@limetech/lime-elements 35.0.0-next.9 → 35.0.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/dist/cjs/checkbox.template-b6c6562c.js +43 -0
- package/dist/cjs/{component-f7ef9087.js → component-66df95e7.js} +190 -132
- package/dist/cjs/{component-f532119f.js → component-67144c1c.js} +47 -3
- package/dist/cjs/{component-ed21410d.js → component-ae3bfacf.js} +367 -235
- package/dist/cjs/{component-2faaa141.js → component-cf490570.js} +213 -143
- package/dist/cjs/{component-10dbdd60.js → component-dd795ff0.js} +7 -5
- package/dist/cjs/{dateFormatter-26eac73a.js → dateFormatter-34b77ead.js} +37 -31
- package/dist/cjs/{index-e63a89d7.js → index-2a28697b.js} +27 -1
- package/dist/cjs/lime-elements.cjs.js +3 -3
- package/dist/cjs/limel-badge.cjs.entry.js +4 -4
- package/dist/cjs/limel-banner.cjs.entry.js +2 -2
- package/dist/cjs/limel-button-group.cjs.entry.js +3 -3
- package/dist/cjs/limel-button.cjs.entry.js +3 -3
- package/dist/cjs/limel-checkbox.cjs.entry.js +136 -90
- package/dist/cjs/limel-chip-set.cjs.entry.js +235 -191
- package/dist/cjs/limel-circular-progress.cjs.entry.js +3 -3
- package/dist/cjs/limel-code-editor.cjs.entry.js +50 -23
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
- package/dist/cjs/limel-color-picker-palette_2.cjs.entry.js +3 -3
- package/dist/cjs/limel-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/limel-config.cjs.entry.js +2 -2
- package/dist/cjs/limel-date-picker.cjs.entry.js +8 -8
- package/dist/cjs/limel-dialog.cjs.entry.js +9 -10
- package/dist/cjs/limel-file.cjs.entry.js +11 -9
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +971 -657
- package/dist/cjs/limel-flex-container.cjs.entry.js +6 -2
- package/dist/cjs/limel-form.cjs.entry.js +423 -449
- package/dist/cjs/limel-grid.cjs.entry.js +2 -2
- package/dist/cjs/limel-header.cjs.entry.js +2 -2
- package/dist/cjs/limel-icon-button.cjs.entry.js +6 -6
- package/dist/cjs/limel-icon.cjs.entry.js +2 -2
- package/dist/cjs/limel-input-field.cjs.entry.js +12 -10
- package/dist/cjs/limel-linear-progress.cjs.entry.js +4 -4
- package/dist/cjs/limel-list_3.cjs.entry.js +154 -91
- package/dist/cjs/limel-menu-list.cjs.entry.js +87 -74
- package/dist/cjs/limel-menu.cjs.entry.js +2 -2
- package/dist/cjs/limel-picker.cjs.entry.js +4 -7
- package/dist/cjs/limel-popover-surface.cjs.entry.js +3 -3
- package/dist/cjs/limel-progress-flow-item.cjs.entry.js +2 -2
- package/dist/cjs/limel-progress-flow.cjs.entry.js +2 -2
- package/dist/cjs/limel-select.cjs.entry.js +6 -6
- package/dist/cjs/limel-slider.cjs.entry.js +34 -7
- package/dist/cjs/limel-snackbar.cjs.entry.js +79 -73
- package/dist/cjs/limel-spinner.cjs.entry.js +2 -2
- package/dist/cjs/limel-switch.cjs.entry.js +498 -202
- package/dist/cjs/limel-tab-bar.cjs.entry.js +263 -186
- package/dist/cjs/limel-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/limel-table.cjs.entry.js +73 -13
- package/dist/cjs/limel-tooltip_2.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{moment-d287c0ed.js → moment-5c6581b7.js} +94 -79
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/badge/badge.css +9 -15
- package/dist/collection/components/badge/badge.js +2 -2
- package/dist/collection/components/button/button.css +333 -145
- package/dist/collection/components/button-group/button-group.css +30 -5
- package/dist/collection/components/checkbox/checkbox.css +71 -20
- package/dist/collection/components/checkbox/checkbox.js +5 -4
- package/dist/collection/components/checkbox/checkbox.template.js +24 -20
- package/dist/collection/components/chip-set/chip-set.css +367 -34
- package/dist/collection/components/circular-progress/circular-progress.css +2 -2
- package/dist/collection/components/code-editor/code-editor.css +8 -13
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +1 -1
- package/dist/collection/components/dialog/dialog.css +153 -109
- package/dist/collection/components/dialog/dialog.js +7 -0
- package/dist/collection/components/file/icon-background-colors.js +2 -1
- package/dist/collection/components/file/icon-fill-colors.js +2 -1
- package/dist/collection/components/file/icons.js +1 -1
- package/dist/collection/components/flex-container/flex-container.js +10 -0
- package/dist/collection/components/form/fields/schema-field.js +0 -1
- package/dist/collection/components/form/form.css +5 -1
- package/dist/collection/components/form/form.js +34 -0
- package/dist/collection/components/form/form.types.js +0 -1
- package/dist/collection/components/form/templates/common.js +4 -1
- package/dist/collection/components/icon-button/icon-button.css +116 -59
- package/dist/collection/components/icon-button/icon-button.js +1 -0
- package/dist/collection/components/input-field/input-field.css +344 -29
- package/dist/collection/components/input-field/input-field.js +5 -3
- package/dist/collection/components/linear-progress/linear-progress.css +14 -2
- package/dist/collection/components/list/list-renderer.js +1 -4
- package/dist/collection/components/list/list.css +938 -93
- package/dist/collection/components/list/list.js +13 -6
- package/dist/collection/components/menu-list/menu-list-renderer.js +1 -4
- package/dist/collection/components/menu-list/menu-list.css +938 -93
- package/dist/collection/components/menu-surface/menu-surface.css +31 -7
- package/dist/collection/components/picker/picker.js +4 -6
- package/dist/collection/components/popover-surface/popover-surface.css +1 -0
- package/dist/collection/components/select/select.css +424 -17
- package/dist/collection/components/select/select.template.js +1 -1
- package/dist/collection/components/slider/slider.css +49 -2
- package/dist/collection/components/snackbar/snackbar.css +588 -301
- package/dist/collection/components/switch/switch.css +592 -222
- package/dist/collection/components/switch/switch.js +18 -12
- package/dist/collection/components/tab-bar/tab-bar.css +77 -48
- package/dist/collection/components/table/table.css +219 -165
- package/dist/collection/components/table/table.js +99 -15
- package/dist/collection/components/table/table.types.js +0 -1
- package/dist/collection/style/functions.scss +3 -1
- package/dist/collection/style/internal/lime-theme.scss +30 -31
- package/dist/collection/style/internal/lime-typography.scss +55 -56
- package/dist/esm/checkbox.template-2f1bbc98.js +41 -0
- package/dist/esm/{component-89e0ce26.js → component-19eb6e2b.js} +7 -5
- package/dist/esm/{component-2630c3d7.js → component-288691f3.js} +367 -235
- package/dist/esm/{component-d682c974.js → component-410aad5a.js} +44 -4
- package/dist/esm/{component-429e92ee.js → component-5b4ac85a.js} +213 -143
- package/dist/esm/{component-834d85a1.js → component-fffa3419.js} +190 -132
- package/dist/esm/{dateFormatter-c9b41548.js → dateFormatter-ed618478.js} +37 -31
- package/dist/esm/{index-2316f345.js → index-11cd0b60.js} +27 -1
- package/dist/esm/lime-elements.js +3 -3
- package/dist/esm/limel-badge.entry.js +4 -4
- package/dist/esm/limel-banner.entry.js +2 -2
- package/dist/esm/limel-button-group.entry.js +3 -3
- package/dist/esm/limel-button.entry.js +3 -3
- package/dist/esm/limel-checkbox.entry.js +136 -90
- package/dist/esm/limel-chip-set.entry.js +235 -191
- package/dist/esm/limel-circular-progress.entry.js +3 -3
- package/dist/esm/limel-code-editor.entry.js +50 -23
- package/dist/esm/limel-collapsible-section.entry.js +2 -2
- package/dist/esm/limel-color-picker-palette_2.entry.js +3 -3
- package/dist/esm/limel-color-picker.entry.js +2 -2
- package/dist/esm/limel-config.entry.js +2 -2
- package/dist/esm/limel-date-picker.entry.js +8 -8
- package/dist/esm/limel-dialog.entry.js +9 -10
- package/dist/esm/limel-file.entry.js +11 -9
- package/dist/esm/limel-flatpickr-adapter.entry.js +971 -657
- package/dist/esm/limel-flex-container.entry.js +6 -2
- package/dist/esm/limel-form.entry.js +424 -450
- package/dist/esm/limel-grid.entry.js +2 -2
- package/dist/esm/limel-header.entry.js +2 -2
- package/dist/esm/limel-icon-button.entry.js +6 -6
- package/dist/esm/limel-icon.entry.js +2 -2
- package/dist/esm/limel-input-field.entry.js +12 -10
- package/dist/esm/limel-linear-progress.entry.js +4 -4
- package/dist/esm/limel-list_3.entry.js +154 -91
- package/dist/esm/limel-menu-list.entry.js +87 -74
- package/dist/esm/limel-menu.entry.js +2 -2
- package/dist/esm/limel-picker.entry.js +4 -7
- package/dist/esm/limel-popover-surface.entry.js +3 -3
- package/dist/esm/limel-progress-flow-item.entry.js +2 -2
- package/dist/esm/limel-progress-flow.entry.js +2 -2
- package/dist/esm/limel-select.entry.js +6 -6
- package/dist/esm/limel-slider.entry.js +34 -7
- package/dist/esm/limel-snackbar.entry.js +79 -73
- package/dist/esm/limel-spinner.entry.js +2 -2
- package/dist/esm/limel-switch.entry.js +498 -202
- package/dist/esm/limel-tab-bar.entry.js +263 -186
- package/dist/esm/limel-tab-panel.entry.js +2 -2
- package/dist/esm/limel-table.entry.js +73 -13
- package/dist/esm/limel-tooltip_2.entry.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{moment-8dadd938.js → moment-29c213b7.js} +94 -79
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-04b5bc13.entry.js +82 -0
- package/dist/lime-elements/p-101af376.entry.js +1 -0
- package/dist/lime-elements/p-1c284626.js +73 -0
- package/dist/lime-elements/p-1ede893b.js +1 -0
- package/dist/lime-elements/p-2639edf9.entry.js +73 -0
- package/dist/lime-elements/p-2da6e2a3.entry.js +1 -0
- package/dist/lime-elements/p-2ff40ce6.js +3 -0
- package/dist/lime-elements/{p-887d5bda.entry.js → p-358706b6.entry.js} +1 -1
- package/dist/lime-elements/p-36ecbd03.entry.js +1 -0
- package/dist/lime-elements/p-404e1465.entry.js +1 -0
- package/dist/lime-elements/p-42b67933.entry.js +1 -0
- package/dist/lime-elements/p-440454ed.entry.js +1 -0
- package/dist/lime-elements/{p-076bd4dc.js → p-48d4ef20.js} +3 -3
- package/dist/lime-elements/p-53e01330.entry.js +1 -0
- package/dist/lime-elements/p-5908c21d.entry.js +1 -0
- package/dist/lime-elements/p-5b7a8c61.entry.js +20 -0
- package/dist/lime-elements/p-63e25a0a.entry.js +1 -0
- package/dist/lime-elements/p-6e7809a6.entry.js +1 -0
- package/dist/lime-elements/p-705334c1.entry.js +1 -0
- package/dist/lime-elements/p-716a6acd.entry.js +16 -0
- package/dist/lime-elements/p-71efe2ca.entry.js +37 -0
- package/dist/lime-elements/{p-e1928c0e.js → p-72e03943.js} +1 -1
- package/dist/lime-elements/p-80327bb8.entry.js +16 -0
- package/dist/lime-elements/p-83ea517b.entry.js +1 -0
- package/dist/lime-elements/p-87a1e1cb.entry.js +1 -0
- package/dist/lime-elements/{p-8ad5e143.entry.js → p-94899019.entry.js} +1 -1
- package/dist/lime-elements/p-95f275ab.entry.js +1 -0
- package/dist/lime-elements/p-96f4b892.entry.js +131 -0
- package/dist/lime-elements/p-97d6c4a6.entry.js +1 -0
- package/dist/lime-elements/p-a465084b.entry.js +82 -0
- package/dist/lime-elements/p-a5af84a7.entry.js +1 -0
- package/dist/lime-elements/p-b91dc1ef.entry.js +1 -0
- package/dist/lime-elements/p-bd8c9384.entry.js +1 -0
- package/dist/lime-elements/p-c4b38454.entry.js +1 -0
- package/dist/lime-elements/p-c7953a05.entry.js +82 -0
- package/dist/lime-elements/p-c80acfb2.entry.js +59 -0
- package/dist/lime-elements/p-cbc43682.js +81 -0
- package/dist/lime-elements/{p-ace9affc.js → p-d0a7de87.js} +2 -2
- package/dist/lime-elements/p-d1ee4501.entry.js +37 -0
- package/dist/lime-elements/p-d74fa89e.entry.js +1 -0
- package/dist/lime-elements/p-da962c64.entry.js +1 -0
- package/dist/lime-elements/p-dfba92de.js +126 -0
- package/dist/lime-elements/p-dfbe015e.entry.js +1 -0
- package/dist/lime-elements/p-e83dddcd.entry.js +126 -0
- package/dist/lime-elements/p-e98d76e8.entry.js +59 -0
- package/dist/lime-elements/{p-92146da6.js → p-e9a95b8f.js} +1 -1
- package/dist/lime-elements/p-eae8c615.entry.js +1 -0
- package/dist/lime-elements/p-ed65468d.entry.js +1 -0
- package/dist/lime-elements/p-f0c9dadd.entry.js +1 -0
- package/dist/lime-elements/style/functions.scss +3 -1
- package/dist/lime-elements/style/internal/lime-theme.scss +30 -31
- package/dist/lime-elements/style/internal/lime-typography.scss +55 -56
- package/dist/types/components/badge/badge.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +3 -2
- package/dist/types/components/checkbox/checkbox.template.d.ts +1 -0
- package/dist/types/components/dialog/dialog.d.ts +7 -0
- package/dist/types/components/flex-container/flex-container.d.ts +7 -0
- package/dist/types/components/form/fields/array-field.d.ts +0 -1
- package/dist/types/components/form/fields/object-field.d.ts +2 -2
- package/dist/types/components/form/form.d.ts +8 -1
- package/dist/types/components/form/form.types.d.ts +6 -0
- package/dist/types/components/picker/picker.d.ts +2 -1
- package/dist/types/components/switch/switch.d.ts +2 -2
- package/dist/types/components/table/table.d.ts +10 -1
- package/dist/types/components/table/table.types.d.ts +13 -0
- package/dist/types/components.d.ts +20 -4
- package/dist/types/stencil-public-runtime.d.ts +6 -4
- package/package.json +30 -43
- package/dist/cjs/checkbox.template-50eb8b76.js +0 -39
- package/dist/esm/checkbox.template-50f7c07b.js +0 -37
- package/dist/lime-elements/p-041ae00c.entry.js +0 -1
- package/dist/lime-elements/p-0ce9165f.entry.js +0 -1
- package/dist/lime-elements/p-0fd208f3.entry.js +0 -82
- package/dist/lime-elements/p-143705b1.entry.js +0 -1
- package/dist/lime-elements/p-1876a96a.entry.js +0 -1
- package/dist/lime-elements/p-1fb5340d.entry.js +0 -1
- package/dist/lime-elements/p-250f55be.js +0 -1
- package/dist/lime-elements/p-29f054cc.entry.js +0 -37
- package/dist/lime-elements/p-31fecf5d.entry.js +0 -1
- package/dist/lime-elements/p-34c7872e.entry.js +0 -1
- package/dist/lime-elements/p-3ae6bb75.entry.js +0 -82
- package/dist/lime-elements/p-3ae6dfba.entry.js +0 -73
- package/dist/lime-elements/p-468e940e.entry.js +0 -16
- package/dist/lime-elements/p-4932c029.entry.js +0 -1
- package/dist/lime-elements/p-4b5af81b.entry.js +0 -1
- package/dist/lime-elements/p-510bb5a4.entry.js +0 -1
- package/dist/lime-elements/p-58cbe99d.entry.js +0 -1
- package/dist/lime-elements/p-597cbe05.entry.js +0 -1
- package/dist/lime-elements/p-6003f817.entry.js +0 -1
- package/dist/lime-elements/p-668795a7.js +0 -73
- package/dist/lime-elements/p-714fde78.entry.js +0 -1
- package/dist/lime-elements/p-7476efe0.entry.js +0 -1
- package/dist/lime-elements/p-8a2c1038.entry.js +0 -16
- package/dist/lime-elements/p-902347b9.js +0 -81
- package/dist/lime-elements/p-90c6fa15.js +0 -126
- package/dist/lime-elements/p-90f3e17c.entry.js +0 -37
- package/dist/lime-elements/p-a2cf74c1.entry.js +0 -1
- package/dist/lime-elements/p-a397bab7.js +0 -3
- package/dist/lime-elements/p-a4c532a7.entry.js +0 -1
- package/dist/lime-elements/p-be56ffab.entry.js +0 -1
- package/dist/lime-elements/p-c306c953.entry.js +0 -1
- package/dist/lime-elements/p-c35874db.entry.js +0 -1
- package/dist/lime-elements/p-c8c8a946.entry.js +0 -59
- package/dist/lime-elements/p-ca664c9f.entry.js +0 -1
- package/dist/lime-elements/p-d2c74396.entry.js +0 -1
- package/dist/lime-elements/p-d48ad9f7.entry.js +0 -126
- package/dist/lime-elements/p-d93a3b07.entry.js +0 -16
- package/dist/lime-elements/p-df8faeb4.entry.js +0 -59
- package/dist/lime-elements/p-dfe0a58b.entry.js +0 -1
- package/dist/lime-elements/p-e275f502.entry.js +0 -37
- package/dist/lime-elements/p-e881e98d.entry.js +0 -1
- package/dist/lime-elements/p-f2c706b8.entry.js +0 -131
- package/dist/lime-elements/p-fc30b8e3.entry.js +0 -1
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import{M as t,a as n}from"./p-076bd4dc.js";import{a as i,M as e,b as r}from"./p-902347b9.js";import{m as u}from"./p-dcc97cc2.js";import{M as s,a as o}from"./p-ace9affc.js";
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var c=function(t,n){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function f(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}c(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var h=function(){return(h=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)},a=function(t,n){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};
|
|
16
|
-
/*! *****************************************************************************
|
|
17
|
-
Copyright (c) Microsoft Corporation.
|
|
18
|
-
|
|
19
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
20
|
-
purpose with or without fee is hereby granted.
|
|
21
|
-
|
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
23
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
24
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
25
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
26
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
27
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
29
|
-
***************************************************************************** */function l(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}a(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var d=function(){return(d=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)},b={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},g=function(t){function n(i){var e=t.call(this,d(d({},n.defaultAdapter),i))||this;return e.transitionEndHandler_=function(t){return e.handleTransitionEnd(t)},e}return l(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return b},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!1,configurable:!0}),n.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler_)},n.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler_)},n.prototype.activate=function(){this.adapter.removeClass(b.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(b.LINE_RIPPLE_ACTIVE)},n.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},n.prototype.deactivate=function(){this.adapter.addClass(b.LINE_RIPPLE_DEACTIVATING)},n.prototype.handleTransitionEnd=function(t){var n=this.adapter.hasClass(b.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&n&&(this.adapter.removeClass(b.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(b.LINE_RIPPLE_DEACTIVATING))},n}(t),m=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return l(n,t),n.attachTo=function(t){return new n(t)},n.prototype.activate=function(){this.foundation.activate()},n.prototype.deactivate=function(){this.foundation.deactivate()},n.prototype.setRippleCenter=function(t){this.foundation.setRippleCenter(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new g({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},setStyle:function(n,i){return t.root.style.setProperty(n,i)},registerEventHandler:function(n,i){return t.listen(n,i)},deregisterEventHandler:function(n,i){return t.unlisten(n,i)}})},n}(n),v=function(t,n){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2018 Google Inc.
|
|
33
|
-
*
|
|
34
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
35
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
36
|
-
* in the Software without restriction, including without limitation the rights
|
|
37
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
38
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
39
|
-
* furnished to do so, subject to the following conditions:
|
|
40
|
-
*
|
|
41
|
-
* The above copyright notice and this permission notice shall be included in
|
|
42
|
-
* all copies or substantial portions of the Software.
|
|
43
|
-
*
|
|
44
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
45
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
46
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
47
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
48
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
49
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
50
|
-
* THE SOFTWARE.
|
|
51
|
-
*/function O(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}v(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var p=function(){return(p=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)},E={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},I={NOTCH_ELEMENT_PADDING:8},C={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},L=function(t){function n(i){return t.call(this,p(p({},n.defaultAdapter),i))||this}return O(n,t),Object.defineProperty(n,"strings",{get:function(){return E},enumerable:!1,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return C},enumerable:!1,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return I},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!1,configurable:!0}),n.prototype.notch=function(t){var i=n.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=I.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(i)},n.prototype.closeNotch=function(){this.adapter.removeClass(n.cssClasses.OUTLINE_NOTCHED),this.adapter.removeNotchWidthProperty()},n}(t),_=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return O(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){this.notchElement_=this.root.querySelector(E.NOTCH_ELEMENT_SELECTOR);var t=this.root.querySelector("."+s.cssClasses.ROOT);t?(t.style.transitionDuration="0s",this.root.classList.add(C.OUTLINE_UPGRADED),requestAnimationFrame((function(){t.style.transitionDuration=""}))):this.root.classList.add(C.NO_LABEL)},n.prototype.notch=function(t){this.foundation.notch(t)},n.prototype.closeNotch=function(){this.foundation.closeNotch()},n.prototype.getDefaultFoundation=function(){var t=this;return new L({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},setNotchWidthProperty:function(n){return t.notchElement_.style.setProperty("width",n+"px")},removeNotchWidthProperty:function(){return t.notchElement_.style.removeProperty("width")}})},n}(n),x={ROOT:"mdc-text-field-character-counter"},A={ROOT_SELECTOR:"."+x.ROOT},T=function(t){function n(i){return t.call(this,h(h({},n.defaultAdapter),i))||this}return f(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return x},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return A},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!1,configurable:!0}),n.prototype.setCounterValue=function(t,n){t=Math.min(t,n),this.adapter.setContent(t+" / "+n)},n}(t),j=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new T({setContent:function(n){t.root.textContent=n}})},n}(n),R={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},w={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},N={LABEL_SCALE:.75},H=["pattern","min","max","required","step","minlength","maxlength"],S=["color","date","datetime-local","month","range","time","week"],y=["mousedown","touchstart"],F=["click","keydown"],D=function(t){function n(i,e){void 0===e&&(e={});var r=t.call(this,h(h({},n.defaultAdapter),i))||this;return r.isFocused_=!1,r.receivedUserInput_=!1,r.isValid_=!0,r.useNativeValidation_=!0,r.validateOnValueChange_=!0,r.helperText_=e.helperText,r.characterCounter_=e.characterCounter,r.leadingIcon_=e.leadingIcon,r.trailingIcon_=e.trailingIcon,r.inputFocusHandler_=function(){return r.activateFocus()},r.inputBlurHandler_=function(){return r.deactivateFocus()},r.inputInputHandler_=function(){return r.handleInput()},r.setPointerXOffset_=function(t){return r.setTransformOrigin(t)},r.textFieldInteractionHandler_=function(){return r.handleTextFieldInteraction()},r.validationAttributeChangeHandler_=function(t){return r.handleValidationAttributeChange(t)},r}return f(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return w},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return R},enumerable:!1,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return N},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shouldAlwaysFloat_",{get:function(){var t=this.getNativeInput_().type;return S.indexOf(t)>=0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||!!this.getValue()||this.isBadInput_()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&!!this.getValue()},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},setInputAttr:function(){},removeInputAttr:function(){},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver((function(){}))},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!1,configurable:!0}),n.prototype.init=function(){var t=this;this.adapter.hasLabel()&&this.getNativeInput_().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler_():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating_(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler_),y.forEach((function(n){t.adapter.registerInputInteractionHandler(n,t.setPointerXOffset_)})),F.forEach((function(n){t.adapter.registerTextFieldInteractionHandler(n,t.textFieldInteractionHandler_)})),this.validationObserver_=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},n.prototype.destroy=function(){var t=this;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler_),y.forEach((function(n){t.adapter.deregisterInputInteractionHandler(n,t.setPointerXOffset_)})),F.forEach((function(n){t.adapter.deregisterTextFieldInteractionHandler(n,t.textFieldInteractionHandler_)})),this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_)},n.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput_=!0)},n.prototype.handleValidationAttributeChange=function(t){var n=this;t.some((function(t){return H.indexOf(t)>-1&&(n.styleValidity_(!0),n.adapter.setLabelRequired(n.getNativeInput_().required),!0)})),t.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},n.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var n=this.adapter.getLabelWidth()*N.LABEL_SCALE;this.adapter.notchOutline(n)}else this.adapter.closeOutline()},n.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),!this.helperText_||!this.helperText_.isPersistent()&&this.helperText_.isValidation()&&this.isValid_||this.helperText_.showToScreenReader()},n.prototype.setTransformOrigin=function(t){if(!this.isDisabled()&&!this.adapter.hasOutline()){var n=t.touches,i=n?n[0]:t,e=i.target.getBoundingClientRect();this.adapter.setLineRippleTransformOrigin(i.clientX-e.left)}},n.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},n.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},n.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter.deactivateLineRipple();var t=this.isValid();this.styleValidity_(t),this.styleFocused_(this.isFocused_),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},n.prototype.getValue=function(){return this.getNativeInput_().value},n.prototype.setValue=function(t){if(this.getValue()!==t&&(this.getNativeInput_().value=t),this.setCharacterCounter_(t.length),this.validateOnValueChange_){var n=this.isValid();this.styleValidity_(n)}this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.validateOnValueChange_&&this.adapter.shakeLabel(this.shouldShake))},n.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},n.prototype.setValid=function(t){this.isValid_=t,this.styleValidity_(t);var n=!t&&!this.isFocused_&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(n)},n.prototype.setValidateOnValueChange=function(t){this.validateOnValueChange_=t},n.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange_},n.prototype.setUseNativeValidation=function(t){this.useNativeValidation_=t},n.prototype.isDisabled=function(){return this.getNativeInput_().disabled},n.prototype.setDisabled=function(t){this.getNativeInput_().disabled=t,this.styleDisabled_(t)},n.prototype.setHelperTextContent=function(t){this.helperText_&&this.helperText_.setContent(t)},n.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(t)},n.prototype.setLeadingIconContent=function(t){this.leadingIcon_&&this.leadingIcon_.setContent(t)},n.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(t)},n.prototype.setTrailingIconContent=function(t){this.trailingIcon_&&this.trailingIcon_.setContent(t)},n.prototype.setCharacterCounter_=function(t){if(this.characterCounter_){var n=this.getNativeInput_().maxLength;if(-1===n)throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(t,n)}},n.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},n.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},n.prototype.styleValidity_=function(t){var i=n.cssClasses.INVALID;if(t?this.adapter.removeClass(i):this.adapter.addClass(i),this.helperText_){if(this.helperText_.setValidity(t),!this.helperText_.isValidation())return;var e=this.helperText_.isVisible(),r=this.helperText_.getId();e&&r?this.adapter.setInputAttr(R.ARIA_DESCRIBEDBY,r):this.adapter.removeInputAttr(R.ARIA_DESCRIBEDBY)}},n.prototype.styleFocused_=function(t){var i=n.cssClasses.FOCUSED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.styleDisabled_=function(t){var i=n.cssClasses,e=i.DISABLED,r=i.INVALID;t?(this.adapter.addClass(e),this.adapter.removeClass(r)):this.adapter.removeClass(e),this.leadingIcon_&&this.leadingIcon_.setDisabled(t),this.trailingIcon_&&this.trailingIcon_.setDisabled(t)},n.prototype.styleFloating_=function(t){var i=n.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.getNativeInput_=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},n}(t),P={HELPER_TEXT_PERSISTENT:"mdc-text-field-helper-text--persistent",HELPER_TEXT_VALIDATION_MSG:"mdc-text-field-helper-text--validation-msg",ROOT:"mdc-text-field-helper-text"},M={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+P.ROOT},B=function(t){function n(i){return t.call(this,h(h({},n.defaultAdapter),i))||this}return f(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return P},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return M},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){}}},enumerable:!1,configurable:!0}),n.prototype.getId=function(){return this.adapter.getAttr("id")},n.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(M.ARIA_HIDDEN)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.isPersistent=function(){return this.adapter.hasClass(P.HELPER_TEXT_PERSISTENT)},n.prototype.setPersistent=function(t){t?this.adapter.addClass(P.HELPER_TEXT_PERSISTENT):this.adapter.removeClass(P.HELPER_TEXT_PERSISTENT)},n.prototype.isValidation=function(){return this.adapter.hasClass(P.HELPER_TEXT_VALIDATION_MSG)},n.prototype.setValidation=function(t){t?this.adapter.addClass(P.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(P.HELPER_TEXT_VALIDATION_MSG)},n.prototype.showToScreenReader=function(){this.adapter.removeAttr(M.ARIA_HIDDEN)},n.prototype.setValidity=function(t){var n=this.adapter.hasClass(P.HELPER_TEXT_PERSISTENT),i=this.adapter.hasClass(P.HELPER_TEXT_VALIDATION_MSG)&&!t;i?(this.showToScreenReader(),this.adapter.setAttr(M.ROLE,"alert")):this.adapter.removeAttr(M.ROLE),n||i||this.hide_()},n.prototype.hide_=function(){this.adapter.setAttr(M.ARIA_HIDDEN,"true")},n}(t),V=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new B({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n}})},n}(n),k={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},G={ROOT:"mdc-text-field__icon"},U=["click","keydown"],W=function(t){function n(i){var e=t.call(this,h(h({},n.defaultAdapter),i))||this;return e.savedTabIndex_=null,e.interactionHandler_=function(t){return e.handleInteraction(t)},e}return f(n,t),Object.defineProperty(n,"strings",{get:function(){return k},enumerable:!1,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return G},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!1,configurable:!0}),n.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),U.forEach((function(n){t.adapter.registerInteractionHandler(n,t.interactionHandler_)}))},n.prototype.destroy=function(){var t=this;U.forEach((function(n){t.adapter.deregisterInteractionHandler(n,t.interactionHandler_)}))},n.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",k.ICON_ROLE)))},n.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.handleInteraction=function(t){("click"===t.type||"Enter"===t.key||13===t.keyCode)&&(t.preventDefault(),this.adapter.notifyIconAction())},n}(t),q=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new W({getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n},registerInteractionHandler:function(n,i){return t.listen(n,i)},deregisterInteractionHandler:function(n,i){return t.unlisten(n,i)},notifyIconAction:function(){return t.emit(W.strings.ICON_EVENT,{},!0)}})},n}(n),X=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,n,i,r,u,s,c){void 0===t&&(t=function(t,n){return new e(t,n)}),void 0===n&&(n=function(t){return new m(t)}),void 0===i&&(i=function(t){return new V(t)}),void 0===r&&(r=function(t){return new j(t)}),void 0===u&&(u=function(t){return new q(t)}),void 0===s&&(s=function(t){return new o(t)}),void 0===c&&(c=function(t){return new _(t)}),this.input_=this.root.querySelector(R.INPUT_SELECTOR);var f=this.root.querySelector(R.LABEL_SELECTOR);this.label_=f?s(f):null;var h=this.root.querySelector(R.LINE_RIPPLE_SELECTOR);this.lineRipple_=h?n(h):null;var a=this.root.querySelector(R.OUTLINE_SELECTOR);this.outline_=a?c(a):null;var l=B.strings,d=this.root.nextElementSibling,b=d&&d.classList.contains(w.HELPER_LINE),g=b&&d&&d.querySelector(l.ROOT_SELECTOR);this.helperText_=g?i(g):null;var v=T.strings,O=this.root.querySelector(v.ROOT_SELECTOR);!O&&b&&d&&(O=d.querySelector(v.ROOT_SELECTOR)),this.characterCounter_=O?r(O):null;var p=this.root.querySelector(R.LEADING_ICON_SELECTOR);this.leadingIcon_=p?u(p):null;var E=this.root.querySelector(R.TRAILING_ICON_SELECTOR);this.trailingIcon_=E?u(E):null,this.prefix_=this.root.querySelector(R.PREFIX_SELECTOR),this.suffix_=this.root.querySelector(R.SUFFIX_SELECTOR),this.ripple=this.createRipple_(t)},n.prototype.destroy=function(){this.ripple&&this.ripple.destroy(),this.lineRipple_&&this.lineRipple_.destroy(),this.helperText_&&this.helperText_.destroy(),this.characterCounter_&&this.characterCounter_.destroy(),this.leadingIcon_&&this.leadingIcon_.destroy(),this.trailingIcon_&&this.trailingIcon_.destroy(),this.label_&&this.label_.destroy(),this.outline_&&this.outline_.destroy(),t.prototype.destroy.call(this)},n.prototype.initialSyncWithDOM=function(){this.disabled=this.input_.disabled},Object.defineProperty(n.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(t){this.foundation.setDisabled(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"required",{get:function(){return this.input_.required},set:function(t){this.input_.required=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pattern",{get:function(){return this.input_.pattern},set:function(t){this.input_.pattern=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"minLength",{get:function(){return this.input_.minLength},set:function(t){this.input_.minLength=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"maxLength",{get:function(){return this.input_.maxLength},set:function(t){t<0?this.input_.removeAttribute("maxLength"):this.input_.maxLength=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.input_.min},set:function(t){this.input_.min=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.input_.max},set:function(t){this.input_.max=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"step",{get:function(){return this.input_.step},set:function(t){this.input_.step=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"trailingIconAriaLabel",{set:function(t){this.foundation.setTrailingIconAriaLabel(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"trailingIconContent",{set:function(t){this.foundation.setTrailingIconContent(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"useNativeValidation",{set:function(t){this.foundation.setUseNativeValidation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"prefixText",{get:function(){return this.prefix_?this.prefix_.textContent:null},set:function(t){this.prefix_&&(this.prefix_.textContent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"suffixText",{get:function(){return this.suffix_?this.suffix_.textContent:null},set:function(t){this.suffix_&&(this.suffix_.textContent=t)},enumerable:!1,configurable:!0}),n.prototype.focus=function(){this.input_.focus()},n.prototype.layout=function(){this.foundation.notchOutline(this.foundation.shouldFloat)},n.prototype.getDefaultFoundation=function(){var t=h(h(h(h(h({},this.getRootAdapterMethods_()),this.getInputAdapterMethods_()),this.getLabelAdapterMethods_()),this.getLineRippleAdapterMethods_()),this.getOutlineAdapterMethods_());return new D(t,this.getFoundationMap_())},n.prototype.getRootAdapterMethods_=function(){var t=this;return{addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},registerTextFieldInteractionHandler:function(n,i){t.listen(n,i)},deregisterTextFieldInteractionHandler:function(n,i){t.unlisten(n,i)},registerValidationAttributeChangeHandler:function(n){var i=new MutationObserver((function(t){return n(function(t){return t.map((function(t){return t.attributeName})).filter((function(t){return t}))}(t))}));return i.observe(t.input_,{attributes:!0}),i},deregisterValidationAttributeChangeHandler:function(t){t.disconnect()}}},n.prototype.getInputAdapterMethods_=function(){var t=this;return{getNativeInput:function(){return t.input_},setInputAttr:function(n,i){t.input_.setAttribute(n,i)},removeInputAttr:function(n){t.input_.removeAttribute(n)},isFocused:function(){return document.activeElement===t.input_},registerInputInteractionHandler:function(n,e){t.input_.addEventListener(n,e,i())},deregisterInputInteractionHandler:function(n,e){t.input_.removeEventListener(n,e,i())}}},n.prototype.getLabelAdapterMethods_=function(){var t=this;return{floatLabel:function(n){return t.label_&&t.label_.float(n)},getLabelWidth:function(){return t.label_?t.label_.getWidth():0},hasLabel:function(){return Boolean(t.label_)},shakeLabel:function(n){return t.label_&&t.label_.shake(n)},setLabelRequired:function(n){return t.label_&&t.label_.setRequired(n)}}},n.prototype.getLineRippleAdapterMethods_=function(){var t=this;return{activateLineRipple:function(){t.lineRipple_&&t.lineRipple_.activate()},deactivateLineRipple:function(){t.lineRipple_&&t.lineRipple_.deactivate()},setLineRippleTransformOrigin:function(n){t.lineRipple_&&t.lineRipple_.setRippleCenter(n)}}},n.prototype.getOutlineAdapterMethods_=function(){var t=this;return{closeOutline:function(){return t.outline_&&t.outline_.closeNotch()},hasOutline:function(){return Boolean(t.outline_)},notchOutline:function(n){return t.outline_&&t.outline_.notch(n)}}},n.prototype.getFoundationMap_=function(){return{characterCounter:this.characterCounter_?this.characterCounter_.foundationForTextField:void 0,helperText:this.helperText_?this.helperText_.foundationForTextField:void 0,leadingIcon:this.leadingIcon_?this.leadingIcon_.foundationForTextField:void 0,trailingIcon:this.trailingIcon_?this.trailingIcon_.foundationForTextField:void 0}},n.prototype.createRipple_=function(t){var n=this,s=this.root.classList.contains(w.TEXTAREA),o=this.root.classList.contains(w.OUTLINED);if(s||o)return null;var c=h(h({},e.createAdapter(this)),{isSurfaceActive:function(){return u(n.input_,":active")},registerInteractionHandler:function(t,e){return n.input_.addEventListener(t,e,i())},deregisterInteractionHandler:function(t,e){return n.input_.removeEventListener(t,e,i())}});return t(this.root,new r(c))},n}(n);
|
|
52
|
-
/**
|
|
53
|
-
* @license
|
|
54
|
-
* Copyright 2018 Google Inc.
|
|
55
|
-
*
|
|
56
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
57
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
58
|
-
* in the Software without restriction, including without limitation the rights
|
|
59
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
60
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
61
|
-
* furnished to do so, subject to the following conditions:
|
|
62
|
-
*
|
|
63
|
-
* The above copyright notice and this permission notice shall be included in
|
|
64
|
-
* all copies or substantial portions of the Software.
|
|
65
|
-
*
|
|
66
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
67
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
68
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
69
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
70
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
71
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
72
|
-
* THE SOFTWARE.
|
|
73
|
-
*/export{X as M}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-92146da6.js";import{c as r}from"./p-6c094f3f.js";import{z as o}from"./p-440084ea.js";import"./p-090bc949.js";import"./p-379955f4.js";import"./p-eda23c05.js";import"./p-c93050d6.js";let n=class{constructor(s){t(this,s),this.cancel=i(this,"cancel",7),this.select=i(this,"select",7),this.items=[],this.disabled=!1,this.openDirection="right",this.open=!1,this.badgeIcons=!1,this.gridLayout=!1,this.setTriggerAttributes=t=>{const i={"aria-haspopup":!0,"aria-expanded":this.open,disabled:this.disabled,role:"button"};for(const[s,e]of Object.entries(i))e?t.setAttribute(s,String(e)):t.removeAttribute(s)},this.onClose=()=>{this.cancel.emit(),this.open=!1},this.onTriggerClick=t=>{t.stopPropagation(),this.disabled||(this.open=!this.open)},this.onListChange=t=>{this.items=this.items.map((i=>i===t.detail?t.detail:i)),this.select.emit(t.detail),this.open=!1},this.setListElement=t=>{this.list=t},this.focusMenuItem=()=>{var t;const i=this.list.shadowRoot.activeElement;null==i||i.blur();const s=this.items.filter(this.isMenuItem),e=Math.max(s.findIndex((t=>t.selected)),0);null===(t=Array.from(this.list.shadowRoot.querySelectorAll('[role="menuitem"]'))[e])||void 0===t||t.focus()},this.portalId=r()}componentDidLoad(){this.host.querySelector('[slot="trigger"]')||console.warn("Using limel-menu with the default trigger is deprecated. Please provide your own trigger element.")}openWatcher(){if(!this.open)return;const t=new IntersectionObserver((()=>{t.unobserve(this.list),this.focusMenuItem()}));t.observe(this.list)}render(){const t=this.getCssProperties(),i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("div",{class:"mdc-menu-surface--anchor",onClick:this.onTriggerClick},s("slot",{name:"trigger"}),s("limel-portal",{visible:this.open,containerId:this.portalId,openDirection:this.openDirection,position:"absolute",containerStyle:{"z-index":i}},s("limel-menu-surface",{open:this.open,onDismiss:this.onClose,style:t,class:{"has-grid-layout":this.gridLayout}},s("limel-menu-list",{class:{"has-grid-layout has-interactive-items":this.gridLayout},items:this.items,type:"menu",badgeIcons:this.badgeIcons,onChange:this.onListChange,ref:this.setListElement}))))}componentDidRender(){this.host.shadowRoot.querySelector("slot").assignedElements().forEach(this.setTriggerAttributes)}getCssProperties(){const t=["--menu-surface-width","--list-grid-item-max-width","--list-grid-item-min-width","--list-grid-gap"],i=getComputedStyle(this.host),s=t.map((t=>i.getPropertyValue(t)));return o(t,s)}isMenuItem(t){return!("separator"in t)}get host(){return e(this)}static get watchers(){return{open:["openWatcher"]}}};n.style=":host{display:inline-block}:host([hidden]){display:none}.menu__trigger{border-color:transparent;border-width:1px;border-style:solid;background:none;color:rgb(var(--contrast-800));height:2.25rem}.menu__trigger-enabled:hover{border-color:rgb(var(--contrast-800));color:rgb(var(--contrast-1100))}.mdc-menu-surface--anchor{position:relative}";export{n as limel_menu}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t}from"./p-92146da6.js";let n=class{constructor(t){e(this,t),this.direction="horizontal",this.justify="space-between",this.align="center",this.reverse=!1}render(){return t("slot",null)}};n.style=":host(limel-flex-container){display:flex}:host(limel-flex-container[hidden]){display:none}:host(limel-flex-container[direction=horizontal]){flex-direction:row}:host(limel-flex-container[direction=horizontal][reverse]){flex-direction:row-reverse}:host(limel-flex-container[direction=vertical]){flex-direction:column}:host(limel-flex-container[direction=vertical][reverse]){flex-direction:column-reverse}:host(limel-flex-container[align=start]){align-items:flex-start}:host(limel-flex-container[align=end]){align-items:flex-end}:host(limel-flex-container[align=center]){align-items:center}:host(limel-flex-container[align=stretch]){align-items:stretch}:host(limel-flex-container[justify=start]){justify-content:flex-start}:host(limel-flex-container[justify=end]){justify-content:flex-end}:host(limel-flex-container[justify=center]){justify-content:center}:host(limel-flex-container[justify=space-between]){justify-content:space-between}:host(limel-flex-container[justify=space-around]){justify-content:space-around}:host(limel-flex-container[justify=space-evenly]){justify-content:space-evenly}:host(limel-flex-container[slot=button]){gap:0.5rem;width:100%;justify-content:flex-end}:host(limel-flex-container[slot=button][direction=horizontal][reverse]){justify-content:flex-start}";export{n as limel_flex_container}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,g as e}from"./p-92146da6.js";import{i as n}from"./p-0534b23b.js";import{T as h,b as r,E as o,c as l,d as a,a as c,A as u,e as d,f,g as p}from"./p-216ffe20.js";import{c as m}from"./p-6c094f3f.js";function v(t){return"function"==typeof t?t():t}function y(){var t={};return t.promise=new Promise((function(i,s){t.resolve=i,t.reject=s})),t}function g(t){var i=null,s=null,e=new Promise((function(t,e){i=t,s=e}));return t&&t.then((function(t){i&&i(t)}),(function(t){s&&s(t)})),{promise:e,resolve:function(t){i&&i(t)},reject:function(t){s&&s(t)},cancel:function(){i=null,s=null}}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
6
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
|
|
8
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
9
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
10
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
11
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
12
|
-
|
|
13
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
|
-
and limitations under the License.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
var b=function(){return(b=Object.assign||function(t){for(var i,s=1,e=arguments.length;s<e;s++)for(var n in i=arguments[s])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t}).apply(this,arguments)},w={key:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return null},onlyResolvesLast:!0},C=function(){function t(t){this.config=t,this.debounceSingleton=null,this.debounceCache={}}return t.prototype._createDebouncedFunction=function(){var t,i,s=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=void 0,n=void 0,h=void 0,r=[];return function(){var l=v(i),a=(new Date).getTime(),c=!e||a-e>l;e=a;for(var u=arguments.length,d=Array(u),f=0;f<u;f++)d[f]=arguments[f];if(c&&s.leading)return s.accumulate?Promise.resolve(t.call(this,[d])).then((function(t){return t[0]})):Promise.resolve(t.call.apply(t,[this].concat(d)));if(n?clearTimeout(h):n=y(),r.push(d),h=setTimeout(o.bind(this),l),s.accumulate){var p=r.length-1;return n.promise.then((function(t){return t[p]}))}return n.promise};function o(){var i=n;clearTimeout(h),Promise.resolve(s.accumulate?t.call(this,r):t.apply(this,r[r.length-1])).then(i.resolve,i.reject),r=[],n=null}}(this.config.func,this.config.wait,this.config.options);return this.config.options.onlyResolvesLast&&(t=s,i=null,s=function(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];i&&i();var n=g(t.apply(void 0,s));return i=n.cancel,n.promise}),{func:s}},t.prototype.getDebouncedFunction=function(t){var i,s=(i=this.config.options).key.apply(i,t);return null==s?(this.debounceSingleton||(this.debounceSingleton=this._createDebouncedFunction()),this.debounceSingleton):(this.debounceCache[s]||(this.debounceCache[s]=this._createDebouncedFunction()),this.debounceCache[s])},t}();let D=class{constructor(s){t(this,s),this.change=i(this,"change",7),this.interact=i(this,"interact",7),this.action=i(this,"action",7),this.disabled=!1,this.readonly=!1,this.required=!1,this.multiple=!1,this.delimiter=null,this.actions=[],this.actionPosition="bottom",this.actionScrollBehavior="sticky",this.badgeIcons=!0,this.textValue="",this.loading=!1,this.chips=[],this.chipSetEditMode=!1,this.handleTextInput=this.handleTextInput.bind(this),this.handleInputKeyDown=this.handleInputKeyDown.bind(this),this.handleDropdownKeyDown=this.handleDropdownKeyDown.bind(this),this.handleInputFieldFocus=this.handleInputFieldFocus.bind(this),this.handleChange=this.handleChange.bind(this),this.handleInteract=this.handleInteract.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleActionListChange=this.handleActionListChange.bind(this),this.handleStopEditAndBlur=this.handleStopEditAndBlur.bind(this),this.createDebouncedSearcher=this.createDebouncedSearcher.bind(this),this.handleCloseMenu=this.handleCloseMenu.bind(this),this.onListKeyDown=this.onListKeyDown.bind(this),this.portalId=m()}componentWillLoad(){this.chips=this.createChips(this.value)}componentDidLoad(){this.createDebouncedSearcher(this.searcher),this.chipSet=this.host.shadowRoot.querySelector("limel-chip-set")}async componentWillUpdate(){this.chipSetEditMode=!1,this.chipSet&&(this.chipSetEditMode=await this.chipSet.getEditMode())}render(){this.chips.forEach((t=>{"iconBackgroundColor"in t&&t.iconBackgroundColor&&(t.iconFillColor="rgb(var(--color-white))")}));const t={};return this.multiple||(t.maxItems=1),[s("limel-chip-set",Object.assign({type:"input",label:this.label,helperText:this.helperText,leadingIcon:this.leadingIcon,value:this.chips,disabled:this.disabled,delimiter:this.renderDelimiter(),readonly:this.readonly,required:this.required,searchLabel:this.searchLabel,onInput:this.handleTextInput,onKeyDown:this.handleInputKeyDown,onChange:this.handleChange,onInteract:this.handleInteract,onStartEdit:this.handleInputFieldFocus,onStopEdit:this.handleStopEditAndBlur,emptyInputOnBlur:!1,clearAllButton:this.multiple},t)),this.renderDropdown()]}onChangeValue(){this.chips=this.createChips(this.value)}createDebouncedSearcher(t){var i,s,e;"function"==typeof t&&(this.debouncedSearch=(i=t,500,s=b({},w,undefined),e=new C({func:i,wait:500,options:s}),function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return e.getDebouncedFunction(t).func.apply(void 0,t)}))}renderDelimiter(){return this.multiple?this.delimiter:null}createChips(t){return t?this.multiple?t.map(this.createChip):[this.createChip(t)]:[]}createChip(t){return{id:`${t.value}`,text:t.text,removable:!0,icon:t.icon,iconBackgroundColor:t.iconColor,value:t}}renderDropdown(){const t=this.getDropdownContent(),i=[];if(this.shouldShowDropDownContent()){const s=this.getActionContent();"top"===this.actionPosition&&i.push(s),t&&i.push(t),"bottom"===this.actionPosition&&i.push(s)}return this.renderPortal(i)}getActionContent(){var t,i;return 0===(null!==(i=null===(t=this.actions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)?null:[s("limel-list",{class:{"static-actions-list":!0,"is-on-top":"top"===this.actionPosition,"is-at-bottom":"bottom"===this.actionPosition,"has-position-sticky":"sticky"===this.actionScrollBehavior},badgeIcons:!0,type:"selectable",onChange:this.handleActionListChange,items:this.actions.map(this.removeUnusedPropertiesOnAction)})]}removeUnusedPropertiesOnAction(t){return Object.assign(Object.assign({},t),{actions:[]})}shouldShowDropDownContent(){return!this.isFull()&&!!this.chipSetEditMode}getDropdownContent(){if(this.shouldShowDropDownContent())return this.loading?this.renderSpinner():this.items&&this.items.length?this.renderListResult():this.renderEmptyMessage()}isFull(){return!this.multiple&&!!this.value}renderSpinner(){return s("div",{style:{width:"100%",display:"flex","align-items":"center","justify-content":"center",padding:"1rem 0"}},s("limel-spinner",{limeBranded:!1}))}renderEmptyMessage(){if(this.emptyResultMessage)return s("p",{style:{color:"var(--lime-light-grey, #{$lime-light-grey})","text-align":"center"}},this.emptyResultMessage)}renderListResult(){const t=this.items.some((t=>"icon"in t&&!!t.icon));return s("limel-list",{badgeIcons:t&&this.badgeIcons,onChange:this.handleListChange,onKeyDown:this.onListKeyDown,type:"selectable",items:this.items})}onListKeyDown(t){const i=[h,r,o].includes(t.key),s=[l,a,c].includes(t.keyCode);(i||s)&&this.chipSet.setFocus()}renderPortal(t=[]){const i=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index");return s("limel-portal",{visible:t.length>0,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":i}},s("limel-menu-surface",{open:t.length>0,allowClicksElement:this.host,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},t))}handleStopEditAndBlur(){const t=this.host.shadowRoot.activeElement||document.activeElement,i=document.querySelector(`#${this.portalId}`);n(t,this.host)||n(t,i)||this.clearInputField()}async handleTextInput(t){t.stopPropagation();const i=t.detail;this.textValue=i,this.loading=!0;const s=""===i?this.searcher:this.debouncedSearch,e=await s(i);this.handleSearchResult(i,e)}handleListChange(t){var i;if(t.stopPropagation(),!this.value||this.value!==t.detail){let i=t.detail;this.multiple&&(i=[...this.value,t.detail]),this.change.emit(i),this.items=[]}this.multiple&&(null===(i=this.chipSet)||void 0===i||i.setFocus(!0))}handleActionListChange(t){t.stopPropagation(),t.detail&&(this.action.emit(t.detail.value),this.items=[])}async handleInputFieldFocus(){this.loading=!0;const t=this.textValue,i=await this.searcher(t);this.handleSearchResult(t,i)}handleChange(t){t.stopPropagation();let i=null;this.multiple&&(i=t.detail.map((t=>this.value.find((i=>`${i.value}`===t.id))))),this.change.emit(i)}handleInteract(t){t.stopPropagation(),this.interact.emit(t.detail?t.detail.value:t.detail)}handleInputKeyDown(t){const i=!(t.key!==h&&t.keyCode!==l||t.altKey||t.metaKey||t.shiftKey),s=t.key===u||t.keyCode===d,e=t.key===f||t.keyCode===p;if(!i&&!s&&!e)return;const n=document.querySelector(` #${this.portalId} limel-list`);n&&(t.preventDefault(),i||e?n.shadowRoot.querySelector(".mdc-deprecated-list-item:first-child").focus():s&&n.shadowRoot.querySelector(".mdc-deprecated-list-item:last-child").focus())}handleDropdownKeyDown(t){(t.key===r||t.keyCode===a)&&(t.preventDefault(),this.textValue="",this.chipSet.setFocus(!0))}handleSearchResult(t,i){if(t===this.textValue){if(this.items=i,this.multiple){const t=this.value;this.items=i.filter((i=>!t.includes(i)))}this.loading=!1}}handleCloseMenu(){this.clearInputField()}clearInputField(){this.chipSet.emptyInput(),this.textValue="",this.handleSearchResult("",[])}get host(){return e(this)}static get watchers(){return{value:["onChangeValue"],searcher:["createDebouncedSearcher"]}}};D.style=":host{position:relative;display:block}:host([hidden]){display:none}";export{D as limel_picker}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import{M as t,a as n}from"./p-076bd4dc.js";import{m as i}from"./p-dcc97cc2.js";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2019 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
|
-
*/function e(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var n=!1;try{var i={get passive(){return n=!0,!1}},e=function(){};t.document.addEventListener("test",e,i),t.document.removeEventListener("test",e,i)}catch(t){n=!1}return n}
|
|
24
|
-
/*! *****************************************************************************
|
|
25
|
-
Copyright (c) Microsoft Corporation.
|
|
26
|
-
|
|
27
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
28
|
-
purpose with or without fee is hereby granted.
|
|
29
|
-
|
|
30
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
31
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
32
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
33
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
34
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
35
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
36
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
37
|
-
***************************************************************************** */(t)&&{passive:!0}}var r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function s(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var o,u=function(){return(u=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)},c={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},a={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},h={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},f=["touchstart","pointerdown","mousedown","keydown"],d=["touchend","pointerup","mouseup","contextmenu"],l=[],v=function(t){function n(i){var e=t.call(this,u(u({},n.defaultAdapter),i))||this;return e.activationAnimationHasEnded_=!1,e.activationTimer_=0,e.fgDeactivationRemovalTimer_=0,e.fgScale_="0",e.frame_={width:0,height:0},e.initialSize_=0,e.layoutFrame_=0,e.maxRadius_=0,e.unboundedCoords_={left:0,top:0},e.activationState_=e.defaultActivationState_(),e.activationTimerCallback_=function(){e.activationAnimationHasEnded_=!0,e.runDeactivationUXLogicIfReady_()},e.activateHandler_=function(t){return e.activate_(t)},e.deactivateHandler_=function(){return e.deactivate_()},e.focusHandler_=function(){return e.handleFocus()},e.blurHandler_=function(){return e.handleBlur()},e.resizeHandler_=function(){return e.layout()},e}return s(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return c},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return a},enumerable:!1,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return h},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),n.prototype.init=function(){var t=this,i=this.supportsPressRipple_();if(this.registerRootHandlers_(i),i){var e=n.cssClasses,r=e.ROOT,s=e.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(r),t.adapter.isUnbounded()&&(t.adapter.addClass(s),t.layoutInternal_())}))}},n.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(n.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(n.cssClasses.FG_DEACTIVATION));var i=n.cssClasses,e=i.ROOT,r=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(e),t.adapter.removeClass(r),t.removeCssVars_()}))}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},n.prototype.activate=function(t){this.activate_(t)},n.prototype.deactivate=function(){this.deactivate_()},n.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},n.prototype.setUnbounded=function(t){var i=n.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(n.cssClasses.BG_FOCUSED)}))},n.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(n.cssClasses.BG_FOCUSED)}))},n.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},n.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},n.prototype.registerRootHandlers_=function(t){var n=this;t&&(f.forEach((function(t){n.adapter.registerInteractionHandler(t,n.activateHandler_)})),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},n.prototype.registerDeactivationHandlers_=function(t){var n=this;"keydown"===t.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):d.forEach((function(t){n.adapter.registerDocumentInteractionHandler(t,n.deactivateHandler_)}))},n.prototype.deregisterRootHandlers_=function(){var t=this;f.forEach((function(n){t.adapter.deregisterInteractionHandler(n,t.activateHandler_)})),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},n.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),d.forEach((function(n){t.adapter.deregisterDocumentInteractionHandler(n,t.deactivateHandler_)}))},n.prototype.removeCssVars_=function(){var t=this,i=n.strings;Object.keys(i).forEach((function(n){0===n.indexOf("VAR_")&&t.adapter.updateCssVariable(i[n],null)}))},n.prototype.activate_=function(t){var n=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState_;if(!i.isActivated){var e=this.previousActivationEvent_;e&&void 0!==t&&e.type!==t.type||(i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&l.length>0&&l.some((function(t){return n.adapter.containsEventTarget(t)}))?this.resetActivationState_():(void 0!==t&&(l.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame((function(){l=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=n.checkElementMadeActive_(t),i.wasElementMadeActive&&n.animateActivation_()),i.wasElementMadeActive||(n.activationState_=n.defaultActivationState_())}))))}}},n.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},n.prototype.animateActivation_=function(){var t=this,i=n.strings,e=i.VAR_FG_TRANSLATE_START,r=i.VAR_FG_TRANSLATE_END,s=n.cssClasses,o=s.FG_DEACTIVATION,u=s.FG_ACTIVATION,c=n.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var a="",h="";if(!this.adapter.isUnbounded()){var f=this.getFgTranslationCoordinates_(),d=f.startPoint,l=f.endPoint;a=d.x+"px, "+d.y+"px",h=l.x+"px, "+l.y+"px"}this.adapter.updateCssVariable(e,a),this.adapter.updateCssVariable(r,h),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(o),this.adapter.computeBoundingRect(),this.adapter.addClass(u),this.activationTimer_=setTimeout((function(){return t.activationTimerCallback_()}),c)},n.prototype.getFgTranslationCoordinates_=function(){var t,n=this.activationState_;return{startPoint:t={x:(t=n.wasActivatedByPointer?function(t,n,i){if(!t)return{x:0,y:0};var e,r,s=n.x+i.left,o=n.y+i.top;return"touchstart"===t.type?(e=t.changedTouches[0].pageX-s,r=t.changedTouches[0].pageY-o):(e=t.pageX-s,r=t.pageY-o),{x:e,y:r}}
|
|
38
|
-
/**
|
|
39
|
-
* @license
|
|
40
|
-
* Copyright 2016 Google Inc.
|
|
41
|
-
*
|
|
42
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
43
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
44
|
-
* in the Software without restriction, including without limitation the rights
|
|
45
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
46
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
47
|
-
* furnished to do so, subject to the following conditions:
|
|
48
|
-
*
|
|
49
|
-
* The above copyright notice and this permission notice shall be included in
|
|
50
|
-
* all copies or substantial portions of the Software.
|
|
51
|
-
*
|
|
52
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
53
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
54
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
55
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
56
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
57
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
58
|
-
* THE SOFTWARE.
|
|
59
|
-
*/(n.activationEvent,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},n.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,i=n.cssClasses.FG_DEACTIVATION,e=this.activationState_;(e.hasDeactivationUXRun||!e.isActivated)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer_=setTimeout((function(){t.adapter.removeClass(i)}),h.FG_DEACTIVATION_MS))},n.prototype.rmBoundedActivationClasses_=function(){this.adapter.removeClass(n.cssClasses.FG_ACTIVATION),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},n.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout((function(){return t.previousActivationEvent_=void 0}),n.numbers.TAP_DELAY_MS)},n.prototype.deactivate_=function(){var t=this,n=this.activationState_;if(n.isActivated){var i=u({},n);n.isProgrammatic?(requestAnimationFrame((function(){return t.animateDeactivation_(i)})),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame((function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(i),t.resetActivationState_()})))}},n.prototype.animateDeactivation_=function(t){(t.wasActivatedByPointer||t.wasElementMadeActive)&&this.runDeactivationUXLogicIfReady_()},n.prototype.layoutInternal_=function(){this.frame_=this.adapter.computeBoundingRect();var t=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?t:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+n.numbers.PADDING;var i=Math.floor(t*n.numbers.INITIAL_ORIGIN_SCALE);this.initialSize_=this.adapter.isUnbounded()&&i%2!=0?i-1:i,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},n.prototype.updateLayoutCssVars_=function(){var t=n.strings,i=t.VAR_LEFT,e=t.VAR_TOP,r=t.VAR_FG_SCALE;this.adapter.updateCssVariable(t.VAR_FG_SIZE,this.initialSize_+"px"),this.adapter.updateCssVariable(r,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(i,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(e,this.unboundedCoords_.top+"px"))},n}(t),p=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.disabled=!1,n}return s(n,t),n.attachTo=function(t,i){void 0===i&&(i={isUnbounded:void 0});var e=new n(t);return void 0!==i.isUnbounded&&(e.unbounded=i.isUnbounded),e},n.createAdapter=function(t){return{addClass:function(n){return t.root.classList.add(n)},browserSupportsCssVars:function(){return function(t,n){void 0===n&&(n=!1);var i,e=window.CSS;if("boolean"==typeof o&&!n)return o;if(!e||"function"!=typeof e.supports)return!1;var r=e.supports("--css-vars","yes"),s=e.supports("(--css-vars: yes)")&&e.supports("color","#00000000");return i=r||s,n||(o=i),i}()},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(n){return t.root.contains(n)},deregisterDocumentInteractionHandler:function(t,n){return document.documentElement.removeEventListener(t,n,e())},deregisterInteractionHandler:function(n,i){return t.root.removeEventListener(n,i,e())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return i(t.root,":active")},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,n){return document.documentElement.addEventListener(t,n,e())},registerInteractionHandler:function(n,i){return t.root.addEventListener(n,i,e())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(n){return t.root.classList.remove(n)},updateCssVariable:function(n,i){return t.root.style.setProperty(n,i)}}},Object.defineProperty(n.prototype,"unbounded",{get:function(){return Boolean(this.unbounded_)},set:function(t){this.unbounded_=Boolean(t),this.setUnbounded_()},enumerable:!1,configurable:!0}),n.prototype.activate=function(){this.foundation.activate()},n.prototype.deactivate=function(){this.foundation.deactivate()},n.prototype.layout=function(){this.foundation.layout()},n.prototype.getDefaultFoundation=function(){return new v(n.createAdapter(this))},n.prototype.initialSyncWithDOM=function(){this.unbounded="mdcRippleIsUnbounded"in this.root.dataset},n.prototype.setUnbounded_=function(){this.foundation.setUnbounded(Boolean(this.unbounded_))},n}(n);
|
|
60
|
-
/**
|
|
61
|
-
* @license
|
|
62
|
-
* Copyright 2016 Google Inc.
|
|
63
|
-
*
|
|
64
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
65
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
66
|
-
* in the Software without restriction, including without limitation the rights
|
|
67
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
68
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
69
|
-
* furnished to do so, subject to the following conditions:
|
|
70
|
-
*
|
|
71
|
-
* The above copyright notice and this permission notice shall be included in
|
|
72
|
-
* all copies or substantial portions of the Software.
|
|
73
|
-
*
|
|
74
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
75
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
76
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
77
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
78
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
79
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
80
|
-
* THE SOFTWARE.
|
|
81
|
-
*/export{p as M,e as a,v as b}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import{M as t,a as i}from"./p-076bd4dc.js";import{m as n,c as e}from"./p-dcc97cc2.js";import{n as s}from"./p-6e219bb4.js";import{g as r}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 o,u,h={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"},c={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(", ")},f={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(o||(o={})),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"}(u||(u={}));
|
|
24
|
-
/*! *****************************************************************************
|
|
25
|
-
Copyright (c) Microsoft Corporation.
|
|
26
|
-
|
|
27
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
28
|
-
purpose with or without fee is hereby granted.
|
|
29
|
-
|
|
30
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
31
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
32
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
33
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
34
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
35
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
36
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
37
|
-
***************************************************************************** */
|
|
38
|
-
var a=function(t,i){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])})(t,i)};function d(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}a(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var l,m,b=function(){return(b=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var s in i=arguments[n])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t}).apply(this,arguments)},I={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"},E=((l={})[""+I.LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",l[""+I.LIST_ITEM_CLASS]="mdc-list-item",l[""+I.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",l[""+I.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",l[""+I.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",l[""+I.ROOT]="mdc-list",l),A=((m={})[""+I.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",m[""+I.LIST_ITEM_CLASS]="mdc-deprecated-list-item",m[""+I.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",m[""+I.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",m[""+I.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",m[""+I.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",m[""+I.ROOT]="mdc-deprecated-list",m),v={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 ."+I.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+I.LIST_ITEM_CLASS+" a,\n ."+A[I.LIST_ITEM_CLASS]+" button:not(:disabled),\n ."+A[I.LIST_ITEM_CLASS]+" a\n ",DEPRECATED_SELECTOR:".mdc-deprecated-list",FOCUSABLE_CHILD_ELEMENTS:"\n ."+I.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+I.LIST_ITEM_CLASS+" a,\n ."+I.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+I.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled),\n .'+A[I.LIST_ITEM_CLASS]+" button:not(:disabled),\n ."+A[I.LIST_ITEM_CLASS]+" a,\n ."+A[I.LIST_ITEM_CLASS]+' input[type="radio"]:not(:disabled),\n .'+A[I.LIST_ITEM_CLASS]+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'},T={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},x=["input","button","textarea","select"],C=function(t){var i=t.target;if(i){var n=(""+i.tagName).toLowerCase();-1===x.indexOf(n)&&t.preventDefault()}};
|
|
39
|
-
/**
|
|
40
|
-
* @license
|
|
41
|
-
* Copyright 2018 Google Inc.
|
|
42
|
-
*
|
|
43
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
44
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
45
|
-
* in the Software without restriction, including without limitation the rights
|
|
46
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
47
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
48
|
-
* furnished to do so, subject to the following conditions:
|
|
49
|
-
*
|
|
50
|
-
* The above copyright notice and this permission notice shall be included in
|
|
51
|
-
* all copies or substantial portions of the Software.
|
|
52
|
-
*
|
|
53
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
54
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
55
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
56
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
57
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
58
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
59
|
-
* THE SOFTWARE.
|
|
60
|
-
*/function O(t,i){var n,e=t.nextChar,s=t.focusItemAtIndex,r=t.sortedIndexByFirstChar,o=t.focusedItemIndex,u=t.skipFocus,h=t.isItemAtIndexDisabled;return clearTimeout(i.bufferClearTimeout),i.bufferClearTimeout=setTimeout((function(){p(i)}),T.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),i.typeaheadBuffer=i.typeaheadBuffer+e,-1===(n=1===i.typeaheadBuffer.length?function(t,i,n,e){var s=e.typeaheadBuffer[0],r=t.get(s);if(!r)return-1;if(s===e.currentFirstChar&&r[e.sortedIndexCursor].index===i){e.sortedIndexCursor=(e.sortedIndexCursor+1)%r.length;var o=r[e.sortedIndexCursor].index;if(!n(o))return o}e.currentFirstChar=s;var u,h=-1;for(u=0;u<r.length;u++)if(!n(r[u].index)){h=u;break}for(;u<r.length;u++)if(r[u].index>i&&!n(r[u].index)){h=u;break}return-1!==h?(e.sortedIndexCursor=h,r[e.sortedIndexCursor].index):-1}(r,o,h,i):function(t,i,n){var e=t.get(n.typeaheadBuffer[0]);if(!e)return-1;var s=e[n.sortedIndexCursor];if(0===s.text.lastIndexOf(n.typeaheadBuffer,0)&&!i(s.index))return s.index;for(var r=(n.sortedIndexCursor+1)%e.length,o=-1;r!==n.sortedIndexCursor;){var u=e[r],h=0===u.text.lastIndexOf(n.typeaheadBuffer,0),c=!i(u.index);if(h&&c){o=r;break}r=(r+1)%e.length}return-1!==o?(n.sortedIndexCursor=o,e[n.sortedIndexCursor].index):-1}(r,h,i))||u||s(n),n}function _(t){return t.typeaheadBuffer.length>0}function p(t){t.typeaheadBuffer=""}function g(t,i){var n=t.event,e=t.isTargetListItem,r=t.focusedItemIndex,o=t.focusItemAtIndex,u=t.sortedIndexByFirstChar,h=t.isItemAtIndexDisabled,c="ArrowLeft"===s(n),f="ArrowUp"===s(n),a="ArrowRight"===s(n),d="ArrowDown"===s(n),l="Home"===s(n),m="End"===s(n),b="Enter"===s(n),I="Spacebar"===s(n);return n.ctrlKey||n.metaKey||c||f||a||d||l||m||b?-1:I||1!==n.key.length?I?(e&&C(n),e&&_(i)?O({focusItemAtIndex:o,focusedItemIndex:r,nextChar:" ",sortedIndexByFirstChar:u,skipFocus:!1,isItemAtIndexDisabled:h},i):-1):-1:(C(n),O({focusItemAtIndex:o,focusedItemIndex:r,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:u,skipFocus:!1,isItemAtIndexDisabled:h},i))}
|
|
61
|
-
/**
|
|
62
|
-
* @license
|
|
63
|
-
* Copyright 2018 Google Inc.
|
|
64
|
-
*
|
|
65
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
66
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
67
|
-
* in the Software without restriction, including without limitation the rights
|
|
68
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
69
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
70
|
-
* furnished to do so, subject to the following conditions:
|
|
71
|
-
*
|
|
72
|
-
* The above copyright notice and this permission notice shall be included in
|
|
73
|
-
* all copies or substantial portions of the Software.
|
|
74
|
-
*
|
|
75
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
76
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
77
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
78
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
79
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
80
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
81
|
-
* THE SOFTWARE.
|
|
82
|
-
*/var y=function(t){function i(n){var e=t.call(this,b(b({},i.defaultAdapter),n))||this;return e.wrapFocus_=!1,e.isVertical_=!0,e.isSingleSelectionList_=!1,e.selectedIndex_=T.UNSET_INDEX,e.focusedItemIndex=T.UNSET_INDEX,e.useActivatedClass_=!1,e.useSelectedAttr_=!1,e.ariaCurrentAttrValue_=null,e.isCheckboxList_=!1,e.isRadioList_=!1,e.hasTypeahead=!1,e.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},e.sortedIndexByFirstChar=new Map,e}return d(i,t),Object.defineProperty(i,"strings",{get:function(){return v},enumerable:!1,configurable:!0}),Object.defineProperty(i,"cssClasses",{get:function(){return I},enumerable:!1,configurable:!0}),Object.defineProperty(i,"numbers",{get:function(){return T},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!1,configurable:!0}),i.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList_=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},i.prototype.setWrapFocus=function(t){this.wrapFocus_=t},i.prototype.setVerticalOrientation=function(t){this.isVertical_=t},i.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t,t&&this.maybeInitializeSingleSelection()},i.prototype.maybeInitializeSingleSelection=function(){for(var t=this.adapter.getListItemCount(),i=0;i<t;i++){var n=this.adapter.listItemAtIndexHasClass(i,I.LIST_ITEM_SELECTED_CLASS),e=this.adapter.listItemAtIndexHasClass(i,I.LIST_ITEM_ACTIVATED_CLASS);if(n||e)return e&&this.setUseActivatedClass(!0),this.isSingleSelectionList_=!0,void(this.selectedIndex_=i)}},i.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},i.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&_(this.typeaheadState)},i.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},i.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr_=t},i.prototype.getSelectedIndex=function(){return this.selectedIndex_},i.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},i.prototype.handleFocusIn=function(t,i){i>=0&&(this.focusedItemIndex=i,this.adapter.setAttributeForElementIndex(i,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(i,"0"))},i.prototype.handleFocusOut=function(t,i){var n=this;i>=0&&(this.adapter.setAttributeForElementIndex(i,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(i,"-1")),setTimeout((function(){n.adapter.isFocusInsideList()||n.setTabindexToFirstSelectedOrFocusedItem()}),0)},i.prototype.handleKeydown=function(t,i,n){var e=this,r="ArrowLeft"===s(t),o="ArrowUp"===s(t),u="ArrowRight"===s(t),h="ArrowDown"===s(t),c="Home"===s(t),f="End"===s(t),a="Enter"===s(t),d="Spacebar"===s(t),l="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused())o||f?(t.preventDefault(),this.focusLastElement()):(h||c)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead&&g({event:t,focusItemAtIndex:function(t){e.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:i,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return e.adapter.listItemAtIndexHasClass(t,I.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState);else{var m=this.adapter.getFocusedElementIndex();if(!(-1===m&&(m=n)<0)){if(this.isVertical_&&h||!this.isVertical_&&u)C(t),this.focusNextElement(m);else if(this.isVertical_&&o||!this.isVertical_&&r)C(t),this.focusPrevElement(m);else if(c)C(t),this.focusFirstElement();else if(f)C(t),this.focusLastElement();else if(l&&t.ctrlKey&&this.isCheckboxList_)t.preventDefault(),this.toggleAll(this.selectedIndex_===T.UNSET_INDEX?[]:this.selectedIndex_);else if((a||d)&&i){var b=t.target;if(b&&"A"===b.tagName&&a)return;if(C(t),this.adapter.listItemAtIndexHasClass(m,I.LIST_ITEM_DISABLED_CLASS))return;this.isTypeaheadInProgress()||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(m),this.adapter.notifyAction(m))}this.hasTypeahead&&g({event:t,focusItemAtIndex:function(t){e.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:i,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return e.adapter.listItemAtIndexHasClass(t,I.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)}}},i.prototype.handleClick=function(t,i){t!==T.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,I.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(t,i),this.adapter.notifyAction(t)))},i.prototype.focusNextElement=function(t){var i=t+1;if(i>=this.adapter.getListItemCount()){if(!this.wrapFocus_)return t;i=0}return this.focusItemAtIndex(i),i},i.prototype.focusPrevElement=function(t){var i=t-1;if(i<0){if(!this.wrapFocus_)return t;i=this.adapter.getListItemCount()-1}return this.focusItemAtIndex(i),i},i.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},i.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},i.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},i.prototype.setEnabled=function(t,i){this.isIndexValid_(t)&&(i?(this.adapter.removeClassForElementIndex(t,I.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,v.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,I.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,v.ARIA_DISABLED,"true")))},i.prototype.setSingleSelectionAtIndex_=function(t){if(this.selectedIndex_!==t){var i=I.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(i=I.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==T.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex_,i),this.setAriaForSingleSelectionAtIndex_(t),this.setTabindexAtIndex(t),t!==T.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,i),this.selectedIndex_=t}},i.prototype.setAriaForSingleSelectionAtIndex_=function(t){this.selectedIndex_===T.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(t,v.ARIA_CURRENT));var i=null!==this.ariaCurrentAttrValue_,n=i?v.ARIA_CURRENT:v.ARIA_SELECTED;this.selectedIndex_!==T.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,n,"false"),t!==T.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,n,i?this.ariaCurrentAttrValue_:"true")},i.prototype.getSelectionAttribute=function(){return this.useSelectedAttr_?v.ARIA_SELECTED:v.ARIA_CHECKED},i.prototype.setRadioAtIndex_=function(t){var i=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex_!==T.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,i,"false"),this.adapter.setAttributeForElementIndex(t,i,"true"),this.selectedIndex_=t},i.prototype.setCheckboxAtIndex_=function(t){for(var i=this.getSelectionAttribute(),n=0;n<this.adapter.getListItemCount();n++){var e=!1;t.indexOf(n)>=0&&(e=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(n,e),this.adapter.setAttributeForElementIndex(n,i,e?"true":"false")}this.selectedIndex_=t},i.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===T.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex_ instanceof Array||this.selectedIndex_===t||this.adapter.setAttributeForElementIndex(this.selectedIndex_,"tabindex","-1"),t!==T.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},i.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},i.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},i.prototype.getFirstSelectedOrFocusedItemIndex=function(){var t=this.focusedItemIndex>=0?this.focusedItemIndex:0;return this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==T.UNSET_INDEX?t=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(t=this.selectedIndex_.reduce((function(t,i){return Math.min(t,i)})))),t},i.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");return 0===t.length||t.some((function(t){return i.isIndexInRange_(t)}))}if("number"==typeof t){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===T.UNSET_INDEX}return!1},i.prototype.isIndexInRange_=function(t){var i=this.adapter.getListItemCount();return t>=0&&t<i},i.prototype.setSelectedIndexOnAction_=function(t,i){void 0===i&&(i=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,i):this.setSelectedIndex(t)},i.prototype.toggleCheckboxAtIndex_=function(t,i){var n=this.getSelectionAttribute(),e=this.adapter.isCheckboxCheckedAtIndex(t);i&&this.adapter.setCheckedCheckboxOrRadioAtIndex(t,e=!e),this.adapter.setAttributeForElementIndex(t,n,e?"true":"false");var s=this.selectedIndex_===T.UNSET_INDEX?[]:this.selectedIndex_.slice();e?s.push(t):s=s.filter((function(i){return i!==t})),this.selectedIndex_=s},i.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},i.prototype.toggleAll=function(t){var i=this.adapter.getListItemCount();if(t.length===i)this.setCheckboxAtIndex_([]);else{for(var n=[],e=0;e<i;e++)(!this.adapter.listItemAtIndexHasClass(e,I.LIST_ITEM_DISABLED_CLASS)||t.indexOf(e)>-1)&&n.push(e);this.setCheckboxAtIndex_(n)}},i.prototype.typeaheadMatchItem=function(t,i,n){var e=this;return void 0===n&&(n=!1),O({focusItemAtIndex:function(t){e.focusItemAtIndex(t)},focusedItemIndex:i||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(t){return e.adapter.listItemAtIndexHasClass(t,I.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},i.prototype.typeaheadInitSortedIndex=function(){return function(t,i){for(var n=new Map,e=0;e<t;e++){var s=i(e).trim();if(s){var r=s[0].toLowerCase();n.has(r)||n.set(r,[]),n.get(r).push({text:s.toLowerCase(),index:e})}}return n.forEach((function(t){t.sort((function(t,i){return t.index-i.index}))})),n}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},i.prototype.clearTypeaheadBuffer=function(){p(this.typeaheadState)},i}(t),S=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return d(i,t),Object.defineProperty(i.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[I.LIST_ITEM_CLASS]))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!1,configurable:!0}),i.attachTo=function(t){return new i(t)},i.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled="evolution"in this.root.dataset,this.classNameMap=this.isEvolutionEnabled?E:n(this.root,v.DEPRECATED_SELECTOR)?A:Object.values(I).reduce((function(t,i){return t[i]=i,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()},i.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.focusInEventListener),this.unlisten("focusout",this.focusOutEventListener)},i.prototype.layout=function(){var t=this.root.getAttribute(v.ARIA_ORIENTATION);this.vertical=t!==v.ARIA_ORIENTATION_HORIZONTAL;var i=v.FOCUSABLE_CHILD_ELEMENTS,n=this.root.querySelectorAll("."+this.classNameMap[I.LIST_ITEM_CLASS]+":not([tabindex])");n.length&&Array.prototype.forEach.call(n,(function(t){t.setAttribute("tabindex","-1")}));var e=this.root.querySelectorAll(i);e.length&&Array.prototype.forEach.call(e,(function(t){t.setAttribute("tabindex","-1")})),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},i.prototype.getPrimaryText=function(t){var i,n=t.querySelector("."+this.classNameMap[I.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||n)return null!==(i=null==n?void 0:n.textContent)&&void 0!==i?i:"";var e=t.querySelector("."+this.classNameMap[I.LIST_ITEM_TEXT_CLASS]);return e&&e.textContent||""},i.prototype.initializeListType=function(){var t=this;if(this.isInteractive=n(this.root,v.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var i=Array.from(this.root.querySelectorAll(v.SELECTED_ITEM_SELECTOR),(function(i){return t.listElements.indexOf(i)}));n(this.root,v.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=i:i.length>0&&(this.selectedIndex=i[0])}else{var e=this.root.querySelectorAll(v.ARIA_ROLE_CHECKBOX_SELECTOR),s=this.root.querySelector(v.ARIA_CHECKED_RADIO_SELECTOR);if(e.length){var r=this.root.querySelectorAll(v.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(r,(function(i){return t.listElements.indexOf(i)}))}else s&&(this.selectedIndex=this.listElements.indexOf(s))}},i.prototype.setEnabled=function(t,i){this.foundation.setEnabled(t,i)},i.prototype.typeaheadMatchItem=function(t,i){return this.foundation.typeaheadMatchItem(t,i,!0)},i.prototype.getDefaultFoundation=function(){var t=this;return new y({addClassForElementIndex:function(i,n){var e=t.listElements[i];e&&e.classList.add(t.classNameMap[n])},focusItemAtIndex:function(i){var n=t.listElements[i];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){return!!t.listElements[i].querySelector(v.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(i){return!!t.listElements[i].querySelector(v.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(i){return t.listElements[i].querySelector(v.CHECKBOX_SELECTOR).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(v.ACTION_EVENT,{index:i},!0)},removeClassForElementIndex:function(i,n){var e=t.listElements[i];e&&e.classList.remove(t.classNameMap[n])},setAttributeForElementIndex:function(i,n,e){var s=t.listElements[i];s&&s.setAttribute(n,e)},setCheckedCheckboxOrRadioAtIndex:function(i,n){var e=t.listElements[i].querySelector(v.CHECKBOX_RADIO_SELECTOR);e.checked=n;var s=document.createEvent("Event");s.initEvent("change",!0,!0),e.dispatchEvent(s)},setTabIndexForListItemChildren:function(i,n){Array.prototype.forEach.call(t.listElements[i].querySelectorAll(v.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX),(function(t){t.setAttribute("tabindex",n)}))}})},i.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[I.LIST_ITEM_CLASS]+'[tabindex="0"]')){var t=this.initialFocusIndex();-1!==t&&(this.listElements[t].tabIndex=0)}},i.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&this.selectedIndex.length>0)return this.selectedIndex[0];if("number"==typeof this.selectedIndex&&this.selectedIndex!==T.UNSET_INDEX)return this.selectedIndex;var t=this.root.querySelector("."+this.classNameMap[I.LIST_ITEM_CLASS]+":not(."+this.classNameMap[I.LIST_ITEM_DISABLED_CLASS]+")");return null===t?-1:this.getListItemIndex(t)},i.prototype.getListItemIndex=function(t){var i=e(t,"."+this.classNameMap[I.LIST_ITEM_CLASS]+", ."+this.classNameMap[I.ROOT]);return i&&n(i,"."+this.classNameMap[I.LIST_ITEM_CLASS])?this.listElements.indexOf(i):-1},i.prototype.handleFocusInEvent=function(t){var i=this.getListItemIndex(t.target);this.foundation.handleFocusIn(t,i)},i.prototype.handleFocusOutEvent=function(t){var i=this.getListItemIndex(t.target);this.foundation.handleFocusOut(t,i)},i.prototype.handleKeydownEvent=function(t){var i=this.getListItemIndex(t.target);this.foundation.handleKeydown(t,t.target.classList.contains(this.classNameMap[I.LIST_ITEM_CLASS]),i)},i.prototype.handleClickEvent=function(t){var i=this.getListItemIndex(t.target),e=!n(t.target,v.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(i,e)},i}(i),R=function(t,i){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])})(t,i)};
|
|
83
|
-
/**
|
|
84
|
-
* @license
|
|
85
|
-
* Copyright 2018 Google Inc.
|
|
86
|
-
*
|
|
87
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
88
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
89
|
-
* in the Software without restriction, including without limitation the rights
|
|
90
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
91
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
92
|
-
* furnished to do so, subject to the following conditions:
|
|
93
|
-
*
|
|
94
|
-
* The above copyright notice and this permission notice shall be included in
|
|
95
|
-
* all copies or substantial portions of the Software.
|
|
96
|
-
*
|
|
97
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
98
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
99
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
100
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
101
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
102
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
103
|
-
* THE SOFTWARE.
|
|
104
|
-
*/function L(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}R(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var w=function(){return(w=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var s in i=arguments[n])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t}).apply(this,arguments)},D=function(t){function i(n){var e=t.call(this,w(w({},i.defaultAdapter),n))||this;return e.isSurfaceOpen=!1,e.isQuickOpen=!1,e.isHoistedElement=!1,e.isFixedPosition=!1,e.isHorizontallyCenteredOnViewport=!1,e.maxHeight=0,e.openAnimationEndTimerId=0,e.closeAnimationEndTimerId=0,e.animationRequestId=0,e.anchorCorner=u.TOP_START,e.originCorner=u.TOP_START,e.anchorMargin={top:0,right:0,bottom:0,left:0},e.position={x:0,y:0},e}return L(i,t),Object.defineProperty(i,"cssClasses",{get:function(){return h},enumerable:!1,configurable:!0}),Object.defineProperty(i,"strings",{get:function(){return c},enumerable:!1,configurable:!0}),Object.defineProperty(i,"numbers",{get:function(){return f},enumerable:!1,configurable:!0}),Object.defineProperty(i,"Corner",{get:function(){return u},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){},notifyClosing:function(){}}},enumerable:!1,configurable:!0}),i.prototype.init=function(){var t=i.cssClasses,n=t.ROOT,e=t.OPEN;if(!this.adapter.hasClass(n))throw new Error(n+" class required in root element.");this.adapter.hasClass(e)&&(this.isSurfaceOpen=!0)},i.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},i.prototype.setAnchorCorner=function(t){this.anchorCorner=t},i.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^o.RIGHT},i.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},i.prototype.setIsHoisted=function(t){this.isHoistedElement=t},i.prototype.setFixedPosition=function(t){this.isFixedPosition=t},i.prototype.setAbsolutePosition=function(t,i){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(i)?i:0},i.prototype.setIsHorizontallyCenteredOnViewport=function(t){this.isHorizontallyCenteredOnViewport=t},i.prototype.setQuickOpen=function(t){this.isQuickOpen=t},i.prototype.setMaxHeight=function(t){this.maxHeight=t},i.prototype.isOpen=function(){return this.isSurfaceOpen},i.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(i.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(i.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame((function(){t.adapter.addClass(i.cssClasses.OPEN),t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.openAnimationEndTimerId=setTimeout((function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(i.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()}),f.TRANSITION_OPEN_DURATION)})),this.isSurfaceOpen=!0))},i.prototype.close=function(t){var n=this;if(void 0===t&&(t=!1),this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen)return this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(i.cssClasses.OPEN),this.adapter.removeClass(i.cssClasses.IS_OPEN_BELOW),void this.adapter.notifyClose();this.adapter.addClass(i.cssClasses.ANIMATING_CLOSED),requestAnimationFrame((function(){n.adapter.removeClass(i.cssClasses.OPEN),n.adapter.removeClass(i.cssClasses.IS_OPEN_BELOW),n.closeAnimationEndTimerId=setTimeout((function(){n.closeAnimationEndTimerId=0,n.adapter.removeClass(i.cssClasses.ANIMATING_CLOSED),n.adapter.notifyClose()}),f.TRANSITION_CLOSE_DURATION)})),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()}},i.prototype.handleBodyClick=function(t){this.adapter.isElementInContainer(t.target)||this.close()},i.prototype.handleKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&this.close()},i.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var n=this.getoriginCorner(),e=this.getMenuSurfaceMaxHeight(n),s=this.hasBit(n,o.BOTTOM)?"bottom":"top",r=this.hasBit(n,o.RIGHT)?"right":"left",u=this.getHorizontalOriginOffset(n),h=this.getVerticalOriginOffset(n),c=this.measurements,a=c.anchorSize,d=c.surfaceSize,l=((t={})[r]=u,t[s]=h,t);a.width/d.width>f.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(r="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(l),this.adapter.setTransformOrigin(r+" "+s),this.adapter.setPosition(l),this.adapter.setMaxHeight(e?e+"px":""),this.hasBit(n,o.BOTTOM)||this.adapter.addClass(i.cssClasses.IS_OPEN_BELOW)},i.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),i=this.adapter.getBodyDimensions(),n=this.adapter.getWindowDimensions(),e=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:i,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:n.width-t.right,bottom:n.height-t.bottom,left:t.left},viewportSize:n,windowScroll:e}},i.prototype.getoriginCorner=function(){var t,n,e=this.originCorner,s=this.measurements,r=s.viewportDistance,u=s.anchorSize,h=s.surfaceSize,c=i.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,o.BOTTOM)?(t=r.top-c+this.anchorMargin.bottom,n=r.bottom-c-this.anchorMargin.bottom):(t=r.top-c+this.anchorMargin.top,n=r.bottom-c+u.height-this.anchorMargin.top),!(n-h.height>0)&&t>n&&(e=this.setBit(e,o.BOTTOM));var f,a,d,l=this.adapter.isRtl(),m=this.hasBit(this.anchorCorner,o.FLIP_RTL),b=this.hasBit(this.anchorCorner,o.RIGHT)||this.hasBit(e,o.RIGHT);(d=l&&m?!b:b)?(f=r.left+u.width+this.anchorMargin.right,a=r.right-this.anchorMargin.right):(f=r.left+this.anchorMargin.left,a=r.right+u.width-this.anchorMargin.left);var I=f-h.width>0,E=a-h.width>0,A=this.hasBit(e,o.FLIP_RTL)&&this.hasBit(e,o.RIGHT);return E&&A&&l||!I&&A?e=this.unsetBit(e,o.RIGHT):(I&&d&&l||I&&!d&&b||!E&&f>=a)&&(e=this.setBit(e,o.RIGHT)),e},i.prototype.getMenuSurfaceMaxHeight=function(t){if(this.maxHeight>0)return this.maxHeight;var n=this.measurements.viewportDistance,e=0,s=this.hasBit(t,o.BOTTOM),r=this.hasBit(this.anchorCorner,o.BOTTOM),u=i.numbers.MARGIN_TO_EDGE;return s?(e=n.top+this.anchorMargin.top-u,r||(e+=this.measurements.anchorSize.height)):(e=n.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-u,r&&(e-=this.measurements.anchorSize.height)),e},i.prototype.getHorizontalOriginOffset=function(t){var i=this.measurements.anchorSize,n=this.hasBit(t,o.RIGHT),e=this.hasBit(this.anchorCorner,o.RIGHT);if(n){var s=e?i.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?s-(this.measurements.viewportSize.width-this.measurements.bodySize.width):s}return e?i.width-this.anchorMargin.right:this.anchorMargin.left},i.prototype.getVerticalOriginOffset=function(t){var i=this.measurements.anchorSize,n=this.hasBit(t,o.BOTTOM),e=this.hasBit(this.anchorCorner,o.BOTTOM);return n?e?i.height-this.anchorMargin.top:-this.anchorMargin.bottom:e?i.height+this.anchorMargin.bottom:this.anchorMargin.top},i.prototype.adjustPositionForHoistedElement=function(t){var i,n,e=this.measurements,s=e.windowScroll,r=e.viewportDistance,o=e.surfaceSize,u=e.viewportSize,h=Object.keys(t);try{for(var c=function(t){var i="function"==typeof Symbol&&Symbol.iterator,n=i&&t[i],e=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}
|
|
105
|
-
/**
|
|
106
|
-
* @license
|
|
107
|
-
* Copyright 2018 Google Inc.
|
|
108
|
-
*
|
|
109
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
110
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
111
|
-
* in the Software without restriction, including without limitation the rights
|
|
112
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
113
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
114
|
-
* furnished to do so, subject to the following conditions:
|
|
115
|
-
*
|
|
116
|
-
* The above copyright notice and this permission notice shall be included in
|
|
117
|
-
* all copies or substantial portions of the Software.
|
|
118
|
-
*
|
|
119
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
120
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
121
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
122
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
123
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
124
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
125
|
-
* THE SOFTWARE.
|
|
126
|
-
*/(h),f=c.next();!f.done;f=c.next()){var a=f.value,d=t[a]||0;!this.isHorizontallyCenteredOnViewport||"left"!==a&&"right"!==a?(d+=r[a],this.isFixedPosition||("top"===a?d+=s.y:"bottom"===a?d-=s.y:"left"===a?d+=s.x:d-=s.x),t[a]=d):t[a]=(u.width-o.width)/2}}catch(t){i={error:t}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}},i.prototype.maybeRestoreFocus=function(){var t=this.adapter.isFocused(),i=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(t||i)&&this.adapter.restoreFocus()},i.prototype.hasBit=function(t,i){return Boolean(t&i)},i.prototype.setBit=function(t,i){return t|i},i.prototype.unsetBit=function(t,i){return t^i},i.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},i}(t),F=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return L(i,t),i.attachTo=function(t){return new i(t)},i.prototype.initialSyncWithDOM=function(){var t=this,i=this.root.parentElement;this.anchorElement=i&&i.classList.contains(h.ANCHOR)?i:null,this.root.classList.contains(h.FIXED)&&this.setFixedPosition(!0),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:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(c.OPENED_EVENT,this.registerBodyClickListener),this.listen(c.CLOSED_EVENT,this.deregisterBodyClickListener)},i.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(c.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(c.CLOSED_EVENT,this.deregisterBodyClickListener),t.prototype.destroy.call(this)},i.prototype.isOpen=function(){return this.foundation.isOpen()},i.prototype.open=function(){this.foundation.open()},i.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(i.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!1,configurable:!0}),i.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},i.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},i.prototype.setFixedPosition=function(t){t?this.root.classList.add(h.FIXED):this.root.classList.remove(h.FIXED),this.foundation.setFixedPosition(t)},i.prototype.setAbsolutePosition=function(t,i){this.foundation.setAbsolutePosition(t,i),this.setIsHoisted(!0)},i.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},i.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},i.prototype.getDefaultFoundation=function(){var t=this;return new D({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(D.strings.CLOSED_EVENT,{})},notifyClosing:function(){t.emit(D.strings.CLOSING_EVENT,{})},notifyOpen:function(){return t.emit(D.strings.OPENED_EVENT,{})},isElementInContainer:function(i){return t.root.contains(i)},isRtl:function(){return"rtl"===getComputedStyle(t.root).getPropertyValue("direction")},setTransformOrigin:function(i){var n=r(window,"transform")+"-origin";t.root.style.setProperty(n,i)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){t.root.contains(document.activeElement)&&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}})},i}(i);export{u as C,D as M,y as a,F as b,I as c,S as d,T as n,v as s}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{r as t,c,h as r,g as e}from"./p-92146da6.js";import{c as i}from"./p-6c094f3f.js";import{M as a,a as o}from"./p-076bd4dc.js";import{M as n,a as d,b as s}from"./p-902347b9.js";import{m}from"./p-dcc97cc2.js";
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var h=function(t,c){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,c){t.__proto__=c}||function(t,c){for(var r in c)Object.prototype.hasOwnProperty.call(c,r)&&(t[r]=c[r])})(t,c)};function l(t,c){if("function"!=typeof c&&null!==c)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function r(){this.constructor=t}h(t,c),t.prototype=null===c?Object.create(c):(r.prototype=c.prototype,new r)}var u=function(){return(u=Object.assign||function(t){for(var c,r=1,e=arguments.length;r<e;r++)for(var i in c=arguments[r])Object.prototype.hasOwnProperty.call(c,i)&&(t[i]=c[i]);return t}).apply(this,arguments)};function p(t,c){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var e,i,a=r.call(t),o=[];try{for(;(void 0===c||c-- >0)&&!(e=a.next()).done;)o.push(e.value)}catch(t){i={error:t}}finally{try{e&&!e.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function f(t,c,r){if(r||2===arguments.length)for(var e,i=0,a=c.length;i<a;i++)!e&&i in c||(e||(e=Array.prototype.slice.call(c,0,i)),e[i]=c[i]);return t.concat(e||c)}
|
|
16
|
-
/**
|
|
17
|
-
* @license
|
|
18
|
-
* Copyright 2018 Google Inc.
|
|
19
|
-
*
|
|
20
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
21
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
22
|
-
* in the Software without restriction, including without limitation the rights
|
|
23
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
24
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
25
|
-
* furnished to do so, subject to the following conditions:
|
|
26
|
-
*
|
|
27
|
-
* The above copyright notice and this permission notice shall be included in
|
|
28
|
-
* all copies or substantial portions of the Software.
|
|
29
|
-
*
|
|
30
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
31
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
32
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
33
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
34
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
35
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
36
|
-
* THE SOFTWARE.
|
|
37
|
-
*/var b={CHECKED:"mdc-switch--checked",DISABLED:"mdc-switch--disabled"},w={ARIA_CHECKED_ATTR:"aria-checked",NATIVE_CONTROL_SELECTOR:".mdc-switch__native-control",RIPPLE_SURFACE_SELECTOR:".mdc-switch__thumb-underlay"},g=function(t){function c(r){return t.call(this,u(u({},c.defaultAdapter),r))||this}return l(c,t),Object.defineProperty(c,"strings",{get:function(){return w},enumerable:!1,configurable:!0}),Object.defineProperty(c,"cssClasses",{get:function(){return b},enumerable:!1,configurable:!0}),Object.defineProperty(c,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){},setNativeControlAttr:function(){}}},enumerable:!1,configurable:!0}),c.prototype.setChecked=function(t){this.adapter.setNativeControlChecked(t),this.updateAriaChecked_(t),this.updateCheckedStyling_(t)},c.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(b.DISABLED):this.adapter.removeClass(b.DISABLED)},c.prototype.handleChange=function(t){var c=t.target;this.updateAriaChecked_(c.checked),this.updateCheckedStyling_(c.checked)},c.prototype.updateCheckedStyling_=function(t){t?this.adapter.addClass(b.CHECKED):this.adapter.removeClass(b.CHECKED)},c.prototype.updateAriaChecked_=function(t){this.adapter.setNativeControlAttr(w.ARIA_CHECKED_ATTR,""+!!t)},c}(a),y=function(t){function c(){var c=null!==t&&t.apply(this,arguments)||this;return c.ripple_=c.createRipple_(),c}return l(c,t),c.attachTo=function(t){return new c(t)},c.prototype.destroy=function(){t.prototype.destroy.call(this),this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.changeHandler_)},c.prototype.initialSyncWithDOM=function(){var t=this;this.changeHandler_=function(){for(var c,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return(c=t.foundation).handleChange.apply(c,f([],p(r)))},this.nativeControl_.addEventListener("change",this.changeHandler_),this.checked=this.checked},c.prototype.getDefaultFoundation=function(){var t=this;return new g({addClass:function(c){return t.root.classList.add(c)},removeClass:function(c){return t.root.classList.remove(c)},setNativeControlChecked:function(c){return t.nativeControl_.checked=c},setNativeControlDisabled:function(c){return t.nativeControl_.disabled=c},setNativeControlAttr:function(c,r){return t.nativeControl_.setAttribute(c,r)}})},Object.defineProperty(c.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.foundation.setChecked(t)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!1,configurable:!0}),c.prototype.createRipple_=function(){var t=this,c=this.root.querySelector(g.strings.RIPPLE_SURFACE_SELECTOR),r=u(u({},n.createAdapter(this)),{addClass:function(t){return c.classList.add(t)},computeBoundingRect:function(){return c.getBoundingClientRect()},deregisterInteractionHandler:function(c,r){t.nativeControl_.removeEventListener(c,r,d())},isSurfaceActive:function(){return m(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(c,r){t.nativeControl_.addEventListener(c,r,d())},removeClass:function(t){c.classList.remove(t)},updateCssVariable:function(t,r){c.style.setProperty(t,r)}});return new n(this.root,new s(r))},Object.defineProperty(c.prototype,"nativeControl_",{get:function(){return this.root.querySelector(g.strings.NATIVE_CONTROL_SELECTOR)},enumerable:!1,configurable:!0}),c}(o);let _=class{constructor(r){t(this,r),this.change=c(this,"change",7),this.disabled=!1,this.readonly=!1,this.value=!1,this.fieldId=i(),this.onChange=t=>{t.stopPropagation(),this.change.emit(t.target.checked)}}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}initialize(){const t=this.host.shadowRoot.querySelector(".mdc-switch");t&&(this.mdcSwitch=new y(t))}disconnectedCallback(){var t;null===(t=this.mdcSwitch)||void 0===t||t.destroy()}render(){return[r("div",{class:{"mdc-switch":!0,"mdc-switch--disabled":this.disabled||this.readonly,"lime-switch--readonly":this.readonly}},r("div",{class:"mdc-switch__track"}),r("div",{class:"mdc-switch__thumb-underlay"},r("div",{class:"mdc-switch__thumb"},r("input",{type:"checkbox",class:"mdc-switch__native-control",id:this.fieldId,role:"switch",onChange:this.onChange,disabled:this.disabled||this.readonly,checked:this.value})))),r("label",{class:this.disabled||this.readonly?"disabled":"",htmlFor:this.fieldId},this.label)]}valueWatcher(t,c){this.mdcSwitch&&t!==c&&(this.mdcSwitch.checked=t)}get host(){return e(this)}static get watchers(){return{value:["valueWatcher"]}}};_.style=":host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n var(--lime-text-primary-on-background-color)\n )}.mdc-switch__thumb-underlay{left:-14px;right:initial;top:-17px;width:48px;height:48px}[dir=rtl] .mdc-switch__thumb-underlay,.mdc-switch__thumb-underlay[dir=rtl]{left:initial;right:-14px}.mdc-switch__native-control{width:64px;height:48px}.mdc-switch{display:inline-block;position:relative;outline:none;user-select:none}.mdc-switch.mdc-switch--checked .mdc-switch__track{background-color:#575756;background-color:var(--mdc-theme-secondary, #575756)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb{background-color:#575756;background-color:var(--mdc-theme-secondary, #575756);border-color:#575756;border-color:var(--mdc-theme-secondary, #575756)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__track{background-color:#000;background-color:var(--mdc-theme-on-surface, #000)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb{background-color:#fff;background-color:var(--mdc-theme-surface, #fff);border-color:#fff;border-color:var(--mdc-theme-surface, #fff)}.mdc-switch__native-control{left:0;right:initial;position:absolute;top:0;margin:0;opacity:0;cursor:pointer;pointer-events:auto;transition:transform 90ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-switch__native-control,.mdc-switch__native-control[dir=rtl]{left:initial;right:0}.mdc-switch__track{box-sizing:border-box;width:36px;height:14px;border:1px solid transparent;border-radius:7px;opacity:0.38;transition:opacity 90ms cubic-bezier(0.4, 0, 0.2, 1), background-color 90ms cubic-bezier(0.4, 0, 0.2, 1), border-color 90ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-switch__thumb-underlay{display:flex;position:absolute;align-items:center;justify-content:center;transform:translateX(0);transition:transform 90ms cubic-bezier(0.4, 0, 0.2, 1), background-color 90ms cubic-bezier(0.4, 0, 0.2, 1), border-color 90ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-switch__thumb{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);box-sizing:border-box;width:20px;height:20px;border:10px solid;border-radius:50%;pointer-events:none;z-index:1}.mdc-switch--checked .mdc-switch__track{opacity:0.54}.mdc-switch--checked .mdc-switch__thumb-underlay{transform:translateX(16px)}[dir=rtl] .mdc-switch--checked .mdc-switch__thumb-underlay,.mdc-switch--checked .mdc-switch__thumb-underlay[dir=rtl]{transform:translateX(-16px)}.mdc-switch--checked .mdc-switch__native-control{transform:translateX(-16px)}[dir=rtl] .mdc-switch--checked .mdc-switch__native-control,.mdc-switch--checked .mdc-switch__native-control[dir=rtl]{transform:translateX(16px)}.mdc-switch--disabled{opacity:0.38;pointer-events:none}.mdc-switch--disabled .mdc-switch__thumb{border-width:1px}.mdc-switch--disabled .mdc-switch__native-control{cursor:default;pointer-events:none}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb-underlay::before,.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb-underlay::after{background-color:#9e9e9e;background-color:var(--mdc-ripple-color, #9e9e9e)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb-underlay:hover::before,.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb-underlay.mdc-ripple-surface--hover::before{opacity:0.08;opacity:var(--mdc-ripple-hover-opacity, 0.08)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb-underlay.mdc-ripple-upgraded--background-focused::before,.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb-underlay:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb-underlay:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb-underlay:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb-underlay.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-switch__thumb-underlay{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity}.mdc-switch__thumb-underlay::before,.mdc-switch__thumb-underlay::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.mdc-switch__thumb-underlay::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-switch__thumb-underlay::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-switch__thumb-underlay.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-switch__thumb-underlay.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-switch__thumb-underlay.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-switch__thumb-underlay.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-switch__thumb-underlay.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-switch__thumb-underlay::before,.mdc-switch__thumb-underlay::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-switch__thumb-underlay.mdc-ripple-upgraded::before,.mdc-switch__thumb-underlay.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-switch__thumb-underlay.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-switch__thumb-underlay::before,.mdc-switch__thumb-underlay::after{background-color:#575756;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #575756))}.mdc-switch__thumb-underlay:hover::before,.mdc-switch__thumb-underlay.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-switch__thumb-underlay.mdc-ripple-upgraded--background-focused::before,.mdc-switch__thumb-underlay:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-switch__thumb-underlay:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-switch__thumb-underlay:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-switch__thumb-underlay.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}:host{display:inline-flex;align-items:center}.mdc-switch{margin-right:0.5rem}.mdc-switch.mdc-switch--checked .mdc-switch__track{background-color:#26a69a;background-color:var(--mdc-theme-primary, #26a69a)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb{background-color:#26a69a;background-color:var(--mdc-theme-primary, #26a69a);border-color:#26a69a;border-color:var(--mdc-theme-primary, #26a69a)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb-underlay::before,.mdc-switch.mdc-switch--checked .mdc-switch__thumb-underlay::after{background-color:#26a69a;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #26a69a))}.mdc-switch.mdc-switch--checked .mdc-switch__thumb-underlay:hover::before,.mdc-switch.mdc-switch--checked .mdc-switch__thumb-underlay.mdc-ripple-surface--hover::before{opacity:0.08;opacity:var(--mdc-ripple-hover-opacity, 0.08)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb-underlay.mdc-ripple-upgraded--background-focused::before,.mdc-switch.mdc-switch--checked .mdc-switch__thumb-underlay:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb-underlay:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-switch.mdc-switch--checked .mdc-switch__thumb-underlay:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb-underlay.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.8125rem;font-size:var(--mdc-typography-body2-font-size, 0.8125rem);line-height:1.625rem;line-height:var(--mdc-typography-body2-line-height, 1.625rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);cursor:pointer}label.disabled{cursor:not-allowed;pointer-events:none;opacity:0.4}.mdc-switch.lime-switch--readonly{opacity:1}.mdc-switch.lime-switch--readonly .mdc-switch__track{opacity:1;border:none}.mdc-switch.lime-switch--readonly .mdc-switch__thumb{background-color:transparent !important;border:none;box-shadow:none}.mdc-switch.lime-switch--readonly .mdc-switch__thumb:after{content:\"\";position:absolute;top:0;right:0;bottom:0;left:0;opacity:0.8;background-repeat:no-repeat;background-position:center;background-size:0.5rem}.mdc-switch.lime-switch--readonly.mdc-switch--checked .mdc-switch__track{background-color:var(--mdc-theme-primary)}.mdc-switch.lime-switch--readonly.mdc-switch--checked .mdc-switch__thumb:after{background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='rgb(255,255,255)' stroke-width='7' stroke-miterlimit='10' d='M29 7L11 25l-8-8'/></svg>\")}.mdc-switch.lime-switch--readonly:not(.mdc-switch--checked) .mdc-switch__track{background-color:rgb(var(--color-red-default))}.mdc-switch.lime-switch--readonly:not(.mdc-switch--checked) .mdc-switch__thumb:after{background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path fill='none' stroke='rgb(255,255,255)' stroke-width='7' stroke-miterlimit='10' d='M8 8l16 16M24 8L8 24'/></svg>\")}.mdc-switch.lime-switch--readonly+label.disabled{cursor:default;opacity:1}";export{_ as limel_switch}
|