@limetech/lime-elements 37.68.0 → 37.69.0
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/CHANGELOG.md +8 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-action-bar-item_2.cjs.entry.js +122 -0
- package/dist/cjs/limel-action-bar-item_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{limel-action-bar_4.cjs.entry.js → limel-action-bar_2.cjs.entry.js} +1 -115
- package/dist/cjs/limel-action-bar_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{limel-breadcrumbs_5.cjs.entry.js → limel-breadcrumbs_7.cjs.entry.js} +3344 -407
- package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-card.cjs.entry.js +85 -0
- package/dist/cjs/limel-card.cjs.entry.js.map +1 -0
- package/dist/cjs/limel-dynamic-label_2.cjs.entry.js +91 -0
- package/dist/cjs/limel-dynamic-label_2.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/card/card.css +202 -0
- package/dist/collection/components/card/card.js +282 -0
- package/dist/collection/components/card/card.js.map +1 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-action-bar-item_2.entry.js +117 -0
- package/dist/esm/limel-action-bar-item_2.entry.js.map +1 -0
- package/dist/esm/{limel-action-bar_4.entry.js → limel-action-bar_2.entry.js} +2 -114
- package/dist/esm/limel-action-bar_2.entry.js.map +1 -0
- package/dist/esm/{limel-breadcrumbs_5.entry.js → limel-breadcrumbs_7.entry.js} +3333 -398
- package/dist/esm/limel-breadcrumbs_7.entry.js.map +1 -0
- package/dist/esm/limel-card.entry.js +81 -0
- package/dist/esm/limel-card.entry.js.map +1 -0
- package/dist/esm/limel-dynamic-label_2.entry.js +86 -0
- package/dist/esm/limel-dynamic-label_2.entry.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js.map +1 -1
- package/dist/lime-elements/p-18b068c9.entry.js +2 -0
- package/dist/lime-elements/p-18b068c9.entry.js.map +1 -0
- package/dist/lime-elements/p-7f9e0f52.entry.js +2 -0
- package/dist/lime-elements/p-7f9e0f52.entry.js.map +1 -0
- package/dist/lime-elements/p-97ae94e0.entry.js +266 -0
- package/dist/lime-elements/p-97ae94e0.entry.js.map +1 -0
- package/dist/lime-elements/p-9f8aa8e7.entry.js +2 -0
- package/dist/lime-elements/p-9f8aa8e7.entry.js.map +1 -0
- package/dist/lime-elements/p-a8e24972.entry.js +2 -0
- package/dist/lime-elements/p-a8e24972.entry.js.map +1 -0
- package/dist/types/components/card/card.d.ts +75 -0
- package/dist/types/components.d.ts +143 -4
- package/package.json +1 -1
- package/dist/cjs/component-864afce0.js +0 -2447
- package/dist/cjs/component-864afce0.js.map +0 -1
- package/dist/cjs/limel-action-bar_4.cjs.entry.js.map +0 -1
- package/dist/cjs/limel-breadcrumbs_5.cjs.entry.js.map +0 -1
- package/dist/cjs/limel-dynamic-label_4.cjs.entry.js +0 -600
- package/dist/cjs/limel-dynamic-label_4.cjs.entry.js.map +0 -1
- package/dist/esm/component-5e233629.js +0 -2439
- package/dist/esm/component-5e233629.js.map +0 -1
- package/dist/esm/limel-action-bar_4.entry.js.map +0 -1
- package/dist/esm/limel-breadcrumbs_5.entry.js.map +0 -1
- package/dist/esm/limel-dynamic-label_4.entry.js +0 -593
- package/dist/esm/limel-dynamic-label_4.entry.js.map +0 -1
- package/dist/lime-elements/p-589ba37a.entry.js +0 -2
- package/dist/lime-elements/p-589ba37a.entry.js.map +0 -1
- package/dist/lime-elements/p-b9b0853b.entry.js +0 -68
- package/dist/lime-elements/p-b9b0853b.entry.js.map +0 -1
- package/dist/lime-elements/p-bd261424.entry.js +0 -2
- package/dist/lime-elements/p-bd261424.entry.js.map +0 -1
- package/dist/lime-elements/p-d528606a.js +0 -200
- package/dist/lime-elements/p-d528606a.js.map +0 -1
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import{_ as t,a as i,M as n,m as e,d as r,b as s,c as u}from"./p-9f722992.js";import{g as o}from"./p-9faad6eb.js";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2018 Google Inc.
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in
|
|
14
|
-
* all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
-
* THE SOFTWARE.
|
|
23
|
-
*/var f={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"};var a={CLOSED_EVENT:"MDCMenuSurface:closed",CLOSING_EVENT:"MDCMenuSurface:closing",OPENED_EVENT:"MDCMenuSurface:opened",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(", ")};var h={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67,TOUCH_EVENT_WAIT_MS:30};var c;(function(t){t[t["BOTTOM"]=1]="BOTTOM";t[t["CENTER"]=2]="CENTER";t[t["RIGHT"]=4]="RIGHT";t[t["FLIP_RTL"]=8]="FLIP_RTL"})(c||(c={}));var d;(function(t){t[t["TOP_LEFT"]=0]="TOP_LEFT";t[t["TOP_RIGHT"]=4]="TOP_RIGHT";t[t["BOTTOM_LEFT"]=1]="BOTTOM_LEFT";t[t["BOTTOM_RIGHT"]=5]="BOTTOM_RIGHT";t[t["TOP_START"]=8]="TOP_START";t[t["TOP_END"]=12]="TOP_END";t[t["BOTTOM_START"]=9]="BOTTOM_START";t[t["BOTTOM_END"]=13]="BOTTOM_END"})(d||(d={}));
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2018 Google Inc.
|
|
27
|
-
*
|
|
28
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
30
|
-
* in the Software without restriction, including without limitation the rights
|
|
31
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
33
|
-
* furnished to do so, subject to the following conditions:
|
|
34
|
-
*
|
|
35
|
-
* The above copyright notice and this permission notice shall be included in
|
|
36
|
-
* all copies or substantial portions of the Software.
|
|
37
|
-
*
|
|
38
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
44
|
-
* THE SOFTWARE.
|
|
45
|
-
*/var l,v;var m={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"};var E=(l={},l[""+m.LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",l[""+m.LIST_ITEM_CLASS]="mdc-list-item",l[""+m.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",l[""+m.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",l[""+m.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",l[""+m.ROOT]="mdc-list",l);var A=(v={},v[""+m.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",v[""+m.LIST_ITEM_CLASS]="mdc-deprecated-list-item",v[""+m.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",v[""+m.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",v[""+m.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",v[""+m.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",v[""+m.ROOT]="mdc-deprecated-list",v);var I={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",ARIA_INTERACTIVE_ROLES_SELECTOR:'[role="listbox"], [role="menu"]',ARIA_MULTI_SELECTABLE_SELECTOR:'[aria-multiselectable="true"]',CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+m.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+m.LIST_ITEM_CLASS+" a,\n ."+A[m.LIST_ITEM_CLASS]+" button:not(:disabled),\n ."+A[m.LIST_ITEM_CLASS]+" a\n ",DEPRECATED_SELECTOR:".mdc-deprecated-list",FOCUSABLE_CHILD_ELEMENTS:"\n ."+m.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+m.LIST_ITEM_CLASS+" a,\n ."+m.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+m.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled),\n .'+A[m.LIST_ITEM_CLASS]+" button:not(:disabled),\n ."+A[m.LIST_ITEM_CLASS]+" a,\n ."+A[m.LIST_ITEM_CLASS]+' input[type="radio"]:not(:disabled),\n .'+A[m.LIST_ITEM_CLASS]+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'};var b={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300};var T="evolution";
|
|
46
|
-
/**
|
|
47
|
-
* @license
|
|
48
|
-
* Copyright 2020 Google Inc.
|
|
49
|
-
*
|
|
50
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
51
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
52
|
-
* in the Software without restriction, including without limitation the rights
|
|
53
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
54
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
55
|
-
* furnished to do so, subject to the following conditions:
|
|
56
|
-
*
|
|
57
|
-
* The above copyright notice and this permission notice shall be included in
|
|
58
|
-
* all copies or substantial portions of the Software.
|
|
59
|
-
*
|
|
60
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
61
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
62
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
63
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
64
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
65
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
66
|
-
* THE SOFTWARE.
|
|
67
|
-
*/var C={UNKNOWN:"Unknown",BACKSPACE:"Backspace",ENTER:"Enter",SPACEBAR:"Spacebar",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",END:"End",HOME:"Home",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",DELETE:"Delete",ESCAPE:"Escape",TAB:"Tab"};var _=new Set;_.add(C.BACKSPACE);_.add(C.ENTER);_.add(C.SPACEBAR);_.add(C.PAGE_UP);_.add(C.PAGE_DOWN);_.add(C.END);_.add(C.HOME);_.add(C.ARROW_LEFT);_.add(C.ARROW_UP);_.add(C.ARROW_RIGHT);_.add(C.ARROW_DOWN);_.add(C.DELETE);_.add(C.ESCAPE);_.add(C.TAB);var O={BACKSPACE:8,ENTER:13,SPACEBAR:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,DELETE:46,ESCAPE:27,TAB:9};var x=new Map;x.set(O.BACKSPACE,C.BACKSPACE);x.set(O.ENTER,C.ENTER);x.set(O.SPACEBAR,C.SPACEBAR);x.set(O.PAGE_UP,C.PAGE_UP);x.set(O.PAGE_DOWN,C.PAGE_DOWN);x.set(O.END,C.END);x.set(O.HOME,C.HOME);x.set(O.ARROW_LEFT,C.ARROW_LEFT);x.set(O.ARROW_UP,C.ARROW_UP);x.set(O.ARROW_RIGHT,C.ARROW_RIGHT);x.set(O.ARROW_DOWN,C.ARROW_DOWN);x.set(O.DELETE,C.DELETE);x.set(O.ESCAPE,C.ESCAPE);x.set(O.TAB,C.TAB);var R=new Set;R.add(C.PAGE_UP);R.add(C.PAGE_DOWN);R.add(C.END);R.add(C.HOME);R.add(C.ARROW_LEFT);R.add(C.ARROW_UP);R.add(C.ARROW_RIGHT);R.add(C.ARROW_DOWN);function p(t){var i=t.key;if(_.has(i)){return i}var n=x.get(t.keyCode);if(n){return n}return C.UNKNOWN}
|
|
68
|
-
/**
|
|
69
|
-
* @license
|
|
70
|
-
* Copyright 2020 Google Inc.
|
|
71
|
-
*
|
|
72
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
73
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
74
|
-
* in the Software without restriction, including without limitation the rights
|
|
75
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
76
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
77
|
-
* furnished to do so, subject to the following conditions:
|
|
78
|
-
*
|
|
79
|
-
* The above copyright notice and this permission notice shall be included in
|
|
80
|
-
* all copies or substantial portions of the Software.
|
|
81
|
-
*
|
|
82
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
83
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
84
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
85
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
86
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
87
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
88
|
-
* THE SOFTWARE.
|
|
89
|
-
*/var g=["input","button","textarea","select"];var S=function(t){var i=t.target;if(!i){return}var n=(""+i.tagName).toLowerCase();if(g.indexOf(n)===-1){t.preventDefault()}};
|
|
90
|
-
/**
|
|
91
|
-
* @license
|
|
92
|
-
* Copyright 2020 Google Inc.
|
|
93
|
-
*
|
|
94
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
95
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
96
|
-
* in the Software without restriction, including without limitation the rights
|
|
97
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
98
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
99
|
-
* furnished to do so, subject to the following conditions:
|
|
100
|
-
*
|
|
101
|
-
* The above copyright notice and this permission notice shall be included in
|
|
102
|
-
* all copies or substantial portions of the Software.
|
|
103
|
-
*
|
|
104
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
110
|
-
* THE SOFTWARE.
|
|
111
|
-
*/function L(){var t={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""};return t}function w(t,i){var n=new Map;for(var e=0;e<t;e++){var r=i(e).trim();if(!r){continue}var s=r[0].toLowerCase();if(!n.has(s)){n.set(s,[])}n.get(s).push({text:r.toLowerCase(),index:e})}n.forEach((function(t){t.sort((function(t,i){return t.index-i.index}))}));return n}function D(t,i){var n=t.nextChar,e=t.focusItemAtIndex,r=t.sortedIndexByFirstChar,s=t.focusedItemIndex,u=t.skipFocus,o=t.isItemAtIndexDisabled;clearTimeout(i.bufferClearTimeout);i.bufferClearTimeout=setTimeout((function(){M(i)}),b.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS);i.typeaheadBuffer=i.typeaheadBuffer+n;var f;if(i.typeaheadBuffer.length===1){f=y(r,s,o,i)}else{f=N(r,o,i)}if(f!==-1&&!u){e(f)}return f}function y(t,i,n,e){var r=e.typeaheadBuffer[0];var s=t.get(r);if(!s){return-1}if(r===e.currentFirstChar&&s[e.sortedIndexCursor].index===i){e.sortedIndexCursor=(e.sortedIndexCursor+1)%s.length;var u=s[e.sortedIndexCursor].index;if(!n(u)){return u}}e.currentFirstChar=r;var o=-1;var f;for(f=0;f<s.length;f++){if(!n(s[f].index)){o=f;break}}for(;f<s.length;f++){if(s[f].index>i&&!n(s[f].index)){o=f;break}}if(o!==-1){e.sortedIndexCursor=o;return s[e.sortedIndexCursor].index}return-1}function N(t,i,n){var e=n.typeaheadBuffer[0];var r=t.get(e);if(!r){return-1}var s=r[n.sortedIndexCursor];if(s.text.lastIndexOf(n.typeaheadBuffer,0)===0&&!i(s.index)){return s.index}var u=(n.sortedIndexCursor+1)%r.length;var o=-1;while(u!==n.sortedIndexCursor){var f=r[u];var a=f.text.lastIndexOf(n.typeaheadBuffer,0)===0;var h=!i(f.index);if(a&&h){o=u;break}u=(u+1)%r.length}if(o!==-1){n.sortedIndexCursor=o;return r[n.sortedIndexCursor].index}return-1}function F(t){return t.typeaheadBuffer.length>0}function M(t){t.typeaheadBuffer=""}function k(t,i){var n=t.event,e=t.isTargetListItem,r=t.focusedItemIndex,s=t.focusItemAtIndex,u=t.sortedIndexByFirstChar,o=t.isItemAtIndexDisabled;var f=p(n)==="ArrowLeft";var a=p(n)==="ArrowUp";var h=p(n)==="ArrowRight";var c=p(n)==="ArrowDown";var d=p(n)==="Home";var l=p(n)==="End";var v=p(n)==="Enter";var m=p(n)==="Spacebar";if(n.ctrlKey||n.metaKey||f||a||h||c||d||l||v){return-1}var E=!m&&n.key.length===1;if(E){S(n);var A={focusItemAtIndex:s,focusedItemIndex:r,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:u,skipFocus:false,isItemAtIndexDisabled:o};return D(A,i)}if(!m){return-1}if(e){S(n)}var I=e&&F(i);if(I){var A={focusItemAtIndex:s,focusedItemIndex:r,nextChar:" ",sortedIndexByFirstChar:u,skipFocus:false,isItemAtIndexDisabled:o};return D(A,i)}return-1}
|
|
112
|
-
/**
|
|
113
|
-
* @license
|
|
114
|
-
* Copyright 2018 Google Inc.
|
|
115
|
-
*
|
|
116
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
117
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
118
|
-
* in the Software without restriction, including without limitation the rights
|
|
119
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
120
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
121
|
-
* furnished to do so, subject to the following conditions:
|
|
122
|
-
*
|
|
123
|
-
* The above copyright notice and this permission notice shall be included in
|
|
124
|
-
* all copies or substantial portions of the Software.
|
|
125
|
-
*
|
|
126
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
127
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
128
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
129
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
130
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
131
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
132
|
-
* THE SOFTWARE.
|
|
133
|
-
*/function P(t){return t instanceof Array}var B=function(n){t(e,n);function e(t){var r=n.call(this,i(i({},e.defaultAdapter),t))||this;r.wrapFocus=false;r.isVertical=true;r.isSingleSelectionList=false;r.selectedIndex=b.UNSET_INDEX;r.focusedItemIndex=b.UNSET_INDEX;r.useActivatedClass=false;r.useSelectedAttr=false;r.ariaCurrentAttrValue=null;r.isCheckboxList=false;r.isRadioList=false;r.hasTypeahead=false;r.typeaheadState=L();r.sortedIndexByFirstChar=new Map;return r}Object.defineProperty(e,"strings",{get:function(){return I},enumerable:false,configurable:true});Object.defineProperty(e,"cssClasses",{get:function(){return m},enumerable:false,configurable:true});Object.defineProperty(e,"numbers",{get:function(){return b},enumerable:false,configurable:true});Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){return undefined},focusItemAtIndex:function(){return undefined},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return false},hasRadioAtIndex:function(){return false},isCheckboxCheckedAtIndex:function(){return false},isFocusInsideList:function(){return false},isRootFocused:function(){return false},listItemAtIndexHasClass:function(){return false},notifyAction:function(){return undefined},removeClassForElementIndex:function(){return undefined},setAttributeForElementIndex:function(){return undefined},setCheckedCheckboxOrRadioAtIndex:function(){return undefined},setTabIndexForListItemChildren:function(){return undefined},getPrimaryTextAtIndex:function(){return""}}},enumerable:false,configurable:true});e.prototype.layout=function(){if(this.adapter.getListItemCount()===0){return}if(this.adapter.hasCheckboxAtIndex(0)){this.isCheckboxList=true}else if(this.adapter.hasRadioAtIndex(0)){this.isRadioList=true}else{this.maybeInitializeSingleSelection()}if(this.hasTypeahead){this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()}};e.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex};e.prototype.setWrapFocus=function(t){this.wrapFocus=t};e.prototype.setVerticalOrientation=function(t){this.isVertical=t};e.prototype.setSingleSelection=function(t){this.isSingleSelectionList=t;if(t){this.maybeInitializeSingleSelection();this.selectedIndex=this.getSelectedIndexFromDOM()}};e.prototype.maybeInitializeSingleSelection=function(){var t=this.getSelectedIndexFromDOM();if(t===b.UNSET_INDEX)return;var i=this.adapter.listItemAtIndexHasClass(t,m.LIST_ITEM_ACTIVATED_CLASS);if(i){this.setUseActivatedClass(true)}this.isSingleSelectionList=true;this.selectedIndex=t};e.prototype.getSelectedIndexFromDOM=function(){var t=b.UNSET_INDEX;var i=this.adapter.getListItemCount();for(var n=0;n<i;n++){var e=this.adapter.listItemAtIndexHasClass(n,m.LIST_ITEM_SELECTED_CLASS);var r=this.adapter.listItemAtIndexHasClass(n,m.LIST_ITEM_ACTIVATED_CLASS);if(!(e||r)){continue}t=n;break}return t};e.prototype.setHasTypeahead=function(t){this.hasTypeahead=t;if(t){this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()}};e.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&F(this.typeaheadState)};e.prototype.setUseActivatedClass=function(t){this.useActivatedClass=t};e.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr=t};e.prototype.getSelectedIndex=function(){return this.selectedIndex};e.prototype.setSelectedIndex=function(t,i){var n=i===void 0?{}:i,e=n.forceUpdate;if(!this.isIndexValid(t)){return}if(this.isCheckboxList){this.setCheckboxAtIndex(t)}else if(this.isRadioList){this.setRadioAtIndex(t)}else{this.setSingleSelectionAtIndex(t,{forceUpdate:e})}};e.prototype.handleFocusIn=function(t){if(t>=0){this.focusedItemIndex=t;this.adapter.setAttributeForElementIndex(t,"tabindex","0");this.adapter.setTabIndexForListItemChildren(t,"0")}};e.prototype.handleFocusOut=function(t){var i=this;if(t>=0){this.adapter.setAttributeForElementIndex(t,"tabindex","-1");this.adapter.setTabIndexForListItemChildren(t,"-1")}setTimeout((function(){if(!i.adapter.isFocusInsideList()){i.setTabindexToFirstSelectedOrFocusedItem()}}),0)};e.prototype.handleKeydown=function(t,i,n){var e=this;var r=p(t)==="ArrowLeft";var s=p(t)==="ArrowUp";var u=p(t)==="ArrowRight";var o=p(t)==="ArrowDown";var f=p(t)==="Home";var a=p(t)==="End";var h=p(t)==="Enter";var c=p(t)==="Spacebar";var d=t.key==="A"||t.key==="a";if(this.adapter.isRootFocused()){if(s||a){t.preventDefault();this.focusLastElement()}else if(o||f){t.preventDefault();this.focusFirstElement()}if(this.hasTypeahead){var l={event:t,focusItemAtIndex:function(t){e.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:i,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return e.adapter.listItemAtIndexHasClass(t,m.LIST_ITEM_DISABLED_CLASS)}};k(l,this.typeaheadState)}return}var v=this.adapter.getFocusedElementIndex();if(v===-1){v=n;if(v<0){return}}if(this.isVertical&&o||!this.isVertical&&u){S(t);this.focusNextElement(v)}else if(this.isVertical&&s||!this.isVertical&&r){S(t);this.focusPrevElement(v)}else if(f){S(t);this.focusFirstElement()}else if(a){S(t);this.focusLastElement()}else if(d&&t.ctrlKey&&this.isCheckboxList){t.preventDefault();this.toggleAll(this.selectedIndex===b.UNSET_INDEX?[]:this.selectedIndex)}else if(h||c){if(i){var E=t.target;if(E&&E.tagName==="A"&&h){return}S(t);if(this.adapter.listItemAtIndexHasClass(v,m.LIST_ITEM_DISABLED_CLASS)){return}if(!this.isTypeaheadInProgress()){if(this.isSelectableList()){this.setSelectedIndexOnAction(v)}this.adapter.notifyAction(v)}}}if(this.hasTypeahead){var l={event:t,focusItemAtIndex:function(t){e.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:i,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return e.adapter.listItemAtIndexHasClass(t,m.LIST_ITEM_DISABLED_CLASS)}};k(l,this.typeaheadState)}};e.prototype.handleClick=function(t,i){if(t===b.UNSET_INDEX){return}if(this.adapter.listItemAtIndexHasClass(t,m.LIST_ITEM_DISABLED_CLASS)){return}if(this.isSelectableList()){this.setSelectedIndexOnAction(t,i)}this.adapter.notifyAction(t)};e.prototype.focusNextElement=function(t){var i=this.adapter.getListItemCount();var n=t+1;if(n>=i){if(this.wrapFocus){n=0}else{return t}}this.focusItemAtIndex(n);return n};e.prototype.focusPrevElement=function(t){var i=t-1;if(i<0){if(this.wrapFocus){i=this.adapter.getListItemCount()-1}else{return t}}this.focusItemAtIndex(i);return i};e.prototype.focusFirstElement=function(){this.focusItemAtIndex(0);return 0};e.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;this.focusItemAtIndex(t);return t};e.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.focusItemAtIndex(t);return t};e.prototype.setEnabled=function(t,i){if(!this.isIndexValid(t)){return}if(i){this.adapter.removeClassForElementIndex(t,m.LIST_ITEM_DISABLED_CLASS);this.adapter.setAttributeForElementIndex(t,I.ARIA_DISABLED,"false")}else{this.adapter.addClassForElementIndex(t,m.LIST_ITEM_DISABLED_CLASS);this.adapter.setAttributeForElementIndex(t,I.ARIA_DISABLED,"true")}};e.prototype.setSingleSelectionAtIndex=function(t,i){var n=i===void 0?{}:i,e=n.forceUpdate;if(this.selectedIndex===t&&!e){return}var r=m.LIST_ITEM_SELECTED_CLASS;if(this.useActivatedClass){r=m.LIST_ITEM_ACTIVATED_CLASS}if(this.selectedIndex!==b.UNSET_INDEX){this.adapter.removeClassForElementIndex(this.selectedIndex,r)}this.setAriaForSingleSelectionAtIndex(t);this.setTabindexAtIndex(t);if(t!==b.UNSET_INDEX){this.adapter.addClassForElementIndex(t,r)}this.selectedIndex=t};e.prototype.setAriaForSingleSelectionAtIndex=function(t){if(this.selectedIndex===b.UNSET_INDEX){this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(t,I.ARIA_CURRENT)}var i=this.ariaCurrentAttrValue!==null;var n=i?I.ARIA_CURRENT:I.ARIA_SELECTED;if(this.selectedIndex!==b.UNSET_INDEX){this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false")}if(t!==b.UNSET_INDEX){var e=i?this.ariaCurrentAttrValue:"true";this.adapter.setAttributeForElementIndex(t,n,e)}};e.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?I.ARIA_SELECTED:I.ARIA_CHECKED};e.prototype.setRadioAtIndex=function(t){var i=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,true);if(this.selectedIndex!==b.UNSET_INDEX){this.adapter.setAttributeForElementIndex(this.selectedIndex,i,"false")}this.adapter.setAttributeForElementIndex(t,i,"true");this.selectedIndex=t};e.prototype.setCheckboxAtIndex=function(t){var i=this.getSelectionAttribute();for(var n=0;n<this.adapter.getListItemCount();n++){var e=false;if(t.indexOf(n)>=0){e=true}this.adapter.setCheckedCheckboxOrRadioAtIndex(n,e);this.adapter.setAttributeForElementIndex(n,i,e?"true":"false")}this.selectedIndex=t};e.prototype.setTabindexAtIndex=function(t){if(this.focusedItemIndex===b.UNSET_INDEX&&t!==0){this.adapter.setAttributeForElementIndex(0,"tabindex","-1")}else if(this.focusedItemIndex>=0&&this.focusedItemIndex!==t){this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1")}if(!(this.selectedIndex instanceof Array)&&this.selectedIndex!==t){this.adapter.setAttributeForElementIndex(this.selectedIndex,"tabindex","-1")}if(t!==b.UNSET_INDEX){this.adapter.setAttributeForElementIndex(t,"tabindex","0")}};e.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList};e.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)};e.prototype.getFirstSelectedOrFocusedItemIndex=function(){if(!this.isSelectableList()){return Math.max(this.focusedItemIndex,0)}if(typeof this.selectedIndex==="number"&&this.selectedIndex!==b.UNSET_INDEX){return this.selectedIndex}if(P(this.selectedIndex)&&this.selectedIndex.length>0){return this.selectedIndex.reduce((function(t,i){return Math.min(t,i)}))}return 0};e.prototype.isIndexValid=function(t){var i=this;if(t instanceof Array){if(!this.isCheckboxList){throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list")}if(t.length===0){return true}else{return t.some((function(t){return i.isIndexInRange(t)}))}}else if(typeof t==="number"){if(this.isCheckboxList){throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t)}return this.isIndexInRange(t)||this.isSingleSelectionList&&t===b.UNSET_INDEX}else{return false}};e.prototype.isIndexInRange=function(t){var i=this.adapter.getListItemCount();return t>=0&&t<i};e.prototype.setSelectedIndexOnAction=function(t,i){if(i===void 0){i=true}if(this.isCheckboxList){this.toggleCheckboxAtIndex(t,i)}else{this.setSelectedIndex(t)}};e.prototype.toggleCheckboxAtIndex=function(t,i){var n=this.getSelectionAttribute();var e=this.adapter.isCheckboxCheckedAtIndex(t);if(i){e=!e;this.adapter.setCheckedCheckboxOrRadioAtIndex(t,e)}this.adapter.setAttributeForElementIndex(t,n,e?"true":"false");var r=this.selectedIndex===b.UNSET_INDEX?[]:this.selectedIndex.slice();if(e){r.push(t)}else{r=r.filter((function(i){return i!==t}))}this.selectedIndex=r};e.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t);this.focusedItemIndex=t};e.prototype.toggleAll=function(t){var i=this.adapter.getListItemCount();if(t.length===i){this.setCheckboxAtIndex([])}else{var n=[];for(var e=0;e<i;e++){if(!this.adapter.listItemAtIndexHasClass(e,m.LIST_ITEM_DISABLED_CLASS)||t.indexOf(e)>-1){n.push(e)}}this.setCheckboxAtIndex(n)}};e.prototype.typeaheadMatchItem=function(t,i,n){var e=this;if(n===void 0){n=false}var r={focusItemAtIndex:function(t){e.focusItemAtIndex(t)},focusedItemIndex:i?i:this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(t){return e.adapter.listItemAtIndexHasClass(t,m.LIST_ITEM_DISABLED_CLASS)}};return D(r,this.typeaheadState)};e.prototype.typeaheadInitSortedIndex=function(){return w(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)};e.prototype.clearTypeaheadBuffer=function(){M(this.typeaheadState)};return e}(n);
|
|
134
|
-
/**
|
|
135
|
-
* @license
|
|
136
|
-
* Copyright 2018 Google Inc.
|
|
137
|
-
*
|
|
138
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
139
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
140
|
-
* in the Software without restriction, including without limitation the rights
|
|
141
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
142
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
143
|
-
* furnished to do so, subject to the following conditions:
|
|
144
|
-
*
|
|
145
|
-
* The above copyright notice and this permission notice shall be included in
|
|
146
|
-
* all copies or substantial portions of the Software.
|
|
147
|
-
*
|
|
148
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
149
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
150
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
151
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
152
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
153
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
154
|
-
* THE SOFTWARE.
|
|
155
|
-
*/var H=function(i){t(n,i);function n(){return i!==null&&i.apply(this,arguments)||this}Object.defineProperty(n.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[m.LIST_ITEM_CLASS]))},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:false,configurable:true});n.attachTo=function(t){return new n(t)};n.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled=T in this.root.dataset;if(this.isEvolutionEnabled){this.classNameMap=E}else if(e(this.root,I.DEPRECATED_SELECTOR)){this.classNameMap=A}else{this.classNameMap=Object.values(m).reduce((function(t,i){t[i]=i;return t}),{})}this.handleClick=this.handleClickEvent.bind(this);this.handleKeydown=this.handleKeydownEvent.bind(this);this.focusInEventListener=this.handleFocusInEvent.bind(this);this.focusOutEventListener=this.handleFocusOutEvent.bind(this);this.listen("keydown",this.handleKeydown);this.listen("click",this.handleClick);this.listen("focusin",this.focusInEventListener);this.listen("focusout",this.focusOutEventListener);this.layout();this.initializeListType();this.ensureFocusable()};n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown);this.unlisten("click",this.handleClick);this.unlisten("focusin",this.focusInEventListener);this.unlisten("focusout",this.focusOutEventListener)};n.prototype.layout=function(){var t=this.root.getAttribute(I.ARIA_ORIENTATION);this.vertical=t!==I.ARIA_ORIENTATION_HORIZONTAL;var i="."+this.classNameMap[m.LIST_ITEM_CLASS]+":not([tabindex])";var n=I.FOCUSABLE_CHILD_ELEMENTS;var e=this.root.querySelectorAll(i);if(e.length){Array.prototype.forEach.call(e,(function(t){t.setAttribute("tabindex","-1")}))}var r=this.root.querySelectorAll(n);if(r.length){Array.prototype.forEach.call(r,(function(t){t.setAttribute("tabindex","-1")}))}if(this.isEvolutionEnabled){this.foundation.setUseSelectedAttribute(true)}this.foundation.layout()};n.prototype.getPrimaryText=function(t){var i;var n=t.querySelector("."+this.classNameMap[m.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||n){return(i=n===null||n===void 0?void 0:n.textContent)!==null&&i!==void 0?i:""}var e=t.querySelector("."+this.classNameMap[m.LIST_ITEM_TEXT_CLASS]);return e&&e.textContent||""};n.prototype.initializeListType=function(){var t=this;this.isInteractive=e(this.root,I.ARIA_INTERACTIVE_ROLES_SELECTOR);if(this.isEvolutionEnabled&&this.isInteractive){var i=Array.from(this.root.querySelectorAll(I.SELECTED_ITEM_SELECTOR),(function(i){return t.listElements.indexOf(i)}));if(e(this.root,I.ARIA_MULTI_SELECTABLE_SELECTOR)){this.selectedIndex=i}else if(i.length>0){this.selectedIndex=i[0]}return}var n=this.root.querySelectorAll(I.ARIA_ROLE_CHECKBOX_SELECTOR);var r=this.root.querySelector(I.ARIA_CHECKED_RADIO_SELECTOR);if(n.length){var s=this.root.querySelectorAll(I.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(s,(function(i){return t.listElements.indexOf(i)}))}else if(r){this.selectedIndex=this.listElements.indexOf(r)}};n.prototype.setEnabled=function(t,i){this.foundation.setEnabled(t,i)};n.prototype.typeaheadMatchItem=function(t,i){return this.foundation.typeaheadMatchItem(t,i,true)};n.prototype.getDefaultFoundation=function(){var t=this;var i={addClassForElementIndex:function(i,n){var e=t.listElements[i];if(e){e.classList.add(t.classNameMap[n])}},focusItemAtIndex:function(i){var n=t.listElements[i];if(n){n.focus()}},getAttributeForElementIndex:function(i,n){return t.listElements[i].getAttribute(n)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(i){return t.getPrimaryText(t.listElements[i])},hasCheckboxAtIndex:function(i){var n=t.listElements[i];return!!n.querySelector(I.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(i){var n=t.listElements[i];return!!n.querySelector(I.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(i){var n=t.listElements[i];var e=n.querySelector(I.CHECKBOX_SELECTOR);return e.checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(i,n){return t.listElements[i].classList.contains(t.classNameMap[n])},notifyAction:function(i){t.emit(I.ACTION_EVENT,{index:i},true)},removeClassForElementIndex:function(i,n){var e=t.listElements[i];if(e){e.classList.remove(t.classNameMap[n])}},setAttributeForElementIndex:function(i,n,e){var r=t.listElements[i];if(r){r.setAttribute(n,e)}},setCheckedCheckboxOrRadioAtIndex:function(i,n){var e=t.listElements[i];var r=e.querySelector(I.CHECKBOX_RADIO_SELECTOR);r.checked=n;var s=document.createEvent("Event");s.initEvent("change",true,true);r.dispatchEvent(s)},setTabIndexForListItemChildren:function(i,n){var e=t.listElements[i];var r=I.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;Array.prototype.forEach.call(e.querySelectorAll(r),(function(t){t.setAttribute("tabindex",n)}))}};return new B(i)};n.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive){if(!this.root.querySelector("."+this.classNameMap[m.LIST_ITEM_CLASS]+'[tabindex="0"]')){var t=this.initialFocusIndex();if(t!==-1){this.listElements[t].tabIndex=0}}}};n.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&this.selectedIndex.length>0){return this.selectedIndex[0]}if(typeof this.selectedIndex==="number"&&this.selectedIndex!==b.UNSET_INDEX){return this.selectedIndex}var t=this.root.querySelector("."+this.classNameMap[m.LIST_ITEM_CLASS]+":not(."+this.classNameMap[m.LIST_ITEM_DISABLED_CLASS]+")");if(t===null){return-1}return this.getListItemIndex(t)};n.prototype.getListItemIndex=function(t){var i=r(t,"."+this.classNameMap[m.LIST_ITEM_CLASS]+", ."+this.classNameMap[m.ROOT]);if(i&&e(i,"."+this.classNameMap[m.LIST_ITEM_CLASS])){return this.listElements.indexOf(i)}return-1};n.prototype.handleFocusInEvent=function(t){var i=this.getListItemIndex(t.target);this.foundation.handleFocusIn(i)};n.prototype.handleFocusOutEvent=function(t){var i=this.getListItemIndex(t.target);this.foundation.handleFocusOut(i)};n.prototype.handleKeydownEvent=function(t){var i=this.getListItemIndex(t.target);var n=t.target;this.foundation.handleKeydown(t,n.classList.contains(this.classNameMap[m.LIST_ITEM_CLASS]),i)};n.prototype.handleClickEvent=function(t){var i=this.getListItemIndex(t.target);var n=t.target;var r=!e(n,I.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(i,r)};return n}(s);
|
|
156
|
-
/**
|
|
157
|
-
* @license
|
|
158
|
-
* Copyright 2018 Google Inc.
|
|
159
|
-
*
|
|
160
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
161
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
162
|
-
* in the Software without restriction, including without limitation the rights
|
|
163
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
164
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
165
|
-
* furnished to do so, subject to the following conditions:
|
|
166
|
-
*
|
|
167
|
-
* The above copyright notice and this permission notice shall be included in
|
|
168
|
-
* all copies or substantial portions of the Software.
|
|
169
|
-
*
|
|
170
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
171
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
172
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
173
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
174
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
175
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
176
|
-
* THE SOFTWARE.
|
|
177
|
-
*/var U=function(n){t(e,n);function e(t){var r=n.call(this,i(i({},e.defaultAdapter),t))||this;r.isSurfaceOpen=false;r.isQuickOpen=false;r.isHoistedElement=false;r.isFixedPosition=false;r.isHorizontallyCenteredOnViewport=false;r.maxHeight=0;r.openAnimationEndTimerId=0;r.closeAnimationEndTimerId=0;r.animationRequestId=0;r.anchorCorner=d.TOP_START;r.originCorner=d.TOP_START;r.anchorMargin={top:0,right:0,bottom:0,left:0};r.position={x:0,y:0};return r}Object.defineProperty(e,"cssClasses",{get:function(){return f},enumerable:false,configurable:true});Object.defineProperty(e,"strings",{get:function(){return a},enumerable:false,configurable:true});Object.defineProperty(e,"numbers",{get:function(){return h},enumerable:false,configurable:true});Object.defineProperty(e,"Corner",{get:function(){return d},enumerable:false,configurable:true});Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){return undefined},removeClass:function(){return undefined},hasClass:function(){return false},hasAnchor:function(){return false},isElementInContainer:function(){return false},isFocused:function(){return false},isRtl:function(){return false},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(){return undefined},setMaxHeight:function(){return undefined},setTransformOrigin:function(){return undefined},saveFocus:function(){return undefined},restoreFocus:function(){return undefined},notifyClose:function(){return undefined},notifyOpen:function(){return undefined},notifyClosing:function(){return undefined}}},enumerable:false,configurable:true});e.prototype.init=function(){var t=e.cssClasses,i=t.ROOT,n=t.OPEN;if(!this.adapter.hasClass(i)){throw new Error(i+" class required in root element.")}if(this.adapter.hasClass(n)){this.isSurfaceOpen=true}};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^c.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.isOpen=function(){return this.isSurfaceOpen};e.prototype.open=function(){var t=this;if(this.isSurfaceOpen){return}this.adapter.saveFocus();if(this.isQuickOpen){this.isSurfaceOpen=true;this.adapter.addClass(e.cssClasses.OPEN);this.dimensions=this.adapter.getInnerDimensions();this.autoposition();this.adapter.notifyOpen()}else{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()}),h.TRANSITION_OPEN_DURATION)}));this.isSurfaceOpen=true}};e.prototype.close=function(t){var i=this;if(t===void 0){t=false}if(!this.isSurfaceOpen){return}this.adapter.notifyClosing();if(this.isQuickOpen){this.isSurfaceOpen=false;if(!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()}),h.TRANSITION_CLOSE_DURATION)}));this.isSurfaceOpen=false;if(!t){this.maybeRestoreFocus()}};e.prototype.handleBodyClick=function(t){var i=t.target;if(this.adapter.isElementInContainer(i)){return}this.close()};e.prototype.handleKeydown=function(t){var i=t.keyCode,n=t.key;var e=n==="Escape"||i===27;if(e){this.close()}};e.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var i=this.getoriginCorner();var n=this.getMenuSurfaceMaxHeight(i);var r=this.hasBit(i,c.BOTTOM)?"bottom":"top";var s=this.hasBit(i,c.RIGHT)?"right":"left";var u=this.getHorizontalOriginOffset(i);var o=this.getVerticalOriginOffset(i);var f=this.measurements,a=f.anchorSize,d=f.surfaceSize;var l=(t={},t[s]=u,t[r]=o,t);if(a.width/d.width>h.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO){s="center"}if(this.isHoistedElement||this.isFixedPosition){this.adjustPositionForHoistedElement(l)}this.adapter.setTransformOrigin(s+" "+r);this.adapter.setPosition(l);this.adapter.setMaxHeight(n?n+"px":"");if(!this.hasBit(i,c.BOTTOM)){this.adapter.addClass(e.cssClasses.IS_OPEN_BELOW)}};e.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions();var i=this.adapter.getBodyDimensions();var n=this.adapter.getWindowDimensions();var e=this.adapter.getWindowScroll();if(!t){t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}}return{anchorSize:t,bodySize:i,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:n.width-t.right,bottom:n.height-t.bottom,left:t.left},viewportSize:n,windowScroll:e}};e.prototype.getoriginCorner=function(){var t=this.originCorner;var i=this.measurements,n=i.viewportDistance,r=i.anchorSize,s=i.surfaceSize;var u=e.numbers.MARGIN_TO_EDGE;var o=this.hasBit(this.anchorCorner,c.BOTTOM);var f;var a;if(o){f=n.top-u+this.anchorMargin.bottom;a=n.bottom-u-this.anchorMargin.bottom}else{f=n.top-u+this.anchorMargin.top;a=n.bottom-u+r.height-this.anchorMargin.top}var h=a-s.height>0;if(!h&&f>a){t=this.setBit(t,c.BOTTOM)}var d=this.adapter.isRtl();var l=this.hasBit(this.anchorCorner,c.FLIP_RTL);var v=this.hasBit(this.anchorCorner,c.RIGHT)||this.hasBit(t,c.RIGHT);var m=false;if(d&&l){m=!v}else{m=v}var E;var A;if(m){E=n.left+r.width+this.anchorMargin.right;A=n.right-this.anchorMargin.right}else{E=n.left+this.anchorMargin.left;A=n.right+r.width-this.anchorMargin.left}var I=E-s.width>0;var b=A-s.width>0;var T=this.hasBit(t,c.FLIP_RTL)&&this.hasBit(t,c.RIGHT);if(b&&T&&d||!I&&T){t=this.unsetBit(t,c.RIGHT)}else if(I&&m&&d||I&&!m&&v||!b&&E>=A){t=this.setBit(t,c.RIGHT)}return t};e.prototype.getMenuSurfaceMaxHeight=function(t){if(this.maxHeight>0){return this.maxHeight}var i=this.measurements.viewportDistance;var n=0;var r=this.hasBit(t,c.BOTTOM);var s=this.hasBit(this.anchorCorner,c.BOTTOM);var u=e.numbers.MARGIN_TO_EDGE;if(r){n=i.top+this.anchorMargin.top-u;if(!s){n+=this.measurements.anchorSize.height}}else{n=i.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-u;if(s){n-=this.measurements.anchorSize.height}}return n};e.prototype.getHorizontalOriginOffset=function(t){var i=this.measurements.anchorSize;var n=this.hasBit(t,c.RIGHT);var e=this.hasBit(this.anchorCorner,c.RIGHT);if(n){var r=e?i.width-this.anchorMargin.left:this.anchorMargin.right;if(this.isHoistedElement||this.isFixedPosition){return r-(this.measurements.viewportSize.width-this.measurements.bodySize.width)}return r}return e?i.width-this.anchorMargin.right:this.anchorMargin.left};e.prototype.getVerticalOriginOffset=function(t){var i=this.measurements.anchorSize;var n=this.hasBit(t,c.BOTTOM);var e=this.hasBit(this.anchorCorner,c.BOTTOM);var r=0;if(n){r=e?i.height-this.anchorMargin.top:-this.anchorMargin.bottom}else{r=e?i.height+this.anchorMargin.bottom:this.anchorMargin.top}return r};e.prototype.adjustPositionForHoistedElement=function(t){var i,n;var e=this.measurements,r=e.windowScroll,s=e.viewportDistance,o=e.surfaceSize,f=e.viewportSize;var a=Object.keys(t);try{for(var h=u(a),c=h.next();!c.done;c=h.next()){var d=c.value;var l=t[d]||0;if(this.isHorizontallyCenteredOnViewport&&(d==="left"||d==="right")){t[d]=(f.width-o.width)/2;continue}l+=s[d];if(!this.isFixedPosition){if(d==="top"){l+=r.y}else if(d==="bottom"){l-=r.y}else if(d==="left"){l+=r.x}else{l-=r.x}}t[d]=l}}catch(t){i={error:t}}finally{try{if(c&&!c.done&&(n=h.return))n.call(h)}finally{if(i)throw i.error}}};e.prototype.maybeRestoreFocus=function(){var t=this;var i=this.adapter.isFocused();var n=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);if(i||n){setTimeout((function(){t.adapter.restoreFocus()}),h.TOUCH_EVENT_WAIT_MS)}};e.prototype.hasBit=function(t,i){return Boolean(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)};return e}(n);
|
|
178
|
-
/**
|
|
179
|
-
* @license
|
|
180
|
-
* Copyright 2018 Google Inc.
|
|
181
|
-
*
|
|
182
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
183
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
184
|
-
* in the Software without restriction, including without limitation the rights
|
|
185
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
186
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
187
|
-
* furnished to do so, subject to the following conditions:
|
|
188
|
-
*
|
|
189
|
-
* The above copyright notice and this permission notice shall be included in
|
|
190
|
-
* all copies or substantial portions of the Software.
|
|
191
|
-
*
|
|
192
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
193
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
194
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
195
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
196
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
197
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
198
|
-
* THE SOFTWARE.
|
|
199
|
-
*/var j=function(i){t(n,i);function n(){return i!==null&&i.apply(this,arguments)||this}n.attachTo=function(t){return new n(t)};n.prototype.initialSyncWithDOM=function(){var t=this;var i=this.root.parentElement;this.anchorElement=i&&i.classList.contains(f.ANCHOR)?i:null;if(this.root.classList.contains(f.FIXED)){this.setFixedPosition(true)}this.handleKeydown=function(i){t.foundation.handleKeydown(i)};this.handleBodyClick=function(i){t.foundation.handleBodyClick(i)};this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:true})};this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:true})};this.listen("keydown",this.handleKeydown);this.listen(a.OPENED_EVENT,this.registerBodyClickListener);this.listen(a.CLOSED_EVENT,this.deregisterBodyClickListener)};n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown);this.unlisten(a.OPENED_EVENT,this.registerBodyClickListener);this.unlisten(a.CLOSED_EVENT,this.deregisterBodyClickListener);i.prototype.destroy.call(this)};n.prototype.isOpen=function(){return this.foundation.isOpen()};n.prototype.open=function(){this.foundation.open()};n.prototype.close=function(t){if(t===void 0){t=false}this.foundation.close(t)};Object.defineProperty(n.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:false,configurable:true});n.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)};n.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t};n.prototype.setFixedPosition=function(t){if(t){this.root.classList.add(f.FIXED)}else{this.root.classList.remove(f.FIXED)}this.foundation.setFixedPosition(t)};n.prototype.setAbsolutePosition=function(t,i){this.foundation.setAbsolutePosition(t,i);this.setIsHoisted(true)};n.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)};n.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)};n.prototype.getDefaultFoundation=function(){var t=this;var i={addClass:function(i){return t.root.classList.add(i)},removeClass:function(i){return t.root.classList.remove(i)},hasClass:function(i){return t.root.classList.contains(i)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(U.strings.CLOSED_EVENT,{})},notifyClosing:function(){t.emit(U.strings.CLOSING_EVENT,{})},notifyOpen:function(){return t.emit(U.strings.OPENED_EVENT,{})},isElementInContainer:function(i){return t.root.contains(i)},isRtl:function(){return getComputedStyle(t.root).getPropertyValue("direction")==="rtl"},setTransformOrigin:function(i){var n=o(window,"transform")+"-origin";t.root.style.setProperty(n,i)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){if(t.root.contains(document.activeElement)){if(t.previousFocus&&t.previousFocus.focus){t.previousFocus.focus()}}},getInnerDimensions:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(i){var n=t.root;n.style.left="left"in i?i.left+"px":"";n.style.right="right"in i?i.right+"px":"";n.style.top="top"in i?i.top+"px":"";n.style.bottom="bottom"in i?i.bottom+"px":""},setMaxHeight:function(i){t.root.style.maxHeight=i}};return new U(i)};return n}(s);export{d as C,U as M,B as a,j as b,m as c,H as d,b as n,I as s};
|
|
200
|
-
//# sourceMappingURL=p-d528606a.js.map
|