@swisspost/design-system-components 10.0.0-next.39 → 10.0.0-next.41
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/dist/cjs/breakpoints-DIH5Oaz7.js +186 -0
- package/dist/cjs/event-from-AKK8RQrn.js +107 -0
- package/dist/cjs/{get-root-8102fecd.js → get-root-DmyBVSJ_.js} +1 -1
- package/dist/cjs/{index-b60129c4.js → index-CRMt-jq2.js} +1172 -313
- package/dist/cjs/index.cjs.js +0 -72
- package/dist/cjs/loader.cjs.js +3 -6
- package/dist/cjs/{package-29dc73af.js → package-C2pR6Vs2.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +183 -0
- package/dist/cjs/post-avatar.cjs.entry.js +151 -8
- package/dist/cjs/post-back-to-top.cjs.entry.js +86 -9
- package/dist/cjs/post-banner.cjs.entry.js +81 -9
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +62 -8
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +119 -7
- package/dist/cjs/post-card-control.cjs.entry.js +283 -8
- package/dist/cjs/post-closebutton_15.cjs.entry.js +4376 -30
- package/dist/cjs/post-collapsible_2.cjs.entry.js +196 -10
- package/dist/cjs/post-components.cjs.js +7 -8
- package/dist/cjs/post-footer.cjs.entry.js +59 -8
- package/dist/cjs/post-linkarea.cjs.entry.js +24 -6
- package/dist/cjs/post-popover.cjs.entry.js +151 -8
- package/dist/cjs/post-rating.cjs.entry.js +115 -8
- package/dist/cjs/post-tab-header.cjs.entry.js +26 -9
- package/dist/cjs/post-tab-panel.cjs.entry.js +28 -9
- package/dist/cjs/post-tabs.cjs.entry.js +165 -7
- package/dist/cjs/post-tag.cjs.entry.js +50 -8
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +5195 -7
- package/dist/cjs/post-tooltip.cjs.entry.js +78 -9
- package/dist/collection/collection-manifest.json +4 -4
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +39 -23
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +26 -12
- package/dist/collection/components/post-avatar/post-avatar.js +12 -9
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +4 -3
- package/dist/collection/components/post-banner/post-banner.js +18 -9
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +4 -6
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +13 -9
- package/dist/collection/components/post-card-control/post-card-control.js +33 -16
- package/dist/collection/components/post-collapsible/post-collapsible.js +6 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +21 -9
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +35 -15
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +28 -16
- package/dist/collection/components/post-icon/post-icon.js +66 -54
- package/dist/collection/components/post-language-option/post-language-option.css +1 -1
- package/dist/collection/components/post-language-option/post-language-option.js +17 -13
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -1
- package/dist/collection/components/post-language-switch/post-language-switch.js +43 -24
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-list/post-list.js +13 -4
- package/dist/collection/components/post-list-item/post-list-item.js +1 -1
- package/dist/collection/components/post-logo/post-logo.js +4 -5
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +12 -6
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +34 -20
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +43 -21
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -0
- package/dist/collection/components/post-menu-item/post-menu-item.js +11 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +9 -5
- package/dist/collection/components/post-popover/post-popover.js +20 -6
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +44 -16
- package/dist/collection/components/post-rating/post-rating.js +26 -6
- package/dist/collection/components/post-tab-header/post-tab-header.js +4 -6
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +4 -6
- package/dist/collection/components/post-tabs/post-tabs.js +4 -3
- package/dist/collection/components/post-tag/post-tag.js +11 -9
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +8 -3
- package/dist/collection/components/post-tooltip/post-tooltip.js +25 -7
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +20 -12
- package/dist/collection/index.js +1 -37
- package/dist/collection/utils/breakpoints.js +38 -45
- package/dist/collection/utils/event-from.js +103 -0
- package/dist/collection/utils/index.js +1 -1
- package/dist/components/index.js +2315 -37
- package/dist/components/p-1KLiMO0w.js +3 -0
- package/dist/components/p-8U5GFtQP.js +105 -0
- package/dist/components/{post-menu2.js → p-BLhBouGz.js} +51 -30
- package/dist/{esm/index-ffccd040.js → components/p-CV7fm1rW.js} +1 -1
- package/dist/components/{post-menu-trigger2.js → p-CaPj3whI.js} +14 -12
- package/dist/components/{post-breadcrumb-item2.js → p-Cpaqct04.js} +9 -11
- package/dist/components/p-CtNCtg2z.js +114 -0
- package/dist/components/p-Cx0AiN2A.js +182 -0
- package/{loaders/post-collapsible-trigger2.js → dist/components/p-D3LhzIrC.js} +25 -14
- package/dist/components/{get-root.js → p-DBHo9yGF.js} +1 -1
- package/dist/components/p-DQuPPEca.js +31 -0
- package/dist/components/{post-accordion2.js → p-DlEtlaNu.js} +42 -29
- package/dist/components/{post-collapsible2.js → p-DphlfQse.js} +11 -8
- package/dist/components/{post-popovercontainer2.js → p-elg4VvHg.js} +246 -278
- package/{loaders/post-icon2.js → dist/components/p-fmA57Ivd.js} +52 -54
- package/dist/components/post-accordion-item.js +1 -1
- package/dist/components/post-accordion.js +1 -1
- package/dist/components/post-avatar.js +183 -1
- package/dist/components/post-back-to-top.js +115 -1
- package/dist/components/post-banner.js +120 -1
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumbs.js +182 -1
- package/dist/components/post-card-control.js +322 -1
- package/dist/components/post-closebutton.js +37 -1
- package/dist/components/post-collapsible-trigger.js +1 -1
- package/dist/components/post-collapsible.js +1 -1
- package/dist/components/post-footer.js +112 -1
- package/dist/components/post-header.js +273 -1
- package/dist/components/post-icon.js +1 -1
- package/dist/components/post-language-option.js +96 -1
- package/dist/components/post-language-switch.js +154 -1
- package/dist/components/post-linkarea.js +41 -1
- package/dist/components/post-list-item.js +34 -1
- package/dist/components/post-list.js +57 -1
- package/dist/components/post-logo.js +54 -1
- package/dist/components/post-mainnavigation.js +181 -1
- package/dist/components/post-megadropdown-trigger.js +132 -1
- package/dist/components/post-megadropdown.js +194 -1
- package/dist/components/post-menu-item.js +1 -1
- package/dist/components/post-menu-trigger.js +1 -1
- package/dist/components/post-menu.js +1 -1
- package/dist/components/post-popover.js +184 -1
- package/dist/components/post-popovercontainer.js +1 -1
- package/dist/components/post-rating.js +148 -1
- package/dist/components/post-tab-header.js +48 -1
- package/dist/components/post-tab-panel.js +50 -1
- package/dist/components/post-tabs.js +186 -1
- package/dist/components/post-tag.js +82 -1
- package/dist/components/post-togglebutton.js +52 -1
- package/dist/components/post-tooltip-trigger.js +5218 -1
- package/dist/components/post-tooltip.js +110 -1
- package/dist/docs.d.ts +8 -0
- package/dist/docs.json +426 -118
- package/dist/esm/breakpoints-DyVir0ex.js +182 -0
- package/dist/esm/event-from-8U5GFtQP.js +105 -0
- package/{loaders/get-root.js → dist/esm/get-root-D9QC9-TY.js} +1 -1
- package/{loaders/index2.js → dist/esm/index-BWC0gtGU.js} +1 -1
- package/dist/esm/{index-f4d19816.js → index-CVhzhVv0.js} +1169 -309
- package/dist/esm/index.js +1 -31
- package/dist/esm/loader.js +3 -4
- package/dist/esm/package-1KLiMO0w.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +180 -0
- package/dist/esm/post-avatar.entry.js +154 -5
- package/dist/esm/post-back-to-top.entry.js +89 -6
- package/dist/esm/post-banner.entry.js +85 -7
- package/dist/esm/post-breadcrumb-item_2.entry.js +65 -5
- package/dist/esm/post-breadcrumbs.entry.js +123 -5
- package/dist/esm/post-card-control.entry.js +286 -5
- package/dist/esm/post-closebutton_15.entry.js +4362 -10
- package/dist/esm/post-collapsible_2.entry.js +199 -7
- package/dist/esm/post-components.js +5 -5
- package/dist/esm/post-footer.entry.js +62 -5
- package/dist/esm/post-linkarea.entry.js +27 -3
- package/dist/esm/post-popover.entry.js +155 -6
- package/dist/esm/post-rating.entry.js +118 -5
- package/dist/esm/post-tab-header.entry.js +29 -6
- package/dist/esm/post-tab-panel.entry.js +31 -6
- package/dist/esm/post-tabs.entry.js +169 -5
- package/dist/esm/post-tag.entry.js +53 -5
- package/dist/esm/post-tooltip-trigger.entry.js +5199 -5
- package/dist/esm/post-tooltip.entry.js +81 -6
- package/dist/post-components/index.esm.js +0 -1
- package/dist/post-components/p-0d08ab13.entry.js +1 -0
- package/dist/post-components/p-1KLiMO0w.js +1 -0
- package/dist/post-components/p-1e006e29.entry.js +1 -0
- package/dist/post-components/p-3a5bdb7f.entry.js +1 -0
- package/dist/post-components/p-4214b85e.entry.js +1 -0
- package/dist/post-components/p-50916d48.entry.js +1 -0
- package/dist/post-components/p-5f4126d8.entry.js +1 -0
- package/dist/post-components/p-62982420.entry.js +1 -0
- package/dist/post-components/p-78f4dd12.entry.js +1 -0
- package/dist/post-components/p-7a7d237b.entry.js +1 -0
- package/dist/post-components/p-80174475.entry.js +1 -0
- package/dist/post-components/p-8U5GFtQP.js +1 -0
- package/dist/post-components/p-8d5a4218.entry.js +1 -0
- package/dist/post-components/p-8e89ccc1.entry.js +1 -0
- package/dist/post-components/p-9003674b.entry.js +1 -0
- package/dist/post-components/p-925aee3d.entry.js +1 -0
- package/dist/post-components/p-9b446561.entry.js +1 -0
- package/dist/post-components/p-9ec29527.entry.js +1 -0
- package/dist/post-components/{p-b176309b.js → p-BWC0gtGU.js} +1 -1
- package/dist/post-components/{p-6b31a76a.js → p-Bkp2QDth.js} +1 -1
- package/dist/post-components/p-CVhzhVv0.js +2 -0
- package/dist/post-components/p-DyVir0ex.js +1 -0
- package/dist/post-components/p-ec764922.entry.js +1 -0
- package/dist/post-components/p-fa550b4a.entry.js +1 -0
- package/dist/post-components/p-fb46e260.entry.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-footer/post-footer.d.ts +7 -3
- package/dist/types/components/post-header/post-header.d.ts +1 -0
- package/dist/types/components/post-icon/post-icon.d.ts +0 -4
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +1 -0
- package/dist/types/components/post-tag/post-tag.d.ts +1 -1
- package/dist/types/components.d.ts +61 -1
- package/dist/types/index.d.ts +10 -37
- package/dist/types/stencil-public-runtime.d.ts +29 -1
- package/dist/types/utils/breakpoints.d.ts +12 -7
- package/dist/types/utils/event-from.d.ts +9 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/hydrate/index.d.ts +273 -0
- package/hydrate/index.js +32002 -0
- package/hydrate/index.mjs +31994 -0
- package/hydrate/package.json +12 -0
- package/package.json +45 -17
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/breakpoints-cdf1b747.js +0 -59
- package/dist/cjs/event-guard-efabc84f.js +0 -47
- package/dist/cjs/heading-levels-608d432e.js +0 -5
- package/dist/cjs/post-accordion-c433c493.js +0 -105
- package/dist/cjs/post-accordion-item-8d5a301d.js +0 -64
- package/dist/cjs/post-accordion-item.cjs.entry.js +0 -16
- package/dist/cjs/post-accordion.cjs.entry.js +0 -15
- package/dist/cjs/post-avatar-421043df.js +0 -162
- package/dist/cjs/post-back-to-top-3cca3803.js +0 -93
- package/dist/cjs/post-banner-2e99c9d8.js +0 -87
- package/dist/cjs/post-breadcrumbs-1be50860.js +0 -126
- package/dist/cjs/post-card-control-0bfdad92.js +0 -290
- package/dist/cjs/post-collapsible-trigger-4180b218.js +0 -190
- package/dist/cjs/post-footer-92adffac.js +0 -48
- package/dist/cjs/post-linkarea-26c457b3.js +0 -30
- package/dist/cjs/post-menu-item-d0a53c84.js +0 -68
- package/dist/cjs/post-popover-36cead3d.js +0 -150
- package/dist/cjs/post-rating-f50a9939.js +0 -109
- package/dist/cjs/post-tab-header-f47508da.js +0 -34
- package/dist/cjs/post-tab-panel-7c51798b.js +0 -36
- package/dist/cjs/post-tabs-2debea01.js +0 -173
- package/dist/cjs/post-tag-ac62c57f.js +0 -60
- package/dist/cjs/post-togglebutton-43c46511.js +0 -4491
- package/dist/cjs/post-tooltip-b7dcfb44.js +0 -74
- package/dist/cjs/post-tooltip-trigger-904061b6.js +0 -4685
- package/dist/collection/utils/event-guard.js +0 -43
- package/dist/components/breakpoints.js +0 -56
- package/dist/components/event-guard.js +0 -45
- package/dist/components/index2.js +0 -88
- package/dist/components/package.js +0 -3
- package/dist/components/post-accordion-item2.js +0 -103
- package/dist/components/post-avatar2.js +0 -190
- package/dist/components/post-back-to-top2.js +0 -118
- package/dist/components/post-banner2.js +0 -121
- package/dist/components/post-breadcrumbs2.js +0 -184
- package/dist/components/post-card-control2.js +0 -325
- package/dist/components/post-closebutton2.js +0 -39
- package/dist/components/post-collapsible-trigger2.js +0 -125
- package/dist/components/post-footer2.js +0 -90
- package/dist/components/post-header2.js +0 -397
- package/dist/components/post-icon2.js +0 -156
- package/dist/components/post-language-option2.js +0 -102
- package/dist/components/post-language-switch2.js +0 -143
- package/dist/components/post-linkarea2.js +0 -43
- package/dist/components/post-list-item2.js +0 -36
- package/dist/components/post-list2.js +0 -54
- package/dist/components/post-logo2.js +0 -57
- package/dist/components/post-mainnavigation2.js +0 -183
- package/dist/components/post-megadropdown-trigger2.js +0 -121
- package/dist/components/post-megadropdown2.js +0 -190
- package/dist/components/post-menu-item2.js +0 -27
- package/dist/components/post-popover2.js +0 -178
- package/dist/components/post-rating2.js +0 -138
- package/dist/components/post-tab-header2.js +0 -52
- package/dist/components/post-tab-panel2.js +0 -54
- package/dist/components/post-tabs2.js +0 -189
- package/dist/components/post-tag2.js +0 -88
- package/dist/components/post-togglebutton2.js +0 -51
- package/dist/components/post-tooltip-trigger2.js +0 -4703
- package/dist/components/post-tooltip2.js +0 -102
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/breakpoints-7812702e.js +0 -56
- package/dist/esm/event-guard-538ee077.js +0 -45
- package/dist/esm/get-root-1b1af46f.js +0 -15
- package/dist/esm/heading-levels-5b7b4349.js +0 -3
- package/dist/esm/package-8503eaa8.js +0 -3
- package/dist/esm/post-accordion-9365faca.js +0 -103
- package/dist/esm/post-accordion-item-2dc8e3b7.js +0 -62
- package/dist/esm/post-accordion-item.entry.js +0 -8
- package/dist/esm/post-accordion.entry.js +0 -7
- package/dist/esm/post-avatar-4f73dc4d.js +0 -160
- package/dist/esm/post-back-to-top-8f759d32.js +0 -91
- package/dist/esm/post-banner-ad979275.js +0 -85
- package/dist/esm/post-breadcrumbs-a20336c7.js +0 -124
- package/dist/esm/post-card-control-3c77e778.js +0 -288
- package/dist/esm/post-collapsible-trigger-5fd0e193.js +0 -187
- package/dist/esm/post-footer-3e117b5a.js +0 -46
- package/dist/esm/post-linkarea-16a14609.js +0 -28
- package/dist/esm/post-menu-item-b1604fe4.js +0 -65
- package/dist/esm/post-popover-49096648.js +0 -148
- package/dist/esm/post-rating-405bee8f.js +0 -107
- package/dist/esm/post-tab-header-b228c217.js +0 -32
- package/dist/esm/post-tab-panel-98110b64.js +0 -34
- package/dist/esm/post-tabs-44d9313c.js +0 -171
- package/dist/esm/post-tag-99cc9616.js +0 -58
- package/dist/esm/post-togglebutton-ea73e63f.js +0 -4475
- package/dist/esm/post-tooltip-78cd2988.js +0 -72
- package/dist/esm/post-tooltip-trigger-bdb21c45.js +0 -4683
- package/dist/post-components/p-0889c759.js +0 -1
- package/dist/post-components/p-09dd5aa4.js +0 -1
- package/dist/post-components/p-0f9322e5.js +0 -8
- package/dist/post-components/p-11572299.js +0 -1
- package/dist/post-components/p-19a83519.entry.js +0 -1
- package/dist/post-components/p-1afb3c43.entry.js +0 -1
- package/dist/post-components/p-214cd032.js +0 -1
- package/dist/post-components/p-21e5b028.js +0 -1
- package/dist/post-components/p-2320305b.js +0 -1
- package/dist/post-components/p-247a1668.js +0 -1
- package/dist/post-components/p-2523f97b.entry.js +0 -1
- package/dist/post-components/p-2bd3a436.js +0 -1
- package/dist/post-components/p-2ce8fbf5.js +0 -1
- package/dist/post-components/p-2f879f4e.entry.js +0 -1
- package/dist/post-components/p-33e26845.entry.js +0 -1
- package/dist/post-components/p-38b1c71e.entry.js +0 -1
- package/dist/post-components/p-38d59732.js +0 -1
- package/dist/post-components/p-3a67f1ff.js +0 -1
- package/dist/post-components/p-41450b6c.entry.js +0 -1
- package/dist/post-components/p-4c23ed05.entry.js +0 -1
- package/dist/post-components/p-57746c40.js +0 -1
- package/dist/post-components/p-6313d72e.entry.js +0 -1
- package/dist/post-components/p-64e0b0fc.js +0 -1
- package/dist/post-components/p-658a2e34.entry.js +0 -1
- package/dist/post-components/p-722ffaae.js +0 -1
- package/dist/post-components/p-746d3cd3.entry.js +0 -1
- package/dist/post-components/p-79a2dad0.entry.js +0 -1
- package/dist/post-components/p-7dd1807c.js +0 -1
- package/dist/post-components/p-817fbeaf.js +0 -1
- package/dist/post-components/p-85950200.js +0 -1
- package/dist/post-components/p-8ebecf22.entry.js +0 -1
- package/dist/post-components/p-8ed1cb53.entry.js +0 -1
- package/dist/post-components/p-91244b25.js +0 -1
- package/dist/post-components/p-91675004.js +0 -1
- package/dist/post-components/p-94ebc430.js +0 -1
- package/dist/post-components/p-95727a4f.entry.js +0 -1
- package/dist/post-components/p-9e461613.js +0 -2
- package/dist/post-components/p-a844da3a.entry.js +0 -1
- package/dist/post-components/p-af900651.js +0 -1
- package/dist/post-components/p-b373659e.entry.js +0 -1
- package/dist/post-components/p-b500b245.js +0 -1
- package/dist/post-components/p-bf182745.entry.js +0 -1
- package/dist/post-components/p-c9b6f9e7.entry.js +0 -1
- package/dist/post-components/p-cb7d8f67.entry.js +0 -1
- package/dist/post-components/p-e1255160.js +0 -1
- package/dist/post-components/p-e28eb73a.js +0 -1
- package/dist/types/popover-fn.d.ts +0 -11
- package/dist/types/utils/event-guard.d.ts +0 -4
- package/loader/package.json +0 -11
- package/loaders/breakpoints.js +0 -56
- package/loaders/event-guard.js +0 -45
- package/loaders/fade.js +0 -11
- package/loaders/get-focusable-children.js +0 -35
- package/loaders/heading-levels.js +0 -3
- package/loaders/index.browser.js +0 -14
- package/loaders/index.d.ts +0 -108
- package/loaders/index.js +0 -39
- package/loaders/long-press-event.js +0 -264
- package/loaders/package.js +0 -3
- package/loaders/post-accordion-item.d.ts +0 -11
- package/loaders/post-accordion-item.js +0 -6
- package/loaders/post-accordion-item2.js +0 -103
- package/loaders/post-accordion.d.ts +0 -11
- package/loaders/post-accordion.js +0 -129
- package/loaders/post-avatar.d.ts +0 -11
- package/loaders/post-avatar.js +0 -193
- package/loaders/post-back-to-top.d.ts +0 -11
- package/loaders/post-back-to-top.js +0 -121
- package/loaders/post-banner.d.ts +0 -11
- package/loaders/post-banner.js +0 -124
- package/loaders/post-breadcrumb-item.d.ts +0 -11
- package/loaders/post-breadcrumb-item.js +0 -6
- package/loaders/post-breadcrumb-item2.js +0 -82
- package/loaders/post-breadcrumbs.d.ts +0 -11
- package/loaders/post-breadcrumbs.js +0 -187
- package/loaders/post-card-control.d.ts +0 -11
- package/loaders/post-card-control.js +0 -328
- package/loaders/post-closebutton.d.ts +0 -11
- package/loaders/post-closebutton.js +0 -42
- package/loaders/post-collapsible-trigger.d.ts +0 -11
- package/loaders/post-collapsible-trigger.js +0 -6
- package/loaders/post-collapsible.d.ts +0 -11
- package/loaders/post-collapsible.js +0 -6
- package/loaders/post-collapsible2.js +0 -108
- package/loaders/post-footer.d.ts +0 -11
- package/loaders/post-footer.js +0 -93
- package/loaders/post-header.d.ts +0 -11
- package/loaders/post-header.js +0 -400
- package/loaders/post-icon.d.ts +0 -11
- package/loaders/post-icon.js +0 -6
- package/loaders/post-language-option.d.ts +0 -11
- package/loaders/post-language-option.js +0 -105
- package/loaders/post-language-switch.d.ts +0 -11
- package/loaders/post-language-switch.js +0 -146
- package/loaders/post-linkarea.d.ts +0 -11
- package/loaders/post-linkarea.js +0 -46
- package/loaders/post-list-item.d.ts +0 -11
- package/loaders/post-list-item.js +0 -39
- package/loaders/post-list.d.ts +0 -11
- package/loaders/post-list.js +0 -57
- package/loaders/post-logo.d.ts +0 -11
- package/loaders/post-logo.js +0 -60
- package/loaders/post-mainnavigation.d.ts +0 -11
- package/loaders/post-mainnavigation.js +0 -186
- package/loaders/post-megadropdown-trigger.d.ts +0 -11
- package/loaders/post-megadropdown-trigger.js +0 -124
- package/loaders/post-megadropdown.d.ts +0 -11
- package/loaders/post-megadropdown.js +0 -193
- package/loaders/post-menu-item.d.ts +0 -11
- package/loaders/post-menu-item.js +0 -6
- package/loaders/post-menu-item2.js +0 -27
- package/loaders/post-menu-trigger.d.ts +0 -11
- package/loaders/post-menu-trigger.js +0 -6
- package/loaders/post-menu-trigger2.js +0 -109
- package/loaders/post-menu.d.ts +0 -11
- package/loaders/post-menu.js +0 -6
- package/loaders/post-menu2.js +0 -202
- package/loaders/post-popover.d.ts +0 -11
- package/loaders/post-popover.js +0 -181
- package/loaders/post-popovercontainer.d.ts +0 -11
- package/loaders/post-popovercontainer.js +0 -6
- package/loaders/post-popovercontainer2.js +0 -3051
- package/loaders/post-rating.d.ts +0 -11
- package/loaders/post-rating.js +0 -141
- package/loaders/post-tab-header.d.ts +0 -11
- package/loaders/post-tab-header.js +0 -55
- package/loaders/post-tab-panel.d.ts +0 -11
- package/loaders/post-tab-panel.js +0 -57
- package/loaders/post-tabs.d.ts +0 -11
- package/loaders/post-tabs.js +0 -192
- package/loaders/post-tag.d.ts +0 -11
- package/loaders/post-tag.js +0 -91
- package/loaders/post-togglebutton.d.ts +0 -11
- package/loaders/post-togglebutton.js +0 -54
- package/loaders/post-tooltip-trigger.d.ts +0 -11
- package/loaders/post-tooltip-trigger.js +0 -4706
- package/loaders/post-tooltip.d.ts +0 -11
- package/loaders/post-tooltip.js +0 -105
- package/loaders/slide.js +0 -25
- package/loaders/switch-variants.js +0 -3
- /package/dist/cjs/{fade-72d5ef55.js → fade-nS5zzDQS.js} +0 -0
- /package/dist/cjs/{index-2b2b85e5.js → index-DtvYdwe1.js} +0 -0
- /package/dist/cjs/{index.browser-4af21c17.js → index.browser-Doj636JV.js} +0 -0
- /package/dist/cjs/{long-press-event-6e62d113.js → long-press-event-Q8jMUNXD.js} +0 -0
- /package/dist/cjs/{placement-b2bb6ec4.js → placement-qEFR9hmI.js} +0 -0
- /package/dist/cjs/{slide-cd1f09b3.js → slide-CbBL7A8w.js} +0 -0
- /package/dist/components/{index.browser.js → p-BLchVpF6.js} +0 -0
- /package/dist/components/{slide.js → p-BuLMaH5t.js} +0 -0
- /package/dist/components/{get-focusable-children.js → p-C35MCWIp.js} +0 -0
- /package/dist/components/{long-press-event.js → p-C_2k3G1c.js} +0 -0
- /package/dist/components/{switch-variants.js → p-DjIHLduJ.js} +0 -0
- /package/dist/components/{fade.js → p-SbIC4aZX.js} +0 -0
- /package/dist/components/{heading-levels.js → p-r4txK0AC.js} +0 -0
- /package/dist/esm/{fade-1f3cacf4.js → fade-SbIC4aZX.js} +0 -0
- /package/dist/esm/{index.browser-ff103197.js → index.browser-BLchVpF6.js} +0 -0
- /package/dist/esm/{long-press-event-04d24397.js → long-press-event-C_2k3G1c.js} +0 -0
- /package/dist/esm/{placement-8d56605d.js → placement-DRiVosES.js} +0 -0
- /package/dist/esm/{slide-cd2850ee.js → slide-BuLMaH5t.js} +0 -0
- /package/dist/post-components/{p-c65f32b0.js → p-BLchVpF6.js} +0 -0
- /package/dist/post-components/{p-9b052461.js → p-BuLMaH5t.js} +0 -0
- /package/dist/post-components/{p-8db32dab.js → p-C_2k3G1c.js} +0 -0
- /package/dist/post-components/{p-59a38c23.js → p-DRiVosES.js} +0 -0
- /package/dist/post-components/{p-64e3de38.js → p-SbIC4aZX.js} +0 -0
|
@@ -1,4683 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-f4d19816.js';
|
|
2
|
-
import { I as IS_BROWSER } from './breakpoints-7812702e.js';
|
|
3
|
-
import { d as checkEmptyOrType } from './index-ffccd040.js';
|
|
4
|
-
import { v as version$1 } from './package-8503eaa8.js';
|
|
5
|
-
|
|
6
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
7
|
-
|
|
8
|
-
function getDefaultExportFromCjs (x) {
|
|
9
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
var focusable = {exports: {}};
|
|
13
|
-
|
|
14
|
-
var focusRelevant = {exports: {}};
|
|
15
|
-
|
|
16
|
-
var parents = {exports: {}};
|
|
17
|
-
|
|
18
|
-
var contextToElement = {exports: {}};
|
|
19
|
-
|
|
20
|
-
var nodeArray = {exports: {}};
|
|
21
|
-
|
|
22
|
-
(function (module, exports) {
|
|
23
|
-
|
|
24
|
-
Object.defineProperty(exports, "__esModule", {
|
|
25
|
-
value: true
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
exports.default = function (input) {
|
|
29
|
-
if (!input) {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (Array.isArray(input)) {
|
|
34
|
-
return input;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// instanceof Node - does not work with iframes
|
|
38
|
-
if (input.nodeType !== undefined) {
|
|
39
|
-
return [input];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (typeof input === 'string') {
|
|
43
|
-
input = document.querySelectorAll(input);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (input.length !== undefined) {
|
|
47
|
-
return [].slice.call(input, 0);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
throw new TypeError('unexpected input ' + String(input));
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
module.exports = exports['default'];
|
|
54
|
-
// input may be undefined, selector-tring, Node, NodeList, HTMLCollection, array of Nodes
|
|
55
|
-
// yes, to some extent this is a bad replica of jQuery's constructor function
|
|
56
|
-
|
|
57
|
-
}(nodeArray, nodeArray.exports));
|
|
58
|
-
|
|
59
|
-
(function (module, exports) {
|
|
60
|
-
|
|
61
|
-
Object.defineProperty(exports, "__esModule", {
|
|
62
|
-
value: true
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
exports.default = function (_ref) {
|
|
66
|
-
var context = _ref.context,
|
|
67
|
-
_ref$label = _ref.label,
|
|
68
|
-
label = _ref$label === undefined ? 'context-to-element' : _ref$label,
|
|
69
|
-
resolveDocument = _ref.resolveDocument,
|
|
70
|
-
defaultToDocument = _ref.defaultToDocument;
|
|
71
|
-
|
|
72
|
-
var element = (0, _nodeArray2.default)(context)[0];
|
|
73
|
-
|
|
74
|
-
if (resolveDocument && element && element.nodeType === Node.DOCUMENT_NODE) {
|
|
75
|
-
element = element.documentElement;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (!element && defaultToDocument) {
|
|
79
|
-
return document.documentElement;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (!element) {
|
|
83
|
-
throw new TypeError(label + ' requires valid options.context');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (element.nodeType !== Node.ELEMENT_NODE && element.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {
|
|
87
|
-
throw new TypeError(label + ' requires options.context to be an Element');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return element;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
var _nodeArray = nodeArray.exports;
|
|
94
|
-
|
|
95
|
-
var _nodeArray2 = _interopRequireDefault(_nodeArray);
|
|
96
|
-
|
|
97
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
98
|
-
|
|
99
|
-
module.exports = exports['default'];
|
|
100
|
-
|
|
101
|
-
}(contextToElement, contextToElement.exports));
|
|
102
|
-
|
|
103
|
-
(function (module, exports) {
|
|
104
|
-
|
|
105
|
-
Object.defineProperty(exports, "__esModule", {
|
|
106
|
-
value: true
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
exports.default = function () {
|
|
110
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
111
|
-
context = _ref.context;
|
|
112
|
-
|
|
113
|
-
var list = [];
|
|
114
|
-
var element = (0, _contextToElement2.default)({
|
|
115
|
-
label: 'get/parents',
|
|
116
|
-
context: context
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
while (element) {
|
|
120
|
-
list.push(element);
|
|
121
|
-
// IE does know support parentElement on SVGElement
|
|
122
|
-
element = element.parentNode;
|
|
123
|
-
if (element && element.nodeType !== Node.ELEMENT_NODE) {
|
|
124
|
-
element = null;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return list;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
var _contextToElement = contextToElement.exports;
|
|
132
|
-
|
|
133
|
-
var _contextToElement2 = _interopRequireDefault(_contextToElement);
|
|
134
|
-
|
|
135
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
136
|
-
|
|
137
|
-
module.exports = exports['default'];
|
|
138
|
-
|
|
139
|
-
// [elem, elem.parent, elem.parent.parent, …, html]
|
|
140
|
-
// will not contain the shadowRoot (DOCUMENT_FRAGMENT_NODE) and shadowHost
|
|
141
|
-
|
|
142
|
-
}(parents, parents.exports));
|
|
143
|
-
|
|
144
|
-
var elementMatches = {exports: {}};
|
|
145
|
-
|
|
146
|
-
(function (module, exports) {
|
|
147
|
-
|
|
148
|
-
Object.defineProperty(exports, "__esModule", {
|
|
149
|
-
value: true
|
|
150
|
-
});
|
|
151
|
-
exports.default = elementMatches;
|
|
152
|
-
|
|
153
|
-
// Element.prototype.matches may be available at a different name
|
|
154
|
-
// https://developer.mozilla.org/en/docs/Web/API/Element/matches
|
|
155
|
-
|
|
156
|
-
var names = ['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector'];
|
|
157
|
-
var name = null;
|
|
158
|
-
|
|
159
|
-
function findMethodName(element) {
|
|
160
|
-
names.some(function (_name) {
|
|
161
|
-
if (!element[_name]) {
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
name = _name;
|
|
166
|
-
return true;
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function elementMatches(element, selector) {
|
|
171
|
-
if (!name) {
|
|
172
|
-
findMethodName(element);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return element[name](selector);
|
|
176
|
-
}
|
|
177
|
-
module.exports = exports['default'];
|
|
178
|
-
|
|
179
|
-
}(elementMatches, elementMatches.exports));
|
|
180
|
-
|
|
181
|
-
var tabindexValue = {exports: {}};
|
|
182
|
-
|
|
183
|
-
var validTabindex = {exports: {}};
|
|
184
|
-
|
|
185
|
-
var supports = {exports: {}};
|
|
186
|
-
|
|
187
|
-
var detectFocus = {exports: {}};
|
|
188
|
-
|
|
189
|
-
var platform$1 = {exports: {}};
|
|
190
|
-
|
|
191
|
-
var platform = {exports: {}};
|
|
192
|
-
|
|
193
|
-
/*!
|
|
194
|
-
* Platform.js <https://mths.be/platform>
|
|
195
|
-
* Copyright 2014-2016 Benjamin Tan <https://demoneaux.github.io/>
|
|
196
|
-
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
|
|
197
|
-
* Available under MIT license <https://mths.be/mit>
|
|
198
|
-
*/
|
|
199
|
-
|
|
200
|
-
(function (module, exports) {
|
|
201
|
-
(function() {
|
|
202
|
-
|
|
203
|
-
/** Used to determine if values are of the language type `Object`. */
|
|
204
|
-
var objectTypes = {
|
|
205
|
-
'function': true,
|
|
206
|
-
'object': true
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
/** Used as a reference to the global object. */
|
|
210
|
-
var root = (objectTypes[typeof window] && window) || this;
|
|
211
|
-
|
|
212
|
-
/** Backup possible global object. */
|
|
213
|
-
var oldRoot = root;
|
|
214
|
-
|
|
215
|
-
/** Detect free variable `exports`. */
|
|
216
|
-
var freeExports = exports;
|
|
217
|
-
|
|
218
|
-
/** Detect free variable `module`. */
|
|
219
|
-
var freeModule = module && !module.nodeType && module;
|
|
220
|
-
|
|
221
|
-
/** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */
|
|
222
|
-
var freeGlobal = freeExports && freeModule && typeof commonjsGlobal == 'object' && commonjsGlobal;
|
|
223
|
-
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
|
|
224
|
-
root = freeGlobal;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Used as the maximum length of an array-like object.
|
|
229
|
-
* See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
|
|
230
|
-
* for more details.
|
|
231
|
-
*/
|
|
232
|
-
var maxSafeInteger = Math.pow(2, 53) - 1;
|
|
233
|
-
|
|
234
|
-
/** Regular expression to detect Opera. */
|
|
235
|
-
var reOpera = /\bOpera/;
|
|
236
|
-
|
|
237
|
-
/** Possible global object. */
|
|
238
|
-
var thisBinding = this;
|
|
239
|
-
|
|
240
|
-
/** Used for native method references. */
|
|
241
|
-
var objectProto = Object.prototype;
|
|
242
|
-
|
|
243
|
-
/** Used to check for own properties of an object. */
|
|
244
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
245
|
-
|
|
246
|
-
/** Used to resolve the internal `[[Class]]` of values. */
|
|
247
|
-
var toString = objectProto.toString;
|
|
248
|
-
|
|
249
|
-
/*--------------------------------------------------------------------------*/
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Capitalizes a string value.
|
|
253
|
-
*
|
|
254
|
-
* @private
|
|
255
|
-
* @param {string} string The string to capitalize.
|
|
256
|
-
* @returns {string} The capitalized string.
|
|
257
|
-
*/
|
|
258
|
-
function capitalize(string) {
|
|
259
|
-
string = String(string);
|
|
260
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* A utility function to clean up the OS name.
|
|
265
|
-
*
|
|
266
|
-
* @private
|
|
267
|
-
* @param {string} os The OS name to clean up.
|
|
268
|
-
* @param {string} [pattern] A `RegExp` pattern matching the OS name.
|
|
269
|
-
* @param {string} [label] A label for the OS.
|
|
270
|
-
*/
|
|
271
|
-
function cleanupOS(os, pattern, label) {
|
|
272
|
-
// Platform tokens are defined at:
|
|
273
|
-
// http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
274
|
-
// http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
|
|
275
|
-
var data = {
|
|
276
|
-
'10.0': '10',
|
|
277
|
-
'6.4': '10 Technical Preview',
|
|
278
|
-
'6.3': '8.1',
|
|
279
|
-
'6.2': '8',
|
|
280
|
-
'6.1': 'Server 2008 R2 / 7',
|
|
281
|
-
'6.0': 'Server 2008 / Vista',
|
|
282
|
-
'5.2': 'Server 2003 / XP 64-bit',
|
|
283
|
-
'5.1': 'XP',
|
|
284
|
-
'5.01': '2000 SP1',
|
|
285
|
-
'5.0': '2000',
|
|
286
|
-
'4.0': 'NT',
|
|
287
|
-
'4.90': 'ME'
|
|
288
|
-
};
|
|
289
|
-
// Detect Windows version from platform tokens.
|
|
290
|
-
if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) &&
|
|
291
|
-
(data = data[/[\d.]+$/.exec(os)])) {
|
|
292
|
-
os = 'Windows ' + data;
|
|
293
|
-
}
|
|
294
|
-
// Correct character case and cleanup string.
|
|
295
|
-
os = String(os);
|
|
296
|
-
|
|
297
|
-
if (pattern && label) {
|
|
298
|
-
os = os.replace(RegExp(pattern, 'i'), label);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
os = format(
|
|
302
|
-
os.replace(/ ce$/i, ' CE')
|
|
303
|
-
.replace(/\bhpw/i, 'web')
|
|
304
|
-
.replace(/\bMacintosh\b/, 'Mac OS')
|
|
305
|
-
.replace(/_PowerPC\b/i, ' OS')
|
|
306
|
-
.replace(/\b(OS X) [^ \d]+/i, '$1')
|
|
307
|
-
.replace(/\bMac (OS X)\b/, '$1')
|
|
308
|
-
.replace(/\/(\d)/, ' $1')
|
|
309
|
-
.replace(/_/g, '.')
|
|
310
|
-
.replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '')
|
|
311
|
-
.replace(/\bx86\.64\b/gi, 'x86_64')
|
|
312
|
-
.replace(/\b(Windows Phone) OS\b/, '$1')
|
|
313
|
-
.replace(/\b(Chrome OS \w+) [\d.]+\b/, '$1')
|
|
314
|
-
.split(' on ')[0]
|
|
315
|
-
);
|
|
316
|
-
|
|
317
|
-
return os;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* An iteration utility for arrays and objects.
|
|
322
|
-
*
|
|
323
|
-
* @private
|
|
324
|
-
* @param {Array|Object} object The object to iterate over.
|
|
325
|
-
* @param {Function} callback The function called per iteration.
|
|
326
|
-
*/
|
|
327
|
-
function each(object, callback) {
|
|
328
|
-
var index = -1,
|
|
329
|
-
length = object ? object.length : 0;
|
|
330
|
-
|
|
331
|
-
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
|
|
332
|
-
while (++index < length) {
|
|
333
|
-
callback(object[index], index, object);
|
|
334
|
-
}
|
|
335
|
-
} else {
|
|
336
|
-
forOwn(object, callback);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Trim and conditionally capitalize string values.
|
|
342
|
-
*
|
|
343
|
-
* @private
|
|
344
|
-
* @param {string} string The string to format.
|
|
345
|
-
* @returns {string} The formatted string.
|
|
346
|
-
*/
|
|
347
|
-
function format(string) {
|
|
348
|
-
string = trim(string);
|
|
349
|
-
return /^(?:webOS|i(?:OS|P))/.test(string)
|
|
350
|
-
? string
|
|
351
|
-
: capitalize(string);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Iterates over an object's own properties, executing the `callback` for each.
|
|
356
|
-
*
|
|
357
|
-
* @private
|
|
358
|
-
* @param {Object} object The object to iterate over.
|
|
359
|
-
* @param {Function} callback The function executed per own property.
|
|
360
|
-
*/
|
|
361
|
-
function forOwn(object, callback) {
|
|
362
|
-
for (var key in object) {
|
|
363
|
-
if (hasOwnProperty.call(object, key)) {
|
|
364
|
-
callback(object[key], key, object);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Gets the internal `[[Class]]` of a value.
|
|
371
|
-
*
|
|
372
|
-
* @private
|
|
373
|
-
* @param {*} value The value.
|
|
374
|
-
* @returns {string} The `[[Class]]`.
|
|
375
|
-
*/
|
|
376
|
-
function getClassOf(value) {
|
|
377
|
-
return value == null
|
|
378
|
-
? capitalize(value)
|
|
379
|
-
: toString.call(value).slice(8, -1);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Host objects can return type values that are different from their actual
|
|
384
|
-
* data type. The objects we are concerned with usually return non-primitive
|
|
385
|
-
* types of "object", "function", or "unknown".
|
|
386
|
-
*
|
|
387
|
-
* @private
|
|
388
|
-
* @param {*} object The owner of the property.
|
|
389
|
-
* @param {string} property The property to check.
|
|
390
|
-
* @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`.
|
|
391
|
-
*/
|
|
392
|
-
function isHostType(object, property) {
|
|
393
|
-
var type = object != null ? typeof object[property] : 'number';
|
|
394
|
-
return !/^(?:boolean|number|string|undefined)$/.test(type) &&
|
|
395
|
-
(type == 'object' ? !!object[property] : true);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* Prepares a string for use in a `RegExp` by making hyphens and spaces optional.
|
|
400
|
-
*
|
|
401
|
-
* @private
|
|
402
|
-
* @param {string} string The string to qualify.
|
|
403
|
-
* @returns {string} The qualified string.
|
|
404
|
-
*/
|
|
405
|
-
function qualify(string) {
|
|
406
|
-
return String(string).replace(/([ -])(?!$)/g, '$1?');
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* A bare-bones `Array#reduce` like utility function.
|
|
411
|
-
*
|
|
412
|
-
* @private
|
|
413
|
-
* @param {Array} array The array to iterate over.
|
|
414
|
-
* @param {Function} callback The function called per iteration.
|
|
415
|
-
* @returns {*} The accumulated result.
|
|
416
|
-
*/
|
|
417
|
-
function reduce(array, callback) {
|
|
418
|
-
var accumulator = null;
|
|
419
|
-
each(array, function(value, index) {
|
|
420
|
-
accumulator = callback(accumulator, value, index, array);
|
|
421
|
-
});
|
|
422
|
-
return accumulator;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Removes leading and trailing whitespace from a string.
|
|
427
|
-
*
|
|
428
|
-
* @private
|
|
429
|
-
* @param {string} string The string to trim.
|
|
430
|
-
* @returns {string} The trimmed string.
|
|
431
|
-
*/
|
|
432
|
-
function trim(string) {
|
|
433
|
-
return String(string).replace(/^ +| +$/g, '');
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/*--------------------------------------------------------------------------*/
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Creates a new platform object.
|
|
440
|
-
*
|
|
441
|
-
* @memberOf platform
|
|
442
|
-
* @param {Object|string} [ua=navigator.userAgent] The user agent string or
|
|
443
|
-
* context object.
|
|
444
|
-
* @returns {Object} A platform object.
|
|
445
|
-
*/
|
|
446
|
-
function parse(ua) {
|
|
447
|
-
|
|
448
|
-
/** The environment context object. */
|
|
449
|
-
var context = root;
|
|
450
|
-
|
|
451
|
-
/** Used to flag when a custom context is provided. */
|
|
452
|
-
var isCustomContext = ua && typeof ua == 'object' && getClassOf(ua) != 'String';
|
|
453
|
-
|
|
454
|
-
// Juggle arguments.
|
|
455
|
-
if (isCustomContext) {
|
|
456
|
-
context = ua;
|
|
457
|
-
ua = null;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
/** Browser navigator object. */
|
|
461
|
-
var nav = context.navigator || {};
|
|
462
|
-
|
|
463
|
-
/** Browser user agent string. */
|
|
464
|
-
var userAgent = nav.userAgent || '';
|
|
465
|
-
|
|
466
|
-
ua || (ua = userAgent);
|
|
467
|
-
|
|
468
|
-
/** Used to flag when `thisBinding` is the [ModuleScope]. */
|
|
469
|
-
var isModuleScope = isCustomContext || thisBinding == oldRoot;
|
|
470
|
-
|
|
471
|
-
/** Used to detect if browser is like Chrome. */
|
|
472
|
-
var likeChrome = isCustomContext
|
|
473
|
-
? !!nav.likeChrome
|
|
474
|
-
: /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
|
|
475
|
-
|
|
476
|
-
/** Internal `[[Class]]` value shortcuts. */
|
|
477
|
-
var objectClass = 'Object',
|
|
478
|
-
airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject',
|
|
479
|
-
enviroClass = isCustomContext ? objectClass : 'Environment',
|
|
480
|
-
javaClass = (isCustomContext && context.java) ? 'JavaPackage' : getClassOf(context.java),
|
|
481
|
-
phantomClass = isCustomContext ? objectClass : 'RuntimeObject';
|
|
482
|
-
|
|
483
|
-
/** Detect Java environments. */
|
|
484
|
-
var java = /\bJava/.test(javaClass) && context.java;
|
|
485
|
-
|
|
486
|
-
/** Detect Rhino. */
|
|
487
|
-
var rhino = java && getClassOf(context.environment) == enviroClass;
|
|
488
|
-
|
|
489
|
-
/** A character to represent alpha. */
|
|
490
|
-
var alpha = java ? 'a' : '\u03b1';
|
|
491
|
-
|
|
492
|
-
/** A character to represent beta. */
|
|
493
|
-
var beta = java ? 'b' : '\u03b2';
|
|
494
|
-
|
|
495
|
-
/** Browser document object. */
|
|
496
|
-
var doc = context.document || {};
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
* Detect Opera browser (Presto-based).
|
|
500
|
-
* http://www.howtocreate.co.uk/operaStuff/operaObject.html
|
|
501
|
-
* http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini
|
|
502
|
-
*/
|
|
503
|
-
var opera = context.operamini || context.opera;
|
|
504
|
-
|
|
505
|
-
/** Opera `[[Class]]`. */
|
|
506
|
-
var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera))
|
|
507
|
-
? operaClass
|
|
508
|
-
: (opera = null);
|
|
509
|
-
|
|
510
|
-
/*------------------------------------------------------------------------*/
|
|
511
|
-
|
|
512
|
-
/** Temporary variable used over the script's lifetime. */
|
|
513
|
-
var data;
|
|
514
|
-
|
|
515
|
-
/** The CPU architecture. */
|
|
516
|
-
var arch = ua;
|
|
517
|
-
|
|
518
|
-
/** Platform description array. */
|
|
519
|
-
var description = [];
|
|
520
|
-
|
|
521
|
-
/** Platform alpha/beta indicator. */
|
|
522
|
-
var prerelease = null;
|
|
523
|
-
|
|
524
|
-
/** A flag to indicate that environment features should be used to resolve the platform. */
|
|
525
|
-
var useFeatures = ua == userAgent;
|
|
526
|
-
|
|
527
|
-
/** The browser/environment version. */
|
|
528
|
-
var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
|
|
529
|
-
|
|
530
|
-
/** A flag to indicate if the OS ends with "/ Version" */
|
|
531
|
-
var isSpecialCasedOS;
|
|
532
|
-
|
|
533
|
-
/* Detectable layout engines (order is important). */
|
|
534
|
-
var layout = getLayout([
|
|
535
|
-
{ 'label': 'EdgeHTML', 'pattern': 'Edge' },
|
|
536
|
-
'Trident',
|
|
537
|
-
{ 'label': 'WebKit', 'pattern': 'AppleWebKit' },
|
|
538
|
-
'iCab',
|
|
539
|
-
'Presto',
|
|
540
|
-
'NetFront',
|
|
541
|
-
'Tasman',
|
|
542
|
-
'KHTML',
|
|
543
|
-
'Gecko'
|
|
544
|
-
]);
|
|
545
|
-
|
|
546
|
-
/* Detectable browser names (order is important). */
|
|
547
|
-
var name = getName([
|
|
548
|
-
'Adobe AIR',
|
|
549
|
-
'Arora',
|
|
550
|
-
'Avant Browser',
|
|
551
|
-
'Breach',
|
|
552
|
-
'Camino',
|
|
553
|
-
'Epiphany',
|
|
554
|
-
'Fennec',
|
|
555
|
-
'Flock',
|
|
556
|
-
'Galeon',
|
|
557
|
-
'GreenBrowser',
|
|
558
|
-
'iCab',
|
|
559
|
-
'Iceweasel',
|
|
560
|
-
'K-Meleon',
|
|
561
|
-
'Konqueror',
|
|
562
|
-
'Lunascape',
|
|
563
|
-
'Maxthon',
|
|
564
|
-
{ 'label': 'Microsoft Edge', 'pattern': 'Edge' },
|
|
565
|
-
'Midori',
|
|
566
|
-
'Nook Browser',
|
|
567
|
-
'PaleMoon',
|
|
568
|
-
'PhantomJS',
|
|
569
|
-
'Raven',
|
|
570
|
-
'Rekonq',
|
|
571
|
-
'RockMelt',
|
|
572
|
-
'SeaMonkey',
|
|
573
|
-
{ 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
|
|
574
|
-
'Sleipnir',
|
|
575
|
-
'SlimBrowser',
|
|
576
|
-
{ 'label': 'SRWare Iron', 'pattern': 'Iron' },
|
|
577
|
-
'Sunrise',
|
|
578
|
-
'Swiftfox',
|
|
579
|
-
'WebPositive',
|
|
580
|
-
'Opera Mini',
|
|
581
|
-
{ 'label': 'Opera Mini', 'pattern': 'OPiOS' },
|
|
582
|
-
'Opera',
|
|
583
|
-
{ 'label': 'Opera', 'pattern': 'OPR' },
|
|
584
|
-
'Chrome',
|
|
585
|
-
{ 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' },
|
|
586
|
-
{ 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' },
|
|
587
|
-
{ 'label': 'Firefox for iOS', 'pattern': 'FxiOS' },
|
|
588
|
-
{ 'label': 'IE', 'pattern': 'IEMobile' },
|
|
589
|
-
{ 'label': 'IE', 'pattern': 'MSIE' },
|
|
590
|
-
'Safari'
|
|
591
|
-
]);
|
|
592
|
-
|
|
593
|
-
/* Detectable products (order is important). */
|
|
594
|
-
var product = getProduct([
|
|
595
|
-
{ 'label': 'BlackBerry', 'pattern': 'BB10' },
|
|
596
|
-
'BlackBerry',
|
|
597
|
-
{ 'label': 'Galaxy S', 'pattern': 'GT-I9000' },
|
|
598
|
-
{ 'label': 'Galaxy S2', 'pattern': 'GT-I9100' },
|
|
599
|
-
{ 'label': 'Galaxy S3', 'pattern': 'GT-I9300' },
|
|
600
|
-
{ 'label': 'Galaxy S4', 'pattern': 'GT-I9500' },
|
|
601
|
-
'Google TV',
|
|
602
|
-
'Lumia',
|
|
603
|
-
'iPad',
|
|
604
|
-
'iPod',
|
|
605
|
-
'iPhone',
|
|
606
|
-
'Kindle',
|
|
607
|
-
{ 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
|
|
608
|
-
'Nexus',
|
|
609
|
-
'Nook',
|
|
610
|
-
'PlayBook',
|
|
611
|
-
'PlayStation 3',
|
|
612
|
-
'PlayStation 4',
|
|
613
|
-
'PlayStation Vita',
|
|
614
|
-
'TouchPad',
|
|
615
|
-
'Transformer',
|
|
616
|
-
{ 'label': 'Wii U', 'pattern': 'WiiU' },
|
|
617
|
-
'Wii',
|
|
618
|
-
'Xbox One',
|
|
619
|
-
{ 'label': 'Xbox 360', 'pattern': 'Xbox' },
|
|
620
|
-
'Xoom'
|
|
621
|
-
]);
|
|
622
|
-
|
|
623
|
-
/* Detectable manufacturers. */
|
|
624
|
-
var manufacturer = getManufacturer({
|
|
625
|
-
'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 },
|
|
626
|
-
'Archos': {},
|
|
627
|
-
'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 },
|
|
628
|
-
'Asus': { 'Transformer': 1 },
|
|
629
|
-
'Barnes & Noble': { 'Nook': 1 },
|
|
630
|
-
'BlackBerry': { 'PlayBook': 1 },
|
|
631
|
-
'Google': { 'Google TV': 1, 'Nexus': 1 },
|
|
632
|
-
'HP': { 'TouchPad': 1 },
|
|
633
|
-
'HTC': {},
|
|
634
|
-
'LG': {},
|
|
635
|
-
'Microsoft': { 'Xbox': 1, 'Xbox One': 1 },
|
|
636
|
-
'Motorola': { 'Xoom': 1 },
|
|
637
|
-
'Nintendo': { 'Wii U': 1, 'Wii': 1 },
|
|
638
|
-
'Nokia': { 'Lumia': 1 },
|
|
639
|
-
'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 },
|
|
640
|
-
'Sony': { 'PlayStation 4': 1, 'PlayStation 3': 1, 'PlayStation Vita': 1 }
|
|
641
|
-
});
|
|
642
|
-
|
|
643
|
-
/* Detectable operating systems (order is important). */
|
|
644
|
-
var os = getOS([
|
|
645
|
-
'Windows Phone',
|
|
646
|
-
'Android',
|
|
647
|
-
'CentOS',
|
|
648
|
-
{ 'label': 'Chrome OS', 'pattern': 'CrOS' },
|
|
649
|
-
'Debian',
|
|
650
|
-
'Fedora',
|
|
651
|
-
'FreeBSD',
|
|
652
|
-
'Gentoo',
|
|
653
|
-
'Haiku',
|
|
654
|
-
'Kubuntu',
|
|
655
|
-
'Linux Mint',
|
|
656
|
-
'OpenBSD',
|
|
657
|
-
'Red Hat',
|
|
658
|
-
'SuSE',
|
|
659
|
-
'Ubuntu',
|
|
660
|
-
'Xubuntu',
|
|
661
|
-
'Cygwin',
|
|
662
|
-
'Symbian OS',
|
|
663
|
-
'hpwOS',
|
|
664
|
-
'webOS ',
|
|
665
|
-
'webOS',
|
|
666
|
-
'Tablet OS',
|
|
667
|
-
'Linux',
|
|
668
|
-
'Mac OS X',
|
|
669
|
-
'Macintosh',
|
|
670
|
-
'Mac',
|
|
671
|
-
'Windows 98;',
|
|
672
|
-
'Windows '
|
|
673
|
-
]);
|
|
674
|
-
|
|
675
|
-
/*------------------------------------------------------------------------*/
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* Picks the layout engine from an array of guesses.
|
|
679
|
-
*
|
|
680
|
-
* @private
|
|
681
|
-
* @param {Array} guesses An array of guesses.
|
|
682
|
-
* @returns {null|string} The detected layout engine.
|
|
683
|
-
*/
|
|
684
|
-
function getLayout(guesses) {
|
|
685
|
-
return reduce(guesses, function(result, guess) {
|
|
686
|
-
return result || RegExp('\\b' + (
|
|
687
|
-
guess.pattern || qualify(guess)
|
|
688
|
-
) + '\\b', 'i').exec(ua) && (guess.label || guess);
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
/**
|
|
693
|
-
* Picks the manufacturer from an array of guesses.
|
|
694
|
-
*
|
|
695
|
-
* @private
|
|
696
|
-
* @param {Array} guesses An object of guesses.
|
|
697
|
-
* @returns {null|string} The detected manufacturer.
|
|
698
|
-
*/
|
|
699
|
-
function getManufacturer(guesses) {
|
|
700
|
-
return reduce(guesses, function(result, value, key) {
|
|
701
|
-
// Lookup the manufacturer by product or scan the UA for the manufacturer.
|
|
702
|
-
return result || (
|
|
703
|
-
value[product] ||
|
|
704
|
-
value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] ||
|
|
705
|
-
RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua)
|
|
706
|
-
) && key;
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* Picks the browser name from an array of guesses.
|
|
712
|
-
*
|
|
713
|
-
* @private
|
|
714
|
-
* @param {Array} guesses An array of guesses.
|
|
715
|
-
* @returns {null|string} The detected browser name.
|
|
716
|
-
*/
|
|
717
|
-
function getName(guesses) {
|
|
718
|
-
return reduce(guesses, function(result, guess) {
|
|
719
|
-
return result || RegExp('\\b' + (
|
|
720
|
-
guess.pattern || qualify(guess)
|
|
721
|
-
) + '\\b', 'i').exec(ua) && (guess.label || guess);
|
|
722
|
-
});
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* Picks the OS name from an array of guesses.
|
|
727
|
-
*
|
|
728
|
-
* @private
|
|
729
|
-
* @param {Array} guesses An array of guesses.
|
|
730
|
-
* @returns {null|string} The detected OS name.
|
|
731
|
-
*/
|
|
732
|
-
function getOS(guesses) {
|
|
733
|
-
return reduce(guesses, function(result, guess) {
|
|
734
|
-
var pattern = guess.pattern || qualify(guess);
|
|
735
|
-
if (!result && (result =
|
|
736
|
-
RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua)
|
|
737
|
-
)) {
|
|
738
|
-
result = cleanupOS(result, pattern, guess.label || guess);
|
|
739
|
-
}
|
|
740
|
-
return result;
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
/**
|
|
745
|
-
* Picks the product name from an array of guesses.
|
|
746
|
-
*
|
|
747
|
-
* @private
|
|
748
|
-
* @param {Array} guesses An array of guesses.
|
|
749
|
-
* @returns {null|string} The detected product name.
|
|
750
|
-
*/
|
|
751
|
-
function getProduct(guesses) {
|
|
752
|
-
return reduce(guesses, function(result, guess) {
|
|
753
|
-
var pattern = guess.pattern || qualify(guess);
|
|
754
|
-
if (!result && (result =
|
|
755
|
-
RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) ||
|
|
756
|
-
RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua)
|
|
757
|
-
)) {
|
|
758
|
-
// Split by forward slash and append product version if needed.
|
|
759
|
-
if ((result = String((guess.label && !RegExp(pattern, 'i').test(guess.label)) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) {
|
|
760
|
-
result[0] += ' ' + result[1];
|
|
761
|
-
}
|
|
762
|
-
// Correct character case and cleanup string.
|
|
763
|
-
guess = guess.label || guess;
|
|
764
|
-
result = format(result[0]
|
|
765
|
-
.replace(RegExp(pattern, 'i'), guess)
|
|
766
|
-
.replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ')
|
|
767
|
-
.replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2'));
|
|
768
|
-
}
|
|
769
|
-
return result;
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
/**
|
|
774
|
-
* Resolves the version using an array of UA patterns.
|
|
775
|
-
*
|
|
776
|
-
* @private
|
|
777
|
-
* @param {Array} patterns An array of UA patterns.
|
|
778
|
-
* @returns {null|string} The detected version.
|
|
779
|
-
*/
|
|
780
|
-
function getVersion(patterns) {
|
|
781
|
-
return reduce(patterns, function(result, pattern) {
|
|
782
|
-
return result || (RegExp(pattern +
|
|
783
|
-
'(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null;
|
|
784
|
-
});
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
/**
|
|
788
|
-
* Returns `platform.description` when the platform object is coerced to a string.
|
|
789
|
-
*
|
|
790
|
-
* @name toString
|
|
791
|
-
* @memberOf platform
|
|
792
|
-
* @returns {string} Returns `platform.description` if available, else an empty string.
|
|
793
|
-
*/
|
|
794
|
-
function toStringPlatform() {
|
|
795
|
-
return this.description || '';
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
/*------------------------------------------------------------------------*/
|
|
799
|
-
|
|
800
|
-
// Convert layout to an array so we can add extra details.
|
|
801
|
-
layout && (layout = [layout]);
|
|
802
|
-
|
|
803
|
-
// Detect product names that contain their manufacturer's name.
|
|
804
|
-
if (manufacturer && !product) {
|
|
805
|
-
product = getProduct([manufacturer]);
|
|
806
|
-
}
|
|
807
|
-
// Clean up Google TV.
|
|
808
|
-
if ((data = /\bGoogle TV\b/.exec(product))) {
|
|
809
|
-
product = data[0];
|
|
810
|
-
}
|
|
811
|
-
// Detect simulators.
|
|
812
|
-
if (/\bSimulator\b/i.test(ua)) {
|
|
813
|
-
product = (product ? product + ' ' : '') + 'Simulator';
|
|
814
|
-
}
|
|
815
|
-
// Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS.
|
|
816
|
-
if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) {
|
|
817
|
-
description.push('running in Turbo/Uncompressed mode');
|
|
818
|
-
}
|
|
819
|
-
// Detect IE Mobile 11.
|
|
820
|
-
if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) {
|
|
821
|
-
data = parse(ua.replace(/like iPhone OS/, ''));
|
|
822
|
-
manufacturer = data.manufacturer;
|
|
823
|
-
product = data.product;
|
|
824
|
-
}
|
|
825
|
-
// Detect iOS.
|
|
826
|
-
else if (/^iP/.test(product)) {
|
|
827
|
-
name || (name = 'Safari');
|
|
828
|
-
os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua))
|
|
829
|
-
? ' ' + data[1].replace(/_/g, '.')
|
|
830
|
-
: '');
|
|
831
|
-
}
|
|
832
|
-
// Detect Kubuntu.
|
|
833
|
-
else if (name == 'Konqueror' && !/buntu/i.test(os)) {
|
|
834
|
-
os = 'Kubuntu';
|
|
835
|
-
}
|
|
836
|
-
// Detect Android browsers.
|
|
837
|
-
else if ((manufacturer && manufacturer != 'Google' &&
|
|
838
|
-
((/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua)) || /\bVita\b/.test(product))) ||
|
|
839
|
-
(/\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua))) {
|
|
840
|
-
name = 'Android Browser';
|
|
841
|
-
os = /\bAndroid\b/.test(os) ? os : 'Android';
|
|
842
|
-
}
|
|
843
|
-
// Detect Silk desktop/accelerated modes.
|
|
844
|
-
else if (name == 'Silk') {
|
|
845
|
-
if (!/\bMobi/i.test(ua)) {
|
|
846
|
-
os = 'Android';
|
|
847
|
-
description.unshift('desktop mode');
|
|
848
|
-
}
|
|
849
|
-
if (/Accelerated *= *true/i.test(ua)) {
|
|
850
|
-
description.unshift('accelerated');
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
// Detect PaleMoon identifying as Firefox.
|
|
854
|
-
else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) {
|
|
855
|
-
description.push('identifying as Firefox ' + data[1]);
|
|
856
|
-
}
|
|
857
|
-
// Detect Firefox OS and products running Firefox.
|
|
858
|
-
else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) {
|
|
859
|
-
os || (os = 'Firefox OS');
|
|
860
|
-
product || (product = data[1]);
|
|
861
|
-
}
|
|
862
|
-
// Detect false positives for Firefox/Safari.
|
|
863
|
-
else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) {
|
|
864
|
-
// Escape the `/` for Firefox 1.
|
|
865
|
-
if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) {
|
|
866
|
-
// Clear name of false positives.
|
|
867
|
-
name = null;
|
|
868
|
-
}
|
|
869
|
-
// Reassign a generic name.
|
|
870
|
-
if ((data = product || manufacturer || os) &&
|
|
871
|
-
(product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) {
|
|
872
|
-
name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser';
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
// Detect non-Opera (Presto-based) versions (order is important).
|
|
876
|
-
if (!version) {
|
|
877
|
-
version = getVersion([
|
|
878
|
-
'(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|Silk(?!/[\\d.]+$))',
|
|
879
|
-
'Version',
|
|
880
|
-
qualify(name),
|
|
881
|
-
'(?:Firefox|Minefield|NetFront)'
|
|
882
|
-
]);
|
|
883
|
-
}
|
|
884
|
-
// Detect stubborn layout engines.
|
|
885
|
-
if ((data =
|
|
886
|
-
layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' ||
|
|
887
|
-
/\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') ||
|
|
888
|
-
/\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' ||
|
|
889
|
-
!layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') ||
|
|
890
|
-
layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront'
|
|
891
|
-
)) {
|
|
892
|
-
layout = [data];
|
|
893
|
-
}
|
|
894
|
-
// Detect Windows Phone 7 desktop mode.
|
|
895
|
-
if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) {
|
|
896
|
-
name += ' Mobile';
|
|
897
|
-
os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x');
|
|
898
|
-
description.unshift('desktop mode');
|
|
899
|
-
}
|
|
900
|
-
// Detect Windows Phone 8.x desktop mode.
|
|
901
|
-
else if (/\bWPDesktop\b/i.test(ua)) {
|
|
902
|
-
name = 'IE Mobile';
|
|
903
|
-
os = 'Windows Phone 8.x';
|
|
904
|
-
description.unshift('desktop mode');
|
|
905
|
-
version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
|
|
906
|
-
}
|
|
907
|
-
// Detect IE 11.
|
|
908
|
-
else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) {
|
|
909
|
-
if (name) {
|
|
910
|
-
description.push('identifying as ' + name + (version ? ' ' + version : ''));
|
|
911
|
-
}
|
|
912
|
-
name = 'IE';
|
|
913
|
-
version = data[1];
|
|
914
|
-
}
|
|
915
|
-
// Leverage environment features.
|
|
916
|
-
if (useFeatures) {
|
|
917
|
-
// Detect server-side environments.
|
|
918
|
-
// Rhino has a global function while others have a global object.
|
|
919
|
-
if (isHostType(context, 'global')) {
|
|
920
|
-
if (java) {
|
|
921
|
-
data = java.lang.System;
|
|
922
|
-
arch = data.getProperty('os.arch');
|
|
923
|
-
os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
|
|
924
|
-
}
|
|
925
|
-
if (isModuleScope && isHostType(context, 'system') && (data = [context.system])[0]) {
|
|
926
|
-
os || (os = data[0].os || null);
|
|
927
|
-
try {
|
|
928
|
-
data[1] = context.require('ringo/engine').version;
|
|
929
|
-
version = data[1].join('.');
|
|
930
|
-
name = 'RingoJS';
|
|
931
|
-
} catch(e) {
|
|
932
|
-
if (data[0].global.system == context.system) {
|
|
933
|
-
name = 'Narwhal';
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
else if (
|
|
938
|
-
typeof context.process == 'object' && !context.process.browser &&
|
|
939
|
-
(data = context.process)
|
|
940
|
-
) {
|
|
941
|
-
name = 'Node.js';
|
|
942
|
-
arch = data.arch;
|
|
943
|
-
os = data.platform;
|
|
944
|
-
version = /[\d.]+/.exec(data.version)[0];
|
|
945
|
-
}
|
|
946
|
-
else if (rhino) {
|
|
947
|
-
name = 'Rhino';
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
// Detect Adobe AIR.
|
|
951
|
-
else if (getClassOf((data = context.runtime)) == airRuntimeClass) {
|
|
952
|
-
name = 'Adobe AIR';
|
|
953
|
-
os = data.flash.system.Capabilities.os;
|
|
954
|
-
}
|
|
955
|
-
// Detect PhantomJS.
|
|
956
|
-
else if (getClassOf((data = context.phantom)) == phantomClass) {
|
|
957
|
-
name = 'PhantomJS';
|
|
958
|
-
version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch);
|
|
959
|
-
}
|
|
960
|
-
// Detect IE compatibility modes.
|
|
961
|
-
else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) {
|
|
962
|
-
// We're in compatibility mode when the Trident version + 4 doesn't
|
|
963
|
-
// equal the document mode.
|
|
964
|
-
version = [version, doc.documentMode];
|
|
965
|
-
if ((data = +data[1] + 4) != version[1]) {
|
|
966
|
-
description.push('IE ' + version[1] + ' mode');
|
|
967
|
-
layout && (layout[1] = '');
|
|
968
|
-
version[1] = data;
|
|
969
|
-
}
|
|
970
|
-
version = name == 'IE' ? String(version[1].toFixed(1)) : version[0];
|
|
971
|
-
}
|
|
972
|
-
os = os && format(os);
|
|
973
|
-
}
|
|
974
|
-
// Detect prerelease phases.
|
|
975
|
-
if (version && (data =
|
|
976
|
-
/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) ||
|
|
977
|
-
/(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) ||
|
|
978
|
-
/\bMinefield\b/i.test(ua) && 'a'
|
|
979
|
-
)) {
|
|
980
|
-
prerelease = /b/i.test(data) ? 'beta' : 'alpha';
|
|
981
|
-
version = version.replace(RegExp(data + '\\+?$'), '') +
|
|
982
|
-
(prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || '');
|
|
983
|
-
}
|
|
984
|
-
// Detect Firefox Mobile.
|
|
985
|
-
if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS)\b/.test(os)) {
|
|
986
|
-
name = 'Firefox Mobile';
|
|
987
|
-
}
|
|
988
|
-
// Obscure Maxthon's unreliable version.
|
|
989
|
-
else if (name == 'Maxthon' && version) {
|
|
990
|
-
version = version.replace(/\.[\d.]+/, '.x');
|
|
991
|
-
}
|
|
992
|
-
// Detect Xbox 360 and Xbox One.
|
|
993
|
-
else if (/\bXbox\b/i.test(product)) {
|
|
994
|
-
os = null;
|
|
995
|
-
if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) {
|
|
996
|
-
description.unshift('mobile mode');
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
// Add mobile postfix.
|
|
1000
|
-
else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) &&
|
|
1001
|
-
(os == 'Windows CE' || /Mobi/i.test(ua))) {
|
|
1002
|
-
name += ' Mobile';
|
|
1003
|
-
}
|
|
1004
|
-
// Detect IE platform preview.
|
|
1005
|
-
else if (name == 'IE' && useFeatures && context.external === null) {
|
|
1006
|
-
description.unshift('platform preview');
|
|
1007
|
-
}
|
|
1008
|
-
// Detect BlackBerry OS version.
|
|
1009
|
-
// http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp
|
|
1010
|
-
else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data =
|
|
1011
|
-
(RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] ||
|
|
1012
|
-
version
|
|
1013
|
-
)) {
|
|
1014
|
-
data = [data, /BB10/.test(ua)];
|
|
1015
|
-
os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0];
|
|
1016
|
-
version = null;
|
|
1017
|
-
}
|
|
1018
|
-
// Detect Opera identifying/masking itself as another browser.
|
|
1019
|
-
// http://www.opera.com/support/kb/view/843/
|
|
1020
|
-
else if (this != forOwn && product != 'Wii' && (
|
|
1021
|
-
(useFeatures && opera) ||
|
|
1022
|
-
(/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) ||
|
|
1023
|
-
(name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os)) ||
|
|
1024
|
-
(name == 'IE' && (
|
|
1025
|
-
(os && !/^Win/.test(os) && version > 5.5) ||
|
|
1026
|
-
/\bWindows XP\b/.test(os) && version > 8 ||
|
|
1027
|
-
version == 8 && !/\bTrident\b/.test(ua)
|
|
1028
|
-
))
|
|
1029
|
-
) && !reOpera.test((data = parse.call(forOwn, ua.replace(reOpera, '') + ';'))) && data.name) {
|
|
1030
|
-
// When "identifying", the UA contains both Opera and the other browser's name.
|
|
1031
|
-
data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : '');
|
|
1032
|
-
if (reOpera.test(name)) {
|
|
1033
|
-
if (/\bIE\b/.test(data) && os == 'Mac OS') {
|
|
1034
|
-
os = null;
|
|
1035
|
-
}
|
|
1036
|
-
data = 'identify' + data;
|
|
1037
|
-
}
|
|
1038
|
-
// When "masking", the UA contains only the other browser's name.
|
|
1039
|
-
else {
|
|
1040
|
-
data = 'mask' + data;
|
|
1041
|
-
if (operaClass) {
|
|
1042
|
-
name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2'));
|
|
1043
|
-
} else {
|
|
1044
|
-
name = 'Opera';
|
|
1045
|
-
}
|
|
1046
|
-
if (/\bIE\b/.test(data)) {
|
|
1047
|
-
os = null;
|
|
1048
|
-
}
|
|
1049
|
-
if (!useFeatures) {
|
|
1050
|
-
version = null;
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
layout = ['Presto'];
|
|
1054
|
-
description.push(data);
|
|
1055
|
-
}
|
|
1056
|
-
// Detect WebKit Nightly and approximate Chrome/Safari versions.
|
|
1057
|
-
if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
|
|
1058
|
-
// Correct build number for numeric comparison.
|
|
1059
|
-
// (e.g. "532.5" becomes "532.05")
|
|
1060
|
-
data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data];
|
|
1061
|
-
// Nightly builds are postfixed with a "+".
|
|
1062
|
-
if (name == 'Safari' && data[1].slice(-1) == '+') {
|
|
1063
|
-
name = 'WebKit Nightly';
|
|
1064
|
-
prerelease = 'alpha';
|
|
1065
|
-
version = data[1].slice(0, -1);
|
|
1066
|
-
}
|
|
1067
|
-
// Clear incorrect browser versions.
|
|
1068
|
-
else if (version == data[1] ||
|
|
1069
|
-
version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
|
|
1070
|
-
version = null;
|
|
1071
|
-
}
|
|
1072
|
-
// Use the full Chrome version when available.
|
|
1073
|
-
data[1] = (/\bChrome\/([\d.]+)/i.exec(ua) || 0)[1];
|
|
1074
|
-
// Detect Blink layout engine.
|
|
1075
|
-
if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') {
|
|
1076
|
-
layout = ['Blink'];
|
|
1077
|
-
}
|
|
1078
|
-
// Detect JavaScriptCore.
|
|
1079
|
-
// http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi
|
|
1080
|
-
if (!useFeatures || (!likeChrome && !data[1])) {
|
|
1081
|
-
layout && (layout[1] = 'like Safari');
|
|
1082
|
-
data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : '8');
|
|
1083
|
-
} else {
|
|
1084
|
-
layout && (layout[1] = 'like Chrome');
|
|
1085
|
-
data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : data < 537.11 ? '21+' : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != 'Blink' ? '27' : '28');
|
|
1086
|
-
}
|
|
1087
|
-
// Add the postfix of ".x" or "+" for approximate versions.
|
|
1088
|
-
layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+'));
|
|
1089
|
-
// Obscure version for some Safari 1-2 releases.
|
|
1090
|
-
if (name == 'Safari' && (!version || parseInt(version) > 45)) {
|
|
1091
|
-
version = data;
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
// Detect Opera desktop modes.
|
|
1095
|
-
if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) {
|
|
1096
|
-
name += ' ';
|
|
1097
|
-
description.unshift('desktop mode');
|
|
1098
|
-
if (data == 'zvav') {
|
|
1099
|
-
name += 'Mini';
|
|
1100
|
-
version = null;
|
|
1101
|
-
} else {
|
|
1102
|
-
name += 'Mobile';
|
|
1103
|
-
}
|
|
1104
|
-
os = os.replace(RegExp(' *' + data + '$'), '');
|
|
1105
|
-
}
|
|
1106
|
-
// Detect Chrome desktop mode.
|
|
1107
|
-
else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) {
|
|
1108
|
-
description.unshift('desktop mode');
|
|
1109
|
-
name = 'Chrome Mobile';
|
|
1110
|
-
version = null;
|
|
1111
|
-
|
|
1112
|
-
if (/\bOS X\b/.test(os)) {
|
|
1113
|
-
manufacturer = 'Apple';
|
|
1114
|
-
os = 'iOS 4.3+';
|
|
1115
|
-
} else {
|
|
1116
|
-
os = null;
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
// Strip incorrect OS versions.
|
|
1120
|
-
if (version && version.indexOf((data = /[\d.]+$/.exec(os))) == 0 &&
|
|
1121
|
-
ua.indexOf('/' + data + '-') > -1) {
|
|
1122
|
-
os = trim(os.replace(data, ''));
|
|
1123
|
-
}
|
|
1124
|
-
// Add layout engine.
|
|
1125
|
-
if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (
|
|
1126
|
-
/Browser|Lunascape|Maxthon/.test(name) ||
|
|
1127
|
-
name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) ||
|
|
1128
|
-
/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Sleipnir|Web)/.test(name) && layout[1])) {
|
|
1129
|
-
// Don't add layout details to description if they are falsey.
|
|
1130
|
-
(data = layout[layout.length - 1]) && description.push(data);
|
|
1131
|
-
}
|
|
1132
|
-
// Combine contextual information.
|
|
1133
|
-
if (description.length) {
|
|
1134
|
-
description = ['(' + description.join('; ') + ')'];
|
|
1135
|
-
}
|
|
1136
|
-
// Append manufacturer to description.
|
|
1137
|
-
if (manufacturer && product && product.indexOf(manufacturer) < 0) {
|
|
1138
|
-
description.push('on ' + manufacturer);
|
|
1139
|
-
}
|
|
1140
|
-
// Append product to description.
|
|
1141
|
-
if (product) {
|
|
1142
|
-
description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product);
|
|
1143
|
-
}
|
|
1144
|
-
// Parse the OS into an object.
|
|
1145
|
-
if (os) {
|
|
1146
|
-
data = / ([\d.+]+)$/.exec(os);
|
|
1147
|
-
isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/';
|
|
1148
|
-
os = {
|
|
1149
|
-
'architecture': 32,
|
|
1150
|
-
'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os,
|
|
1151
|
-
'version': data ? data[1] : null,
|
|
1152
|
-
'toString': function() {
|
|
1153
|
-
var version = this.version;
|
|
1154
|
-
return this.family + ((version && !isSpecialCasedOS) ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : '');
|
|
1155
|
-
}
|
|
1156
|
-
};
|
|
1157
|
-
}
|
|
1158
|
-
// Add browser/OS architecture.
|
|
1159
|
-
if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) {
|
|
1160
|
-
if (os) {
|
|
1161
|
-
os.architecture = 64;
|
|
1162
|
-
os.family = os.family.replace(RegExp(' *' + data), '');
|
|
1163
|
-
}
|
|
1164
|
-
if (
|
|
1165
|
-
name && (/\bWOW64\b/i.test(ua) ||
|
|
1166
|
-
(useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua)))
|
|
1167
|
-
) {
|
|
1168
|
-
description.unshift('32-bit');
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
// Chrome 39 and above on OS X is always 64-bit.
|
|
1172
|
-
else if (
|
|
1173
|
-
os && /^OS X/.test(os.family) &&
|
|
1174
|
-
name == 'Chrome' && parseFloat(version) >= 39
|
|
1175
|
-
) {
|
|
1176
|
-
os.architecture = 64;
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
ua || (ua = null);
|
|
1180
|
-
|
|
1181
|
-
/*------------------------------------------------------------------------*/
|
|
1182
|
-
|
|
1183
|
-
/**
|
|
1184
|
-
* The platform object.
|
|
1185
|
-
*
|
|
1186
|
-
* @name platform
|
|
1187
|
-
* @type Object
|
|
1188
|
-
*/
|
|
1189
|
-
var platform = {};
|
|
1190
|
-
|
|
1191
|
-
/**
|
|
1192
|
-
* The platform description.
|
|
1193
|
-
*
|
|
1194
|
-
* @memberOf platform
|
|
1195
|
-
* @type string|null
|
|
1196
|
-
*/
|
|
1197
|
-
platform.description = ua;
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
* The name of the browser's layout engine.
|
|
1201
|
-
*
|
|
1202
|
-
* @memberOf platform
|
|
1203
|
-
* @type string|null
|
|
1204
|
-
*/
|
|
1205
|
-
platform.layout = layout && layout[0];
|
|
1206
|
-
|
|
1207
|
-
/**
|
|
1208
|
-
* The name of the product's manufacturer.
|
|
1209
|
-
*
|
|
1210
|
-
* @memberOf platform
|
|
1211
|
-
* @type string|null
|
|
1212
|
-
*/
|
|
1213
|
-
platform.manufacturer = manufacturer;
|
|
1214
|
-
|
|
1215
|
-
/**
|
|
1216
|
-
* The name of the browser/environment.
|
|
1217
|
-
*
|
|
1218
|
-
* @memberOf platform
|
|
1219
|
-
* @type string|null
|
|
1220
|
-
*/
|
|
1221
|
-
platform.name = name;
|
|
1222
|
-
|
|
1223
|
-
/**
|
|
1224
|
-
* The alpha/beta release indicator.
|
|
1225
|
-
*
|
|
1226
|
-
* @memberOf platform
|
|
1227
|
-
* @type string|null
|
|
1228
|
-
*/
|
|
1229
|
-
platform.prerelease = prerelease;
|
|
1230
|
-
|
|
1231
|
-
/**
|
|
1232
|
-
* The name of the product hosting the browser.
|
|
1233
|
-
*
|
|
1234
|
-
* @memberOf platform
|
|
1235
|
-
* @type string|null
|
|
1236
|
-
*/
|
|
1237
|
-
platform.product = product;
|
|
1238
|
-
|
|
1239
|
-
/**
|
|
1240
|
-
* The browser's user agent string.
|
|
1241
|
-
*
|
|
1242
|
-
* @memberOf platform
|
|
1243
|
-
* @type string|null
|
|
1244
|
-
*/
|
|
1245
|
-
platform.ua = ua;
|
|
1246
|
-
|
|
1247
|
-
/**
|
|
1248
|
-
* The browser/environment version.
|
|
1249
|
-
*
|
|
1250
|
-
* @memberOf platform
|
|
1251
|
-
* @type string|null
|
|
1252
|
-
*/
|
|
1253
|
-
platform.version = name && version;
|
|
1254
|
-
|
|
1255
|
-
/**
|
|
1256
|
-
* The name of the operating system.
|
|
1257
|
-
*
|
|
1258
|
-
* @memberOf platform
|
|
1259
|
-
* @type Object
|
|
1260
|
-
*/
|
|
1261
|
-
platform.os = os || {
|
|
1262
|
-
|
|
1263
|
-
/**
|
|
1264
|
-
* The CPU architecture the OS is built for.
|
|
1265
|
-
*
|
|
1266
|
-
* @memberOf platform.os
|
|
1267
|
-
* @type number|null
|
|
1268
|
-
*/
|
|
1269
|
-
'architecture': null,
|
|
1270
|
-
|
|
1271
|
-
/**
|
|
1272
|
-
* The family of the OS.
|
|
1273
|
-
*
|
|
1274
|
-
* Common values include:
|
|
1275
|
-
* "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
|
|
1276
|
-
* "Windows XP", "OS X", "Ubuntu", "Debian", "Fedora", "Red Hat", "SuSE",
|
|
1277
|
-
* "Android", "iOS" and "Windows Phone"
|
|
1278
|
-
*
|
|
1279
|
-
* @memberOf platform.os
|
|
1280
|
-
* @type string|null
|
|
1281
|
-
*/
|
|
1282
|
-
'family': null,
|
|
1283
|
-
|
|
1284
|
-
/**
|
|
1285
|
-
* The version of the OS.
|
|
1286
|
-
*
|
|
1287
|
-
* @memberOf platform.os
|
|
1288
|
-
* @type string|null
|
|
1289
|
-
*/
|
|
1290
|
-
'version': null,
|
|
1291
|
-
|
|
1292
|
-
/**
|
|
1293
|
-
* Returns the OS string.
|
|
1294
|
-
*
|
|
1295
|
-
* @memberOf platform.os
|
|
1296
|
-
* @returns {string} The OS string.
|
|
1297
|
-
*/
|
|
1298
|
-
'toString': function() { return 'null'; }
|
|
1299
|
-
};
|
|
1300
|
-
|
|
1301
|
-
platform.parse = parse;
|
|
1302
|
-
platform.toString = toStringPlatform;
|
|
1303
|
-
|
|
1304
|
-
if (platform.version) {
|
|
1305
|
-
description.unshift(version);
|
|
1306
|
-
}
|
|
1307
|
-
if (platform.name) {
|
|
1308
|
-
description.unshift(name);
|
|
1309
|
-
}
|
|
1310
|
-
if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) {
|
|
1311
|
-
description.push(product ? '(' + os + ')' : 'on ' + os);
|
|
1312
|
-
}
|
|
1313
|
-
if (description.length) {
|
|
1314
|
-
platform.description = description.join(' ');
|
|
1315
|
-
}
|
|
1316
|
-
return platform;
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
/*--------------------------------------------------------------------------*/
|
|
1320
|
-
|
|
1321
|
-
// Export platform.
|
|
1322
|
-
var platform = parse();
|
|
1323
|
-
|
|
1324
|
-
// Some AMD build optimizers, like r.js, check for condition patterns like the following:
|
|
1325
|
-
if (freeExports && freeModule) {
|
|
1326
|
-
// Export for CommonJS support.
|
|
1327
|
-
forOwn(platform, function(value, key) {
|
|
1328
|
-
freeExports[key] = value;
|
|
1329
|
-
});
|
|
1330
|
-
}
|
|
1331
|
-
else {
|
|
1332
|
-
// Export to the global object.
|
|
1333
|
-
root.platform = platform;
|
|
1334
|
-
}
|
|
1335
|
-
}.call(commonjsGlobal));
|
|
1336
|
-
}(platform, platform.exports));
|
|
1337
|
-
|
|
1338
|
-
(function (module, exports) {
|
|
1339
|
-
|
|
1340
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1341
|
-
value: true
|
|
1342
|
-
});
|
|
1343
|
-
|
|
1344
|
-
var _platform2 = platform.exports;
|
|
1345
|
-
|
|
1346
|
-
var _platform3 = _interopRequireDefault(_platform2);
|
|
1347
|
-
|
|
1348
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1349
|
-
|
|
1350
|
-
// deep clone of original platform
|
|
1351
|
-
var platform$1 = JSON.parse(JSON.stringify(_platform3.default));
|
|
1352
|
-
|
|
1353
|
-
// operating system
|
|
1354
|
-
|
|
1355
|
-
// sugar for https://github.com/bestiejs/platform.js
|
|
1356
|
-
// make sure to ALWAYS reference the layout engine,
|
|
1357
|
-
// even if it is not necessary for the condition,
|
|
1358
|
-
// as this makes grepping for this stuff simpler
|
|
1359
|
-
|
|
1360
|
-
var os = platform$1.os.family || '';
|
|
1361
|
-
var ANDROID = os === 'Android';
|
|
1362
|
-
var WINDOWS = os.slice(0, 7) === 'Windows';
|
|
1363
|
-
var OSX = os === 'OS X';
|
|
1364
|
-
var IOS = os === 'iOS';
|
|
1365
|
-
|
|
1366
|
-
// layout
|
|
1367
|
-
var BLINK = platform$1.layout === 'Blink';
|
|
1368
|
-
var GECKO = platform$1.layout === 'Gecko';
|
|
1369
|
-
var TRIDENT = platform$1.layout === 'Trident';
|
|
1370
|
-
var EDGE = platform$1.layout === 'EdgeHTML';
|
|
1371
|
-
var WEBKIT = platform$1.layout === 'WebKit';
|
|
1372
|
-
|
|
1373
|
-
// browser version (not layout engine version!)
|
|
1374
|
-
var version = parseFloat(platform$1.version);
|
|
1375
|
-
var majorVersion = Math.floor(version);
|
|
1376
|
-
platform$1.majorVersion = majorVersion;
|
|
1377
|
-
|
|
1378
|
-
platform$1.is = {
|
|
1379
|
-
// operating system
|
|
1380
|
-
ANDROID: ANDROID,
|
|
1381
|
-
WINDOWS: WINDOWS,
|
|
1382
|
-
OSX: OSX,
|
|
1383
|
-
IOS: IOS,
|
|
1384
|
-
// layout
|
|
1385
|
-
BLINK: BLINK, // "Chrome", "Chrome Mobile", "Opera"
|
|
1386
|
-
GECKO: GECKO, // "Firefox"
|
|
1387
|
-
TRIDENT: TRIDENT, // "Internet Explorer"
|
|
1388
|
-
EDGE: EDGE, // "Microsoft Edge"
|
|
1389
|
-
WEBKIT: WEBKIT, // "Safari"
|
|
1390
|
-
// INTERNET EXPLORERS
|
|
1391
|
-
IE9: TRIDENT && majorVersion === 9,
|
|
1392
|
-
IE10: TRIDENT && majorVersion === 10,
|
|
1393
|
-
IE11: TRIDENT && majorVersion === 11
|
|
1394
|
-
};
|
|
1395
|
-
|
|
1396
|
-
exports.default = platform$1;
|
|
1397
|
-
module.exports = exports['default'];
|
|
1398
|
-
|
|
1399
|
-
}(platform$1, platform$1.exports));
|
|
1400
|
-
|
|
1401
|
-
(function (module, exports) {
|
|
1402
|
-
|
|
1403
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1404
|
-
value: true
|
|
1405
|
-
});
|
|
1406
|
-
|
|
1407
|
-
exports.default = function (tests) {
|
|
1408
|
-
var data = before();
|
|
1409
|
-
|
|
1410
|
-
var results = {};
|
|
1411
|
-
Object.keys(tests).map(function (key) {
|
|
1412
|
-
results[key] = test(data, tests[key]);
|
|
1413
|
-
});
|
|
1414
|
-
|
|
1415
|
-
after(data);
|
|
1416
|
-
return results;
|
|
1417
|
-
};
|
|
1418
|
-
|
|
1419
|
-
var _platform = platform$1.exports;
|
|
1420
|
-
|
|
1421
|
-
var _platform2 = _interopRequireDefault(_platform);
|
|
1422
|
-
|
|
1423
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1424
|
-
|
|
1425
|
-
function before() {
|
|
1426
|
-
var data = {
|
|
1427
|
-
// remember what had focus to restore after test
|
|
1428
|
-
activeElement: document.activeElement,
|
|
1429
|
-
// remember scroll positions to restore after test
|
|
1430
|
-
windowScrollTop: window.scrollTop,
|
|
1431
|
-
windowScrollLeft: window.scrollLeft,
|
|
1432
|
-
bodyScrollTop: document.body.scrollTop,
|
|
1433
|
-
bodyScrollLeft: document.body.scrollLeft
|
|
1434
|
-
};
|
|
1435
|
-
|
|
1436
|
-
// wrap tests in an element hidden from screen readers to prevent them
|
|
1437
|
-
// from announcing focus, which can be quite irritating to the user
|
|
1438
|
-
var iframe = document.createElement('iframe');
|
|
1439
|
-
iframe.setAttribute('style', 'position:absolute; position:fixed; top:0; left:-2px; width:1px; height:1px; overflow:hidden;');
|
|
1440
|
-
iframe.setAttribute('aria-live', 'off');
|
|
1441
|
-
iframe.setAttribute('aria-busy', 'true');
|
|
1442
|
-
iframe.setAttribute('aria-hidden', 'true');
|
|
1443
|
-
document.body.appendChild(iframe);
|
|
1444
|
-
|
|
1445
|
-
var _window = iframe.contentWindow;
|
|
1446
|
-
var _document = _window.document;
|
|
1447
|
-
|
|
1448
|
-
_document.open();
|
|
1449
|
-
_document.close();
|
|
1450
|
-
var wrapper = _document.createElement('div');
|
|
1451
|
-
_document.body.appendChild(wrapper);
|
|
1452
|
-
|
|
1453
|
-
data.iframe = iframe;
|
|
1454
|
-
data.wrapper = wrapper;
|
|
1455
|
-
data.window = _window;
|
|
1456
|
-
data.document = _document;
|
|
1457
|
-
|
|
1458
|
-
return data;
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
// options.element:
|
|
1462
|
-
// {string} element name
|
|
1463
|
-
// {function} callback(wrapper, document) to generate an element
|
|
1464
|
-
// options.mutate: (optional)
|
|
1465
|
-
// {function} callback(element, wrapper, document) to manipulate element prior to focus-test.
|
|
1466
|
-
// Can return DOMElement to define focus target (default: element)
|
|
1467
|
-
// options.validate: (optional)
|
|
1468
|
-
// {function} callback(element, focusTarget, document) to manipulate test-result
|
|
1469
|
-
function test(data, options) {
|
|
1470
|
-
// make sure we operate on a clean slate
|
|
1471
|
-
data.wrapper.innerHTML = '';
|
|
1472
|
-
// create dummy element to test focusability of
|
|
1473
|
-
var element = typeof options.element === 'string' ? data.document.createElement(options.element) : options.element(data.wrapper, data.document);
|
|
1474
|
-
// allow callback to further specify dummy element
|
|
1475
|
-
// and optionally define element to focus
|
|
1476
|
-
var focus = options.mutate && options.mutate(element, data.wrapper, data.document);
|
|
1477
|
-
if (!focus && focus !== false) {
|
|
1478
|
-
focus = element;
|
|
1479
|
-
}
|
|
1480
|
-
// element needs to be part of the DOM to be focusable
|
|
1481
|
-
!element.parentNode && data.wrapper.appendChild(element);
|
|
1482
|
-
// test if the element with invalid tabindex can be focused
|
|
1483
|
-
focus && focus.focus && focus.focus();
|
|
1484
|
-
// validate test's result
|
|
1485
|
-
return options.validate ? options.validate(element, focus, data.document) : data.document.activeElement === focus;
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
function after(data) {
|
|
1489
|
-
// restore focus to what it was before test and cleanup
|
|
1490
|
-
if (data.activeElement === document.body) {
|
|
1491
|
-
document.activeElement && document.activeElement.blur && document.activeElement.blur();
|
|
1492
|
-
if (_platform2.default.is.IE10) {
|
|
1493
|
-
// IE10 does not redirect focus to <body> when the activeElement is removed
|
|
1494
|
-
document.body.focus();
|
|
1495
|
-
}
|
|
1496
|
-
} else {
|
|
1497
|
-
data.activeElement && data.activeElement.focus && data.activeElement.focus();
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
document.body.removeChild(data.iframe);
|
|
1501
|
-
|
|
1502
|
-
// restore scroll position
|
|
1503
|
-
window.scrollTop = data.windowScrollTop;
|
|
1504
|
-
window.scrollLeft = data.windowScrollLeft;
|
|
1505
|
-
document.body.scrollTop = data.bodyScrollTop;
|
|
1506
|
-
document.body.scrollLeft = data.bodyScrollLeft;
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
module.exports = exports['default'];
|
|
1510
|
-
|
|
1511
|
-
}(detectFocus, detectFocus.exports));
|
|
1512
|
-
|
|
1513
|
-
var supportsCache = {exports: {}};
|
|
1514
|
-
|
|
1515
|
-
var version = {exports: {}};
|
|
1516
|
-
|
|
1517
|
-
(function (module, exports) {
|
|
1518
|
-
|
|
1519
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1520
|
-
value: true
|
|
1521
|
-
});
|
|
1522
|
-
|
|
1523
|
-
// this file is overwritten by `npm run build:pre`
|
|
1524
|
-
var version = '1.4.1';
|
|
1525
|
-
exports.default = version;
|
|
1526
|
-
module.exports = exports['default'];
|
|
1527
|
-
|
|
1528
|
-
}(version, version.exports));
|
|
1529
|
-
|
|
1530
|
-
(function (module, exports) {
|
|
1531
|
-
|
|
1532
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1533
|
-
value: true
|
|
1534
|
-
});
|
|
1535
|
-
|
|
1536
|
-
var _version = version.exports;
|
|
1537
|
-
|
|
1538
|
-
var _version2 = _interopRequireDefault(_version);
|
|
1539
|
-
|
|
1540
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1541
|
-
|
|
1542
|
-
function readLocalStorage(key) {
|
|
1543
|
-
// allow reading from storage to retrieve previous support results
|
|
1544
|
-
// even while the document does not have focus
|
|
1545
|
-
var data = void 0;
|
|
1546
|
-
|
|
1547
|
-
try {
|
|
1548
|
-
data = window.localStorage && window.localStorage.getItem(key);
|
|
1549
|
-
data = data ? JSON.parse(data) : {};
|
|
1550
|
-
} catch (e) {
|
|
1551
|
-
data = {};
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1554
|
-
return data;
|
|
1555
|
-
} /*
|
|
1556
|
-
Facility to cache test results in localStorage.
|
|
1557
|
-
|
|
1558
|
-
USAGE:
|
|
1559
|
-
cache.get('key');
|
|
1560
|
-
cache.set('key', 'value');
|
|
1561
|
-
*/
|
|
1562
|
-
|
|
1563
|
-
function writeLocalStorage(key, value) {
|
|
1564
|
-
if (!document.hasFocus()) {
|
|
1565
|
-
// if the document does not have focus when tests are executed, focus() may
|
|
1566
|
-
// not be handled properly and events may not be dispatched immediately.
|
|
1567
|
-
// This can happen when a document is reloaded while Developer Tools have focus.
|
|
1568
|
-
try {
|
|
1569
|
-
window.localStorage && window.localStorage.removeItem(key);
|
|
1570
|
-
} catch (e) {
|
|
1571
|
-
// ignore
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
return;
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
try {
|
|
1578
|
-
window.localStorage && window.localStorage.setItem(key, JSON.stringify(value));
|
|
1579
|
-
} catch (e) {
|
|
1580
|
-
// ignore
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1584
|
-
var userAgent = typeof window !== 'undefined' && window.navigator.userAgent || '';
|
|
1585
|
-
var cacheKey = 'ally-supports-cache';
|
|
1586
|
-
var cache = readLocalStorage(cacheKey);
|
|
1587
|
-
|
|
1588
|
-
// update the cache if ally or the user agent changed (newer version, etc)
|
|
1589
|
-
if (cache.userAgent !== userAgent || cache.version !== _version2.default) {
|
|
1590
|
-
cache = {};
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
cache.userAgent = userAgent;
|
|
1594
|
-
cache.version = _version2.default;
|
|
1595
|
-
|
|
1596
|
-
exports.default = {
|
|
1597
|
-
get: function get() {
|
|
1598
|
-
return cache;
|
|
1599
|
-
},
|
|
1600
|
-
set: function set(values) {
|
|
1601
|
-
Object.keys(values).forEach(function (key) {
|
|
1602
|
-
cache[key] = values[key];
|
|
1603
|
-
});
|
|
1604
|
-
|
|
1605
|
-
cache.time = new Date().toISOString();
|
|
1606
|
-
writeLocalStorage(cacheKey, cache);
|
|
1607
|
-
}
|
|
1608
|
-
};
|
|
1609
|
-
module.exports = exports['default'];
|
|
1610
|
-
|
|
1611
|
-
}(supportsCache, supportsCache.exports));
|
|
1612
|
-
|
|
1613
|
-
var cssShadowPiercingDeepCombinator = {exports: {}};
|
|
1614
|
-
|
|
1615
|
-
(function (module, exports) {
|
|
1616
|
-
|
|
1617
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1618
|
-
value: true
|
|
1619
|
-
});
|
|
1620
|
-
|
|
1621
|
-
exports.default = function () {
|
|
1622
|
-
var combinator = void 0;
|
|
1623
|
-
|
|
1624
|
-
// see https://dev.w3.org/csswg/css-scoping-1/#deep-combinator
|
|
1625
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=1117572
|
|
1626
|
-
// https://code.google.com/p/chromium/issues/detail?id=446051
|
|
1627
|
-
try {
|
|
1628
|
-
document.querySelector('html >>> :first-child');
|
|
1629
|
-
combinator = '>>>';
|
|
1630
|
-
} catch (noArrowArrowArrow) {
|
|
1631
|
-
try {
|
|
1632
|
-
// old syntax supported at least up to Chrome 41
|
|
1633
|
-
// https://code.google.com/p/chromium/issues/detail?id=446051
|
|
1634
|
-
document.querySelector('html /deep/ :first-child');
|
|
1635
|
-
combinator = '/deep/';
|
|
1636
|
-
} catch (noDeep) {
|
|
1637
|
-
combinator = '';
|
|
1638
|
-
}
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
|
-
return combinator;
|
|
1642
|
-
};
|
|
1643
|
-
|
|
1644
|
-
module.exports = exports['default'];
|
|
1645
|
-
|
|
1646
|
-
}(cssShadowPiercingDeepCombinator, cssShadowPiercingDeepCombinator.exports));
|
|
1647
|
-
|
|
1648
|
-
var focusAreaImgTabindex = {exports: {}};
|
|
1649
|
-
|
|
1650
|
-
var gif = {exports: {}};
|
|
1651
|
-
|
|
1652
|
-
(function (module, exports) {
|
|
1653
|
-
|
|
1654
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1655
|
-
value: true
|
|
1656
|
-
});
|
|
1657
|
-
exports.default = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
|
|
1658
|
-
module.exports = exports['default'];
|
|
1659
|
-
|
|
1660
|
-
}(gif, gif.exports));
|
|
1661
|
-
|
|
1662
|
-
(function (module, exports) {
|
|
1663
|
-
|
|
1664
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1665
|
-
value: true
|
|
1666
|
-
});
|
|
1667
|
-
|
|
1668
|
-
var _gif = gif.exports;
|
|
1669
|
-
|
|
1670
|
-
var _gif2 = _interopRequireDefault(_gif);
|
|
1671
|
-
|
|
1672
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1673
|
-
|
|
1674
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-usemap
|
|
1675
|
-
exports.default = {
|
|
1676
|
-
element: 'div',
|
|
1677
|
-
mutate: function mutate(element) {
|
|
1678
|
-
element.innerHTML = '<map name="image-map-tabindex-test">' + '<area shape="rect" coords="63,19,144,45"></map>' + '<img usemap="#image-map-tabindex-test" tabindex="-1" alt="" src="' + _gif2.default + '">';
|
|
1679
|
-
|
|
1680
|
-
return element.querySelector('area');
|
|
1681
|
-
}
|
|
1682
|
-
};
|
|
1683
|
-
module.exports = exports['default'];
|
|
1684
|
-
|
|
1685
|
-
}(focusAreaImgTabindex, focusAreaImgTabindex.exports));
|
|
1686
|
-
|
|
1687
|
-
var focusAreaTabindex = {exports: {}};
|
|
1688
|
-
|
|
1689
|
-
(function (module, exports) {
|
|
1690
|
-
|
|
1691
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1692
|
-
value: true
|
|
1693
|
-
});
|
|
1694
|
-
|
|
1695
|
-
var _gif = gif.exports;
|
|
1696
|
-
|
|
1697
|
-
var _gif2 = _interopRequireDefault(_gif);
|
|
1698
|
-
|
|
1699
|
-
var _platform = platform$1.exports;
|
|
1700
|
-
|
|
1701
|
-
var _platform2 = _interopRequireDefault(_platform);
|
|
1702
|
-
|
|
1703
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1704
|
-
|
|
1705
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-usemap
|
|
1706
|
-
exports.default = {
|
|
1707
|
-
element: 'div',
|
|
1708
|
-
mutate: function mutate(element) {
|
|
1709
|
-
element.innerHTML = '<map name="image-map-tabindex-test">' + '<area href="#void" tabindex="-1" shape="rect" coords="63,19,144,45"></map>' + '<img usemap="#image-map-tabindex-test" alt="" src="' + _gif2.default + '">';
|
|
1710
|
-
|
|
1711
|
-
return false;
|
|
1712
|
-
},
|
|
1713
|
-
validate: function validate(element, focusTarget, _document) {
|
|
1714
|
-
if (_platform2.default.is.GECKO) {
|
|
1715
|
-
// fixes https://github.com/medialize/ally.js/issues/35
|
|
1716
|
-
// Firefox loads the DataURI asynchronously, causing a false-negative
|
|
1717
|
-
return true;
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
var focus = element.querySelector('area');
|
|
1721
|
-
focus.focus();
|
|
1722
|
-
return _document.activeElement === focus;
|
|
1723
|
-
}
|
|
1724
|
-
};
|
|
1725
|
-
module.exports = exports['default'];
|
|
1726
|
-
|
|
1727
|
-
}(focusAreaTabindex, focusAreaTabindex.exports));
|
|
1728
|
-
|
|
1729
|
-
var focusAreaWithoutHref = {exports: {}};
|
|
1730
|
-
|
|
1731
|
-
(function (module, exports) {
|
|
1732
|
-
|
|
1733
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1734
|
-
value: true
|
|
1735
|
-
});
|
|
1736
|
-
|
|
1737
|
-
var _gif = gif.exports;
|
|
1738
|
-
|
|
1739
|
-
var _gif2 = _interopRequireDefault(_gif);
|
|
1740
|
-
|
|
1741
|
-
var _platform = platform$1.exports;
|
|
1742
|
-
|
|
1743
|
-
var _platform2 = _interopRequireDefault(_platform);
|
|
1744
|
-
|
|
1745
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1746
|
-
|
|
1747
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-usemap
|
|
1748
|
-
exports.default = {
|
|
1749
|
-
element: 'div',
|
|
1750
|
-
mutate: function mutate(element) {
|
|
1751
|
-
element.innerHTML = '<map name="image-map-area-href-test">' + '<area shape="rect" coords="63,19,144,45"></map>' + '<img usemap="#image-map-area-href-test" alt="" src="' + _gif2.default + '">';
|
|
1752
|
-
|
|
1753
|
-
return element.querySelector('area');
|
|
1754
|
-
},
|
|
1755
|
-
validate: function validate(element, focusTarget, _document) {
|
|
1756
|
-
if (_platform2.default.is.GECKO) {
|
|
1757
|
-
// fixes https://github.com/medialize/ally.js/issues/35
|
|
1758
|
-
// Firefox loads the DataURI asynchronously, causing a false-negative
|
|
1759
|
-
return true;
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
|
-
return _document.activeElement === focusTarget;
|
|
1763
|
-
}
|
|
1764
|
-
};
|
|
1765
|
-
module.exports = exports['default'];
|
|
1766
|
-
|
|
1767
|
-
}(focusAreaWithoutHref, focusAreaWithoutHref.exports));
|
|
1768
|
-
|
|
1769
|
-
var focusAudioWithoutControls = {exports: {}};
|
|
1770
|
-
|
|
1771
|
-
var mp3 = {exports: {}};
|
|
1772
|
-
|
|
1773
|
-
(function (module, exports) {
|
|
1774
|
-
|
|
1775
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1776
|
-
value: true
|
|
1777
|
-
});
|
|
1778
|
-
|
|
1779
|
-
var _gif = gif.exports;
|
|
1780
|
-
|
|
1781
|
-
var _gif2 = _interopRequireDefault(_gif);
|
|
1782
|
-
|
|
1783
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1784
|
-
|
|
1785
|
-
exports.default = _gif2.default;
|
|
1786
|
-
// export default 'data:audio/mp3;base64,audio-focus-test';
|
|
1787
|
-
|
|
1788
|
-
module.exports = exports['default'];
|
|
1789
|
-
|
|
1790
|
-
}(mp3, mp3.exports));
|
|
1791
|
-
|
|
1792
|
-
(function (module, exports) {
|
|
1793
|
-
|
|
1794
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1795
|
-
value: true
|
|
1796
|
-
});
|
|
1797
|
-
|
|
1798
|
-
var _mp = mp3.exports;
|
|
1799
|
-
|
|
1800
|
-
var _mp2 = _interopRequireDefault(_mp);
|
|
1801
|
-
|
|
1802
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1803
|
-
|
|
1804
|
-
exports.default = {
|
|
1805
|
-
name: 'can-focus-audio-without-controls',
|
|
1806
|
-
element: 'audio',
|
|
1807
|
-
mutate: function mutate(element) {
|
|
1808
|
-
try {
|
|
1809
|
-
// invalid media file can trigger warning in console, data-uri to prevent HTTP request
|
|
1810
|
-
element.setAttribute('src', _mp2.default);
|
|
1811
|
-
} catch (e) {
|
|
1812
|
-
// IE9 may throw "Error: Not implemented"
|
|
1813
|
-
}
|
|
1814
|
-
}
|
|
1815
|
-
};
|
|
1816
|
-
module.exports = exports['default'];
|
|
1817
|
-
|
|
1818
|
-
}(focusAudioWithoutControls, focusAudioWithoutControls.exports));
|
|
1819
|
-
|
|
1820
|
-
var focusBrokenImageMap = {exports: {}};
|
|
1821
|
-
|
|
1822
|
-
var gif_invalid = {exports: {}};
|
|
1823
|
-
|
|
1824
|
-
(function (module, exports) {
|
|
1825
|
-
|
|
1826
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1827
|
-
value: true
|
|
1828
|
-
});
|
|
1829
|
-
exports.default = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ';
|
|
1830
|
-
module.exports = exports['default'];
|
|
1831
|
-
|
|
1832
|
-
}(gif_invalid, gif_invalid.exports));
|
|
1833
|
-
|
|
1834
|
-
(function (module, exports) {
|
|
1835
|
-
|
|
1836
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1837
|
-
value: true
|
|
1838
|
-
});
|
|
1839
|
-
|
|
1840
|
-
var _gif = gif_invalid.exports;
|
|
1841
|
-
|
|
1842
|
-
var _gif2 = _interopRequireDefault(_gif);
|
|
1843
|
-
|
|
1844
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1845
|
-
|
|
1846
|
-
// NOTE: https://github.com/medialize/ally.js/issues/35
|
|
1847
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-usemap
|
|
1848
|
-
exports.default = {
|
|
1849
|
-
element: 'div',
|
|
1850
|
-
mutate: function mutate(element) {
|
|
1851
|
-
element.innerHTML = '<map name="broken-image-map-test"><area href="#void" shape="rect" coords="63,19,144,45"></map>' + '<img usemap="#broken-image-map-test" alt="" src="' + _gif2.default + '">';
|
|
1852
|
-
|
|
1853
|
-
return element.querySelector('area');
|
|
1854
|
-
}
|
|
1855
|
-
};
|
|
1856
|
-
module.exports = exports['default'];
|
|
1857
|
-
|
|
1858
|
-
}(focusBrokenImageMap, focusBrokenImageMap.exports));
|
|
1859
|
-
|
|
1860
|
-
var focusChildrenOfFocusableFlexbox = {exports: {}};
|
|
1861
|
-
|
|
1862
|
-
(function (module, exports) {
|
|
1863
|
-
|
|
1864
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1865
|
-
value: true
|
|
1866
|
-
});
|
|
1867
|
-
|
|
1868
|
-
// Children of focusable elements with display:flex are focusable in IE10-11
|
|
1869
|
-
exports.default = {
|
|
1870
|
-
element: 'div',
|
|
1871
|
-
mutate: function mutate(element) {
|
|
1872
|
-
element.setAttribute('tabindex', '-1');
|
|
1873
|
-
element.setAttribute('style', 'display: -webkit-flex; display: -ms-flexbox; display: flex;');
|
|
1874
|
-
element.innerHTML = '<span style="display: block;">hello</span>';
|
|
1875
|
-
return element.querySelector('span');
|
|
1876
|
-
}
|
|
1877
|
-
};
|
|
1878
|
-
module.exports = exports['default'];
|
|
1879
|
-
|
|
1880
|
-
}(focusChildrenOfFocusableFlexbox, focusChildrenOfFocusableFlexbox.exports));
|
|
1881
|
-
|
|
1882
|
-
var focusFieldsetDisabled = {exports: {}};
|
|
1883
|
-
|
|
1884
|
-
(function (module, exports) {
|
|
1885
|
-
|
|
1886
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1887
|
-
value: true
|
|
1888
|
-
});
|
|
1889
|
-
|
|
1890
|
-
// fieldset[tabindex=0][disabled] should not be focusable, but Blink and WebKit disagree
|
|
1891
|
-
// @specification https://www.w3.org/TR/html5/disabled-elements.html#concept-element-disabled
|
|
1892
|
-
// @browser-issue Chromium https://crbug.com/453847
|
|
1893
|
-
// @browser-issue WebKit https://bugs.webkit.org/show_bug.cgi?id=141086
|
|
1894
|
-
exports.default = {
|
|
1895
|
-
element: 'fieldset',
|
|
1896
|
-
mutate: function mutate(element) {
|
|
1897
|
-
element.setAttribute('tabindex', 0);
|
|
1898
|
-
element.setAttribute('disabled', 'disabled');
|
|
1899
|
-
}
|
|
1900
|
-
};
|
|
1901
|
-
module.exports = exports['default'];
|
|
1902
|
-
|
|
1903
|
-
}(focusFieldsetDisabled, focusFieldsetDisabled.exports));
|
|
1904
|
-
|
|
1905
|
-
var focusFieldset = {exports: {}};
|
|
1906
|
-
|
|
1907
|
-
(function (module, exports) {
|
|
1908
|
-
|
|
1909
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1910
|
-
value: true
|
|
1911
|
-
});
|
|
1912
|
-
exports.default = {
|
|
1913
|
-
element: 'fieldset',
|
|
1914
|
-
mutate: function mutate(element) {
|
|
1915
|
-
element.innerHTML = '<legend>legend</legend><p>content</p>';
|
|
1916
|
-
}
|
|
1917
|
-
};
|
|
1918
|
-
module.exports = exports['default'];
|
|
1919
|
-
|
|
1920
|
-
}(focusFieldset, focusFieldset.exports));
|
|
1921
|
-
|
|
1922
|
-
var focusFlexboxContainer = {exports: {}};
|
|
1923
|
-
|
|
1924
|
-
(function (module, exports) {
|
|
1925
|
-
|
|
1926
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1927
|
-
value: true
|
|
1928
|
-
});
|
|
1929
|
-
|
|
1930
|
-
// elements with display:flex are focusable in IE10-11
|
|
1931
|
-
exports.default = {
|
|
1932
|
-
element: 'span',
|
|
1933
|
-
mutate: function mutate(element) {
|
|
1934
|
-
element.setAttribute('style', 'display: -webkit-flex; display: -ms-flexbox; display: flex;');
|
|
1935
|
-
element.innerHTML = '<span style="display: block;">hello</span>';
|
|
1936
|
-
}
|
|
1937
|
-
};
|
|
1938
|
-
module.exports = exports['default'];
|
|
1939
|
-
|
|
1940
|
-
}(focusFlexboxContainer, focusFlexboxContainer.exports));
|
|
1941
|
-
|
|
1942
|
-
var focusFormDisabled = {exports: {}};
|
|
1943
|
-
|
|
1944
|
-
(function (module, exports) {
|
|
1945
|
-
|
|
1946
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1947
|
-
value: true
|
|
1948
|
-
});
|
|
1949
|
-
|
|
1950
|
-
// form[tabindex=0][disabled] should be focusable as the
|
|
1951
|
-
// specification doesn't know the disabled attribute on the form element
|
|
1952
|
-
// @specification https://www.w3.org/TR/html5/forms.html#the-form-element
|
|
1953
|
-
exports.default = {
|
|
1954
|
-
element: 'form',
|
|
1955
|
-
mutate: function mutate(element) {
|
|
1956
|
-
element.setAttribute('tabindex', 0);
|
|
1957
|
-
element.setAttribute('disabled', 'disabled');
|
|
1958
|
-
}
|
|
1959
|
-
};
|
|
1960
|
-
module.exports = exports['default'];
|
|
1961
|
-
|
|
1962
|
-
}(focusFormDisabled, focusFormDisabled.exports));
|
|
1963
|
-
|
|
1964
|
-
var focusImgIsmap = {exports: {}};
|
|
1965
|
-
|
|
1966
|
-
(function (module, exports) {
|
|
1967
|
-
|
|
1968
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1969
|
-
value: true
|
|
1970
|
-
});
|
|
1971
|
-
|
|
1972
|
-
var _gif = gif.exports;
|
|
1973
|
-
|
|
1974
|
-
var _gif2 = _interopRequireDefault(_gif);
|
|
1975
|
-
|
|
1976
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1977
|
-
|
|
1978
|
-
// NOTE: https://github.com/medialize/ally.js/issues/35
|
|
1979
|
-
// fixes https://github.com/medialize/ally.js/issues/20
|
|
1980
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-ismap
|
|
1981
|
-
exports.default = {
|
|
1982
|
-
element: 'a',
|
|
1983
|
-
mutate: function mutate(element) {
|
|
1984
|
-
element.href = '#void';
|
|
1985
|
-
element.innerHTML = '<img ismap src="' + _gif2.default + '" alt="">';
|
|
1986
|
-
return element.querySelector('img');
|
|
1987
|
-
}
|
|
1988
|
-
};
|
|
1989
|
-
module.exports = exports['default'];
|
|
1990
|
-
|
|
1991
|
-
}(focusImgIsmap, focusImgIsmap.exports));
|
|
1992
|
-
|
|
1993
|
-
var focusImgUsemapTabindex = {exports: {}};
|
|
1994
|
-
|
|
1995
|
-
(function (module, exports) {
|
|
1996
|
-
|
|
1997
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1998
|
-
value: true
|
|
1999
|
-
});
|
|
2000
|
-
|
|
2001
|
-
var _gif = gif.exports;
|
|
2002
|
-
|
|
2003
|
-
var _gif2 = _interopRequireDefault(_gif);
|
|
2004
|
-
|
|
2005
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2006
|
-
|
|
2007
|
-
// NOTE: https://github.com/medialize/ally.js/issues/35
|
|
2008
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-usemap
|
|
2009
|
-
exports.default = {
|
|
2010
|
-
element: 'div',
|
|
2011
|
-
mutate: function mutate(element) {
|
|
2012
|
-
element.innerHTML = '<map name="image-map-tabindex-test"><area href="#void" shape="rect" coords="63,19,144,45"></map>' + '<img usemap="#image-map-tabindex-test" tabindex="-1" alt="" ' + 'src="' + _gif2.default + '">';
|
|
2013
|
-
|
|
2014
|
-
return element.querySelector('img');
|
|
2015
|
-
}
|
|
2016
|
-
};
|
|
2017
|
-
module.exports = exports['default'];
|
|
2018
|
-
|
|
2019
|
-
}(focusImgUsemapTabindex, focusImgUsemapTabindex.exports));
|
|
2020
|
-
|
|
2021
|
-
var focusInHiddenIframe = {exports: {}};
|
|
2022
|
-
|
|
2023
|
-
(function (module, exports) {
|
|
2024
|
-
|
|
2025
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2026
|
-
value: true
|
|
2027
|
-
});
|
|
2028
|
-
exports.default = {
|
|
2029
|
-
element: function element(wrapper, _document) {
|
|
2030
|
-
var iframe = _document.createElement('iframe');
|
|
2031
|
-
|
|
2032
|
-
// iframe must be part of the DOM before accessing the contentWindow is possible
|
|
2033
|
-
wrapper.appendChild(iframe);
|
|
2034
|
-
|
|
2035
|
-
// create the iframe's default document (<html><head></head><body></body></html>)
|
|
2036
|
-
var iframeDocument = iframe.contentWindow.document;
|
|
2037
|
-
iframeDocument.open();
|
|
2038
|
-
iframeDocument.close();
|
|
2039
|
-
return iframe;
|
|
2040
|
-
},
|
|
2041
|
-
mutate: function mutate(iframe) {
|
|
2042
|
-
iframe.style.visibility = 'hidden';
|
|
2043
|
-
|
|
2044
|
-
var iframeDocument = iframe.contentWindow.document;
|
|
2045
|
-
var input = iframeDocument.createElement('input');
|
|
2046
|
-
iframeDocument.body.appendChild(input);
|
|
2047
|
-
return input;
|
|
2048
|
-
},
|
|
2049
|
-
validate: function validate(iframe) {
|
|
2050
|
-
var iframeDocument = iframe.contentWindow.document;
|
|
2051
|
-
var focus = iframeDocument.querySelector('input');
|
|
2052
|
-
return iframeDocument.activeElement === focus;
|
|
2053
|
-
}
|
|
2054
|
-
};
|
|
2055
|
-
module.exports = exports['default'];
|
|
2056
|
-
|
|
2057
|
-
}(focusInHiddenIframe, focusInHiddenIframe.exports));
|
|
2058
|
-
|
|
2059
|
-
var focusInZeroDimensionObject = {exports: {}};
|
|
2060
|
-
|
|
2061
|
-
(function (module, exports) {
|
|
2062
|
-
|
|
2063
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2064
|
-
value: true
|
|
2065
|
-
});
|
|
2066
|
-
|
|
2067
|
-
exports.default = function () {
|
|
2068
|
-
return result;
|
|
2069
|
-
};
|
|
2070
|
-
|
|
2071
|
-
var _platform = platform$1.exports;
|
|
2072
|
-
|
|
2073
|
-
var _platform2 = _interopRequireDefault(_platform);
|
|
2074
|
-
|
|
2075
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2076
|
-
|
|
2077
|
-
var result = !_platform2.default.is.WEBKIT;
|
|
2078
|
-
|
|
2079
|
-
module.exports = exports['default'];
|
|
2080
|
-
|
|
2081
|
-
}(focusInZeroDimensionObject, focusInZeroDimensionObject.exports));
|
|
2082
|
-
|
|
2083
|
-
var focusInvalidTabindex = {exports: {}};
|
|
2084
|
-
|
|
2085
|
-
(function (module, exports) {
|
|
2086
|
-
|
|
2087
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2088
|
-
value: true
|
|
2089
|
-
});
|
|
2090
|
-
|
|
2091
|
-
// Firefox allows *any* value and treats invalid values like tabindex="-1"
|
|
2092
|
-
// @browser-issue Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054
|
|
2093
|
-
exports.default = {
|
|
2094
|
-
element: 'div',
|
|
2095
|
-
mutate: function mutate(element) {
|
|
2096
|
-
element.setAttribute('tabindex', 'invalid-value');
|
|
2097
|
-
}
|
|
2098
|
-
};
|
|
2099
|
-
module.exports = exports['default'];
|
|
2100
|
-
|
|
2101
|
-
}(focusInvalidTabindex, focusInvalidTabindex.exports));
|
|
2102
|
-
|
|
2103
|
-
var focusLabelTabindex = {exports: {}};
|
|
2104
|
-
|
|
2105
|
-
(function (module, exports) {
|
|
2106
|
-
|
|
2107
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2108
|
-
value: true
|
|
2109
|
-
});
|
|
2110
|
-
exports.default = {
|
|
2111
|
-
element: 'label',
|
|
2112
|
-
mutate: function mutate(element) {
|
|
2113
|
-
element.setAttribute('tabindex', '-1');
|
|
2114
|
-
},
|
|
2115
|
-
validate: function validate(element, focusTarget, _document) {
|
|
2116
|
-
/* eslint-enable no-unused-vars */
|
|
2117
|
-
element.focus();
|
|
2118
|
-
return _document.activeElement === element;
|
|
2119
|
-
}
|
|
2120
|
-
};
|
|
2121
|
-
module.exports = exports['default'];
|
|
2122
|
-
|
|
2123
|
-
}(focusLabelTabindex, focusLabelTabindex.exports));
|
|
2124
|
-
|
|
2125
|
-
var focusObjectSvgHidden = {exports: {}};
|
|
2126
|
-
|
|
2127
|
-
var svg$1 = {exports: {}};
|
|
2128
|
-
|
|
2129
|
-
(function (module, exports) {
|
|
2130
|
-
|
|
2131
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2132
|
-
value: true
|
|
2133
|
-
});
|
|
2134
|
-
exports.default = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtb' + 'G5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBpZD0ic3ZnIj48dGV4dCB4PSIxMCIgeT0iMjAiIGlkPSJ' + 'zdmctbGluay10ZXh0Ij50ZXh0PC90ZXh0Pjwvc3ZnPg==';
|
|
2135
|
-
module.exports = exports['default'];
|
|
2136
|
-
|
|
2137
|
-
}(svg$1, svg$1.exports));
|
|
2138
|
-
|
|
2139
|
-
(function (module, exports) {
|
|
2140
|
-
|
|
2141
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2142
|
-
value: true
|
|
2143
|
-
});
|
|
2144
|
-
|
|
2145
|
-
var _svg = svg$1.exports;
|
|
2146
|
-
|
|
2147
|
-
var _svg2 = _interopRequireDefault(_svg);
|
|
2148
|
-
|
|
2149
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2150
|
-
|
|
2151
|
-
// Note: IE10 on BrowserStack does not like this test
|
|
2152
|
-
|
|
2153
|
-
exports.default = {
|
|
2154
|
-
element: 'object',
|
|
2155
|
-
mutate: function mutate(element) {
|
|
2156
|
-
element.setAttribute('type', 'image/svg+xml');
|
|
2157
|
-
element.setAttribute('data', _svg2.default);
|
|
2158
|
-
element.setAttribute('width', '200');
|
|
2159
|
-
element.setAttribute('height', '50');
|
|
2160
|
-
element.style.visibility = 'hidden';
|
|
2161
|
-
}
|
|
2162
|
-
};
|
|
2163
|
-
module.exports = exports['default'];
|
|
2164
|
-
|
|
2165
|
-
}(focusObjectSvgHidden, focusObjectSvgHidden.exports));
|
|
2166
|
-
|
|
2167
|
-
var focusObjectSvg = {exports: {}};
|
|
2168
|
-
|
|
2169
|
-
(function (module, exports) {
|
|
2170
|
-
|
|
2171
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2172
|
-
value: true
|
|
2173
|
-
});
|
|
2174
|
-
|
|
2175
|
-
var _svg = svg$1.exports;
|
|
2176
|
-
|
|
2177
|
-
var _svg2 = _interopRequireDefault(_svg);
|
|
2178
|
-
|
|
2179
|
-
var _platform = platform$1.exports;
|
|
2180
|
-
|
|
2181
|
-
var _platform2 = _interopRequireDefault(_platform);
|
|
2182
|
-
|
|
2183
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2184
|
-
|
|
2185
|
-
// Note: IE10 on BrowserStack does not like this test
|
|
2186
|
-
|
|
2187
|
-
exports.default = {
|
|
2188
|
-
name: 'can-focus-object-svg',
|
|
2189
|
-
element: 'object',
|
|
2190
|
-
mutate: function mutate(element) {
|
|
2191
|
-
element.setAttribute('type', 'image/svg+xml');
|
|
2192
|
-
element.setAttribute('data', _svg2.default);
|
|
2193
|
-
element.setAttribute('width', '200');
|
|
2194
|
-
element.setAttribute('height', '50');
|
|
2195
|
-
},
|
|
2196
|
-
validate: function validate(element, focusTarget, _document) {
|
|
2197
|
-
if (_platform2.default.is.GECKO) {
|
|
2198
|
-
// Firefox seems to be handling the object creation asynchronously and thereby produces a false negative test result.
|
|
2199
|
-
// Because we know Firefox is able to focus object elements referencing SVGs, we simply cheat by sniffing the user agent string
|
|
2200
|
-
return true;
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
return _document.activeElement === element;
|
|
2204
|
-
}
|
|
2205
|
-
};
|
|
2206
|
-
module.exports = exports['default'];
|
|
2207
|
-
|
|
2208
|
-
}(focusObjectSvg, focusObjectSvg.exports));
|
|
2209
|
-
|
|
2210
|
-
var focusObjectSwf = {exports: {}};
|
|
2211
|
-
|
|
2212
|
-
(function (module, exports) {
|
|
2213
|
-
|
|
2214
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2215
|
-
value: true
|
|
2216
|
-
});
|
|
2217
|
-
|
|
2218
|
-
exports.default = function () {
|
|
2219
|
-
return result;
|
|
2220
|
-
};
|
|
2221
|
-
|
|
2222
|
-
var _platform = platform$1.exports;
|
|
2223
|
-
|
|
2224
|
-
var _platform2 = _interopRequireDefault(_platform);
|
|
2225
|
-
|
|
2226
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2227
|
-
|
|
2228
|
-
// Every Environment except IE9 considers SWF objects focusable
|
|
2229
|
-
var result = !_platform2.default.is.IE9;
|
|
2230
|
-
|
|
2231
|
-
module.exports = exports['default'];
|
|
2232
|
-
|
|
2233
|
-
}(focusObjectSwf, focusObjectSwf.exports));
|
|
2234
|
-
|
|
2235
|
-
var focusRedirectImgUsemap = {exports: {}};
|
|
2236
|
-
|
|
2237
|
-
(function (module, exports) {
|
|
2238
|
-
|
|
2239
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2240
|
-
value: true
|
|
2241
|
-
});
|
|
2242
|
-
|
|
2243
|
-
var _gif = gif.exports;
|
|
2244
|
-
|
|
2245
|
-
var _gif2 = _interopRequireDefault(_gif);
|
|
2246
|
-
|
|
2247
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2248
|
-
|
|
2249
|
-
exports.default = {
|
|
2250
|
-
element: 'div',
|
|
2251
|
-
mutate: function mutate(element) {
|
|
2252
|
-
element.innerHTML = '<map name="focus-redirect-img-usemap"><area href="#void" shape="rect" coords="63,19,144,45"></map>' + '<img usemap="#focus-redirect-img-usemap" alt="" ' + 'src="' + _gif2.default + '">';
|
|
2253
|
-
|
|
2254
|
-
// focus the <img>, not the <div>
|
|
2255
|
-
return element.querySelector('img');
|
|
2256
|
-
},
|
|
2257
|
-
validate: function validate(element, focusTarget, _document) {
|
|
2258
|
-
var target = element.querySelector('area');
|
|
2259
|
-
return _document.activeElement === target;
|
|
2260
|
-
}
|
|
2261
|
-
};
|
|
2262
|
-
module.exports = exports['default'];
|
|
2263
|
-
|
|
2264
|
-
}(focusRedirectImgUsemap, focusRedirectImgUsemap.exports));
|
|
2265
|
-
|
|
2266
|
-
var focusRedirectLegend = {exports: {}};
|
|
2267
|
-
|
|
2268
|
-
(function (module, exports) {
|
|
2269
|
-
|
|
2270
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2271
|
-
value: true
|
|
2272
|
-
});
|
|
2273
|
-
|
|
2274
|
-
// see https://jsbin.com/nenirisage/edit?html,js,console,output
|
|
2275
|
-
|
|
2276
|
-
exports.default = {
|
|
2277
|
-
element: 'fieldset',
|
|
2278
|
-
mutate: function mutate(element) {
|
|
2279
|
-
element.innerHTML = '<legend>legend</legend><input tabindex="-1"><input tabindex="0">';
|
|
2280
|
-
// take care of focus in validate();
|
|
2281
|
-
return false;
|
|
2282
|
-
},
|
|
2283
|
-
validate: function validate(element, focusTarget, _document) {
|
|
2284
|
-
var focusable = element.querySelector('input[tabindex="-1"]');
|
|
2285
|
-
var tabbable = element.querySelector('input[tabindex="0"]');
|
|
2286
|
-
|
|
2287
|
-
// Firefox requires this test to focus the <fieldset> first, while this is not necessary in
|
|
2288
|
-
// https://jsbin.com/nenirisage/edit?html,js,console,output
|
|
2289
|
-
element.focus();
|
|
2290
|
-
|
|
2291
|
-
element.querySelector('legend').focus();
|
|
2292
|
-
return _document.activeElement === focusable && 'focusable' || _document.activeElement === tabbable && 'tabbable' || '';
|
|
2293
|
-
}
|
|
2294
|
-
};
|
|
2295
|
-
module.exports = exports['default'];
|
|
2296
|
-
|
|
2297
|
-
}(focusRedirectLegend, focusRedirectLegend.exports));
|
|
2298
|
-
|
|
2299
|
-
var focusScrollBody = {exports: {}};
|
|
2300
|
-
|
|
2301
|
-
(function (module, exports) {
|
|
2302
|
-
|
|
2303
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2304
|
-
value: true
|
|
2305
|
-
});
|
|
2306
|
-
|
|
2307
|
-
// https://github.com/medialize/ally.js/issues/21
|
|
2308
|
-
exports.default = {
|
|
2309
|
-
element: 'div',
|
|
2310
|
-
mutate: function mutate(element) {
|
|
2311
|
-
element.setAttribute('style', 'width: 100px; height: 50px; overflow: auto;');
|
|
2312
|
-
element.innerHTML = '<div style="width: 500px; height: 40px;">scrollable content</div>';
|
|
2313
|
-
return element.querySelector('div');
|
|
2314
|
-
}
|
|
2315
|
-
};
|
|
2316
|
-
module.exports = exports['default'];
|
|
2317
|
-
|
|
2318
|
-
}(focusScrollBody, focusScrollBody.exports));
|
|
2319
|
-
|
|
2320
|
-
var focusScrollContainerWithoutOverflow = {exports: {}};
|
|
2321
|
-
|
|
2322
|
-
(function (module, exports) {
|
|
2323
|
-
|
|
2324
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2325
|
-
value: true
|
|
2326
|
-
});
|
|
2327
|
-
|
|
2328
|
-
// https://github.com/medialize/ally.js/issues/21
|
|
2329
|
-
exports.default = {
|
|
2330
|
-
element: 'div',
|
|
2331
|
-
mutate: function mutate(element) {
|
|
2332
|
-
element.setAttribute('style', 'width: 100px; height: 50px;');
|
|
2333
|
-
element.innerHTML = '<div style="width: 500px; height: 40px;">scrollable content</div>';
|
|
2334
|
-
}
|
|
2335
|
-
};
|
|
2336
|
-
module.exports = exports['default'];
|
|
2337
|
-
|
|
2338
|
-
}(focusScrollContainerWithoutOverflow, focusScrollContainerWithoutOverflow.exports));
|
|
2339
|
-
|
|
2340
|
-
var focusScrollContainer = {exports: {}};
|
|
2341
|
-
|
|
2342
|
-
(function (module, exports) {
|
|
2343
|
-
|
|
2344
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2345
|
-
value: true
|
|
2346
|
-
});
|
|
2347
|
-
|
|
2348
|
-
// https://github.com/medialize/ally.js/issues/21
|
|
2349
|
-
exports.default = {
|
|
2350
|
-
element: 'div',
|
|
2351
|
-
mutate: function mutate(element) {
|
|
2352
|
-
element.setAttribute('style', 'width: 100px; height: 50px; overflow: auto;');
|
|
2353
|
-
element.innerHTML = '<div style="width: 500px; height: 40px;">scrollable content</div>';
|
|
2354
|
-
}
|
|
2355
|
-
};
|
|
2356
|
-
module.exports = exports['default'];
|
|
2357
|
-
|
|
2358
|
-
}(focusScrollContainer, focusScrollContainer.exports));
|
|
2359
|
-
|
|
2360
|
-
var focusSummary = {exports: {}};
|
|
2361
|
-
|
|
2362
|
-
(function (module, exports) {
|
|
2363
|
-
|
|
2364
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2365
|
-
value: true
|
|
2366
|
-
});
|
|
2367
|
-
exports.default = {
|
|
2368
|
-
element: 'details',
|
|
2369
|
-
mutate: function mutate(element) {
|
|
2370
|
-
element.innerHTML = '<summary>foo</summary><p>content</p>';
|
|
2371
|
-
return element.firstElementChild;
|
|
2372
|
-
}
|
|
2373
|
-
};
|
|
2374
|
-
module.exports = exports['default'];
|
|
2375
|
-
|
|
2376
|
-
}(focusSummary, focusSummary.exports));
|
|
2377
|
-
|
|
2378
|
-
var focusSvgFocusableAttribute = {exports: {}};
|
|
2379
|
-
|
|
2380
|
-
var svg = {};
|
|
2381
|
-
|
|
2382
|
-
var focus_svgForeignObjectHack = {exports: {}};
|
|
2383
|
-
|
|
2384
|
-
(function (module, exports) {
|
|
2385
|
-
|
|
2386
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2387
|
-
value: true
|
|
2388
|
-
});
|
|
2389
|
-
|
|
2390
|
-
exports.default = function (element) {
|
|
2391
|
-
// Edge13, Edge14: foreignObject focus hack
|
|
2392
|
-
// https://jsbin.com/kunehinugi/edit?html,js,output
|
|
2393
|
-
// https://jsbin.com/fajagi/3/edit?html,js,output
|
|
2394
|
-
var isSvgElement = element.ownerSVGElement || element.nodeName.toLowerCase() === 'svg';
|
|
2395
|
-
if (!isSvgElement) {
|
|
2396
|
-
return false;
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
// inject and focus an <input> element into the SVG element to receive focus
|
|
2400
|
-
var foreignObject = makeFocusableForeignObject();
|
|
2401
|
-
element.appendChild(foreignObject);
|
|
2402
|
-
var input = foreignObject.querySelector('input');
|
|
2403
|
-
input.focus();
|
|
2404
|
-
|
|
2405
|
-
// upon disabling the activeElement, IE and Edge
|
|
2406
|
-
// will not shift focus to <body> like all the other
|
|
2407
|
-
// browsers, but instead find the first focusable
|
|
2408
|
-
// ancestor and shift focus to that
|
|
2409
|
-
input.disabled = true;
|
|
2410
|
-
|
|
2411
|
-
// clean up
|
|
2412
|
-
element.removeChild(foreignObject);
|
|
2413
|
-
return true;
|
|
2414
|
-
};
|
|
2415
|
-
|
|
2416
|
-
function makeFocusableForeignObject() {
|
|
2417
|
-
var fragment = document.createElement('div');
|
|
2418
|
-
fragment.innerHTML = '<svg><foreignObject width="30" height="30">\n <input type="text"/>\n </foreignObject></svg>';
|
|
2419
|
-
|
|
2420
|
-
return fragment.firstChild.firstChild;
|
|
2421
|
-
}
|
|
2422
|
-
|
|
2423
|
-
module.exports = exports['default'];
|
|
2424
|
-
|
|
2425
|
-
}(focus_svgForeignObjectHack, focus_svgForeignObjectHack.exports));
|
|
2426
|
-
|
|
2427
|
-
Object.defineProperty(svg, "__esModule", {
|
|
2428
|
-
value: true
|
|
2429
|
-
});
|
|
2430
|
-
svg.generate = generate;
|
|
2431
|
-
svg.focus = focus;
|
|
2432
|
-
svg.validate = validate;
|
|
2433
|
-
|
|
2434
|
-
var _focus = focus_svgForeignObjectHack.exports;
|
|
2435
|
-
|
|
2436
|
-
var _focus2 = _interopRequireDefault$1(_focus);
|
|
2437
|
-
|
|
2438
|
-
function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2439
|
-
|
|
2440
|
-
function generate(element) {
|
|
2441
|
-
return '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' + element + '</svg>';
|
|
2442
|
-
}
|
|
2443
|
-
|
|
2444
|
-
function focus(element) {
|
|
2445
|
-
if (element.focus) {
|
|
2446
|
-
return;
|
|
2447
|
-
}
|
|
2448
|
-
|
|
2449
|
-
try {
|
|
2450
|
-
HTMLElement.prototype.focus.call(element);
|
|
2451
|
-
} catch (e) {
|
|
2452
|
-
(0, _focus2.default)(element);
|
|
2453
|
-
}
|
|
2454
|
-
}
|
|
2455
|
-
|
|
2456
|
-
function validate(element, focusTarget, _document) {
|
|
2457
|
-
focus(focusTarget);
|
|
2458
|
-
return _document.activeElement === focusTarget;
|
|
2459
|
-
}
|
|
2460
|
-
|
|
2461
|
-
(function (module, exports) {
|
|
2462
|
-
|
|
2463
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2464
|
-
value: true
|
|
2465
|
-
});
|
|
2466
|
-
|
|
2467
|
-
var _svg = svg;
|
|
2468
|
-
|
|
2469
|
-
exports.default = {
|
|
2470
|
-
element: 'div',
|
|
2471
|
-
mutate: function mutate(element) {
|
|
2472
|
-
element.innerHTML = (0, _svg.generate)('<text focusable="true">a</text>');
|
|
2473
|
-
return element.querySelector('text');
|
|
2474
|
-
},
|
|
2475
|
-
validate: _svg.validate
|
|
2476
|
-
};
|
|
2477
|
-
module.exports = exports['default'];
|
|
2478
|
-
|
|
2479
|
-
}(focusSvgFocusableAttribute, focusSvgFocusableAttribute.exports));
|
|
2480
|
-
|
|
2481
|
-
var focusSvgTabindexAttribute = {exports: {}};
|
|
2482
|
-
|
|
2483
|
-
(function (module, exports) {
|
|
2484
|
-
|
|
2485
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2486
|
-
value: true
|
|
2487
|
-
});
|
|
2488
|
-
|
|
2489
|
-
var _svg = svg;
|
|
2490
|
-
|
|
2491
|
-
exports.default = {
|
|
2492
|
-
element: 'div',
|
|
2493
|
-
mutate: function mutate(element) {
|
|
2494
|
-
element.innerHTML = (0, _svg.generate)('<text tabindex="0">a</text>');
|
|
2495
|
-
return element.querySelector('text');
|
|
2496
|
-
},
|
|
2497
|
-
validate: _svg.validate
|
|
2498
|
-
};
|
|
2499
|
-
module.exports = exports['default'];
|
|
2500
|
-
|
|
2501
|
-
}(focusSvgTabindexAttribute, focusSvgTabindexAttribute.exports));
|
|
2502
|
-
|
|
2503
|
-
var focusSvgNegativeTabindexAttribute = {exports: {}};
|
|
2504
|
-
|
|
2505
|
-
(function (module, exports) {
|
|
2506
|
-
|
|
2507
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2508
|
-
value: true
|
|
2509
|
-
});
|
|
2510
|
-
|
|
2511
|
-
var _svg = svg;
|
|
2512
|
-
|
|
2513
|
-
exports.default = {
|
|
2514
|
-
element: 'div',
|
|
2515
|
-
mutate: function mutate(element) {
|
|
2516
|
-
element.innerHTML = (0, _svg.generate)('<text tabindex="-1">a</text>');
|
|
2517
|
-
return element.querySelector('text');
|
|
2518
|
-
},
|
|
2519
|
-
validate: _svg.validate
|
|
2520
|
-
};
|
|
2521
|
-
module.exports = exports['default'];
|
|
2522
|
-
|
|
2523
|
-
}(focusSvgNegativeTabindexAttribute, focusSvgNegativeTabindexAttribute.exports));
|
|
2524
|
-
|
|
2525
|
-
var focusSvgUseTabindex = {exports: {}};
|
|
2526
|
-
|
|
2527
|
-
(function (module, exports) {
|
|
2528
|
-
|
|
2529
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2530
|
-
value: true
|
|
2531
|
-
});
|
|
2532
|
-
|
|
2533
|
-
var _svg = svg;
|
|
2534
|
-
|
|
2535
|
-
exports.default = {
|
|
2536
|
-
element: 'div',
|
|
2537
|
-
mutate: function mutate(element) {
|
|
2538
|
-
element.innerHTML = (0, _svg.generate)(['<g id="ally-test-target"><a xlink:href="#void"><text>link</text></a></g>', '<use xlink:href="#ally-test-target" x="0" y="0" tabindex="-1" />'].join(''));
|
|
2539
|
-
|
|
2540
|
-
return element.querySelector('use');
|
|
2541
|
-
},
|
|
2542
|
-
validate: _svg.validate
|
|
2543
|
-
};
|
|
2544
|
-
module.exports = exports['default'];
|
|
2545
|
-
|
|
2546
|
-
}(focusSvgUseTabindex, focusSvgUseTabindex.exports));
|
|
2547
|
-
|
|
2548
|
-
var focusSvgForeignobjectTabindex = {exports: {}};
|
|
2549
|
-
|
|
2550
|
-
(function (module, exports) {
|
|
2551
|
-
|
|
2552
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2553
|
-
value: true
|
|
2554
|
-
});
|
|
2555
|
-
|
|
2556
|
-
var _svg = svg;
|
|
2557
|
-
|
|
2558
|
-
exports.default = {
|
|
2559
|
-
element: 'div',
|
|
2560
|
-
mutate: function mutate(element) {
|
|
2561
|
-
element.innerHTML = (0, _svg.generate)('<foreignObject tabindex="-1"><input type="text" /></foreignObject>');
|
|
2562
|
-
// Safari 8's quersSelector() can't identify foreignObject, but getElementyByTagName() can
|
|
2563
|
-
return element.querySelector('foreignObject') || element.getElementsByTagName('foreignObject')[0];
|
|
2564
|
-
},
|
|
2565
|
-
validate: _svg.validate
|
|
2566
|
-
|
|
2567
|
-
};
|
|
2568
|
-
module.exports = exports['default'];
|
|
2569
|
-
|
|
2570
|
-
}(focusSvgForeignobjectTabindex, focusSvgForeignobjectTabindex.exports));
|
|
2571
|
-
|
|
2572
|
-
var focusSvgInIframe = {exports: {}};
|
|
2573
|
-
|
|
2574
|
-
(function (module, exports) {
|
|
2575
|
-
|
|
2576
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2577
|
-
value: true
|
|
2578
|
-
});
|
|
2579
|
-
|
|
2580
|
-
exports.default = function () {
|
|
2581
|
-
return result;
|
|
2582
|
-
};
|
|
2583
|
-
|
|
2584
|
-
var _platform = platform$1.exports;
|
|
2585
|
-
|
|
2586
|
-
var _platform2 = _interopRequireDefault(_platform);
|
|
2587
|
-
|
|
2588
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2589
|
-
|
|
2590
|
-
// Firefox seems to be handling the SVG-document-in-iframe creation asynchronously
|
|
2591
|
-
// and thereby produces a false negative test result. Thus the test is pointless
|
|
2592
|
-
// and we resort to UA sniffing once again.
|
|
2593
|
-
// see http://jsbin.com/vunadohoko/1/edit?js,console,output
|
|
2594
|
-
|
|
2595
|
-
var result = Boolean(_platform2.default.is.GECKO && typeof SVGElement !== 'undefined' && SVGElement.prototype.focus);
|
|
2596
|
-
|
|
2597
|
-
module.exports = exports['default'];
|
|
2598
|
-
|
|
2599
|
-
}(focusSvgInIframe, focusSvgInIframe.exports));
|
|
2600
|
-
|
|
2601
|
-
var focusSvg = {exports: {}};
|
|
2602
|
-
|
|
2603
|
-
(function (module, exports) {
|
|
2604
|
-
|
|
2605
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2606
|
-
value: true
|
|
2607
|
-
});
|
|
2608
|
-
|
|
2609
|
-
var _svg = svg;
|
|
2610
|
-
|
|
2611
|
-
exports.default = {
|
|
2612
|
-
element: 'div',
|
|
2613
|
-
mutate: function mutate(element) {
|
|
2614
|
-
element.innerHTML = (0, _svg.generate)('');
|
|
2615
|
-
return element.firstChild;
|
|
2616
|
-
},
|
|
2617
|
-
validate: _svg.validate
|
|
2618
|
-
};
|
|
2619
|
-
module.exports = exports['default'];
|
|
2620
|
-
|
|
2621
|
-
}(focusSvg, focusSvg.exports));
|
|
2622
|
-
|
|
2623
|
-
var focusTabindexTrailingCharacters = {exports: {}};
|
|
2624
|
-
|
|
2625
|
-
(function (module, exports) {
|
|
2626
|
-
|
|
2627
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2628
|
-
value: true
|
|
2629
|
-
});
|
|
2630
|
-
|
|
2631
|
-
// Firefox allows *any* value and treats invalid values like tabindex="-1"
|
|
2632
|
-
// @browser-issue Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054
|
|
2633
|
-
exports.default = {
|
|
2634
|
-
element: 'div',
|
|
2635
|
-
mutate: function mutate(element) {
|
|
2636
|
-
element.setAttribute('tabindex', '3x');
|
|
2637
|
-
}
|
|
2638
|
-
};
|
|
2639
|
-
module.exports = exports['default'];
|
|
2640
|
-
|
|
2641
|
-
}(focusTabindexTrailingCharacters, focusTabindexTrailingCharacters.exports));
|
|
2642
|
-
|
|
2643
|
-
var focusTable = {exports: {}};
|
|
2644
|
-
|
|
2645
|
-
(function (module, exports) {
|
|
2646
|
-
|
|
2647
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2648
|
-
value: true
|
|
2649
|
-
});
|
|
2650
|
-
exports.default = {
|
|
2651
|
-
element: 'table',
|
|
2652
|
-
mutate: function mutate(element, wrapper, _document) {
|
|
2653
|
-
// IE9 has a problem replacing TBODY contents with innerHTML.
|
|
2654
|
-
// https://stackoverflow.com/a/8097055/515124
|
|
2655
|
-
// element.innerHTML = '<tr><td>cell</td></tr>';
|
|
2656
|
-
var fragment = _document.createDocumentFragment();
|
|
2657
|
-
fragment.innerHTML = '<tr><td>cell</td></tr>';
|
|
2658
|
-
element.appendChild(fragment);
|
|
2659
|
-
}
|
|
2660
|
-
};
|
|
2661
|
-
module.exports = exports['default'];
|
|
2662
|
-
|
|
2663
|
-
}(focusTable, focusTable.exports));
|
|
2664
|
-
|
|
2665
|
-
var focusVideoWithoutControls = {exports: {}};
|
|
2666
|
-
|
|
2667
|
-
var mp4 = {exports: {}};
|
|
2668
|
-
|
|
2669
|
-
(function (module, exports) {
|
|
2670
|
-
|
|
2671
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2672
|
-
value: true
|
|
2673
|
-
});
|
|
2674
|
-
|
|
2675
|
-
var _gif = gif.exports;
|
|
2676
|
-
|
|
2677
|
-
var _gif2 = _interopRequireDefault(_gif);
|
|
2678
|
-
|
|
2679
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2680
|
-
|
|
2681
|
-
exports.default = _gif2.default;
|
|
2682
|
-
// export default 'data:video/mp4;base64,video-focus-test';
|
|
2683
|
-
|
|
2684
|
-
module.exports = exports['default'];
|
|
2685
|
-
|
|
2686
|
-
}(mp4, mp4.exports));
|
|
2687
|
-
|
|
2688
|
-
(function (module, exports) {
|
|
2689
|
-
|
|
2690
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2691
|
-
value: true
|
|
2692
|
-
});
|
|
2693
|
-
|
|
2694
|
-
var _mp = mp4.exports;
|
|
2695
|
-
|
|
2696
|
-
var _mp2 = _interopRequireDefault(_mp);
|
|
2697
|
-
|
|
2698
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2699
|
-
|
|
2700
|
-
exports.default = {
|
|
2701
|
-
element: 'video',
|
|
2702
|
-
mutate: function mutate(element) {
|
|
2703
|
-
try {
|
|
2704
|
-
// invalid media file can trigger warning in console, data-uri to prevent HTTP request
|
|
2705
|
-
element.setAttribute('src', _mp2.default);
|
|
2706
|
-
} catch (e) {
|
|
2707
|
-
// IE9 may throw "Error: Not implemented"
|
|
2708
|
-
}
|
|
2709
|
-
}
|
|
2710
|
-
};
|
|
2711
|
-
module.exports = exports['default'];
|
|
2712
|
-
|
|
2713
|
-
}(focusVideoWithoutControls, focusVideoWithoutControls.exports));
|
|
2714
|
-
|
|
2715
|
-
var tabsequenceAreaAtImgPosition = {exports: {}};
|
|
2716
|
-
|
|
2717
|
-
(function (module, exports) {
|
|
2718
|
-
|
|
2719
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2720
|
-
value: true
|
|
2721
|
-
});
|
|
2722
|
-
|
|
2723
|
-
exports.default = function () {
|
|
2724
|
-
return result;
|
|
2725
|
-
};
|
|
2726
|
-
|
|
2727
|
-
var _platform = platform$1.exports;
|
|
2728
|
-
|
|
2729
|
-
var _platform2 = _interopRequireDefault(_platform);
|
|
2730
|
-
|
|
2731
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2732
|
-
|
|
2733
|
-
// https://jsbin.com/vafaba/3/edit?html,js,console,output
|
|
2734
|
-
var result = _platform2.default.is.GECKO || _platform2.default.is.TRIDENT || _platform2.default.is.EDGE;
|
|
2735
|
-
|
|
2736
|
-
module.exports = exports['default'];
|
|
2737
|
-
|
|
2738
|
-
}(tabsequenceAreaAtImgPosition, tabsequenceAreaAtImgPosition.exports));
|
|
2739
|
-
|
|
2740
|
-
(function (module, exports) {
|
|
2741
|
-
|
|
2742
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2743
|
-
value: true
|
|
2744
|
-
});
|
|
2745
|
-
|
|
2746
|
-
exports.default = function () {
|
|
2747
|
-
if (supportsCache$1) {
|
|
2748
|
-
return supportsCache$1;
|
|
2749
|
-
}
|
|
2750
|
-
|
|
2751
|
-
supportsCache$1 = _supportsCache2.default.get();
|
|
2752
|
-
if (!supportsCache$1.time) {
|
|
2753
|
-
_supportsCache2.default.set(executeTests());
|
|
2754
|
-
supportsCache$1 = _supportsCache2.default.get();
|
|
2755
|
-
}
|
|
2756
|
-
|
|
2757
|
-
return supportsCache$1;
|
|
2758
|
-
};
|
|
2759
|
-
|
|
2760
|
-
var _detectFocus = detectFocus.exports;
|
|
2761
|
-
|
|
2762
|
-
var _detectFocus2 = _interopRequireDefault(_detectFocus);
|
|
2763
|
-
|
|
2764
|
-
var _supportsCache = supportsCache.exports;
|
|
2765
|
-
|
|
2766
|
-
var _supportsCache2 = _interopRequireDefault(_supportsCache);
|
|
2767
|
-
|
|
2768
|
-
var _cssShadowPiercingDeepCombinator = cssShadowPiercingDeepCombinator.exports;
|
|
2769
|
-
|
|
2770
|
-
var _cssShadowPiercingDeepCombinator2 = _interopRequireDefault(_cssShadowPiercingDeepCombinator);
|
|
2771
|
-
|
|
2772
|
-
var _focusAreaImgTabindex = focusAreaImgTabindex.exports;
|
|
2773
|
-
|
|
2774
|
-
var _focusAreaImgTabindex2 = _interopRequireDefault(_focusAreaImgTabindex);
|
|
2775
|
-
|
|
2776
|
-
var _focusAreaTabindex = focusAreaTabindex.exports;
|
|
2777
|
-
|
|
2778
|
-
var _focusAreaTabindex2 = _interopRequireDefault(_focusAreaTabindex);
|
|
2779
|
-
|
|
2780
|
-
var _focusAreaWithoutHref = focusAreaWithoutHref.exports;
|
|
2781
|
-
|
|
2782
|
-
var _focusAreaWithoutHref2 = _interopRequireDefault(_focusAreaWithoutHref);
|
|
2783
|
-
|
|
2784
|
-
var _focusAudioWithoutControls = focusAudioWithoutControls.exports;
|
|
2785
|
-
|
|
2786
|
-
var _focusAudioWithoutControls2 = _interopRequireDefault(_focusAudioWithoutControls);
|
|
2787
|
-
|
|
2788
|
-
var _focusBrokenImageMap = focusBrokenImageMap.exports;
|
|
2789
|
-
|
|
2790
|
-
var _focusBrokenImageMap2 = _interopRequireDefault(_focusBrokenImageMap);
|
|
2791
|
-
|
|
2792
|
-
var _focusChildrenOfFocusableFlexbox = focusChildrenOfFocusableFlexbox.exports;
|
|
2793
|
-
|
|
2794
|
-
var _focusChildrenOfFocusableFlexbox2 = _interopRequireDefault(_focusChildrenOfFocusableFlexbox);
|
|
2795
|
-
|
|
2796
|
-
var _focusFieldsetDisabled = focusFieldsetDisabled.exports;
|
|
2797
|
-
|
|
2798
|
-
var _focusFieldsetDisabled2 = _interopRequireDefault(_focusFieldsetDisabled);
|
|
2799
|
-
|
|
2800
|
-
var _focusFieldset = focusFieldset.exports;
|
|
2801
|
-
|
|
2802
|
-
var _focusFieldset2 = _interopRequireDefault(_focusFieldset);
|
|
2803
|
-
|
|
2804
|
-
var _focusFlexboxContainer = focusFlexboxContainer.exports;
|
|
2805
|
-
|
|
2806
|
-
var _focusFlexboxContainer2 = _interopRequireDefault(_focusFlexboxContainer);
|
|
2807
|
-
|
|
2808
|
-
var _focusFormDisabled = focusFormDisabled.exports;
|
|
2809
|
-
|
|
2810
|
-
var _focusFormDisabled2 = _interopRequireDefault(_focusFormDisabled);
|
|
2811
|
-
|
|
2812
|
-
var _focusImgIsmap = focusImgIsmap.exports;
|
|
2813
|
-
|
|
2814
|
-
var _focusImgIsmap2 = _interopRequireDefault(_focusImgIsmap);
|
|
2815
|
-
|
|
2816
|
-
var _focusImgUsemapTabindex = focusImgUsemapTabindex.exports;
|
|
2817
|
-
|
|
2818
|
-
var _focusImgUsemapTabindex2 = _interopRequireDefault(_focusImgUsemapTabindex);
|
|
2819
|
-
|
|
2820
|
-
var _focusInHiddenIframe = focusInHiddenIframe.exports;
|
|
2821
|
-
|
|
2822
|
-
var _focusInHiddenIframe2 = _interopRequireDefault(_focusInHiddenIframe);
|
|
2823
|
-
|
|
2824
|
-
var _focusInZeroDimensionObject = focusInZeroDimensionObject.exports;
|
|
2825
|
-
|
|
2826
|
-
var _focusInZeroDimensionObject2 = _interopRequireDefault(_focusInZeroDimensionObject);
|
|
2827
|
-
|
|
2828
|
-
var _focusInvalidTabindex = focusInvalidTabindex.exports;
|
|
2829
|
-
|
|
2830
|
-
var _focusInvalidTabindex2 = _interopRequireDefault(_focusInvalidTabindex);
|
|
2831
|
-
|
|
2832
|
-
var _focusLabelTabindex = focusLabelTabindex.exports;
|
|
2833
|
-
|
|
2834
|
-
var _focusLabelTabindex2 = _interopRequireDefault(_focusLabelTabindex);
|
|
2835
|
-
|
|
2836
|
-
var _focusObjectSvgHidden = focusObjectSvgHidden.exports;
|
|
2837
|
-
|
|
2838
|
-
var _focusObjectSvgHidden2 = _interopRequireDefault(_focusObjectSvgHidden);
|
|
2839
|
-
|
|
2840
|
-
var _focusObjectSvg = focusObjectSvg.exports;
|
|
2841
|
-
|
|
2842
|
-
var _focusObjectSvg2 = _interopRequireDefault(_focusObjectSvg);
|
|
2843
|
-
|
|
2844
|
-
var _focusObjectSwf = focusObjectSwf.exports;
|
|
2845
|
-
|
|
2846
|
-
var _focusObjectSwf2 = _interopRequireDefault(_focusObjectSwf);
|
|
2847
|
-
|
|
2848
|
-
var _focusRedirectImgUsemap = focusRedirectImgUsemap.exports;
|
|
2849
|
-
|
|
2850
|
-
var _focusRedirectImgUsemap2 = _interopRequireDefault(_focusRedirectImgUsemap);
|
|
2851
|
-
|
|
2852
|
-
var _focusRedirectLegend = focusRedirectLegend.exports;
|
|
2853
|
-
|
|
2854
|
-
var _focusRedirectLegend2 = _interopRequireDefault(_focusRedirectLegend);
|
|
2855
|
-
|
|
2856
|
-
var _focusScrollBody = focusScrollBody.exports;
|
|
2857
|
-
|
|
2858
|
-
var _focusScrollBody2 = _interopRequireDefault(_focusScrollBody);
|
|
2859
|
-
|
|
2860
|
-
var _focusScrollContainerWithoutOverflow = focusScrollContainerWithoutOverflow.exports;
|
|
2861
|
-
|
|
2862
|
-
var _focusScrollContainerWithoutOverflow2 = _interopRequireDefault(_focusScrollContainerWithoutOverflow);
|
|
2863
|
-
|
|
2864
|
-
var _focusScrollContainer = focusScrollContainer.exports;
|
|
2865
|
-
|
|
2866
|
-
var _focusScrollContainer2 = _interopRequireDefault(_focusScrollContainer);
|
|
2867
|
-
|
|
2868
|
-
var _focusSummary = focusSummary.exports;
|
|
2869
|
-
|
|
2870
|
-
var _focusSummary2 = _interopRequireDefault(_focusSummary);
|
|
2871
|
-
|
|
2872
|
-
var _focusSvgFocusableAttribute = focusSvgFocusableAttribute.exports;
|
|
2873
|
-
|
|
2874
|
-
var _focusSvgFocusableAttribute2 = _interopRequireDefault(_focusSvgFocusableAttribute);
|
|
2875
|
-
|
|
2876
|
-
var _focusSvgTabindexAttribute = focusSvgTabindexAttribute.exports;
|
|
2877
|
-
|
|
2878
|
-
var _focusSvgTabindexAttribute2 = _interopRequireDefault(_focusSvgTabindexAttribute);
|
|
2879
|
-
|
|
2880
|
-
var _focusSvgNegativeTabindexAttribute = focusSvgNegativeTabindexAttribute.exports;
|
|
2881
|
-
|
|
2882
|
-
var _focusSvgNegativeTabindexAttribute2 = _interopRequireDefault(_focusSvgNegativeTabindexAttribute);
|
|
2883
|
-
|
|
2884
|
-
var _focusSvgUseTabindex = focusSvgUseTabindex.exports;
|
|
2885
|
-
|
|
2886
|
-
var _focusSvgUseTabindex2 = _interopRequireDefault(_focusSvgUseTabindex);
|
|
2887
|
-
|
|
2888
|
-
var _focusSvgForeignobjectTabindex = focusSvgForeignobjectTabindex.exports;
|
|
2889
|
-
|
|
2890
|
-
var _focusSvgForeignobjectTabindex2 = _interopRequireDefault(_focusSvgForeignobjectTabindex);
|
|
2891
|
-
|
|
2892
|
-
var _focusSvgInIframe = focusSvgInIframe.exports;
|
|
2893
|
-
|
|
2894
|
-
var _focusSvgInIframe2 = _interopRequireDefault(_focusSvgInIframe);
|
|
2895
|
-
|
|
2896
|
-
var _focusSvg = focusSvg.exports;
|
|
2897
|
-
|
|
2898
|
-
var _focusSvg2 = _interopRequireDefault(_focusSvg);
|
|
2899
|
-
|
|
2900
|
-
var _focusTabindexTrailingCharacters = focusTabindexTrailingCharacters.exports;
|
|
2901
|
-
|
|
2902
|
-
var _focusTabindexTrailingCharacters2 = _interopRequireDefault(_focusTabindexTrailingCharacters);
|
|
2903
|
-
|
|
2904
|
-
var _focusTable = focusTable.exports;
|
|
2905
|
-
|
|
2906
|
-
var _focusTable2 = _interopRequireDefault(_focusTable);
|
|
2907
|
-
|
|
2908
|
-
var _focusVideoWithoutControls = focusVideoWithoutControls.exports;
|
|
2909
|
-
|
|
2910
|
-
var _focusVideoWithoutControls2 = _interopRequireDefault(_focusVideoWithoutControls);
|
|
2911
|
-
|
|
2912
|
-
var _tabsequenceAreaAtImgPosition = tabsequenceAreaAtImgPosition.exports;
|
|
2913
|
-
|
|
2914
|
-
var _tabsequenceAreaAtImgPosition2 = _interopRequireDefault(_tabsequenceAreaAtImgPosition);
|
|
2915
|
-
|
|
2916
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2917
|
-
|
|
2918
|
-
var testCallbacks = {
|
|
2919
|
-
cssShadowPiercingDeepCombinator: _cssShadowPiercingDeepCombinator2.default,
|
|
2920
|
-
focusInZeroDimensionObject: _focusInZeroDimensionObject2.default,
|
|
2921
|
-
focusObjectSwf: _focusObjectSwf2.default,
|
|
2922
|
-
focusSvgInIframe: _focusSvgInIframe2.default,
|
|
2923
|
-
tabsequenceAreaAtImgPosition: _tabsequenceAreaAtImgPosition2.default
|
|
2924
|
-
};
|
|
2925
|
-
|
|
2926
|
-
var testDescriptions = {
|
|
2927
|
-
focusAreaImgTabindex: _focusAreaImgTabindex2.default,
|
|
2928
|
-
focusAreaTabindex: _focusAreaTabindex2.default,
|
|
2929
|
-
focusAreaWithoutHref: _focusAreaWithoutHref2.default,
|
|
2930
|
-
focusAudioWithoutControls: _focusAudioWithoutControls2.default,
|
|
2931
|
-
focusBrokenImageMap: _focusBrokenImageMap2.default,
|
|
2932
|
-
focusChildrenOfFocusableFlexbox: _focusChildrenOfFocusableFlexbox2.default,
|
|
2933
|
-
focusFieldsetDisabled: _focusFieldsetDisabled2.default,
|
|
2934
|
-
focusFieldset: _focusFieldset2.default,
|
|
2935
|
-
focusFlexboxContainer: _focusFlexboxContainer2.default,
|
|
2936
|
-
focusFormDisabled: _focusFormDisabled2.default,
|
|
2937
|
-
focusImgIsmap: _focusImgIsmap2.default,
|
|
2938
|
-
focusImgUsemapTabindex: _focusImgUsemapTabindex2.default,
|
|
2939
|
-
focusInHiddenIframe: _focusInHiddenIframe2.default,
|
|
2940
|
-
focusInvalidTabindex: _focusInvalidTabindex2.default,
|
|
2941
|
-
focusLabelTabindex: _focusLabelTabindex2.default,
|
|
2942
|
-
focusObjectSvg: _focusObjectSvg2.default,
|
|
2943
|
-
focusObjectSvgHidden: _focusObjectSvgHidden2.default,
|
|
2944
|
-
focusRedirectImgUsemap: _focusRedirectImgUsemap2.default,
|
|
2945
|
-
focusRedirectLegend: _focusRedirectLegend2.default,
|
|
2946
|
-
focusScrollBody: _focusScrollBody2.default,
|
|
2947
|
-
focusScrollContainerWithoutOverflow: _focusScrollContainerWithoutOverflow2.default,
|
|
2948
|
-
focusScrollContainer: _focusScrollContainer2.default,
|
|
2949
|
-
focusSummary: _focusSummary2.default,
|
|
2950
|
-
focusSvgFocusableAttribute: _focusSvgFocusableAttribute2.default,
|
|
2951
|
-
focusSvgTabindexAttribute: _focusSvgTabindexAttribute2.default,
|
|
2952
|
-
focusSvgNegativeTabindexAttribute: _focusSvgNegativeTabindexAttribute2.default,
|
|
2953
|
-
focusSvgUseTabindex: _focusSvgUseTabindex2.default,
|
|
2954
|
-
focusSvgForeignobjectTabindex: _focusSvgForeignobjectTabindex2.default,
|
|
2955
|
-
focusSvg: _focusSvg2.default,
|
|
2956
|
-
focusTabindexTrailingCharacters: _focusTabindexTrailingCharacters2.default,
|
|
2957
|
-
focusTable: _focusTable2.default,
|
|
2958
|
-
focusVideoWithoutControls: _focusVideoWithoutControls2.default
|
|
2959
|
-
};
|
|
2960
|
-
|
|
2961
|
-
function executeTests() {
|
|
2962
|
-
var results = (0, _detectFocus2.default)(testDescriptions);
|
|
2963
|
-
Object.keys(testCallbacks).forEach(function (key) {
|
|
2964
|
-
results[key] = testCallbacks[key]();
|
|
2965
|
-
});
|
|
2966
|
-
|
|
2967
|
-
return results;
|
|
2968
|
-
}
|
|
2969
|
-
|
|
2970
|
-
var supportsCache$1 = null;
|
|
2971
|
-
|
|
2972
|
-
module.exports = exports['default'];
|
|
2973
|
-
|
|
2974
|
-
}(supports, supports.exports));
|
|
2975
|
-
|
|
2976
|
-
(function (module, exports) {
|
|
2977
|
-
|
|
2978
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2979
|
-
value: true
|
|
2980
|
-
});
|
|
2981
|
-
|
|
2982
|
-
exports.default = function (context) {
|
|
2983
|
-
if (!supports$1) {
|
|
2984
|
-
supports$1 = (0, _supports3.default)();
|
|
2985
|
-
}
|
|
2986
|
-
|
|
2987
|
-
var validIntegerPattern = supports$1.focusTabindexTrailingCharacters ? validIntegerPatternWithTrailing : validIntegerPatternNoTrailing;
|
|
2988
|
-
|
|
2989
|
-
var element = (0, _contextToElement2.default)({
|
|
2990
|
-
label: 'is/valid-tabindex',
|
|
2991
|
-
resolveDocument: true,
|
|
2992
|
-
context: context
|
|
2993
|
-
});
|
|
2994
|
-
|
|
2995
|
-
// Edge 14 has a capitalization problem on SVG elements,
|
|
2996
|
-
// see https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9282058/
|
|
2997
|
-
var hasTabindex = element.hasAttribute('tabindex');
|
|
2998
|
-
var hasTabIndex = element.hasAttribute('tabIndex');
|
|
2999
|
-
|
|
3000
|
-
if (!hasTabindex && !hasTabIndex) {
|
|
3001
|
-
return false;
|
|
3002
|
-
}
|
|
3003
|
-
|
|
3004
|
-
// older Firefox and Internet Explorer don't support tabindex on SVG elements
|
|
3005
|
-
var isSvgElement = element.ownerSVGElement || element.nodeName.toLowerCase() === 'svg';
|
|
3006
|
-
if (isSvgElement && !supports$1.focusSvgTabindexAttribute) {
|
|
3007
|
-
return false;
|
|
3008
|
-
}
|
|
3009
|
-
|
|
3010
|
-
// @browser-issue Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054
|
|
3011
|
-
if (supports$1.focusInvalidTabindex) {
|
|
3012
|
-
return true;
|
|
3013
|
-
}
|
|
3014
|
-
|
|
3015
|
-
// an element matches the tabindex selector even if its value is invalid
|
|
3016
|
-
var tabindex = element.getAttribute(hasTabindex ? 'tabindex' : 'tabIndex');
|
|
3017
|
-
// IE11 parses tabindex="" as the value "-32768"
|
|
3018
|
-
// @browser-issue Trident https://connect.microsoft.com/IE/feedback/details/1072965
|
|
3019
|
-
if (tabindex === '-32768') {
|
|
3020
|
-
return false;
|
|
3021
|
-
}
|
|
3022
|
-
|
|
3023
|
-
return Boolean(tabindex && validIntegerPattern.test(tabindex));
|
|
3024
|
-
};
|
|
3025
|
-
|
|
3026
|
-
var _contextToElement = contextToElement.exports;
|
|
3027
|
-
|
|
3028
|
-
var _contextToElement2 = _interopRequireDefault(_contextToElement);
|
|
3029
|
-
|
|
3030
|
-
var _supports2 = supports.exports;
|
|
3031
|
-
|
|
3032
|
-
var _supports3 = _interopRequireDefault(_supports2);
|
|
3033
|
-
|
|
3034
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3035
|
-
|
|
3036
|
-
// determine if an element's tabindex attribute has a valid value
|
|
3037
|
-
|
|
3038
|
-
var supports$1 = void 0;
|
|
3039
|
-
|
|
3040
|
-
// https://www.w3.org/TR/html5/infrastructure.html#rules-for-parsing-integers
|
|
3041
|
-
// NOTE: all browsers agree to allow trailing spaces as well
|
|
3042
|
-
var validIntegerPatternNoTrailing = /^\s*(-|\+)?[0-9]+\s*$/;
|
|
3043
|
-
var validIntegerPatternWithTrailing = /^\s*(-|\+)?[0-9]+.*$/;
|
|
3044
|
-
|
|
3045
|
-
module.exports = exports['default'];
|
|
3046
|
-
|
|
3047
|
-
}(validTabindex, validTabindex.exports));
|
|
3048
|
-
|
|
3049
|
-
(function (module, exports) {
|
|
3050
|
-
|
|
3051
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3052
|
-
value: true
|
|
3053
|
-
});
|
|
3054
|
-
|
|
3055
|
-
exports.default = function (element) {
|
|
3056
|
-
if (!(0, _validTabindex2.default)(element)) {
|
|
3057
|
-
return null;
|
|
3058
|
-
}
|
|
3059
|
-
|
|
3060
|
-
// Edge 14 has a capitalization problem on SVG elements,
|
|
3061
|
-
// see https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9282058/
|
|
3062
|
-
var hasTabindex = element.hasAttribute('tabindex');
|
|
3063
|
-
var attributeName = hasTabindex ? 'tabindex' : 'tabIndex';
|
|
3064
|
-
|
|
3065
|
-
// @browser-issue Gecko https://bugzilla.mozilla.org/show_bug.cgi?id=1128054
|
|
3066
|
-
var tabindex = parseInt(element.getAttribute(attributeName), 10);
|
|
3067
|
-
return isNaN(tabindex) ? -1 : tabindex;
|
|
3068
|
-
};
|
|
3069
|
-
|
|
3070
|
-
var _validTabindex = validTabindex.exports;
|
|
3071
|
-
|
|
3072
|
-
var _validTabindex2 = _interopRequireDefault(_validTabindex);
|
|
3073
|
-
|
|
3074
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3075
|
-
|
|
3076
|
-
module.exports = exports['default'];
|
|
3077
|
-
|
|
3078
|
-
}(tabindexValue, tabindexValue.exports));
|
|
3079
|
-
|
|
3080
|
-
var is_util = {};
|
|
3081
|
-
|
|
3082
|
-
Object.defineProperty(is_util, "__esModule", {
|
|
3083
|
-
value: true
|
|
3084
|
-
});
|
|
3085
|
-
is_util.isUserModifyWritable = isUserModifyWritable;
|
|
3086
|
-
is_util.hasCssOverflowScroll = hasCssOverflowScroll;
|
|
3087
|
-
is_util.hasCssDisplayFlex = hasCssDisplayFlex;
|
|
3088
|
-
is_util.isScrollableContainer = isScrollableContainer;
|
|
3089
|
-
|
|
3090
|
-
// this is a shared utility file for focus-relevant.js and tabbable.js
|
|
3091
|
-
// separate testing of this file's functions is not necessary,
|
|
3092
|
-
// as they're implicitly tested by way of the consumers
|
|
3093
|
-
|
|
3094
|
-
function isUserModifyWritable(style) {
|
|
3095
|
-
// https://www.w3.org/TR/1999/WD-css3-userint-19990916#user-modify
|
|
3096
|
-
// https://github.com/medialize/ally.js/issues/17
|
|
3097
|
-
var userModify = style.webkitUserModify || '';
|
|
3098
|
-
return Boolean(userModify && userModify.indexOf('write') !== -1);
|
|
3099
|
-
}
|
|
3100
|
-
|
|
3101
|
-
function hasCssOverflowScroll(style) {
|
|
3102
|
-
return [style.getPropertyValue('overflow'), style.getPropertyValue('overflow-x'), style.getPropertyValue('overflow-y')].some(function (overflow) {
|
|
3103
|
-
return overflow === 'auto' || overflow === 'scroll';
|
|
3104
|
-
});
|
|
3105
|
-
}
|
|
3106
|
-
|
|
3107
|
-
function hasCssDisplayFlex(style) {
|
|
3108
|
-
return style.display.indexOf('flex') > -1;
|
|
3109
|
-
}
|
|
3110
|
-
|
|
3111
|
-
function isScrollableContainer(element, nodeName, parentNodeName, parentStyle) {
|
|
3112
|
-
if (nodeName !== 'div' && nodeName !== 'span') {
|
|
3113
|
-
// Internet Explorer advances scrollable containers and bodies to focusable
|
|
3114
|
-
// only if the scrollable container is <div> or <span> - this does *not*
|
|
3115
|
-
// happen for <section>, <article>, …
|
|
3116
|
-
return false;
|
|
3117
|
-
}
|
|
3118
|
-
|
|
3119
|
-
if (parentNodeName && parentNodeName !== 'div' && parentNodeName !== 'span' && !hasCssOverflowScroll(parentStyle)) {
|
|
3120
|
-
return false;
|
|
3121
|
-
}
|
|
3122
|
-
|
|
3123
|
-
return element.offsetHeight < element.scrollHeight || element.offsetWidth < element.scrollWidth;
|
|
3124
|
-
}
|
|
3125
|
-
|
|
3126
|
-
(function (module, exports) {
|
|
3127
|
-
|
|
3128
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3129
|
-
value: true
|
|
3130
|
-
});
|
|
3131
|
-
|
|
3132
|
-
var _parents = parents.exports;
|
|
3133
|
-
|
|
3134
|
-
var _parents2 = _interopRequireDefault(_parents);
|
|
3135
|
-
|
|
3136
|
-
var _contextToElement = contextToElement.exports;
|
|
3137
|
-
|
|
3138
|
-
var _contextToElement2 = _interopRequireDefault(_contextToElement);
|
|
3139
|
-
|
|
3140
|
-
var _elementMatches = elementMatches.exports;
|
|
3141
|
-
|
|
3142
|
-
var _elementMatches2 = _interopRequireDefault(_elementMatches);
|
|
3143
|
-
|
|
3144
|
-
var _tabindexValue = tabindexValue.exports;
|
|
3145
|
-
|
|
3146
|
-
var _tabindexValue2 = _interopRequireDefault(_tabindexValue);
|
|
3147
|
-
|
|
3148
|
-
var _validTabindex = validTabindex.exports;
|
|
3149
|
-
|
|
3150
|
-
var _validTabindex2 = _interopRequireDefault(_validTabindex);
|
|
3151
|
-
|
|
3152
|
-
var _is = is_util;
|
|
3153
|
-
|
|
3154
|
-
var _supports2 = supports.exports;
|
|
3155
|
-
|
|
3156
|
-
var _supports3 = _interopRequireDefault(_supports2);
|
|
3157
|
-
|
|
3158
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3159
|
-
|
|
3160
|
-
var supports$1 = void 0;
|
|
3161
|
-
// determine if an element supports.can be focused by script regardless
|
|
3162
|
-
// of the element actually being focusable at the time of execution
|
|
3163
|
-
// i.e. <input disabled> is conisdered focus-relevant, but not focusable
|
|
3164
|
-
|
|
3165
|
-
function isFocusRelevantRules() {
|
|
3166
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
3167
|
-
context = _ref.context,
|
|
3168
|
-
_ref$except = _ref.except,
|
|
3169
|
-
except = _ref$except === undefined ? {
|
|
3170
|
-
flexbox: false,
|
|
3171
|
-
scrollable: false,
|
|
3172
|
-
shadow: false
|
|
3173
|
-
} : _ref$except;
|
|
3174
|
-
|
|
3175
|
-
if (!supports$1) {
|
|
3176
|
-
supports$1 = (0, _supports3.default)();
|
|
3177
|
-
}
|
|
3178
|
-
|
|
3179
|
-
var element = (0, _contextToElement2.default)({
|
|
3180
|
-
label: 'is/focus-relevant',
|
|
3181
|
-
resolveDocument: true,
|
|
3182
|
-
context: context
|
|
3183
|
-
});
|
|
3184
|
-
|
|
3185
|
-
if (!except.shadow && element.shadowRoot) {
|
|
3186
|
-
// a ShadowDOM host receives focus when the focus moves to its content
|
|
3187
|
-
return true;
|
|
3188
|
-
}
|
|
3189
|
-
|
|
3190
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
3191
|
-
|
|
3192
|
-
if (nodeName === 'input' && element.type === 'hidden') {
|
|
3193
|
-
// input[type="hidden"] supports.cannot be focused
|
|
3194
|
-
return false;
|
|
3195
|
-
}
|
|
3196
|
-
|
|
3197
|
-
if (nodeName === 'input' || nodeName === 'select' || nodeName === 'button' || nodeName === 'textarea') {
|
|
3198
|
-
return true;
|
|
3199
|
-
}
|
|
3200
|
-
|
|
3201
|
-
if (nodeName === 'legend' && supports$1.focusRedirectLegend) {
|
|
3202
|
-
// specifics filtered in is/focusable
|
|
3203
|
-
return true;
|
|
3204
|
-
}
|
|
3205
|
-
|
|
3206
|
-
if (nodeName === 'label') {
|
|
3207
|
-
// specifics filtered in is/focusable
|
|
3208
|
-
return true;
|
|
3209
|
-
}
|
|
3210
|
-
|
|
3211
|
-
if (nodeName === 'area') {
|
|
3212
|
-
// specifics filtered in is/focusable
|
|
3213
|
-
return true;
|
|
3214
|
-
}
|
|
3215
|
-
|
|
3216
|
-
if (nodeName === 'a' && element.hasAttribute('href')) {
|
|
3217
|
-
return true;
|
|
3218
|
-
}
|
|
3219
|
-
|
|
3220
|
-
if (nodeName === 'object' && element.hasAttribute('usemap')) {
|
|
3221
|
-
// object[usemap] is not focusable in any browser
|
|
3222
|
-
return false;
|
|
3223
|
-
}
|
|
3224
|
-
|
|
3225
|
-
if (nodeName === 'object') {
|
|
3226
|
-
var svgType = element.getAttribute('type');
|
|
3227
|
-
if (!supports$1.focusObjectSvg && svgType === 'image/svg+xml') {
|
|
3228
|
-
// object[type="image/svg+xml"] is not focusable in Internet Explorer
|
|
3229
|
-
return false;
|
|
3230
|
-
} else if (!supports$1.focusObjectSwf && svgType === 'application/x-shockwave-flash') {
|
|
3231
|
-
// object[type="application/x-shockwave-flash"] is not focusable in Internet Explorer 9
|
|
3232
|
-
return false;
|
|
3233
|
-
}
|
|
3234
|
-
}
|
|
3235
|
-
|
|
3236
|
-
if (nodeName === 'iframe' || nodeName === 'object') {
|
|
3237
|
-
// browsing context containers
|
|
3238
|
-
return true;
|
|
3239
|
-
}
|
|
3240
|
-
|
|
3241
|
-
if (nodeName === 'embed' || nodeName === 'keygen') {
|
|
3242
|
-
// embed is considered focus-relevant but not focusable
|
|
3243
|
-
// see https://github.com/medialize/ally.js/issues/82
|
|
3244
|
-
return true;
|
|
3245
|
-
}
|
|
3246
|
-
|
|
3247
|
-
if (element.hasAttribute('contenteditable')) {
|
|
3248
|
-
// also see CSS property user-modify below
|
|
3249
|
-
return true;
|
|
3250
|
-
}
|
|
3251
|
-
|
|
3252
|
-
if (nodeName === 'audio' && (supports$1.focusAudioWithoutControls || element.hasAttribute('controls'))) {
|
|
3253
|
-
return true;
|
|
3254
|
-
}
|
|
3255
|
-
|
|
3256
|
-
if (nodeName === 'video' && (supports$1.focusVideoWithoutControls || element.hasAttribute('controls'))) {
|
|
3257
|
-
return true;
|
|
3258
|
-
}
|
|
3259
|
-
|
|
3260
|
-
if (supports$1.focusSummary && nodeName === 'summary') {
|
|
3261
|
-
return true;
|
|
3262
|
-
}
|
|
3263
|
-
|
|
3264
|
-
var validTabindex = (0, _validTabindex2.default)(element);
|
|
3265
|
-
|
|
3266
|
-
if (nodeName === 'img' && element.hasAttribute('usemap')) {
|
|
3267
|
-
// Gecko, Trident and Edge do not allow an image with an image map and tabindex to be focused,
|
|
3268
|
-
// it appears the tabindex is overruled so focus is still forwarded to the <map>
|
|
3269
|
-
return validTabindex && supports$1.focusImgUsemapTabindex || supports$1.focusRedirectImgUsemap;
|
|
3270
|
-
}
|
|
3271
|
-
|
|
3272
|
-
if (supports$1.focusTable && (nodeName === 'table' || nodeName === 'td')) {
|
|
3273
|
-
// IE10-11 supports.can focus <table> and <td>
|
|
3274
|
-
return true;
|
|
3275
|
-
}
|
|
3276
|
-
|
|
3277
|
-
if (supports$1.focusFieldset && nodeName === 'fieldset') {
|
|
3278
|
-
// IE10-11 supports.can focus <fieldset>
|
|
3279
|
-
return true;
|
|
3280
|
-
}
|
|
3281
|
-
|
|
3282
|
-
var isSvgElement = nodeName === 'svg';
|
|
3283
|
-
var isSvgContent = element.ownerSVGElement;
|
|
3284
|
-
var focusableAttribute = element.getAttribute('focusable');
|
|
3285
|
-
var tabindex = (0, _tabindexValue2.default)(element);
|
|
3286
|
-
|
|
3287
|
-
if (nodeName === 'use' && tabindex !== null && !supports$1.focusSvgUseTabindex) {
|
|
3288
|
-
// <use> cannot be made focusable by adding a tabindex attribute anywhere but Blink and WebKit
|
|
3289
|
-
return false;
|
|
3290
|
-
}
|
|
3291
|
-
|
|
3292
|
-
if (nodeName === 'foreignobject') {
|
|
3293
|
-
// <use> can only be made focusable in Blink and WebKit
|
|
3294
|
-
return tabindex !== null && supports$1.focusSvgForeignobjectTabindex;
|
|
3295
|
-
}
|
|
3296
|
-
|
|
3297
|
-
if ((0, _elementMatches2.default)(element, 'svg a') && element.hasAttribute('xlink:href')) {
|
|
3298
|
-
return true;
|
|
3299
|
-
}
|
|
3300
|
-
|
|
3301
|
-
if ((isSvgElement || isSvgContent) && element.focus && !supports$1.focusSvgNegativeTabindexAttribute && tabindex < 0) {
|
|
3302
|
-
// Firefox 51 and 52 treat any natively tabbable SVG element with
|
|
3303
|
-
// tabindex="-1" as tabbable and everything else as inert
|
|
3304
|
-
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1302340
|
|
3305
|
-
return false;
|
|
3306
|
-
}
|
|
3307
|
-
|
|
3308
|
-
if (isSvgElement) {
|
|
3309
|
-
return validTabindex || supports$1.focusSvg || supports$1.focusSvgInIframe
|
|
3310
|
-
// Internet Explorer understands the focusable attribute introduced in SVG Tiny 1.2
|
|
3311
|
-
|| Boolean(supports$1.focusSvgFocusableAttribute && focusableAttribute && focusableAttribute === 'true');
|
|
3312
|
-
}
|
|
3313
|
-
|
|
3314
|
-
if (isSvgContent) {
|
|
3315
|
-
if (supports$1.focusSvgTabindexAttribute && validTabindex) {
|
|
3316
|
-
return true;
|
|
3317
|
-
}
|
|
3318
|
-
|
|
3319
|
-
if (supports$1.focusSvgFocusableAttribute) {
|
|
3320
|
-
// Internet Explorer understands the focusable attribute introduced in SVG Tiny 1.2
|
|
3321
|
-
return focusableAttribute === 'true';
|
|
3322
|
-
}
|
|
3323
|
-
}
|
|
3324
|
-
|
|
3325
|
-
// https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
|
|
3326
|
-
if (validTabindex) {
|
|
3327
|
-
return true;
|
|
3328
|
-
}
|
|
3329
|
-
|
|
3330
|
-
var style = window.getComputedStyle(element, null);
|
|
3331
|
-
if ((0, _is.isUserModifyWritable)(style)) {
|
|
3332
|
-
return true;
|
|
3333
|
-
}
|
|
3334
|
-
|
|
3335
|
-
if (supports$1.focusImgIsmap && nodeName === 'img' && element.hasAttribute('ismap')) {
|
|
3336
|
-
// IE10-11 considers the <img> in <a href><img ismap> focusable
|
|
3337
|
-
// https://github.com/medialize/ally.js/issues/20
|
|
3338
|
-
var hasLinkParent = (0, _parents2.default)({ context: element }).some(function (parent) {
|
|
3339
|
-
return parent.nodeName.toLowerCase() === 'a' && parent.hasAttribute('href');
|
|
3340
|
-
});
|
|
3341
|
-
|
|
3342
|
-
if (hasLinkParent) {
|
|
3343
|
-
return true;
|
|
3344
|
-
}
|
|
3345
|
-
}
|
|
3346
|
-
|
|
3347
|
-
// https://github.com/medialize/ally.js/issues/21
|
|
3348
|
-
if (!except.scrollable && supports$1.focusScrollContainer) {
|
|
3349
|
-
if (supports$1.focusScrollContainerWithoutOverflow) {
|
|
3350
|
-
// Internet Explorer does will consider the scrollable area focusable
|
|
3351
|
-
// if the element is a <div> or a <span> and it is in fact scrollable,
|
|
3352
|
-
// regardless of the CSS overflow property
|
|
3353
|
-
if ((0, _is.isScrollableContainer)(element, nodeName)) {
|
|
3354
|
-
return true;
|
|
3355
|
-
}
|
|
3356
|
-
} else if ((0, _is.hasCssOverflowScroll)(style)) {
|
|
3357
|
-
// Firefox requires proper overflow setting, IE does not necessarily
|
|
3358
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/overflow
|
|
3359
|
-
return true;
|
|
3360
|
-
}
|
|
3361
|
-
}
|
|
3362
|
-
|
|
3363
|
-
if (!except.flexbox && supports$1.focusFlexboxContainer && (0, _is.hasCssDisplayFlex)(style)) {
|
|
3364
|
-
// elements with display:flex are focusable in IE10-11
|
|
3365
|
-
return true;
|
|
3366
|
-
}
|
|
3367
|
-
|
|
3368
|
-
var parent = element.parentElement;
|
|
3369
|
-
if (!except.scrollable && parent) {
|
|
3370
|
-
var parentNodeName = parent.nodeName.toLowerCase();
|
|
3371
|
-
var parentStyle = window.getComputedStyle(parent, null);
|
|
3372
|
-
if (supports$1.focusScrollBody && (0, _is.isScrollableContainer)(parent, nodeName, parentNodeName, parentStyle)) {
|
|
3373
|
-
// scrollable bodies are focusable Internet Explorer
|
|
3374
|
-
// https://github.com/medialize/ally.js/issues/21
|
|
3375
|
-
return true;
|
|
3376
|
-
}
|
|
3377
|
-
|
|
3378
|
-
// Children of focusable elements with display:flex are focusable in IE10-11
|
|
3379
|
-
if (supports$1.focusChildrenOfFocusableFlexbox) {
|
|
3380
|
-
if ((0, _is.hasCssDisplayFlex)(parentStyle)) {
|
|
3381
|
-
return true;
|
|
3382
|
-
}
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
|
|
3386
|
-
// NOTE: elements marked as inert are not focusable,
|
|
3387
|
-
// but that property is not exposed to the DOM
|
|
3388
|
-
// https://www.w3.org/TR/html5/editing.html#inert
|
|
3389
|
-
|
|
3390
|
-
return false;
|
|
3391
|
-
}
|
|
3392
|
-
|
|
3393
|
-
// bind exceptions to an iterator callback
|
|
3394
|
-
isFocusRelevantRules.except = function () {
|
|
3395
|
-
var except = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3396
|
-
|
|
3397
|
-
var isFocusRelevant = function isFocusRelevant(context) {
|
|
3398
|
-
return isFocusRelevantRules({
|
|
3399
|
-
context: context,
|
|
3400
|
-
except: except
|
|
3401
|
-
});
|
|
3402
|
-
};
|
|
3403
|
-
|
|
3404
|
-
isFocusRelevant.rules = isFocusRelevantRules;
|
|
3405
|
-
return isFocusRelevant;
|
|
3406
|
-
};
|
|
3407
|
-
|
|
3408
|
-
// provide isFocusRelevant(context) as default iterator callback
|
|
3409
|
-
var isFocusRelevant = isFocusRelevantRules.except({});
|
|
3410
|
-
exports.default = isFocusRelevant;
|
|
3411
|
-
module.exports = exports['default'];
|
|
3412
|
-
|
|
3413
|
-
}(focusRelevant, focusRelevant.exports));
|
|
3414
|
-
|
|
3415
|
-
var validArea = {exports: {}};
|
|
3416
|
-
|
|
3417
|
-
var visible = {exports: {}};
|
|
3418
|
-
|
|
3419
|
-
var arrayFindIndex = {exports: {}};
|
|
3420
|
-
|
|
3421
|
-
(function (module, exports) {
|
|
3422
|
-
|
|
3423
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3424
|
-
value: true
|
|
3425
|
-
});
|
|
3426
|
-
exports.default = findIndex;
|
|
3427
|
-
function findIndex(array, callback) {
|
|
3428
|
-
// attempt to use native or polyfilled Array#findIndex first
|
|
3429
|
-
if (array.findIndex) {
|
|
3430
|
-
return array.findIndex(callback);
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
|
-
var length = array.length;
|
|
3434
|
-
|
|
3435
|
-
// shortcut if the array is empty
|
|
3436
|
-
if (length === 0) {
|
|
3437
|
-
return -1;
|
|
3438
|
-
}
|
|
3439
|
-
|
|
3440
|
-
// otherwise loop over array
|
|
3441
|
-
for (var i = 0; i < length; i++) {
|
|
3442
|
-
if (callback(array[i], i, array)) {
|
|
3443
|
-
return i;
|
|
3444
|
-
}
|
|
3445
|
-
}
|
|
3446
|
-
|
|
3447
|
-
return -1;
|
|
3448
|
-
}
|
|
3449
|
-
module.exports = exports["default"];
|
|
3450
|
-
|
|
3451
|
-
}(arrayFindIndex, arrayFindIndex.exports));
|
|
3452
|
-
|
|
3453
|
-
var getFrameElement = {exports: {}};
|
|
3454
|
-
|
|
3455
|
-
var getContentDocument = {exports: {}};
|
|
3456
|
-
|
|
3457
|
-
(function (module, exports) {
|
|
3458
|
-
|
|
3459
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3460
|
-
value: true
|
|
3461
|
-
});
|
|
3462
|
-
|
|
3463
|
-
exports.default = function (node) {
|
|
3464
|
-
try {
|
|
3465
|
-
// works on <object> and <iframe>
|
|
3466
|
-
return node.contentDocument
|
|
3467
|
-
// works on <object> and <iframe>
|
|
3468
|
-
|| node.contentWindow && node.contentWindow.document
|
|
3469
|
-
// works on <object> and <iframe> that contain SVG
|
|
3470
|
-
|| node.getSVGDocument && node.getSVGDocument() || null;
|
|
3471
|
-
} catch (e) {
|
|
3472
|
-
// SecurityError: Failed to read the 'contentDocument' property from 'HTMLObjectElement'
|
|
3473
|
-
// also IE may throw member not found exception e.g. on <object type="image/png">
|
|
3474
|
-
return null;
|
|
3475
|
-
}
|
|
3476
|
-
};
|
|
3477
|
-
|
|
3478
|
-
module.exports = exports["default"];
|
|
3479
|
-
|
|
3480
|
-
}(getContentDocument, getContentDocument.exports));
|
|
3481
|
-
|
|
3482
|
-
var getWindow = {exports: {}};
|
|
3483
|
-
|
|
3484
|
-
var getDocument = {exports: {}};
|
|
3485
|
-
|
|
3486
|
-
(function (module, exports) {
|
|
3487
|
-
|
|
3488
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3489
|
-
value: true
|
|
3490
|
-
});
|
|
3491
|
-
|
|
3492
|
-
exports.default = function (node) {
|
|
3493
|
-
if (!node) {
|
|
3494
|
-
return document;
|
|
3495
|
-
}
|
|
3496
|
-
|
|
3497
|
-
if (node.nodeType === Node.DOCUMENT_NODE) {
|
|
3498
|
-
return node;
|
|
3499
|
-
}
|
|
3500
|
-
|
|
3501
|
-
return node.ownerDocument || document;
|
|
3502
|
-
};
|
|
3503
|
-
|
|
3504
|
-
module.exports = exports["default"];
|
|
3505
|
-
|
|
3506
|
-
}(getDocument, getDocument.exports));
|
|
3507
|
-
|
|
3508
|
-
(function (module, exports) {
|
|
3509
|
-
|
|
3510
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3511
|
-
value: true
|
|
3512
|
-
});
|
|
3513
|
-
|
|
3514
|
-
exports.default = function (node) {
|
|
3515
|
-
var _document = (0, _getDocument2.default)(node);
|
|
3516
|
-
return _document.defaultView || window;
|
|
3517
|
-
};
|
|
3518
|
-
|
|
3519
|
-
var _getDocument = getDocument.exports;
|
|
3520
|
-
|
|
3521
|
-
var _getDocument2 = _interopRequireDefault(_getDocument);
|
|
3522
|
-
|
|
3523
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3524
|
-
|
|
3525
|
-
module.exports = exports['default'];
|
|
3526
|
-
|
|
3527
|
-
}(getWindow, getWindow.exports));
|
|
3528
|
-
|
|
3529
|
-
var selectInShadows = {exports: {}};
|
|
3530
|
-
|
|
3531
|
-
(function (module, exports) {
|
|
3532
|
-
|
|
3533
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3534
|
-
value: true
|
|
3535
|
-
});
|
|
3536
|
-
|
|
3537
|
-
exports.default = function (selector) {
|
|
3538
|
-
if (typeof shadowPrefix !== 'string') {
|
|
3539
|
-
var operator = (0, _cssShadowPiercingDeepCombinator2.default)();
|
|
3540
|
-
if (operator) {
|
|
3541
|
-
shadowPrefix = ', html ' + operator + ' ';
|
|
3542
|
-
}
|
|
3543
|
-
}
|
|
3544
|
-
|
|
3545
|
-
if (!shadowPrefix) {
|
|
3546
|
-
return selector;
|
|
3547
|
-
}
|
|
3548
|
-
|
|
3549
|
-
return selector + shadowPrefix + selector.replace(/\s*,\s*/g, ',').split(',').join(shadowPrefix);
|
|
3550
|
-
};
|
|
3551
|
-
|
|
3552
|
-
var _cssShadowPiercingDeepCombinator = cssShadowPiercingDeepCombinator.exports;
|
|
3553
|
-
|
|
3554
|
-
var _cssShadowPiercingDeepCombinator2 = _interopRequireDefault(_cssShadowPiercingDeepCombinator);
|
|
3555
|
-
|
|
3556
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3557
|
-
|
|
3558
|
-
var shadowPrefix = void 0;
|
|
3559
|
-
// convert a CSS selector so that it also pierces ShadowDOM
|
|
3560
|
-
// takes ".a, #b" and turns it into ".a, #b, html >>> .a, html >>> #b"
|
|
3561
|
-
|
|
3562
|
-
module.exports = exports['default'];
|
|
3563
|
-
|
|
3564
|
-
}(selectInShadows, selectInShadows.exports));
|
|
3565
|
-
|
|
3566
|
-
(function (module, exports) {
|
|
3567
|
-
|
|
3568
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3569
|
-
value: true
|
|
3570
|
-
});
|
|
3571
|
-
exports.default = getFrameElement;
|
|
3572
|
-
|
|
3573
|
-
var _getContentDocument = getContentDocument.exports;
|
|
3574
|
-
|
|
3575
|
-
var _getContentDocument2 = _interopRequireDefault(_getContentDocument);
|
|
3576
|
-
|
|
3577
|
-
var _getWindow = getWindow.exports;
|
|
3578
|
-
|
|
3579
|
-
var _getWindow2 = _interopRequireDefault(_getWindow);
|
|
3580
|
-
|
|
3581
|
-
var _selectInShadows = selectInShadows.exports;
|
|
3582
|
-
|
|
3583
|
-
var _selectInShadows2 = _interopRequireDefault(_selectInShadows);
|
|
3584
|
-
|
|
3585
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3586
|
-
|
|
3587
|
-
var selector = void 0;
|
|
3588
|
-
|
|
3589
|
-
function findDocumentHostElement(_window) {
|
|
3590
|
-
if (!selector) {
|
|
3591
|
-
selector = (0, _selectInShadows2.default)('object, iframe');
|
|
3592
|
-
}
|
|
3593
|
-
|
|
3594
|
-
if (_window._frameElement !== undefined) {
|
|
3595
|
-
return _window._frameElement;
|
|
3596
|
-
}
|
|
3597
|
-
|
|
3598
|
-
_window._frameElement = null;
|
|
3599
|
-
|
|
3600
|
-
var potentialHosts = _window.parent.document.querySelectorAll(selector);
|
|
3601
|
-
[].some.call(potentialHosts, function (element) {
|
|
3602
|
-
var _document = (0, _getContentDocument2.default)(element);
|
|
3603
|
-
if (_document !== _window.document) {
|
|
3604
|
-
return false;
|
|
3605
|
-
}
|
|
3606
|
-
|
|
3607
|
-
_window._frameElement = element;
|
|
3608
|
-
return true;
|
|
3609
|
-
});
|
|
3610
|
-
|
|
3611
|
-
return _window._frameElement;
|
|
3612
|
-
}
|
|
3613
|
-
|
|
3614
|
-
function getFrameElement(element) {
|
|
3615
|
-
var _window = (0, _getWindow2.default)(element);
|
|
3616
|
-
if (!_window.parent || _window.parent === _window) {
|
|
3617
|
-
// if there is no parent browsing context,
|
|
3618
|
-
// we're not going to get a frameElement either way
|
|
3619
|
-
return null;
|
|
3620
|
-
}
|
|
3621
|
-
|
|
3622
|
-
try {
|
|
3623
|
-
// see https://developer.mozilla.org/en-US/docs/Web/API/Window/frameElement
|
|
3624
|
-
// does not work within <embed> anywhere, and not within in <object> in IE
|
|
3625
|
-
return _window.frameElement || findDocumentHostElement(_window);
|
|
3626
|
-
} catch (e) {
|
|
3627
|
-
return null;
|
|
3628
|
-
}
|
|
3629
|
-
}
|
|
3630
|
-
module.exports = exports['default'];
|
|
3631
|
-
|
|
3632
|
-
}(getFrameElement, getFrameElement.exports));
|
|
3633
|
-
|
|
3634
|
-
(function (module, exports) {
|
|
3635
|
-
|
|
3636
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3637
|
-
value: true
|
|
3638
|
-
});
|
|
3639
|
-
|
|
3640
|
-
var _arrayFindIndex = arrayFindIndex.exports;
|
|
3641
|
-
|
|
3642
|
-
var _arrayFindIndex2 = _interopRequireDefault(_arrayFindIndex);
|
|
3643
|
-
|
|
3644
|
-
var _parents = parents.exports;
|
|
3645
|
-
|
|
3646
|
-
var _parents2 = _interopRequireDefault(_parents);
|
|
3647
|
-
|
|
3648
|
-
var _contextToElement = contextToElement.exports;
|
|
3649
|
-
|
|
3650
|
-
var _contextToElement2 = _interopRequireDefault(_contextToElement);
|
|
3651
|
-
|
|
3652
|
-
var _getFrameElement = getFrameElement.exports;
|
|
3653
|
-
|
|
3654
|
-
var _getFrameElement2 = _interopRequireDefault(_getFrameElement);
|
|
3655
|
-
|
|
3656
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3657
|
-
|
|
3658
|
-
// https://www.w3.org/TR/html5/rendering.html#being-rendered
|
|
3659
|
-
// <area> is not rendered, but we *consider* it visible to simplfiy this function's usage
|
|
3660
|
-
|
|
3661
|
-
// determine if an element is rendered
|
|
3662
|
-
// NOTE: that does not mean an element is visible in the viewport, see util/visible-area
|
|
3663
|
-
|
|
3664
|
-
var notRenderedElementsPattern = /^(area)$/;
|
|
3665
|
-
|
|
3666
|
-
function computedStyle(element, property) {
|
|
3667
|
-
return window.getComputedStyle(element, null).getPropertyValue(property);
|
|
3668
|
-
}
|
|
3669
|
-
|
|
3670
|
-
function notDisplayed(_path) {
|
|
3671
|
-
return _path.some(function (element) {
|
|
3672
|
-
// display:none is not visible (optimized away at layout)
|
|
3673
|
-
return computedStyle(element, 'display') === 'none';
|
|
3674
|
-
});
|
|
3675
|
-
}
|
|
3676
|
-
|
|
3677
|
-
function notVisible(_path) {
|
|
3678
|
-
// https://github.com/jquery/jquery-ui/blob/master/ui/core.js#L109-L114
|
|
3679
|
-
// NOTE: a nested element can reverse visibility:hidden|collapse by explicitly setting visibility:visible
|
|
3680
|
-
// NOTE: visibility can be ["", "visible", "hidden", "collapse"]
|
|
3681
|
-
var hidden = (0, _arrayFindIndex2.default)(_path, function (element) {
|
|
3682
|
-
var visibility = computedStyle(element, 'visibility');
|
|
3683
|
-
return visibility === 'hidden' || visibility === 'collapse';
|
|
3684
|
-
});
|
|
3685
|
-
|
|
3686
|
-
if (hidden === -1) {
|
|
3687
|
-
// there is no hidden element
|
|
3688
|
-
return false;
|
|
3689
|
-
}
|
|
3690
|
-
|
|
3691
|
-
var visible = (0, _arrayFindIndex2.default)(_path, function (element) {
|
|
3692
|
-
return computedStyle(element, 'visibility') === 'visible';
|
|
3693
|
-
});
|
|
3694
|
-
|
|
3695
|
-
if (visible === -1) {
|
|
3696
|
-
// there is no visible element (but a hidden element)
|
|
3697
|
-
return true;
|
|
3698
|
-
}
|
|
3699
|
-
|
|
3700
|
-
if (hidden < visible) {
|
|
3701
|
-
// there is a hidden element and it's closer than the first visible element
|
|
3702
|
-
return true;
|
|
3703
|
-
}
|
|
3704
|
-
|
|
3705
|
-
// there may be a hidden element, but the closest element is visible
|
|
3706
|
-
return false;
|
|
3707
|
-
}
|
|
3708
|
-
|
|
3709
|
-
function collapsedParent(_path) {
|
|
3710
|
-
var offset = 1;
|
|
3711
|
-
if (_path[0].nodeName.toLowerCase() === 'summary') {
|
|
3712
|
-
offset = 2;
|
|
3713
|
-
}
|
|
3714
|
-
|
|
3715
|
-
return _path.slice(offset).some(function (element) {
|
|
3716
|
-
// "content children" of a closed details element are not visible
|
|
3717
|
-
return element.nodeName.toLowerCase() === 'details' && element.open === false;
|
|
3718
|
-
});
|
|
3719
|
-
}
|
|
3720
|
-
|
|
3721
|
-
function isVisibleRules() {
|
|
3722
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
3723
|
-
context = _ref.context,
|
|
3724
|
-
_ref$except = _ref.except,
|
|
3725
|
-
except = _ref$except === undefined ? {
|
|
3726
|
-
notRendered: false,
|
|
3727
|
-
cssDisplay: false,
|
|
3728
|
-
cssVisibility: false,
|
|
3729
|
-
detailsElement: false,
|
|
3730
|
-
browsingContext: false
|
|
3731
|
-
} : _ref$except;
|
|
3732
|
-
|
|
3733
|
-
var element = (0, _contextToElement2.default)({
|
|
3734
|
-
label: 'is/visible',
|
|
3735
|
-
resolveDocument: true,
|
|
3736
|
-
context: context
|
|
3737
|
-
});
|
|
3738
|
-
|
|
3739
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
3740
|
-
if (!except.notRendered && notRenderedElementsPattern.test(nodeName)) {
|
|
3741
|
-
return true;
|
|
3742
|
-
}
|
|
3743
|
-
|
|
3744
|
-
var _path = (0, _parents2.default)({ context: element });
|
|
3745
|
-
|
|
3746
|
-
// in Internet Explorer <audio> has a default display: none, where others have display: inline
|
|
3747
|
-
// but IE allows focusing <audio style="display:none">, but not <div display:none><audio>
|
|
3748
|
-
// this is irrelevant to other browsers, as the controls attribute is required to make <audio> focusable
|
|
3749
|
-
var isAudioWithoutControls = nodeName === 'audio' && !element.hasAttribute('controls');
|
|
3750
|
-
if (!except.cssDisplay && notDisplayed(isAudioWithoutControls ? _path.slice(1) : _path)) {
|
|
3751
|
-
return false;
|
|
3752
|
-
}
|
|
3753
|
-
|
|
3754
|
-
if (!except.cssVisibility && notVisible(_path)) {
|
|
3755
|
-
return false;
|
|
3756
|
-
}
|
|
3757
|
-
|
|
3758
|
-
if (!except.detailsElement && collapsedParent(_path)) {
|
|
3759
|
-
return false;
|
|
3760
|
-
}
|
|
3761
|
-
|
|
3762
|
-
if (!except.browsingContext) {
|
|
3763
|
-
// elements within a browsing context are affected by the
|
|
3764
|
-
// browsing context host element's visibility and tabindex
|
|
3765
|
-
var frameElement = (0, _getFrameElement2.default)(element);
|
|
3766
|
-
var _isVisible = isVisibleRules.except(except);
|
|
3767
|
-
if (frameElement && !_isVisible(frameElement)) {
|
|
3768
|
-
return false;
|
|
3769
|
-
}
|
|
3770
|
-
}
|
|
3771
|
-
|
|
3772
|
-
return true;
|
|
3773
|
-
}
|
|
3774
|
-
|
|
3775
|
-
// bind exceptions to an iterator callback
|
|
3776
|
-
isVisibleRules.except = function () {
|
|
3777
|
-
var except = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3778
|
-
|
|
3779
|
-
var isVisible = function isVisible(context) {
|
|
3780
|
-
return isVisibleRules({
|
|
3781
|
-
context: context,
|
|
3782
|
-
except: except
|
|
3783
|
-
});
|
|
3784
|
-
};
|
|
3785
|
-
|
|
3786
|
-
isVisible.rules = isVisibleRules;
|
|
3787
|
-
return isVisible;
|
|
3788
|
-
};
|
|
3789
|
-
|
|
3790
|
-
// provide isVisible(context) as default iterator callback
|
|
3791
|
-
var isVisible = isVisibleRules.except({});
|
|
3792
|
-
exports.default = isVisible;
|
|
3793
|
-
module.exports = exports['default'];
|
|
3794
|
-
|
|
3795
|
-
}(visible, visible.exports));
|
|
3796
|
-
|
|
3797
|
-
var imageMap = {};
|
|
3798
|
-
|
|
3799
|
-
var css_escape = {exports: {}};
|
|
3800
|
-
|
|
3801
|
-
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
|
|
3802
|
-
|
|
3803
|
-
(function (module, exports) {
|
|
3804
|
-
(function(root, factory) {
|
|
3805
|
-
// https://github.com/umdjs/umd/blob/master/returnExports.js
|
|
3806
|
-
{
|
|
3807
|
-
// For Node.js.
|
|
3808
|
-
module.exports = factory(root);
|
|
3809
|
-
}
|
|
3810
|
-
}(typeof commonjsGlobal != 'undefined' ? commonjsGlobal : commonjsGlobal, function(root) {
|
|
3811
|
-
|
|
3812
|
-
if (root.CSS && root.CSS.escape) {
|
|
3813
|
-
return root.CSS.escape;
|
|
3814
|
-
}
|
|
3815
|
-
|
|
3816
|
-
// https://drafts.csswg.org/cssom/#serialize-an-identifier
|
|
3817
|
-
var cssEscape = function(value) {
|
|
3818
|
-
if (arguments.length == 0) {
|
|
3819
|
-
throw new TypeError('`CSS.escape` requires an argument.');
|
|
3820
|
-
}
|
|
3821
|
-
var string = String(value);
|
|
3822
|
-
var length = string.length;
|
|
3823
|
-
var index = -1;
|
|
3824
|
-
var codeUnit;
|
|
3825
|
-
var result = '';
|
|
3826
|
-
var firstCodeUnit = string.charCodeAt(0);
|
|
3827
|
-
while (++index < length) {
|
|
3828
|
-
codeUnit = string.charCodeAt(index);
|
|
3829
|
-
// Note: there’s no need to special-case astral symbols, surrogate
|
|
3830
|
-
// pairs, or lone surrogates.
|
|
3831
|
-
|
|
3832
|
-
// If the character is NULL (U+0000), then the REPLACEMENT CHARACTER
|
|
3833
|
-
// (U+FFFD).
|
|
3834
|
-
if (codeUnit == 0x0000) {
|
|
3835
|
-
result += '\uFFFD';
|
|
3836
|
-
continue;
|
|
3837
|
-
}
|
|
3838
|
-
|
|
3839
|
-
if (
|
|
3840
|
-
// If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
|
|
3841
|
-
// U+007F, […]
|
|
3842
|
-
(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||
|
|
3843
|
-
// If the character is the first character and is in the range [0-9]
|
|
3844
|
-
// (U+0030 to U+0039), […]
|
|
3845
|
-
(index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||
|
|
3846
|
-
// If the character is the second character and is in the range [0-9]
|
|
3847
|
-
// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]
|
|
3848
|
-
(
|
|
3849
|
-
index == 1 &&
|
|
3850
|
-
codeUnit >= 0x0030 && codeUnit <= 0x0039 &&
|
|
3851
|
-
firstCodeUnit == 0x002D
|
|
3852
|
-
)
|
|
3853
|
-
) {
|
|
3854
|
-
// https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
|
|
3855
|
-
result += '\\' + codeUnit.toString(16) + ' ';
|
|
3856
|
-
continue;
|
|
3857
|
-
}
|
|
3858
|
-
|
|
3859
|
-
if (
|
|
3860
|
-
// If the character is the first character and is a `-` (U+002D), and
|
|
3861
|
-
// there is no second character, […]
|
|
3862
|
-
index == 0 &&
|
|
3863
|
-
length == 1 &&
|
|
3864
|
-
codeUnit == 0x002D
|
|
3865
|
-
) {
|
|
3866
|
-
result += '\\' + string.charAt(index);
|
|
3867
|
-
continue;
|
|
3868
|
-
}
|
|
3869
|
-
|
|
3870
|
-
// If the character is not handled by one of the above rules and is
|
|
3871
|
-
// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or
|
|
3872
|
-
// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to
|
|
3873
|
-
// U+005A), or [a-z] (U+0061 to U+007A), […]
|
|
3874
|
-
if (
|
|
3875
|
-
codeUnit >= 0x0080 ||
|
|
3876
|
-
codeUnit == 0x002D ||
|
|
3877
|
-
codeUnit == 0x005F ||
|
|
3878
|
-
codeUnit >= 0x0030 && codeUnit <= 0x0039 ||
|
|
3879
|
-
codeUnit >= 0x0041 && codeUnit <= 0x005A ||
|
|
3880
|
-
codeUnit >= 0x0061 && codeUnit <= 0x007A
|
|
3881
|
-
) {
|
|
3882
|
-
// the character itself
|
|
3883
|
-
result += string.charAt(index);
|
|
3884
|
-
continue;
|
|
3885
|
-
}
|
|
3886
|
-
|
|
3887
|
-
// Otherwise, the escaped character.
|
|
3888
|
-
// https://drafts.csswg.org/cssom/#escape-a-character
|
|
3889
|
-
result += '\\' + string.charAt(index);
|
|
3890
|
-
|
|
3891
|
-
}
|
|
3892
|
-
return result;
|
|
3893
|
-
};
|
|
3894
|
-
|
|
3895
|
-
if (!root.CSS) {
|
|
3896
|
-
root.CSS = {};
|
|
3897
|
-
}
|
|
3898
|
-
|
|
3899
|
-
root.CSS.escape = cssEscape;
|
|
3900
|
-
return cssEscape;
|
|
3901
|
-
|
|
3902
|
-
}));
|
|
3903
|
-
}(css_escape));
|
|
3904
|
-
|
|
3905
|
-
Object.defineProperty(imageMap, "__esModule", {
|
|
3906
|
-
value: true
|
|
3907
|
-
});
|
|
3908
|
-
imageMap.getMapByName = getMapByName;
|
|
3909
|
-
imageMap.getMapOfImage = getMapOfImage;
|
|
3910
|
-
imageMap.getImageOfArea = getImageOfArea;
|
|
3911
|
-
|
|
3912
|
-
var _css = css_escape.exports;
|
|
3913
|
-
|
|
3914
|
-
var _css2 = _interopRequireDefault(_css);
|
|
3915
|
-
|
|
3916
|
-
var _getDocument = getDocument.exports;
|
|
3917
|
-
|
|
3918
|
-
var _getDocument2 = _interopRequireDefault(_getDocument);
|
|
3919
|
-
|
|
3920
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3921
|
-
|
|
3922
|
-
function getMapByName(name, _document) {
|
|
3923
|
-
// apparently getElementsByName() also considers id attribute in IE & opera
|
|
3924
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByName
|
|
3925
|
-
var map = _document.querySelector('map[name="' + (0, _css2.default)(name) + '"]');
|
|
3926
|
-
return map || null;
|
|
3927
|
-
}
|
|
3928
|
-
|
|
3929
|
-
function getMapOfImage(element) {
|
|
3930
|
-
var usemap = element.getAttribute('usemap');
|
|
3931
|
-
if (!usemap) {
|
|
3932
|
-
return null;
|
|
3933
|
-
}
|
|
3934
|
-
|
|
3935
|
-
var _document = (0, _getDocument2.default)(element);
|
|
3936
|
-
return getMapByName(usemap.slice(1), _document);
|
|
3937
|
-
}
|
|
3938
|
-
|
|
3939
|
-
function getImageOfArea(element) {
|
|
3940
|
-
var map = element.parentElement;
|
|
3941
|
-
|
|
3942
|
-
if (!map.name || map.nodeName.toLowerCase() !== 'map') {
|
|
3943
|
-
return null;
|
|
3944
|
-
}
|
|
3945
|
-
|
|
3946
|
-
// NOTE: image maps can also be applied to <object> with image content,
|
|
3947
|
-
// but no browser supports this at the moment
|
|
3948
|
-
|
|
3949
|
-
// HTML5 specifies HTMLMapElement.images to be an HTMLCollection of all
|
|
3950
|
-
// <img> and <object> referencing the <map> element, but no browser implements this
|
|
3951
|
-
// https://www.w3.org/TR/html5/embedded-content-0.html#the-map-element
|
|
3952
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLMapElement
|
|
3953
|
-
// the image must be valid and loaded for the map to take effect
|
|
3954
|
-
var _document = (0, _getDocument2.default)(element);
|
|
3955
|
-
return _document.querySelector('img[usemap="#' + (0, _css2.default)(map.name) + '"]') || null;
|
|
3956
|
-
}
|
|
3957
|
-
|
|
3958
|
-
(function (module, exports) {
|
|
3959
|
-
|
|
3960
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3961
|
-
value: true
|
|
3962
|
-
});
|
|
3963
|
-
|
|
3964
|
-
exports.default = function (context) {
|
|
3965
|
-
if (!supports$1) {
|
|
3966
|
-
supports$1 = (0, _supports3.default)();
|
|
3967
|
-
}
|
|
3968
|
-
|
|
3969
|
-
var element = (0, _contextToElement2.default)({
|
|
3970
|
-
label: 'is/valid-area',
|
|
3971
|
-
context: context
|
|
3972
|
-
});
|
|
3973
|
-
|
|
3974
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
3975
|
-
if (nodeName !== 'area') {
|
|
3976
|
-
return false;
|
|
3977
|
-
}
|
|
3978
|
-
|
|
3979
|
-
var hasTabindex = element.hasAttribute('tabindex');
|
|
3980
|
-
if (!supports$1.focusAreaTabindex && hasTabindex) {
|
|
3981
|
-
// Blink and WebKit do not consider <area tabindex="-1" href="#void"> focusable
|
|
3982
|
-
return false;
|
|
3983
|
-
}
|
|
3984
|
-
|
|
3985
|
-
var img = (0, _imageMap.getImageOfArea)(element);
|
|
3986
|
-
if (!img || !(0, _visible2.default)(img)) {
|
|
3987
|
-
return false;
|
|
3988
|
-
}
|
|
3989
|
-
|
|
3990
|
-
// Firefox only allows fully loaded images to reference image maps
|
|
3991
|
-
// https://stereochro.me/ideas/detecting-broken-images-js
|
|
3992
|
-
if (!supports$1.focusBrokenImageMap && (!img.complete || !img.naturalHeight || img.offsetWidth <= 0 || img.offsetHeight <= 0)) {
|
|
3993
|
-
return false;
|
|
3994
|
-
}
|
|
3995
|
-
|
|
3996
|
-
// Firefox supports.can focus area elements even if they don't have an href attribute
|
|
3997
|
-
if (!supports$1.focusAreaWithoutHref && !element.href) {
|
|
3998
|
-
// Internet explorer supports.can focus area elements without href if either
|
|
3999
|
-
// the area element or the image element has a tabindex attribute
|
|
4000
|
-
return supports$1.focusAreaTabindex && hasTabindex || supports$1.focusAreaImgTabindex && img.hasAttribute('tabindex');
|
|
4001
|
-
}
|
|
4002
|
-
|
|
4003
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-usemap
|
|
4004
|
-
var childOfInteractive = (0, _parents2.default)({ context: img }).slice(1).some(function (_element) {
|
|
4005
|
-
var name = _element.nodeName.toLowerCase();
|
|
4006
|
-
return name === 'button' || name === 'a';
|
|
4007
|
-
});
|
|
4008
|
-
|
|
4009
|
-
if (childOfInteractive) {
|
|
4010
|
-
return false;
|
|
4011
|
-
}
|
|
4012
|
-
|
|
4013
|
-
return true;
|
|
4014
|
-
};
|
|
4015
|
-
|
|
4016
|
-
var _contextToElement = contextToElement.exports;
|
|
4017
|
-
|
|
4018
|
-
var _contextToElement2 = _interopRequireDefault(_contextToElement);
|
|
4019
|
-
|
|
4020
|
-
var _visible = visible.exports;
|
|
4021
|
-
|
|
4022
|
-
var _visible2 = _interopRequireDefault(_visible);
|
|
4023
|
-
|
|
4024
|
-
var _parents = parents.exports;
|
|
4025
|
-
|
|
4026
|
-
var _parents2 = _interopRequireDefault(_parents);
|
|
4027
|
-
|
|
4028
|
-
var _imageMap = imageMap;
|
|
4029
|
-
|
|
4030
|
-
var _supports2 = supports.exports;
|
|
4031
|
-
|
|
4032
|
-
var _supports3 = _interopRequireDefault(_supports2);
|
|
4033
|
-
|
|
4034
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
4035
|
-
|
|
4036
|
-
var supports$1 = void 0;
|
|
4037
|
-
|
|
4038
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map
|
|
4039
|
-
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-usemap
|
|
4040
|
-
// https://github.com/jquery/jquery-ui/blob/master/ui/core.js#L88-L107
|
|
4041
|
-
|
|
4042
|
-
// determine if an <area> element is being properly used by and <img> via a <map>
|
|
4043
|
-
|
|
4044
|
-
module.exports = exports['default'];
|
|
4045
|
-
|
|
4046
|
-
}(validArea, validArea.exports));
|
|
4047
|
-
|
|
4048
|
-
var disabled = {exports: {}};
|
|
4049
|
-
|
|
4050
|
-
var nativeDisabledSupported = {exports: {}};
|
|
4051
|
-
|
|
4052
|
-
(function (module, exports) {
|
|
4053
|
-
|
|
4054
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4055
|
-
value: true
|
|
4056
|
-
});
|
|
4057
|
-
|
|
4058
|
-
exports.default = function (context) {
|
|
4059
|
-
if (!supports$1) {
|
|
4060
|
-
supports$1 = (0, _supports3.default)();
|
|
4061
|
-
|
|
4062
|
-
if (supports$1.focusFieldsetDisabled) {
|
|
4063
|
-
delete disabledElements.fieldset;
|
|
4064
|
-
}
|
|
4065
|
-
|
|
4066
|
-
if (supports$1.focusFormDisabled) {
|
|
4067
|
-
delete disabledElements.form;
|
|
4068
|
-
}
|
|
4069
|
-
|
|
4070
|
-
disabledElementsPattern = new RegExp('^(' + Object.keys(disabledElements).join('|') + ')$');
|
|
4071
|
-
}
|
|
4072
|
-
|
|
4073
|
-
var element = (0, _contextToElement2.default)({
|
|
4074
|
-
label: 'is/native-disabled-supported',
|
|
4075
|
-
context: context
|
|
4076
|
-
});
|
|
4077
|
-
|
|
4078
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
4079
|
-
return Boolean(disabledElementsPattern.test(nodeName));
|
|
4080
|
-
};
|
|
4081
|
-
|
|
4082
|
-
var _contextToElement = contextToElement.exports;
|
|
4083
|
-
|
|
4084
|
-
var _contextToElement2 = _interopRequireDefault(_contextToElement);
|
|
4085
|
-
|
|
4086
|
-
var _supports2 = supports.exports;
|
|
4087
|
-
|
|
4088
|
-
var _supports3 = _interopRequireDefault(_supports2);
|
|
4089
|
-
|
|
4090
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
4091
|
-
|
|
4092
|
-
// Determine if an element supports the disabled attribute
|
|
4093
|
-
|
|
4094
|
-
var supports$1 = void 0;
|
|
4095
|
-
|
|
4096
|
-
// https://www.w3.org/TR/html5/disabled-elements.html#concept-element-disabled
|
|
4097
|
-
var disabledElementsPattern = void 0;
|
|
4098
|
-
var disabledElements = {
|
|
4099
|
-
input: true,
|
|
4100
|
-
select: true,
|
|
4101
|
-
textarea: true,
|
|
4102
|
-
button: true,
|
|
4103
|
-
fieldset: true,
|
|
4104
|
-
form: true
|
|
4105
|
-
};
|
|
4106
|
-
|
|
4107
|
-
module.exports = exports['default'];
|
|
4108
|
-
|
|
4109
|
-
}(nativeDisabledSupported, nativeDisabledSupported.exports));
|
|
4110
|
-
|
|
4111
|
-
(function (module, exports) {
|
|
4112
|
-
|
|
4113
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4114
|
-
value: true
|
|
4115
|
-
});
|
|
4116
|
-
|
|
4117
|
-
exports.default = function (context) {
|
|
4118
|
-
if (!supports$1) {
|
|
4119
|
-
supports$1 = (0, _supports3.default)();
|
|
4120
|
-
}
|
|
4121
|
-
|
|
4122
|
-
var element = (0, _contextToElement2.default)({
|
|
4123
|
-
label: 'is/disabled',
|
|
4124
|
-
context: context
|
|
4125
|
-
});
|
|
4126
|
-
|
|
4127
|
-
if (element.hasAttribute('data-ally-disabled')) {
|
|
4128
|
-
// treat ally's element/disabled like the DOM native element.disabled
|
|
4129
|
-
return true;
|
|
4130
|
-
}
|
|
4131
|
-
|
|
4132
|
-
if (!(0, _nativeDisabledSupported2.default)(element)) {
|
|
4133
|
-
// non-form elements do not support the disabled attribute
|
|
4134
|
-
return false;
|
|
4135
|
-
}
|
|
4136
|
-
|
|
4137
|
-
if (element.disabled) {
|
|
4138
|
-
// the element itself is disabled
|
|
4139
|
-
return true;
|
|
4140
|
-
}
|
|
4141
|
-
|
|
4142
|
-
var parents = (0, _parents2.default)({ context: element });
|
|
4143
|
-
if (parents.some(isDisabledFieldset)) {
|
|
4144
|
-
// a parental <fieldset> is disabld and inherits the state onto this element
|
|
4145
|
-
return true;
|
|
4146
|
-
}
|
|
4147
|
-
|
|
4148
|
-
if (!supports$1.focusFormDisabled && parents.some(isDisabledForm)) {
|
|
4149
|
-
// a parental <form> is disabld and inherits the state onto this element
|
|
4150
|
-
return true;
|
|
4151
|
-
}
|
|
4152
|
-
|
|
4153
|
-
return false;
|
|
4154
|
-
};
|
|
4155
|
-
|
|
4156
|
-
var _contextToElement = contextToElement.exports;
|
|
4157
|
-
|
|
4158
|
-
var _contextToElement2 = _interopRequireDefault(_contextToElement);
|
|
4159
|
-
|
|
4160
|
-
var _parents = parents.exports;
|
|
4161
|
-
|
|
4162
|
-
var _parents2 = _interopRequireDefault(_parents);
|
|
4163
|
-
|
|
4164
|
-
var _nativeDisabledSupported = nativeDisabledSupported.exports;
|
|
4165
|
-
|
|
4166
|
-
var _nativeDisabledSupported2 = _interopRequireDefault(_nativeDisabledSupported);
|
|
4167
|
-
|
|
4168
|
-
var _supports2 = supports.exports;
|
|
4169
|
-
|
|
4170
|
-
var _supports3 = _interopRequireDefault(_supports2);
|
|
4171
|
-
|
|
4172
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
4173
|
-
|
|
4174
|
-
// Determine if an element is disabled (i.e. not editable)
|
|
4175
|
-
|
|
4176
|
-
var supports$1 = void 0;
|
|
4177
|
-
|
|
4178
|
-
function isDisabledFieldset(element) {
|
|
4179
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
4180
|
-
return nodeName === 'fieldset' && element.disabled;
|
|
4181
|
-
}
|
|
4182
|
-
|
|
4183
|
-
function isDisabledForm(element) {
|
|
4184
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
4185
|
-
return nodeName === 'form' && element.disabled;
|
|
4186
|
-
}
|
|
4187
|
-
|
|
4188
|
-
module.exports = exports['default'];
|
|
4189
|
-
|
|
4190
|
-
}(disabled, disabled.exports));
|
|
4191
|
-
|
|
4192
|
-
var onlyTabbable = {exports: {}};
|
|
4193
|
-
|
|
4194
|
-
(function (module, exports) {
|
|
4195
|
-
|
|
4196
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4197
|
-
value: true
|
|
4198
|
-
});
|
|
4199
|
-
|
|
4200
|
-
var _visible = visible.exports;
|
|
4201
|
-
|
|
4202
|
-
var _visible2 = _interopRequireDefault(_visible);
|
|
4203
|
-
|
|
4204
|
-
var _contextToElement = contextToElement.exports;
|
|
4205
|
-
|
|
4206
|
-
var _contextToElement2 = _interopRequireDefault(_contextToElement);
|
|
4207
|
-
|
|
4208
|
-
var _getFrameElement = getFrameElement.exports;
|
|
4209
|
-
|
|
4210
|
-
var _getFrameElement2 = _interopRequireDefault(_getFrameElement);
|
|
4211
|
-
|
|
4212
|
-
var _tabindexValue = tabindexValue.exports;
|
|
4213
|
-
|
|
4214
|
-
var _tabindexValue2 = _interopRequireDefault(_tabindexValue);
|
|
4215
|
-
|
|
4216
|
-
var _platform = platform$1.exports;
|
|
4217
|
-
|
|
4218
|
-
var _platform2 = _interopRequireDefault(_platform);
|
|
4219
|
-
|
|
4220
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
4221
|
-
|
|
4222
|
-
function isOnlyTabbableRules() {
|
|
4223
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
4224
|
-
context = _ref.context,
|
|
4225
|
-
_ref$except = _ref.except,
|
|
4226
|
-
except = _ref$except === undefined ? {
|
|
4227
|
-
onlyFocusableBrowsingContext: false,
|
|
4228
|
-
visible: false
|
|
4229
|
-
} : _ref$except;
|
|
4230
|
-
|
|
4231
|
-
var element = (0, _contextToElement2.default)({
|
|
4232
|
-
label: 'is/only-tabbable',
|
|
4233
|
-
resolveDocument: true,
|
|
4234
|
-
context: context
|
|
4235
|
-
});
|
|
4236
|
-
|
|
4237
|
-
if (!except.visible && !(0, _visible2.default)(element)) {
|
|
4238
|
-
return false;
|
|
4239
|
-
}
|
|
4240
|
-
|
|
4241
|
-
if (!except.onlyFocusableBrowsingContext && (_platform2.default.is.GECKO || _platform2.default.is.TRIDENT || _platform2.default.is.EDGE)) {
|
|
4242
|
-
var frameElement = (0, _getFrameElement2.default)(element);
|
|
4243
|
-
if (frameElement) {
|
|
4244
|
-
if ((0, _tabindexValue2.default)(frameElement) < 0) {
|
|
4245
|
-
// iframe[tabindex="-1"] and object[tabindex="-1"] inherit the
|
|
4246
|
-
// tabbable demotion onto elements of their browsing contexts
|
|
4247
|
-
return false;
|
|
4248
|
-
}
|
|
4249
|
-
}
|
|
4250
|
-
}
|
|
4251
|
-
|
|
4252
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
4253
|
-
var tabindex = (0, _tabindexValue2.default)(element);
|
|
4254
|
-
|
|
4255
|
-
if (nodeName === 'label' && _platform2.default.is.GECKO) {
|
|
4256
|
-
// Firefox cannot focus, but tab to: label[tabindex=0]
|
|
4257
|
-
return tabindex !== null && tabindex >= 0;
|
|
4258
|
-
}
|
|
4259
|
-
|
|
4260
|
-
// SVG Elements were keyboard focusable but not script focusable before Firefox 51.
|
|
4261
|
-
// Firefox 51 added the focus management DOM API (.focus and .blur) to SVGElement,
|
|
4262
|
-
// see https://bugzilla.mozilla.org/show_bug.cgi?id=778654
|
|
4263
|
-
if (_platform2.default.is.GECKO && element.ownerSVGElement && !element.focus) {
|
|
4264
|
-
if (nodeName === 'a' && element.hasAttribute('xlink:href')) {
|
|
4265
|
-
// any focusable child of <svg> cannot be focused, but tabbed to
|
|
4266
|
-
if (_platform2.default.is.GECKO) {
|
|
4267
|
-
return true;
|
|
4268
|
-
}
|
|
4269
|
-
}
|
|
4270
|
-
}
|
|
4271
|
-
|
|
4272
|
-
return false;
|
|
4273
|
-
}
|
|
4274
|
-
|
|
4275
|
-
// bind exceptions to an iterator callback
|
|
4276
|
-
isOnlyTabbableRules.except = function () {
|
|
4277
|
-
var except = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4278
|
-
|
|
4279
|
-
var isOnlyTabbable = function isOnlyTabbable(context) {
|
|
4280
|
-
return isOnlyTabbableRules({
|
|
4281
|
-
context: context,
|
|
4282
|
-
except: except
|
|
4283
|
-
});
|
|
4284
|
-
};
|
|
4285
|
-
|
|
4286
|
-
isOnlyTabbable.rules = isOnlyTabbableRules;
|
|
4287
|
-
return isOnlyTabbable;
|
|
4288
|
-
};
|
|
4289
|
-
|
|
4290
|
-
// provide isOnlyTabbable(context) as default iterator callback
|
|
4291
|
-
var isOnlyTabbable = isOnlyTabbableRules.except({});
|
|
4292
|
-
exports.default = isOnlyTabbable;
|
|
4293
|
-
module.exports = exports['default'];
|
|
4294
|
-
|
|
4295
|
-
}(onlyTabbable, onlyTabbable.exports));
|
|
4296
|
-
|
|
4297
|
-
(function (module, exports) {
|
|
4298
|
-
|
|
4299
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4300
|
-
value: true
|
|
4301
|
-
});
|
|
4302
|
-
|
|
4303
|
-
var _focusRelevant = focusRelevant.exports;
|
|
4304
|
-
|
|
4305
|
-
var _focusRelevant2 = _interopRequireDefault(_focusRelevant);
|
|
4306
|
-
|
|
4307
|
-
var _validArea = validArea.exports;
|
|
4308
|
-
|
|
4309
|
-
var _validArea2 = _interopRequireDefault(_validArea);
|
|
4310
|
-
|
|
4311
|
-
var _visible = visible.exports;
|
|
4312
|
-
|
|
4313
|
-
var _visible2 = _interopRequireDefault(_visible);
|
|
4314
|
-
|
|
4315
|
-
var _disabled = disabled.exports;
|
|
4316
|
-
|
|
4317
|
-
var _disabled2 = _interopRequireDefault(_disabled);
|
|
4318
|
-
|
|
4319
|
-
var _onlyTabbable = onlyTabbable.exports;
|
|
4320
|
-
|
|
4321
|
-
var _onlyTabbable2 = _interopRequireDefault(_onlyTabbable);
|
|
4322
|
-
|
|
4323
|
-
var _contextToElement = contextToElement.exports;
|
|
4324
|
-
|
|
4325
|
-
var _contextToElement2 = _interopRequireDefault(_contextToElement);
|
|
4326
|
-
|
|
4327
|
-
var _getFrameElement = getFrameElement.exports;
|
|
4328
|
-
|
|
4329
|
-
var _getFrameElement2 = _interopRequireDefault(_getFrameElement);
|
|
4330
|
-
|
|
4331
|
-
var _tabindexValue = tabindexValue.exports;
|
|
4332
|
-
|
|
4333
|
-
var _tabindexValue2 = _interopRequireDefault(_tabindexValue);
|
|
4334
|
-
|
|
4335
|
-
var _supports2 = supports.exports;
|
|
4336
|
-
|
|
4337
|
-
var _supports3 = _interopRequireDefault(_supports2);
|
|
4338
|
-
|
|
4339
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
4340
|
-
|
|
4341
|
-
var supports$1 = void 0;
|
|
4342
|
-
// determine if an element can be focused
|
|
4343
|
-
|
|
4344
|
-
// https://www.w3.org/TR/html5/editing.html#focus-management
|
|
4345
|
-
|
|
4346
|
-
// NOTE: The following known issues exist:
|
|
4347
|
-
// Gecko: `svg a[xlink|href]` is not identified as focusable (because SVGElement.prototype.focus is missing)
|
|
4348
|
-
// Blink, WebKit: SVGElements that have been made focusable by adding a focus event listener are not identified as focusable
|
|
4349
|
-
|
|
4350
|
-
function isOnlyFocusRelevant(element) {
|
|
4351
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
4352
|
-
if (nodeName === 'embed' || nodeName === 'keygen') {
|
|
4353
|
-
// embed is considered focus-relevant but not focusable
|
|
4354
|
-
// see https://github.com/medialize/ally.js/issues/82
|
|
4355
|
-
return true;
|
|
4356
|
-
}
|
|
4357
|
-
|
|
4358
|
-
var _tabindex = (0, _tabindexValue2.default)(element);
|
|
4359
|
-
if (element.shadowRoot && _tabindex === null) {
|
|
4360
|
-
// ShadowDOM host elements *may* receive focus
|
|
4361
|
-
// even though they are not considered focuable
|
|
4362
|
-
return true;
|
|
4363
|
-
}
|
|
4364
|
-
|
|
4365
|
-
if (nodeName === 'label') {
|
|
4366
|
-
// <label tabindex="0"> is only tabbable in Firefox, not script-focusable
|
|
4367
|
-
// there's no way to make an element focusable other than by adding a tabindex,
|
|
4368
|
-
// and focus behavior of the label element seems hard-wired to ignore tabindex
|
|
4369
|
-
// in some browsers (like Gecko, Blink and WebKit)
|
|
4370
|
-
return !supports$1.focusLabelTabindex || _tabindex === null;
|
|
4371
|
-
}
|
|
4372
|
-
|
|
4373
|
-
if (nodeName === 'legend') {
|
|
4374
|
-
return _tabindex === null;
|
|
4375
|
-
}
|
|
4376
|
-
|
|
4377
|
-
if (supports$1.focusSvgFocusableAttribute && (element.ownerSVGElement || nodeName === 'svg')) {
|
|
4378
|
-
// Internet Explorer understands the focusable attribute introduced in SVG Tiny 1.2
|
|
4379
|
-
var focusableAttribute = element.getAttribute('focusable');
|
|
4380
|
-
return focusableAttribute && focusableAttribute === 'false';
|
|
4381
|
-
}
|
|
4382
|
-
|
|
4383
|
-
if (nodeName === 'img' && element.hasAttribute('usemap')) {
|
|
4384
|
-
// Gecko, Trident and Edge do not allow an image with an image map and tabindex to be focused,
|
|
4385
|
-
// it appears the tabindex is overruled so focus is still forwarded to the <map>
|
|
4386
|
-
return _tabindex === null || !supports$1.focusImgUsemapTabindex;
|
|
4387
|
-
}
|
|
4388
|
-
|
|
4389
|
-
if (nodeName === 'area') {
|
|
4390
|
-
// all <area>s are considered relevant,
|
|
4391
|
-
// but only the valid <area>s are focusable
|
|
4392
|
-
return !(0, _validArea2.default)(element);
|
|
4393
|
-
}
|
|
4394
|
-
|
|
4395
|
-
return false;
|
|
4396
|
-
}
|
|
4397
|
-
|
|
4398
|
-
function isFocusableRules() {
|
|
4399
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
4400
|
-
context = _ref.context,
|
|
4401
|
-
_ref$except = _ref.except,
|
|
4402
|
-
except = _ref$except === undefined ? {
|
|
4403
|
-
disabled: false,
|
|
4404
|
-
visible: false,
|
|
4405
|
-
onlyTabbable: false
|
|
4406
|
-
} : _ref$except;
|
|
4407
|
-
|
|
4408
|
-
if (!supports$1) {
|
|
4409
|
-
supports$1 = (0, _supports3.default)();
|
|
4410
|
-
}
|
|
4411
|
-
|
|
4412
|
-
var _isOnlyTabbable = _onlyTabbable2.default.rules.except({
|
|
4413
|
-
onlyFocusableBrowsingContext: true,
|
|
4414
|
-
visible: except.visible
|
|
4415
|
-
});
|
|
4416
|
-
|
|
4417
|
-
var element = (0, _contextToElement2.default)({
|
|
4418
|
-
label: 'is/focusable',
|
|
4419
|
-
resolveDocument: true,
|
|
4420
|
-
context: context
|
|
4421
|
-
});
|
|
4422
|
-
|
|
4423
|
-
var focusRelevant = _focusRelevant2.default.rules({
|
|
4424
|
-
context: element,
|
|
4425
|
-
except: except
|
|
4426
|
-
});
|
|
4427
|
-
|
|
4428
|
-
if (!focusRelevant || isOnlyFocusRelevant(element)) {
|
|
4429
|
-
return false;
|
|
4430
|
-
}
|
|
4431
|
-
|
|
4432
|
-
if (!except.disabled && (0, _disabled2.default)(element)) {
|
|
4433
|
-
return false;
|
|
4434
|
-
}
|
|
4435
|
-
|
|
4436
|
-
if (!except.onlyTabbable && _isOnlyTabbable(element)) {
|
|
4437
|
-
// some elements may be keyboard focusable, but not script focusable
|
|
4438
|
-
return false;
|
|
4439
|
-
}
|
|
4440
|
-
|
|
4441
|
-
// elements that are not rendered, cannot be focused
|
|
4442
|
-
if (!except.visible) {
|
|
4443
|
-
var visibilityOptions = {
|
|
4444
|
-
context: element,
|
|
4445
|
-
except: {}
|
|
4446
|
-
};
|
|
4447
|
-
|
|
4448
|
-
if (supports$1.focusInHiddenIframe) {
|
|
4449
|
-
// WebKit and Blink can focus content in hidden <iframe> and <object>
|
|
4450
|
-
visibilityOptions.except.browsingContext = true;
|
|
4451
|
-
}
|
|
4452
|
-
|
|
4453
|
-
if (supports$1.focusObjectSvgHidden) {
|
|
4454
|
-
// Blink allows focusing the object element, even if it has visibility: hidden;
|
|
4455
|
-
// @browser-issue Blink https://code.google.com/p/chromium/issues/detail?id=586191
|
|
4456
|
-
var _nodeName2 = element.nodeName.toLowerCase();
|
|
4457
|
-
if (_nodeName2 === 'object') {
|
|
4458
|
-
visibilityOptions.except.cssVisibility = true;
|
|
4459
|
-
}
|
|
4460
|
-
}
|
|
4461
|
-
|
|
4462
|
-
if (!_visible2.default.rules(visibilityOptions)) {
|
|
4463
|
-
return false;
|
|
4464
|
-
}
|
|
4465
|
-
}
|
|
4466
|
-
|
|
4467
|
-
var frameElement = (0, _getFrameElement2.default)(element);
|
|
4468
|
-
if (frameElement) {
|
|
4469
|
-
var _nodeName = frameElement.nodeName.toLowerCase();
|
|
4470
|
-
if (_nodeName === 'object' && !supports$1.focusInZeroDimensionObject) {
|
|
4471
|
-
if (!frameElement.offsetWidth || !frameElement.offsetHeight) {
|
|
4472
|
-
// WebKit can not focus content in <object> if it doesn't have dimensions
|
|
4473
|
-
return false;
|
|
4474
|
-
}
|
|
4475
|
-
}
|
|
4476
|
-
}
|
|
4477
|
-
|
|
4478
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
4479
|
-
if (nodeName === 'svg' && supports$1.focusSvgInIframe && !frameElement && element.getAttribute('tabindex') === null) {
|
|
4480
|
-
return false;
|
|
4481
|
-
}
|
|
4482
|
-
|
|
4483
|
-
return true;
|
|
4484
|
-
}
|
|
4485
|
-
|
|
4486
|
-
// bind exceptions to an iterator callback
|
|
4487
|
-
isFocusableRules.except = function () {
|
|
4488
|
-
var except = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4489
|
-
|
|
4490
|
-
var isFocusable = function isFocusable(context) {
|
|
4491
|
-
return isFocusableRules({
|
|
4492
|
-
context: context,
|
|
4493
|
-
except: except
|
|
4494
|
-
});
|
|
4495
|
-
};
|
|
4496
|
-
|
|
4497
|
-
isFocusable.rules = isFocusableRules;
|
|
4498
|
-
return isFocusable;
|
|
4499
|
-
};
|
|
4500
|
-
|
|
4501
|
-
// provide isFocusRelevant(context) as default iterator callback
|
|
4502
|
-
var isFocusable = isFocusableRules.except({});
|
|
4503
|
-
exports.default = isFocusable;
|
|
4504
|
-
module.exports = exports['default'];
|
|
4505
|
-
|
|
4506
|
-
}(focusable, focusable.exports));
|
|
4507
|
-
|
|
4508
|
-
const isFocusable = /*@__PURE__*/getDefaultExportFromCjs(focusable.exports);
|
|
4509
|
-
|
|
4510
|
-
const postTooltipTriggerCss = "post-tooltip-trigger{vertical-align:top}";
|
|
4511
|
-
const PostTooltipTriggerStyle0 = postTooltipTriggerCss;
|
|
4512
|
-
|
|
4513
|
-
const TRIGGER_EVENTS = ['pointerenter', 'pointerleave', 'focusin', 'focusout', 'long-press'];
|
|
4514
|
-
if (IS_BROWSER) {
|
|
4515
|
-
(async () => {
|
|
4516
|
-
await import('./long-press-event-04d24397.js');
|
|
4517
|
-
})();
|
|
4518
|
-
}
|
|
4519
|
-
const PostTooltipTrigger = class {
|
|
4520
|
-
constructor(hostRef) {
|
|
4521
|
-
registerInstance(this, hostRef);
|
|
4522
|
-
/**
|
|
4523
|
-
* Reference to the element inside the host that will act as the trigger.
|
|
4524
|
-
*/
|
|
4525
|
-
this.trigger = null;
|
|
4526
|
-
/**
|
|
4527
|
-
* Timeout ID for the delay.
|
|
4528
|
-
*/
|
|
4529
|
-
this.delayTimeout = null;
|
|
4530
|
-
this.for = undefined;
|
|
4531
|
-
this.delay = 0;
|
|
4532
|
-
this.boundTriggerHandler = this.handleTriggerEvent.bind(this);
|
|
4533
|
-
this.boundTooltipHandler = this.handleTooltipEvent.bind(this);
|
|
4534
|
-
}
|
|
4535
|
-
validateControlFor() {
|
|
4536
|
-
checkEmptyOrType(this, 'for', 'string');
|
|
4537
|
-
}
|
|
4538
|
-
get tooltip() {
|
|
4539
|
-
if (!IS_BROWSER)
|
|
4540
|
-
return null;
|
|
4541
|
-
const ref = document.getElementById(this.for);
|
|
4542
|
-
return ref?.localName === 'post-tooltip' ? ref : null;
|
|
4543
|
-
}
|
|
4544
|
-
componentDidLoad() {
|
|
4545
|
-
this.setupTrigger();
|
|
4546
|
-
this.attachListeners();
|
|
4547
|
-
this.attachTooltipListeners();
|
|
4548
|
-
}
|
|
4549
|
-
disconnectedCallback() {
|
|
4550
|
-
this.removeListeners();
|
|
4551
|
-
this.removeTooltipListeners();
|
|
4552
|
-
this.cleanupTrigger();
|
|
4553
|
-
if (this.delayTimeout) {
|
|
4554
|
-
clearTimeout(this.delayTimeout);
|
|
4555
|
-
this.delayTimeout = null;
|
|
4556
|
-
}
|
|
4557
|
-
}
|
|
4558
|
-
handleSlotChange() {
|
|
4559
|
-
this.cleanupTrigger();
|
|
4560
|
-
this.setupTrigger();
|
|
4561
|
-
}
|
|
4562
|
-
cleanupTrigger() {
|
|
4563
|
-
if (this.trigger) {
|
|
4564
|
-
const describedBy = this.trigger.getAttribute('aria-describedby') || '';
|
|
4565
|
-
if (describedBy.includes(this.for)) {
|
|
4566
|
-
const newDescribedBy = describedBy
|
|
4567
|
-
.split(' ')
|
|
4568
|
-
.filter(id => id !== this.for)
|
|
4569
|
-
.join(' ');
|
|
4570
|
-
if (newDescribedBy) {
|
|
4571
|
-
this.trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
4572
|
-
}
|
|
4573
|
-
else {
|
|
4574
|
-
this.trigger.removeAttribute('aria-describedby');
|
|
4575
|
-
}
|
|
4576
|
-
}
|
|
4577
|
-
this.trigger = null;
|
|
4578
|
-
}
|
|
4579
|
-
}
|
|
4580
|
-
setupTrigger() {
|
|
4581
|
-
this.trigger = this.host.querySelector('*');
|
|
4582
|
-
if (this.trigger) {
|
|
4583
|
-
if (!isFocusable(this.trigger)) {
|
|
4584
|
-
this.trigger.setAttribute('tabindex', '0');
|
|
4585
|
-
}
|
|
4586
|
-
const describedBy = this.trigger.getAttribute('aria-describedby') || '';
|
|
4587
|
-
if (!describedBy.includes(this.for)) {
|
|
4588
|
-
this.trigger.setAttribute('aria-describedby', `${describedBy} ${this.for}`.trim());
|
|
4589
|
-
}
|
|
4590
|
-
}
|
|
4591
|
-
else {
|
|
4592
|
-
console.warn('No content found in the post-tooltip-trigger slot. Please insert a focusable element or content that can receive focus.');
|
|
4593
|
-
}
|
|
4594
|
-
}
|
|
4595
|
-
attachListeners() {
|
|
4596
|
-
TRIGGER_EVENTS.forEach(event => {
|
|
4597
|
-
this.host.addEventListener(event, this.boundTriggerHandler);
|
|
4598
|
-
});
|
|
4599
|
-
}
|
|
4600
|
-
removeListeners() {
|
|
4601
|
-
TRIGGER_EVENTS.forEach(event => {
|
|
4602
|
-
this.host.removeEventListener(event, this.boundTriggerHandler);
|
|
4603
|
-
});
|
|
4604
|
-
}
|
|
4605
|
-
attachTooltipListeners() {
|
|
4606
|
-
if (this.tooltip) {
|
|
4607
|
-
this.tooltip.addEventListener('pointerenter', this.boundTooltipHandler);
|
|
4608
|
-
this.tooltip.addEventListener('pointerleave', this.boundTooltipHandler);
|
|
4609
|
-
}
|
|
4610
|
-
}
|
|
4611
|
-
removeTooltipListeners() {
|
|
4612
|
-
if (this.tooltip) {
|
|
4613
|
-
this.tooltip.removeEventListener('pointerenter', this.boundTooltipHandler);
|
|
4614
|
-
this.tooltip.removeEventListener('pointerleave', this.boundTooltipHandler);
|
|
4615
|
-
}
|
|
4616
|
-
}
|
|
4617
|
-
handleTriggerEvent(event) {
|
|
4618
|
-
switch (event.type) {
|
|
4619
|
-
case 'pointerenter':
|
|
4620
|
-
case 'focusin':
|
|
4621
|
-
case 'long-press':
|
|
4622
|
-
this.handleEnter();
|
|
4623
|
-
break;
|
|
4624
|
-
case 'pointerleave':
|
|
4625
|
-
case 'focusout':
|
|
4626
|
-
this.handleLeave(event);
|
|
4627
|
-
break;
|
|
4628
|
-
}
|
|
4629
|
-
}
|
|
4630
|
-
handleTooltipEvent(event) {
|
|
4631
|
-
switch (event.type) {
|
|
4632
|
-
case 'pointerenter':
|
|
4633
|
-
this.handleEnter();
|
|
4634
|
-
break;
|
|
4635
|
-
case 'pointerleave':
|
|
4636
|
-
this.handleLeave(event);
|
|
4637
|
-
break;
|
|
4638
|
-
}
|
|
4639
|
-
}
|
|
4640
|
-
handleEnter() {
|
|
4641
|
-
if (this.delayTimeout) {
|
|
4642
|
-
clearTimeout(this.delayTimeout);
|
|
4643
|
-
this.delayTimeout = null;
|
|
4644
|
-
}
|
|
4645
|
-
this.interestHandler();
|
|
4646
|
-
}
|
|
4647
|
-
handleLeave(event) {
|
|
4648
|
-
const newTarget = event.relatedTarget;
|
|
4649
|
-
if ((this.tooltip && newTarget && this.tooltip.contains(newTarget)) ||
|
|
4650
|
-
newTarget === this.trigger) {
|
|
4651
|
-
return;
|
|
4652
|
-
}
|
|
4653
|
-
this.interestLostHandler();
|
|
4654
|
-
}
|
|
4655
|
-
interestHandler() {
|
|
4656
|
-
if (this.delay > 0) {
|
|
4657
|
-
this.delayTimeout = window.setTimeout(() => {
|
|
4658
|
-
this.tooltip?.show(this.trigger);
|
|
4659
|
-
this.delayTimeout = null;
|
|
4660
|
-
}, this.delay);
|
|
4661
|
-
}
|
|
4662
|
-
else {
|
|
4663
|
-
this.tooltip?.show(this.trigger);
|
|
4664
|
-
}
|
|
4665
|
-
}
|
|
4666
|
-
interestLostHandler() {
|
|
4667
|
-
if (this.delayTimeout) {
|
|
4668
|
-
clearTimeout(this.delayTimeout);
|
|
4669
|
-
this.delayTimeout = null;
|
|
4670
|
-
}
|
|
4671
|
-
this.tooltip?.hide();
|
|
4672
|
-
}
|
|
4673
|
-
render() {
|
|
4674
|
-
return (h(Host, { key: '2dc6f70e4dc7706a69efcede935e85faede3b73c', "data-version": version$1 }, h("slot", { key: 'b6301a66707d85a06b053a0a70a2a0cbc62877b3', onSlotchange: () => this.handleSlotChange() })));
|
|
4675
|
-
}
|
|
4676
|
-
get host() { return getElement(this); }
|
|
4677
|
-
static get watchers() { return {
|
|
4678
|
-
"for": ["validateControlFor"]
|
|
4679
|
-
}; }
|
|
4680
|
-
};
|
|
4681
|
-
PostTooltipTrigger.style = PostTooltipTriggerStyle0;
|
|
4682
|
-
|
|
4683
|
-
export { PostTooltipTrigger as P };
|