packages
1 year ago
152486453d0e39071cdb.bundle.js
1 year ago
294b4bf3066815c5927f.bundle.min.js
1 year ago
2f08057553c95b827d30.bundle.min.js
1 year ago
4748df03726015eef04f.bundle.min.js
1 year ago
49d9a23b08ff2c138b03.bundle.min.js
1 year ago
49d9a23b08ff2c138b03.bundle.min.js.LICENSE.txt
1 year ago
7b18c3f2f2bfffda289f.bundle.js
1 year ago
9c42cff515a6191fddaf.bundle.min.js
1 year ago
a730ee9caa710006b307.bundle.js
1 year ago
accordion.8799675460c73eb48972.bundle.min.js
1 year ago
accordion.c16b88b2e8a0c50189bc.bundle.js
1 year ago
admin-feedback.js
1 year ago
admin-feedback.min.js
1 year ago
admin-modules.js
1 year ago
admin-modules.min.js
1 year ago
admin-modules.min.js.LICENSE.txt
2 years ago
admin-notifications.js
1 year ago
admin-notifications.min.js
1 year ago
admin-notifications.min.js.LICENSE.txt
1 year ago
admin-top-bar.js
1 year ago
admin-top-bar.min.js
1 year ago
admin.js
1 year ago
admin.min.js
1 year ago
admin.min.js.LICENSE.txt
2 years ago
ai-admin.js
1 year ago
ai-admin.min.js
1 year ago
ai-admin.min.js.LICENSE.txt
2 years ago
ai-gutenberg.js
1 year ago
ai-gutenberg.min.js
1 year ago
ai-gutenberg.min.js.LICENSE.txt
2 years ago
ai-layout.js
1 year ago
ai-layout.min.js
1 year ago
ai-layout.min.js.LICENSE.txt
2 years ago
ai-media-library.js
1 year ago
ai-media-library.min.js
1 year ago
ai-media-library.min.js.LICENSE.txt
2 years ago
ai.js
1 year ago
ai.min.js
1 year ago
ai.min.js.LICENSE.txt
1 year ago
alert.c3c6a3fdf4745bd26b7f.bundle.js
1 year ago
alert.cbc2a0fee74ee3ed0419.bundle.min.js
1 year ago
announcements-app.js
1 year ago
announcements-app.min.js
1 year ago
announcements-app.min.js.LICENSE.txt
3 years ago
app-loader.js
1 year ago
app-loader.min.js
1 year ago
app-packages.js
1 year ago
app-packages.min.js
1 year ago
app-packages.min.js.LICENSE.txt
3 years ago
app.js
1 year ago
app.min.js
1 year ago
app.min.js.LICENSE.txt
3 years ago
atomic-widgets-editor.js
1 year ago
atomic-widgets-editor.min.js
1 year ago
b7931adecb98651a09c7.bundle.min.js
1 year ago
bdd4030576f6a94a4f0d.bundle.js
1 year ago
beta-tester.js
1 year ago
beta-tester.min.js
1 year ago
c96bb3445f3bc9de7d26.bundle.min.js
1 year ago
checklist.js
1 year ago
checklist.min.js
1 year ago
checklist.min.js.LICENSE.txt
1 year ago
common-modules.js
1 year ago
common-modules.min.js
1 year ago
common.js
1 year ago
common.min.js
1 year ago
common.min.js.LICENSE.txt
3 years ago
contact-buttons.31aad77620f461830ce9.bundle.min.js
1 year ago
contact-buttons.a5e2cc7274ba4c94eb66.bundle.js
1 year ago
container-converter.js
1 year ago
container-converter.min.js
1 year ago
container.a7f0a15dfa05df34e1f7.bundle.js
1 year ago
container.c65a2a923085e1120e75.bundle.min.js
1 year ago
counter.02cef29c589e742d4c8c.bundle.min.js
1 year ago
counter.3f74a246dff765f39aea.bundle.js
1 year ago
d91e4d7f57d57af2aab9.bundle.min.js
1 year ago
d9299811bc70ddb82fbf.bundle.js
1 year ago
dev-tools.js
1 year ago
dev-tools.min.js
1 year ago
e-home-screen.js
1 year ago
e-home-screen.min.js
1 year ago
e-wc-product-editor.js
1 year ago
e-wc-product-editor.min.js
1 year ago
e-wc-product-editor.min.js.LICENSE.txt
1 year ago
e3f753621bf9be55ec4d.bundle.js
1 year ago
editor-document.js
1 year ago
editor-document.min.js
1 year ago
editor-environment-v2.js
1 year ago
editor-environment-v2.min.js
1 year ago
editor-loader-v1.js
1 year ago
editor-loader-v1.min.js
1 year ago
editor-loader-v2.js
1 year ago
editor-loader-v2.min.js
1 year ago
editor-modules.js
1 year ago
editor-modules.min.js
1 year ago
editor-modules.min.js.LICENSE.txt
2 years ago
editor-notifications.js
1 year ago
editor-notifications.min.js
1 year ago
editor-notifications.min.js.LICENSE.txt
1 year ago
editor.js
1 year ago
editor.min.js
1 year ago
editor.min.js.LICENSE.txt
1 year ago
element-manager-admin.js
1 year ago
element-manager-admin.min.js
1 year ago
element-manager-admin.min.js.LICENSE.txt
2 years ago
elementor-admin-bar.js
1 year ago
elementor-admin-bar.min.js
1 year ago
f634673e5824ceb13f3d.bundle.js
1 year ago
fa0cbd4c7b6a8ad83224.bundle.js
1 year ago
fd6a00ae23a1bc2c6190.bundle.js
1 year ago
floating-bars.1ebb83f158244b35bda6.bundle.js
1 year ago
floating-bars.e4547b87bc6fb09381ca.bundle.min.js
1 year ago
floating-elements-modal.js
1 year ago
floating-elements-modal.min.js
1 year ago
frontend-modules.js
1 year ago
frontend-modules.min.js
1 year ago
frontend.js
1 year ago
frontend.min.js
1 year ago
gutenberg.js
1 year ago
gutenberg.min.js
1 year ago
image-carousel.4455c6362492d9067512.bundle.min.js
1 year ago
image-carousel.9399f19d95d7300cbc2e.bundle.js
1 year ago
import-export-admin.js
1 year ago
import-export-admin.min.js
1 year ago
kit-elements-defaults-editor.js
1 year ago
kit-elements-defaults-editor.min.js
1 year ago
kit-elements-defaults-editor.min.js.LICENSE.txt
3 years ago
kit-library.1f8d31888dc9d19dd031.bundle.min.js
1 year ago
kit-library.ac1a4cd5deae5526ce49.bundle.js
1 year ago
lightbox.01a419d1fcdd47a75a77.bundle.min.js
1 year ago
lightbox.2c9ae19597fcd2a76c3a.bundle.js
1 year ago
media-hints.js
1 year ago
media-hints.min.js
1 year ago
nested-accordion.82e5c4e9017e457a5f2e.bundle.js
1 year ago
nested-accordion.c3b109b714293a16bd95.bundle.min.js
1 year ago
nested-accordion.js
1 year ago
nested-accordion.min.js
1 year ago
nested-accordion.min.js.LICENSE.txt
3 years ago
nested-elements.js
1 year ago
nested-elements.min.js
1 year ago
nested-tabs.js
1 year ago
nested-tabs.min.js
1 year ago
nested-tabs.min.js.LICENSE.txt
3 years ago
nested-title-keyboard-handler.0b608656da2be746fb80.bundle.min.js
1 year ago
nested-title-keyboard-handler.92a73d7a8a75bcb8cd67.bundle.js
1 year ago
new-template.js
1 year ago
new-template.min.js
1 year ago
notes.js
1 year ago
notes.min.js
1 year ago
onboarding.4a4002ff7ea58bfa166e.bundle.min.js
1 year ago
onboarding.5ceee1b219b66e943cb0.bundle.js
1 year ago
progress.6d15c16f0f5c4792940f.bundle.js
1 year ago
progress.985f012a6336ab21cb44.bundle.min.js
1 year ago
responsive-bar.js
1 year ago
responsive-bar.min.js
1 year ago
styleguide-app-initiator.js
1 year ago
styleguide-app-initiator.min.js
1 year ago
styleguide-app-initiator.min.js.LICENSE.txt
3 years ago
styleguide.js
1 year ago
styleguide.min.js
1 year ago
tabs.520bc2ed4560c561029e.bundle.js
1 year ago
tabs.c2af5be7f9cb3cdcf3d5.bundle.min.js
1 year ago
text-editor.2c35aafbe5bf0e127950.bundle.min.js
1 year ago
text-editor.2f2f7e0ea1e16387a004.bundle.js
1 year ago
text-path.39fb59e43970222f5a3e.bundle.min.js
1 year ago
text-path.39fb59e43970222f5a3e.bundle.min.js.LICENSE.txt
1 year ago
text-path.a20877e832db83423958.bundle.js
1 year ago
toggle.31881477c45ff5cf9d4d.bundle.min.js
1 year ago
toggle.d79746a764407a0828ee.bundle.js
1 year ago
video.78c625e89ab767d621c5.bundle.min.js
1 year ago
video.817bd6a65a1542503aac.bundle.js
1 year ago
web-cli.js
1 year ago
web-cli.min.js
1 year ago
web-cli.min.js.LICENSE.txt
3 years ago
webpack.runtime.js
1 year ago
webpack.runtime.min.js
1 year ago
wp-audio.75f0ced143febb8cd31a.bundle.min.js
1 year ago
wp-audio.b8efdc046bc9df72a075.bundle.js
1 year ago
nested-title-keyboard-handler.92a73d7a8a75bcb8cd67.bundle.js
205 lines
| 1 | /*! elementor - v3.25.0 - 16-10-2024 */ |
| 2 | "use strict"; |
| 3 | (self["webpackChunkelementor"] = self["webpackChunkelementor"] || []).push([["nested-title-keyboard-handler"],{ |
| 4 | |
| 5 | /***/ "../assets/dev/js/frontend/handlers/accessibility/nested-title-keyboard-handler.js": |
| 6 | /*!*****************************************************************************************!*\ |
| 7 | !*** ../assets/dev/js/frontend/handlers/accessibility/nested-title-keyboard-handler.js ***! |
| 8 | \*****************************************************************************************/ |
| 9 | /***/ ((__unused_webpack_module, exports, __webpack_require__) => { |
| 10 | |
| 11 | |
| 12 | |
| 13 | var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); |
| 14 | Object.defineProperty(exports, "__esModule", ({ |
| 15 | value: true |
| 16 | })); |
| 17 | exports["default"] = void 0; |
| 18 | var _base = _interopRequireDefault(__webpack_require__(/*! ../base */ "../assets/dev/js/frontend/handlers/base.js")); |
| 19 | class NestedTitleKeyboardHandler extends _base.default { |
| 20 | __construct(settings) { |
| 21 | super.__construct(settings); |
| 22 | this.directionNext = 'next'; |
| 23 | this.directionPrevious = 'previous'; |
| 24 | this.focusableElementSelector = 'audio, button, canvas, details, iframe, input, select, summary, textarea, video, [accesskey], [contenteditable], [href], [tabindex]:not([tabindex="-1"])'; |
| 25 | } |
| 26 | getWidgetNumber() { |
| 27 | return this.$element.find('> .elementor-widget-container > .e-n-tabs, > .e-n-tabs').attr('data-widget-number'); |
| 28 | } |
| 29 | getDefaultSettings() { |
| 30 | return { |
| 31 | selectors: { |
| 32 | itemTitle: `[id*="e-n-tab-title-${this.getWidgetNumber()}"]`, |
| 33 | itemContainer: `[id*="e-n-tab-content-${this.getWidgetNumber()}"]` |
| 34 | }, |
| 35 | ariaAttributes: { |
| 36 | titleStateAttribute: 'aria-selected', |
| 37 | activeTitleSelector: '[aria-selected="true"]' |
| 38 | }, |
| 39 | datasets: { |
| 40 | titleIndex: 'data-tab-index' |
| 41 | }, |
| 42 | keyDirection: { |
| 43 | ArrowLeft: elementorFrontendConfig.is_rtl ? this.directionNext : this.directionPrevious, |
| 44 | ArrowUp: this.directionPrevious, |
| 45 | ArrowRight: elementorFrontendConfig.is_rtl ? this.directionPrevious : this.directionNext, |
| 46 | ArrowDown: this.directionNext |
| 47 | } |
| 48 | }; |
| 49 | } |
| 50 | getDefaultElements() { |
| 51 | const selectors = this.getSettings('selectors'); |
| 52 | return { |
| 53 | $itemTitles: this.findElement(selectors.itemTitle), |
| 54 | $itemContainers: this.findElement(selectors.itemContainer), |
| 55 | $focusableContainerElements: this.getFocusableElements(this.findElement(selectors.itemContainer)) |
| 56 | }; |
| 57 | } |
| 58 | getFocusableElements($elements) { |
| 59 | return $elements.find(this.focusableElementSelector).not('[disabled], [inert]'); |
| 60 | } |
| 61 | getKeyDirectionValue(event) { |
| 62 | const direction = this.getSettings('keyDirection')[event.key]; |
| 63 | return this.directionNext === direction ? 1 : -1; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * @param {HTMLElement} itemTitleElement |
| 68 | * |
| 69 | * @return {string} |
| 70 | */ |
| 71 | getTitleIndex(itemTitleElement) { |
| 72 | const { |
| 73 | titleIndex: indexAttribute |
| 74 | } = this.getSettings('datasets'); |
| 75 | return itemTitleElement.getAttribute(indexAttribute); |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * @param {string|number} titleIndex |
| 80 | * |
| 81 | * @return {string} |
| 82 | */ |
| 83 | getTitleFilterSelector(titleIndex) { |
| 84 | const { |
| 85 | titleIndex: indexAttribute |
| 86 | } = this.getSettings('datasets'); |
| 87 | return `[${indexAttribute}="${titleIndex}"]`; |
| 88 | } |
| 89 | getActiveTitleElement() { |
| 90 | const activeTitleFilter = this.getSettings('ariaAttributes').activeTitleSelector; |
| 91 | return this.elements.$itemTitles.filter(activeTitleFilter); |
| 92 | } |
| 93 | onInit() { |
| 94 | super.onInit(...arguments); |
| 95 | } |
| 96 | bindEvents() { |
| 97 | this.elements.$itemTitles.on(this.getTitleEvents()); |
| 98 | this.elements.$focusableContainerElements.on(this.getContentElementEvents()); |
| 99 | } |
| 100 | unbindEvents() { |
| 101 | this.elements.$itemTitles.off(this.getTitleEvents()); |
| 102 | this.elements.$focusableContainerElements.children().off(this.getContentElementEvents()); |
| 103 | } |
| 104 | getTitleEvents() { |
| 105 | return { |
| 106 | keydown: this.handleTitleKeyboardNavigation.bind(this) |
| 107 | }; |
| 108 | } |
| 109 | getContentElementEvents() { |
| 110 | return { |
| 111 | keydown: this.handleContentElementKeyboardNavigation.bind(this) |
| 112 | }; |
| 113 | } |
| 114 | isDirectionKey(event) { |
| 115 | const directionKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End']; |
| 116 | return directionKeys.includes(event.key); |
| 117 | } |
| 118 | isActivationKey(event) { |
| 119 | const activationKeys = ['Enter', ' ']; |
| 120 | return activationKeys.includes(event.key); |
| 121 | } |
| 122 | handleTitleKeyboardNavigation(event) { |
| 123 | if (this.isDirectionKey(event)) { |
| 124 | event.preventDefault(); |
| 125 | const currentTitleIndex = parseInt(this.getTitleIndex(event.currentTarget)) || 1, |
| 126 | numberOfTitles = this.elements.$itemTitles.length, |
| 127 | titleIndexUpdated = this.getTitleIndexFocusUpdated(event, currentTitleIndex, numberOfTitles); |
| 128 | this.changeTitleFocus(titleIndexUpdated); |
| 129 | event.stopPropagation(); |
| 130 | } else if (this.isActivationKey(event)) { |
| 131 | event.preventDefault(); |
| 132 | if (this.handeTitleLinkEnterOrSpaceEvent(event)) { |
| 133 | return; |
| 134 | } |
| 135 | const titleIndex = this.getTitleIndex(event.currentTarget); |
| 136 | elementorFrontend.elements.$window.trigger('elementor/nested-elements/activate-by-keyboard', { |
| 137 | widgetId: this.getID(), |
| 138 | titleIndex |
| 139 | }); |
| 140 | } else if ('Escape' === event.key) { |
| 141 | this.handleTitleEscapeKeyEvents(event); |
| 142 | } |
| 143 | } |
| 144 | handeTitleLinkEnterOrSpaceEvent(event) { |
| 145 | const isLinkElement = 'a' === event?.currentTarget?.tagName?.toLowerCase(); |
| 146 | if (!elementorFrontend.isEditMode() && isLinkElement) { |
| 147 | event?.currentTarget?.click(); |
| 148 | event.stopPropagation(); |
| 149 | } |
| 150 | return isLinkElement; |
| 151 | } |
| 152 | getTitleIndexFocusUpdated(event, currentTitleIndex, numberOfTitles) { |
| 153 | let titleIndexUpdated = 0; |
| 154 | switch (event.key) { |
| 155 | case 'Home': |
| 156 | titleIndexUpdated = 1; |
| 157 | break; |
| 158 | case 'End': |
| 159 | titleIndexUpdated = numberOfTitles; |
| 160 | break; |
| 161 | default: |
| 162 | const directionValue = this.getKeyDirectionValue(event), |
| 163 | isEndReached = numberOfTitles < currentTitleIndex + directionValue, |
| 164 | isStartReached = 0 === currentTitleIndex + directionValue; |
| 165 | if (isEndReached) { |
| 166 | titleIndexUpdated = 1; |
| 167 | } else if (isStartReached) { |
| 168 | titleIndexUpdated = numberOfTitles; |
| 169 | } else { |
| 170 | titleIndexUpdated = currentTitleIndex + directionValue; |
| 171 | } |
| 172 | } |
| 173 | return titleIndexUpdated; |
| 174 | } |
| 175 | changeTitleFocus(titleIndexUpdated) { |
| 176 | const $newTitle = this.elements.$itemTitles.filter(this.getTitleFilterSelector(titleIndexUpdated)); |
| 177 | this.setTitleTabindex(titleIndexUpdated); |
| 178 | $newTitle.trigger('focus'); |
| 179 | } |
| 180 | setTitleTabindex(titleIndex) { |
| 181 | this.elements.$itemTitles.attr('tabindex', '-1'); |
| 182 | const $newTitle = this.elements.$itemTitles.filter(this.getTitleFilterSelector(titleIndex)); |
| 183 | $newTitle.attr('tabindex', '0'); |
| 184 | } |
| 185 | handleTitleEscapeKeyEvents() {} |
| 186 | handleContentElementKeyboardNavigation(event) { |
| 187 | if ('Tab' === event.key && !event.shiftKey) { |
| 188 | this.handleContentElementTabEvents(event); |
| 189 | } else if ('Escape' === event.key) { |
| 190 | event.preventDefault(); |
| 191 | event.stopPropagation(); |
| 192 | this.handleContentElementEscapeEvents(event); |
| 193 | } |
| 194 | } |
| 195 | handleContentElementEscapeEvents() { |
| 196 | this.getActiveTitleElement().trigger('focus'); |
| 197 | } |
| 198 | handleContentElementTabEvents() {} |
| 199 | } |
| 200 | exports["default"] = NestedTitleKeyboardHandler; |
| 201 | |
| 202 | /***/ }) |
| 203 | |
| 204 | }]); |
| 205 | //# sourceMappingURL=nested-title-keyboard-handler.92a73d7a8a75bcb8cd67.bundle.js.map |