All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.Popup.js.map Maven / Gradle / Ivy

The newest version!
{"version":3,"file":"Popup.js","sourceRoot":"","sources":["../src/Popup.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,EACN,QAAQ,EACR,SAAS,EACT,OAAO,GACP,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,0BAA0B,MAAM,iEAAiE,CAAC;AACzG,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAChH,OAAO,aAAa,MAAM,wDAAwD,CAAC;AAEnF,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,mBAAmB,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1F,SAAS;AACT,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAC1D,OAAO,qBAAqB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,YAAY,MAAM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ACF,KAAK,CAAC,OAAO,CAAC;IAEf;;;OAGG;;IACF,KAAK,CAAC,QAAQ,CAAC;GACD,KAAK,CA6fnB;AAED,eAAe,KAAK,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type { ClassMap } from \"@ui5/webcomponents-base/dist/types.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport {\n\tisChrome,\n\tisDesktop,\n\tisPhone,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { getFirstFocusableElement, getLastFocusableElement } from \"@ui5/webcomponents-base/dist/util/FocusableElements.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AriaLabelHelper.js\";\nimport getEffectiveScrollbarStyle from \"@ui5/webcomponents-base/dist/util/getEffectiveScrollbarStyle.js\";\nimport { hasStyle, createStyle } from \"@ui5/webcomponents-base/dist/ManagedStyles.js\";\nimport { isEnter, isTabPrevious } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getFocusedElement, isFocusedElementWithinNode } from \"@ui5/webcomponents-base/dist/util/PopupUtils.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport MediaRange from \"@ui5/webcomponents-base/dist/MediaRange.js\";\nimport Title from \"./Title.js\";\nimport PopupTemplate from \"./generated/templates/PopupTemplate.lit.js\";\nimport PopupAccessibleRole from \"./types/PopupAccessibleRole.js\";\nimport { addOpenedPopup, removeOpenedPopup } from \"./popup-utils/OpenedPopupsRegistry.js\";\n\n// Styles\nimport popupStlyes from \"./generated/themes/Popup.css.js\";\nimport popupBlockLayerStyles from \"./generated/themes/PopupBlockLayer.css.js\";\nimport globalStyles from \"./generated/themes/PopupGlobal.css.js\";\n\nconst createBlockingStyle = (): void => {\n\tif (!hasStyle(\"data-ui5-popup-scroll-blocker\")) {\n\t\tcreateStyle(globalStyles, \"data-ui5-popup-scroll-blocker\");\n\t}\n};\n\ncreateBlockingStyle();\n\nconst pageScrollingBlockers = new Set();\n\ntype PopupScrollEventDetail = {\n\tscrollTop: number;\n\ttargetRef: HTMLElement;\n}\n\ntype PopupBeforeCloseEventDetail = {\n\tescPressed: boolean;\n}\n\n/**\n * @class\n * ### Overview\n * Base class for all popup Web Components.\n *\n * If you need to create your own popup-like custom UI5 Web Components.\n *\n * 1. The Popup class handles modality:\n *  - The \"isModal\" getter can be overridden by derivatives to provide their own conditions when they are modal or not\n *  - Derivatives may call the \"blockPageScrolling\" and \"unblockPageScrolling\" static methods to temporarily remove scrollbars on the html element\n *  - Derivatives may call the \"openPopup\" and \"closePopup\" methods which handle focus, manage the popup registry and for modal popups, manage the blocking layer\n *\n *  2. Provides blocking layer (relevant for modal popups only):\n *   - Controlled by the \"open\" and \"close\" methods\n *\n * 3. The Popup class \"traps\" focus:\n *  - Derivatives may call the \"applyInitialFocus\" method (usually when opening, to transfer focus inside the popup)\n *\n * 4. The template of this component exposes two inline partials you can override in derivatives:\n *  - beforeContent (upper part of the box, useful for header/title/close button)\n *  - afterContent (lower part, useful for footer/action buttons)\n * @constructor\n * @extends UI5Element\n * @public\n */\n@customElement({\n\trenderer: litRender,\n\tstyles: [popupStlyes, popupBlockLayerStyles],\n\ttemplate: PopupTemplate,\n\tdependencies: [\n\t\tTitle,\n\t],\n})\n/**\n * Fired before the component is opened. This event can be cancelled, which will prevent the popup from opening. **This event does not bubble.**\n * @public\n * @allowPreventDefault\n */\n@event(\"before-open\")\n\n/**\n * Fired after the component is opened. **This event does not bubble.**\n * @public\n */\n@event(\"open\")\n\n/**\n * Fired before the component is closed. This event can be cancelled, which will prevent the popup from closing. **This event does not bubble.**\n * @public\n * @allowPreventDefault\n * @param {boolean} escPressed Indicates that `ESC` key has triggered the event.\n */\n@event(\"before-close\", {\n\tdetail: {\n\t\t/**\n\t\t * @public\n\t\t */\n\t\tescPressed: {\n\t\t\ttype: Boolean,\n\t\t},\n\t},\n})\n\n/**\n * Fired after the component is closed. **This event does not bubble.**\n * @public\n */\n@event(\"close\")\n\n/**\n * Fired whenever the popup content area is scrolled\n * @private\n */\n@event(\"scroll\")\nabstract class Popup extends UI5Element {\n\t/**\n\t * Defines the ID of the HTML Element, which will get the initial focus.\n\t *\n\t * **Note:** If an element with `autofocus` attribute is added inside the component,\n\t * `initialFocus` won't take effect.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tinitialFocus?: string;\n\n\t/**\n\t * Defines if the focus should be returned to the previously focused element,\n\t * when the popup closes.\n\t * @default false\n\t * @public\n\t * @since 1.0.0-rc.8\n\t*/\n\t@property({ type: Boolean })\n\tpreventFocusRestore = false;\n\n\t/**\n\t * Defines the accessible name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the IDs of the elements that label the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Allows setting a custom role.\n\t * @default \"Dialog\"\n\t * @public\n\t * @since 1.10.0\n\t */\n\t@property()\n\taccessibleRole: `${PopupAccessibleRole}` = \"Dialog\";\n\n\t/**\n\t * Defines the current media query size.\n\t * @private\n\t */\n\t@property()\n\tmediaRange?: string;\n\n\t/**\n\t * Indicates whether initial focus should be prevented.\n\t * @public\n\t * @default false\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tpreventInitialFocus = false;\n\n\t/**\n\t * Indicates if the element is the top modal popup\n\t *\n\t * This property is calculated automatically\n\t * @private\n\t * @default false\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\tisTopModalPopup = false;\n\n\t/**\n\t * Defines the content of the Popup.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\tcontent!: Array;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tonPhone = false;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tonDesktop = false;\n\n\t_resizeHandler: ResizeObserverCallback;\n\t_shouldFocusRoot?: boolean;\n\t_focusedElementBeforeOpen?: HTMLElement | null;\n\t_opened = false;\n\t_open = false;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._resizeHandler = this._resize.bind(this);\n\n\t\tthis._getRealDomRef = () => {\n\t\t\treturn this.shadowRoot!.querySelector(\"[root-element]\")!;\n\t\t};\n\t}\n\n\tonBeforeRendering() {\n\t\tthis.onPhone = isPhone();\n\t\tthis.onDesktop = isDesktop();\n\t}\n\n\tonAfterRendering() {\n\t\trenderFinished().then(() => {\n\t\t\tthis._updateMediaRange();\n\t\t});\n\t}\n\n\tonEnterDOM() {\n\t\tthis.setAttribute(\"popover\", \"manual\");\n\t\tResizeHandler.register(this, this._resizeHandler);\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\n\t\tthis.tabIndex = -1;\n\n\t\tif (this.open) {\n\t\t\tthis.showPopover();\n\t\t}\n\t}\n\n\tonExitDOM() {\n\t\tif (this._opened) {\n\t\t\tPopup.unblockPageScrolling(this);\n\t\t\tthis._removeOpenedPopup();\n\t\t}\n\n\t\tResizeHandler.deregister(this, this._resizeHandler);\n\t}\n\n\t/**\n\t * Indicates if the element is open\n\t * @public\n\t * @default false\n\t * @since 1.2.0\n\t */\n\t@property({ type: Boolean })\n\tset open(value: boolean) {\n\t\tif (this._open === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._open = value;\n\n\t\tif (value) {\n\t\t\tthis.openPopup();\n\t\t} else {\n\t\t\tthis.closePopup();\n\t\t}\n\t}\n\n\tget open() : boolean {\n\t\treturn this._open;\n\t}\n\n\tasync openPopup() {\n\t\tif (this._opened) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevented = !this.fireEvent(\"before-open\", {}, true, false);\n\n\t\tif (prevented || this._opened) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._opened = true;\n\n\t\tif (this.isModal) {\n\t\t\tPopup.blockPageScrolling(this);\n\t\t}\n\n\t\tthis._focusedElementBeforeOpen = getFocusedElement();\n\n\t\tthis._show();\n\n\t\tif (this.getDomRef()) {\n\t\t\tthis._updateMediaRange();\n\t\t}\n\n\t\tthis._addOpenedPopup();\n\n\t\tthis.open = true;\n\n\t\t// initial focus, if focused element is statically created\n\t\tawait this.applyInitialFocus();\n\n\t\tawait renderFinished();\n\n\t\t// initial focus, if focused element is dynamically created\n\t\tawait this.applyInitialFocus();\n\n\t\tif (this.isConnected) {\n\t\t\tthis.fireEvent(\"open\", {}, false, false);\n\t\t}\n\t}\n\n\t_resize() {\n\t\tthis._updateMediaRange();\n\t}\n\n\t/**\n\t * Prevents the user from interacting with the content under the block layer\n\t */\n\t_preventBlockLayerFocus(e: KeyboardEvent | MouseEvent) {\n\t\te.preventDefault();\n\t}\n\n\t/**\n\t * Temporarily removes scrollbars from the html element\n\t * @protected\n\t */\n\tstatic blockPageScrolling(popup: Popup) {\n\t\tpageScrollingBlockers.add(popup);\n\n\t\tif (pageScrollingBlockers.size !== 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.classList.add(\"ui5-popup-scroll-blocker\");\n\t}\n\n\t/**\n\t * Restores scrollbars on the html element, if needed\n\t * @protected\n\t */\n\tstatic unblockPageScrolling(popup: Popup) {\n\t\tpageScrollingBlockers.delete(popup);\n\n\t\tif (pageScrollingBlockers.size !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.classList.remove(\"ui5-popup-scroll-blocker\");\n\t}\n\n\t_scroll(e: Event) {\n\t\tthis.fireEvent(\"scroll\", {\n\t\t\tscrollTop: (e.target as HTMLElement).scrollTop,\n\t\t\ttargetRef: e.target as HTMLElement,\n\t\t});\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tconst isTabOutAttempt = e.target === this._root && isTabPrevious(e);\n\t\t// if the popup is closed, focus is already moved, so Enter keydown may result in click on the newly focused element\n\t\tconst isEnterOnClosedPopupChild = isEnter(e) && !this.open;\n\n\t\tif (isTabOutAttempt || isEnterOnClosedPopupChild) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_onfocusout(e: FocusEvent) {\n\t\t// relatedTarget is the element, which will get focus. If no such element exists, focus the root.\n\t\t// This happens after the mouse is released in order to not interrupt text selection.\n\t\tif (!e.relatedTarget) {\n\t\t\tthis._shouldFocusRoot = true;\n\t\t}\n\t}\n\n\t_onmousedown(e: MouseEvent) {\n\t\tif (this.shadowRoot!.contains(e.target as HTMLElement)) {\n\t\t\tthis._shouldFocusRoot = true;\n\t\t} else {\n\t\t\tthis._shouldFocusRoot = false;\n\t\t}\n\t}\n\n\t_onmouseup() {\n\t\tif (this._shouldFocusRoot) {\n\t\t\tif (isChrome()) {\n\t\t\t\tthis._root.focus();\n\t\t\t}\n\t\t\tthis._shouldFocusRoot = false;\n\t\t}\n\t}\n\n\t/**\n\t * Focus trapping\n\t * @private\n\t */\n\tasync forwardToFirst() {\n\t\tconst firstFocusable = await getFirstFocusableElement(this);\n\n\t\tif (firstFocusable) {\n\t\t\tfirstFocusable.focus();\n\t\t} else {\n\t\t\tthis._root.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Focus trapping\n\t * @private\n\t */\n\tasync forwardToLast() {\n\t\tconst lastFocusable = await getLastFocusableElement(this);\n\n\t\tif (lastFocusable) {\n\t\t\tlastFocusable.focus();\n\t\t} else {\n\t\t\tthis._root.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Use this method to focus the element denoted by \"initialFocus\", if provided,\n\t * or the first focusable element otherwise.\n\t * @protected\n\t */\n\tasync applyInitialFocus() {\n\t\tif (!this.preventInitialFocus) {\n\t\t\tawait this.applyFocus();\n\t\t}\n\t}\n\n\t/**\n\t * Focuses the element denoted by `initialFocus`, if provided,\n\t * or the first focusable element otherwise.\n\t * @public\n\t * @returns Promise that resolves when the focus is applied\n\t */\n\tasync applyFocus(): Promise {\n\t\t// do nothing if the standard HTML autofocus is used\n\t\tif (this.querySelector(\"[autofocus]\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tawait this._waitForDomRef();\n\n\t\tif (this.getRootNode() === this) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet element;\n\n\t\tif (this.initialFocus) {\n\t\t\telement = (this.getRootNode() as Document).getElementById(this.initialFocus)\n\t\t\t|| document.getElementById(this.initialFocus);\n\t\t}\n\n\t\telement = element || await getFirstFocusableElement(this) || this._root; // in case of no focusable content focus the root\n\n\t\tif (element) {\n\t\t\tif (element === this._root) {\n\t\t\t\telement.tabIndex = -1;\n\t\t\t}\n\t\t\telement.focus();\n\t\t}\n\t}\n\n\tisFocusWithin() {\n\t\treturn isFocusedElementWithinNode(this._root);\n\t}\n\n\t_updateMediaRange() {\n\t\tthis.mediaRange = MediaRange.getCurrentRange(MediaRange.RANGESETS.RANGE_4STEPS, this.getDomRef()!.offsetWidth);\n\t}\n\n\t/**\n\t * Adds the popup to the \"opened popups registry\"\n\t * @protected\n\t */\n\t_addOpenedPopup() {\n\t\taddOpenedPopup(this);\n\t}\n\n\t/**\n\t * Closes the popup.\n\t */\n\tclosePopup(escPressed = false, preventRegistryUpdate = false, preventFocusRestore = false): void {\n\t\tif (!this._opened) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevented = !this.fireEvent(\"before-close\", { escPressed }, true, false);\n\t\tif (prevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._opened = false;\n\n\t\tif (this.isModal) {\n\t\t\tPopup.unblockPageScrolling(this);\n\t\t}\n\n\t\tthis.hide();\n\t\tthis.open = false;\n\n\t\tif (!preventRegistryUpdate) {\n\t\t\tthis._removeOpenedPopup();\n\t\t}\n\n\t\tif (!this.preventFocusRestore && !preventFocusRestore) {\n\t\t\tthis.resetFocus();\n\t\t}\n\n\t\tthis.fireEvent(\"close\", {}, false, false);\n\t}\n\n\t/**\n\t * Removes the popup from the \"opened popups registry\"\n\t * @protected\n\t */\n\t_removeOpenedPopup() {\n\t\tremoveOpenedPopup(this);\n\t}\n\n\t/**\n\t * Returns the focus to the previously focused element\n\t * @protected\n\t */\n\tresetFocus() {\n\t\tif (!this._focusedElementBeforeOpen) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focusedElementBeforeOpen.focus();\n\t\tthis._focusedElementBeforeOpen = null;\n\t}\n\n\t/**\n\t * Sets \"block\" display to the popup. The property can be overriden by derivatives of Popup.\n\t * @protected\n\t */\n\t_show() {\n\t\tif (this.isConnected) {\n\t\t\tthis.setAttribute(\"popover\", \"manual\");\n\t\t\tthis.showPopover();\n\t\t}\n\t}\n\n\t/**\n\t * Sets \"none\" display to the popup\n\t * @protected\n\t */\n\thide() {\n\t\tthis.isConnected && this.hidePopover();\n\t}\n\n\t/**\n\t * Implement this getter with relevant logic regarding the modality of the popup (e.g. based on a public property)\n\t * @protected\n\t */\n\tabstract get isModal(): boolean\n\n\t/**\n\t * Return the ID of an element in the shadow DOM that is going to label this popup\n\t * @protected\n\t */\n\tabstract get _ariaLabelledBy(): string | undefined\n\n\t/**\n\t * Ensures ariaLabel is never null or empty string\n\t * @protected\n\t */\n\tget _ariaLabel() {\n\t\treturn getEffectiveAriaLabelText(this);\n\t}\n\n\tget _root(): HTMLElement {\n\t\treturn this.shadowRoot!.querySelector(\".ui5-popup-root\")!;\n\t}\n\n\tget _role(): string | undefined {\n\t\treturn (this.accessibleRole === PopupAccessibleRole.None) ? undefined : this.accessibleRole.toLowerCase();\n\t}\n\n\tget _ariaModal(): string | undefined {\n\t\treturn this.accessibleRole === PopupAccessibleRole.None ? undefined : \"true\";\n\t}\n\n\tget contentDOM(): HTMLElement {\n\t\treturn this.shadowRoot!.querySelector(\".ui5-popup-content\")!;\n\t}\n\n\tget styles() {\n\t\treturn {\n\t\t\troot: {},\n\t\t\tcontent: {},\n\t\t};\n\t}\n\n\tget classes(): ClassMap {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t\"ui5-popup-root\": true,\n\t\t\t\t\"ui5-content-native-scrollbars\": getEffectiveScrollbarStyle(),\n\t\t\t},\n\t\t\tcontent: {\n\t\t\t\t\"ui5-popup-content\": true,\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport default Popup;\n\nexport type {\n\tPopupScrollEventDetail,\n\tPopupBeforeCloseEventDetail,\n};\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy