packages
5 months ago
00f53f1b378f6c98c043.bundle.min.js
5 months ago
04441cacbcc0ffea6713.bundle.min.js
5 months ago
0982f37bec0944fbcb10.bundle.js
5 months ago
0bc41c4656ca54cf2aca.bundle.min.js
5 months ago
137ba3baf43f287996c2.bundle.min.js
5 months ago
1564d2bfa4591bf857f3.bundle.min.js
5 months ago
197583acd246fea0e25d.bundle.js
6 months ago
1f7fa1d64dd4cef4a3c0.bundle.js
5 months ago
254132ea6903b7cf0c30.bundle.js
5 months ago
2934fa380b70eb462ece.bundle.min.js
5 months ago
315ffba5a5bf098be034.bundle.min.js
5 months ago
35423d812dc1d52fdb27.bundle.min.js
5 months ago
3c18b6eb4e735ca7e8bf.bundle.js
5 months ago
3c838288a9b7ddd2aea4.bundle.min.js
5 months ago
3d1613aca86991103452.bundle.min.js
5 months ago
3d410a099008411bb011.bundle.js
6 months ago
40d841f4b4ce7b1928f5.bundle.js
5 months ago
4246c56134ca9ba65163.bundle.js
5 months ago
45167112673d4bc99f6b.bundle.js
5 months ago
45a55c192b49ad3f224d.bundle.js
5 months ago
45f1ae567e48fe3da9b0.bundle.min.js
8 months ago
4812775bcbc0ff8a9043.bundle.min.js
5 months ago
4886b33c17731474e197.bundle.min.js
5 months ago
54d62e5edbcf81b72a1f.bundle.min.js
5 months ago
5b13d0f77c0ac139c979.bundle.js
5 months ago
5be98965bbdf1c631fdf.bundle.min.js
5 months ago
6a19e86dd8c1f9165dbe.bundle.js
6 months ago
6cb9e42b9b73a76315e0.bundle.js
5 months ago
72459a35b6570acc77f3.bundle.js
5 months ago
75915b40e37cc6d910ef.bundle.js
5 months ago
7745b82dc4a05385ef1f.bundle.js
5 months ago
79016b3aba18d6be6dc3.bundle.min.js
5 months ago
7a5da9cf33b7d3557599.bundle.js
5 months ago
7a8c6c081d659e35d7d2.bundle.min.js
5 months ago
7d17894dc2ca045cfbb5.bundle.min.js
5 months ago
7dae73b622bebe8a5d94.bundle.js
5 months ago
7f2c78456ab3f406f3df.bundle.js
5 months ago
8277989eebcfba278cb0.bundle.min.js
8 months ago
84288e5699f5d8b8b23e.bundle.min.js
5 months ago
85106d35eeb23f6f4a33.bundle.min.js
5 months ago
877227b9d759b63096a9.bundle.js
5 months ago
8ac2c6e532225b54dba2.bundle.js
5 months ago
8b4f35f99eb521b37d0c.bundle.js
5 months ago
8b6212b7ad0ef8719b6b.bundle.min.js
5 months ago
8e8b47ad5b4e4d038c80.bundle.js
5 months ago
8ecfd8495b7ec419862a.bundle.js
5 months ago
9167bffba76b36a431f5.bundle.min.js
5 months ago
91c1e96a5c75bbc8ec6d.bundle.js
5 months ago
982fcee032dda41fa3a1.bundle.min.js
5 months ago
9832c866a8fe9b51f9d2.bundle.min.js
5 months ago
9dcd9e88237da6496816.bundle.min.js
5 months ago
9f88a0d716a691c2448a.bundle.min.js
8 months ago
a2ea929f439e819b924b.bundle.min.js
5 months ago
a9f41949787209626737.bundle.min.js
5 months ago
ac53273f887639e3c6ea.bundle.min.js
5 months ago
accordion.8b0db5058afeb74622f5.bundle.min.js
8 months ago
accordion.b9a0ab19c7c872c405d7.bundle.js
6 months ago
admin-feedback.js
8 months ago
admin-feedback.min.js
8 months ago
admin-feedback.strings.js
5 months ago
admin-modules.js
6 months ago
admin-modules.min.js
6 months ago
admin-modules.min.js.LICENSE.txt
10 months ago
admin-modules.strings.js
6 months ago
admin-notifications.js
8 months ago
admin-notifications.min.js
8 months ago
admin-notifications.strings.js
6 months ago
admin-top-bar.js
5 months ago
admin-top-bar.min.js
5 months ago
admin-top-bar.strings.js
6 months ago
admin.js
5 months ago
admin.min.js
5 months ago
admin.min.js.LICENSE.txt
10 months ago
admin.strings.js
6 months ago
aee13673e923469c3275.bundle.min.js
5 months ago
ai-admin.js
6 months ago
ai-admin.min.js
6 months ago
ai-admin.min.js.LICENSE.txt
10 months ago
ai-admin.strings.js
6 months ago
ai-gutenberg.js
6 months ago
ai-gutenberg.min.js
6 months ago
ai-gutenberg.min.js.LICENSE.txt
10 months ago
ai-gutenberg.strings.js
6 months ago
ai-layout.js
6 months ago
ai-layout.min.js
6 months ago
ai-layout.min.js.LICENSE.txt
10 months ago
ai-layout.strings.js
5 months ago
ai-media-library.js
6 months ago
ai-media-library.min.js
6 months ago
ai-media-library.min.js.LICENSE.txt
10 months ago
ai-media-library.strings.js
6 months ago
ai-unify-product-images.js
6 months ago
ai-unify-product-images.min.js
6 months ago
ai-unify-product-images.min.js.LICENSE.txt
10 months ago
ai-unify-product-images.strings.js
6 months ago
ai.js
6 months ago
ai.min.js
6 months ago
ai.min.js.LICENSE.txt
10 months ago
ai.strings.js
5 months ago
alert.42cc1d522ef5c60bf874.bundle.min.js
8 months ago
alert.fd509aa768e7b35a8e32.bundle.js
6 months ago
announcements-app.js
5 months ago
announcements-app.min.js
5 months ago
announcements-app.min.js.LICENSE.txt
10 months ago
announcements-app.strings.js
6 months ago
app-loader.js
6 months ago
app-loader.min.js
8 months ago
app-loader.strings.js
5 months ago
app-packages.js
5 months ago
app-packages.min.js
5 months ago
app-packages.min.js.LICENSE.txt
10 months ago
app-packages.strings.js
5 months ago
app.js
5 months ago
app.min.js
5 months ago
app.min.js.LICENSE.txt
10 months ago
app.strings.js
5 months ago
atomic-widgets-editor.js
5 months ago
atomic-widgets-editor.min.js
5 months ago
atomic-widgets-editor.min.js.LICENSE.txt
5 months ago
atomic-widgets-editor.strings.js
5 months ago
atomic-widgets-frontend-handler.js
5 months ago
atomic-widgets-frontend-handler.min.js
5 months ago
b09b262748a4be8417ce.bundle.js
5 months ago
b423d91809cf7e0cb8b0.bundle.js
5 months ago
b668f6906820570e60b5.bundle.min.js
5 months ago
b96d70044d0d67c2df19.bundle.min.js
8 months ago
b97ced1683f62f5686fa.bundle.min.js
5 months ago
ba292d36d983cead2a5b.bundle.js
5 months ago
bb708343060feb5c4a5d.bundle.min.js
5 months ago
beta-tester.js
8 months ago
beta-tester.min.js
8 months ago
beta-tester.strings.js
6 months ago
bf55a1adc050b89179ff.bundle.min.js
5 months ago
bff204c1ab0d15e0a69b.bundle.min.js
5 months ago
bfff0d754d68404bd5a6.bundle.js
5 months ago
c13d205fa26f8af1ce7c.bundle.js
6 months ago
c4d335a90ec9a10c603f.bundle.js
5 months ago
cf2707501445e5b44fbe.bundle.js
5 months ago
cf6ec600fcf4e08ba6d3.bundle.js
5 months ago
checklist.js
6 months ago
checklist.min.js
6 months ago
checklist.min.js.LICENSE.txt
10 months ago
checklist.strings.js
6 months ago
cloud-library-screenshot.js
6 months ago
cloud-library-screenshot.min.js
6 months ago
cloud-library-screenshot.min.js.LICENSE.txt
8 months ago
cloud-library-screenshot.strings.js
6 months ago
common-modules.js
5 months ago
common-modules.min.js
5 months ago
common-modules.strings.js
6 months ago
common.js
5 months ago
common.min.js
5 months ago
common.min.js.LICENSE.txt
10 months ago
common.strings.js
6 months ago
contact-buttons.086261d3e9c4d8037686.bundle.js
6 months ago
contact-buttons.e98d0220ce8c38404e7e.bundle.min.js
8 months ago
container-converter.js
8 months ago
container-converter.min.js
8 months ago
container-converter.strings.js
6 months ago
container-editor-handlers.a2e8e48d28c5544fb183.bundle.min.js
5 months ago
container-editor-handlers.e7e069c4e656425c51f8.bundle.js
5 months ago
counter.12335f45aaa79d244f24.bundle.min.js
8 months ago
counter.7310c276bc7865a3d438.bundle.js
6 months ago
d0d9578389b742468cb7.bundle.min.js
5 months ago
d42de03ef4a0f50e39ca.bundle.min.js
5 months ago
d52aa05c75af56327744.bundle.js
6 months ago
d67ddd6f08b08392c42f.bundle.js
6 months ago
daecdcc50702fd1d72f1.bundle.js
6 months ago
daedc6797eaad5c82711.bundle.min.js
8 months ago
db27207322ef9be952ee.bundle.js
5 months ago
dev-tools.js
8 months ago
dev-tools.min.js
8 months ago
dev-tools.strings.js
6 months ago
e-home-screen.js
5 months ago
e-home-screen.min.js
5 months ago
e-home-screen.strings.js
5 months ago
e-react-promotions.js
8 months ago
e-react-promotions.min.js
8 months ago
e-react-promotions.strings.js
6 months ago
e-wc-product-editor.js
6 months ago
e-wc-product-editor.min.js
8 months ago
e-wc-product-editor.min.js.LICENSE.txt
1 year ago
e-wc-product-editor.strings.js
6 months ago
e1cb4d726bb59646c677.bundle.min.js
8 months ago
e2a127e2fb01b578d2ba.bundle.js
5 months ago
e393545679b12d012fba.bundle.js
5 months ago
e3b540e2c02813e75f38.bundle.min.js
5 months ago
e459c6c89c0c0899c850.bundle.js
6 months ago
e4d209bf3a704ff88e1a.bundle.js
5 months ago
e7d71f4e1d39edbc1fb6.bundle.js
5 months ago
e883e6638ef93bfd3204.bundle.js
6 months ago
editor-document.js
6 months ago
editor-document.min.js
8 months ago
editor-document.strings.js
5 months ago
editor-environment-v2.js
8 months ago
editor-environment-v2.min.js
8 months ago
editor-environment-v2.strings.js
6 months ago
editor-interactions.js
5 months ago
editor-interactions.min.js
5 months ago
editor-interactions.strings.js
6 months ago
editor-loader-v1.js
8 months ago
editor-loader-v1.min.js
8 months ago
editor-loader-v1.strings.js
6 months ago
editor-loader-v2.js
8 months ago
editor-loader-v2.min.js
8 months ago
editor-loader-v2.strings.js
6 months ago
editor-modules.js
6 months ago
editor-modules.min.js
6 months ago
editor-modules.min.js.LICENSE.txt
10 months ago
editor-modules.strings.js
5 months ago
editor-notifications.js
8 months ago
editor-notifications.min.js
8 months ago
editor-notifications.strings.js
6 months ago
editor-one-admin.js
6 months ago
editor-one-admin.min.js
6 months ago
editor-one-admin.strings.js
6 months ago
editor-one-menu.js
5 months ago
editor-one-menu.min.js
5 months ago
editor-one-menu.strings.js
6 months ago
editor-one-sidebar-navigation.js
5 months ago
editor-one-sidebar-navigation.min.js
5 months ago
editor-one-sidebar-navigation.min.js.LICENSE.txt
6 months ago
editor-one-sidebar-navigation.strings.js
6 months ago
editor-one-top-bar.js
5 months ago
editor-one-top-bar.min.js
5 months ago
editor-one-top-bar.min.js.LICENSE.txt
5 months ago
editor-one-top-bar.strings.js
5 months ago
editor-v4-opt-in-alphachip.js
5 months ago
editor-v4-opt-in-alphachip.min.js
5 months ago
editor-v4-opt-in-alphachip.strings.js
5 months ago
editor-v4-opt-in.js
5 months ago
editor-v4-opt-in.min.js
5 months ago
editor-v4-opt-in.min.js.LICENSE.txt
6 months ago
editor-v4-opt-in.strings.js
5 months ago
editor-v4-welcome-opt-in.js
5 months ago
editor-v4-welcome-opt-in.min.js
5 months ago
editor-v4-welcome-opt-in.strings.js
5 months ago
editor.js
5 months ago
editor.min.js
5 months ago
editor.min.js.LICENSE.txt
6 months ago
editor.strings.js
6 months ago
ef2100ac3eda1a957819.bundle.min.js
8 months ago
ef35c83e4628f0a5c328.bundle.js
5 months ago
element-manager-admin.js
5 months ago
element-manager-admin.min.js
5 months ago
element-manager-admin.min.js.LICENSE.txt
10 months ago
element-manager-admin.strings.js
5 months ago
elementor-admin-bar.js
8 months ago
elementor-admin-bar.min.js
8 months ago
elementor-admin-bar.strings.js
6 months ago
fa64159422dec32bd185.bundle.js
5 months ago
floating-bars.740d06d17cea5cebdb61.bundle.min.js
8 months ago
floating-bars.a6e6a043444b62f64f82.bundle.js
6 months ago
floating-elements-modal.js
5 months ago
floating-elements-modal.min.js
5 months ago
floating-elements-modal.strings.js
6 months ago
frontend-modules.js
5 months ago
frontend-modules.min.js
5 months ago
frontend.js
8 months ago
frontend.min.js
8 months ago
gutenberg.js
8 months ago
gutenberg.min.js
8 months ago
gutenberg.strings.js
6 months ago
image-carousel.6167d20b95b33386757b.bundle.min.js
8 months ago
image-carousel.8b25f3674c29b829a867.bundle.js
6 months ago
import-export-admin.js
6 months ago
import-export-admin.min.js
6 months ago
import-export-admin.strings.js
5 months ago
import-export-customization-admin.js
5 months ago
import-export-customization-admin.min.js
5 months ago
import-export-customization-admin.min.js.LICENSE.txt
8 months ago
import-export-customization-admin.strings.js
5 months ago
interactions.js
5 months ago
interactions.min.js
5 months ago
interactions.strings.js
6 months ago
kit-elements-defaults-editor.js
6 months ago
kit-elements-defaults-editor.min.js
6 months ago
kit-elements-defaults-editor.min.js.LICENSE.txt
10 months ago
kit-elements-defaults-editor.strings.js
6 months ago
kit-library.4d4a9d3b76f7410214c3.bundle.min.js
5 months ago
kit-library.9c4bbee79edf32c6fcb3.bundle.js
5 months ago
lightbox.a1f44406e887981f48c7.bundle.js
6 months ago
lightbox.d1799e507b570f6b0496.bundle.min.js
8 months ago
media-hints.js
8 months ago
media-hints.min.js
8 months ago
media-hints.strings.js
6 months ago
nested-accordion.294d40984397351fd0f5.bundle.min.js
5 months ago
nested-accordion.4340b64226322f36bcc0.bundle.js
5 months ago
nested-accordion.js
6 months ago
nested-accordion.min.js
6 months ago
nested-accordion.min.js.LICENSE.txt
10 months ago
nested-accordion.strings.js
6 months ago
nested-elements.js
6 months ago
nested-elements.min.js
6 months ago
nested-elements.strings.js
6 months ago
nested-tabs.7a338e6d7e060c473993.bundle.js
6 months ago
nested-tabs.a2401356d329f179475e.bundle.min.js
6 months ago
nested-tabs.js
6 months ago
nested-tabs.min.js
6 months ago
nested-tabs.min.js.LICENSE.txt
10 months ago
nested-tabs.strings.js
6 months ago
nested-title-keyboard-handler.0c2b498e3e0695a1dc19.bundle.js
6 months ago
nested-title-keyboard-handler.2a67d3cc630e11815acc.bundle.min.js
6 months ago
new-template.js
5 months ago
new-template.min.js
5 months ago
new-template.strings.js
6 months ago
notes.js
8 months ago
notes.min.js
8 months ago
notes.strings.js
6 months ago
onboarding.31a5615a753ffac2c800.bundle.min.js
5 months ago
onboarding.63cdf72a450944ebd5f7.bundle.js
5 months ago
pro-free-trial-popup.js
8 months ago
pro-free-trial-popup.min.js
8 months ago
pro-free-trial-popup.strings.js
6 months ago
pro-install-events.js
8 months ago
pro-install-events.min.js
8 months ago
pro-install-events.strings.js
6 months ago
progress.0ea083b809812c0e3aa1.bundle.min.js
8 months ago
progress.b1057ba870016558bce1.bundle.js
6 months ago
responsive-bar.js
8 months ago
responsive-bar.min.js
8 months ago
responsive-bar.strings.js
6 months ago
section-editor-handlers.53ffedef32043348b99b.bundle.min.js
8 months ago
section-editor-handlers.d65899d232b5339510d7.bundle.js
6 months ago
section-frontend-handlers.c3950c6b190ca134bc8d.bundle.js
6 months ago
section-frontend-handlers.d85ab872da118940910d.bundle.min.js
8 months ago
shared-editor-handlers.3023894100138e442ab0.bundle.js
5 months ago
shared-editor-handlers.cacdcbed391abf4b48b0.bundle.min.js
5 months ago
shared-frontend-handlers.03caa53373b56d3bab67.bundle.min.js
8 months ago
shared-frontend-handlers.3b079824c37a5fe2bdaa.bundle.js
6 months ago
styleguide-app-initiator.js
6 months ago
styleguide-app-initiator.min.js
6 months ago
styleguide-app-initiator.min.js.LICENSE.txt
10 months ago
styleguide-app-initiator.strings.js
6 months ago
styleguide-app.04340244193733d78622.bundle.min.js
8 months ago
styleguide-app.36ecabae74d9b87fc5a8.bundle.js
6 months ago
styleguide.js
8 months ago
styleguide.min.js
8 months ago
styleguide.strings.js
6 months ago
tabs-handler.js
6 months ago
tabs-handler.min.js
6 months ago
tabs-preview-handler.js
6 months ago
tabs-preview-handler.min.js
6 months ago
tabs.18344b05d8d1ea0702bc.bundle.min.js
8 months ago
tabs.40498fa771d612162c53.bundle.js
6 months ago
text-editor.0c9960167105139d27c9.bundle.js
6 months ago
text-editor.45609661e409413f1cef.bundle.min.js
8 months ago
text-path.b5766aff4e92f7f6c661.bundle.min.js
6 months ago
text-path.b5766aff4e92f7f6c661.bundle.min.js.LICENSE.txt
6 months ago
text-path.eb787fc2b296f56e6e5f.bundle.js
6 months ago
toggle.2a177a3ef4785d3dfbc5.bundle.min.js
8 months ago
toggle.b75e66d2aca6f6ee742e.bundle.js
6 months ago
video.6e96510afa701d1f2ebc.bundle.js
6 months ago
video.86d44e46e43d0807e708.bundle.min.js
8 months ago
web-cli.js
6 months ago
web-cli.min.js
6 months ago
web-cli.min.js.LICENSE.txt
10 months ago
web-cli.strings.js
6 months ago
webpack.runtime.js
5 months ago
webpack.runtime.min.js
5 months ago
wp-audio.0ba9114964acf4c37ca2.bundle.js
6 months ago
wp-audio.c9624cb6e5dc9de86abd.bundle.min.js
8 months ago
youtube-handler.js
6 months ago
youtube-handler.min.js
6 months ago
nested-title-keyboard-handler.0c2b498e3e0695a1dc19.bundle.js
207 lines
| 1 | "use strict"; |
| 2 | (self["webpackChunkelementorFrontend"] = self["webpackChunkelementorFrontend"] || []).push([["nested-title-keyboard-handler"],{ |
| 3 | |
| 4 | /***/ "../assets/dev/js/frontend/handlers/accessibility/nested-title-keyboard-handler.js": |
| 5 | /*!*****************************************************************************************!*\ |
| 6 | !*** ../assets/dev/js/frontend/handlers/accessibility/nested-title-keyboard-handler.js ***! |
| 7 | \*****************************************************************************************/ |
| 8 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 9 | |
| 10 | |
| 11 | |
| 12 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 13 | Object.defineProperty(exports, "__esModule", ({ |
| 14 | value: true |
| 15 | })); |
| 16 | exports["default"] = void 0; |
| 17 | __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); |
| 18 | __webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ "../node_modules/core-js/modules/esnext.iterator.filter.js"); |
| 19 | __webpack_require__(/*! core-js/modules/esnext.iterator.find.js */ "../node_modules/core-js/modules/esnext.iterator.find.js"); |
| 20 | var _base = _interopRequireDefault(__webpack_require__(/*! ../base */ "../assets/dev/js/frontend/handlers/base.js")); |
| 21 | class NestedTitleKeyboardHandler extends _base.default { |
| 22 | __construct(settings) { |
| 23 | super.__construct(settings); |
| 24 | this.directionNext = 'next'; |
| 25 | this.directionPrevious = 'previous'; |
| 26 | this.focusableElementSelector = 'audio, button, canvas, details, iframe, input, select, summary, textarea, video, [accesskey], [contenteditable], [href], [tabindex]:not([tabindex="-1"])'; |
| 27 | } |
| 28 | getWidgetNumber() { |
| 29 | return this.$element.find('> .elementor-widget-container > .e-n-tabs, > .e-n-tabs').attr('data-widget-number'); |
| 30 | } |
| 31 | getDefaultSettings() { |
| 32 | return { |
| 33 | selectors: { |
| 34 | itemTitle: `[data-tab-title-id*="e-n-tab-title-${this.getWidgetNumber()}"]`, |
| 35 | itemContainer: `[id*="e-n-tab-content-${this.getWidgetNumber()}"]` |
| 36 | }, |
| 37 | ariaAttributes: { |
| 38 | titleStateAttribute: 'aria-selected', |
| 39 | activeTitleSelector: '[aria-selected="true"]' |
| 40 | }, |
| 41 | datasets: { |
| 42 | titleIndex: 'data-tab-index' |
| 43 | }, |
| 44 | keyDirection: { |
| 45 | ArrowLeft: elementorFrontendConfig.is_rtl ? this.directionNext : this.directionPrevious, |
| 46 | ArrowUp: this.directionPrevious, |
| 47 | ArrowRight: elementorFrontendConfig.is_rtl ? this.directionPrevious : this.directionNext, |
| 48 | ArrowDown: this.directionNext |
| 49 | } |
| 50 | }; |
| 51 | } |
| 52 | getDefaultElements() { |
| 53 | const selectors = this.getSettings('selectors'); |
| 54 | return { |
| 55 | $itemTitles: this.findElement(selectors.itemTitle), |
| 56 | $itemContainers: this.findElement(selectors.itemContainer), |
| 57 | $focusableContainerElements: this.getFocusableElements(this.findElement(selectors.itemContainer)) |
| 58 | }; |
| 59 | } |
| 60 | getFocusableElements($elements) { |
| 61 | return $elements.find(this.focusableElementSelector).not('[disabled], [inert]'); |
| 62 | } |
| 63 | getKeyDirectionValue(event) { |
| 64 | const direction = this.getSettings('keyDirection')[event.key]; |
| 65 | return this.directionNext === direction ? 1 : -1; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @param {HTMLElement} itemTitleElement |
| 70 | * |
| 71 | * @return {string} |
| 72 | */ |
| 73 | getTitleIndex(itemTitleElement) { |
| 74 | const { |
| 75 | titleIndex: indexAttribute |
| 76 | } = this.getSettings('datasets'); |
| 77 | return itemTitleElement.getAttribute(indexAttribute); |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * @param {string|number} titleIndex |
| 82 | * |
| 83 | * @return {string} |
| 84 | */ |
| 85 | getTitleFilterSelector(titleIndex) { |
| 86 | const { |
| 87 | titleIndex: indexAttribute |
| 88 | } = this.getSettings('datasets'); |
| 89 | return `[${indexAttribute}="${titleIndex}"]`; |
| 90 | } |
| 91 | getActiveTitleElement() { |
| 92 | const activeTitleFilter = this.getSettings('ariaAttributes').activeTitleSelector; |
| 93 | return this.elements.$itemTitles.filter(activeTitleFilter); |
| 94 | } |
| 95 | onInit(...args) { |
| 96 | super.onInit(...args); |
| 97 | } |
| 98 | bindEvents() { |
| 99 | this.elements.$itemTitles.on(this.getTitleEvents()); |
| 100 | this.elements.$focusableContainerElements.on(this.getContentElementEvents()); |
| 101 | } |
| 102 | unbindEvents() { |
| 103 | this.elements.$itemTitles.off(this.getTitleEvents()); |
| 104 | this.elements.$focusableContainerElements.children().off(this.getContentElementEvents()); |
| 105 | } |
| 106 | getTitleEvents() { |
| 107 | return { |
| 108 | keydown: this.handleTitleKeyboardNavigation.bind(this) |
| 109 | }; |
| 110 | } |
| 111 | getContentElementEvents() { |
| 112 | return { |
| 113 | keydown: this.handleContentElementKeyboardNavigation.bind(this) |
| 114 | }; |
| 115 | } |
| 116 | isDirectionKey(event) { |
| 117 | const directionKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End']; |
| 118 | return directionKeys.includes(event.key); |
| 119 | } |
| 120 | isActivationKey(event) { |
| 121 | const activationKeys = ['Enter', ' ']; |
| 122 | return activationKeys.includes(event.key); |
| 123 | } |
| 124 | handleTitleKeyboardNavigation(event) { |
| 125 | if (this.isDirectionKey(event)) { |
| 126 | event.preventDefault(); |
| 127 | const currentTitleIndex = parseInt(this.getTitleIndex(event.currentTarget)) || 1, |
| 128 | numberOfTitles = this.elements.$itemTitles.length, |
| 129 | titleIndexUpdated = this.getTitleIndexFocusUpdated(event, currentTitleIndex, numberOfTitles); |
| 130 | this.changeTitleFocus(titleIndexUpdated); |
| 131 | event.stopPropagation(); |
| 132 | } else if (this.isActivationKey(event)) { |
| 133 | event.preventDefault(); |
| 134 | if (this.handeTitleLinkEnterOrSpaceEvent(event)) { |
| 135 | return; |
| 136 | } |
| 137 | const titleIndex = this.getTitleIndex(event.currentTarget); |
| 138 | elementorFrontend.elements.$window.trigger('elementor/nested-elements/activate-by-keyboard', { |
| 139 | widgetId: this.getID(), |
| 140 | titleIndex |
| 141 | }); |
| 142 | } else if ('Escape' === event.key) { |
| 143 | this.handleTitleEscapeKeyEvents(event); |
| 144 | } |
| 145 | } |
| 146 | handeTitleLinkEnterOrSpaceEvent(event) { |
| 147 | const isLinkElement = 'a' === event?.currentTarget?.tagName?.toLowerCase(); |
| 148 | if (!elementorFrontend.isEditMode() && isLinkElement) { |
| 149 | event?.currentTarget?.click(); |
| 150 | event.stopPropagation(); |
| 151 | } |
| 152 | return isLinkElement; |
| 153 | } |
| 154 | getTitleIndexFocusUpdated(event, currentTitleIndex, numberOfTitles) { |
| 155 | let titleIndexUpdated = 0; |
| 156 | switch (event.key) { |
| 157 | case 'Home': |
| 158 | titleIndexUpdated = 1; |
| 159 | break; |
| 160 | case 'End': |
| 161 | titleIndexUpdated = numberOfTitles; |
| 162 | break; |
| 163 | default: |
| 164 | const directionValue = this.getKeyDirectionValue(event), |
| 165 | isEndReached = numberOfTitles < currentTitleIndex + directionValue, |
| 166 | isStartReached = 0 === currentTitleIndex + directionValue; |
| 167 | if (isEndReached) { |
| 168 | titleIndexUpdated = 1; |
| 169 | } else if (isStartReached) { |
| 170 | titleIndexUpdated = numberOfTitles; |
| 171 | } else { |
| 172 | titleIndexUpdated = currentTitleIndex + directionValue; |
| 173 | } |
| 174 | } |
| 175 | return titleIndexUpdated; |
| 176 | } |
| 177 | changeTitleFocus(titleIndexUpdated) { |
| 178 | const $newTitle = this.elements.$itemTitles.filter(this.getTitleFilterSelector(titleIndexUpdated)); |
| 179 | this.setTitleTabindex(titleIndexUpdated); |
| 180 | $newTitle.trigger('focus'); |
| 181 | } |
| 182 | setTitleTabindex(titleIndex) { |
| 183 | this.elements.$itemTitles.attr('tabindex', '-1'); |
| 184 | const $newTitle = this.elements.$itemTitles.filter(this.getTitleFilterSelector(titleIndex)); |
| 185 | $newTitle.attr('tabindex', '0'); |
| 186 | } |
| 187 | handleTitleEscapeKeyEvents() {} |
| 188 | handleContentElementKeyboardNavigation(event) { |
| 189 | if ('Tab' === event.key && !event.shiftKey) { |
| 190 | this.handleContentElementTabEvents(event); |
| 191 | } else if ('Escape' === event.key) { |
| 192 | event.preventDefault(); |
| 193 | event.stopPropagation(); |
| 194 | this.handleContentElementEscapeEvents(event); |
| 195 | } |
| 196 | } |
| 197 | handleContentElementEscapeEvents() { |
| 198 | this.getActiveTitleElement().trigger('focus'); |
| 199 | } |
| 200 | handleContentElementTabEvents() {} |
| 201 | } |
| 202 | exports["default"] = NestedTitleKeyboardHandler; |
| 203 | |
| 204 | /***/ }) |
| 205 | |
| 206 | }]); |
| 207 | //# sourceMappingURL=nested-title-keyboard-handler.0c2b498e3e0695a1dc19.bundle.js.map |