@covalent/components 10.4.0-beta.2 → 11.0.0-beta.1
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/_commonjsHelpers-DGT2Y9Xa.js +1 -0
- package/{_commonjsHelpers-HP5nalso.mjs → _commonjsHelpers-MdHo5S7N.mjs} +1 -1
- package/action-ribbon/action-ribbon-base.d.ts +0 -1
- package/action-ribbon/action-ribbon.d.ts +0 -1
- package/action-ribbon.js +5 -5
- package/action-ribbon.mjs +33 -33
- package/alert/alert-base.d.ts +0 -1
- package/alert/alert.d.ts +0 -1
- package/alert.js +5 -5
- package/alert.mjs +48 -48
- package/app-shell/app-shell.d.ts +0 -1
- package/app-shell.js +1 -1
- package/app-shell.mjs +7 -7
- package/async-directive-JqUnzsgG.mjs +66 -0
- package/async-directive-X7VhNdG3.js +5 -0
- package/badge/badge.d.ts +0 -1
- package/badge.js +1 -1
- package/badge.mjs +4 -4
- package/{base-element-5ZU-p99q.js → base-element-DP9GZic2.js} +1 -1
- package/{base-element-CzNmpVoz.mjs → base-element-DUJkJh_y.mjs} +1 -1
- package/button/button.d.ts +0 -1
- package/button.js +2 -2
- package/button.mjs +26 -26
- package/card/card-base.d.ts +0 -1
- package/card/card.d.ts +0 -1
- package/card.js +8 -8
- package/card.mjs +39 -39
- package/check-list-item.js +8 -8
- package/check-list-item.mjs +34 -34
- package/checkbox/checkbox.d.ts +0 -1
- package/checkbox.js +1 -1
- package/checkbox.mjs +15 -15
- package/{chip-DmwMNZYy.js → chip-BjFvUMom.js} +44 -44
- package/{chip-tQfbvpbh.mjs → chip-Dc7_8pVI.mjs} +412 -408
- package/chip-set.js +5 -5
- package/chip-set.mjs +125 -125
- package/chip.js +1 -1
- package/chip.mjs +2 -2
- package/chips/chip-base.d.ts +0 -1
- package/chips/chip-set-base.d.ts +0 -1
- package/chips/chip-set.d.ts +0 -1
- package/chips/chip.d.ts +0 -1
- package/circular-progress/circular-progress.d.ts +0 -1
- package/circular-progress.js +15 -15
- package/circular-progress.mjs +25 -25
- package/class-map-DPUylGZM.mjs +36 -0
- package/class-map-DTzB8z-1.js +5 -0
- package/code-editor/code-editor.d.ts +0 -1
- package/code-editor/code-editor.theme.d.ts +0 -1
- package/{code-editor-CryBkPGy.js → code-editor-Bu3qtyEg.js} +110 -110
- package/{code-editor-XU5DhFbC.mjs → code-editor-CPpojoPe.mjs} +5423 -5477
- package/code-editor.js +1 -1
- package/code-editor.mjs +2 -2
- package/code-snippet/code-snippet.d.ts +0 -1
- package/code-snippet.js +11 -11
- package/code-snippet.mjs +2611 -2641
- package/dialog/dialog.d.ts +0 -1
- package/{dialog-DMqDMT_N.js → dialog-BShWbhKq.js} +9 -9
- package/{dialog-BodJc4rc.mjs → dialog-CGLRIM8z.mjs} +186 -186
- package/dialog.js +1 -1
- package/dialog.mjs +2 -2
- package/directive-C7oCP5Bh.js +5 -0
- package/directive-helpers-C-un5pST.js +5 -0
- package/directive-helpers-DS-VuBZD.mjs +11 -0
- package/{directive-B76A7YXI.mjs → directive-oAbCiebi.mjs} +4 -4
- package/drawer/drawer.d.ts +0 -1
- package/drawer.js +2 -2
- package/drawer.mjs +14 -14
- package/empty-state/empty-state.d.ts +0 -1
- package/empty-state.js +1 -1
- package/empty-state.mjs +6 -6
- package/{event-options-D44mpm5S.mjs → event-options-C7DvXRgq.mjs} +1 -1
- package/{event-options-IG-2g8HU.js → event-options-DD382x85.js} +1 -1
- package/expansion-panel/expansion-panel-item.d.ts +0 -1
- package/expansion-panel/expansion-panel.d.ts +0 -1
- package/expansion-panel-item.js +1 -1
- package/expansion-panel-item.mjs +3 -3
- package/expansion-panel.js +1 -1
- package/expansion-panel.mjs +5 -5
- package/focused-page/focused-page.d.ts +0 -1
- package/focused-page.js +1 -1
- package/focused-page.mjs +7 -7
- package/form-element-BOhYShN_.mjs +50 -0
- package/form-element-BSAsNxWv.js +5 -0
- package/formfield/formfield.d.ts +0 -1
- package/formfield.js +7 -7
- package/formfield.mjs +45 -45
- package/{foundation-BYhAXCW_.mjs → foundation-CZtT3AWn.mjs} +15 -17
- package/{foundation-sIsx2I_x.js → foundation-CySCCTUE.js} +2 -2
- package/{foundation-D6JHa7Lg.mjs → foundation-PL3XY-m_.mjs} +4 -4
- package/{foundation-aT_gy6X8.js → foundation-pgmPu2iJ.js} +1 -1
- package/full-screen-dialog/full-screen-dialog.d.ts +0 -1
- package/full-screen-dialog.js +2 -2
- package/full-screen-dialog.mjs +10 -10
- package/{html-DW6Y8eLM.mjs → html-DC72jQvb.mjs} +1 -1
- package/{html-CEiNqoVv.js → html-wWghN8cA.js} +1 -1
- package/icon/_icon-list.d.ts +0 -1
- package/icon/icon-demo.d.ts +0 -1
- package/icon/icon.d.ts +0 -1
- package/icon-button/icon-button.d.ts +0 -1
- package/icon-button-toggle/icon-button-toggle.d.ts +0 -1
- package/icon-button-toggle.js +6 -6
- package/icon-button-toggle.mjs +32 -32
- package/icon-button.js +5 -5
- package/icon-button.mjs +36 -36
- package/icon-check-toggle.js +1 -1
- package/icon-check-toggle.mjs +7 -7
- package/icon-checkbox/icon-check-toggle.d.ts +0 -1
- package/icon-lockup/icon-lockup.d.ts +0 -1
- package/icon-lockup.js +5 -5
- package/icon-lockup.mjs +4 -4
- package/icon-radio/icon-radio-toggle.d.ts +0 -1
- package/icon-radio-toggle.js +1 -1
- package/icon-radio-toggle.mjs +13 -13
- package/icon.js +1 -1
- package/icon.mjs +13 -13
- package/{if-defined-B7G84qob.js → if-defined-CZCqOAYs.js} +1 -1
- package/{if-defined-DN7whKwy.mjs → if-defined-DGrxuPYz.mjs} +1 -1
- package/index.d.ts +0 -1
- package/index.js +7 -7
- package/index.mjs +121 -121
- package/inert.esm-CknhJysw.mjs +645 -0
- package/inert.esm-D2PJKL9E.js +28 -0
- package/{javascript-DzJ0FiwJ.mjs → javascript-C_a5TwhW.mjs} +1 -1
- package/{javascript-vVCDG6Rm.js → javascript-cY8cX08V.js} +1 -1
- package/linear-progress/linear-progress.d.ts +0 -1
- package/linear-progress.js +7 -7
- package/linear-progress.mjs +32 -32
- package/list/check-list-item.d.ts +0 -1
- package/list/list-item.d.ts +0 -1
- package/list/list.d.ts +0 -1
- package/list/nav-list-item.d.ts +0 -1
- package/list/radio-list-item.d.ts +0 -1
- package/{list-item-BIuZJQpK.mjs → list-item-CK66f3gK.mjs} +1 -1
- package/{list-item-V8RaZO6L.js → list-item-LcvIn8Xz.js} +1 -1
- package/list-item.js +7 -7
- package/list-item.mjs +21 -21
- package/list.js +3 -3
- package/list.mjs +16 -16
- package/menu/menu.d.ts +0 -1
- package/menu.js +3 -3
- package/menu.mjs +16 -16
- package/{mwc-checkbox.css-CNoj0V14.mjs → mwc-checkbox.css-BrjbMwch.mjs} +28 -28
- package/{mwc-checkbox.css-BV3dyB4C.js → mwc-checkbox.css-u49MHsHT.js} +1 -1
- package/{mwc-drawer-base-BIn51sQu.js → mwc-drawer-base-C2YS_KZk.js} +3 -3
- package/{mwc-drawer-base-C96HTnbC.mjs → mwc-drawer-base-_d7xArWM.mjs} +11 -11
- package/{mwc-icon-Xgr698ax.js → mwc-icon-BUzuM0iB.js} +1 -1
- package/{mwc-icon-DTCUplqR.mjs → mwc-icon-U80igLyY.mjs} +2 -2
- package/{mwc-icon-button.css-DOVWWyjA.js → mwc-icon-button.css-BzElD_JI.js} +1 -1
- package/{mwc-icon-button.css-DJiDOS0_.mjs → mwc-icon-button.css-DosQIdlt.mjs} +1 -1
- package/{mwc-line-ripple-directive-r80jluoU.js → mwc-line-ripple-directive-DBy5sTfo.js} +4 -4
- package/{mwc-line-ripple-directive-TO37-41n.mjs → mwc-line-ripple-directive-at_ngzOj.mjs} +35 -34
- package/{mwc-list-item.css-CO1JlA8e.js → mwc-list-item.css-Bib8TVz5.js} +10 -10
- package/{mwc-list-item.css-Cg9onxQ-.mjs → mwc-list-item.css-BtGzAhUF.mjs} +10 -10
- package/{mwc-list.css-C_-DVEme.mjs → mwc-list.css-BBbQixrF.mjs} +100 -100
- package/{mwc-list.css-Deg9oBaO.js → mwc-list.css-DWV8pw-x.js} +1 -1
- package/{mwc-menu.css-qpZxKN-g.mjs → mwc-menu.css-BUjxqJjM.mjs} +303 -303
- package/{mwc-menu.css-Dvr-f3_T.js → mwc-menu.css-D3EFugOg.js} +18 -18
- package/{mwc-radio.css-DjO4Rn44.js → mwc-radio.css-BWiWreTh.js} +1 -1
- package/{mwc-radio.css-BiHC1R8I.mjs → mwc-radio.css-DPbyzNg_.mjs} +8 -8
- package/{mwc-slider.css-Deh1__Ar.mjs → mwc-slider.css-CBNgYCJf.mjs} +277 -288
- package/{mwc-slider.css-DFOaS04S.js → mwc-slider.css-DytByuJk.js} +13 -13
- package/{mwc-tab.css-sq5suZKe.js → mwc-tab.css-CrjUDOft.js} +11 -11
- package/{mwc-tab.css-2UrPKkNg.mjs → mwc-tab.css-DJHVL7wZ.mjs} +31 -31
- package/{mwc-top-app-bar-base-DUdOcIjS.js → mwc-top-app-bar-base-Gxaye-WD.js} +3 -3
- package/{mwc-top-app-bar-base-BIZGhVtM.mjs → mwc-top-app-bar-base-N3OLLWe5.mjs} +21 -21
- package/nav-list-item.js +1 -1
- package/nav-list-item.mjs +13 -13
- package/notebook-cell/notebook-cell.d.ts +0 -1
- package/notebook-cell.js +1 -1
- package/notebook-cell.mjs +23 -23
- package/package.json +3 -3
- package/{property-BRKnMYJe.js → property-DYTC_2-m.js} +1 -1
- package/{python-CddQNZH2.mjs → python-3XbrQbry.mjs} +1 -1
- package/{python-DnfGbG5q.js → python-C-jtMxm_.js} +1 -1
- package/query-CDOd1Kwm.mjs +15 -0
- package/query-Dv2F3m_t.js +5 -0
- package/query-assigned-elements-8EurZY45.js +31 -0
- package/query-assigned-elements-D930kELM.mjs +591 -0
- package/query-assigned-nodes-BAfLwxmx.js +5 -0
- package/query-assigned-nodes-Dof2CSLU.mjs +17 -0
- package/radio/radio.d.ts +0 -1
- package/radio-list-item.js +9 -9
- package/radio-list-item.mjs +28 -28
- package/radio.js +1 -1
- package/radio.mjs +15 -15
- package/{ripple-handlers-BDmOLx8c.js → ripple-handlers-C7an-EE1.js} +5 -5
- package/{ripple-handlers-BAdg-fJB.mjs → ripple-handlers-_gEIkKpx.mjs} +71 -71
- package/select/select.d.ts +0 -1
- package/select.js +15 -15
- package/select.mjs +166 -167
- package/side-sheet/side-sheet.d.ts +0 -1
- package/side-sheet.js +1 -1
- package/side-sheet.mjs +8 -8
- package/slider/slider-range.d.ts +0 -1
- package/slider/slider.d.ts +0 -1
- package/slider-range.js +5 -5
- package/slider-range.mjs +43 -43
- package/slider.js +2 -2
- package/slider.mjs +19 -19
- package/snackbar/snackbar.d.ts +0 -1
- package/snackbar.js +11 -11
- package/snackbar.mjs +54 -54
- package/{state-Csv4sdJA.js → state-C3HoXfoa.js} +1 -1
- package/status-dialog/status-dialog.d.ts +0 -1
- package/status-dialog.js +1 -1
- package/status-dialog.mjs +6 -6
- package/status-header/status-header-base.d.ts +0 -1
- package/status-header/status-header-item.d.ts +0 -1
- package/status-header/status-header.d.ts +0 -1
- package/status-header-item.js +1 -1
- package/status-header-item.mjs +17 -17
- package/status-header.js +5 -5
- package/status-header.mjs +34 -34
- package/style-map-D2TR7M-D.mjs +42 -0
- package/style-map-DOMuf9Fg.js +5 -0
- package/switch/switch.d.ts +0 -1
- package/switch.js +5 -5
- package/switch.mjs +42 -42
- package/tab/tab-bar.d.ts +0 -1
- package/tab/tab.d.ts +0 -1
- package/tab-bar.js +11 -11
- package/tab-bar.mjs +98 -98
- package/tab.js +1 -1
- package/tab.mjs +13 -13
- package/text-lockup/text-lockup.d.ts +0 -1
- package/text-lockup.js +1 -1
- package/text-lockup.mjs +9 -9
- package/textarea/textarea.d.ts +0 -1
- package/textarea.js +6 -6
- package/textarea.mjs +29 -29
- package/textfield/textfield.d.ts +0 -1
- package/{textfield-bHWjhOOq.js → textfield-Byf2gP_G.js} +31 -31
- package/{textfield-i_Whj47J.mjs → textfield-RbQ6Kwq7.mjs} +102 -102
- package/textfield.js +3 -3
- package/textfield.mjs +17 -17
- package/theme/prebuilt/dark-theme.css +1 -1
- package/theme/prebuilt/light-theme.css +1 -1
- package/toolbar/toolbar.d.ts +0 -1
- package/toolbar.js +1 -1
- package/toolbar.mjs +4 -4
- package/tooltip/tooltip.d.ts +0 -1
- package/tooltip.js +3 -3
- package/tooltip.mjs +54 -55
- package/top-app-bar/top-app-bar-fixed.d.ts +0 -1
- package/top-app-bar/top-app-bar.d.ts +0 -1
- package/{top-app-bar-CZ5ILmAf.mjs → top-app-bar-BQ88Rom5.mjs} +1 -1
- package/top-app-bar-fixed.js +8 -8
- package/top-app-bar-fixed.mjs +40 -40
- package/{top-app-bar-UVbXY1md.js → top-app-bar-lbNkmJbQ.js} +1 -1
- package/top-app-bar.js +3 -3
- package/top-app-bar.mjs +18 -18
- package/tree-list/tree-list-item.d.ts +0 -1
- package/tree-list/tree-list.d.ts +0 -1
- package/tree-list-item.js +1 -1
- package/tree-list-item.mjs +4 -4
- package/tree-list.js +4 -4
- package/tree-list.mjs +22 -22
- package/tslib.es6-CJ7TUrOc.mjs +75 -0
- package/{typescript-BRw9OFm1.js → typescript-CNfpftAV.js} +1 -1
- package/{typescript-CdlgcZ3y.mjs → typescript-Dj6mne2e.mjs} +1 -1
- package/typography/typography.d.ts +0 -1
- package/typography.js +1 -1
- package/typography.mjs +3 -3
- package/_commonjsHelpers-6jR-N8xe.js +0 -1
- package/action-ribbon/action-ribbon-base.d.ts.map +0 -1
- package/action-ribbon/action-ribbon.d.ts.map +0 -1
- package/alert/alert-base.d.ts.map +0 -1
- package/alert/alert.d.ts.map +0 -1
- package/app-shell/app-shell.d.ts.map +0 -1
- package/async-directive-2AOdKBUW.mjs +0 -66
- package/async-directive-DZ3MjSIj.js +0 -5
- package/badge/badge.d.ts.map +0 -1
- package/button/button.d.ts.map +0 -1
- package/card/card-base.d.ts.map +0 -1
- package/card/card.d.ts.map +0 -1
- package/checkbox/checkbox.d.ts.map +0 -1
- package/chips/chip-base.d.ts.map +0 -1
- package/chips/chip-set-base.d.ts.map +0 -1
- package/chips/chip-set.d.ts.map +0 -1
- package/chips/chip.d.ts.map +0 -1
- package/circular-progress/circular-progress.d.ts.map +0 -1
- package/class-map-BHl5MHd7.mjs +0 -36
- package/class-map-PsUYVqvf.js +0 -5
- package/code-editor/code-editor.d.ts.map +0 -1
- package/code-editor/code-editor.theme.d.ts.map +0 -1
- package/code-snippet/code-snippet.d.ts.map +0 -1
- package/dialog/dialog.d.ts.map +0 -1
- package/directive-C_VV3qwo.js +0 -5
- package/directive-helpers-6HCt_-zj.mjs +0 -11
- package/directive-helpers-BnUMbYHh.js +0 -5
- package/drawer/drawer.d.ts.map +0 -1
- package/empty-state/empty-state.d.ts.map +0 -1
- package/expansion-panel/expansion-panel-item.d.ts.map +0 -1
- package/expansion-panel/expansion-panel.d.ts.map +0 -1
- package/focused-page/focused-page.d.ts.map +0 -1
- package/form-element--PS8uSRI.js +0 -5
- package/form-element-Dn0Lerng.mjs +0 -50
- package/formfield/formfield.d.ts.map +0 -1
- package/full-screen-dialog/full-screen-dialog.d.ts.map +0 -1
- package/icon/_icon-list.d.ts.map +0 -1
- package/icon/icon-demo.d.ts.map +0 -1
- package/icon/icon.d.ts.map +0 -1
- package/icon-button/icon-button.d.ts.map +0 -1
- package/icon-button-toggle/icon-button-toggle.d.ts.map +0 -1
- package/icon-checkbox/icon-check-toggle.d.ts.map +0 -1
- package/icon-lockup/icon-lockup.d.ts.map +0 -1
- package/icon-radio/icon-radio-toggle.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/inert.esm-C8R-X3j4.mjs +0 -639
- package/inert.esm-t-228rpY.js +0 -28
- package/linear-progress/linear-progress.d.ts.map +0 -1
- package/list/check-list-item.d.ts.map +0 -1
- package/list/list-item.d.ts.map +0 -1
- package/list/list.d.ts.map +0 -1
- package/list/nav-list-item.d.ts.map +0 -1
- package/list/radio-list-item.d.ts.map +0 -1
- package/menu/menu.d.ts.map +0 -1
- package/notebook-cell/notebook-cell.d.ts.map +0 -1
- package/query-BvlE-gMJ.js +0 -5
- package/query-DSO61t36.mjs +0 -15
- package/query-assigned-elements-BQszEgac.js +0 -31
- package/query-assigned-elements-DhyCP_2z.mjs +0 -591
- package/query-assigned-nodes-9DFnkxV8.js +0 -5
- package/query-assigned-nodes-B-jCihdA.mjs +0 -17
- package/radio/radio.d.ts.map +0 -1
- package/select/select.d.ts.map +0 -1
- package/side-sheet/side-sheet.d.ts.map +0 -1
- package/slider/slider-range.d.ts.map +0 -1
- package/slider/slider.d.ts.map +0 -1
- package/snackbar/snackbar.d.ts.map +0 -1
- package/status-dialog/status-dialog.d.ts.map +0 -1
- package/status-header/status-header-base.d.ts.map +0 -1
- package/status-header/status-header-item.d.ts.map +0 -1
- package/status-header/status-header.d.ts.map +0 -1
- package/style-map-3QfsA_1O.js +0 -5
- package/style-map-QxIETvrs.mjs +0 -42
- package/switch/switch.d.ts.map +0 -1
- package/tab/tab-bar.d.ts.map +0 -1
- package/tab/tab.d.ts.map +0 -1
- package/text-lockup/text-lockup.d.ts.map +0 -1
- package/textarea/textarea.d.ts.map +0 -1
- package/textfield/textfield.d.ts.map +0 -1
- package/theme/prebuilt/dark-theme.css.map +0 -1
- package/theme/prebuilt/light-theme.css.map +0 -1
- package/toolbar/toolbar.d.ts.map +0 -1
- package/tooltip/tooltip.d.ts.map +0 -1
- package/top-app-bar/top-app-bar-fixed.d.ts.map +0 -1
- package/top-app-bar/top-app-bar.d.ts.map +0 -1
- package/tree-list/tree-list-item.d.ts.map +0 -1
- package/tree-list/tree-list.d.ts.map +0 -1
- package/tslib.es6-CISSdiiH.mjs +0 -75
- package/typography/typography.d.ts.map +0 -1
- /package/{style.css → covalent.css} +0 -0
@@ -0,0 +1,645 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2016 Google Inc. All rights reserved.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
(() => {
|
18
|
+
var S, w, v;
|
19
|
+
const l = Symbol(), y = Symbol(), b = Symbol(), c = Symbol(), p = Symbol(), N = Symbol(), k = Symbol(), T = Symbol(), u = Symbol(), n = Symbol(), e = Symbol(), i = Symbol(), o = Symbol();
|
20
|
+
class d {
|
21
|
+
constructor() {
|
22
|
+
this[S] = [], this[w] = [], this[v] = /* @__PURE__ */ new Set();
|
23
|
+
}
|
24
|
+
destructor() {
|
25
|
+
this[u](this[b]);
|
26
|
+
const t = this;
|
27
|
+
t[l] = null, t[b] = null, t[y] = null;
|
28
|
+
}
|
29
|
+
get top() {
|
30
|
+
const t = this[l];
|
31
|
+
return t[t.length - 1] || null;
|
32
|
+
}
|
33
|
+
push(t) {
|
34
|
+
!t || t === this.top || (this.remove(t), this[N](t), this[l].push(t));
|
35
|
+
}
|
36
|
+
remove(t) {
|
37
|
+
const r = this[l].indexOf(t);
|
38
|
+
return r === -1 ? !1 : (this[l].splice(r, 1), r === this[l].length && this[N](this.top), !0);
|
39
|
+
}
|
40
|
+
pop() {
|
41
|
+
const t = this.top;
|
42
|
+
return t && this.remove(t), t;
|
43
|
+
}
|
44
|
+
has(t) {
|
45
|
+
return this[l].indexOf(t) !== -1;
|
46
|
+
}
|
47
|
+
/**
|
48
|
+
* Sets `inert` to all document elements except the new top element, its
|
49
|
+
* parents, and its distributed content.
|
50
|
+
*/
|
51
|
+
[(S = l, w = b, v = y, N)](t) {
|
52
|
+
const r = this[y], s = this[b];
|
53
|
+
if (!t) {
|
54
|
+
this[u](s), r.clear(), this[b] = [];
|
55
|
+
return;
|
56
|
+
}
|
57
|
+
const a = this[n](t);
|
58
|
+
if (a[a.length - 1].parentNode !== document.body)
|
59
|
+
throw Error("Non-connected element cannot be a blocking element");
|
60
|
+
this[b] = a;
|
61
|
+
const h = this[e](t);
|
62
|
+
if (!s.length) {
|
63
|
+
this[T](a, h, r);
|
64
|
+
return;
|
65
|
+
}
|
66
|
+
let _ = s.length - 1, f = a.length - 1;
|
67
|
+
for (; _ > 0 && f > 0 && s[_] === a[f]; )
|
68
|
+
_--, f--;
|
69
|
+
s[_] !== a[f] && this[k](s[_], a[f]), _ > 0 && this[u](s.slice(0, _)), f > 0 && this[T](a.slice(0, f), h, null);
|
70
|
+
}
|
71
|
+
/**
|
72
|
+
* Swaps inertness between two sibling elements.
|
73
|
+
* Sets the property `inert` over the attribute since the inert spec
|
74
|
+
* doesn't specify if it should be reflected.
|
75
|
+
* https://html.spec.whatwg.org/multipage/interaction.html#inert
|
76
|
+
*/
|
77
|
+
[k](t, r) {
|
78
|
+
const s = t[c];
|
79
|
+
this[i](t) && !t.inert && (t.inert = !0, s.add(t)), s.has(r) && (r.inert = !1, s.delete(r)), r[p] = t[p], r[c] = s, t[p] = void 0, t[c] = void 0;
|
80
|
+
}
|
81
|
+
/**
|
82
|
+
* Restores original inertness to the siblings of the elements.
|
83
|
+
* Sets the property `inert` over the attribute since the inert spec
|
84
|
+
* doesn't specify if it should be reflected.
|
85
|
+
* https://html.spec.whatwg.org/multipage/interaction.html#inert
|
86
|
+
*/
|
87
|
+
[u](t) {
|
88
|
+
for (const r of t) {
|
89
|
+
r[p].disconnect(), r[p] = void 0;
|
90
|
+
const a = r[c];
|
91
|
+
for (const h of a)
|
92
|
+
h.inert = !1;
|
93
|
+
r[c] = void 0;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
/**
|
97
|
+
* Inerts the siblings of the elements except the elements to skip. Stores
|
98
|
+
* the inerted siblings into the element's symbol `_siblingsToRestore`.
|
99
|
+
* Pass `toKeepInert` to collect the already inert elements.
|
100
|
+
* Sets the property `inert` over the attribute since the inert spec
|
101
|
+
* doesn't specify if it should be reflected.
|
102
|
+
* https://html.spec.whatwg.org/multipage/interaction.html#inert
|
103
|
+
*/
|
104
|
+
[T](t, r, s) {
|
105
|
+
for (const a of t) {
|
106
|
+
const h = a.parentNode, _ = h.children, f = /* @__PURE__ */ new Set();
|
107
|
+
for (let R = 0; R < _.length; R++) {
|
108
|
+
const I = _[R];
|
109
|
+
I === a || !this[i](I) || r && r.has(I) || (s && I.inert ? s.add(I) : (I.inert = !0, f.add(I)));
|
110
|
+
}
|
111
|
+
a[c] = f;
|
112
|
+
const M = new MutationObserver(this[o].bind(this));
|
113
|
+
a[p] = M;
|
114
|
+
let E = h;
|
115
|
+
const g = E;
|
116
|
+
g.__shady && g.host && (E = g.host), M.observe(E, {
|
117
|
+
childList: !0
|
118
|
+
});
|
119
|
+
}
|
120
|
+
}
|
121
|
+
/**
|
122
|
+
* Handles newly added/removed nodes by toggling their inertness.
|
123
|
+
* It also checks if the current top Blocking Element has been removed,
|
124
|
+
* notifying and removing it.
|
125
|
+
*/
|
126
|
+
[o](t) {
|
127
|
+
const r = this[b], s = this[y];
|
128
|
+
for (const a of t) {
|
129
|
+
const h = a.target.host || a.target, _ = h === document.body ? r.length : r.indexOf(h), f = r[_ - 1], M = f[c];
|
130
|
+
for (let E = 0; E < a.removedNodes.length; E++) {
|
131
|
+
const g = a.removedNodes[E];
|
132
|
+
if (g === f) {
|
133
|
+
console.info("Detected removal of the top Blocking Element."), this.pop();
|
134
|
+
return;
|
135
|
+
}
|
136
|
+
M.has(g) && (g.inert = !1, M.delete(g));
|
137
|
+
}
|
138
|
+
for (let E = 0; E < a.addedNodes.length; E++) {
|
139
|
+
const g = a.addedNodes[E];
|
140
|
+
this[i](g) && (s && g.inert ? s.add(g) : (g.inert = !0, M.add(g)));
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
/**
|
145
|
+
* Returns if the element is inertable.
|
146
|
+
*/
|
147
|
+
[i](t) {
|
148
|
+
return /^(style|template|script)$/.test(t.localName) === !1;
|
149
|
+
}
|
150
|
+
/**
|
151
|
+
* Returns the list of newParents of an element, starting from element
|
152
|
+
* (included) up to `document.body` (excluded).
|
153
|
+
*/
|
154
|
+
[n](t) {
|
155
|
+
const r = [];
|
156
|
+
let s = t;
|
157
|
+
for (; s && s !== document.body; ) {
|
158
|
+
if (s.nodeType === Node.ELEMENT_NODE && r.push(s), s.assignedSlot) {
|
159
|
+
for (; s = s.assignedSlot; )
|
160
|
+
r.push(s);
|
161
|
+
s = r.pop();
|
162
|
+
continue;
|
163
|
+
}
|
164
|
+
s = s.parentNode || s.host;
|
165
|
+
}
|
166
|
+
return r;
|
167
|
+
}
|
168
|
+
/**
|
169
|
+
* Returns the distributed children of the element's shadow root.
|
170
|
+
* Returns null if the element doesn't have a shadow root.
|
171
|
+
*/
|
172
|
+
[e](t) {
|
173
|
+
const r = t.shadowRoot;
|
174
|
+
if (!r)
|
175
|
+
return null;
|
176
|
+
const s = /* @__PURE__ */ new Set();
|
177
|
+
let a, h, _;
|
178
|
+
const f = r.querySelectorAll("slot");
|
179
|
+
if (f.length && f[0].assignedNodes)
|
180
|
+
for (a = 0; a < f.length; a++)
|
181
|
+
for (_ = f[a].assignedNodes({
|
182
|
+
flatten: !0
|
183
|
+
}), h = 0; h < _.length; h++)
|
184
|
+
_[h].nodeType === Node.ELEMENT_NODE && s.add(_[h]);
|
185
|
+
return s;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
document.$blockingElements = new d();
|
189
|
+
})();
|
190
|
+
var A = {}, x;
|
191
|
+
function D() {
|
192
|
+
if (x) return A;
|
193
|
+
x = 1;
|
194
|
+
var S = /* @__PURE__ */ function() {
|
195
|
+
function v(l, y) {
|
196
|
+
for (var b = 0; b < y.length; b++) {
|
197
|
+
var c = y[b];
|
198
|
+
c.enumerable = c.enumerable || !1, c.configurable = !0, "value" in c && (c.writable = !0), Object.defineProperty(l, c.key, c);
|
199
|
+
}
|
200
|
+
}
|
201
|
+
return function(l, y, b) {
|
202
|
+
return y && v(l.prototype, y), b && v(l, b), l;
|
203
|
+
};
|
204
|
+
}();
|
205
|
+
function w(v, l) {
|
206
|
+
if (!(v instanceof l))
|
207
|
+
throw new TypeError("Cannot call a class as a function");
|
208
|
+
}
|
209
|
+
return function() {
|
210
|
+
if (typeof window > "u" || typeof Element > "u")
|
211
|
+
return;
|
212
|
+
var v = Array.prototype.slice, l = Element.prototype.matches || Element.prototype.msMatchesSelector, y = ["a[href]", "area[href]", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])", "button:not([disabled])", "details", "summary", "iframe", "object", "embed", "video", "[contenteditable]"].join(","), b = function() {
|
213
|
+
function u(n, e) {
|
214
|
+
w(this, u), this._inertManager = e, this._rootElement = n, this._managedNodes = /* @__PURE__ */ new Set(), this._rootElement.hasAttribute("aria-hidden") ? this._savedAriaHidden = this._rootElement.getAttribute("aria-hidden") : this._savedAriaHidden = null, this._rootElement.setAttribute("aria-hidden", "true"), this._makeSubtreeUnfocusable(this._rootElement), this._observer = new MutationObserver(this._onMutation.bind(this)), this._observer.observe(this._rootElement, { attributes: !0, childList: !0, subtree: !0 });
|
215
|
+
}
|
216
|
+
return S(u, [{
|
217
|
+
key: "destructor",
|
218
|
+
value: function() {
|
219
|
+
this._observer.disconnect(), this._rootElement && (this._savedAriaHidden !== null ? this._rootElement.setAttribute("aria-hidden", this._savedAriaHidden) : this._rootElement.removeAttribute("aria-hidden")), this._managedNodes.forEach(function(e) {
|
220
|
+
this._unmanageNode(e.node);
|
221
|
+
}, this), this._observer = /** @type {?} */
|
222
|
+
null, this._rootElement = /** @type {?} */
|
223
|
+
null, this._managedNodes = /** @type {?} */
|
224
|
+
null, this._inertManager = /** @type {?} */
|
225
|
+
null;
|
226
|
+
}
|
227
|
+
/**
|
228
|
+
* @return {!Set<!InertNode>} A copy of this InertRoot's managed nodes set.
|
229
|
+
*/
|
230
|
+
}, {
|
231
|
+
key: "_makeSubtreeUnfocusable",
|
232
|
+
/**
|
233
|
+
* @param {!Node} startNode
|
234
|
+
*/
|
235
|
+
value: function(e) {
|
236
|
+
var i = this;
|
237
|
+
N(e, function(t) {
|
238
|
+
return i._visitNode(t);
|
239
|
+
});
|
240
|
+
var o = document.activeElement;
|
241
|
+
if (!document.body.contains(e)) {
|
242
|
+
for (var d = e, m = void 0; d; ) {
|
243
|
+
if (d.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
244
|
+
m = /** @type {!ShadowRoot} */
|
245
|
+
d;
|
246
|
+
break;
|
247
|
+
}
|
248
|
+
d = d.parentNode;
|
249
|
+
}
|
250
|
+
m && (o = m.activeElement);
|
251
|
+
}
|
252
|
+
e.contains(o) && (o.blur(), o === document.activeElement && document.body.focus());
|
253
|
+
}
|
254
|
+
/**
|
255
|
+
* @param {!Node} node
|
256
|
+
*/
|
257
|
+
}, {
|
258
|
+
key: "_visitNode",
|
259
|
+
value: function(e) {
|
260
|
+
if (e.nodeType === Node.ELEMENT_NODE) {
|
261
|
+
var i = (
|
262
|
+
/** @type {!HTMLElement} */
|
263
|
+
e
|
264
|
+
);
|
265
|
+
i !== this._rootElement && i.hasAttribute("inert") && this._adoptInertRoot(i), (l.call(i, y) || i.hasAttribute("tabindex")) && this._manageNode(i);
|
266
|
+
}
|
267
|
+
}
|
268
|
+
/**
|
269
|
+
* Register the given node with this InertRoot and with InertManager.
|
270
|
+
* @param {!Node} node
|
271
|
+
*/
|
272
|
+
}, {
|
273
|
+
key: "_manageNode",
|
274
|
+
value: function(e) {
|
275
|
+
var i = this._inertManager.register(e, this);
|
276
|
+
this._managedNodes.add(i);
|
277
|
+
}
|
278
|
+
/**
|
279
|
+
* Unregister the given node with this InertRoot and with InertManager.
|
280
|
+
* @param {!Node} node
|
281
|
+
*/
|
282
|
+
}, {
|
283
|
+
key: "_unmanageNode",
|
284
|
+
value: function(e) {
|
285
|
+
var i = this._inertManager.deregister(e, this);
|
286
|
+
i && this._managedNodes.delete(i);
|
287
|
+
}
|
288
|
+
/**
|
289
|
+
* Unregister the entire subtree starting at `startNode`.
|
290
|
+
* @param {!Node} startNode
|
291
|
+
*/
|
292
|
+
}, {
|
293
|
+
key: "_unmanageSubtree",
|
294
|
+
value: function(e) {
|
295
|
+
var i = this;
|
296
|
+
N(e, function(o) {
|
297
|
+
return i._unmanageNode(o);
|
298
|
+
});
|
299
|
+
}
|
300
|
+
/**
|
301
|
+
* If a descendant node is found with an `inert` attribute, adopt its managed nodes.
|
302
|
+
* @param {!HTMLElement} node
|
303
|
+
*/
|
304
|
+
}, {
|
305
|
+
key: "_adoptInertRoot",
|
306
|
+
value: function(e) {
|
307
|
+
var i = this._inertManager.getInertRoot(e);
|
308
|
+
i || (this._inertManager.setInert(e, !0), i = this._inertManager.getInertRoot(e)), i.managedNodes.forEach(function(o) {
|
309
|
+
this._manageNode(o.node);
|
310
|
+
}, this);
|
311
|
+
}
|
312
|
+
/**
|
313
|
+
* Callback used when mutation observer detects subtree additions, removals, or attribute changes.
|
314
|
+
* @param {!Array<!MutationRecord>} records
|
315
|
+
* @param {!MutationObserver} self
|
316
|
+
*/
|
317
|
+
}, {
|
318
|
+
key: "_onMutation",
|
319
|
+
value: function(e, i) {
|
320
|
+
e.forEach(function(o) {
|
321
|
+
var d = (
|
322
|
+
/** @type {!HTMLElement} */
|
323
|
+
o.target
|
324
|
+
);
|
325
|
+
if (o.type === "childList")
|
326
|
+
v.call(o.addedNodes).forEach(function(t) {
|
327
|
+
this._makeSubtreeUnfocusable(t);
|
328
|
+
}, this), v.call(o.removedNodes).forEach(function(t) {
|
329
|
+
this._unmanageSubtree(t);
|
330
|
+
}, this);
|
331
|
+
else if (o.type === "attributes") {
|
332
|
+
if (o.attributeName === "tabindex")
|
333
|
+
this._manageNode(d);
|
334
|
+
else if (d !== this._rootElement && o.attributeName === "inert" && d.hasAttribute("inert")) {
|
335
|
+
this._adoptInertRoot(d);
|
336
|
+
var m = this._inertManager.getInertRoot(d);
|
337
|
+
this._managedNodes.forEach(function(t) {
|
338
|
+
d.contains(t.node) && m._manageNode(t.node);
|
339
|
+
});
|
340
|
+
}
|
341
|
+
}
|
342
|
+
}, this);
|
343
|
+
}
|
344
|
+
}, {
|
345
|
+
key: "managedNodes",
|
346
|
+
get: function() {
|
347
|
+
return new Set(this._managedNodes);
|
348
|
+
}
|
349
|
+
/** @return {boolean} */
|
350
|
+
}, {
|
351
|
+
key: "hasSavedAriaHidden",
|
352
|
+
get: function() {
|
353
|
+
return this._savedAriaHidden !== null;
|
354
|
+
}
|
355
|
+
/** @param {?string} ariaHidden */
|
356
|
+
}, {
|
357
|
+
key: "savedAriaHidden",
|
358
|
+
set: function(e) {
|
359
|
+
this._savedAriaHidden = e;
|
360
|
+
},
|
361
|
+
get: function() {
|
362
|
+
return this._savedAriaHidden;
|
363
|
+
}
|
364
|
+
}]), u;
|
365
|
+
}(), c = function() {
|
366
|
+
function u(n, e) {
|
367
|
+
w(this, u), this._node = n, this._overrodeFocusMethod = !1, this._inertRoots = /* @__PURE__ */ new Set([e]), this._savedTabIndex = null, this._destroyed = !1, this.ensureUntabbable();
|
368
|
+
}
|
369
|
+
return S(u, [{
|
370
|
+
key: "destructor",
|
371
|
+
value: function() {
|
372
|
+
if (this._throwIfDestroyed(), this._node && this._node.nodeType === Node.ELEMENT_NODE) {
|
373
|
+
var e = (
|
374
|
+
/** @type {!HTMLElement} */
|
375
|
+
this._node
|
376
|
+
);
|
377
|
+
this._savedTabIndex !== null ? e.setAttribute("tabindex", this._savedTabIndex) : e.removeAttribute("tabindex"), this._overrodeFocusMethod && delete e.focus;
|
378
|
+
}
|
379
|
+
this._node = /** @type {?} */
|
380
|
+
null, this._inertRoots = /** @type {?} */
|
381
|
+
null, this._destroyed = !0;
|
382
|
+
}
|
383
|
+
/**
|
384
|
+
* @type {boolean} Whether this object is obsolete because the managed node is no longer inert.
|
385
|
+
* If the object has been destroyed, any attempt to access it will cause an exception.
|
386
|
+
*/
|
387
|
+
}, {
|
388
|
+
key: "_throwIfDestroyed",
|
389
|
+
/**
|
390
|
+
* Throw if user tries to access destroyed InertNode.
|
391
|
+
*/
|
392
|
+
value: function() {
|
393
|
+
if (this.destroyed)
|
394
|
+
throw new Error("Trying to access destroyed InertNode");
|
395
|
+
}
|
396
|
+
/** @return {boolean} */
|
397
|
+
}, {
|
398
|
+
key: "ensureUntabbable",
|
399
|
+
/** Save the existing tabindex value and make the node untabbable and unfocusable */
|
400
|
+
value: function() {
|
401
|
+
if (this.node.nodeType === Node.ELEMENT_NODE) {
|
402
|
+
var e = (
|
403
|
+
/** @type {!HTMLElement} */
|
404
|
+
this.node
|
405
|
+
);
|
406
|
+
if (l.call(e, y)) {
|
407
|
+
if (
|
408
|
+
/** @type {!HTMLElement} */
|
409
|
+
e.tabIndex === -1 && this.hasSavedTabIndex
|
410
|
+
)
|
411
|
+
return;
|
412
|
+
e.hasAttribute("tabindex") && (this._savedTabIndex = /** @type {!HTMLElement} */
|
413
|
+
e.tabIndex), e.setAttribute("tabindex", "-1"), e.nodeType === Node.ELEMENT_NODE && (e.focus = function() {
|
414
|
+
}, this._overrodeFocusMethod = !0);
|
415
|
+
} else e.hasAttribute("tabindex") && (this._savedTabIndex = /** @type {!HTMLElement} */
|
416
|
+
e.tabIndex, e.removeAttribute("tabindex"));
|
417
|
+
}
|
418
|
+
}
|
419
|
+
/**
|
420
|
+
* Add another inert root to this inert node's set of managing inert roots.
|
421
|
+
* @param {!InertRoot} inertRoot
|
422
|
+
*/
|
423
|
+
}, {
|
424
|
+
key: "addInertRoot",
|
425
|
+
value: function(e) {
|
426
|
+
this._throwIfDestroyed(), this._inertRoots.add(e);
|
427
|
+
}
|
428
|
+
/**
|
429
|
+
* Remove the given inert root from this inert node's set of managing inert roots.
|
430
|
+
* If the set of managing inert roots becomes empty, this node is no longer inert,
|
431
|
+
* so the object should be destroyed.
|
432
|
+
* @param {!InertRoot} inertRoot
|
433
|
+
*/
|
434
|
+
}, {
|
435
|
+
key: "removeInertRoot",
|
436
|
+
value: function(e) {
|
437
|
+
this._throwIfDestroyed(), this._inertRoots.delete(e), this._inertRoots.size === 0 && this.destructor();
|
438
|
+
}
|
439
|
+
}, {
|
440
|
+
key: "destroyed",
|
441
|
+
get: function() {
|
442
|
+
return (
|
443
|
+
/** @type {!InertNode} */
|
444
|
+
this._destroyed
|
445
|
+
);
|
446
|
+
}
|
447
|
+
}, {
|
448
|
+
key: "hasSavedTabIndex",
|
449
|
+
get: function() {
|
450
|
+
return this._savedTabIndex !== null;
|
451
|
+
}
|
452
|
+
/** @return {!Node} */
|
453
|
+
}, {
|
454
|
+
key: "node",
|
455
|
+
get: function() {
|
456
|
+
return this._throwIfDestroyed(), this._node;
|
457
|
+
}
|
458
|
+
/** @param {?number} tabIndex */
|
459
|
+
}, {
|
460
|
+
key: "savedTabIndex",
|
461
|
+
set: function(e) {
|
462
|
+
this._throwIfDestroyed(), this._savedTabIndex = e;
|
463
|
+
},
|
464
|
+
get: function() {
|
465
|
+
return this._throwIfDestroyed(), this._savedTabIndex;
|
466
|
+
}
|
467
|
+
}]), u;
|
468
|
+
}(), p = function() {
|
469
|
+
function u(n) {
|
470
|
+
if (w(this, u), !n)
|
471
|
+
throw new Error("Missing required argument; InertManager needs to wrap a document.");
|
472
|
+
this._document = n, this._managedNodes = /* @__PURE__ */ new Map(), this._inertRoots = /* @__PURE__ */ new Map(), this._observer = new MutationObserver(this._watchForInert.bind(this)), k(n.head || n.body || n.documentElement), n.readyState === "loading" ? n.addEventListener("DOMContentLoaded", this._onDocumentLoaded.bind(this)) : this._onDocumentLoaded();
|
473
|
+
}
|
474
|
+
return S(u, [{
|
475
|
+
key: "setInert",
|
476
|
+
value: function(e, i) {
|
477
|
+
if (i) {
|
478
|
+
if (this._inertRoots.has(e))
|
479
|
+
return;
|
480
|
+
var o = new b(e, this);
|
481
|
+
if (e.setAttribute("inert", ""), this._inertRoots.set(e, o), !this._document.body.contains(e))
|
482
|
+
for (var d = e.parentNode; d; )
|
483
|
+
d.nodeType === 11 && k(d), d = d.parentNode;
|
484
|
+
} else {
|
485
|
+
if (!this._inertRoots.has(e))
|
486
|
+
return;
|
487
|
+
var m = this._inertRoots.get(e);
|
488
|
+
m.destructor(), this._inertRoots.delete(e), e.removeAttribute("inert");
|
489
|
+
}
|
490
|
+
}
|
491
|
+
/**
|
492
|
+
* Get the InertRoot object corresponding to the given inert root element, if any.
|
493
|
+
* @param {!Node} element
|
494
|
+
* @return {!InertRoot|undefined}
|
495
|
+
*/
|
496
|
+
}, {
|
497
|
+
key: "getInertRoot",
|
498
|
+
value: function(e) {
|
499
|
+
return this._inertRoots.get(e);
|
500
|
+
}
|
501
|
+
/**
|
502
|
+
* Register the given InertRoot as managing the given node.
|
503
|
+
* In the case where the node has a previously existing inert root, this inert root will
|
504
|
+
* be added to its set of inert roots.
|
505
|
+
* @param {!Node} node
|
506
|
+
* @param {!InertRoot} inertRoot
|
507
|
+
* @return {!InertNode} inertNode
|
508
|
+
*/
|
509
|
+
}, {
|
510
|
+
key: "register",
|
511
|
+
value: function(e, i) {
|
512
|
+
var o = this._managedNodes.get(e);
|
513
|
+
return o !== void 0 ? o.addInertRoot(i) : o = new c(e, i), this._managedNodes.set(e, o), o;
|
514
|
+
}
|
515
|
+
/**
|
516
|
+
* De-register the given InertRoot as managing the given inert node.
|
517
|
+
* Removes the inert root from the InertNode's set of managing inert roots, and remove the inert
|
518
|
+
* node from the InertManager's set of managed nodes if it is destroyed.
|
519
|
+
* If the node is not currently managed, this is essentially a no-op.
|
520
|
+
* @param {!Node} node
|
521
|
+
* @param {!InertRoot} inertRoot
|
522
|
+
* @return {?InertNode} The potentially destroyed InertNode associated with this node, if any.
|
523
|
+
*/
|
524
|
+
}, {
|
525
|
+
key: "deregister",
|
526
|
+
value: function(e, i) {
|
527
|
+
var o = this._managedNodes.get(e);
|
528
|
+
return o ? (o.removeInertRoot(i), o.destroyed && this._managedNodes.delete(e), o) : null;
|
529
|
+
}
|
530
|
+
/**
|
531
|
+
* Callback used when document has finished loading.
|
532
|
+
*/
|
533
|
+
}, {
|
534
|
+
key: "_onDocumentLoaded",
|
535
|
+
value: function() {
|
536
|
+
var e = v.call(this._document.querySelectorAll("[inert]"));
|
537
|
+
e.forEach(function(i) {
|
538
|
+
this.setInert(i, !0);
|
539
|
+
}, this), this._observer.observe(this._document.body || this._document.documentElement, { attributes: !0, subtree: !0, childList: !0 });
|
540
|
+
}
|
541
|
+
/**
|
542
|
+
* Callback used when mutation observer detects attribute changes.
|
543
|
+
* @param {!Array<!MutationRecord>} records
|
544
|
+
* @param {!MutationObserver} self
|
545
|
+
*/
|
546
|
+
}, {
|
547
|
+
key: "_watchForInert",
|
548
|
+
value: function(e, i) {
|
549
|
+
var o = this;
|
550
|
+
e.forEach(function(d) {
|
551
|
+
switch (d.type) {
|
552
|
+
case "childList":
|
553
|
+
v.call(d.addedNodes).forEach(function(r) {
|
554
|
+
if (r.nodeType === Node.ELEMENT_NODE) {
|
555
|
+
var s = v.call(r.querySelectorAll("[inert]"));
|
556
|
+
l.call(r, "[inert]") && s.unshift(r), s.forEach(function(a) {
|
557
|
+
this.setInert(a, !0);
|
558
|
+
}, o);
|
559
|
+
}
|
560
|
+
}, o);
|
561
|
+
break;
|
562
|
+
case "attributes":
|
563
|
+
if (d.attributeName !== "inert")
|
564
|
+
return;
|
565
|
+
var m = (
|
566
|
+
/** @type {!HTMLElement} */
|
567
|
+
d.target
|
568
|
+
), t = m.hasAttribute("inert");
|
569
|
+
o.setInert(m, t);
|
570
|
+
break;
|
571
|
+
}
|
572
|
+
}, this);
|
573
|
+
}
|
574
|
+
}]), u;
|
575
|
+
}();
|
576
|
+
function N(u, n, e) {
|
577
|
+
if (u.nodeType == Node.ELEMENT_NODE) {
|
578
|
+
var i = (
|
579
|
+
/** @type {!HTMLElement} */
|
580
|
+
u
|
581
|
+
);
|
582
|
+
n && n(i);
|
583
|
+
var o = (
|
584
|
+
/** @type {!HTMLElement} */
|
585
|
+
i.shadowRoot
|
586
|
+
);
|
587
|
+
if (o) {
|
588
|
+
N(o, n);
|
589
|
+
return;
|
590
|
+
}
|
591
|
+
if (i.localName == "content") {
|
592
|
+
for (var d = (
|
593
|
+
/** @type {!HTMLContentElement} */
|
594
|
+
i
|
595
|
+
), m = d.getDistributedNodes ? d.getDistributedNodes() : [], t = 0; t < m.length; t++)
|
596
|
+
N(m[t], n);
|
597
|
+
return;
|
598
|
+
}
|
599
|
+
if (i.localName == "slot") {
|
600
|
+
for (var r = (
|
601
|
+
/** @type {!HTMLSlotElement} */
|
602
|
+
i
|
603
|
+
), s = r.assignedNodes ? r.assignedNodes({ flatten: !0 }) : [], a = 0; a < s.length; a++)
|
604
|
+
N(s[a], n);
|
605
|
+
return;
|
606
|
+
}
|
607
|
+
}
|
608
|
+
for (var h = u.firstChild; h != null; )
|
609
|
+
N(h, n), h = h.nextSibling;
|
610
|
+
}
|
611
|
+
function k(u) {
|
612
|
+
if (!u.querySelector("style#inert-style, link#inert-style")) {
|
613
|
+
var n = document.createElement("style");
|
614
|
+
n.setAttribute("id", "inert-style"), n.textContent = `
|
615
|
+
[inert] {
|
616
|
+
pointer-events: none;
|
617
|
+
cursor: default;
|
618
|
+
}
|
619
|
+
|
620
|
+
[inert], [inert] * {
|
621
|
+
-webkit-user-select: none;
|
622
|
+
-moz-user-select: none;
|
623
|
+
-ms-user-select: none;
|
624
|
+
user-select: none;
|
625
|
+
}
|
626
|
+
`, u.appendChild(n);
|
627
|
+
}
|
628
|
+
}
|
629
|
+
if (!HTMLElement.prototype.hasOwnProperty("inert")) {
|
630
|
+
var T = new p(document);
|
631
|
+
Object.defineProperty(HTMLElement.prototype, "inert", {
|
632
|
+
enumerable: !0,
|
633
|
+
/** @this {!HTMLElement} */
|
634
|
+
get: function() {
|
635
|
+
return this.hasAttribute("inert");
|
636
|
+
},
|
637
|
+
/** @this {!HTMLElement} */
|
638
|
+
set: function(n) {
|
639
|
+
T.setInert(this, n);
|
640
|
+
}
|
641
|
+
});
|
642
|
+
}
|
643
|
+
}(), A;
|
644
|
+
}
|
645
|
+
D();
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2016 Google Inc. All rights reserved.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/(()=>{var S,w,v;const l=Symbol(),y=Symbol(),b=Symbol(),c=Symbol(),p=Symbol(),N=Symbol(),k=Symbol(),T=Symbol(),u=Symbol(),n=Symbol(),e=Symbol(),i=Symbol(),o=Symbol();class d{constructor(){this[S]=[],this[w]=[],this[v]=new Set}destructor(){this[u](this[b]);const t=this;t[l]=null,t[b]=null,t[y]=null}get top(){const t=this[l];return t[t.length-1]||null}push(t){!t||t===this.top||(this.remove(t),this[N](t),this[l].push(t))}remove(t){const r=this[l].indexOf(t);return r===-1?!1:(this[l].splice(r,1),r===this[l].length&&this[N](this.top),!0)}pop(){const t=this.top;return t&&this.remove(t),t}has(t){return this[l].indexOf(t)!==-1}[(S=l,w=b,v=y,N)](t){const r=this[y],s=this[b];if(!t){this[u](s),r.clear(),this[b]=[];return}const a=this[n](t);if(a[a.length-1].parentNode!==document.body)throw Error("Non-connected element cannot be a blocking element");this[b]=a;const h=this[e](t);if(!s.length){this[T](a,h,r);return}let _=s.length-1,f=a.length-1;for(;_>0&&f>0&&s[_]===a[f];)_--,f--;s[_]!==a[f]&&this[k](s[_],a[f]),_>0&&this[u](s.slice(0,_)),f>0&&this[T](a.slice(0,f),h,null)}[k](t,r){const s=t[c];this[i](t)&&!t.inert&&(t.inert=!0,s.add(t)),s.has(r)&&(r.inert=!1,s.delete(r)),r[p]=t[p],r[c]=s,t[p]=void 0,t[c]=void 0}[u](t){for(const r of t){r[p].disconnect(),r[p]=void 0;const a=r[c];for(const h of a)h.inert=!1;r[c]=void 0}}[T](t,r,s){for(const a of t){const h=a.parentNode,_=h.children,f=new Set;for(let R=0;R<_.length;R++){const I=_[R];I===a||!this[i](I)||r&&r.has(I)||(s&&I.inert?s.add(I):(I.inert=!0,f.add(I)))}a[c]=f;const M=new MutationObserver(this[o].bind(this));a[p]=M;let E=h;const g=E;g.__shady&&g.host&&(E=g.host),M.observe(E,{childList:!0})}}[o](t){const r=this[b],s=this[y];for(const a of t){const h=a.target.host||a.target,_=h===document.body?r.length:r.indexOf(h),f=r[_-1],M=f[c];for(let E=0;E<a.removedNodes.length;E++){const g=a.removedNodes[E];if(g===f){console.info("Detected removal of the top Blocking Element."),this.pop();return}M.has(g)&&(g.inert=!1,M.delete(g))}for(let E=0;E<a.addedNodes.length;E++){const g=a.addedNodes[E];this[i](g)&&(s&&g.inert?s.add(g):(g.inert=!0,M.add(g)))}}}[i](t){return/^(style|template|script)$/.test(t.localName)===!1}[n](t){const r=[];let s=t;for(;s&&s!==document.body;){if(s.nodeType===Node.ELEMENT_NODE&&r.push(s),s.assignedSlot){for(;s=s.assignedSlot;)r.push(s);s=r.pop();continue}s=s.parentNode||s.host}return r}[e](t){const r=t.shadowRoot;if(!r)return null;const s=new Set;let a,h,_;const f=r.querySelectorAll("slot");if(f.length&&f[0].assignedNodes)for(a=0;a<f.length;a++)for(_=f[a].assignedNodes({flatten:!0}),h=0;h<_.length;h++)_[h].nodeType===Node.ELEMENT_NODE&&s.add(_[h]);return s}}document.$blockingElements=new d})();var A={},x;function D(){if(x)return A;x=1;var S=function(){function v(l,y){for(var b=0;b<y.length;b++){var c=y[b];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,y,b){return y&&v(l.prototype,y),b&&v(l,b),l}}();function w(v,l){if(!(v instanceof l))throw new TypeError("Cannot call a class as a function")}return function(){if(typeof window>"u"||typeof Element>"u")return;var v=Array.prototype.slice,l=Element.prototype.matches||Element.prototype.msMatchesSelector,y=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","video","[contenteditable]"].join(","),b=function(){function u(n,e){w(this,u),this._inertManager=e,this._rootElement=n,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}return S(u,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(this._savedAriaHidden!==null?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(e){this._unmanageNode(e.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(e){var i=this;N(e,function(t){return i._visitNode(t)});var o=document.activeElement;if(!document.body.contains(e)){for(var d=e,m=void 0;d;){if(d.nodeType===Node.DOCUMENT_FRAGMENT_NODE){m=d;break}d=d.parentNode}m&&(o=m.activeElement)}e.contains(o)&&(o.blur(),o===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(e){if(e.nodeType===Node.ELEMENT_NODE){var i=e;i!==this._rootElement&&i.hasAttribute("inert")&&this._adoptInertRoot(i),(l.call(i,y)||i.hasAttribute("tabindex"))&&this._manageNode(i)}}},{key:"_manageNode",value:function(e){var i=this._inertManager.register(e,this);this._managedNodes.add(i)}},{key:"_unmanageNode",value:function(e){var i=this._inertManager.deregister(e,this);i&&this._managedNodes.delete(i)}},{key:"_unmanageSubtree",value:function(e){var i=this;N(e,function(o){return i._unmanageNode(o)})}},{key:"_adoptInertRoot",value:function(e){var i=this._inertManager.getInertRoot(e);i||(this._inertManager.setInert(e,!0),i=this._inertManager.getInertRoot(e)),i.managedNodes.forEach(function(o){this._manageNode(o.node)},this)}},{key:"_onMutation",value:function(e,i){e.forEach(function(o){var d=o.target;if(o.type==="childList")v.call(o.addedNodes).forEach(function(t){this._makeSubtreeUnfocusable(t)},this),v.call(o.removedNodes).forEach(function(t){this._unmanageSubtree(t)},this);else if(o.type==="attributes"){if(o.attributeName==="tabindex")this._manageNode(d);else if(d!==this._rootElement&&o.attributeName==="inert"&&d.hasAttribute("inert")){this._adoptInertRoot(d);var m=this._inertManager.getInertRoot(d);this._managedNodes.forEach(function(t){d.contains(t.node)&&m._manageNode(t.node)})}}},this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return this._savedAriaHidden!==null}},{key:"savedAriaHidden",set:function(e){this._savedAriaHidden=e},get:function(){return this._savedAriaHidden}}]),u}(),c=function(){function u(n,e){w(this,u),this._node=n,this._overrodeFocusMethod=!1,this._inertRoots=new Set([e]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}return S(u,[{key:"destructor",value:function(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){var e=this._node;this._savedTabIndex!==null?e.setAttribute("tabindex",this._savedTabIndex):e.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete e.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){if(this.node.nodeType===Node.ELEMENT_NODE){var e=this.node;if(l.call(e,y)){if(e.tabIndex===-1&&this.hasSavedTabIndex)return;e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex),e.setAttribute("tabindex","-1"),e.nodeType===Node.ELEMENT_NODE&&(e.focus=function(){},this._overrodeFocusMethod=!0)}else e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex,e.removeAttribute("tabindex"))}}},{key:"addInertRoot",value:function(e){this._throwIfDestroyed(),this._inertRoots.add(e)}},{key:"removeInertRoot",value:function(e){this._throwIfDestroyed(),this._inertRoots.delete(e),this._inertRoots.size===0&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return this._savedTabIndex!==null}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(e){this._throwIfDestroyed(),this._savedTabIndex=e},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),u}(),p=function(){function u(n){if(w(this,u),!n)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=n,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),k(n.head||n.body||n.documentElement),n.readyState==="loading"?n.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}return S(u,[{key:"setInert",value:function(e,i){if(i){if(this._inertRoots.has(e))return;var o=new b(e,this);if(e.setAttribute("inert",""),this._inertRoots.set(e,o),!this._document.body.contains(e))for(var d=e.parentNode;d;)d.nodeType===11&&k(d),d=d.parentNode}else{if(!this._inertRoots.has(e))return;var m=this._inertRoots.get(e);m.destructor(),this._inertRoots.delete(e),e.removeAttribute("inert")}}},{key:"getInertRoot",value:function(e){return this._inertRoots.get(e)}},{key:"register",value:function(e,i){var o=this._managedNodes.get(e);return o!==void 0?o.addInertRoot(i):o=new c(e,i),this._managedNodes.set(e,o),o}},{key:"deregister",value:function(e,i){var o=this._managedNodes.get(e);return o?(o.removeInertRoot(i),o.destroyed&&this._managedNodes.delete(e),o):null}},{key:"_onDocumentLoaded",value:function(){var e=v.call(this._document.querySelectorAll("[inert]"));e.forEach(function(i){this.setInert(i,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(e,i){var o=this;e.forEach(function(d){switch(d.type){case"childList":v.call(d.addedNodes).forEach(function(r){if(r.nodeType===Node.ELEMENT_NODE){var s=v.call(r.querySelectorAll("[inert]"));l.call(r,"[inert]")&&s.unshift(r),s.forEach(function(a){this.setInert(a,!0)},o)}},o);break;case"attributes":if(d.attributeName!=="inert")return;var m=d.target,t=m.hasAttribute("inert");o.setInert(m,t);break}},this)}}]),u}();function N(u,n,e){if(u.nodeType==Node.ELEMENT_NODE){var i=u;n&&n(i);var o=i.shadowRoot;if(o){N(o,n);return}if(i.localName=="content"){for(var d=i,m=d.getDistributedNodes?d.getDistributedNodes():[],t=0;t<m.length;t++)N(m[t],n);return}if(i.localName=="slot"){for(var r=i,s=r.assignedNodes?r.assignedNodes({flatten:!0}):[],a=0;a<s.length;a++)N(s[a],n);return}}for(var h=u.firstChild;h!=null;)N(h,n),h=h.nextSibling}function k(u){if(!u.querySelector("style#inert-style, link#inert-style")){var n=document.createElement("style");n.setAttribute("id","inert-style"),n.textContent=`
|
17
|
+
[inert] {
|
18
|
+
pointer-events: none;
|
19
|
+
cursor: default;
|
20
|
+
}
|
21
|
+
|
22
|
+
[inert], [inert] * {
|
23
|
+
-webkit-user-select: none;
|
24
|
+
-moz-user-select: none;
|
25
|
+
-ms-user-select: none;
|
26
|
+
user-select: none;
|
27
|
+
}
|
28
|
+
`,u.appendChild(n)}}if(!HTMLElement.prototype.hasOwnProperty("inert")){var T=new p(document);Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(n){T.setInert(this,n)}})}}(),A}D();
|