@covalent/components 9.1.0 → 9.1.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-DjF3Plf2.mjs → _commonjsHelpers-HP5nalso.mjs} +2 -2
- package/action-ribbon.js +2 -2
- package/action-ribbon.mjs +24 -24
- package/alert.js +3 -3
- package/alert.mjs +4 -4
- package/app-shell.js +1 -1
- package/app-shell.mjs +6 -6
- package/async-directive-2AOdKBUW.mjs +66 -0
- package/async-directive-DZ3MjSIj.js +5 -0
- package/badge.js +1 -1
- package/badge.mjs +6 -6
- package/{base-element-aUDWLn36.js → base-element-5ZU-p99q.js} +1 -1
- package/{base-element-C-U4OfWx.mjs → base-element-CzNmpVoz.mjs} +1 -1
- package/button.js +1 -1
- package/button.mjs +24 -24
- package/card.js +1 -1
- package/card.mjs +12 -12
- package/check-list-item.js +7 -7
- package/check-list-item.mjs +31 -31
- package/checkbox.js +1 -1
- package/checkbox.mjs +9 -9
- package/{chip-C8L37ovG.mjs → chip-5QP7xPTY.mjs} +6 -6
- package/{chip-BsDYOEFW.js → chip-CitHXhY7.js} +1 -1
- package/chip-set.js +1 -1
- package/chip-set.mjs +114 -114
- package/chip.js +1 -1
- package/chip.mjs +2 -2
- package/circular-progress.js +4 -4
- package/circular-progress.mjs +10 -10
- package/class-map-BHl5MHd7.mjs +36 -0
- package/class-map-PsUYVqvf.js +5 -0
- package/{code-editor-CSH3MdBF.js → code-editor-CCUZsYkN.js} +135 -137
- package/{code-editor-Bshyfjyn.mjs → code-editor-JaW-06cH.mjs} +8151 -8113
- package/code-editor.js +1 -1
- package/code-editor.mjs +2 -2
- package/code-snippet.js +1 -1
- package/code-snippet.mjs +7 -7
- package/{dialog-BoNH4r3n.mjs → dialog-BVmWYLqR.mjs} +194 -194
- package/{dialog-LUOzoMeO.js → dialog-DzaPP3Vt.js} +9 -9
- package/dialog.js +1 -1
- package/dialog.mjs +2 -2
- package/{directive-oAbCiebi.mjs → directive-B76A7YXI.mjs} +4 -4
- package/directive-C_VV3qwo.js +5 -0
- package/directive-helpers-6HCt_-zj.mjs +11 -0
- package/directive-helpers-BnUMbYHh.js +5 -0
- package/drawer.js +1 -1
- package/drawer.mjs +2 -2
- package/empty-state.js +1 -1
- package/empty-state.mjs +7 -7
- package/{event-options-CNykeE2u.mjs → event-options-D44mpm5S.mjs} +1 -1
- package/{event-options-BH8ks-kz.js → event-options-IG-2g8HU.js} +1 -1
- package/expansion-panel-item.js +1 -1
- package/expansion-panel-item.mjs +4 -4
- package/expansion-panel.js +1 -1
- package/expansion-panel.mjs +1 -1
- package/focused-page.js +1 -1
- package/focused-page.mjs +8 -8
- package/form-element--PS8uSRI.js +5 -0
- package/form-element-Dn0Lerng.mjs +50 -0
- package/formfield.js +4 -4
- package/formfield.mjs +13 -13
- package/{foundation-qQ4jzaAu.mjs → foundation-BYhAXCW_.mjs} +17 -15
- package/{foundation-PL3XY-m_.mjs → foundation-D6JHa7Lg.mjs} +4 -4
- package/{foundation-pgmPu2iJ.js → foundation-aT_gy6X8.js} +1 -1
- package/{foundation-CySCCTUE.js → foundation-sIsx2I_x.js} +2 -2
- package/full-screen-dialog.js +2 -2
- package/full-screen-dialog.mjs +12 -12
- package/{html-DrhRpsz9.mjs → html-DhKW0KfF.mjs} +1 -1
- package/{html-DUGRoHaj.js → html-S7zzCKH0.js} +1 -1
- package/icon/_icon-list.d.ts +4 -0
- package/icon/_icon-list.d.ts.map +1 -0
- package/icon/icon-demo.d.ts +14 -0
- package/icon/icon-demo.d.ts.map +1 -0
- package/icon-button-toggle.js +5 -5
- package/icon-button-toggle.mjs +35 -35
- package/icon-button.js +2 -2
- package/icon-button.mjs +28 -28
- package/icon-check-toggle.js +1 -1
- package/icon-check-toggle.mjs +6 -6
- package/icon-lockup.js +5 -5
- package/icon-lockup.mjs +6 -6
- package/icon-radio-toggle.js +4 -4
- package/icon-radio-toggle.mjs +8 -8
- package/icon.js +1 -1
- package/icon.mjs +14 -14
- package/{if-defined-D8C6ewRn.js → if-defined-B7G84qob.js} +1 -1
- package/{if-defined-BsNkRMMG.mjs → if-defined-DN7whKwy.mjs} +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +10 -1
- package/index.mjs +450 -112
- package/{javascript-DKtDcqDi.mjs → javascript-BtkevR81.mjs} +1 -1
- package/{javascript-54eqLOAw.js → javascript-fH54qAGk.js} +1 -1
- package/linear-progress.js +7 -7
- package/linear-progress.mjs +17 -17
- package/{list-item-BZVW1fmJ.js → list-item-BQ6SDTvW.js} +1 -1
- package/{list-item-DCzzLVZh.mjs → list-item-DuBDCnZ-.mjs} +1 -1
- package/list-item.js +2 -2
- package/list-item.mjs +16 -16
- package/list.js +1 -1
- package/list.mjs +16 -16
- package/menu.js +2 -2
- package/menu.mjs +11 -11
- package/{mwc-checkbox.css-Cd0yCOHu.js → mwc-checkbox.css-BV3dyB4C.js} +1 -1
- package/{mwc-checkbox.css-MBOzkrQg.mjs → mwc-checkbox.css-CNoj0V14.mjs} +31 -31
- package/{mwc-drawer-base-Dgs9327G.mjs → mwc-drawer-base-A-4s_ZnE.mjs} +10 -10
- package/{mwc-drawer-base-D-48lqfn.js → mwc-drawer-base-DWczEPvb.js} +3 -3
- package/{mwc-icon-BZRds8SY.mjs → mwc-icon-DTCUplqR.mjs} +2 -2
- package/{mwc-icon-BumH81hp.js → mwc-icon-Xgr698ax.js} +1 -1
- package/{mwc-icon-button.css-DJMY7U7e.mjs → mwc-icon-button.css-DJiDOS0_.mjs} +1 -1
- package/{mwc-icon-button.css-BtgKBOl3.js → mwc-icon-button.css-DOVWWyjA.js} +1 -1
- package/{mwc-line-ripple-directive-zhm5Zc8i.mjs → mwc-line-ripple-directive-TO37-41n.mjs} +34 -34
- package/{mwc-line-ripple-directive-DvPWr3ER.js → mwc-line-ripple-directive-r80jluoU.js} +4 -4
- package/{mwc-list-item.css-CtRq5wSu.js → mwc-list-item.css-CO1JlA8e.js} +10 -10
- package/{mwc-list-item.css-g34xqhLC.mjs → mwc-list-item.css-Cg9onxQ-.mjs} +11 -11
- package/{mwc-list.css-DFOdJyFB.mjs → mwc-list.css-C_-DVEme.mjs} +102 -102
- package/{mwc-list.css-CaMJWsDp.js → mwc-list.css-Deg9oBaO.js} +1 -1
- package/{mwc-menu.css-pxcxlTrh.js → mwc-menu.css-Dvr-f3_T.js} +18 -18
- package/{mwc-menu.css-BEiPghgR.mjs → mwc-menu.css-qpZxKN-g.mjs} +306 -306
- package/{mwc-radio.css-XRx0vL1k.mjs → mwc-radio.css-BiHC1R8I.mjs} +11 -11
- package/{mwc-radio.css-CVMtIq-L.js → mwc-radio.css-DjO4Rn44.js} +1 -1
- package/{mwc-slider.css-WrkrmqkL.js → mwc-slider.css-DFOaS04S.js} +13 -13
- package/{mwc-slider.css-2Bqk43z7.mjs → mwc-slider.css-Deh1__Ar.mjs} +290 -279
- package/{mwc-tab.css-B9yQpkYf.mjs → mwc-tab.css-2UrPKkNg.mjs} +34 -34
- package/{mwc-tab.css-CgdXMZBB.js → mwc-tab.css-sq5suZKe.js} +11 -11
- package/{mwc-top-app-bar-base-B0EW9eNk.mjs → mwc-top-app-bar-base-BIZGhVtM.mjs} +40 -40
- package/{mwc-top-app-bar-base-CSXRBOiX.js → mwc-top-app-bar-base-DUdOcIjS.js} +7 -7
- package/nav-list-item.js +3 -3
- package/nav-list-item.mjs +18 -18
- package/notebook-cell.js +1 -1
- package/notebook-cell.mjs +25 -25
- package/package.json +6 -1
- package/{property-DYTC_2-m.js → property-BRKnMYJe.js} +1 -1
- package/{python-CEXbOLXn.mjs → python-BkZeja0y.mjs} +1 -1
- package/{python-CzGtlN7c.js → python-C2_KOh3o.js} +1 -1
- package/query-BvlE-gMJ.js +5 -0
- package/query-DSO61t36.mjs +15 -0
- package/query-assigned-elements-BQszEgac.js +31 -0
- package/query-assigned-elements-DhyCP_2z.mjs +591 -0
- package/query-assigned-nodes-9DFnkxV8.js +5 -0
- package/query-assigned-nodes-B-jCihdA.mjs +17 -0
- package/radio-list-item.js +5 -5
- package/radio-list-item.mjs +24 -24
- package/radio.js +1 -1
- package/radio.mjs +9 -9
- package/{ripple-handlers-i3WPEBiO.mjs → ripple-handlers-BAdg-fJB.mjs} +72 -72
- package/{ripple-handlers-CzfSBjWo.js → ripple-handlers-BDmOLx8c.js} +5 -5
- package/select.js +12 -12
- package/select.mjs +119 -118
- package/side-sheet.js +1 -1
- package/side-sheet.mjs +8 -8
- package/slider-range.js +7 -7
- package/slider-range.mjs +39 -39
- package/slider.js +1 -1
- package/slider.mjs +18 -18
- package/snackbar.js +8 -8
- package/snackbar.mjs +21 -21
- package/{state-DaD9o2aK.mjs → state-B_tK3mBm.mjs} +2 -2
- package/{state-C3HoXfoa.js → state-Csv4sdJA.js} +1 -1
- package/status-dialog.js +1 -1
- package/status-dialog.mjs +7 -7
- package/status-header-item.js +1 -1
- package/status-header-item.mjs +18 -18
- package/status-header.js +1 -1
- package/status-header.mjs +2 -2
- package/style-map-3QfsA_1O.js +5 -0
- package/style-map-QxIETvrs.mjs +42 -0
- package/switch.js +6 -6
- package/switch.mjs +40 -40
- package/tab-bar.js +5 -5
- package/tab-bar.mjs +93 -93
- package/tab.js +1 -1
- package/tab.mjs +5 -5
- package/text-lockup.js +1 -1
- package/text-lockup.mjs +11 -11
- package/textarea.js +6 -6
- package/textarea.mjs +22 -22
- package/{textfield-BwmiygD8.js → textfield-CO6CFCCn.js} +30 -30
- package/{textfield-C6sUZIeA.mjs → textfield-WSgoABZn.mjs} +103 -103
- package/textfield.js +2 -2
- package/textfield.mjs +9 -9
- package/toolbar.js +1 -1
- package/toolbar.mjs +2 -2
- package/tooltip.js +3 -3
- package/tooltip.mjs +56 -55
- package/{top-app-bar-4SA3DjLX.mjs → top-app-bar-BvXNELe9.mjs} +1 -1
- package/{top-app-bar-CGjBuyiD.js → top-app-bar-Cvp1aN42.js} +1 -1
- package/top-app-bar-fixed.js +8 -8
- package/top-app-bar-fixed.mjs +35 -35
- package/top-app-bar.js +1 -1
- package/top-app-bar.mjs +12 -12
- package/tree-list-item.js +1 -1
- package/tree-list-item.mjs +5 -5
- package/tree-list.js +1 -1
- package/tree-list.mjs +5 -5
- package/tslib.es6-CISSdiiH.mjs +75 -0
- package/{typescript-DotYReBq.mjs → typescript-BUN0g4m9.mjs} +1 -1
- package/{typescript-D_zVB3gH.js → typescript-DzngJr4U.js} +1 -1
- package/typography.js +1 -1
- package/typography.mjs +10 -10
- package/async-directive-Cx1B9M5C.mjs +0 -66
- package/async-directive-y3fBDDSk.js +0 -5
- package/class-map-C1SJpero.mjs +0 -36
- package/class-map-C8G1ALWK.js +0 -5
- package/directive-C7oCP5Bh.js +0 -5
- package/directive-helpers-CllkNDrI.mjs +0 -11
- package/directive-helpers-Duf3sfLn.js +0 -5
- package/form-element-CxSqbssX.mjs +0 -50
- package/form-element-DwqUbs65.js +0 -5
- package/query-BBDQWsft.mjs +0 -15
- package/query-BxDs8ftQ.js +0 -5
- package/query-assigned-elements-4CafVNR8.js +0 -31
- package/query-assigned-elements-DCt2xozt.mjs +0 -591
- package/query-assigned-nodes-B9zBfkh6.mjs +0 -17
- package/query-assigned-nodes-CckKHm2z.js +0 -5
- package/style-map-BJBXlSqn.js +0 -5
- package/style-map-CCsABR5m.mjs +0 -42
- package/tslib.es6-pPsSiLLK.mjs +0 -75
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";const o=require("./tslib.es6-CHeFCc6E.js"),A=require("./query-assigned-elements-
|
1
|
+
"use strict";const o=require("./tslib.es6-CHeFCc6E.js"),A=require("./query-assigned-elements-BQszEgac.js"),U=require("./mwc-list.css-Deg9oBaO.js"),q=require("./base-element-5ZU-p99q.js"),E=require("./observer-N9cgkDqh.js"),D=require("./utils-wMBJ9n_n.js"),a=require("./property-BRKnMYJe.js"),R=require("./state-Csv4sdJA.js"),F=require("./query-BvlE-gMJ.js"),P=require("./class-map-PsUYVqvf.js"),j=require("./style-map-3QfsA_1O.js");/**
|
2
2
|
* @license
|
3
3
|
* Copyright 2020 Google LLC
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
@@ -23,7 +23,7 @@
|
|
23
23
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
24
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
25
|
* THE SOFTWARE.
|
26
|
-
*/var
|
26
|
+
*/var W={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},X={CLOSED_EVENT:"MDCMenuSurface:closed",CLOSING_EVENT:"MDCMenuSurface:closing",OPENED_EVENT:"MDCMenuSurface:opened",OPENING_EVENT:"MDCMenuSurface:opening",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")},x={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67,TOUCH_EVENT_WAIT_MS:30},u;(function(n){n[n.BOTTOM=1]="BOTTOM",n[n.CENTER=2]="CENTER",n[n.RIGHT=4]="RIGHT",n[n.FLIP_RTL=8]="FLIP_RTL"})(u||(u={}));var m;(function(n){n[n.TOP_LEFT=0]="TOP_LEFT",n[n.TOP_RIGHT=4]="TOP_RIGHT",n[n.BOTTOM_LEFT=1]="BOTTOM_LEFT",n[n.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",n[n.TOP_START=8]="TOP_START",n[n.TOP_END=12]="TOP_END",n[n.BOTTOM_START=9]="BOTTOM_START",n[n.BOTTOM_END=13]="BOTTOM_END"})(m||(m={}));/**
|
27
27
|
* @license
|
28
28
|
* Copyright 2016 Google Inc.
|
29
29
|
*
|
@@ -44,7 +44,7 @@
|
|
44
44
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
45
45
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
46
46
|
* THE SOFTWARE.
|
47
|
-
*/var
|
47
|
+
*/var V=function(){function n(t){t===void 0&&(t={}),this.adapter=t}return Object.defineProperty(n,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),n.prototype.init=function(){},n.prototype.destroy=function(){},n}();/**
|
48
48
|
* @license
|
49
49
|
* Copyright 2018 Google Inc.
|
50
50
|
*
|
@@ -65,19 +65,19 @@
|
|
65
65
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
66
66
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
67
67
|
* THE SOFTWARE.
|
68
|
-
*/var
|
68
|
+
*/var K=function(n){o.__extends(t,n);function t(e){var i=n.call(this,o.__assign(o.__assign({},t.defaultAdapter),e))||this;return i.isSurfaceOpen=!1,i.isQuickOpen=!1,i.isHoistedElement=!1,i.isFixedPosition=!1,i.isHorizontallyCenteredOnViewport=!1,i.maxHeight=0,i.openBottomBias=0,i.openAnimationEndTimerId=0,i.closeAnimationEndTimerId=0,i.animationRequestId=0,i.anchorCorner=m.TOP_START,i.originCorner=m.TOP_START,i.anchorMargin={top:0,right:0,bottom:0,left:0},i.position={x:0,y:0},i}return Object.defineProperty(t,"cssClasses",{get:function(){return W},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return X},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return x},enumerable:!1,configurable:!0}),Object.defineProperty(t,"Corner",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyClosing:function(){},notifyOpen:function(){},notifyOpening:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){var e=t.cssClasses,i=e.ROOT,s=e.OPEN;if(!this.adapter.hasClass(i))throw new Error(i+" class required in root element.");this.adapter.hasClass(s)&&(this.isSurfaceOpen=!0)},t.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},t.prototype.setAnchorCorner=function(e){this.anchorCorner=e},t.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^u.RIGHT},t.prototype.setAnchorMargin=function(e){this.anchorMargin.top=e.top||0,this.anchorMargin.right=e.right||0,this.anchorMargin.bottom=e.bottom||0,this.anchorMargin.left=e.left||0},t.prototype.setIsHoisted=function(e){this.isHoistedElement=e},t.prototype.setFixedPosition=function(e){this.isFixedPosition=e},t.prototype.isFixed=function(){return this.isFixedPosition},t.prototype.setAbsolutePosition=function(e,i){this.position.x=this.isFinite(e)?e:0,this.position.y=this.isFinite(i)?i:0},t.prototype.setIsHorizontallyCenteredOnViewport=function(e){this.isHorizontallyCenteredOnViewport=e},t.prototype.setQuickOpen=function(e){this.isQuickOpen=e},t.prototype.setMaxHeight=function(e){this.maxHeight=e},t.prototype.setOpenBottomBias=function(e){this.openBottomBias=e},t.prototype.isOpen=function(){return this.isSurfaceOpen},t.prototype.open=function(){var e=this;this.isSurfaceOpen||(this.adapter.notifyOpening(),this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(t.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(t.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){e.dimensions=e.adapter.getInnerDimensions(),e.autoposition(),e.adapter.addClass(t.cssClasses.OPEN),e.openAnimationEndTimerId=setTimeout(function(){e.openAnimationEndTimerId=0,e.adapter.removeClass(t.cssClasses.ANIMATING_OPEN),e.adapter.notifyOpen()},x.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},t.prototype.close=function(e){var i=this;if(e===void 0&&(e=!1),!!this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen){this.isSurfaceOpen=!1,e||this.maybeRestoreFocus(),this.adapter.removeClass(t.cssClasses.OPEN),this.adapter.removeClass(t.cssClasses.IS_OPEN_BELOW),this.adapter.notifyClose();return}this.adapter.addClass(t.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){i.adapter.removeClass(t.cssClasses.OPEN),i.adapter.removeClass(t.cssClasses.IS_OPEN_BELOW),i.closeAnimationEndTimerId=setTimeout(function(){i.closeAnimationEndTimerId=0,i.adapter.removeClass(t.cssClasses.ANIMATING_CLOSED),i.adapter.notifyClose()},x.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,e||this.maybeRestoreFocus()}},t.prototype.handleBodyClick=function(e){var i=e.target;this.adapter.isElementInContainer(i)||this.close()},t.prototype.handleKeydown=function(e){var i=e.keyCode,s=e.key,r=s==="Escape"||i===27;r&&this.close()},t.prototype.autoposition=function(){var e;this.measurements=this.getAutoLayoutmeasurements();var i=this.getoriginCorner(),s=this.getMenuSurfaceMaxHeight(i),r=this.hasBit(i,u.BOTTOM)?"bottom":"top",c=this.hasBit(i,u.RIGHT)?"right":"left",p=this.getHorizontalOriginOffset(i),M=this.getVerticalOriginOffset(i),I=this.measurements,S=I.anchorSize,g=I.surfaceSize,f=(e={},e[c]=p,e[r]=M,e);S.width/g.width>x.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(c="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(f),this.adapter.setTransformOrigin(c+" "+r),this.adapter.setPosition(f),this.adapter.setMaxHeight(s?s+"px":""),this.hasBit(i,u.BOTTOM)||this.adapter.addClass(t.cssClasses.IS_OPEN_BELOW)},t.prototype.getAutoLayoutmeasurements=function(){var e=this.adapter.getAnchorDimensions(),i=this.adapter.getBodyDimensions(),s=this.adapter.getWindowDimensions(),r=this.adapter.getWindowScroll();return e||(e={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:e,bodySize:i,surfaceSize:this.dimensions,viewportDistance:{top:e.top,right:s.width-e.right,bottom:s.height-e.bottom,left:e.left},viewportSize:s,windowScroll:r}},t.prototype.getoriginCorner=function(){var e=this.originCorner,i=this.measurements,s=i.viewportDistance,r=i.anchorSize,c=i.surfaceSize,p=t.numbers.MARGIN_TO_EDGE,M=this.hasBit(this.anchorCorner,u.BOTTOM),I,S;M?(I=s.top-p+this.anchorMargin.bottom,S=s.bottom-p-this.anchorMargin.bottom):(I=s.top-p+this.anchorMargin.top,S=s.bottom-p+r.height-this.anchorMargin.top);var g=S-c.height>0;!g&&I>S+this.openBottomBias&&(e=this.setBit(e,u.BOTTOM));var f=this.adapter.isRtl(),T=this.hasBit(this.anchorCorner,u.FLIP_RTL),_=this.hasBit(this.anchorCorner,u.RIGHT)||this.hasBit(e,u.RIGHT),C=!1;f&&T?C=!_:C=_;var w,B;C?(w=s.left+r.width+this.anchorMargin.right,B=s.right-this.anchorMargin.right):(w=s.left+this.anchorMargin.left,B=s.right+r.width-this.anchorMargin.left);var N=w-c.width>0,G=B-c.width>0,$=this.hasBit(e,u.FLIP_RTL)&&this.hasBit(e,u.RIGHT);return G&&$&&f||!N&&$?e=this.unsetBit(e,u.RIGHT):(N&&C&&f||N&&!C&&_||!G&&w>=B)&&(e=this.setBit(e,u.RIGHT)),e},t.prototype.getMenuSurfaceMaxHeight=function(e){if(this.maxHeight>0)return this.maxHeight;var i=this.measurements.viewportDistance,s=0,r=this.hasBit(e,u.BOTTOM),c=this.hasBit(this.anchorCorner,u.BOTTOM),p=t.numbers.MARGIN_TO_EDGE;return r?(s=i.top+this.anchorMargin.top-p,c||(s+=this.measurements.anchorSize.height)):(s=i.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-p,c&&(s-=this.measurements.anchorSize.height)),s},t.prototype.getHorizontalOriginOffset=function(e){var i=this.measurements.anchorSize,s=this.hasBit(e,u.RIGHT),r=this.hasBit(this.anchorCorner,u.RIGHT);if(s){var c=r?i.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?c-(this.measurements.viewportSize.width-this.measurements.bodySize.width):c}return r?i.width-this.anchorMargin.right:this.anchorMargin.left},t.prototype.getVerticalOriginOffset=function(e){var i=this.measurements.anchorSize,s=this.hasBit(e,u.BOTTOM),r=this.hasBit(this.anchorCorner,u.BOTTOM),c=0;return s?c=r?i.height-this.anchorMargin.top:-this.anchorMargin.bottom:c=r?i.height+this.anchorMargin.bottom:this.anchorMargin.top,c},t.prototype.adjustPositionForHoistedElement=function(e){var i,s,r=this.measurements,c=r.windowScroll,p=r.viewportDistance,M=r.surfaceSize,I=r.viewportSize,S=Object.keys(e);try{for(var g=o.__values(S),f=g.next();!f.done;f=g.next()){var T=f.value,_=e[T]||0;if(this.isHorizontallyCenteredOnViewport&&(T==="left"||T==="right")){e[T]=(I.width-M.width)/2;continue}_+=p[T],this.isFixedPosition||(T==="top"?_+=c.y:T==="bottom"?_-=c.y:T==="left"?_+=c.x:_-=c.x),e[T]=_}}catch(C){i={error:C}}finally{try{f&&!f.done&&(s=g.return)&&s.call(g)}finally{if(i)throw i.error}}},t.prototype.maybeRestoreFocus=function(){var e=this,i=this.adapter.isFocused(),s=this.adapter.getOwnerDocument?this.adapter.getOwnerDocument():document,r=s.activeElement&&this.adapter.isElementInContainer(s.activeElement);(i||r)&&setTimeout(function(){e.adapter.restoreFocus()},x.TOUCH_EVENT_WAIT_MS)},t.prototype.hasBit=function(e,i){return!!(e&i)},t.prototype.setBit=function(e,i){return e|i},t.prototype.unsetBit=function(e,i){return e^i},t.prototype.isFinite=function(e){return typeof e=="number"&&isFinite(e)},t}(V);/**
|
69
69
|
* @license
|
70
70
|
* Copyright 2020 Google LLC
|
71
71
|
* SPDX-License-Identifier: Apache-2.0
|
72
|
-
*/const Q={TOP_LEFT:m.TOP_LEFT,TOP_RIGHT:m.TOP_RIGHT,BOTTOM_LEFT:m.BOTTOM_LEFT,BOTTOM_RIGHT:m.BOTTOM_RIGHT,TOP_START:m.TOP_START,TOP_END:m.TOP_END,BOTTOM_START:m.BOTTOM_START,BOTTOM_END:m.BOTTOM_END};class h extends q.BaseElement{constructor(){super(...arguments),this.mdcFoundationClass=
|
72
|
+
*/const Q={TOP_LEFT:m.TOP_LEFT,TOP_RIGHT:m.TOP_RIGHT,BOTTOM_LEFT:m.BOTTOM_LEFT,BOTTOM_RIGHT:m.BOTTOM_RIGHT,TOP_START:m.TOP_START,TOP_END:m.TOP_END,BOTTOM_START:m.BOTTOM_START,BOTTOM_END:m.BOTTOM_END};class h extends q.BaseElement{constructor(){super(...arguments),this.mdcFoundationClass=K,this.absolute=!1,this.fullwidth=!1,this.fixed=!1,this.x=null,this.y=null,this.quick=!1,this.open=!1,this.stayOpenOnBodyClick=!1,this.bitwiseCorner=m.TOP_START,this.previousMenuCorner=null,this.menuCorner="START",this.corner="TOP_START",this.styleTop="",this.styleLeft="",this.styleRight="",this.styleBottom="",this.styleMaxHeight="",this.styleTransformOrigin="",this.anchor=null,this.previouslyFocused=null,this.previousAnchor=null,this.onBodyClickBound=()=>{}}render(){return this.renderSurface()}renderSurface(){const t=this.getRootClasses(),e=this.getRootStyles();return A.x`
|
73
73
|
<div
|
74
|
-
class=${
|
75
|
-
style="${
|
74
|
+
class=${P.o(t)}
|
75
|
+
style="${j.o(e)}"
|
76
76
|
@keydown=${this.onKeydown}
|
77
77
|
@opened=${this.registerBodyClick}
|
78
78
|
@closed=${this.deregisterBodyClick}>
|
79
79
|
${this.renderContent()}
|
80
|
-
</div>`}getRootClasses(){return{"mdc-menu-surface":!0,"mdc-menu-surface--fixed":this.fixed,"mdc-menu-surface--fullwidth":this.fullwidth}}getRootStyles(){return{top:this.styleTop,left:this.styleLeft,right:this.styleRight,bottom:this.styleBottom,"max-height":this.styleMaxHeight,"transform-origin":this.styleTransformOrigin}}renderContent(){return A.x`<slot></slot>`}createAdapter(){return Object.assign(Object.assign({},D.addHasRemoveClass(this.mdcRoot)),{hasAnchor:()=>!!this.anchor,notifyClose:()=>{const
|
80
|
+
</div>`}getRootClasses(){return{"mdc-menu-surface":!0,"mdc-menu-surface--fixed":this.fixed,"mdc-menu-surface--fullwidth":this.fullwidth}}getRootStyles(){return{top:this.styleTop,left:this.styleLeft,right:this.styleRight,bottom:this.styleBottom,"max-height":this.styleMaxHeight,"transform-origin":this.styleTransformOrigin}}renderContent(){return A.x`<slot></slot>`}createAdapter(){return Object.assign(Object.assign({},D.addHasRemoveClass(this.mdcRoot)),{hasAnchor:()=>!!this.anchor,notifyClose:()=>{const t={bubbles:!0,composed:!0},e=new CustomEvent("closed",t);this.open=!1,this.mdcRoot.dispatchEvent(e)},notifyClosing:()=>{const t={bubbles:!0,composed:!0},e=new CustomEvent("closing",t);this.mdcRoot.dispatchEvent(e)},notifyOpen:()=>{const t={bubbles:!0,composed:!0},e=new CustomEvent("opened",t);this.open=!0,this.mdcRoot.dispatchEvent(e)},notifyOpening:()=>{const t={bubbles:!0,composed:!0},e=new CustomEvent("opening",t);this.mdcRoot.dispatchEvent(e)},isElementInContainer:()=>!1,isRtl:()=>this.mdcRoot?getComputedStyle(this.mdcRoot).direction==="rtl":!1,setTransformOrigin:t=>{this.mdcRoot&&(this.styleTransformOrigin=t)},isFocused:()=>D.doesElementContainFocus(this),saveFocus:()=>{const t=D.deepActiveElementPath(),e=t.length;e||(this.previouslyFocused=null),this.previouslyFocused=t[e-1]},restoreFocus:()=>{this.previouslyFocused&&"focus"in this.previouslyFocused&&this.previouslyFocused.focus()},getInnerDimensions:()=>{const t=this.mdcRoot;return t?{width:t.offsetWidth,height:t.offsetHeight}:{width:0,height:0}},getAnchorDimensions:()=>{const t=this.anchor;return t?t.getBoundingClientRect():null},getBodyDimensions:()=>({width:document.body.clientWidth,height:document.body.clientHeight}),getWindowDimensions:()=>({width:window.innerWidth,height:window.innerHeight}),getWindowScroll:()=>({x:window.pageXOffset,y:window.pageYOffset}),setPosition:t=>{this.mdcRoot&&(this.styleLeft="left"in t?`${t.left}px`:"",this.styleRight="right"in t?`${t.right}px`:"",this.styleTop="top"in t?`${t.top}px`:"",this.styleBottom="bottom"in t?`${t.bottom}px`:"")},setMaxHeight:async t=>{this.mdcRoot&&(this.styleMaxHeight=t,await this.updateComplete,this.styleMaxHeight=`var(--mdc-menu-max-height, ${t})`)}})}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onBodyClick(t){if(this.stayOpenOnBodyClick)return;t.composedPath().indexOf(this)===-1&&this.close()}registerBodyClick(){this.onBodyClickBound=this.onBodyClick.bind(this),document.body.addEventListener("click",this.onBodyClickBound,{passive:!0,capture:!0})}deregisterBodyClick(){document.body.removeEventListener("click",this.onBodyClickBound,{capture:!0})}onOpenChanged(t,e){this.mdcFoundation&&(t?this.mdcFoundation.open():e!==void 0&&this.mdcFoundation.close())}close(){this.open=!1}show(){this.open=!0}}o.__decorate([F.i(".mdc-menu-surface")],h.prototype,"mdcRoot",void 0);o.__decorate([F.i("slot")],h.prototype,"slotElement",void 0);o.__decorate([a.n({type:Boolean}),E.observer(function(n){this.mdcFoundation&&!this.fixed&&this.mdcFoundation.setIsHoisted(n)})],h.prototype,"absolute",void 0);o.__decorate([a.n({type:Boolean})],h.prototype,"fullwidth",void 0);o.__decorate([a.n({type:Boolean}),E.observer(function(n){this.mdcFoundation&&!this.absolute&&this.mdcFoundation.setFixedPosition(n)})],h.prototype,"fixed",void 0);o.__decorate([a.n({type:Number}),E.observer(function(n){this.mdcFoundation&&this.y!==null&&n!==null&&(this.mdcFoundation.setAbsolutePosition(n,this.y),this.mdcFoundation.setAnchorMargin({left:n,top:this.y,right:-n,bottom:this.y}))})],h.prototype,"x",void 0);o.__decorate([a.n({type:Number}),E.observer(function(n){this.mdcFoundation&&this.x!==null&&n!==null&&(this.mdcFoundation.setAbsolutePosition(this.x,n),this.mdcFoundation.setAnchorMargin({left:this.x,top:n,right:-this.x,bottom:n}))})],h.prototype,"y",void 0);o.__decorate([a.n({type:Boolean}),E.observer(function(n){this.mdcFoundation&&this.mdcFoundation.setQuickOpen(n)})],h.prototype,"quick",void 0);o.__decorate([a.n({type:Boolean,reflect:!0}),E.observer(function(n,t){this.onOpenChanged(n,t)})],h.prototype,"open",void 0);o.__decorate([a.n({type:Boolean})],h.prototype,"stayOpenOnBodyClick",void 0);o.__decorate([R.t(),E.observer(function(n){this.mdcFoundation&&(n?this.mdcFoundation.setAnchorCorner(n):this.mdcFoundation.setAnchorCorner(n))})],h.prototype,"bitwiseCorner",void 0);o.__decorate([a.n({type:String}),E.observer(function(n){if(this.mdcFoundation){const t=n==="START"||n==="END",e=this.previousMenuCorner===null,i=!e&&n!==this.previousMenuCorner;t&&(i||e&&n==="END")&&(this.bitwiseCorner=this.bitwiseCorner^u.RIGHT,this.mdcFoundation.flipCornerHorizontally(),this.previousMenuCorner=n)}})],h.prototype,"menuCorner",void 0);o.__decorate([a.n({type:String}),E.observer(function(n){if(this.mdcFoundation&&n){let t=Q[n];this.menuCorner==="END"&&(t=t^u.RIGHT),this.bitwiseCorner=t}})],h.prototype,"corner",void 0);o.__decorate([R.t()],h.prototype,"styleTop",void 0);o.__decorate([R.t()],h.prototype,"styleLeft",void 0);o.__decorate([R.t()],h.prototype,"styleRight",void 0);o.__decorate([R.t()],h.prototype,"styleBottom",void 0);o.__decorate([R.t()],h.prototype,"styleMaxHeight",void 0);o.__decorate([R.t()],h.prototype,"styleTransformOrigin",void 0);/**
|
81
81
|
* @license
|
82
82
|
* Copyright 2021 Google LLC
|
83
83
|
* SPDX-LIcense-Identifier: Apache-2.0
|
@@ -106,7 +106,7 @@
|
|
106
106
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
107
107
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
108
108
|
* THE SOFTWARE.
|
109
|
-
*/var
|
109
|
+
*/var H={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},v={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",SELECTED_EVENT:"MDCMenu:selected",SKIP_RESTORE_FOCUS:"data-menu-item-skip-restore-focus"},Z={FOCUS_ROOT_INDEX:-1},b;(function(n){n[n.NONE=0]="NONE",n[n.LIST_ROOT=1]="LIST_ROOT",n[n.FIRST_ITEM=2]="FIRST_ITEM",n[n.LAST_ITEM=3]="LAST_ITEM"})(b||(b={}));/**
|
110
110
|
* @license
|
111
111
|
* Copyright 2018 Google Inc.
|
112
112
|
*
|
@@ -127,7 +127,7 @@
|
|
127
127
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
128
128
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
129
129
|
* THE SOFTWARE.
|
130
|
-
*/var O,y,d={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"};O={},O[""+d.LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",O[""+d.LIST_ITEM_CLASS]="mdc-list-item",O[""+d.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",O[""+d.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",O[""+d.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",O[""+d.ROOT]="mdc-list";var
|
130
|
+
*/var O,y,d={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"};O={},O[""+d.LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",O[""+d.LIST_ITEM_CLASS]="mdc-list-item",O[""+d.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",O[""+d.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",O[""+d.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",O[""+d.ROOT]="mdc-list";var L=(y={},y[""+d.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",y[""+d.LIST_ITEM_CLASS]="mdc-deprecated-list-item",y[""+d.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",y[""+d.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",y[""+d.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",y[""+d.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",y[""+d.ROOT]="mdc-deprecated-list",y);""+d.LIST_ITEM_CLASS+d.LIST_ITEM_CLASS+L[d.LIST_ITEM_CLASS]+L[d.LIST_ITEM_CLASS],""+d.LIST_ITEM_CLASS+d.LIST_ITEM_CLASS+d.LIST_ITEM_CLASS+d.LIST_ITEM_CLASS+L[d.LIST_ITEM_CLASS]+L[d.LIST_ITEM_CLASS]+L[d.LIST_ITEM_CLASS]+L[d.LIST_ITEM_CLASS];/**
|
131
131
|
* @license
|
132
132
|
* Copyright 2018 Google Inc.
|
133
133
|
*
|
@@ -148,11 +148,11 @@
|
|
148
148
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
149
149
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
150
150
|
* THE SOFTWARE.
|
151
|
-
*/var
|
151
|
+
*/var J=function(n){o.__extends(t,n);function t(e){var i=n.call(this,o.__assign(o.__assign({},t.defaultAdapter),e))||this;return i.closeAnimationEndTimerId=0,i.defaultFocusState=b.LIST_ROOT,i.selectedIndex=-1,i}return Object.defineProperty(t,"cssClasses",{get:function(){return H},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return v},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return Z},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},getAttributeFromElementAtIndex:function(){return null},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},t.prototype.handleKeydown=function(e){var i=e.key,s=e.keyCode,r=i==="Tab"||s===9;r&&this.adapter.closeSurface(!0)},t.prototype.handleItemAction=function(e){var i=this,s=this.adapter.getElementIndex(e);if(!(s<0)){this.adapter.notifySelected({index:s});var r=this.adapter.getAttributeFromElementAtIndex(s,v.SKIP_RESTORE_FOCUS)==="true";this.adapter.closeSurface(r),this.closeAnimationEndTimerId=setTimeout(function(){var c=i.adapter.getElementIndex(e);c>=0&&i.adapter.isSelectableItemAtIndex(c)&&i.setSelectedIndex(c)},K.numbers.TRANSITION_CLOSE_DURATION)}},t.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case b.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case b.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case b.NONE:break;default:this.adapter.focusListRoot();break}},t.prototype.setDefaultFocusState=function(e){this.defaultFocusState=e},t.prototype.getSelectedIndex=function(){return this.selectedIndex},t.prototype.setSelectedIndex=function(e){if(this.validatedIndex(e),!this.adapter.isSelectableItemAtIndex(e))throw new Error("MDCMenuFoundation: No selection group at specified index.");var i=this.adapter.getSelectedSiblingOfItemAtIndex(e);i>=0&&(this.adapter.removeAttributeFromElementAtIndex(i,v.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(i,H.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(e,H.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(e,v.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=e},t.prototype.setEnabled=function(e,i){this.validatedIndex(e),i?(this.adapter.removeClassFromElementAtIndex(e,d.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,v.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(e,d.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(e,v.ARIA_DISABLED_ATTR,"true"))},t.prototype.validatedIndex=function(e){var i=this.adapter.getMenuItemCount(),s=e>=0&&e<i;if(!s)throw new Error("MDCMenuFoundation: No list item at specified index.")},t}(V);/**
|
152
152
|
* @license
|
153
153
|
* Copyright 2020 Google LLC
|
154
154
|
* SPDX-License-Identifier: Apache-2.0
|
155
|
-
*/class
|
155
|
+
*/class l extends q.BaseElement{constructor(){super(...arguments),this.mdcFoundationClass=J,this.listElement_=null,this.anchor=null,this.open=!1,this.quick=!1,this.wrapFocus=!1,this.innerRole="menu",this.innerAriaLabel=null,this.corner="TOP_START",this.x=null,this.y=null,this.absolute=!1,this.multi=!1,this.activatable=!1,this.fixed=!1,this.forceGroupSelection=!1,this.fullwidth=!1,this.menuCorner="START",this.stayOpenOnBodyClick=!1,this.defaultFocus="LIST_ROOT",this._listUpdateComplete=null}get listElement(){return this.listElement_?this.listElement_:(this.listElement_=this.renderRoot.querySelector("mwc-list"),this.listElement_)}get items(){const t=this.listElement;return t?t.items:[]}get index(){const t=this.listElement;return t?t.index:-1}get selected(){const t=this.listElement;return t?t.selected:null}render(){return this.renderSurface()}renderSurface(){const t=this.getSurfaceClasses();return A.x`
|
156
156
|
<mwc-menu-surface
|
157
157
|
?hidden=${!this.open}
|
158
158
|
.anchor=${this.anchor}
|
@@ -166,25 +166,25 @@
|
|
166
166
|
.fullwidth=${this.fullwidth}
|
167
167
|
.menuCorner=${this.menuCorner}
|
168
168
|
?stayOpenOnBodyClick=${this.stayOpenOnBodyClick}
|
169
|
-
class=${
|
169
|
+
class=${P.o(t)}
|
170
170
|
@closed=${this.onClosed}
|
171
171
|
@opened=${this.onOpened}
|
172
172
|
@keydown=${this.onKeydown}>
|
173
173
|
${this.renderList()}
|
174
|
-
</mwc-menu-surface>`}getSurfaceClasses(){return{"mdc-menu":!0,"mdc-menu-surface":!0}}renderList(){const
|
174
|
+
</mwc-menu-surface>`}getSurfaceClasses(){return{"mdc-menu":!0,"mdc-menu-surface":!0}}renderList(){const t=this.innerRole==="menu"?"menuitem":"option",e=this.renderListClasses();return A.x`
|
175
175
|
<mwc-list
|
176
176
|
rootTabbable
|
177
177
|
.innerAriaLabel=${this.innerAriaLabel}
|
178
178
|
.innerRole=${this.innerRole}
|
179
179
|
.multi=${this.multi}
|
180
|
-
class=${
|
181
|
-
.itemRoles=${
|
180
|
+
class=${P.o(e)}
|
181
|
+
.itemRoles=${t}
|
182
182
|
.wrapFocus=${this.wrapFocus}
|
183
183
|
.activatable=${this.activatable}
|
184
184
|
@action=${this.onAction}>
|
185
185
|
<slot></slot>
|
186
|
-
</mwc-list>`}renderListClasses(){return{"mdc-deprecated-list":!0}}createAdapter(){return{addClassToElementAtIndex:(e
|
186
|
+
</mwc-list>`}renderListClasses(){return{"mdc-deprecated-list":!0}}createAdapter(){return{addClassToElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const s=i.items[t];s&&(e==="mdc-menu-item--selected"?this.forceGroupSelection&&!s.selected&&i.toggle(t,!0):s.classList.add(e))},removeClassFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const s=i.items[t];s&&(e==="mdc-menu-item--selected"?s.selected&&i.toggle(t,!1):s.classList.remove(e))},addAttributeToElementAtIndex:(t,e,i)=>{const s=this.listElement;if(!s)return;const r=s.items[t];r&&r.setAttribute(e,i)},removeAttributeFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const s=i.items[t];s&&s.removeAttribute(e)},getAttributeFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return null;const s=i.items[t];return s?s.getAttribute(e):null},elementContainsClass:(t,e)=>t.classList.contains(e),closeSurface:()=>{this.open=!1},getElementIndex:t=>{const e=this.listElement;return e?e.items.indexOf(t):-1},notifySelected:()=>{},getMenuItemCount:()=>{const t=this.listElement;return t?t.items.length:0},focusItemAtIndex:t=>{const e=this.listElement;if(!e)return;const i=e.items[t];i&&i.focus()},focusListRoot:()=>{this.listElement&&this.listElement.focus()},getSelectedSiblingOfItemAtIndex:t=>{const e=this.listElement;if(!e)return-1;const i=e.items[t];if(!i||!i.group)return-1;for(let s=0;s<e.items.length;s++){if(s===t)continue;const r=e.items[s];if(r.selected&&r.group===i.group)return s}return-1},isSelectableItemAtIndex:t=>{const e=this.listElement;if(!e)return!1;const i=e.items[t];return i?i.hasAttribute("group"):!1}}}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onAction(t){const e=this.listElement;if(this.mdcFoundation&&e){const i=t.detail.index,s=e.items[i];s&&this.mdcFoundation.handleItemAction(s)}}onOpened(){this.open=!0,this.mdcFoundation&&this.mdcFoundation.handleMenuSurfaceOpened()}onClosed(){this.open=!1}async getUpdateComplete(){return await this._listUpdateComplete,await super.getUpdateComplete()}async firstUpdated(){super.firstUpdated();const t=this.listElement;t&&(this._listUpdateComplete=t.updateComplete,await this._listUpdateComplete)}select(t){const e=this.listElement;e&&e.select(t)}close(){this.open=!1}show(){this.open=!0}getFocusedItemIndex(){const t=this.listElement;return t?t.getFocusedItemIndex():-1}focusItemAtIndex(t){const e=this.listElement;e&&e.focusItemAtIndex(t)}layout(t=!0){const e=this.listElement;e&&e.layout(t)}}o.__decorate([F.i(".mdc-menu")],l.prototype,"mdcRoot",void 0);o.__decorate([F.i("slot")],l.prototype,"slotElement",void 0);o.__decorate([a.n({type:Object})],l.prototype,"anchor",void 0);o.__decorate([a.n({type:Boolean,reflect:!0})],l.prototype,"open",void 0);o.__decorate([a.n({type:Boolean})],l.prototype,"quick",void 0);o.__decorate([a.n({type:Boolean})],l.prototype,"wrapFocus",void 0);o.__decorate([a.n({type:String})],l.prototype,"innerRole",void 0);o.__decorate([a.n({type:String})],l.prototype,"innerAriaLabel",void 0);o.__decorate([a.n({type:String})],l.prototype,"corner",void 0);o.__decorate([a.n({type:Number})],l.prototype,"x",void 0);o.__decorate([a.n({type:Number})],l.prototype,"y",void 0);o.__decorate([a.n({type:Boolean})],l.prototype,"absolute",void 0);o.__decorate([a.n({type:Boolean})],l.prototype,"multi",void 0);o.__decorate([a.n({type:Boolean})],l.prototype,"activatable",void 0);o.__decorate([a.n({type:Boolean})],l.prototype,"fixed",void 0);o.__decorate([a.n({type:Boolean})],l.prototype,"forceGroupSelection",void 0);o.__decorate([a.n({type:Boolean})],l.prototype,"fullwidth",void 0);o.__decorate([a.n({type:String})],l.prototype,"menuCorner",void 0);o.__decorate([a.n({type:Boolean})],l.prototype,"stayOpenOnBodyClick",void 0);o.__decorate([a.n({type:String}),E.observer(function(n){this.mdcFoundation&&this.mdcFoundation.setDefaultFocusState(b[n])})],l.prototype,"defaultFocus",void 0);/**
|
187
187
|
* @license
|
188
188
|
* Copyright 2021 Google LLC
|
189
189
|
* SPDX-LIcense-Identifier: Apache-2.0
|
190
|
-
*/const
|
190
|
+
*/const ee=A.i`mwc-list ::slotted([mwc-list-item]:not([twoline])),mwc-list ::slotted([noninteractive]:not([twoline])){height:var(--mdc-menu-item-height, 48px)}`;exports.MenuBase=l;exports.styles=ee;
|