@limetech/lime-elements 37.59.1 → 37.60.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/{component-55b926ef.js → component-3f00c197.js} +7 -8
- package/dist/cjs/component-3f00c197.js.map +1 -0
- package/dist/cjs/{component-37425b99.js → component-44f52caf.js} +50 -51
- package/dist/cjs/component-44f52caf.js.map +1 -0
- package/dist/cjs/{component-cba208a8.js → component-864afce0.js} +13 -14
- package/dist/cjs/component-864afce0.js.map +1 -0
- package/dist/cjs/{component-a4eb183b.js → component-a8e11c4c.js} +12 -13
- package/dist/cjs/component-a8e11c4c.js.map +1 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-action-bar_4.cjs.entry.js +1 -1
- package/dist/cjs/limel-breadcrumbs_5.cjs.entry.js +21 -22
- package/dist/cjs/limel-breadcrumbs_5.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +1 -1
- package/dist/cjs/limel-checkbox.cjs.entry.js +18 -19
- package/dist/cjs/limel-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +6 -7
- package/dist/cjs/limel-chip_2.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +4 -5
- package/dist/cjs/limel-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-dialog.cjs.entry.js +9 -10
- package/dist/cjs/limel-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-dynamic-label_4.cjs.entry.js +2 -3
- package/dist/cjs/limel-dynamic-label_4.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-linear-progress.cjs.entry.js +17 -396
- package/dist/cjs/limel-linear-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +8 -9
- package/dist/cjs/limel-select.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-slider.cjs.entry.js +10 -11
- package/dist/cjs/limel-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js +16 -17
- package/dist/cjs/limel-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +42 -43
- package/dist/cjs/limel-tab-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{component-b37fd9bc.js → ponyfill-63966294.js} +75 -1
- package/dist/cjs/ponyfill-63966294.js.map +1 -0
- package/dist/cjs/{translations-6d759b59.js → translations-e12a6869.js} +13 -1
- package/dist/cjs/translations-e12a6869.js.map +1 -0
- package/dist/collection/components/chip/chip.css +0 -2
- package/dist/collection/components/info-tile/info-tile.css +0 -2
- package/dist/collection/components/linear-progress/linear-progress.css +58 -250
- package/dist/collection/components/linear-progress/linear-progress.js +62 -29
- package/dist/collection/components/linear-progress/linear-progress.js.map +1 -1
- package/dist/collection/components/table/table.js +1 -1
- package/dist/collection/components/table/table.js.map +1 -1
- package/dist/collection/translations/da.js +2 -0
- package/dist/collection/translations/da.js.map +1 -1
- package/dist/collection/translations/en.js +2 -0
- package/dist/collection/translations/en.js.map +1 -1
- package/dist/collection/translations/fi.js +2 -0
- package/dist/collection/translations/fi.js.map +1 -1
- package/dist/collection/translations/nl.js +2 -0
- package/dist/collection/translations/nl.js.map +1 -1
- package/dist/collection/translations/no.js +2 -0
- package/dist/collection/translations/no.js.map +1 -1
- package/dist/collection/translations/sv.js +2 -0
- package/dist/collection/translations/sv.js.map +1 -1
- package/dist/esm/{component-db286494.js → component-5e233629.js} +2 -3
- package/dist/esm/component-5e233629.js.map +1 -0
- package/dist/esm/{component-f972b8db.js → component-a531729c.js} +2 -3
- package/dist/esm/component-a531729c.js.map +1 -0
- package/dist/esm/{component-fc0a08f6.js → component-b934161d.js} +2 -3
- package/dist/esm/component-b934161d.js.map +1 -0
- package/dist/esm/{component-58f68f3e.js → component-e6eb55fa.js} +4 -5
- package/dist/esm/component-e6eb55fa.js.map +1 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-action-bar_4.entry.js +1 -1
- package/dist/esm/limel-breadcrumbs_5.entry.js +5 -6
- package/dist/esm/limel-breadcrumbs_5.entry.js.map +1 -1
- package/dist/esm/limel-callout.entry.js +1 -1
- package/dist/esm/limel-checkbox.entry.js +2 -3
- package/dist/esm/limel-checkbox.entry.js.map +1 -1
- package/dist/esm/limel-chip_2.entry.js +6 -7
- package/dist/esm/limel-chip_2.entry.js.map +1 -1
- package/dist/esm/limel-date-picker.entry.js +4 -5
- package/dist/esm/limel-date-picker.entry.js.map +1 -1
- package/dist/esm/limel-dialog.entry.js +2 -3
- package/dist/esm/limel-dialog.entry.js.map +1 -1
- package/dist/esm/limel-dynamic-label_4.entry.js +2 -3
- package/dist/esm/limel-dynamic-label_4.entry.js.map +1 -1
- package/dist/esm/limel-file-viewer.entry.js +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js.map +1 -1
- package/dist/esm/limel-linear-progress.entry.js +18 -397
- package/dist/esm/limel-linear-progress.entry.js.map +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-select.entry.js +2 -3
- package/dist/esm/limel-select.entry.js.map +1 -1
- package/dist/esm/limel-slider.entry.js +2 -3
- package/dist/esm/limel-slider.entry.js.map +1 -1
- package/dist/esm/limel-snackbar.entry.js +1 -1
- package/dist/esm/limel-switch.entry.js +2 -3
- package/dist/esm/limel-switch.entry.js.map +1 -1
- package/dist/esm/limel-tab-bar.entry.js +2 -3
- package/dist/esm/limel-tab-bar.entry.js.map +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/limel-table.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{component-8b6ce3e9.js → ponyfill-9f1f6cd2.js} +73 -2
- package/dist/esm/ponyfill-9f1f6cd2.js.map +1 -0
- package/dist/esm/{translations-aee148ca.js → translations-d6a1fb0b.js} +13 -1
- package/dist/esm/translations-d6a1fb0b.js.map +1 -0
- 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-d2077011.entry.js → p-02e9b8ce.entry.js} +2 -2
- package/dist/lime-elements/{p-9b437537.entry.js → p-20440a35.entry.js} +2 -2
- package/dist/lime-elements/{p-83648c76.entry.js → p-216eb1cf.entry.js} +2 -2
- package/dist/lime-elements/{p-c36a9afa.entry.js → p-2512011c.entry.js} +4 -4
- package/dist/lime-elements/{p-f1d08f33.entry.js → p-30ca30ec.entry.js} +5 -5
- package/dist/lime-elements/{p-f1d08f33.entry.js.map → p-30ca30ec.entry.js.map} +1 -1
- package/dist/lime-elements/{p-ef5539b0.entry.js → p-3e1e3fe6.entry.js} +2 -2
- package/dist/lime-elements/{p-11d5d44e.js → p-5a478c15.js} +3 -3
- package/dist/lime-elements/{p-9375145d.entry.js → p-6b0ef5ee.entry.js} +3 -3
- package/dist/lime-elements/p-6c74fcaa.entry.js +2 -0
- package/dist/lime-elements/{p-c66da652.entry.js.map → p-6c74fcaa.entry.js.map} +1 -1
- package/dist/lime-elements/{p-48c62d9d.entry.js → p-715d4a78.entry.js} +2 -2
- package/dist/lime-elements/p-78889be5.entry.js +2 -0
- package/dist/lime-elements/{p-2367b082.entry.js.map → p-78889be5.entry.js.map} +1 -1
- package/dist/lime-elements/{p-9ab3a908.js → p-85a982f9.js} +3 -3
- package/dist/lime-elements/{p-cb63f2d7.entry.js → p-9452ff1b.entry.js} +2 -2
- package/dist/lime-elements/{p-5e0ee0be.entry.js → p-9bb104b1.entry.js} +2 -2
- package/dist/lime-elements/p-9bb104b1.entry.js.map +1 -0
- package/dist/lime-elements/p-9f722992.js +68 -0
- package/dist/{cjs/component-b37fd9bc.js.map → lime-elements/p-9f722992.js.map} +1 -1
- package/dist/lime-elements/{p-fe1decdc.entry.js → p-a80507e5.entry.js} +2 -2
- package/dist/lime-elements/p-afefcd43.entry.js +2 -0
- package/dist/lime-elements/p-afefcd43.entry.js.map +1 -0
- package/dist/lime-elements/{p-16ad4500.entry.js → p-c4760e4a.entry.js} +2 -2
- package/dist/lime-elements/{p-16ad4500.entry.js.map → p-c4760e4a.entry.js.map} +1 -1
- package/dist/lime-elements/{p-6fc349f0.entry.js → p-c544c575.entry.js} +2 -2
- package/dist/lime-elements/p-c85589d6.entry.js +2 -0
- package/dist/lime-elements/{p-7603dc0d.entry.js.map → p-c85589d6.entry.js.map} +1 -1
- package/dist/lime-elements/{p-8da06871.entry.js → p-cd04c508.entry.js} +2 -2
- package/dist/lime-elements/{p-f764b655.js → p-d528606a.js} +8 -8
- package/dist/lime-elements/{p-178bbeb4.entry.js → p-dab818a1.entry.js} +2 -2
- package/dist/lime-elements/{p-178bbeb4.entry.js.map → p-dab818a1.entry.js.map} +1 -1
- package/dist/lime-elements/{p-43c83a69.entry.js → p-dd85a0b2.entry.js} +2 -2
- package/dist/lime-elements/{p-083d1db4.js → p-e7281e6a.js} +3 -3
- package/dist/lime-elements/p-f63f1114.js +2 -0
- package/dist/lime-elements/p-f63f1114.js.map +1 -0
- package/dist/types/components/linear-progress/linear-progress.d.ts +19 -7
- package/dist/types/components.d.ts +32 -4
- package/dist/types/translations/da.d.ts +2 -0
- package/dist/types/translations/en.d.ts +2 -0
- package/dist/types/translations/fi.d.ts +2 -0
- package/dist/types/translations/nl.d.ts +2 -0
- package/dist/types/translations/no.d.ts +2 -0
- package/dist/types/translations/sv.d.ts +2 -0
- package/package.json +2 -2
- package/dist/cjs/component-37425b99.js.map +0 -1
- package/dist/cjs/component-55b926ef.js.map +0 -1
- package/dist/cjs/component-a4eb183b.js.map +0 -1
- package/dist/cjs/component-cba208a8.js.map +0 -1
- package/dist/cjs/ponyfill-98ca4766.js +0 -78
- package/dist/cjs/ponyfill-98ca4766.js.map +0 -1
- package/dist/cjs/translations-6d759b59.js.map +0 -1
- package/dist/esm/component-58f68f3e.js.map +0 -1
- package/dist/esm/component-8b6ce3e9.js.map +0 -1
- package/dist/esm/component-db286494.js.map +0 -1
- package/dist/esm/component-f972b8db.js.map +0 -1
- package/dist/esm/component-fc0a08f6.js.map +0 -1
- package/dist/esm/ponyfill-30263d5e.js +0 -74
- package/dist/esm/ponyfill-30263d5e.js.map +0 -1
- package/dist/esm/translations-aee148ca.js.map +0 -1
- package/dist/lime-elements/p-2367b082.entry.js +0 -2
- package/dist/lime-elements/p-2ff3f85e.js +0 -46
- package/dist/lime-elements/p-2ff3f85e.js.map +0 -1
- package/dist/lime-elements/p-4d503318.js +0 -2
- package/dist/lime-elements/p-4d503318.js.map +0 -1
- package/dist/lime-elements/p-5e0ee0be.entry.js.map +0 -1
- package/dist/lime-elements/p-7603dc0d.entry.js +0 -2
- package/dist/lime-elements/p-9605854b.entry.js +0 -68
- package/dist/lime-elements/p-9605854b.entry.js.map +0 -1
- package/dist/lime-elements/p-c66da652.entry.js +0 -2
- package/dist/lime-elements/p-dcc97cc2.js +0 -24
- package/dist/lime-elements/p-dcc97cc2.js.map +0 -1
- /package/dist/lime-elements/{p-d2077011.entry.js.map → p-02e9b8ce.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-9b437537.entry.js.map → p-20440a35.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-83648c76.entry.js.map → p-216eb1cf.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-c36a9afa.entry.js.map → p-2512011c.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-ef5539b0.entry.js.map → p-3e1e3fe6.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-11d5d44e.js.map → p-5a478c15.js.map} +0 -0
- /package/dist/lime-elements/{p-9375145d.entry.js.map → p-6b0ef5ee.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-48c62d9d.entry.js.map → p-715d4a78.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-9ab3a908.js.map → p-85a982f9.js.map} +0 -0
- /package/dist/lime-elements/{p-cb63f2d7.entry.js.map → p-9452ff1b.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-fe1decdc.entry.js.map → p-a80507e5.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-6fc349f0.entry.js.map → p-c544c575.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8da06871.entry.js.map → p-cd04c508.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-f764b655.js.map → p-d528606a.js.map} +0 -0
- /package/dist/lime-elements/{p-43c83a69.entry.js.map → p-dd85a0b2.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-083d1db4.js.map → p-e7281e6a.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as t,a as i,M as n,
|
|
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
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google Inc.
|
|
@@ -64,7 +64,7 @@ import{_ as t,a as i,M as n,b as e,c as r}from"./p-2ff3f85e.js";import{m as s,c
|
|
|
64
64
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
65
65
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
66
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
|
|
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
68
|
/**
|
|
69
69
|
* @license
|
|
70
70
|
* Copyright 2020 Google Inc.
|
|
@@ -108,7 +108,7 @@ import{_ as t,a as i,M as n,b as e,c as r}from"./p-2ff3f85e.js";import{m as s,c
|
|
|
108
108
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
109
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
110
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=
|
|
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
112
|
/**
|
|
113
113
|
* @license
|
|
114
114
|
* Copyright 2018 Google Inc.
|
|
@@ -130,7 +130,7 @@ import{_ as t,a as i,M as n,b as e,c as r}from"./p-2ff3f85e.js";import{m as s,c
|
|
|
130
130
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
131
131
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
132
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=R(t)==="ArrowLeft";var s=R(t)==="ArrowUp";var u=R(t)==="ArrowRight";var o=R(t)==="ArrowDown";var f=R(t)==="Home";var a=R(t)==="End";var h=R(t)==="Enter";var c=R(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);
|
|
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
134
|
/**
|
|
135
135
|
* @license
|
|
136
136
|
* Copyright 2018 Google Inc.
|
|
@@ -152,7 +152,7 @@ import{_ as t,a as i,M as n,b as e,c as r}from"./p-2ff3f85e.js";import{m as s,c
|
|
|
152
152
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
153
153
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
154
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(
|
|
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
156
|
/**
|
|
157
157
|
* @license
|
|
158
158
|
* Copyright 2018 Google Inc.
|
|
@@ -174,7 +174,7 @@ import{_ as t,a as i,M as n,b as e,c as r}from"./p-2ff3f85e.js";import{m as s,c
|
|
|
174
174
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
175
175
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
176
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,
|
|
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
178
|
/**
|
|
179
179
|
* @license
|
|
180
180
|
* Copyright 2018 Google Inc.
|
|
@@ -196,5 +196,5 @@ import{_ as t,a as i,M as n,b as e,c as r}from"./p-2ff3f85e.js";import{m as s,c
|
|
|
196
196
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
197
197
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
198
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}(
|
|
200
|
-
//# sourceMappingURL=p-
|
|
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
|