@limetech/lime-elements 39.8.1 → 39.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/{component-DC8AD-ZG.js → component-BrNWuGdj.js} +1 -1
- package/dist/cjs/{component-BflTavfP.js → component-CFk7Dfoi.js} +3 -3
- package/dist/cjs/{component--XvTU1MI.js → component-y8swlNNR.js} +1 -1
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js +4 -4
- package/dist/cjs/limel-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/limel-code-diff.cjs.entry.js +645 -711
- package/dist/cjs/limel-date-picker.cjs.entry.js +4 -4
- package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
- package/dist/cjs/limel-portal_3.cjs.entry.js +3 -3
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +2 -2
- package/dist/cjs/limel-slider.cjs.entry.js +2 -2
- package/dist/cjs/limel-switch.cjs.entry.js +18 -632
- package/dist/cjs/limel-tab-bar.cjs.entry.js +4 -4
- package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +3 -3
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +3 -3
- package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{ponyfill-CNdYytGF.js → ponyfill-BgIFyUG5.js} +0 -1
- package/dist/collection/components/action-bar/action-bar-item/action-bar-item.css +7 -5
- package/dist/collection/components/action-bar/action-bar.css +7 -5
- package/dist/collection/components/badge/badge.css +7 -5
- package/dist/collection/components/breadcrumbs/breadcrumbs.css +7 -5
- package/dist/collection/components/button/button.css +7 -5
- package/dist/collection/components/button-group/button-group.css +7 -5
- package/dist/collection/components/card/card.css +7 -5
- package/dist/collection/components/chart/chart.css +7 -5
- package/dist/collection/components/checkbox/checkbox.css +7 -5
- package/dist/collection/components/chip/chip.css +7 -5
- package/dist/collection/components/chip-set/chip-set.css +7 -5
- package/dist/collection/components/circular-progress/circular-progress.css +7 -5
- package/dist/collection/components/code-diff/code-diff.css +7 -5
- package/dist/collection/components/code-editor/code-editor.css +7 -5
- package/dist/collection/components/collapsible-section/collapsible-section.css +7 -5
- package/dist/collection/components/color-picker/color-picker-palette.css +7 -5
- package/dist/collection/components/color-picker/color-picker.css +7 -5
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +7 -5
- package/dist/collection/components/dialog/dialog.css +7 -5
- package/dist/collection/components/dock/dock-button/dock-button.css +7 -5
- package/dist/collection/components/dock/dock.css +7 -5
- package/dist/collection/components/drag-handle/drag-handle.css +7 -5
- package/dist/collection/components/email-viewer/email-viewer.css +7 -5
- package/dist/collection/components/file/file.css +7 -5
- package/dist/collection/components/file-viewer/file-viewer.css +7 -5
- package/dist/collection/components/form/form.css +7 -5
- package/dist/collection/components/header/header.css +7 -5
- package/dist/collection/components/help/help.css +7 -5
- package/dist/collection/components/help/limel-help-content.css +7 -5
- package/dist/collection/components/icon-button/icon-button.css +7 -5
- package/dist/collection/components/info-tile/info-tile.css +7 -5
- package/dist/collection/components/input-field/input-field.css +7 -5
- package/dist/collection/components/list/list.css +7 -5
- package/dist/collection/components/list-item/list-item.css +7 -5
- package/dist/collection/components/list-item/menu-item-meta/menu-item-meta.css +7 -5
- package/dist/collection/components/markdown/markdown.css +7 -5
- package/dist/collection/components/menu-list/menu-list.css +7 -5
- package/dist/collection/components/notched-outline/notched-outline.css +7 -5
- package/dist/collection/components/popover-surface/popover-surface.css +7 -5
- package/dist/collection/components/profile-picture/profile-picture.css +7 -5
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +7 -5
- package/dist/collection/components/radio-button-group/radio-button.css +7 -5
- package/dist/collection/components/select/select.css +7 -5
- package/dist/collection/components/shortcut/shortcut.css +7 -5
- package/dist/collection/components/slider/slider.css +7 -5
- package/dist/collection/components/split-button/split-button.css +7 -5
- package/dist/collection/components/switch/switch.css +76 -774
- package/dist/collection/components/switch/switch.js +18 -50
- package/dist/collection/components/tab-bar/tab-bar.css +7 -5
- package/dist/collection/components/tab-bar/tab-bar.js +2 -2
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/table/table.css +7 -5
- package/dist/collection/components/table/table.js +3 -3
- package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.css +7 -5
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
- package/dist/collection/components/text-editor/text-editor.css +7 -5
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/tooltip/tooltip-content.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/scss/mixins.scss +7 -5
- package/dist/collection/style/exports.scss +12 -0
- package/dist/collection/style/mixins.scss +7 -5
- package/dist/esm/{component-CfpvJ0ln.js → component-7QB0OUSF.js} +1 -1
- package/dist/esm/{component-zxri0Bi3.js → component-D4qgwaTf.js} +1 -1
- package/dist/esm/{component-BsWKksqY.js → component-wGVqvUmL.js} +3 -3
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-breadcrumbs_7.entry.js +4 -4
- package/dist/esm/limel-chip_2.entry.js +4 -4
- package/dist/esm/limel-code-diff.entry.js +645 -711
- package/dist/esm/limel-date-picker.entry.js +4 -4
- package/dist/esm/limel-dialog.entry.js +2 -2
- package/dist/esm/limel-portal_3.entry.js +3 -3
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-select.entry.js +2 -2
- package/dist/esm/limel-slider.entry.js +2 -2
- package/dist/esm/limel-switch.entry.js +19 -633
- package/dist/esm/limel-tab-bar.entry.js +4 -4
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +3 -3
- package/dist/esm/limel-text-editor-link-menu.entry.js +3 -3
- package/dist/esm/limel-text-editor.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{ponyfill-D-I_3IxW.js → ponyfill-ChRGk668.js} +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-89dfbd4a.entry.js → p-13f4d39d.entry.js} +1 -1
- package/dist/lime-elements/{p-68ffd790.entry.js → p-1a3a7374.entry.js} +1 -1
- package/dist/lime-elements/{p-90f8d2ef.entry.js → p-288aa326.entry.js} +1 -1
- package/dist/lime-elements/{p-6b05db4a.entry.js → p-2af214de.entry.js} +1 -1
- package/dist/lime-elements/{p-c6e9af7c.entry.js → p-37b41bad.entry.js} +1 -1
- package/dist/lime-elements/{p-ce22f3da.entry.js → p-74cd80a9.entry.js} +4 -4
- package/dist/lime-elements/{p-70e2e60c.entry.js → p-767935ac.entry.js} +1 -1
- package/dist/lime-elements/{p-b95a42ea.entry.js → p-86eebe44.entry.js} +1 -1
- package/dist/lime-elements/{p-D7ojrUFG.js → p-BN1-aIOw.js} +1 -1
- package/dist/lime-elements/{p-ClrXWM0F.js → p-C9yTLqR8.js} +1 -1
- package/dist/lime-elements/{p-D-I_3IxW.js → p-ChRGk668.js} +3 -3
- package/dist/lime-elements/{p-BDAjvVhN.js → p-DZkKQUDM.js} +3 -3
- package/dist/lime-elements/{p-dcf3cc71.entry.js → p-b2ea92be.entry.js} +1 -1
- package/dist/lime-elements/p-b3622713.entry.js +1 -0
- package/dist/lime-elements/{p-8ec4fdee.entry.js → p-cd722648.entry.js} +2 -2
- package/dist/lime-elements/{p-ee3afb60.entry.js → p-cdd5b814.entry.js} +9 -9
- package/dist/lime-elements/{p-8ec92025.entry.js → p-db51323c.entry.js} +1 -1
- package/dist/lime-elements/{p-64f664b0.entry.js → p-e2f1b070.entry.js} +1 -1
- package/dist/lime-elements/p-f10ca306.entry.js +1 -0
- package/dist/lime-elements/scss/mixins.scss +7 -5
- package/dist/lime-elements/style/exports.scss +12 -0
- package/dist/lime-elements/style/mixins.scss +7 -5
- package/dist/scss/mixins.scss +724 -0
- package/dist/types/components/switch/switch.d.ts +4 -6
- package/index.scss +9 -0
- package/package.json +5 -3
- package/dist/lime-elements/p-644911cc.entry.js +0 -68
- package/dist/lime-elements/p-965288d2.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as t,a as n,M as i,c as e,b as r,m as u}from"./p-
|
|
1
|
+
import{_ as t,a as n,M as i,c as e,b as r,m as u}from"./p-ChRGk668.js";import{a as s,M as o,b as c}from"./p-BN1-aIOw.js";import{a as h,M as f}from"./p-C9yTLqR8.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google Inc.
|
|
@@ -20,7 +20,7 @@ import{_ as t,a as n,M as i,c as e,b as r,m as u}from"./p-D-I_3IxW.js";import{a
|
|
|
20
20
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
22
|
* THE SOFTWARE.
|
|
23
|
-
*/var a={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},l=function(i){function e(t){var r=i.call(this,n(n({},e.defaultAdapter),t))||this;return r.transitionEndHandler=function(t){r.handleTransitionEnd(t)},r}return t(e,i),Object.defineProperty(e,"cssClasses",{get:function(){return a},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler)},e.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler)},e.prototype.activate=function(){this.adapter.removeClass(a.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(a.LINE_RIPPLE_ACTIVE)},e.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},e.prototype.deactivate=function(){this.adapter.addClass(a.LINE_RIPPLE_DEACTIVATING)},e.prototype.handleTransitionEnd=function(t){var n=this.adapter.hasClass(a.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&n&&(this.adapter.removeClass(a.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(a.LINE_RIPPLE_DEACTIVATING))},e}(i),d=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},i.prototype.activate=function(){this.foundation.activate()},i.prototype.deactivate=function(){this.foundation.deactivate()},i.prototype.setRippleCenter=function(t){this.foundation.setRippleCenter(t)},i.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)},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)}})},i}(e),b={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},g={NOTCH_ELEMENT_PADDING:8},m={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},v=function(i){function e(t){return i.call(this,n(n({},e.defaultAdapter),t))||this}return t(e,i),Object.defineProperty(e,"strings",{get:function(){return b},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return g},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!1,configurable:!0}),e.prototype.notch=function(t){var n=e.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=g.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(n)},e.prototype.closeNotch=function(){this.adapter.removeClass(e.cssClasses.OUTLINE_NOTCHED),this.adapter.removeNotchWidthProperty()},e}(i),O=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},i.prototype.initialSyncWithDOM=function(){this.notchElement=this.root.querySelector(b.NOTCH_ELEMENT_SELECTOR);var t=this.root.querySelector("."+h.cssClasses.ROOT);t?(t.style.transitionDuration="0s",this.root.classList.add(m.OUTLINE_UPGRADED),requestAnimationFrame((function(){t.style.transitionDuration=""}))):this.root.classList.add(m.NO_LABEL)},i.prototype.notch=function(t){this.foundation.notch(t)},i.prototype.closeNotch=function(){this.foundation.closeNotch()},i.prototype.getDefaultFoundation=function(){var t=this;return new v({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},setNotchWidthProperty:function(n){t.notchElement.style.setProperty("width",n+"px")},removeNotchWidthProperty:function(){t.notchElement.style.removeProperty("width")}})},i}(e),E={ROOT:"mdc-text-field-character-counter"},I={ROOT_SELECTOR:"."+E.ROOT},p=function(i){function e(t){return i.call(this,n(n({},e.defaultAdapter),t))||this}return t(e,i),Object.defineProperty(e,"cssClasses",{get:function(){return E},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return I},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!1,configurable:!0}),e.prototype.setCounterValue=function(t,n){t=Math.min(t,n),this.adapter.setContent(t+" / "+n)},e}(i),C=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},Object.defineProperty(i.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),i.prototype.getDefaultFoundation=function(){var t=this;return new p({setContent:function(n){t.root.textContent=n}})},i}(e),L={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"},T={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",WITH_INTERNAL_COUNTER:"mdc-text-field--with-internal-counter"},x={LABEL_SCALE:.75},A=["pattern","min","max","required","step","minlength","maxlength"],_=["color","date","datetime-local","month","range","time","week"],j=["mousedown","touchstart"],R=["click","keydown"],N=function(i){function e(t,r){void 0===r&&(r={});var u=i.call(this,n(n({},e.defaultAdapter),t))||this;return u.isFocused=!1,u.receivedUserInput=!1,u.valid=!0,u.useNativeValidation=!0,u.validateOnValueChange=!0,u.helperText=r.helperText,u.characterCounter=r.characterCounter,u.leadingIcon=r.leadingIcon,u.trailingIcon=r.trailingIcon,u.inputFocusHandler=function(){u.activateFocus()},u.inputBlurHandler=function(){u.deactivateFocus()},u.inputInputHandler=function(){u.handleInput()},u.setPointerXOffset=function(t){u.setTransformOrigin(t)},u.textFieldInteractionHandler=function(){u.handleTextFieldInteraction()},u.validationAttributeChangeHandler=function(t){u.handleValidationAttributeChange(t)},u}return t(e,i),Object.defineProperty(e,"cssClasses",{get:function(){return T},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return L},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldAlwaysFloat",{get:function(){var t=this.getNativeInput().type;return _.indexOf(t)>=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat||this.isFocused||!!this.getValue()||this.isBadInput()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldShake",{get:function(){return!this.isFocused&&!this.isValid()&&!!this.getValue()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"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}),e.prototype.init=function(){var t,n,i,e;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);try{for(var u=r(j),s=u.next();!s.done;s=u.next())this.adapter.registerInputInteractionHandler(s.value,this.setPointerXOffset)}catch(n){t={error:n}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}try{for(var o=r(R),c=o.next();!c.done;c=o.next())this.adapter.registerTextFieldInteractionHandler(c.value,this.textFieldInteractionHandler)}catch(t){i={error:t}}finally{try{c&&!c.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}this.validationObserver=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler),this.setcharacterCounter(this.getValue().length)},e.prototype.destroy=function(){var t,n,i,e;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler);try{for(var u=r(j),s=u.next();!s.done;s=u.next())this.adapter.deregisterInputInteractionHandler(s.value,this.setPointerXOffset)}catch(n){t={error:n}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}try{for(var o=r(R),c=o.next();!c.done;c=o.next())this.adapter.deregisterTextFieldInteractionHandler(c.value,this.textFieldInteractionHandler)}catch(t){i={error:t}}finally{try{c&&!c.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver)},e.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput=!0)},e.prototype.handleValidationAttributeChange=function(t){var n=this;t.some((function(t){return A.indexOf(t)>-1&&(n.styleValidity(!0),n.adapter.setLabelRequired(n.getNativeInput().required),!0)})),t.indexOf("maxlength")>-1&&this.setcharacterCounter(this.getValue().length)},e.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var n=this.adapter.getLabelWidth()*x.LABEL_SCALE;this.adapter.notchOutline(n)}else this.adapter.closeOutline()},e.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.valid||this.helperText.showToScreenReader()},e.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)}},e.prototype.handleInput=function(){this.autoCompleteFocus(),this.setcharacterCounter(this.getValue().length)},e.prototype.autoCompleteFocus=function(){this.receivedUserInput||this.activateFocus()},e.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)},e.prototype.getValue=function(){return this.getNativeInput().value},e.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))},e.prototype.isValid=function(){return this.useNativeValidation?this.isNativeInputValid():this.valid},e.prototype.setValid=function(t){this.valid=t,this.styleValidity(t);var n=!t&&!this.isFocused&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(n)},e.prototype.setValidateOnValueChange=function(t){this.validateOnValueChange=t},e.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange},e.prototype.setUseNativeValidation=function(t){this.useNativeValidation=t},e.prototype.isDisabled=function(){return this.getNativeInput().disabled},e.prototype.setDisabled=function(t){this.getNativeInput().disabled=t,this.styleDisabled(t)},e.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},e.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},e.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},e.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon&&this.trailingIcon.setAriaLabel(t)},e.prototype.setTrailingIconContent=function(t){this.trailingIcon&&this.trailingIcon.setContent(t)},e.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)}},e.prototype.isBadInput=function(){return this.getNativeInput().validity.badInput||!1},e.prototype.isNativeInputValid=function(){return this.getNativeInput().validity.valid},e.prototype.styleValidity=function(t){var n=e.cssClasses.INVALID;if(t?this.adapter.removeClass(n):this.adapter.addClass(n),this.helperText){if(this.helperText.setValidity(t),!this.helperText.isValidation())return;var i=this.helperText.isVisible(),r=this.helperText.getId();i&&r?this.adapter.setInputAttr(L.ARIA_DESCRIBEDBY,r):this.adapter.removeInputAttr(L.ARIA_DESCRIBEDBY)}},e.prototype.styleFocused=function(t){var n=e.cssClasses.FOCUSED;t?this.adapter.addClass(n):this.adapter.removeClass(n)},e.prototype.styleDisabled=function(t){var n=e.cssClasses,i=n.DISABLED,r=n.INVALID;t?(this.adapter.addClass(i),this.adapter.removeClass(r)):this.adapter.removeClass(i),this.leadingIcon&&this.leadingIcon.setDisabled(t),this.trailingIcon&&this.trailingIcon.setDisabled(t)},e.prototype.styleFloating=function(t){var n=e.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(n):this.adapter.removeClass(n)},e.prototype.getNativeInput=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},e}(i),w={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"},y={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+w.ROOT},H=function(i){function e(t){return i.call(this,n(n({},e.defaultAdapter),t))||this}return t(e,i),Object.defineProperty(e,"cssClasses",{get:function(){return w},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return y},enumerable:!1,configurable:!0}),Object.defineProperty(e,"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}),e.prototype.getId=function(){return this.adapter.getAttr("id")},e.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(y.ARIA_HIDDEN)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.isPersistent=function(){return this.adapter.hasClass(w.HELPER_TEXT_PERSISTENT)},e.prototype.setPersistent=function(t){t?this.adapter.addClass(w.HELPER_TEXT_PERSISTENT):this.adapter.removeClass(w.HELPER_TEXT_PERSISTENT)},e.prototype.isValidation=function(){return this.adapter.hasClass(w.HELPER_TEXT_VALIDATION_MSG)},e.prototype.setValidation=function(t){t?this.adapter.addClass(w.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(w.HELPER_TEXT_VALIDATION_MSG)},e.prototype.showToScreenReader=function(){this.adapter.removeAttr(y.ARIA_HIDDEN)},e.prototype.setValidity=function(t){var n=this.adapter.hasClass(w.HELPER_TEXT_PERSISTENT),i=this.adapter.hasClass(w.HELPER_TEXT_VALIDATION_MSG)&&!t;i?(this.showToScreenReader(),"alert"===this.adapter.getAttr(y.ROLE)?this.refreshAlertRole():this.adapter.setAttr(y.ROLE,"alert")):this.adapter.removeAttr(y.ROLE),n||i||this.hide()},e.prototype.hide=function(){this.adapter.setAttr(y.ARIA_HIDDEN,"true")},e.prototype.refreshAlertRole=function(){var t=this;this.adapter.removeAttr(y.ROLE),requestAnimationFrame((function(){t.adapter.setAttr(y.ROLE,"alert")}))},e}(i),F=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},Object.defineProperty(i.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),i.prototype.getDefaultFoundation=function(){var t=this;return new H({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}})},i}(e),S={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},D={ROOT:"mdc-text-field__icon"},P=["click","keydown"],M=function(i){function e(t){var r=i.call(this,n(n({},e.defaultAdapter),t))||this;return r.savedTabIndex=null,r.interactionHandler=function(t){r.handleInteraction(t)},r}return t(e,i),Object.defineProperty(e,"strings",{get:function(){return S},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t,n;this.savedTabIndex=this.adapter.getAttr("tabindex");try{for(var i=r(P),e=i.next();!e.done;e=i.next())this.adapter.registerInteractionHandler(e.value,this.interactionHandler)}catch(n){t={error:n}}finally{try{e&&!e.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.destroy=function(){var t,n;try{for(var i=r(P),e=i.next();!e.done;e=i.next())this.adapter.deregisterInteractionHandler(e.value,this.interactionHandler)}catch(n){t={error:n}}finally{try{e&&!e.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.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",S.ICON_ROLE)))},e.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.handleInteraction=function(t){("click"===t.type||"Enter"===t.key||13===t.keyCode)&&(t.preventDefault(),this.adapter.notifyIconAction())},e}(i),W=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},Object.defineProperty(i.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),i.prototype.getDefaultFoundation=function(){var t=this;return new M({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(M.strings.ICON_EVENT,{},!0)}})},i}(e),B=function(i){function e(){return null!==i&&i.apply(this,arguments)||this}return t(e,i),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,n,i,e,r,u,s){void 0===t&&(t=function(t,n){return new o(t,n)}),void 0===n&&(n=function(t){return new d(t)}),void 0===i&&(i=function(t){return new F(t)}),void 0===e&&(e=function(t){return new C(t)}),void 0===r&&(r=function(t){return new W(t)}),void 0===u&&(u=function(t){return new f(t)}),void 0===s&&(s=function(t){return new O(t)}),this.input=this.root.querySelector(L.INPUT_SELECTOR);var c=this.root.querySelector(L.LABEL_SELECTOR);this.label=c?u(c):null;var h=this.root.querySelector(L.LINE_RIPPLE_SELECTOR);this.lineRipple=h?n(h):null;var a=this.root.querySelector(L.OUTLINE_SELECTOR);this.outline=a?s(a):null;var l=H.strings,b=this.root.nextElementSibling,g=b&&b.classList.contains(T.HELPER_LINE),m=g&&b&&b.querySelector(l.ROOT_SELECTOR);this.helperText=m?i(m):null;var v=p.strings,E=this.root.querySelector(v.ROOT_SELECTOR);!E&&g&&b&&(E=b.querySelector(v.ROOT_SELECTOR)),this.characterCounter=E?e(E):null;var I=this.root.querySelector(L.LEADING_ICON_SELECTOR);this.leadingIcon=I?r(I):null;var x=this.root.querySelector(L.TRAILING_ICON_SELECTOR);this.trailingIcon=x?r(x):null,this.prefix=this.root.querySelector(L.PREFIX_SELECTOR),this.suffix=this.root.querySelector(L.SUFFIX_SELECTOR),this.ripple=this.createRipple(t)},e.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(),i.prototype.destroy.call(this)},e.prototype.initialSyncWithDOM=function(){this.disabled=this.input.disabled},Object.defineProperty(e.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(t){this.foundation.setDisabled(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"required",{get:function(){return this.input.required},set:function(t){this.input.required=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pattern",{get:function(){return this.input.pattern},set:function(t){this.input.pattern=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minLength",{get:function(){return this.input.minLength},set:function(t){this.input.minLength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"min",{get:function(){return this.input.min},set:function(t){this.input.min=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this.input.max},set:function(t){this.input.max=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"step",{get:function(){return this.input.step},set:function(t){this.input.step=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trailingIconAriaLabel",{set:function(t){this.foundation.setTrailingIconAriaLabel(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trailingIconContent",{set:function(t){this.foundation.setTrailingIconContent(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useNativeValidation",{set:function(t){this.foundation.setUseNativeValidation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"suffixText",{get:function(){return this.suffix?this.suffix.textContent:null},set:function(t){this.suffix&&(this.suffix.textContent=t)},enumerable:!1,configurable:!0}),e.prototype.focus=function(){this.input.focus()},e.prototype.layout=function(){this.foundation.notchOutline(this.foundation.shouldFloat)},e.prototype.getDefaultFoundation=function(){var t=n(n(n(n(n({},this.getRootAdapterMethods()),this.getInputAdapterMethods()),this.getLabelAdapterMethods()),this.getLineRippleAdapterMethods()),this.getOutlineAdapterMethods());return new N(t,this.getFoundationMap())},e.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()}}},e.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,i){t.input.addEventListener(n,i,s())},deregisterInputInteractionHandler:function(n,i){t.input.removeEventListener(n,i,s())}}},e.prototype.getLabelAdapterMethods=function(){var t=this;return{floatLabel:function(n){t.label&&t.label.float(n)},getLabelWidth:function(){return t.label?t.label.getWidth():0},hasLabel:function(){return Boolean(t.label)},shakeLabel:function(n){t.label&&t.label.shake(n)},setLabelRequired:function(n){t.label&&t.label.setRequired(n)}}},e.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)}}},e.prototype.getOutlineAdapterMethods=function(){var t=this;return{closeOutline:function(){t.outline&&t.outline.closeNotch()},hasOutline:function(){return Boolean(t.outline)},notchOutline:function(n){t.outline&&t.outline.notch(n)}}},e.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}},e.prototype.createRipple=function(t){var i=this,e=this.root.classList.contains(T.TEXTAREA),r=this.root.classList.contains(T.OUTLINED);if(e||r)return null;var h=n(n({},o.createAdapter(this)),{isSurfaceActive:function(){return u(i.input,":active")},registerInteractionHandler:function(t,n){i.input.addEventListener(t,n,s())},deregisterInteractionHandler:function(t,n){i.input.removeEventListener(t,n,s())}});return t(this.root,new c(h))},e}(e);
|
|
23
|
+
*/var a={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},l=function(i){function e(t){var r=i.call(this,n(n({},e.defaultAdapter),t))||this;return r.transitionEndHandler=function(t){r.handleTransitionEnd(t)},r}return t(e,i),Object.defineProperty(e,"cssClasses",{get:function(){return a},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler)},e.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler)},e.prototype.activate=function(){this.adapter.removeClass(a.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(a.LINE_RIPPLE_ACTIVE)},e.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},e.prototype.deactivate=function(){this.adapter.addClass(a.LINE_RIPPLE_DEACTIVATING)},e.prototype.handleTransitionEnd=function(t){var n=this.adapter.hasClass(a.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&n&&(this.adapter.removeClass(a.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(a.LINE_RIPPLE_DEACTIVATING))},e}(i),d=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},i.prototype.activate=function(){this.foundation.activate()},i.prototype.deactivate=function(){this.foundation.deactivate()},i.prototype.setRippleCenter=function(t){this.foundation.setRippleCenter(t)},i.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)},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)}})},i}(e),b={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},g={NOTCH_ELEMENT_PADDING:8},m={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},v=function(i){function e(t){return i.call(this,n(n({},e.defaultAdapter),t))||this}return t(e,i),Object.defineProperty(e,"strings",{get:function(){return b},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return g},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!1,configurable:!0}),e.prototype.notch=function(t){var n=e.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=g.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(n)},e.prototype.closeNotch=function(){this.adapter.removeClass(e.cssClasses.OUTLINE_NOTCHED),this.adapter.removeNotchWidthProperty()},e}(i),O=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},i.prototype.initialSyncWithDOM=function(){this.notchElement=this.root.querySelector(b.NOTCH_ELEMENT_SELECTOR);var t=this.root.querySelector("."+h.cssClasses.ROOT);t?(t.style.transitionDuration="0s",this.root.classList.add(m.OUTLINE_UPGRADED),requestAnimationFrame((function(){t.style.transitionDuration=""}))):this.root.classList.add(m.NO_LABEL)},i.prototype.notch=function(t){this.foundation.notch(t)},i.prototype.closeNotch=function(){this.foundation.closeNotch()},i.prototype.getDefaultFoundation=function(){var t=this;return new v({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},setNotchWidthProperty:function(n){t.notchElement.style.setProperty("width",n+"px")},removeNotchWidthProperty:function(){t.notchElement.style.removeProperty("width")}})},i}(e),E={ROOT:"mdc-text-field-character-counter"},I={ROOT_SELECTOR:"."+E.ROOT},C=function(i){function e(t){return i.call(this,n(n({},e.defaultAdapter),t))||this}return t(e,i),Object.defineProperty(e,"cssClasses",{get:function(){return E},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return I},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!1,configurable:!0}),e.prototype.setCounterValue=function(t,n){t=Math.min(t,n),this.adapter.setContent(t+" / "+n)},e}(i),L=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},Object.defineProperty(i.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),i.prototype.getDefaultFoundation=function(){var t=this;return new C({setContent:function(n){t.root.textContent=n}})},i}(e),p={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"},T={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",WITH_INTERNAL_COUNTER:"mdc-text-field--with-internal-counter"},A={LABEL_SCALE:.75},x=["pattern","min","max","required","step","minlength","maxlength"],_=["color","date","datetime-local","month","range","time","week"],R=["mousedown","touchstart"],j=["click","keydown"],N=function(i){function e(t,r){void 0===r&&(r={});var u=i.call(this,n(n({},e.defaultAdapter),t))||this;return u.isFocused=!1,u.receivedUserInput=!1,u.valid=!0,u.useNativeValidation=!0,u.validateOnValueChange=!0,u.helperText=r.helperText,u.characterCounter=r.characterCounter,u.leadingIcon=r.leadingIcon,u.trailingIcon=r.trailingIcon,u.inputFocusHandler=function(){u.activateFocus()},u.inputBlurHandler=function(){u.deactivateFocus()},u.inputInputHandler=function(){u.handleInput()},u.setPointerXOffset=function(t){u.setTransformOrigin(t)},u.textFieldInteractionHandler=function(){u.handleTextFieldInteraction()},u.validationAttributeChangeHandler=function(t){u.handleValidationAttributeChange(t)},u}return t(e,i),Object.defineProperty(e,"cssClasses",{get:function(){return T},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return p},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return A},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldAlwaysFloat",{get:function(){var t=this.getNativeInput().type;return _.indexOf(t)>=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat||this.isFocused||!!this.getValue()||this.isBadInput()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shouldShake",{get:function(){return!this.isFocused&&!this.isValid()&&!!this.getValue()},enumerable:!1,configurable:!0}),Object.defineProperty(e,"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}),e.prototype.init=function(){var t,n,i,e;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);try{for(var u=r(R),s=u.next();!s.done;s=u.next())this.adapter.registerInputInteractionHandler(s.value,this.setPointerXOffset)}catch(n){t={error:n}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}try{for(var o=r(j),c=o.next();!c.done;c=o.next())this.adapter.registerTextFieldInteractionHandler(c.value,this.textFieldInteractionHandler)}catch(t){i={error:t}}finally{try{c&&!c.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}this.validationObserver=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler),this.setcharacterCounter(this.getValue().length)},e.prototype.destroy=function(){var t,n,i,e;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler);try{for(var u=r(R),s=u.next();!s.done;s=u.next())this.adapter.deregisterInputInteractionHandler(s.value,this.setPointerXOffset)}catch(n){t={error:n}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}try{for(var o=r(j),c=o.next();!c.done;c=o.next())this.adapter.deregisterTextFieldInteractionHandler(c.value,this.textFieldInteractionHandler)}catch(t){i={error:t}}finally{try{c&&!c.done&&(e=o.return)&&e.call(o)}finally{if(i)throw i.error}}this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver)},e.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput=!0)},e.prototype.handleValidationAttributeChange=function(t){var n=this;t.some((function(t){return x.indexOf(t)>-1&&(n.styleValidity(!0),n.adapter.setLabelRequired(n.getNativeInput().required),!0)})),t.indexOf("maxlength")>-1&&this.setcharacterCounter(this.getValue().length)},e.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var n=this.adapter.getLabelWidth()*A.LABEL_SCALE;this.adapter.notchOutline(n)}else this.adapter.closeOutline()},e.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.valid||this.helperText.showToScreenReader()},e.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)}},e.prototype.handleInput=function(){this.autoCompleteFocus(),this.setcharacterCounter(this.getValue().length)},e.prototype.autoCompleteFocus=function(){this.receivedUserInput||this.activateFocus()},e.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)},e.prototype.getValue=function(){return this.getNativeInput().value},e.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))},e.prototype.isValid=function(){return this.useNativeValidation?this.isNativeInputValid():this.valid},e.prototype.setValid=function(t){this.valid=t,this.styleValidity(t);var n=!t&&!this.isFocused&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(n)},e.prototype.setValidateOnValueChange=function(t){this.validateOnValueChange=t},e.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange},e.prototype.setUseNativeValidation=function(t){this.useNativeValidation=t},e.prototype.isDisabled=function(){return this.getNativeInput().disabled},e.prototype.setDisabled=function(t){this.getNativeInput().disabled=t,this.styleDisabled(t)},e.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},e.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},e.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},e.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon&&this.trailingIcon.setAriaLabel(t)},e.prototype.setTrailingIconContent=function(t){this.trailingIcon&&this.trailingIcon.setContent(t)},e.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)}},e.prototype.isBadInput=function(){return this.getNativeInput().validity.badInput||!1},e.prototype.isNativeInputValid=function(){return this.getNativeInput().validity.valid},e.prototype.styleValidity=function(t){var n=e.cssClasses.INVALID;if(t?this.adapter.removeClass(n):this.adapter.addClass(n),this.helperText){if(this.helperText.setValidity(t),!this.helperText.isValidation())return;var i=this.helperText.isVisible(),r=this.helperText.getId();i&&r?this.adapter.setInputAttr(p.ARIA_DESCRIBEDBY,r):this.adapter.removeInputAttr(p.ARIA_DESCRIBEDBY)}},e.prototype.styleFocused=function(t){var n=e.cssClasses.FOCUSED;t?this.adapter.addClass(n):this.adapter.removeClass(n)},e.prototype.styleDisabled=function(t){var n=e.cssClasses,i=n.DISABLED,r=n.INVALID;t?(this.adapter.addClass(i),this.adapter.removeClass(r)):this.adapter.removeClass(i),this.leadingIcon&&this.leadingIcon.setDisabled(t),this.trailingIcon&&this.trailingIcon.setDisabled(t)},e.prototype.styleFloating=function(t){var n=e.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(n):this.adapter.removeClass(n)},e.prototype.getNativeInput=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},e}(i),w={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"},y={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+w.ROOT},H=function(i){function e(t){return i.call(this,n(n({},e.defaultAdapter),t))||this}return t(e,i),Object.defineProperty(e,"cssClasses",{get:function(){return w},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return y},enumerable:!1,configurable:!0}),Object.defineProperty(e,"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}),e.prototype.getId=function(){return this.adapter.getAttr("id")},e.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(y.ARIA_HIDDEN)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.isPersistent=function(){return this.adapter.hasClass(w.HELPER_TEXT_PERSISTENT)},e.prototype.setPersistent=function(t){t?this.adapter.addClass(w.HELPER_TEXT_PERSISTENT):this.adapter.removeClass(w.HELPER_TEXT_PERSISTENT)},e.prototype.isValidation=function(){return this.adapter.hasClass(w.HELPER_TEXT_VALIDATION_MSG)},e.prototype.setValidation=function(t){t?this.adapter.addClass(w.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(w.HELPER_TEXT_VALIDATION_MSG)},e.prototype.showToScreenReader=function(){this.adapter.removeAttr(y.ARIA_HIDDEN)},e.prototype.setValidity=function(t){var n=this.adapter.hasClass(w.HELPER_TEXT_PERSISTENT),i=this.adapter.hasClass(w.HELPER_TEXT_VALIDATION_MSG)&&!t;i?(this.showToScreenReader(),"alert"===this.adapter.getAttr(y.ROLE)?this.refreshAlertRole():this.adapter.setAttr(y.ROLE,"alert")):this.adapter.removeAttr(y.ROLE),n||i||this.hide()},e.prototype.hide=function(){this.adapter.setAttr(y.ARIA_HIDDEN,"true")},e.prototype.refreshAlertRole=function(){var t=this;this.adapter.removeAttr(y.ROLE),requestAnimationFrame((function(){t.adapter.setAttr(y.ROLE,"alert")}))},e}(i),F=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},Object.defineProperty(i.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),i.prototype.getDefaultFoundation=function(){var t=this;return new H({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}})},i}(e),S={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},D={ROOT:"mdc-text-field__icon"},P=["click","keydown"],M=function(i){function e(t){var r=i.call(this,n(n({},e.defaultAdapter),t))||this;return r.savedTabIndex=null,r.interactionHandler=function(t){r.handleInteraction(t)},r}return t(e,i),Object.defineProperty(e,"strings",{get:function(){return S},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t,n;this.savedTabIndex=this.adapter.getAttr("tabindex");try{for(var i=r(P),e=i.next();!e.done;e=i.next())this.adapter.registerInteractionHandler(e.value,this.interactionHandler)}catch(n){t={error:n}}finally{try{e&&!e.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.destroy=function(){var t,n;try{for(var i=r(P),e=i.next();!e.done;e=i.next())this.adapter.deregisterInteractionHandler(e.value,this.interactionHandler)}catch(n){t={error:n}}finally{try{e&&!e.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.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",S.ICON_ROLE)))},e.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.handleInteraction=function(t){("click"===t.type||"Enter"===t.key||13===t.keyCode)&&(t.preventDefault(),this.adapter.notifyIconAction())},e}(i),B=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return t(i,n),i.attachTo=function(t){return new i(t)},Object.defineProperty(i.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!1,configurable:!0}),i.prototype.getDefaultFoundation=function(){var t=this;return new M({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(M.strings.ICON_EVENT,{},!0)}})},i}(e),k=function(i){function e(){return null!==i&&i.apply(this,arguments)||this}return t(e,i),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,n,i,e,r,u,s){void 0===t&&(t=function(t,n){return new o(t,n)}),void 0===n&&(n=function(t){return new d(t)}),void 0===i&&(i=function(t){return new F(t)}),void 0===e&&(e=function(t){return new L(t)}),void 0===r&&(r=function(t){return new B(t)}),void 0===u&&(u=function(t){return new f(t)}),void 0===s&&(s=function(t){return new O(t)}),this.input=this.root.querySelector(p.INPUT_SELECTOR);var c=this.root.querySelector(p.LABEL_SELECTOR);this.label=c?u(c):null;var h=this.root.querySelector(p.LINE_RIPPLE_SELECTOR);this.lineRipple=h?n(h):null;var a=this.root.querySelector(p.OUTLINE_SELECTOR);this.outline=a?s(a):null;var l=H.strings,b=this.root.nextElementSibling,g=b&&b.classList.contains(T.HELPER_LINE),m=g&&b&&b.querySelector(l.ROOT_SELECTOR);this.helperText=m?i(m):null;var v=C.strings,E=this.root.querySelector(v.ROOT_SELECTOR);!E&&g&&b&&(E=b.querySelector(v.ROOT_SELECTOR)),this.characterCounter=E?e(E):null;var I=this.root.querySelector(p.LEADING_ICON_SELECTOR);this.leadingIcon=I?r(I):null;var A=this.root.querySelector(p.TRAILING_ICON_SELECTOR);this.trailingIcon=A?r(A):null,this.prefix=this.root.querySelector(p.PREFIX_SELECTOR),this.suffix=this.root.querySelector(p.SUFFIX_SELECTOR),this.ripple=this.createRipple(t)},e.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(),i.prototype.destroy.call(this)},e.prototype.initialSyncWithDOM=function(){this.disabled=this.input.disabled},Object.defineProperty(e.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(t){this.foundation.setDisabled(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"required",{get:function(){return this.input.required},set:function(t){this.input.required=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pattern",{get:function(){return this.input.pattern},set:function(t){this.input.pattern=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minLength",{get:function(){return this.input.minLength},set:function(t){this.input.minLength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"min",{get:function(){return this.input.min},set:function(t){this.input.min=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this.input.max},set:function(t){this.input.max=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"step",{get:function(){return this.input.step},set:function(t){this.input.step=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trailingIconAriaLabel",{set:function(t){this.foundation.setTrailingIconAriaLabel(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trailingIconContent",{set:function(t){this.foundation.setTrailingIconContent(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useNativeValidation",{set:function(t){this.foundation.setUseNativeValidation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"suffixText",{get:function(){return this.suffix?this.suffix.textContent:null},set:function(t){this.suffix&&(this.suffix.textContent=t)},enumerable:!1,configurable:!0}),e.prototype.focus=function(){this.input.focus()},e.prototype.layout=function(){this.foundation.notchOutline(this.foundation.shouldFloat)},e.prototype.getDefaultFoundation=function(){var t=n(n(n(n(n({},this.getRootAdapterMethods()),this.getInputAdapterMethods()),this.getLabelAdapterMethods()),this.getLineRippleAdapterMethods()),this.getOutlineAdapterMethods());return new N(t,this.getFoundationMap())},e.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()}}},e.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,i){t.input.addEventListener(n,i,s())},deregisterInputInteractionHandler:function(n,i){t.input.removeEventListener(n,i,s())}}},e.prototype.getLabelAdapterMethods=function(){var t=this;return{floatLabel:function(n){t.label&&t.label.float(n)},getLabelWidth:function(){return t.label?t.label.getWidth():0},hasLabel:function(){return Boolean(t.label)},shakeLabel:function(n){t.label&&t.label.shake(n)},setLabelRequired:function(n){t.label&&t.label.setRequired(n)}}},e.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)}}},e.prototype.getOutlineAdapterMethods=function(){var t=this;return{closeOutline:function(){t.outline&&t.outline.closeNotch()},hasOutline:function(){return Boolean(t.outline)},notchOutline:function(n){t.outline&&t.outline.notch(n)}}},e.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}},e.prototype.createRipple=function(t){var i=this,e=this.root.classList.contains(T.TEXTAREA),r=this.root.classList.contains(T.OUTLINED);if(e||r)return null;var h=n(n({},o.createAdapter(this)),{isSurfaceActive:function(){return u(i.input,":active")},registerInteractionHandler:function(t,n){i.input.addEventListener(t,n,s())},deregisterInteractionHandler:function(t,n){i.input.removeEventListener(t,n,s())}});return t(this.root,new c(h))},e}(e);
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2018 Google Inc.
|
|
@@ -42,4 +42,4 @@ import{_ as t,a as n,M as i,c as e,b as r,m as u}from"./p-D-I_3IxW.js";import{a
|
|
|
42
42
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
43
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
44
44
|
* THE SOFTWARE.
|
|
45
|
-
*/export{
|
|
45
|
+
*/export{k as M}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as e,r as t,c as l,a as c}from"./p-DBTJNfo7.js";import{b as i}from"./p-SlH7g-uH.js";import{a as d,S as o}from"./p-CxzDbuiY.js";import{i as n}from"./p-B8hi7R6R.js";import{c as r}from"./p-JbKhhoXs.js";import{g as s,b as a}from"./p-CgNJbSP4.js";import{M as m}from"./p-
|
|
1
|
+
import{h as e,r as t,c as l,a as c}from"./p-DBTJNfo7.js";import{b as i}from"./p-SlH7g-uH.js";import{a as d,S as o}from"./p-CxzDbuiY.js";import{i as n}from"./p-B8hi7R6R.js";import{c as r}from"./p-JbKhhoXs.js";import{g as s,b as a}from"./p-CgNJbSP4.js";import{M as m}from"./p-C9yTLqR8.js";import{_ as p,a as h,M as _,c as u}from"./p-ChRGk668.js";import"./p-B8VKuhvH.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google Inc.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as i,h as t,H as s,a as r}from"./p-DBTJNfo7.js";import{c as l}from"./p-JbKhhoXs.js";import{m as o,r as a}from"./p-BgTwPGeH.js";const h=class{constructor(s){e(this,s),this.change=i(this,"change"),this.disabled=!1,this.readonly=!1,this.value=!1,this.readonlyLabels=[],this.helperTextId=l(),this.fieldId=l(),this.renderReadonly=()=>t("limel-dynamic-label",{value:this.value,"aria-describedby":this.ariaDescribedBy,defaultLabel:{text:this.label,icon:this.value?{name:"ok",color:"var(--lime-primary-color, var(--limel-theme-primary-color))"}:"minus"},labels:this.readonlyLabels}),this.renderInteractive=()=>t("div",{class:"switch"},t("button",{id:this.fieldId,type:"button",role:"switch","aria-checked":String(this.value),disabled:this.disabled,onClick:this.handleClick,"aria-describedby":this.ariaDescribedBy},t("span",{class:"handle"})),t("label",{htmlFor:this.fieldId},this.label)),this.renderHelperLine=()=>{if(this.hasHelperText())return t("limel-helper-line",{helperTextId:this.helperTextId,helperText:this.helperText,invalid:this.invalid})},this.hasHelperText=()=>null!=this.helperText,this.handleClick=e=>{e.stopPropagation(),this.change.emit(!this.value)}}componentWillLoad(){o(this.host)}disconnectedCallback(){a(this.host)}render(){return t(s,{key:"3acdf2f3d34ab4cc8411638be9c8fe66a98b173d"},this.readonly?this.renderReadonly():this.renderInteractive(),this.renderHelperLine())}get ariaDescribedBy(){return this.helperText?this.helperTextId:void 0}get host(){return r(this)}};h.style='@charset "UTF-8";:host(limel-switch){min-height:1.75rem;display:flex;flex-direction:column;align-items:flex-start}.switch{display:grid;grid-template-columns:auto 1fr;gap:0.5rem;align-items:center;width:100%;min-height:1.75rem}button{border:none;outline:none;cursor:pointer;transition:background-color calc(0.2s + 0.2s) ease;flex-shrink:0;display:inline-flex;align-items:center;padding:0;width:2.25rem;height:1.25rem;border-radius:1.25rem;background-color:rgb(var(--contrast-700))}:host([disabled]) button{opacity:0.4;cursor:not-allowed}button[aria-checked=true]{background-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.handle{position:relative;display:flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;border-radius:50%;transition:transform 0.2s cubic-bezier(0.46, 0.52, 0.27, 1.55), box-shadow 0.2s ease, background-color 0.2s ease;transform:translateX(0)}button[aria-checked=true] .handle{transform:translateX(1rem)}button:focus-visible .handle{background-color:rgb(var(--color-white), 0.6);box-shadow:var(--shadow-depth-8-focused), var(--shadow-brighten-edges-inside)}.handle:after{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);content:"";position:absolute;inset:0.125rem;border-radius:50%;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal), var(--button-shadow-normal)}button:hover:not(:disabled) .handle:after{box-shadow:var(--button-shadow-normal), var(--button-shadow-hovered)}svg{width:0.625rem;height:0.625rem;fill:var(--lime-elevated-surface-background-color)}label{font-size:var(--limel-theme-default-font-size);cursor:pointer;width:fit-content}:host([disabled]) label{cursor:not-allowed;opacity:0.4}:host(limel-switch:focus),:host(limel-switch:focus-visible),:host(limel-switch:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-switch){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-switch:focus) limel-helper-line,:host(limel-switch:focus-visible) limel-helper-line,:host(limel-switch:focus-within) limel-helper-line,:host(limel-switch:hover) limel-helper-line{will-change:grid-template-rows}';export{h as limel_switch}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as r,a as s}from"./p-DBTJNfo7.js";import{c as o}from"./p-JbKhhoXs.js";import{_ as d,a as n,M as l,c,m as a}from"./p-
|
|
1
|
+
import{r as t,c as i,h as e,H as r,a as s}from"./p-DBTJNfo7.js";import{c as o}from"./p-JbKhhoXs.js";import{_ as d,a as n,M as l,c,m as a}from"./p-ChRGk668.js";import{M as h,a as m,b as u}from"./p-BN1-aIOw.js";import{A as p}from"./p-BDw7dT4x.js";import{g as f}from"./p-Dx8swykg.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -20,7 +20,7 @@ import{r as t,c as i,h as e,H as r,a as s}from"./p-DBTJNfo7.js";import{c as o}fr
|
|
|
20
20
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
22
|
* THE SOFTWARE.
|
|
23
|
-
*/var b,_,v,g="mdc-slider--disabled",y="mdc-slider__thumb",k="mdc-slider__thumb--focused",x="mdc-slider__thumb--top",w="mdc-slider__thumb--with-indicator",E="mdc-slider__tick-marks",C="mdc-slider__tick-mark--active",S="mdc-slider__tick-mark--inactive",T="disabled",I="min",z="max",D="value",M="step";!function(t){t[t.ACTIVE=0]="ACTIVE",t[t.INACTIVE=1]="INACTIVE"}(b||(b={})),function(t){t[t.START=1]="START",t[t.END=2]="END"}(_||(_={})),function(t){t.SLIDER_UPDATE="slider_update"}(v||(v={}));var A="undefined"!=typeof window,H=function(t){function i(e){var r=t.call(this,n(n({},i.defaultAdapter),e))||this;return r.initialStylesRemoved=!1,r.isDisabled=!1,r.isDiscrete=!1,r.step=1,r.hasTickMarks=!1,r.isRange=!1,r.thumb=null,r.downEventClientX=null,r.startThumbKnobWidth=0,r.endThumbKnobWidth=0,r.animFrame=new p,r}return d(i,t),Object.defineProperty(i,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},addThumbClass:function(){},removeThumbClass:function(){},getAttribute:function(){return null},getInputValue:function(){return""},setInputValue:function(){},getInputAttribute:function(){return null},setInputAttribute:function(){return null},removeInputAttribute:function(){return null},focusInput:function(){},isInputFocused:function(){return!1},getThumbKnobWidth:function(){return 0},getThumbBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},isRTL:function(){return!1},setThumbStyleProperty:function(){},removeThumbStyleProperty:function(){},setTrackActiveStyleProperty:function(){},removeTrackActiveStyleProperty:function(){},setValueIndicatorText:function(){},getValueToAriaValueTextFn:function(){return null},updateTickMarks:function(){},setPointerCapture:function(){},emitChangeEvent:function(){},emitInputEvent:function(){},emitDragStartEvent:function(){},emitDragEndEvent:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerThumbEventHandler:function(){},deregisterThumbEventHandler:function(){},registerInputEventHandler:function(){},deregisterInputEventHandler:function(){},registerBodyEventHandler:function(){},deregisterBodyEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!1,configurable:!0}),i.prototype.init=function(){var t=this;this.isDisabled=this.adapter.hasClass(g),this.isDiscrete=this.adapter.hasClass("mdc-slider--discrete"),this.hasTickMarks=this.adapter.hasClass("mdc-slider--tick-marks"),this.isRange=this.adapter.hasClass("mdc-slider--range");var i=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(I,this.isRange?_.START:_.END),I),e=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(z,_.END),z),r=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(D,_.END),D),s=this.isRange?this.convertAttributeValueToNumber(this.adapter.getInputAttribute(D,_.START),D):i,o=this.adapter.getInputAttribute(M,_.END),d=o?this.convertAttributeValueToNumber(o,M):this.step;this.validateProperties({min:i,max:e,value:r,valueStart:s,step:d}),this.min=i,this.max=e,this.value=r,this.valueStart=s,this.step=d,this.numDecimalPlaces=F(this.step),this.valueBeforeDownEvent=r,this.valueStartBeforeDownEvent=s,this.mousedownOrTouchstartListener=this.handleMousedownOrTouchstart.bind(this),this.moveListener=this.handleMove.bind(this),this.pointerdownListener=this.handlePointerdown.bind(this),this.pointerupListener=this.handlePointerup.bind(this),this.thumbMouseenterListener=this.handleThumbMouseenter.bind(this),this.thumbMouseleaveListener=this.handleThumbMouseleave.bind(this),this.inputStartChangeListener=function(){t.handleInputChange(_.START)},this.inputEndChangeListener=function(){t.handleInputChange(_.END)},this.inputStartFocusListener=function(){t.handleInputFocus(_.START)},this.inputEndFocusListener=function(){t.handleInputFocus(_.END)},this.inputStartBlurListener=function(){t.handleInputBlur(_.START)},this.inputEndBlurListener=function(){t.handleInputBlur(_.END)},this.resizeListener=this.handleResize.bind(this),this.registerEventHandlers()},i.prototype.destroy=function(){this.deregisterEventHandlers()},i.prototype.setMin=function(t){this.min=t,this.isRange||(this.valueStart=t),this.updateUI()},i.prototype.setMax=function(t){this.max=t,this.updateUI()},i.prototype.getMin=function(){return this.min},i.prototype.getMax=function(){return this.max},i.prototype.getValue=function(){return this.value},i.prototype.setValue=function(t){if(this.isRange&&t<this.valueStart)throw new Error("end thumb value ("+t+") must be >= start thumb value ("+this.valueStart+")");this.updateValue(t,_.END)},i.prototype.getValueStart=function(){if(!this.isRange)throw new Error("`valueStart` is only applicable for range sliders.");return this.valueStart},i.prototype.setValueStart=function(t){if(!this.isRange)throw new Error("`valueStart` is only applicable for range sliders.");if(this.isRange&&t>this.value)throw new Error("start thumb value ("+t+") must be <= end thumb value ("+this.value+")");this.updateValue(t,_.START)},i.prototype.setStep=function(t){this.step=t,this.numDecimalPlaces=F(t),this.updateUI()},i.prototype.setIsDiscrete=function(t){this.isDiscrete=t,this.updateValueIndicatorUI(),this.updateTickMarksUI()},i.prototype.getStep=function(){return this.step},i.prototype.setHasTickMarks=function(t){this.hasTickMarks=t,this.updateTickMarksUI()},i.prototype.getDisabled=function(){return this.isDisabled},i.prototype.setDisabled=function(t){this.isDisabled=t,t?(this.adapter.addClass(g),this.isRange&&this.adapter.setInputAttribute(T,"",_.START),this.adapter.setInputAttribute(T,"",_.END)):(this.adapter.removeClass(g),this.isRange&&this.adapter.removeInputAttribute(T,_.START),this.adapter.removeInputAttribute(T,_.END))},i.prototype.getIsRange=function(){return this.isRange},i.prototype.layout=function(t){var i=(void 0===t?{}:t).skipUpdateUI;this.rect=this.adapter.getBoundingClientRect(),this.isRange&&(this.startThumbKnobWidth=this.adapter.getThumbKnobWidth(_.START),this.endThumbKnobWidth=this.adapter.getThumbKnobWidth(_.END)),i||this.updateUI()},i.prototype.handleResize=function(){this.layout()},i.prototype.handleDown=function(t){if(!this.isDisabled){this.valueStartBeforeDownEvent=this.valueStart,this.valueBeforeDownEvent=this.value;var i=null!=t.clientX?t.clientX:t.targetTouches[0].clientX;this.downEventClientX=i;var e=this.mapClientXOnSliderScale(i);this.thumb=this.getThumbFromDownEvent(i,e),null!==this.thumb&&(this.handleDragStart(t,e,this.thumb),this.updateValue(e,this.thumb,{emitInputEvent:!0}))}},i.prototype.handleMove=function(t){if(!this.isDisabled){t.preventDefault();var i=null!=t.clientX?t.clientX:t.targetTouches[0].clientX,e=null!=this.thumb;if(this.thumb=this.getThumbFromMoveEvent(i),null!==this.thumb){var r=this.mapClientXOnSliderScale(i);e||(this.handleDragStart(t,r,this.thumb),this.adapter.emitDragStartEvent(r,this.thumb)),this.updateValue(r,this.thumb,{emitInputEvent:!0})}}},i.prototype.handleUp=function(){if(!this.isDisabled&&null!==this.thumb){var t=this.thumb===_.START?this.valueStart:this.value;(this.thumb===_.START?this.valueStartBeforeDownEvent:this.valueBeforeDownEvent)!==t&&this.adapter.emitChangeEvent(t,this.thumb),this.adapter.emitDragEndEvent(t,this.thumb),this.thumb=null}},i.prototype.handleThumbMouseenter=function(){this.isDiscrete&&this.isRange&&(this.adapter.addThumbClass(w,_.START),this.adapter.addThumbClass(w,_.END))},i.prototype.handleThumbMouseleave=function(){this.isDiscrete&&this.isRange&&(this.adapter.isInputFocused(_.START)||this.adapter.isInputFocused(_.END)||(this.adapter.removeThumbClass(w,_.START),this.adapter.removeThumbClass(w,_.END)))},i.prototype.handleMousedownOrTouchstart=function(t){var i=this,e="mousedown"===t.type?"mousemove":"touchmove";this.adapter.registerBodyEventHandler(e,this.moveListener);var r=function(){i.handleUp(),i.adapter.deregisterBodyEventHandler(e,i.moveListener),i.adapter.deregisterEventHandler("mouseup",r),i.adapter.deregisterEventHandler("touchend",r)};this.adapter.registerBodyEventHandler("mouseup",r),this.adapter.registerBodyEventHandler("touchend",r),this.handleDown(t)},i.prototype.handlePointerdown=function(t){this.adapter.setPointerCapture(t.pointerId),this.adapter.registerEventHandler("pointermove",this.moveListener),this.handleDown(t)},i.prototype.handleInputChange=function(t){var i=Number(this.adapter.getInputValue(t));t===_.START?this.setValueStart(i):this.setValue(i),this.adapter.emitChangeEvent(t===_.START?this.valueStart:this.value,t),this.adapter.emitInputEvent(t===_.START?this.valueStart:this.value,t)},i.prototype.handleInputFocus=function(t){this.adapter.addThumbClass(k,t),this.isDiscrete&&(this.adapter.addThumbClass(w,t),this.isRange&&this.adapter.addThumbClass(w,t===_.START?_.END:_.START))},i.prototype.handleInputBlur=function(t){this.adapter.removeThumbClass(k,t),this.isDiscrete&&(this.adapter.removeThumbClass(w,t),this.isRange&&this.adapter.removeThumbClass(w,t===_.START?_.END:_.START))},i.prototype.handleDragStart=function(t,i,e){this.adapter.emitDragStartEvent(i,e),this.adapter.focusInput(e),t.preventDefault()},i.prototype.getThumbFromDownEvent=function(t,i){if(!this.isRange)return _.END;var e=this.adapter.getThumbBoundingClientRect(_.START),r=this.adapter.getThumbBoundingClientRect(_.END),s=t>=e.left&&t<=e.right,o=t>=r.left&&t<=r.right;return s&&o?null:s?_.START:o?_.END:i<this.valueStart?_.START:i>this.value?_.END:i-this.valueStart<=this.value-i?_.START:_.END},i.prototype.getThumbFromMoveEvent=function(t){if(null!==this.thumb)return this.thumb;if(null===this.downEventClientX)throw new Error("`downEventClientX` is null after move event.");return Math.abs(this.downEventClientX-t)<5?this.thumb:t<this.downEventClientX?this.adapter.isRTL()?_.END:_.START:this.adapter.isRTL()?_.START:_.END},i.prototype.updateUI=function(t){this.updateThumbAndInputAttributes(t),this.updateThumbAndTrackUI(t),this.updateValueIndicatorUI(t),this.updateTickMarksUI()},i.prototype.updateThumbAndInputAttributes=function(t){if(t){var i=this.isRange&&t===_.START?this.valueStart:this.value,e=String(i);this.adapter.setInputAttribute(D,e,t),this.isRange&&t===_.START?this.adapter.setInputAttribute(I,e,_.END):this.isRange&&t===_.END&&this.adapter.setInputAttribute(z,e,_.START),this.adapter.getInputValue(t)!==e&&this.adapter.setInputValue(e,t);var r=this.adapter.getValueToAriaValueTextFn();r&&this.adapter.setInputAttribute("aria-valuetext",r(i),t)}},i.prototype.updateValueIndicatorUI=function(t){this.isDiscrete&&(this.adapter.setValueIndicatorText(this.isRange&&t===_.START?this.valueStart:this.value,t===_.START?_.START:_.END),!t&&this.isRange&&this.adapter.setValueIndicatorText(this.valueStart,_.START))},i.prototype.updateTickMarksUI=function(){if(this.isDiscrete&&this.hasTickMarks){var t=(this.value-this.valueStart)/this.step+1,i=(this.max-this.value)/this.step,e=Array.from({length:(this.valueStart-this.min)/this.step}).fill(b.INACTIVE),r=Array.from({length:t}).fill(b.ACTIVE),s=Array.from({length:i}).fill(b.INACTIVE);this.adapter.updateTickMarks(e.concat(r).concat(s))}},i.prototype.mapClientXOnSliderScale=function(t){var i=(t-this.rect.left)/this.rect.width;this.adapter.isRTL()&&(i=1-i);var e=this.min+i*(this.max-this.min);return e===this.max||e===this.min?e:Number(this.quantize(e).toFixed(this.numDecimalPlaces))},i.prototype.quantize=function(t){var i=Math.round((t-this.min)/this.step);return this.min+i*this.step},i.prototype.updateValue=function(t,i,e){var r=(void 0===e?{}:e).emitInputEvent;if(t=this.clampValue(t,i),this.isRange&&i===_.START){if(this.valueStart===t)return;this.valueStart=t}else{if(this.value===t)return;this.value=t}this.updateUI(i),r&&this.adapter.emitInputEvent(i===_.START?this.valueStart:this.value,i)},i.prototype.clampValue=function(t,i){return t=Math.min(Math.max(t,this.min),this.max),this.isRange&&i===_.START&&t>this.value?this.value:this.isRange&&i===_.END&&t<this.valueStart?this.valueStart:t},i.prototype.updateThumbAndTrackUI=function(t){var i=this,e=this.max,r=this.min,s=(this.value-this.valueStart)/(e-r),o=s*this.rect.width,d=this.adapter.isRTL(),n=A?f(window,"transform"):"transform";if(this.isRange){var l=this.adapter.isRTL()?(e-this.value)/(e-r)*this.rect.width:(this.valueStart-r)/(e-r)*this.rect.width,c=l+o;this.animFrame.request(v.SLIDER_UPDATE,(function(){!d&&t===_.START||d&&t!==_.START?(i.adapter.setTrackActiveStyleProperty("transform-origin","right"),i.adapter.setTrackActiveStyleProperty("left","unset"),i.adapter.setTrackActiveStyleProperty("right",i.rect.width-c+"px")):(i.adapter.setTrackActiveStyleProperty("transform-origin","left"),i.adapter.setTrackActiveStyleProperty("right","unset"),i.adapter.setTrackActiveStyleProperty("left",l+"px")),i.adapter.setTrackActiveStyleProperty(n,"scaleX("+s+")");var e=d?c:l,r=i.adapter.isRTL()?l:c;t!==_.START&&t&&i.initialStylesRemoved||i.adapter.setThumbStyleProperty(n,"translateX("+e+"px)",_.START),t!==_.END&&t&&i.initialStylesRemoved||i.adapter.setThumbStyleProperty(n,"translateX("+r+"px)",_.END),i.removeInitialStyles(d),i.updateOverlappingThumbsUI(e,r,t)}))}else this.animFrame.request(v.SLIDER_UPDATE,(function(){i.adapter.setThumbStyleProperty(n,"translateX("+(d?i.rect.width-o:o)+"px)",_.END),i.adapter.setTrackActiveStyleProperty(n,"scaleX("+s+")"),i.removeInitialStyles(d)}))},i.prototype.removeInitialStyles=function(t){if(!this.initialStylesRemoved){var i=t?"right":"left";this.adapter.removeThumbStyleProperty(i,_.END),this.isRange&&this.adapter.removeThumbStyleProperty(i,_.START),this.initialStylesRemoved=!0,this.resetTrackAndThumbAnimation()}},i.prototype.resetTrackAndThumbAnimation=function(){var t=this;if(this.isDiscrete){var i=A?f(window,"transition"):"transition",e="all 0s ease 0s";this.adapter.setThumbStyleProperty(i,e,_.END),this.isRange&&this.adapter.setThumbStyleProperty(i,e,_.START),this.adapter.setTrackActiveStyleProperty(i,e),requestAnimationFrame((function(){t.adapter.removeThumbStyleProperty(i,_.END),t.adapter.removeTrackActiveStyleProperty(i),t.isRange&&t.adapter.removeThumbStyleProperty(i,_.START)}))}},i.prototype.updateOverlappingThumbsUI=function(t,i,e){(this.adapter.isRTL()?i+this.endThumbKnobWidth/2>=t-this.startThumbKnobWidth/2:t+this.startThumbKnobWidth/2>=i-this.endThumbKnobWidth/2)?(this.adapter.addThumbClass(x,e||_.END),this.adapter.removeThumbClass(x,e===_.START?_.END:_.START)):(this.adapter.removeThumbClass(x,_.START),this.adapter.removeThumbClass(x,_.END))},i.prototype.convertAttributeValueToNumber=function(t,i){if(null===t)throw new Error("MDCSliderFoundation: `"+i+"` must be non-null.");var e=Number(t);if(isNaN(e))throw new Error("MDCSliderFoundation: `"+i+"` value is `"+t+"`, but must be a number.");return e},i.prototype.validateProperties=function(t){var i=t.min,e=t.max,r=t.value,s=t.valueStart,o=t.step;if(i>=e)throw new Error("MDCSliderFoundation: min must be strictly less than max. Current: [min: "+i+", max: "+e+"]");if(o<=0)throw new Error("MDCSliderFoundation: step must be a positive number. Current step: "+this.step);if(this.isRange){if(r<i||r>e||s<i||s>e)throw new Error("MDCSliderFoundation: values must be in [min, max] range. Current values: [start value: "+s+", end value: "+r+"]");if(s>r)throw new Error("MDCSliderFoundation: start value must be <= end value. Current values: [start value: "+s+", end value: "+r+"]");var d=(r-i)/o;if((s-i)/o%1!=0||d%1!=0)throw new Error("MDCSliderFoundation: Slider values must be valid based on the step value. Current values: [start value: "+s+", end value: "+r+"]")}else{if(r<i||r>e)throw new Error("MDCSliderFoundation: value must be in [min, max] range. Current value: "+r);if((d=(r-i)/o)%1!=0)throw new Error("MDCSliderFoundation: Slider value must be valid based on the step value. Current value: "+r)}},i.prototype.registerEventHandlers=function(){this.adapter.registerWindowEventHandler("resize",this.resizeListener),i.SUPPORTS_POINTER_EVENTS?(this.adapter.registerEventHandler("pointerdown",this.pointerdownListener),this.adapter.registerEventHandler("pointerup",this.pointerupListener)):(this.adapter.registerEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.registerEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.registerThumbEventHandler(_.START,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(_.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(_.START,"change",this.inputStartChangeListener),this.adapter.registerInputEventHandler(_.START,"focus",this.inputStartFocusListener),this.adapter.registerInputEventHandler(_.START,"blur",this.inputStartBlurListener)),this.adapter.registerThumbEventHandler(_.END,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(_.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(_.END,"change",this.inputEndChangeListener),this.adapter.registerInputEventHandler(_.END,"focus",this.inputEndFocusListener),this.adapter.registerInputEventHandler(_.END,"blur",this.inputEndBlurListener)},i.prototype.deregisterEventHandlers=function(){this.adapter.deregisterWindowEventHandler("resize",this.resizeListener),i.SUPPORTS_POINTER_EVENTS?(this.adapter.deregisterEventHandler("pointerdown",this.pointerdownListener),this.adapter.deregisterEventHandler("pointerup",this.pointerupListener)):(this.adapter.deregisterEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.deregisterEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.deregisterThumbEventHandler(_.START,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(_.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(_.START,"change",this.inputStartChangeListener),this.adapter.deregisterInputEventHandler(_.START,"focus",this.inputStartFocusListener),this.adapter.deregisterInputEventHandler(_.START,"blur",this.inputStartBlurListener)),this.adapter.deregisterThumbEventHandler(_.END,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(_.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(_.END,"change",this.inputEndChangeListener),this.adapter.deregisterInputEventHandler(_.END,"focus",this.inputEndFocusListener),this.adapter.deregisterInputEventHandler(_.END,"blur",this.inputEndBlurListener)},i.prototype.handlePointerup=function(){this.handleUp(),this.adapter.deregisterEventHandler("pointermove",this.moveListener)},i.SUPPORTS_POINTER_EVENTS=A&&Boolean(window.PointerEvent)&&!(["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document),i}(l);function F(t){var i=/(?:\.(\d+))?(?:[eE]([+\-]?\d+))?$/.exec(String(t));if(!i)return 0;var e=i[1]||"";return Math.max(0,("0"===e?0:e.length)-Number(i[2]||0))}
|
|
23
|
+
*/var b,_,v,g="mdc-slider--disabled",y="mdc-slider__thumb",k="mdc-slider__thumb--focused",x="mdc-slider__thumb--top",w="mdc-slider__thumb--with-indicator",E="mdc-slider__tick-marks",C="mdc-slider__tick-mark--active",S="mdc-slider__tick-mark--inactive",T="disabled",I="min",z="max",M="value",D="step";!function(t){t[t.ACTIVE=0]="ACTIVE",t[t.INACTIVE=1]="INACTIVE"}(b||(b={})),function(t){t[t.START=1]="START",t[t.END=2]="END"}(_||(_={})),function(t){t.SLIDER_UPDATE="slider_update"}(v||(v={}));var A="undefined"!=typeof window,H=function(t){function i(e){var r=t.call(this,n(n({},i.defaultAdapter),e))||this;return r.initialStylesRemoved=!1,r.isDisabled=!1,r.isDiscrete=!1,r.step=1,r.hasTickMarks=!1,r.isRange=!1,r.thumb=null,r.downEventClientX=null,r.startThumbKnobWidth=0,r.endThumbKnobWidth=0,r.animFrame=new p,r}return d(i,t),Object.defineProperty(i,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},addThumbClass:function(){},removeThumbClass:function(){},getAttribute:function(){return null},getInputValue:function(){return""},setInputValue:function(){},getInputAttribute:function(){return null},setInputAttribute:function(){return null},removeInputAttribute:function(){return null},focusInput:function(){},isInputFocused:function(){return!1},getThumbKnobWidth:function(){return 0},getThumbBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},isRTL:function(){return!1},setThumbStyleProperty:function(){},removeThumbStyleProperty:function(){},setTrackActiveStyleProperty:function(){},removeTrackActiveStyleProperty:function(){},setValueIndicatorText:function(){},getValueToAriaValueTextFn:function(){return null},updateTickMarks:function(){},setPointerCapture:function(){},emitChangeEvent:function(){},emitInputEvent:function(){},emitDragStartEvent:function(){},emitDragEndEvent:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerThumbEventHandler:function(){},deregisterThumbEventHandler:function(){},registerInputEventHandler:function(){},deregisterInputEventHandler:function(){},registerBodyEventHandler:function(){},deregisterBodyEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!1,configurable:!0}),i.prototype.init=function(){var t=this;this.isDisabled=this.adapter.hasClass(g),this.isDiscrete=this.adapter.hasClass("mdc-slider--discrete"),this.hasTickMarks=this.adapter.hasClass("mdc-slider--tick-marks"),this.isRange=this.adapter.hasClass("mdc-slider--range");var i=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(I,this.isRange?_.START:_.END),I),e=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(z,_.END),z),r=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(M,_.END),M),s=this.isRange?this.convertAttributeValueToNumber(this.adapter.getInputAttribute(M,_.START),M):i,o=this.adapter.getInputAttribute(D,_.END),d=o?this.convertAttributeValueToNumber(o,D):this.step;this.validateProperties({min:i,max:e,value:r,valueStart:s,step:d}),this.min=i,this.max=e,this.value=r,this.valueStart=s,this.step=d,this.numDecimalPlaces=F(this.step),this.valueBeforeDownEvent=r,this.valueStartBeforeDownEvent=s,this.mousedownOrTouchstartListener=this.handleMousedownOrTouchstart.bind(this),this.moveListener=this.handleMove.bind(this),this.pointerdownListener=this.handlePointerdown.bind(this),this.pointerupListener=this.handlePointerup.bind(this),this.thumbMouseenterListener=this.handleThumbMouseenter.bind(this),this.thumbMouseleaveListener=this.handleThumbMouseleave.bind(this),this.inputStartChangeListener=function(){t.handleInputChange(_.START)},this.inputEndChangeListener=function(){t.handleInputChange(_.END)},this.inputStartFocusListener=function(){t.handleInputFocus(_.START)},this.inputEndFocusListener=function(){t.handleInputFocus(_.END)},this.inputStartBlurListener=function(){t.handleInputBlur(_.START)},this.inputEndBlurListener=function(){t.handleInputBlur(_.END)},this.resizeListener=this.handleResize.bind(this),this.registerEventHandlers()},i.prototype.destroy=function(){this.deregisterEventHandlers()},i.prototype.setMin=function(t){this.min=t,this.isRange||(this.valueStart=t),this.updateUI()},i.prototype.setMax=function(t){this.max=t,this.updateUI()},i.prototype.getMin=function(){return this.min},i.prototype.getMax=function(){return this.max},i.prototype.getValue=function(){return this.value},i.prototype.setValue=function(t){if(this.isRange&&t<this.valueStart)throw new Error("end thumb value ("+t+") must be >= start thumb value ("+this.valueStart+")");this.updateValue(t,_.END)},i.prototype.getValueStart=function(){if(!this.isRange)throw new Error("`valueStart` is only applicable for range sliders.");return this.valueStart},i.prototype.setValueStart=function(t){if(!this.isRange)throw new Error("`valueStart` is only applicable for range sliders.");if(this.isRange&&t>this.value)throw new Error("start thumb value ("+t+") must be <= end thumb value ("+this.value+")");this.updateValue(t,_.START)},i.prototype.setStep=function(t){this.step=t,this.numDecimalPlaces=F(t),this.updateUI()},i.prototype.setIsDiscrete=function(t){this.isDiscrete=t,this.updateValueIndicatorUI(),this.updateTickMarksUI()},i.prototype.getStep=function(){return this.step},i.prototype.setHasTickMarks=function(t){this.hasTickMarks=t,this.updateTickMarksUI()},i.prototype.getDisabled=function(){return this.isDisabled},i.prototype.setDisabled=function(t){this.isDisabled=t,t?(this.adapter.addClass(g),this.isRange&&this.adapter.setInputAttribute(T,"",_.START),this.adapter.setInputAttribute(T,"",_.END)):(this.adapter.removeClass(g),this.isRange&&this.adapter.removeInputAttribute(T,_.START),this.adapter.removeInputAttribute(T,_.END))},i.prototype.getIsRange=function(){return this.isRange},i.prototype.layout=function(t){var i=(void 0===t?{}:t).skipUpdateUI;this.rect=this.adapter.getBoundingClientRect(),this.isRange&&(this.startThumbKnobWidth=this.adapter.getThumbKnobWidth(_.START),this.endThumbKnobWidth=this.adapter.getThumbKnobWidth(_.END)),i||this.updateUI()},i.prototype.handleResize=function(){this.layout()},i.prototype.handleDown=function(t){if(!this.isDisabled){this.valueStartBeforeDownEvent=this.valueStart,this.valueBeforeDownEvent=this.value;var i=null!=t.clientX?t.clientX:t.targetTouches[0].clientX;this.downEventClientX=i;var e=this.mapClientXOnSliderScale(i);this.thumb=this.getThumbFromDownEvent(i,e),null!==this.thumb&&(this.handleDragStart(t,e,this.thumb),this.updateValue(e,this.thumb,{emitInputEvent:!0}))}},i.prototype.handleMove=function(t){if(!this.isDisabled){t.preventDefault();var i=null!=t.clientX?t.clientX:t.targetTouches[0].clientX,e=null!=this.thumb;if(this.thumb=this.getThumbFromMoveEvent(i),null!==this.thumb){var r=this.mapClientXOnSliderScale(i);e||(this.handleDragStart(t,r,this.thumb),this.adapter.emitDragStartEvent(r,this.thumb)),this.updateValue(r,this.thumb,{emitInputEvent:!0})}}},i.prototype.handleUp=function(){if(!this.isDisabled&&null!==this.thumb){var t=this.thumb===_.START?this.valueStart:this.value;(this.thumb===_.START?this.valueStartBeforeDownEvent:this.valueBeforeDownEvent)!==t&&this.adapter.emitChangeEvent(t,this.thumb),this.adapter.emitDragEndEvent(t,this.thumb),this.thumb=null}},i.prototype.handleThumbMouseenter=function(){this.isDiscrete&&this.isRange&&(this.adapter.addThumbClass(w,_.START),this.adapter.addThumbClass(w,_.END))},i.prototype.handleThumbMouseleave=function(){this.isDiscrete&&this.isRange&&(this.adapter.isInputFocused(_.START)||this.adapter.isInputFocused(_.END)||(this.adapter.removeThumbClass(w,_.START),this.adapter.removeThumbClass(w,_.END)))},i.prototype.handleMousedownOrTouchstart=function(t){var i=this,e="mousedown"===t.type?"mousemove":"touchmove";this.adapter.registerBodyEventHandler(e,this.moveListener);var r=function(){i.handleUp(),i.adapter.deregisterBodyEventHandler(e,i.moveListener),i.adapter.deregisterEventHandler("mouseup",r),i.adapter.deregisterEventHandler("touchend",r)};this.adapter.registerBodyEventHandler("mouseup",r),this.adapter.registerBodyEventHandler("touchend",r),this.handleDown(t)},i.prototype.handlePointerdown=function(t){this.adapter.setPointerCapture(t.pointerId),this.adapter.registerEventHandler("pointermove",this.moveListener),this.handleDown(t)},i.prototype.handleInputChange=function(t){var i=Number(this.adapter.getInputValue(t));t===_.START?this.setValueStart(i):this.setValue(i),this.adapter.emitChangeEvent(t===_.START?this.valueStart:this.value,t),this.adapter.emitInputEvent(t===_.START?this.valueStart:this.value,t)},i.prototype.handleInputFocus=function(t){this.adapter.addThumbClass(k,t),this.isDiscrete&&(this.adapter.addThumbClass(w,t),this.isRange&&this.adapter.addThumbClass(w,t===_.START?_.END:_.START))},i.prototype.handleInputBlur=function(t){this.adapter.removeThumbClass(k,t),this.isDiscrete&&(this.adapter.removeThumbClass(w,t),this.isRange&&this.adapter.removeThumbClass(w,t===_.START?_.END:_.START))},i.prototype.handleDragStart=function(t,i,e){this.adapter.emitDragStartEvent(i,e),this.adapter.focusInput(e),t.preventDefault()},i.prototype.getThumbFromDownEvent=function(t,i){if(!this.isRange)return _.END;var e=this.adapter.getThumbBoundingClientRect(_.START),r=this.adapter.getThumbBoundingClientRect(_.END),s=t>=e.left&&t<=e.right,o=t>=r.left&&t<=r.right;return s&&o?null:s?_.START:o?_.END:i<this.valueStart?_.START:i>this.value?_.END:i-this.valueStart<=this.value-i?_.START:_.END},i.prototype.getThumbFromMoveEvent=function(t){if(null!==this.thumb)return this.thumb;if(null===this.downEventClientX)throw new Error("`downEventClientX` is null after move event.");return Math.abs(this.downEventClientX-t)<5?this.thumb:t<this.downEventClientX?this.adapter.isRTL()?_.END:_.START:this.adapter.isRTL()?_.START:_.END},i.prototype.updateUI=function(t){this.updateThumbAndInputAttributes(t),this.updateThumbAndTrackUI(t),this.updateValueIndicatorUI(t),this.updateTickMarksUI()},i.prototype.updateThumbAndInputAttributes=function(t){if(t){var i=this.isRange&&t===_.START?this.valueStart:this.value,e=String(i);this.adapter.setInputAttribute(M,e,t),this.isRange&&t===_.START?this.adapter.setInputAttribute(I,e,_.END):this.isRange&&t===_.END&&this.adapter.setInputAttribute(z,e,_.START),this.adapter.getInputValue(t)!==e&&this.adapter.setInputValue(e,t);var r=this.adapter.getValueToAriaValueTextFn();r&&this.adapter.setInputAttribute("aria-valuetext",r(i),t)}},i.prototype.updateValueIndicatorUI=function(t){this.isDiscrete&&(this.adapter.setValueIndicatorText(this.isRange&&t===_.START?this.valueStart:this.value,t===_.START?_.START:_.END),!t&&this.isRange&&this.adapter.setValueIndicatorText(this.valueStart,_.START))},i.prototype.updateTickMarksUI=function(){if(this.isDiscrete&&this.hasTickMarks){var t=(this.value-this.valueStart)/this.step+1,i=(this.max-this.value)/this.step,e=Array.from({length:(this.valueStart-this.min)/this.step}).fill(b.INACTIVE),r=Array.from({length:t}).fill(b.ACTIVE),s=Array.from({length:i}).fill(b.INACTIVE);this.adapter.updateTickMarks(e.concat(r).concat(s))}},i.prototype.mapClientXOnSliderScale=function(t){var i=(t-this.rect.left)/this.rect.width;this.adapter.isRTL()&&(i=1-i);var e=this.min+i*(this.max-this.min);return e===this.max||e===this.min?e:Number(this.quantize(e).toFixed(this.numDecimalPlaces))},i.prototype.quantize=function(t){var i=Math.round((t-this.min)/this.step);return this.min+i*this.step},i.prototype.updateValue=function(t,i,e){var r=(void 0===e?{}:e).emitInputEvent;if(t=this.clampValue(t,i),this.isRange&&i===_.START){if(this.valueStart===t)return;this.valueStart=t}else{if(this.value===t)return;this.value=t}this.updateUI(i),r&&this.adapter.emitInputEvent(i===_.START?this.valueStart:this.value,i)},i.prototype.clampValue=function(t,i){return t=Math.min(Math.max(t,this.min),this.max),this.isRange&&i===_.START&&t>this.value?this.value:this.isRange&&i===_.END&&t<this.valueStart?this.valueStart:t},i.prototype.updateThumbAndTrackUI=function(t){var i=this,e=this.max,r=this.min,s=(this.value-this.valueStart)/(e-r),o=s*this.rect.width,d=this.adapter.isRTL(),n=A?f(window,"transform"):"transform";if(this.isRange){var l=this.adapter.isRTL()?(e-this.value)/(e-r)*this.rect.width:(this.valueStart-r)/(e-r)*this.rect.width,c=l+o;this.animFrame.request(v.SLIDER_UPDATE,(function(){!d&&t===_.START||d&&t!==_.START?(i.adapter.setTrackActiveStyleProperty("transform-origin","right"),i.adapter.setTrackActiveStyleProperty("left","unset"),i.adapter.setTrackActiveStyleProperty("right",i.rect.width-c+"px")):(i.adapter.setTrackActiveStyleProperty("transform-origin","left"),i.adapter.setTrackActiveStyleProperty("right","unset"),i.adapter.setTrackActiveStyleProperty("left",l+"px")),i.adapter.setTrackActiveStyleProperty(n,"scaleX("+s+")");var e=d?c:l,r=i.adapter.isRTL()?l:c;t!==_.START&&t&&i.initialStylesRemoved||i.adapter.setThumbStyleProperty(n,"translateX("+e+"px)",_.START),t!==_.END&&t&&i.initialStylesRemoved||i.adapter.setThumbStyleProperty(n,"translateX("+r+"px)",_.END),i.removeInitialStyles(d),i.updateOverlappingThumbsUI(e,r,t)}))}else this.animFrame.request(v.SLIDER_UPDATE,(function(){i.adapter.setThumbStyleProperty(n,"translateX("+(d?i.rect.width-o:o)+"px)",_.END),i.adapter.setTrackActiveStyleProperty(n,"scaleX("+s+")"),i.removeInitialStyles(d)}))},i.prototype.removeInitialStyles=function(t){if(!this.initialStylesRemoved){var i=t?"right":"left";this.adapter.removeThumbStyleProperty(i,_.END),this.isRange&&this.adapter.removeThumbStyleProperty(i,_.START),this.initialStylesRemoved=!0,this.resetTrackAndThumbAnimation()}},i.prototype.resetTrackAndThumbAnimation=function(){var t=this;if(this.isDiscrete){var i=A?f(window,"transition"):"transition",e="all 0s ease 0s";this.adapter.setThumbStyleProperty(i,e,_.END),this.isRange&&this.adapter.setThumbStyleProperty(i,e,_.START),this.adapter.setTrackActiveStyleProperty(i,e),requestAnimationFrame((function(){t.adapter.removeThumbStyleProperty(i,_.END),t.adapter.removeTrackActiveStyleProperty(i),t.isRange&&t.adapter.removeThumbStyleProperty(i,_.START)}))}},i.prototype.updateOverlappingThumbsUI=function(t,i,e){(this.adapter.isRTL()?i+this.endThumbKnobWidth/2>=t-this.startThumbKnobWidth/2:t+this.startThumbKnobWidth/2>=i-this.endThumbKnobWidth/2)?(this.adapter.addThumbClass(x,e||_.END),this.adapter.removeThumbClass(x,e===_.START?_.END:_.START)):(this.adapter.removeThumbClass(x,_.START),this.adapter.removeThumbClass(x,_.END))},i.prototype.convertAttributeValueToNumber=function(t,i){if(null===t)throw new Error("MDCSliderFoundation: `"+i+"` must be non-null.");var e=Number(t);if(isNaN(e))throw new Error("MDCSliderFoundation: `"+i+"` value is `"+t+"`, but must be a number.");return e},i.prototype.validateProperties=function(t){var i=t.min,e=t.max,r=t.value,s=t.valueStart,o=t.step;if(i>=e)throw new Error("MDCSliderFoundation: min must be strictly less than max. Current: [min: "+i+", max: "+e+"]");if(o<=0)throw new Error("MDCSliderFoundation: step must be a positive number. Current step: "+this.step);if(this.isRange){if(r<i||r>e||s<i||s>e)throw new Error("MDCSliderFoundation: values must be in [min, max] range. Current values: [start value: "+s+", end value: "+r+"]");if(s>r)throw new Error("MDCSliderFoundation: start value must be <= end value. Current values: [start value: "+s+", end value: "+r+"]");var d=(r-i)/o;if((s-i)/o%1!=0||d%1!=0)throw new Error("MDCSliderFoundation: Slider values must be valid based on the step value. Current values: [start value: "+s+", end value: "+r+"]")}else{if(r<i||r>e)throw new Error("MDCSliderFoundation: value must be in [min, max] range. Current value: "+r);if((d=(r-i)/o)%1!=0)throw new Error("MDCSliderFoundation: Slider value must be valid based on the step value. Current value: "+r)}},i.prototype.registerEventHandlers=function(){this.adapter.registerWindowEventHandler("resize",this.resizeListener),i.SUPPORTS_POINTER_EVENTS?(this.adapter.registerEventHandler("pointerdown",this.pointerdownListener),this.adapter.registerEventHandler("pointerup",this.pointerupListener)):(this.adapter.registerEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.registerEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.registerThumbEventHandler(_.START,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(_.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(_.START,"change",this.inputStartChangeListener),this.adapter.registerInputEventHandler(_.START,"focus",this.inputStartFocusListener),this.adapter.registerInputEventHandler(_.START,"blur",this.inputStartBlurListener)),this.adapter.registerThumbEventHandler(_.END,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(_.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(_.END,"change",this.inputEndChangeListener),this.adapter.registerInputEventHandler(_.END,"focus",this.inputEndFocusListener),this.adapter.registerInputEventHandler(_.END,"blur",this.inputEndBlurListener)},i.prototype.deregisterEventHandlers=function(){this.adapter.deregisterWindowEventHandler("resize",this.resizeListener),i.SUPPORTS_POINTER_EVENTS?(this.adapter.deregisterEventHandler("pointerdown",this.pointerdownListener),this.adapter.deregisterEventHandler("pointerup",this.pointerupListener)):(this.adapter.deregisterEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.deregisterEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.deregisterThumbEventHandler(_.START,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(_.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(_.START,"change",this.inputStartChangeListener),this.adapter.deregisterInputEventHandler(_.START,"focus",this.inputStartFocusListener),this.adapter.deregisterInputEventHandler(_.START,"blur",this.inputStartBlurListener)),this.adapter.deregisterThumbEventHandler(_.END,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(_.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(_.END,"change",this.inputEndChangeListener),this.adapter.deregisterInputEventHandler(_.END,"focus",this.inputEndFocusListener),this.adapter.deregisterInputEventHandler(_.END,"blur",this.inputEndBlurListener)},i.prototype.handlePointerup=function(){this.handleUp(),this.adapter.deregisterEventHandler("pointermove",this.moveListener)},i.SUPPORTS_POINTER_EVENTS=A&&Boolean(window.PointerEvent)&&!(["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document),i}(l);function F(t){var i=/(?:\.(\d+))?(?:[eE]([+\-]?\d+))?$/.exec(String(t));if(!i)return 0;var e=i[1]||"";return Math.max(0,("0"===e?0:e.length)-Number(i[2]||0))}
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2020 Google Inc.
|