@covalent/components 8.23.2 → 9.0.0-beta.2
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-2f131a27.mjs → _commonjsHelpers-DjF3Plf2.mjs} +2 -4
- package/action-ribbon.js +5 -6
- package/action-ribbon.mjs +47 -51
- package/alert.js +5 -6
- package/alert.mjs +48 -52
- package/app-shell.js +1 -2
- package/app-shell.mjs +13 -30
- package/{async-directive-99a01ec7.mjs → async-directive-Cx1B9M5C.mjs} +11 -23
- package/{async-directive-4a34f75e.js → async-directive-y3fBDDSk.js} +1 -1
- package/badge.js +1 -2
- package/badge.mjs +10 -12
- package/{base-element-acf30176.mjs → base-element-C-U4OfWx.mjs} +2 -2
- package/{base-element-58a3f9ea.js → base-element-aUDWLn36.js} +1 -1
- package/button.js +2 -3
- package/button.mjs +18 -23
- package/card.js +8 -9
- package/card.mjs +36 -38
- package/check-list-item.js +11 -15
- package/check-list-item.mjs +53 -70
- package/checkbox.js +1 -2
- package/checkbox.mjs +15 -31
- package/{chip-c65a4549.js → chip-BsDYOEFW.js} +31 -32
- package/{chip-fb0ea5c5.mjs → chip-C8L37ovG.mjs} +110 -117
- package/chip-set.js +5 -6
- package/chip-set.mjs +73 -83
- package/chip.js +1 -1
- package/chip.mjs +4 -13
- package/circular-progress.js +1 -1
- package/circular-progress.mjs +9 -10
- package/{class-map-6e504a9a.mjs → class-map-C1SJpero.mjs} +4 -6
- package/{class-map-0a4c6ca9.js → class-map-C8G1ALWK.js} +1 -1
- package/{code-editor-712d0ce9.mjs → code-editor-CxQzms2S.mjs} +13485 -13720
- package/code-editor-hT6MTCL6.js +660 -0
- package/code-editor.js +1 -1
- package/code-editor.mjs +3 -6
- package/code-snippet.js +5 -6
- package/code-snippet.mjs +235 -284
- package/{dialog-78a9fd0e.mjs → dialog-BoNH4r3n.mjs} +23 -25
- package/{dialog-83104700.js → dialog-LUOzoMeO.js} +6 -7
- package/dialog.js +1 -1
- package/dialog.mjs +4 -13
- package/directive-C7oCP5Bh.js +5 -0
- package/{directive-helpers-e3ea6592.mjs → directive-helpers-CllkNDrI.mjs} +1 -1
- package/{directive-helpers-0ce1f995.js → directive-helpers-Duf3sfLn.js} +1 -1
- package/{directive-daf4e9b6.mjs → directive-oAbCiebi.mjs} +4 -4
- package/drawer.js +2 -3
- package/drawer.mjs +7 -17
- package/empty-state.js +2 -3
- package/empty-state.mjs +12 -15
- package/{event-options-3f5eb195.js → event-options-BH8ks-kz.js} +1 -1
- package/{event-options-78d6cf94.mjs → event-options-CNykeE2u.mjs} +1 -1
- package/expansion-panel-item.js +1 -2
- package/expansion-panel-item.mjs +6 -9
- package/expansion-panel.js +1 -1
- package/expansion-panel.mjs +2 -2
- package/focused-page.js +1 -2
- package/focused-page.mjs +13 -16
- package/{form-element-abadd335.mjs → form-element-CxSqbssX.mjs} +4 -4
- package/{form-element-c553d6f5.js → form-element-DwqUbs65.js} +1 -1
- package/formfield.js +6 -7
- package/formfield.mjs +19 -23
- package/{foundation-e980aa3d.js → foundation-CySCCTUE.js} +3 -3
- package/{foundation-d533452a.mjs → foundation-qQ4jzaAu.mjs} +11 -13
- package/full-screen-dialog.js +4 -5
- package/full-screen-dialog.mjs +13 -22
- package/{html-021d0b5b.mjs → html-BFM6gjw5.mjs} +13 -18
- package/html-BMgGKfr0.js +6 -0
- package/icon-button-toggle.js +11 -16
- package/icon-button-toggle.mjs +68 -78
- package/icon-button.js +6 -11
- package/icon-button.mjs +56 -66
- package/icon-check-toggle.js +6 -7
- package/icon-check-toggle.mjs +10 -23
- package/icon-radio-toggle.js +4 -5
- package/icon-radio-toggle.mjs +13 -29
- package/icon.js +1 -5
- package/icon.mjs +13 -20
- package/{if-defined-c367f208.mjs → if-defined-BsNkRMMG.mjs} +1 -1
- package/{if-defined-f1c45245.js → if-defined-D8C6ewRn.js} +1 -1
- package/index.js +1 -1
- package/index.mjs +110 -150
- package/{inert.esm-359d4581.mjs → inert.esm-BJ7IrRxy.mjs} +3 -4
- package/{javascript-5b83986c.js → javascript-20JK5_5Y.js} +1 -1
- package/{javascript-d2604785.mjs → javascript-BVQ0GGQP.mjs} +4 -10
- package/linear-progress.js +2 -3
- package/linear-progress.mjs +12 -14
- package/list-item-BZVW1fmJ.js +5 -0
- package/list-item-DCzzLVZh.mjs +11 -0
- package/list-item.js +5 -5
- package/list-item.mjs +21 -32
- package/list.js +3 -8
- package/list.mjs +18 -38
- package/menu.js +3 -8
- package/menu.mjs +18 -39
- package/{mwc-checkbox.css-b3434429.js → mwc-checkbox.css-Cd0yCOHu.js} +42 -2
- package/{mwc-checkbox.css-8f4f1a9b.mjs → mwc-checkbox.css-MBOzkrQg.mjs} +198 -3
- package/{mwc-drawer-base-bbae43c3.js → mwc-drawer-base-D-48lqfn.js} +5 -5
- package/{mwc-drawer-base-ca75f41f.mjs → mwc-drawer-base-Dgs9327G.mjs} +24 -26
- package/{mwc-icon-5227aec3.mjs → mwc-icon-BZRds8SY.mjs} +6 -5
- package/{mwc-icon-f87639bc.js → mwc-icon-BumH81hp.js} +2 -2
- package/mwc-icon-button.css-BtgKBOl3.js +5 -0
- package/mwc-icon-button.css-DJMY7U7e.mjs +10 -0
- package/{mwc-line-ripple-directive-40145003.js → mwc-line-ripple-directive-DvPWr3ER.js} +1 -1
- package/{mwc-line-ripple-directive-aabd8778.mjs → mwc-line-ripple-directive-zhm5Zc8i.mjs} +7 -7
- package/{list-item-8b940ec8.js → mwc-list-item.css-CtRq5wSu.js} +28 -6
- package/{list-item-ef175b93.mjs → mwc-list-item.css-g34xqhLC.mjs} +199 -9
- package/mwc-list.css-CaMJWsDp.js +111 -0
- package/{mwc-list-base-402e1d8e.mjs → mwc-list.css-DFOdJyFB.mjs} +213 -213
- package/{mwc-menu-base-04586160.mjs → mwc-menu.css-BEiPghgR.mjs} +90 -92
- package/{mwc-menu-base-08f54c38.js → mwc-menu.css-pxcxlTrh.js} +22 -22
- package/mwc-radio.css-CVMtIq-L.js +105 -0
- package/{mwc-radio-base-768b4221.mjs → mwc-radio.css-XRx0vL1k.mjs} +124 -118
- package/{mwc-slider.css-cda43bd0.mjs → mwc-slider.css-2Bqk43z7.mjs} +200 -211
- package/{mwc-slider.css-c5f99704.js → mwc-slider.css-WrkrmqkL.js} +6 -6
- package/{mwc-tab-base-0814a3ef.mjs → mwc-tab.css-B9yQpkYf.mjs} +126 -122
- package/{mwc-tab-base-f2269fd1.js → mwc-tab.css-CgdXMZBB.js} +26 -22
- package/{mwc-top-app-bar-base-8a7f7312.mjs → mwc-top-app-bar-base-B0EW9eNk.mjs} +13 -15
- package/{mwc-top-app-bar-base-8c8cde51.js → mwc-top-app-bar-base-CSXRBOiX.js} +3 -3
- package/nav-list-item.js +4 -5
- package/nav-list-item.mjs +12 -23
- package/notebook-cell.js +8 -9
- package/notebook-cell.mjs +14 -29
- package/package.json +1 -1
- package/python-B8sEpp0H.js +6 -0
- package/{python-0707b744.mjs → python-BRZC-1dQ.mjs} +11 -16
- package/query-BBDQWsft.mjs +15 -0
- package/query-BxDs8ftQ.js +5 -0
- package/{query-assigned-elements-4a39219d.mjs → query-assigned-elements-DCt2xozt.mjs} +32 -57
- package/{query-assigned-nodes-df691e78.mjs → query-assigned-nodes-B9zBfkh6.mjs} +1 -1
- package/{query-assigned-nodes-99eae71d.js → query-assigned-nodes-CckKHm2z.js} +1 -1
- package/radio-list-item.js +9 -13
- package/radio-list-item.mjs +50 -66
- package/radio.js +1 -2
- package/radio.mjs +15 -32
- package/{ripple-handlers-9fb4a31a.js → ripple-handlers-CzfSBjWo.js} +8 -8
- package/{ripple-handlers-8883e893.mjs → ripple-handlers-i3WPEBiO.mjs} +20 -25
- package/select.js +15 -20
- package/select.mjs +196 -213
- package/side-sheet.js +1 -2
- package/side-sheet.mjs +18 -27
- package/slider-range.js +1 -1
- package/slider-range.mjs +15 -19
- package/slider.js +1 -1
- package/slider.mjs +18 -26
- package/snackbar.js +9 -10
- package/snackbar.mjs +30 -33
- package/{state-0974a8e5.js → state-C3HoXfoa.js} +1 -1
- package/{state-b5e865db.mjs → state-DaD9o2aK.mjs} +1 -1
- package/status-dialog/status-dialog.d.ts.map +1 -1
- package/status-dialog.js +15 -37
- package/status-dialog.mjs +47 -116
- package/status-header-item.js +1 -2
- package/status-header-item.mjs +7 -8
- package/status-header.js +4 -5
- package/status-header.mjs +22 -24
- package/{style-map-a135c6ab.js → style-map-BJBXlSqn.js} +1 -1
- package/{style-map-e7ec6d41.mjs → style-map-CCsABR5m.mjs} +4 -6
- package/style.css +1 -1
- package/switch.js +6 -7
- package/switch.mjs +20 -29
- package/tab-bar.js +18 -22
- package/tab-bar.mjs +192 -205
- package/tab.js +1 -6
- package/tab.mjs +13 -31
- package/text-lockup.js +1 -2
- package/text-lockup.mjs +14 -16
- package/textarea.js +15 -19
- package/textarea.mjs +53 -68
- package/textfield-BwmiygD8.js +136 -0
- package/textfield-C6sUZIeA.mjs +927 -0
- package/textfield.js +3 -7
- package/textfield.mjs +17 -37
- package/toolbar.js +1 -2
- package/toolbar.mjs +6 -13
- package/tooltip.js +3 -4
- package/tooltip.mjs +29 -40
- package/{top-app-bar-f83386e0.mjs → top-app-bar-4SA3DjLX.mjs} +2 -3
- package/{top-app-bar-a531c1b4.js → top-app-bar-CGjBuyiD.js} +2 -3
- package/top-app-bar-fixed.js +6 -6
- package/top-app-bar-fixed.mjs +24 -32
- package/top-app-bar.js +3 -3
- package/top-app-bar.mjs +18 -25
- package/tree-list-item.js +1 -2
- package/tree-list-item.mjs +9 -13
- package/tree-list.js +1 -2
- package/tree-list.mjs +6 -7
- package/{tslib.es6-c4b0f3b1.mjs → tslib.es6-pPsSiLLK.mjs} +15 -26
- package/typescript-CqVUCaiQ.js +6 -0
- package/{typescript-399a453a.mjs → typescript-qqbekFoQ.mjs} +10 -15
- package/typography.js +1 -2
- package/typography.mjs +7 -8
- package/code-editor-b36fad77.js +0 -662
- package/directive-1186bc23.js +0 -5
- package/html-b2900c6a.js +0 -6
- package/mwc-checkbox-base-02b4eb91.mjs +0 -198
- package/mwc-checkbox-base-935d9566.js +0 -41
- package/mwc-list-base-22616d0a.js +0 -111
- package/mwc-list-item-base-06d93e6e.js +0 -28
- package/mwc-list-item-base-3c6a3bfb.mjs +0 -202
- package/mwc-radio-base-147cf999.js +0 -101
- package/mwc-radio.css-4e140252.js +0 -5
- package/mwc-radio.css-7454bb11.mjs +0 -10
- package/python-6a1f2ad7.js +0 -6
- package/query-680f1868.js +0 -5
- package/query-d843aa92.mjs +0 -25
- package/textfield-83e78e56.js +0 -133
- package/textfield-853ebae5.mjs +0 -933
- package/typescript-98fbdb3d.js +0 -6
- /package/{_commonjsHelpers-2367a3a2.js → _commonjsHelpers-6jR-N8xe.js} +0 -0
- /package/{aria-property-fa2717fe.mjs → aria-property-6O5bK0tV.mjs} +0 -0
- /package/{aria-property-849c8816.js → aria-property-Dl2ZKBbP.js} +0 -0
- /package/{css-9be95551.js → css-Bn4le2Sp.js} +0 -0
- /package/{css-5dd354ac.mjs → css-DjwjINlv.mjs} +0 -0
- /package/{foundation-2334d146.mjs → foundation-PL3XY-m_.mjs} +0 -0
- /package/{foundation-e830bd94.js → foundation-pgmPu2iJ.js} +0 -0
- /package/{inert.esm-2cee6f2e.js → inert.esm-CNFtJ8pb.js} +0 -0
- /package/{keyboard-983b121c.mjs → keyboard-BLpVBEDM.mjs} +0 -0
- /package/{keyboard-39125691.js → keyboard-CZlaSOb1.js} +0 -0
- /package/{markdown-eae8e3ba.js → markdown-CrnizovQ.js} +0 -0
- /package/{markdown-9b448c46.mjs → markdown-bAu8rWEZ.mjs} +0 -0
- /package/{observer-be7b92e2.mjs → observer-DQ8OfVDQ.mjs} +0 -0
- /package/{observer-a096ab43.js → observer-N9cgkDqh.js} +0 -0
- /package/{property-9b6ea53b.mjs → property-DJzm_oB9.mjs} +0 -0
- /package/{property-57f6f6fe.js → property-DYTC_2-m.js} +0 -0
- /package/{query-assigned-elements-f623705d.js → query-assigned-elements-4CafVNR8.js} +0 -0
- /package/{r-42c6f0aa.js → r-DKABafMl.js} +0 -0
- /package/{r-630f5d6b.mjs → r-rF4J5dF2.mjs} +0 -0
- /package/{sql-63ec8e76.mjs → sql-CL8qgBkR.mjs} +0 -0
- /package/{sql-faf05577.js → sql-CXm05EUD.js} +0 -0
- /package/{tslib.es6-98719205.js → tslib.es6-CHeFCc6E.js} +0 -0
- /package/{utils-dc65fdc9.mjs → utils-Dr5MegQq.mjs} +0 -0
- /package/{utils-a8190a39.js → utils-wMBJ9n_n.js} +0 -0
@@ -1,12 +1,8 @@
|
|
1
|
-
"use strict";const
|
2
|
-
* @license
|
3
|
-
* Copyright 2021 Google LLC
|
4
|
-
* SPDX-LIcense-Identifier: Apache-2.0
|
5
|
-
*/const W=A.i`@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{display:block}.mdc-deprecated-list{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);line-height:1.5rem;margin:0;padding:8px 0;list-style-type:none;color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87));padding:var(--mdc-list-vertical-padding, 8px) 0}.mdc-deprecated-list:focus{outline:none}.mdc-deprecated-list-item{height:48px}.mdc-deprecated-list--dense{padding-top:4px;padding-bottom:4px;font-size:.812rem}.mdc-deprecated-list ::slotted([divider]){height:0;margin:0;border:none;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgba(0, 0, 0, 0.12)}.mdc-deprecated-list ::slotted([divider][padded]){margin:0 var(--mdc-list-side-padding, 16px)}.mdc-deprecated-list ::slotted([divider][inset]){margin-left:var(--mdc-list-inset-margin, 72px);margin-right:0;width:calc( 100% - var(--mdc-list-inset-margin, 72px) )}[dir=rtl] .mdc-deprecated-list ::slotted([divider][inset]),.mdc-deprecated-list ::slotted([divider][inset][dir=rtl]){margin-left:0;margin-right:var(--mdc-list-inset-margin, 72px)}.mdc-deprecated-list ::slotted([divider][inset][padded]){width:calc( 100% - var(--mdc-list-inset-margin, 72px) - var(--mdc-list-side-padding, 16px) )}.mdc-deprecated-list--dense ::slotted([mwc-list-item]){height:40px}.mdc-deprecated-list--dense ::slotted([mwc-list]){--mdc-list-item-graphic-size: 20px}.mdc-deprecated-list--two-line.mdc-deprecated-list--dense ::slotted([mwc-list-item]),.mdc-deprecated-list--avatar-list.mdc-deprecated-list--dense ::slotted([mwc-list-item]){height:60px}.mdc-deprecated-list--avatar-list.mdc-deprecated-list--dense ::slotted([mwc-list]){--mdc-list-item-graphic-size: 36px}:host([noninteractive]){pointer-events:none;cursor:default}.mdc-deprecated-list--dense ::slotted(.mdc-deprecated-list-item__primary-text){display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-deprecated-list--dense ::slotted(.mdc-deprecated-list-item__primary-text)::before{display:inline-block;width:0;height:24px;content:"";vertical-align:0}.mdc-deprecated-list--dense ::slotted(.mdc-deprecated-list-item__primary-text)::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}`;/**
|
1
|
+
"use strict";const o=require("./tslib.es6-CHeFCc6E.js"),A=require("./query-assigned-elements-4CafVNR8.js"),U=require("./mwc-list.css-CaMJWsDp.js"),q=require("./base-element-aUDWLn36.js"),E=require("./observer-N9cgkDqh.js"),D=require("./utils-wMBJ9n_n.js"),a=require("./property-DYTC_2-m.js"),v=require("./state-C3HoXfoa.js"),F=require("./query-BxDs8ftQ.js"),H=require("./class-map-C8G1ALWK.js"),W=require("./style-map-BJBXlSqn.js");/**
|
6
2
|
* @license
|
7
3
|
* Copyright 2020 Google LLC
|
8
4
|
* SPDX-License-Identifier: Apache-2.0
|
9
|
-
*/let k=class extends
|
5
|
+
*/let k=class extends U.ListBase{};k.styles=[U.styles];k=o.__decorate([A.e("mwc-list")],k);/**
|
10
6
|
* @license
|
11
7
|
* Copyright 2018 Google Inc.
|
12
8
|
*
|
@@ -27,7 +23,7 @@
|
|
27
23
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
28
24
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
29
25
|
* THE SOFTWARE.
|
30
|
-
*/var
|
26
|
+
*/var K={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(", ")},L={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67,TOUCH_EVENT_WAIT_MS:30},l;(function(n){n[n.BOTTOM=1]="BOTTOM",n[n.CENTER=2]="CENTER",n[n.RIGHT=4]="RIGHT",n[n.FLIP_RTL=8]="FLIP_RTL"})(l||(l={}));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={}));/**
|
31
27
|
* @license
|
32
28
|
* Copyright 2016 Google Inc.
|
33
29
|
*
|
@@ -48,7 +44,7 @@
|
|
48
44
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
49
45
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
50
46
|
* THE SOFTWARE.
|
51
|
-
*/var
|
47
|
+
*/var j=function(){function n(e){e===void 0&&(e={}),this.adapter=e}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}();/**
|
52
48
|
* @license
|
53
49
|
* Copyright 2018 Google Inc.
|
54
50
|
*
|
@@ -69,27 +65,27 @@
|
|
69
65
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
70
66
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
71
67
|
* THE SOFTWARE.
|
72
|
-
*/var V=function(n){
|
68
|
+
*/var V=function(n){o.__extends(e,n);function e(t){var i=n.call(this,o.__assign(o.__assign({},e.defaultAdapter),t))||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(e,"cssClasses",{get:function(){return K},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return X},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return L},enumerable:!1,configurable:!0}),Object.defineProperty(e,"Corner",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(e,"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}),e.prototype.init=function(){var t=e.cssClasses,i=t.ROOT,s=t.OPEN;if(!this.adapter.hasClass(i))throw new Error(i+" class required in root element.");this.adapter.hasClass(s)&&(this.isSurfaceOpen=!0)},e.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},e.prototype.setAnchorCorner=function(t){this.anchorCorner=t},e.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^l.RIGHT},e.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},e.prototype.setIsHoisted=function(t){this.isHoistedElement=t},e.prototype.setFixedPosition=function(t){this.isFixedPosition=t},e.prototype.isFixed=function(){return this.isFixedPosition},e.prototype.setAbsolutePosition=function(t,i){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(i)?i:0},e.prototype.setIsHorizontallyCenteredOnViewport=function(t){this.isHorizontallyCenteredOnViewport=t},e.prototype.setQuickOpen=function(t){this.isQuickOpen=t},e.prototype.setMaxHeight=function(t){this.maxHeight=t},e.prototype.setOpenBottomBias=function(t){this.openBottomBias=t},e.prototype.isOpen=function(){return this.isSurfaceOpen},e.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.notifyOpening(),this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(e.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(e.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.adapter.addClass(e.cssClasses.OPEN),t.openAnimationEndTimerId=setTimeout(function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(e.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()},L.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},e.prototype.close=function(t){var i=this;if(t===void 0&&(t=!1),!!this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen){this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(e.cssClasses.OPEN),this.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),this.adapter.notifyClose();return}this.adapter.addClass(e.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){i.adapter.removeClass(e.cssClasses.OPEN),i.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),i.closeAnimationEndTimerId=setTimeout(function(){i.closeAnimationEndTimerId=0,i.adapter.removeClass(e.cssClasses.ANIMATING_CLOSED),i.adapter.notifyClose()},L.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()}},e.prototype.handleBodyClick=function(t){var i=t.target;this.adapter.isElementInContainer(i)||this.close()},e.prototype.handleKeydown=function(t){var i=t.keyCode,s=t.key,r=s==="Escape"||i===27;r&&this.close()},e.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var i=this.getoriginCorner(),s=this.getMenuSurfaceMaxHeight(i),r=this.hasBit(i,l.BOTTOM)?"bottom":"top",c=this.hasBit(i,l.RIGHT)?"right":"left",p=this.getHorizontalOriginOffset(i),R=this.getVerticalOriginOffset(i),g=this.measurements,I=g.anchorSize,S=g.surfaceSize,f=(t={},t[c]=p,t[r]=R,t);I.width/S.width>L.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,l.BOTTOM)||this.adapter.addClass(e.cssClasses.IS_OPEN_BELOW)},e.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),i=this.adapter.getBodyDimensions(),s=this.adapter.getWindowDimensions(),r=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:i,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:s.width-t.right,bottom:s.height-t.bottom,left:t.left},viewportSize:s,windowScroll:r}},e.prototype.getoriginCorner=function(){var t=this.originCorner,i=this.measurements,s=i.viewportDistance,r=i.anchorSize,c=i.surfaceSize,p=e.numbers.MARGIN_TO_EDGE,R=this.hasBit(this.anchorCorner,l.BOTTOM),g,I;R?(g=s.top-p+this.anchorMargin.bottom,I=s.bottom-p-this.anchorMargin.bottom):(g=s.top-p+this.anchorMargin.top,I=s.bottom-p+r.height-this.anchorMargin.top);var S=I-c.height>0;!S&&g>I+this.openBottomBias&&(t=this.setBit(t,l.BOTTOM));var f=this.adapter.isRtl(),T=this.hasBit(this.anchorCorner,l.FLIP_RTL),_=this.hasBit(this.anchorCorner,l.RIGHT)||this.hasBit(t,l.RIGHT),b=!1;f&&T?b=!_:b=_;var w,B;b?(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(t,l.FLIP_RTL)&&this.hasBit(t,l.RIGHT);return G&&$&&f||!N&&$?t=this.unsetBit(t,l.RIGHT):(N&&b&&f||N&&!b&&_||!G&&w>=B)&&(t=this.setBit(t,l.RIGHT)),t},e.prototype.getMenuSurfaceMaxHeight=function(t){if(this.maxHeight>0)return this.maxHeight;var i=this.measurements.viewportDistance,s=0,r=this.hasBit(t,l.BOTTOM),c=this.hasBit(this.anchorCorner,l.BOTTOM),p=e.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},e.prototype.getHorizontalOriginOffset=function(t){var i=this.measurements.anchorSize,s=this.hasBit(t,l.RIGHT),r=this.hasBit(this.anchorCorner,l.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},e.prototype.getVerticalOriginOffset=function(t){var i=this.measurements.anchorSize,s=this.hasBit(t,l.BOTTOM),r=this.hasBit(this.anchorCorner,l.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},e.prototype.adjustPositionForHoistedElement=function(t){var i,s,r=this.measurements,c=r.windowScroll,p=r.viewportDistance,R=r.surfaceSize,g=r.viewportSize,I=Object.keys(t);try{for(var S=o.__values(I),f=S.next();!f.done;f=S.next()){var T=f.value,_=t[T]||0;if(this.isHorizontallyCenteredOnViewport&&(T==="left"||T==="right")){t[T]=(g.width-R.width)/2;continue}_+=p[T],this.isFixedPosition||(T==="top"?_+=c.y:T==="bottom"?_-=c.y:T==="left"?_+=c.x:_-=c.x),t[T]=_}}catch(b){i={error:b}}finally{try{f&&!f.done&&(s=S.return)&&s.call(S)}finally{if(i)throw i.error}}},e.prototype.maybeRestoreFocus=function(){var t=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(){t.adapter.restoreFocus()},L.TOUCH_EVENT_WAIT_MS)},e.prototype.hasBit=function(t,i){return!!(t&i)},e.prototype.setBit=function(t,i){return t|i},e.prototype.unsetBit=function(t,i){return t^i},e.prototype.isFinite=function(t){return typeof t=="number"&&isFinite(t)},e}(j);/**
|
73
69
|
* @license
|
74
70
|
* Copyright 2020 Google LLC
|
75
71
|
* SPDX-License-Identifier: Apache-2.0
|
76
|
-
*/const
|
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=V,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 e=this.getRootClasses(),t=this.getRootStyles();return A.x`
|
77
73
|
<div
|
78
|
-
class=${
|
79
|
-
style="${
|
74
|
+
class=${H.o(e)}
|
75
|
+
style="${W.o(t)}"
|
80
76
|
@keydown=${this.onKeydown}
|
81
77
|
@opened=${this.registerBodyClick}
|
82
78
|
@closed=${this.deregisterBodyClick}>
|
83
79
|
${this.renderContent()}
|
84
|
-
</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({},
|
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 e={bubbles:!0,composed:!0},t=new CustomEvent("closed",e);this.open=!1,this.mdcRoot.dispatchEvent(t)},notifyClosing:()=>{const e={bubbles:!0,composed:!0},t=new CustomEvent("closing",e);this.mdcRoot.dispatchEvent(t)},notifyOpen:()=>{const e={bubbles:!0,composed:!0},t=new CustomEvent("opened",e);this.open=!0,this.mdcRoot.dispatchEvent(t)},notifyOpening:()=>{const e={bubbles:!0,composed:!0},t=new CustomEvent("opening",e);this.mdcRoot.dispatchEvent(t)},isElementInContainer:()=>!1,isRtl:()=>this.mdcRoot?getComputedStyle(this.mdcRoot).direction==="rtl":!1,setTransformOrigin:e=>{this.mdcRoot&&(this.styleTransformOrigin=e)},isFocused:()=>D.doesElementContainFocus(this),saveFocus:()=>{const e=D.deepActiveElementPath(),t=e.length;t||(this.previouslyFocused=null),this.previouslyFocused=e[t-1]},restoreFocus:()=>{this.previouslyFocused&&"focus"in this.previouslyFocused&&this.previouslyFocused.focus()},getInnerDimensions:()=>{const e=this.mdcRoot;return e?{width:e.offsetWidth,height:e.offsetHeight}:{width:0,height:0}},getAnchorDimensions:()=>{const e=this.anchor;return e?e.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:e=>{this.mdcRoot&&(this.styleLeft="left"in e?`${e.left}px`:"",this.styleRight="right"in e?`${e.right}px`:"",this.styleTop="top"in e?`${e.top}px`:"",this.styleBottom="bottom"in e?`${e.bottom}px`:"")},setMaxHeight:async e=>{this.mdcRoot&&(this.styleMaxHeight=e,await this.updateComplete,this.styleMaxHeight=`var(--mdc-menu-max-height, ${e})`)}})}onKeydown(e){this.mdcFoundation&&this.mdcFoundation.handleKeydown(e)}onBodyClick(e){if(this.stayOpenOnBodyClick)return;e.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(e,t){this.mdcFoundation&&(e?this.mdcFoundation.open():t!==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,e){this.onOpenChanged(n,e)})],h.prototype,"open",void 0);o.__decorate([a.n({type:Boolean})],h.prototype,"stayOpenOnBodyClick",void 0);o.__decorate([v.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 e=n==="START"||n==="END",t=this.previousMenuCorner===null,i=!t&&n!==this.previousMenuCorner;e&&(i||t&&n==="END")&&(this.bitwiseCorner=this.bitwiseCorner^l.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 e=Q[n];this.menuCorner==="END"&&(e=e^l.RIGHT),this.bitwiseCorner=e}})],h.prototype,"corner",void 0);o.__decorate([v.t()],h.prototype,"styleTop",void 0);o.__decorate([v.t()],h.prototype,"styleLeft",void 0);o.__decorate([v.t()],h.prototype,"styleRight",void 0);o.__decorate([v.t()],h.prototype,"styleBottom",void 0);o.__decorate([v.t()],h.prototype,"styleMaxHeight",void 0);o.__decorate([v.t()],h.prototype,"styleTransformOrigin",void 0);/**
|
85
81
|
* @license
|
86
82
|
* Copyright 2021 Google LLC
|
87
83
|
* SPDX-LIcense-Identifier: Apache-2.0
|
88
|
-
*/const
|
84
|
+
*/const Y=A.i`.mdc-menu-surface{display:none;position:absolute;box-sizing:border-box;max-width:calc(100vw - 32px);max-width:var(--mdc-menu-max-width, calc(100vw - 32px));max-height:calc(100vh - 32px);max-height:var(--mdc-menu-max-height, calc(100vh - 32px));margin:0;padding:0;transform:scale(1);transform-origin:top left;opacity:0;overflow:auto;will-change:transform,opacity;z-index:8;transition:opacity .03s linear,transform .12s cubic-bezier(0, 0, 0.2, 1),height 250ms cubic-bezier(0, 0, 0.2, 1);box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12);background-color:#fff;background-color:var(--mdc-theme-surface, #fff);color:#000;color:var(--mdc-theme-on-surface, #000);border-radius:4px;border-radius:var(--mdc-shape-medium, 4px);transform-origin-left:top left;transform-origin-right:top right}.mdc-menu-surface:focus{outline:none}.mdc-menu-surface--animating-open{display:inline-block;transform:scale(0.8);opacity:0}.mdc-menu-surface--open{display:inline-block;transform:scale(1);opacity:1}.mdc-menu-surface--animating-closed{display:inline-block;opacity:0;transition:opacity .075s linear}[dir=rtl] .mdc-menu-surface,.mdc-menu-surface[dir=rtl]{transform-origin-left:top right;transform-origin-right:top left}.mdc-menu-surface--anchor{position:relative;overflow:visible}.mdc-menu-surface--fixed{position:fixed}.mdc-menu-surface--fullwidth{width:100%}:host(:not([open])){display:none}.mdc-menu-surface{z-index:8;z-index:var(--mdc-menu-z-index, 8);min-width:112px;min-width:var(--mdc-menu-min-width, 112px)}`;/**
|
89
85
|
* @license
|
90
86
|
* Copyright 2020 Google LLC
|
91
87
|
* SPDX-License-Identifier: Apache-2.0
|
92
|
-
*/let z=class extends h{};z.styles=[
|
88
|
+
*/let z=class extends h{};z.styles=[Y];z=o.__decorate([A.e("mwc-menu-surface")],z);/**
|
93
89
|
* @license
|
94
90
|
* Copyright 2018 Google Inc.
|
95
91
|
*
|
@@ -110,7 +106,7 @@
|
|
110
106
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
111
107
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
112
108
|
* THE SOFTWARE.
|
113
|
-
*/var
|
109
|
+
*/var P={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},M={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"},J={FOCUS_ROOT_INDEX:-1},C;(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"})(C||(C={}));/**
|
114
110
|
* @license
|
115
111
|
* Copyright 2018 Google Inc.
|
116
112
|
*
|
@@ -131,7 +127,7 @@
|
|
131
127
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
132
128
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
133
129
|
* THE SOFTWARE.
|
134
|
-
*/var O,
|
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 x=(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+x[d.LIST_ITEM_CLASS]+x[d.LIST_ITEM_CLASS],""+d.LIST_ITEM_CLASS+d.LIST_ITEM_CLASS+d.LIST_ITEM_CLASS+d.LIST_ITEM_CLASS+x[d.LIST_ITEM_CLASS]+x[d.LIST_ITEM_CLASS]+x[d.LIST_ITEM_CLASS]+x[d.LIST_ITEM_CLASS];/**
|
135
131
|
* @license
|
136
132
|
* Copyright 2018 Google Inc.
|
137
133
|
*
|
@@ -152,11 +148,11 @@
|
|
152
148
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
153
149
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
154
150
|
* THE SOFTWARE.
|
155
|
-
*/var
|
151
|
+
*/var Z=function(n){o.__extends(e,n);function e(t){var i=n.call(this,o.__assign(o.__assign({},e.defaultAdapter),t))||this;return i.closeAnimationEndTimerId=0,i.defaultFocusState=C.LIST_ROOT,i.selectedIndex=-1,i}return Object.defineProperty(e,"cssClasses",{get:function(){return P},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return M},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return J},enumerable:!1,configurable:!0}),Object.defineProperty(e,"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}),e.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},e.prototype.handleKeydown=function(t){var i=t.key,s=t.keyCode,r=i==="Tab"||s===9;r&&this.adapter.closeSurface(!0)},e.prototype.handleItemAction=function(t){var i=this,s=this.adapter.getElementIndex(t);if(!(s<0)){this.adapter.notifySelected({index:s});var r=this.adapter.getAttributeFromElementAtIndex(s,M.SKIP_RESTORE_FOCUS)==="true";this.adapter.closeSurface(r),this.closeAnimationEndTimerId=setTimeout(function(){var c=i.adapter.getElementIndex(t);c>=0&&i.adapter.isSelectableItemAtIndex(c)&&i.setSelectedIndex(c)},V.numbers.TRANSITION_CLOSE_DURATION)}},e.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case C.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case C.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case C.NONE:break;default:this.adapter.focusListRoot();break}},e.prototype.setDefaultFocusState=function(t){this.defaultFocusState=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.setSelectedIndex=function(t){if(this.validatedIndex(t),!this.adapter.isSelectableItemAtIndex(t))throw new Error("MDCMenuFoundation: No selection group at specified index.");var i=this.adapter.getSelectedSiblingOfItemAtIndex(t);i>=0&&(this.adapter.removeAttributeFromElementAtIndex(i,M.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(i,P.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,P.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,M.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=t},e.prototype.setEnabled=function(t,i){this.validatedIndex(t),i?(this.adapter.removeClassFromElementAtIndex(t,d.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,M.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,d.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,M.ARIA_DISABLED_ATTR,"true"))},e.prototype.validatedIndex=function(t){var i=this.adapter.getMenuItemCount(),s=t>=0&&t<i;if(!s)throw new Error("MDCMenuFoundation: No list item at specified index.")},e}(j);/**
|
156
152
|
* @license
|
157
153
|
* Copyright 2020 Google LLC
|
158
154
|
* SPDX-License-Identifier: Apache-2.0
|
159
|
-
*/class u extends
|
155
|
+
*/class u extends q.BaseElement{constructor(){super(...arguments),this.mdcFoundationClass=Z,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 e=this.listElement;return e?e.items:[]}get index(){const e=this.listElement;return e?e.index:-1}get selected(){const e=this.listElement;return e?e.selected:null}render(){return this.renderSurface()}renderSurface(){const e=this.getSurfaceClasses();return A.x`
|
160
156
|
<mwc-menu-surface
|
161
157
|
?hidden=${!this.open}
|
162
158
|
.anchor=${this.anchor}
|
@@ -170,7 +166,7 @@
|
|
170
166
|
.fullwidth=${this.fullwidth}
|
171
167
|
.menuCorner=${this.menuCorner}
|
172
168
|
?stayOpenOnBodyClick=${this.stayOpenOnBodyClick}
|
173
|
-
class=${
|
169
|
+
class=${H.o(e)}
|
174
170
|
@closed=${this.onClosed}
|
175
171
|
@opened=${this.onOpened}
|
176
172
|
@keydown=${this.onKeydown}>
|
@@ -181,10 +177,14 @@
|
|
181
177
|
.innerAriaLabel=${this.innerAriaLabel}
|
182
178
|
.innerRole=${this.innerRole}
|
183
179
|
.multi=${this.multi}
|
184
|
-
class=${
|
180
|
+
class=${H.o(t)}
|
185
181
|
.itemRoles=${e}
|
186
182
|
.wrapFocus=${this.wrapFocus}
|
187
183
|
.activatable=${this.activatable}
|
188
184
|
@action=${this.onAction}>
|
189
185
|
<slot></slot>
|
190
|
-
</mwc-list>`}renderListClasses(){return{"mdc-deprecated-list":!0}}createAdapter(){return{addClassToElementAtIndex:(e,t)=>{const i=this.listElement;if(!i)return;const
|
186
|
+
</mwc-list>`}renderListClasses(){return{"mdc-deprecated-list":!0}}createAdapter(){return{addClassToElementAtIndex:(e,t)=>{const i=this.listElement;if(!i)return;const s=i.items[e];s&&(t==="mdc-menu-item--selected"?this.forceGroupSelection&&!s.selected&&i.toggle(e,!0):s.classList.add(t))},removeClassFromElementAtIndex:(e,t)=>{const i=this.listElement;if(!i)return;const s=i.items[e];s&&(t==="mdc-menu-item--selected"?s.selected&&i.toggle(e,!1):s.classList.remove(t))},addAttributeToElementAtIndex:(e,t,i)=>{const s=this.listElement;if(!s)return;const r=s.items[e];r&&r.setAttribute(t,i)},removeAttributeFromElementAtIndex:(e,t)=>{const i=this.listElement;if(!i)return;const s=i.items[e];s&&s.removeAttribute(t)},getAttributeFromElementAtIndex:(e,t)=>{const i=this.listElement;if(!i)return null;const s=i.items[e];return s?s.getAttribute(t):null},elementContainsClass:(e,t)=>e.classList.contains(t),closeSurface:()=>{this.open=!1},getElementIndex:e=>{const t=this.listElement;return t?t.items.indexOf(e):-1},notifySelected:()=>{},getMenuItemCount:()=>{const e=this.listElement;return e?e.items.length:0},focusItemAtIndex:e=>{const t=this.listElement;if(!t)return;const i=t.items[e];i&&i.focus()},focusListRoot:()=>{this.listElement&&this.listElement.focus()},getSelectedSiblingOfItemAtIndex:e=>{const t=this.listElement;if(!t)return-1;const i=t.items[e];if(!i||!i.group)return-1;for(let s=0;s<t.items.length;s++){if(s===e)continue;const r=t.items[s];if(r.selected&&r.group===i.group)return s}return-1},isSelectableItemAtIndex:e=>{const t=this.listElement;if(!t)return!1;const i=t.items[e];return i?i.hasAttribute("group"):!1}}}onKeydown(e){this.mdcFoundation&&this.mdcFoundation.handleKeydown(e)}onAction(e){const t=this.listElement;if(this.mdcFoundation&&t){const i=e.detail.index,s=t.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 e=this.listElement;e&&(this._listUpdateComplete=e.updateComplete,await this._listUpdateComplete)}select(e){const t=this.listElement;t&&t.select(e)}close(){this.open=!1}show(){this.open=!0}getFocusedItemIndex(){const e=this.listElement;return e?e.getFocusedItemIndex():-1}focusItemAtIndex(e){const t=this.listElement;t&&t.focusItemAtIndex(e)}layout(e=!0){const t=this.listElement;t&&t.layout(e)}}o.__decorate([F.i(".mdc-menu")],u.prototype,"mdcRoot",void 0);o.__decorate([F.i("slot")],u.prototype,"slotElement",void 0);o.__decorate([a.n({type:Object})],u.prototype,"anchor",void 0);o.__decorate([a.n({type:Boolean,reflect:!0})],u.prototype,"open",void 0);o.__decorate([a.n({type:Boolean})],u.prototype,"quick",void 0);o.__decorate([a.n({type:Boolean})],u.prototype,"wrapFocus",void 0);o.__decorate([a.n({type:String})],u.prototype,"innerRole",void 0);o.__decorate([a.n({type:String})],u.prototype,"innerAriaLabel",void 0);o.__decorate([a.n({type:String})],u.prototype,"corner",void 0);o.__decorate([a.n({type:Number})],u.prototype,"x",void 0);o.__decorate([a.n({type:Number})],u.prototype,"y",void 0);o.__decorate([a.n({type:Boolean})],u.prototype,"absolute",void 0);o.__decorate([a.n({type:Boolean})],u.prototype,"multi",void 0);o.__decorate([a.n({type:Boolean})],u.prototype,"activatable",void 0);o.__decorate([a.n({type:Boolean})],u.prototype,"fixed",void 0);o.__decorate([a.n({type:Boolean})],u.prototype,"forceGroupSelection",void 0);o.__decorate([a.n({type:Boolean})],u.prototype,"fullwidth",void 0);o.__decorate([a.n({type:String})],u.prototype,"menuCorner",void 0);o.__decorate([a.n({type:Boolean})],u.prototype,"stayOpenOnBodyClick",void 0);o.__decorate([a.n({type:String}),E.observer(function(n){this.mdcFoundation&&this.mdcFoundation.setDefaultFocusState(C[n])})],u.prototype,"defaultFocus",void 0);/**
|
187
|
+
* @license
|
188
|
+
* Copyright 2021 Google LLC
|
189
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
190
|
+
*/const tt=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=u;exports.styles=tt;
|
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";const d=require("./tslib.es6-CHeFCc6E.js"),p=require("./ripple-handlers-CzfSBjWo.js"),_=require("./aria-property-Dl2ZKBbP.js"),f=require("./form-element-DwqUbs65.js"),b=require("./observer-N9cgkDqh.js"),n=require("./query-assigned-elements-4CafVNR8.js"),a=require("./property-DYTC_2-m.js"),s=require("./state-C3HoXfoa.js"),g=require("./event-options-BH8ks-kz.js"),h=require("./query-BxDs8ftQ.js"),v=require("./class-map-C8G1ALWK.js"),u=require("./if-defined-D8C6ewRn.js"),k=require("./utils-wMBJ9n_n.js");/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2020 Google LLC
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
5
|
+
*/const m=Symbol("selection controller");class y{constructor(){this.selected=null,this.ordered=null,this.set=new Set}}class l{constructor(e){this.sets={},this.focusedSet=null,this.mouseIsDown=!1,this.updating=!1,e.addEventListener("keydown",r=>{this.keyDownHandler(r)}),e.addEventListener("mousedown",()=>{this.mousedownHandler()}),e.addEventListener("mouseup",()=>{this.mouseupHandler()})}static getController(e){const o=!("global"in e)||"global"in e&&e.global?document:e.getRootNode();let c=o[m];return c===void 0&&(c=new l(o),o[m]=c),c}keyDownHandler(e){const r=e.target;"checked"in r&&this.has(r)&&(e.key=="ArrowRight"||e.key=="ArrowDown"?this.selectNext(r):(e.key=="ArrowLeft"||e.key=="ArrowUp")&&this.selectPrevious(r))}mousedownHandler(){this.mouseIsDown=!0}mouseupHandler(){this.mouseIsDown=!1}has(e){return this.getSet(e.name).set.has(e)}selectPrevious(e){const r=this.getOrdered(e),o=r.indexOf(e),c=r[o-1]||r[r.length-1];return this.select(c),c}selectNext(e){const r=this.getOrdered(e),o=r.indexOf(e),c=r[o+1]||r[0];return this.select(c),c}select(e){e.click()}focus(e){if(this.mouseIsDown)return;const r=this.getSet(e.name),o=this.focusedSet;this.focusedSet=r,o!=r&&r.selected&&r.selected!=e&&r.selected.focus()}isAnySelected(e){const r=this.getSet(e.name);for(const o of r.set)if(o.checked)return!0;return!1}getOrdered(e){const r=this.getSet(e.name);return r.ordered||(r.ordered=Array.from(r.set),r.ordered.sort((o,c)=>o.compareDocumentPosition(c)==Node.DOCUMENT_POSITION_PRECEDING?1:0)),r.ordered}getSet(e){return this.sets[e]||(this.sets[e]=new y),this.sets[e]}register(e){const r=e.name||e.getAttribute("name")||"",o=this.getSet(r);o.set.add(e),o.ordered=null}unregister(e){const r=this.getSet(e.name);r.set.delete(e),r.ordered=null,r.selected==e&&(r.selected=null)}update(e){if(this.updating)return;this.updating=!0;const r=this.getSet(e.name);if(e.checked){for(const o of r.set)o!=e&&(o.checked=!1);r.selected=e}if(this.isAnySelected(e))for(const o of r.set){if(o.formElementTabIndex===void 0)break;o.formElementTabIndex=o.checked?0:-1}this.updating=!1}}/**
|
6
|
+
* @license
|
7
|
+
* Copyright 2016 Google Inc.
|
8
|
+
*
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
+
* of this software and associated documentation files (the "Software"), to deal
|
11
|
+
* in the Software without restriction, including without limitation the rights
|
12
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
+
* copies of the Software, and to permit persons to whom the Software is
|
14
|
+
* furnished to do so, subject to the following conditions:
|
15
|
+
*
|
16
|
+
* The above copyright notice and this permission notice shall be included in
|
17
|
+
* all copies or substantial portions of the Software.
|
18
|
+
*
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
25
|
+
* THE SOFTWARE.
|
26
|
+
*/var x=function(){function i(e){e===void 0&&(e={}),this.adapter=e}return Object.defineProperty(i,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(i,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(i,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),i.prototype.init=function(){},i.prototype.destroy=function(){},i}();/**
|
27
|
+
* @license
|
28
|
+
* Copyright 2016 Google Inc.
|
29
|
+
*
|
30
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
31
|
+
* of this software and associated documentation files (the "Software"), to deal
|
32
|
+
* in the Software without restriction, including without limitation the rights
|
33
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
34
|
+
* copies of the Software, and to permit persons to whom the Software is
|
35
|
+
* furnished to do so, subject to the following conditions:
|
36
|
+
*
|
37
|
+
* The above copyright notice and this permission notice shall be included in
|
38
|
+
* all copies or substantial portions of the Software.
|
39
|
+
*
|
40
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
41
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
42
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
43
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
44
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
45
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
46
|
+
* THE SOFTWARE.
|
47
|
+
*/var w={NATIVE_CONTROL_SELECTOR:".mdc-radio__native-control"},R={DISABLED:"mdc-radio--disabled",ROOT:"mdc-radio"};/**
|
48
|
+
* @license
|
49
|
+
* Copyright 2016 Google Inc.
|
50
|
+
*
|
51
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
52
|
+
* of this software and associated documentation files (the "Software"), to deal
|
53
|
+
* in the Software without restriction, including without limitation the rights
|
54
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
55
|
+
* copies of the Software, and to permit persons to whom the Software is
|
56
|
+
* furnished to do so, subject to the following conditions:
|
57
|
+
*
|
58
|
+
* The above copyright notice and this permission notice shall be included in
|
59
|
+
* all copies or substantial portions of the Software.
|
60
|
+
*
|
61
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
62
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
63
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
64
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
65
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
66
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
67
|
+
* THE SOFTWARE.
|
68
|
+
*/var E=function(i){d.__extends(e,i);function e(r){return i.call(this,d.__assign(d.__assign({},e.defaultAdapter),r))||this}return Object.defineProperty(e,"cssClasses",{get:function(){return R},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return w},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlDisabled:function(){}}},enumerable:!1,configurable:!0}),e.prototype.setDisabled=function(r){var o=e.cssClasses.DISABLED;this.adapter.setNativeControlDisabled(r),r?this.adapter.addClass(o):this.adapter.removeClass(o)},e}(x);/**
|
69
|
+
* @license
|
70
|
+
* Copyright 2018 Google LLC
|
71
|
+
* SPDX-License-Identifier: Apache-2.0
|
72
|
+
*/class t extends f.FormElement{constructor(){super(...arguments),this._checked=!1,this.useStateLayerCustomProperties=!1,this.global=!1,this.disabled=!1,this.value="on",this.name="",this.reducedTouchTarget=!1,this.mdcFoundationClass=E,this.formElementTabIndex=0,this.focused=!1,this.shouldRenderRipple=!1,this.rippleElement=null,this.rippleHandlers=new p.RippleHandlers(()=>(this.shouldRenderRipple=!0,this.ripple.then(e=>{this.rippleElement=e}),this.ripple))}get checked(){return this._checked}set checked(e){var r,o;const c=this._checked;e!==c&&(this._checked=e,this.formElement&&(this.formElement.checked=e),(r=this._selectionController)===null||r===void 0||r.update(this),e===!1&&((o=this.formElement)===null||o===void 0||o.blur()),this.requestUpdate("checked",c),this.dispatchEvent(new Event("checked",{bubbles:!0,composed:!0})))}_handleUpdatedValue(e){this.formElement.value=e}renderRipple(){return this.shouldRenderRipple?n.x`<mwc-ripple unbounded accent
|
73
|
+
.internalUseStateLayerCustomProperties="${this.useStateLayerCustomProperties}"
|
74
|
+
.disabled="${this.disabled}"></mwc-ripple>`:""}get isRippleActive(){var e;return((e=this.rippleElement)===null||e===void 0?void 0:e.isActive)||!1}connectedCallback(){super.connectedCallback(),this._selectionController=l.getController(this),this._selectionController.register(this),this._selectionController.update(this)}disconnectedCallback(){this._selectionController.unregister(this),this._selectionController=void 0}focus(){this.formElement.focus()}createAdapter(){return Object.assign(Object.assign({},k.addHasRemoveClass(this.mdcRoot)),{setNativeControlDisabled:e=>{this.formElement.disabled=e}})}handleFocus(){this.focused=!0,this.handleRippleFocus()}handleClick(){this.formElement.focus()}handleBlur(){this.focused=!1,this.formElement.blur(),this.rippleHandlers.endFocus()}setFormData(e){this.name&&this.checked&&e.append(this.name,this.value)}render(){const e={"mdc-radio--touch":!this.reducedTouchTarget,"mdc-ripple-upgraded--background-focused":this.focused,"mdc-radio--disabled":this.disabled};return n.x`
|
75
|
+
<div class="mdc-radio ${v.o(e)}">
|
76
|
+
<input
|
77
|
+
tabindex="${this.formElementTabIndex}"
|
78
|
+
class="mdc-radio__native-control"
|
79
|
+
type="radio"
|
80
|
+
name="${this.name}"
|
81
|
+
aria-label="${u.l(this.ariaLabel)}"
|
82
|
+
aria-labelledby="${u.l(this.ariaLabelledBy)}"
|
83
|
+
.checked="${this.checked}"
|
84
|
+
.value="${this.value}"
|
85
|
+
?disabled="${this.disabled}"
|
86
|
+
@change="${this.changeHandler}"
|
87
|
+
@focus="${this.handleFocus}"
|
88
|
+
@click="${this.handleClick}"
|
89
|
+
@blur="${this.handleBlur}"
|
90
|
+
@mousedown="${this.handleRippleMouseDown}"
|
91
|
+
@mouseenter="${this.handleRippleMouseEnter}"
|
92
|
+
@mouseleave="${this.handleRippleMouseLeave}"
|
93
|
+
@touchstart="${this.handleRippleTouchStart}"
|
94
|
+
@touchend="${this.handleRippleDeactivate}"
|
95
|
+
@touchcancel="${this.handleRippleDeactivate}">
|
96
|
+
<div class="mdc-radio__background">
|
97
|
+
<div class="mdc-radio__outer-circle"></div>
|
98
|
+
<div class="mdc-radio__inner-circle"></div>
|
99
|
+
</div>
|
100
|
+
${this.renderRipple()}
|
101
|
+
</div>`}handleRippleMouseDown(e){const r=()=>{window.removeEventListener("mouseup",r),this.handleRippleDeactivate()};window.addEventListener("mouseup",r),this.rippleHandlers.startPress(e)}handleRippleTouchStart(e){this.rippleHandlers.startPress(e)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}changeHandler(){this.checked=this.formElement.checked}}d.__decorate([h.i(".mdc-radio")],t.prototype,"mdcRoot",void 0);d.__decorate([h.i("input")],t.prototype,"formElement",void 0);d.__decorate([s.t()],t.prototype,"useStateLayerCustomProperties",void 0);d.__decorate([a.n({type:Boolean})],t.prototype,"global",void 0);d.__decorate([a.n({type:Boolean,reflect:!0})],t.prototype,"checked",null);d.__decorate([a.n({type:Boolean}),b.observer(function(i){this.mdcFoundation.setDisabled(i)})],t.prototype,"disabled",void 0);d.__decorate([a.n({type:String}),b.observer(function(i){this._handleUpdatedValue(i)})],t.prototype,"value",void 0);d.__decorate([a.n({type:String})],t.prototype,"name",void 0);d.__decorate([a.n({type:Boolean})],t.prototype,"reducedTouchTarget",void 0);d.__decorate([a.n({type:Number})],t.prototype,"formElementTabIndex",void 0);d.__decorate([s.t()],t.prototype,"focused",void 0);d.__decorate([s.t()],t.prototype,"shouldRenderRipple",void 0);d.__decorate([p.e("mwc-ripple")],t.prototype,"ripple",void 0);d.__decorate([_.ariaProperty,a.n({attribute:"aria-label"})],t.prototype,"ariaLabel",void 0);d.__decorate([_.ariaProperty,a.n({attribute:"aria-labelledby"})],t.prototype,"ariaLabelledBy",void 0);d.__decorate([g.e({passive:!0})],t.prototype,"handleRippleTouchStart",null);/**
|
102
|
+
* @license
|
103
|
+
* Copyright 2021 Google LLC
|
104
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
105
|
+
*/const C=n.i`.mdc-touch-target-wrapper{display:inline}.mdc-radio{padding:calc((40px - 20px) / 2)}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.54)}.mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:#018786;border-color:var(--mdc-theme-secondary, #018786)}.mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:#018786;border-color:var(--mdc-theme-secondary, #018786)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:rgba(0, 0, 0, 0.38)}.mdc-radio .mdc-radio__background::before{background-color:#018786;background-color:var(--mdc-theme-secondary, #018786)}.mdc-radio .mdc-radio__background::before{top:calc(-1 * (40px - 20px) / 2);left:calc(-1 * (40px - 20px) / 2);width:40px;height:40px}.mdc-radio .mdc-radio__native-control{top:calc((40px - 40px) / 2);right:calc((40px - 40px) / 2);left:calc((40px - 40px) / 2);width:40px;height:40px}@media screen and (forced-colors: active),(-ms-high-contrast: active){.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:GrayText}.mdc-radio.mdc-radio--disabled [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio.mdc-radio--disabled .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:GrayText}}.mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:"";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid transparent;border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:"";border:2px solid transparent;border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}:host{display:inline-block;outline:none}.mdc-radio{vertical-align:bottom}.mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unchecked-color, rgba(0, 0, 0, 0.54))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}.mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-color, rgba(0, 0, 0, 0.38))}`;exports.RadioBase=t;exports.styles=C;
|