@limetech/lime-elements 39.10.3 → 39.10.5
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 +16 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js +51 -3
- package/dist/cjs/limel-dialog.cjs.entry.js +86 -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-slider.cjs.entry.js +44 -1494
- package/dist/cjs/limel-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/limel-split-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-switch.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +2 -2
- package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +15 -10
- 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/collection/components/slider/slider.css +215 -642
- package/dist/collection/components/slider/slider.js +45 -165
- package/dist/collection/components/snackbar/snackbar.js +2 -2
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/split-button/split-button.js +2 -2
- package/dist/collection/components/switch/switch.js +1 -1
- 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.js +15 -10
- package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
- 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/esm/lime-elements.js +1 -1
- package/dist/esm/limel-breadcrumbs_7.entry.js +50 -2
- package/dist/esm/limel-dialog.entry.js +85 -1
- package/dist/esm/limel-portal_3.entry.js +3 -3
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-slider.entry.js +45 -1495
- package/dist/esm/limel-snackbar.entry.js +2 -2
- package/dist/esm/limel-split-button.entry.js +2 -2
- package/dist/esm/limel-switch.entry.js +1 -1
- package/dist/esm/limel-tab-bar.entry.js +2 -2
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +15 -10
- 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/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-17e1d911.entry.js → p-2906606d.entry.js} +1 -1
- package/dist/lime-elements/{p-30e54f05.entry.js → p-2b1eda20.entry.js} +3 -3
- package/dist/lime-elements/{p-889a05e4.entry.js → p-3d724fc2.entry.js} +1 -1
- package/dist/lime-elements/{p-b8e5bd98.entry.js → p-3f188493.entry.js} +1 -1
- package/dist/lime-elements/{p-8e3cc9b0.entry.js → p-4e1b8c0a.entry.js} +1 -1
- package/dist/lime-elements/{p-a243b8e2.entry.js → p-730a05e3.entry.js} +1 -1
- package/dist/lime-elements/{p-77f42eff.entry.js → p-8203eea8.entry.js} +1 -1
- package/dist/lime-elements/{p-a44dfaa1.entry.js → p-90e09eea.entry.js} +1 -1
- package/dist/lime-elements/{p-9abfb8ba.entry.js → p-9aa07388.entry.js} +1 -1
- package/dist/lime-elements/{p-9d629f5f.entry.js → p-c308e2a5.entry.js} +55 -10
- package/dist/lime-elements/{p-c9591213.entry.js → p-de203f64.entry.js} +1 -1
- package/dist/lime-elements/p-faceccc0.entry.js +1 -0
- package/dist/lime-elements/{p-12646794.entry.js → p-fe993f80.entry.js} +1 -1
- package/dist/types/components/slider/slider.d.ts +6 -24
- package/dist/types/components.d.ts +4 -0
- package/package.json +1 -1
- package/dist/cjs/animationframe-ChtL6ouH.js +0 -88
- package/dist/cjs/util-BOQp7lfZ.js +0 -52
- package/dist/esm/animationframe-BDw7dT4x.js +0 -86
- package/dist/esm/util-Dx8swykg.js +0 -50
- package/dist/lime-elements/p-23c1033d.entry.js +0 -45
- package/dist/lime-elements/p-BDw7dT4x.js +0 -23
- package/dist/lime-elements/p-Dx8swykg.js +0 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as
|
|
1
|
+
import{r as t,c as s,h as a,H as e,a as i}from"./p-DBTJNfo7.js";import{d as h}from"./p-z_E3sq3p.js";const o=class{constructor(a){t(this,a),this.changeTab=s(this,"changeTab"),this.tabs=[],this.slotElements=[],this.handleChangeTabs=this.handleChangeTabs.bind(this),this.setSlotElements=this.setSlotElements.bind(this),this.setTabStatus=this.setTabStatus.bind(this)}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}initialize(){const t=this.getSlot();t&&(t.addEventListener("slotchange",this.setSlotElements),this.setSlotElements(),this.tabs.forEach(this.setTabStatus))}disconnectedCallback(){this.getSlot().removeEventListener("slotchange",this.setSlotElements)}tabsChanged(){this.hidePanels(),this.tabs.forEach(this.setTabStatus)}render(){return a(e,{key:"ebab881a0b0efc36b64c866b58b919890c526525",onChangeTab:this.handleChangeTabs},a("div",{key:"1417a34aea0af009e44cd91ac8fd425412a2b706",class:"tab-panel"},a("limel-tab-bar",{key:"5b420eeec41fdd353ba0ba36bb0e475c3fd26821",tabs:this.tabs}),a("div",{key:"aa3d6f711a824a07eed6f2b5120497dd4218ed7b",class:"tab-content"},a("slot",{key:"7ba511fa07bd96018e4d8d288d7b1dca572cead0"}))))}setSlotElements(){const t=this.getSlot();this.hidePanels(),this.slotElements=Array.prototype.slice.call(t.assignedElements()),this.tabs.forEach(this.setTabStatus)}setTabStatus(t){const s=this.slotElements.find((s=>s.id===t.id));s&&(s.style.display=t.active?"":"none",s.tab=t)}handleChangeTabs(t){this.tabs=this.tabs.map((s=>s.id===t.detail.id?t.detail:s)),this.setTabStatus(t.detail),setTimeout(h)}getSlot(){return this.host.shadowRoot.querySelector("slot")}hidePanels(){for(const t of this.slotElements)t.style.display="none"}get host(){return i(this)}static get watchers(){return{tabs:[{tabsChanged:0}]}}};o.style=":host(limel-tab-panel){--tab-panel-background-color:rgb(var(--contrast-100));display:block;height:100%}.tab-panel{height:100%;position:relative;display:flex;flex-direction:column}.tab-content{height:100%;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box;background-color:var(--tab-panel-background-color)}";export{o as limel_tab_panel}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as r,H as o}from"./p-DBTJNfo7.js";import{c as i}from"./p-JbKhhoXs.js";const s=class{constructor(o){e(this,o),this.change=t(this,"change"),this.disabled=!1,this.readonly=!1,this.factor=1,this.required=!1,this.invalid=!1,this.displaysPercentageColors=!1,this.unit="",this.valuemax=100,this.valuemin=0,this.renderStepDots=(e,t)=>{if(!this.step)return;const o=this.multiplyByFactor(this.step),i=Math.floor((t-e)/o)+1;return i>20?void 0:Array.from({length:i},(()=>r("span",{class:"step-dot"})))},this.renderHelperLine=()=>{if(this.helperText)return r("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid})},this.handleInput=e=>{e.stopPropagation();const t=Number(e.target.value);this.displayValue=t,this.setPercentageClass(t/this.factor)},this.handleChange=e=>{e.stopPropagation();let t=Number(e.target.value);const r=this.multiplyByFactor(this.step);this.isMultipleOfStep(t,r)||(t=this.roundToStep(t,r)),this.change.emit(t/this.factor)},this.getContainerClassList=()=>this.percentageClass?{[this.percentageClass]:!0}:{},this.multiplyByFactor=e=>Math.round(e*this.factor),this.getValue=()=>{let e=this.value;return Number.isFinite(e)||(e=this.valuemin),e},this.getFraction=()=>{const e=this.multiplyByFactor(this.valuemin),t=this.multiplyByFactor(this.valuemax);return t===e?0:Math.max(0,Math.min(1,(this.displayValue-e)/(t-e)))},this.setPercentageClass=e=>{this.percentageClass=function(e){return 0===e?"percent-0":e<.1?"percent-0-10":e<.2?"percent-10-20":e<.3?"percent-20-30":e<.4?"percent-30-40":e<.5?"percent-40-50":e<.6?"percent-50-60":e<.7?"percent-60-70":e<.8?"percent-70-80":e<.9?"percent-80-90":"percent-90-100"}((e-this.valuemin)/(this.valuemax-this.valuemin))},this.isMultipleOfStep=(e,t)=>!t||e%t==0,this.roundToStep=(e,t)=>Math.round(e/t)*t,this.labelId=i(),this.helperTextId=i()}componentWillLoad(){this.displayValue=this.multiplyByFactor(this.getValue()),this.setPercentageClass(this.getValue())}render(){const e=this.multiplyByFactor(this.valuemin),t=this.multiplyByFactor(this.valuemax),i=this.getFraction(),s={};return this.step&&(s.step=this.multiplyByFactor(this.step)),(this.disabled||this.readonly)&&(s.disabled=!0),r(o,{key:"fa9695563f078bdab1707422cad3aaef2610e592",class:this.getContainerClassList()},r("limel-notched-outline",{key:"8b71ef15e9544a6b346248217c2c2fa8acbba6e7",labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasFloatingLabel:!0},r("div",{key:"0327cf7d5295bb1d56e2e34b8dca15cfc3e15c0d",slot:"content"},r("div",{key:"83fade77119ba9fa1d24ae8fdcd54317648918b3",class:"slider",style:{"--slider-fraction":`${i}`}},r("input",Object.assign({key:"5181430787abe75b4556923e31ebe8520df977e9",type:"range",min:e,max:t,value:this.displayValue,"aria-labelledby":this.labelId,"aria-describedby":this.helperText?this.helperTextId:void 0,onInput:this.handleInput,onChange:this.handleChange},s)),r("div",{key:"6ee95d718f1d01e92adcf9592882ed1d32e4ba67",class:"track"},r("div",{key:"bba420e41501990bdeb1326e59e6eff57000848d",class:"active"}),this.renderStepDots(e,t)),r("div",{key:"46e5a45adbda4e1a650d01408c3d228f1c6be68d",class:"thumb"},r("div",{key:"eeba995f52ff3291e2e7818528b05c7c1dec1b32",class:"knob"}),r("div",{key:"d0321459ed22c6870d939da54df43fe2bfef6333",class:"indicator","aria-hidden":"true"},this.displayValue))),r("div",{key:"bcc4449d7605343fd64f4b89b50c8e5d665f6937",class:"range-labels"},r("span",{key:"301c78b1640551fe814ad3b2768bb40f9b682b39",class:"min"},this.multiplyByFactor(this.valuemin),this.unit),r("span",{key:"7f8d741f63030b6f8e88231e5215448b815bf3ca",class:"max"},this.multiplyByFactor(this.valuemax),this.unit)))),this.renderHelperLine())}watchValue(){this.displayValue=this.multiplyByFactor(this.getValue()),this.setPercentageClass(this.getValue())}static get watchers(){return{value:[{watchValue:0}]}}};s.style='@charset "UTF-8";:host([displays-percentage-colors].percent-0){--lime-primary-color:var(--color-percent--0)}:host([displays-percentage-colors].percent-0-10){--lime-primary-color:var(--color-percent--0to10)}:host([displays-percentage-colors].percent-10-20){--lime-primary-color:var(--color-percent--10to20)}:host([displays-percentage-colors].percent-20-30){--lime-primary-color:var(--color-percent--20to30)}:host([displays-percentage-colors].percent-30-40){--lime-primary-color:var(--color-percent--30to40)}:host([displays-percentage-colors].percent-40-50){--lime-primary-color:var(--color-percent--40to50)}:host([displays-percentage-colors].percent-50-60){--lime-primary-color:var(--color-percent--50to60)}:host([displays-percentage-colors].percent-60-70){--lime-primary-color:var(--color-percent--60to70)}:host([displays-percentage-colors].percent-70-80){--lime-primary-color:var(--color-percent--70to80)}:host([displays-percentage-colors].percent-80-90){--lime-primary-color:var(--color-percent--80to90)}:host([displays-percentage-colors].percent-90-100){--lime-primary-color:var(--color-percent--90to100)}:host([displays-percentage-colors].percent-30-40) .indicator,:host([displays-percentage-colors].percent-40-50) .indicator,:host([displays-percentage-colors].percent-70-80) .indicator{color:rgb(var(--color-gray-darker))}:host([displays-percentage-colors].percent-50-60) .indicator,:host([displays-percentage-colors].percent-60-70) .indicator{color:rgb(var(--color-gray-dark))}:host([readonly]:not([readonly=false])) input[type=range]{cursor:default}:host([readonly]:not([readonly=false])) .track,:host([readonly]:not([readonly=false])) .active,:host([readonly]:not([readonly=false])) .indicator{height:0.75rem}:host([readonly]:not([readonly=false])) .indicator{box-shadow:none}:host([readonly]:not([readonly=false])) .knob{opacity:0}:host([readonly]:not([readonly=false])) .active{background-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.thumb{position:absolute;left:calc(var(--slider-fraction) * 100%);top:0;bottom:0;width:0;z-index:1}.knob{transition:border-color 0.5s ease;position:absolute;top:50%;left:0;transform:translate3d(-50%, -50%, 0);width:1.25rem;height:1.25rem;border-radius:50%;border:0.5rem solid;border-color:var(--lime-primary-color, var(--limel-theme-primary-color));background-color:rgb(var(--contrast-100))}.knob:before,.knob:after{transition:all 0.2s ease 0.2s;content:"";display:block;position:absolute;top:0;bottom:0;margin:auto;width:0;height:0;border:0.375rem solid transparent}:host([disabled]:not([disabled=false])) .knob:before,:host([disabled]:not([disabled=false])) .knob:after{content:none}.knob:before{opacity:calc(var(--slider-fraction) * 100);left:-1rem;transform:rotate(90deg)}.knob:after{opacity:calc((1 - var(--slider-fraction)) * 100);right:-1rem;transform:rotate(-90deg)}.slider:hover .knob,.slider:has(input[type=range]:active) .knob,.slider:has(input[type=range]:focus) .knob{box-shadow:var(--button-shadow-normal)}.slider:hover .knob:before,.slider:has(input[type=range]:active) .knob:before,.slider:has(input[type=range]:focus) .knob:before{left:-1.5rem;border-top-color:rgb(var(--contrast-1400), 0.5)}.slider:hover .knob:after,.slider:has(input[type=range]:active) .knob:after,.slider:has(input[type=range]:focus) .knob:after{right:-1.5rem;border-top-color:rgb(var(--contrast-1400), 0.5)}.indicator{user-select:none;position:absolute;left:0;top:50%;z-index:1;transform:translate3d(-50%, -50%, 0);transform-origin:bottom center;transition:transform 0.2s ease-out, box-shadow 0.2s ease-out, background-color 0.5s ease;border-radius:1.25rem;padding:0 0.375rem;height:1.25rem;display:flex;align-items:center;white-space:nowrap;color:rgb(var(--color-white));font-size:0.6875rem;background-color:var(--lime-primary-color, var(--limel-theme-primary-color));box-shadow:var(--button-shadow-normal)}:host(:not([disabled]):not([readonly])) input[type=range]:active~.thumb .indicator,:host(:not([disabled]):not([readonly])) input[type=range]:focus~.thumb .indicator{transform:translate3d(-50%, calc(-100% - 0.75rem), 0) scale(1.25);box-shadow:var(--shadow-depth-16)}*,*:before,*:after{box-sizing:border-box;min-width:0;min-height:0}:host(limel-slider){box-sizing:border-box;isolation:isolate;position:relative;display:flex;flex-direction:column}:host(limel-slider:not([invalid]):not([invalid=true])) .limel-notched-outline,:host(limel-slider[disabled]:not([disabled=false])) .limel-notched-outline{--limel-notched-outline-border-color:transparent;--limel-notched-outline-background-color:transparent}div[slot=content]{display:flex;flex-direction:column;width:100%;padding:0 0.25rem}.slider{position:relative;height:2.5rem;margin:0 0.75rem}input[type=range]{position:absolute;width:100%;height:100%;opacity:0;cursor:pointer;z-index:2;margin:0;appearance:none}:host([disabled]:not([disabled=false])) input[type=range]{cursor:not-allowed}:host([disabled]:not([disabled=false])) .track .active{opacity:0.5}:host([disabled]:not([disabled=false])) .indicator{border-radius:0.125rem;box-shadow:var(--button-shadow-pressed)}.track{transition:background-color 0.5s ease;display:flex;align-items:center;justify-content:space-between;position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);height:0.5rem;border-radius:1rem;background-color:rgba(var(--contrast-700), 0.6)}.track:before,.track:after{content:"";display:inline-block;position:absolute;top:0;bottom:0;margin:auto;width:0.375rem;height:0.375rem;border-radius:50%;background-color:rgba(var(--contrast-700), 0.6)}.track:before{left:-0.75rem}.track:after{right:-0.75rem}.track .active{transition:background-color 0.5s ease;position:absolute;height:100%;width:calc(var(--slider-fraction) * 100%);border-radius:inherit;background-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.step-dot{transform:translateX(-50%);border-radius:50%;height:0.25rem;width:0.25rem;background-color:rgb(var(--contrast-100), 0.6)}.step-dot:first-of-type,.step-dot:last-of-type{opacity:0}.range-labels{display:flex;justify-content:space-between;margin-top:-0.75rem;width:100%}.range-labels .min,.range-labels .max{line-height:1;font-size:0.75rem;color:var(--limel-notched-outline-label-color, rgb(var(--contrast-1200)))}:host(limel-slider:focus),:host(limel-slider:focus-visible),:host(limel-slider:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-slider){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-slider:focus) limel-helper-line,:host(limel-slider:focus-visible) limel-helper-line,:host(limel-slider:focus-within) limel-helper-line,:host(limel-slider:hover) limel-helper-line{will-change:grid-template-rows}';export{s as limel_slider}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as e}from"./p-DBTJNfo7.js";import{t as s}from"./p-DVRaJQvC.js";import{a,E as n}from"./p-rI0IeKpx.js";const o=class{constructor(e){t(this,e),this.cancel=i(this,"cancel"),this.save=i(this,"save"),this.linkChange=i(this,"linkChange"),this.language="en",this.isOpen=!1,this.getTranslation=t=>s.get(t,this.language),this.isValid=t=>{try{new URL(t)}catch(t){return!1}return!0},this.handleKeyDown=t=>{var i;t.key===a&&(this.saveButton&&this.saveButton.focus(),t.preventDefault(),this.isValid(null===(i=this.link)||void 0===i?void 0:i.href)&&this.handleSave(t))},this.handleCancel=t=>{t instanceof KeyboardEvent&&t.key!==n||(t.stopPropagation(),t.preventDefault(),this.cancel.emit())},this.handleSave=t=>{t.stopPropagation(),this.save.emit()},this.handleLinkInputAction=t=>{window.open(this.link.href,"_blank"),t.stopPropagation()},this.handleLinkTitleChange=t=>{var i;this.emitLinkChange(t.detail,null===(i=this.link)||void 0===i?void 0:i.href)},this.handleLinkValueChange=t=>{var i;this.emitLinkChange(null===(i=this.link)||void 0===i?void 0:i.text,t.detail)},this.emitLinkChange=(t,i)=>{this.linkChange.emit({text:t,href:i})}}connectedCallback(){this.setupGlobalHandlers()}disconnectedCallback(){this.teardownGlobalHandlers()}setupGlobalHandlers(){this.isOpen&&document.addEventListener("keyup",this.handleCancel)}teardownGlobalHandlers(){document.removeEventListener("keyup",this.handleCancel)}componentDidLoad(){this.focusOnTextInput()}focusOnTextInput(){if(this.textInput){const t=this.textInput.shadowRoot.querySelector("input");t&&requestAnimationFrame((()=>{t.focus()}))}}render(){var t,i;const s=this.isValid(this.link.href);return[e("limel-input-field",{key:"
|
|
1
|
+
import{r as t,c as i,h as e}from"./p-DBTJNfo7.js";import{t as s}from"./p-DVRaJQvC.js";import{a,E as n}from"./p-rI0IeKpx.js";const o=class{constructor(e){t(this,e),this.cancel=i(this,"cancel"),this.save=i(this,"save"),this.linkChange=i(this,"linkChange"),this.language="en",this.isOpen=!1,this.getTranslation=t=>s.get(t,this.language),this.isValid=t=>{try{new URL(t)}catch(t){return!1}return!0},this.handleKeyDown=t=>{var i;t.key===a&&(this.saveButton&&this.saveButton.focus(),t.preventDefault(),this.isValid(null===(i=this.link)||void 0===i?void 0:i.href)&&this.handleSave(t))},this.handleCancel=t=>{t instanceof KeyboardEvent&&t.key!==n||(t.stopPropagation(),t.preventDefault(),this.cancel.emit())},this.handleSave=t=>{t.stopPropagation(),this.save.emit()},this.handleLinkInputAction=t=>{window.open(this.link.href,"_blank"),t.stopPropagation()},this.handleLinkTitleChange=t=>{var i;this.emitLinkChange(t.detail,null===(i=this.link)||void 0===i?void 0:i.href)},this.handleLinkValueChange=t=>{var i;this.emitLinkChange(null===(i=this.link)||void 0===i?void 0:i.text,t.detail)},this.emitLinkChange=(t,i)=>{this.linkChange.emit({text:t,href:i})}}connectedCallback(){this.setupGlobalHandlers()}disconnectedCallback(){this.teardownGlobalHandlers()}setupGlobalHandlers(){this.isOpen&&document.addEventListener("keyup",this.handleCancel)}teardownGlobalHandlers(){document.removeEventListener("keyup",this.handleCancel)}componentDidLoad(){this.focusOnTextInput()}focusOnTextInput(){if(this.textInput){const t=this.textInput.shadowRoot.querySelector("input");t&&requestAnimationFrame((()=>{t.focus()}))}}render(){var t,i;const s=this.isValid(this.link.href);return[e("limel-input-field",{key:"f91dd3a9c03bb52cb91ea0f3251288f5a612cd3a",label:this.getTranslation("editor-link-menu.text"),value:(null===(t=this.link)||void 0===t?void 0:t.text)||"",leadingIcon:"text_cursor",onChange:this.handleLinkTitleChange,onKeyDown:this.handleKeyDown,ref:t=>this.textInput=t}),e("limel-input-field",{key:"1034663268cae0a749397331b43ea44387431c78",label:this.getTranslation("editor-link-menu.link"),value:(null===(i=this.link)||void 0===i?void 0:i.href)||"",type:"text",leadingIcon:"-lime-text-link",trailingIcon:"external_link",invalid:!s,onChange:this.handleLinkValueChange,onAction:this.handleLinkInputAction,onKeyDown:this.handleKeyDown}),e("div",{key:"5c4b46deb47d9369a0a59e1e5908934093322755",class:"actions"},e("limel-button",{key:"62c2dcc49a7907d938a27e2887432caa3e1a75ff",label:this.getTranslation("cancel"),onClick:this.handleCancel}),e("limel-button",{key:"5252752da58d02fd81abef41fc9788a07e277738",primary:!0,label:this.getTranslation("save"),disabled:!s,onClick:this.handleSave,ref:t=>this.saveButton=t,slot:"button"}))]}};o.style=":host(limel-text-editor-link-menu){animation:fade 0.2s ease forwards;animation-delay:0.1s;opacity:0;display:flex;flex-direction:column;gap:0.5rem;padding:0.5rem;max-width:calc(100vw - 2rem);border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-16)}.actions{display:flex;justify-content:end;gap:0.5rem}@keyframes fade{0%{scale:0.86;opacity:0}100%{scale:1;opacity:1}}";export{o as limel_text_editor_link_menu}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @exampleComponent limel-example-slider-basic
|
|
3
3
|
* @exampleComponent limel-example-slider-multiplier
|
|
4
4
|
* @exampleComponent limel-example-slider-multiplier-percentage-colors
|
|
5
|
+
* @exampleComponent limel-example-slider-unit
|
|
5
6
|
* @exampleComponent limel-example-slider-composite
|
|
6
7
|
*/
|
|
7
8
|
export declare class Slider {
|
|
@@ -71,43 +72,24 @@ export declare class Slider {
|
|
|
71
72
|
* Emitted when the value has been changed
|
|
72
73
|
*/
|
|
73
74
|
private change;
|
|
74
|
-
private rootElement;
|
|
75
75
|
private percentageClass;
|
|
76
|
-
private
|
|
76
|
+
private displayValue;
|
|
77
77
|
private labelId;
|
|
78
78
|
private helperTextId;
|
|
79
|
-
private observer;
|
|
80
79
|
constructor();
|
|
81
|
-
connectedCallback(): void;
|
|
82
80
|
componentWillLoad(): void;
|
|
83
|
-
componentDidLoad(): void;
|
|
84
|
-
disconnectedCallback(): void;
|
|
85
81
|
render(): any;
|
|
86
|
-
protected watchDisabled(): void;
|
|
87
|
-
protected watchReadonly(): void;
|
|
88
82
|
protected watchValue(): void;
|
|
89
|
-
private
|
|
90
|
-
private renderSliderContainer;
|
|
91
|
-
private renderSliderInput;
|
|
92
|
-
private renderTrack;
|
|
93
|
-
private renderThumb;
|
|
83
|
+
private renderStepDots;
|
|
94
84
|
private renderHelperLine;
|
|
95
|
-
private
|
|
96
|
-
private
|
|
97
|
-
private createMDCSlider;
|
|
98
|
-
private destroyMDCSlider;
|
|
99
|
-
private changeHandler;
|
|
100
|
-
private inputHandler;
|
|
85
|
+
private handleInput;
|
|
86
|
+
private handleChange;
|
|
101
87
|
private getContainerClassList;
|
|
102
|
-
private resizeObserverCallback;
|
|
103
|
-
private updateDisabledState;
|
|
104
88
|
private multiplyByFactor;
|
|
105
89
|
private getValue;
|
|
90
|
+
private getFraction;
|
|
106
91
|
private setPercentageClass;
|
|
107
92
|
private isMultipleOfStep;
|
|
108
93
|
private roundToStep;
|
|
109
|
-
private getRootElement;
|
|
110
|
-
private getInputElement;
|
|
111
|
-
private isStepConfigured;
|
|
112
94
|
}
|
|
113
95
|
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -3280,6 +3280,7 @@ export namespace Components {
|
|
|
3280
3280
|
* @exampleComponent limel-example-slider-basic
|
|
3281
3281
|
* @exampleComponent limel-example-slider-multiplier
|
|
3282
3282
|
* @exampleComponent limel-example-slider-multiplier-percentage-colors
|
|
3283
|
+
* @exampleComponent limel-example-slider-unit
|
|
3283
3284
|
* @exampleComponent limel-example-slider-composite
|
|
3284
3285
|
*/
|
|
3285
3286
|
interface LimelSlider {
|
|
@@ -5967,6 +5968,7 @@ declare global {
|
|
|
5967
5968
|
* @exampleComponent limel-example-slider-basic
|
|
5968
5969
|
* @exampleComponent limel-example-slider-multiplier
|
|
5969
5970
|
* @exampleComponent limel-example-slider-multiplier-percentage-colors
|
|
5971
|
+
* @exampleComponent limel-example-slider-unit
|
|
5970
5972
|
* @exampleComponent limel-example-slider-composite
|
|
5971
5973
|
*/
|
|
5972
5974
|
interface HTMLLimelSliderElement extends Components.LimelSlider, HTMLStencilElement {
|
|
@@ -9830,6 +9832,7 @@ declare namespace LocalJSX {
|
|
|
9830
9832
|
* @exampleComponent limel-example-slider-basic
|
|
9831
9833
|
* @exampleComponent limel-example-slider-multiplier
|
|
9832
9834
|
* @exampleComponent limel-example-slider-multiplier-percentage-colors
|
|
9835
|
+
* @exampleComponent limel-example-slider-unit
|
|
9833
9836
|
* @exampleComponent limel-example-slider-composite
|
|
9834
9837
|
*/
|
|
9835
9838
|
interface LimelSlider {
|
|
@@ -12312,6 +12315,7 @@ declare module "@stencil/core" {
|
|
|
12312
12315
|
* @exampleComponent limel-example-slider-basic
|
|
12313
12316
|
* @exampleComponent limel-example-slider-multiplier
|
|
12314
12317
|
* @exampleComponent limel-example-slider-multiplier-percentage-colors
|
|
12318
|
+
* @exampleComponent limel-example-slider-unit
|
|
12315
12319
|
* @exampleComponent limel-example-slider-composite
|
|
12316
12320
|
*/
|
|
12317
12321
|
"limel-slider": LocalJSX.IntrinsicElements["limel-slider"] & JSXBase.HTMLAttributes<HTMLLimelSliderElement>;
|
package/package.json
CHANGED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2020 Google Inc.
|
|
6
|
-
*
|
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
* furnished to do so, subject to the following conditions:
|
|
13
|
-
*
|
|
14
|
-
* The above copyright notice and this permission notice shall be included in
|
|
15
|
-
* all copies or substantial portions of the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
-
* THE SOFTWARE.
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* AnimationFrame provides a user-friendly abstraction around requesting
|
|
27
|
-
* and canceling animation frames.
|
|
28
|
-
*/
|
|
29
|
-
var AnimationFrame = /** @class */ (function () {
|
|
30
|
-
function AnimationFrame() {
|
|
31
|
-
this.rafIDs = new Map();
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Requests an animation frame. Cancels any existing frame with the same key.
|
|
35
|
-
* @param {string} key The key for this callback.
|
|
36
|
-
* @param {FrameRequestCallback} callback The callback to be executed.
|
|
37
|
-
*/
|
|
38
|
-
AnimationFrame.prototype.request = function (key, callback) {
|
|
39
|
-
var _this = this;
|
|
40
|
-
this.cancel(key);
|
|
41
|
-
var frameID = requestAnimationFrame(function (frame) {
|
|
42
|
-
_this.rafIDs.delete(key);
|
|
43
|
-
// Callback must come *after* the key is deleted so that nested calls to
|
|
44
|
-
// request with the same key are not deleted.
|
|
45
|
-
callback(frame);
|
|
46
|
-
});
|
|
47
|
-
this.rafIDs.set(key, frameID);
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Cancels a queued callback with the given key.
|
|
51
|
-
* @param {string} key The key for this callback.
|
|
52
|
-
*/
|
|
53
|
-
AnimationFrame.prototype.cancel = function (key) {
|
|
54
|
-
var rafID = this.rafIDs.get(key);
|
|
55
|
-
if (rafID) {
|
|
56
|
-
cancelAnimationFrame(rafID);
|
|
57
|
-
this.rafIDs.delete(key);
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Cancels all queued callback.
|
|
62
|
-
*/
|
|
63
|
-
AnimationFrame.prototype.cancelAll = function () {
|
|
64
|
-
var _this = this;
|
|
65
|
-
// Need to use forEach because it's the only iteration method supported
|
|
66
|
-
// by IE11. Suppress the underscore because we don't need it.
|
|
67
|
-
// tslint:disable-next-line:enforce-name-casing
|
|
68
|
-
this.rafIDs.forEach(function (_, key) {
|
|
69
|
-
_this.cancel(key);
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* Returns the queue of unexecuted callback keys.
|
|
74
|
-
*/
|
|
75
|
-
AnimationFrame.prototype.getQueue = function () {
|
|
76
|
-
var queue = [];
|
|
77
|
-
// Need to use forEach because it's the only iteration method supported
|
|
78
|
-
// by IE11. Suppress the underscore because we don't need it.
|
|
79
|
-
// tslint:disable-next-line:enforce-name-casing
|
|
80
|
-
this.rafIDs.forEach(function (_, key) {
|
|
81
|
-
queue.push(key);
|
|
82
|
-
});
|
|
83
|
-
return queue;
|
|
84
|
-
};
|
|
85
|
-
return AnimationFrame;
|
|
86
|
-
}());
|
|
87
|
-
|
|
88
|
-
exports.AnimationFrame = AnimationFrame;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright 2016 Google Inc.
|
|
6
|
-
*
|
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
* furnished to do so, subject to the following conditions:
|
|
13
|
-
*
|
|
14
|
-
* The above copyright notice and this permission notice shall be included in
|
|
15
|
-
* all copies or substantial portions of the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
-
* THE SOFTWARE.
|
|
24
|
-
*/
|
|
25
|
-
var cssPropertyNameMap = {
|
|
26
|
-
animation: {
|
|
27
|
-
prefixed: '-webkit-animation',
|
|
28
|
-
standard: 'animation',
|
|
29
|
-
},
|
|
30
|
-
transform: {
|
|
31
|
-
prefixed: '-webkit-transform',
|
|
32
|
-
standard: 'transform',
|
|
33
|
-
},
|
|
34
|
-
transition: {
|
|
35
|
-
prefixed: '-webkit-transition',
|
|
36
|
-
standard: 'transition',
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
function isWindow(windowObj) {
|
|
40
|
-
return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';
|
|
41
|
-
}
|
|
42
|
-
function getCorrectPropertyName(windowObj, cssProperty) {
|
|
43
|
-
if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {
|
|
44
|
-
var el = windowObj.document.createElement('div');
|
|
45
|
-
var _a = cssPropertyNameMap[cssProperty], standard = _a.standard, prefixed = _a.prefixed;
|
|
46
|
-
var isStandard = standard in el.style;
|
|
47
|
-
return isStandard ? standard : prefixed;
|
|
48
|
-
}
|
|
49
|
-
return cssProperty;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
exports.getCorrectPropertyName = getCorrectPropertyName;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google Inc.
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
* in the Software without restriction, including without limitation the rights
|
|
8
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
* furnished to do so, subject to the following conditions:
|
|
11
|
-
*
|
|
12
|
-
* The above copyright notice and this permission notice shall be included in
|
|
13
|
-
* all copies or substantial portions of the Software.
|
|
14
|
-
*
|
|
15
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
* THE SOFTWARE.
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* AnimationFrame provides a user-friendly abstraction around requesting
|
|
25
|
-
* and canceling animation frames.
|
|
26
|
-
*/
|
|
27
|
-
var AnimationFrame = /** @class */ (function () {
|
|
28
|
-
function AnimationFrame() {
|
|
29
|
-
this.rafIDs = new Map();
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Requests an animation frame. Cancels any existing frame with the same key.
|
|
33
|
-
* @param {string} key The key for this callback.
|
|
34
|
-
* @param {FrameRequestCallback} callback The callback to be executed.
|
|
35
|
-
*/
|
|
36
|
-
AnimationFrame.prototype.request = function (key, callback) {
|
|
37
|
-
var _this = this;
|
|
38
|
-
this.cancel(key);
|
|
39
|
-
var frameID = requestAnimationFrame(function (frame) {
|
|
40
|
-
_this.rafIDs.delete(key);
|
|
41
|
-
// Callback must come *after* the key is deleted so that nested calls to
|
|
42
|
-
// request with the same key are not deleted.
|
|
43
|
-
callback(frame);
|
|
44
|
-
});
|
|
45
|
-
this.rafIDs.set(key, frameID);
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Cancels a queued callback with the given key.
|
|
49
|
-
* @param {string} key The key for this callback.
|
|
50
|
-
*/
|
|
51
|
-
AnimationFrame.prototype.cancel = function (key) {
|
|
52
|
-
var rafID = this.rafIDs.get(key);
|
|
53
|
-
if (rafID) {
|
|
54
|
-
cancelAnimationFrame(rafID);
|
|
55
|
-
this.rafIDs.delete(key);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Cancels all queued callback.
|
|
60
|
-
*/
|
|
61
|
-
AnimationFrame.prototype.cancelAll = function () {
|
|
62
|
-
var _this = this;
|
|
63
|
-
// Need to use forEach because it's the only iteration method supported
|
|
64
|
-
// by IE11. Suppress the underscore because we don't need it.
|
|
65
|
-
// tslint:disable-next-line:enforce-name-casing
|
|
66
|
-
this.rafIDs.forEach(function (_, key) {
|
|
67
|
-
_this.cancel(key);
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Returns the queue of unexecuted callback keys.
|
|
72
|
-
*/
|
|
73
|
-
AnimationFrame.prototype.getQueue = function () {
|
|
74
|
-
var queue = [];
|
|
75
|
-
// Need to use forEach because it's the only iteration method supported
|
|
76
|
-
// by IE11. Suppress the underscore because we don't need it.
|
|
77
|
-
// tslint:disable-next-line:enforce-name-casing
|
|
78
|
-
this.rafIDs.forEach(function (_, key) {
|
|
79
|
-
queue.push(key);
|
|
80
|
-
});
|
|
81
|
-
return queue;
|
|
82
|
-
};
|
|
83
|
-
return AnimationFrame;
|
|
84
|
-
}());
|
|
85
|
-
|
|
86
|
-
export { AnimationFrame as A };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2016 Google Inc.
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
* in the Software without restriction, including without limitation the rights
|
|
8
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
* furnished to do so, subject to the following conditions:
|
|
11
|
-
*
|
|
12
|
-
* The above copyright notice and this permission notice shall be included in
|
|
13
|
-
* all copies or substantial portions of the Software.
|
|
14
|
-
*
|
|
15
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
* THE SOFTWARE.
|
|
22
|
-
*/
|
|
23
|
-
var cssPropertyNameMap = {
|
|
24
|
-
animation: {
|
|
25
|
-
prefixed: '-webkit-animation',
|
|
26
|
-
standard: 'animation',
|
|
27
|
-
},
|
|
28
|
-
transform: {
|
|
29
|
-
prefixed: '-webkit-transform',
|
|
30
|
-
standard: 'transform',
|
|
31
|
-
},
|
|
32
|
-
transition: {
|
|
33
|
-
prefixed: '-webkit-transition',
|
|
34
|
-
standard: 'transition',
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
function isWindow(windowObj) {
|
|
38
|
-
return Boolean(windowObj.document) && typeof windowObj.document.createElement === 'function';
|
|
39
|
-
}
|
|
40
|
-
function getCorrectPropertyName(windowObj, cssProperty) {
|
|
41
|
-
if (isWindow(windowObj) && cssProperty in cssPropertyNameMap) {
|
|
42
|
-
var el = windowObj.document.createElement('div');
|
|
43
|
-
var _a = cssPropertyNameMap[cssProperty], standard = _a.standard, prefixed = _a.prefixed;
|
|
44
|
-
var isStandard = standard in el.style;
|
|
45
|
-
return isStandard ? standard : prefixed;
|
|
46
|
-
}
|
|
47
|
-
return cssProperty;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { getCorrectPropertyName as g };
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2020 Google Inc.
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in
|
|
14
|
-
* all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
-
* THE SOFTWARE.
|
|
23
|
-
*/var 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
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2020 Google Inc.
|
|
27
|
-
*
|
|
28
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
30
|
-
* in the Software without restriction, including without limitation the rights
|
|
31
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
33
|
-
* furnished to do so, subject to the following conditions:
|
|
34
|
-
*
|
|
35
|
-
* The above copyright notice and this permission notice shall be included in
|
|
36
|
-
* all copies or substantial portions of the Software.
|
|
37
|
-
*
|
|
38
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
44
|
-
* THE SOFTWARE.
|
|
45
|
-
*/var P=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.skipInitialUIUpdate=!1,i.valueToAriaValueTextFn=null,i}return d(i,t),i.attachTo=function(t,e){return void 0===e&&(e={}),new i(t,void 0,e)},i.prototype.getDefaultFoundation=function(){var t=this;return new H({hasClass:function(i){return t.root.classList.contains(i)},addClass:function(i){t.root.classList.add(i)},removeClass:function(i){t.root.classList.remove(i)},addThumbClass:function(i,e){t.getThumbEl(e).classList.add(i)},removeThumbClass:function(i,e){t.getThumbEl(e).classList.remove(i)},getAttribute:function(i){return t.root.getAttribute(i)},getInputValue:function(i){return t.getInput(i).value},setInputValue:function(i,e){t.getInput(e).value=i},getInputAttribute:function(i,e){return t.getInput(e).getAttribute(i)},setInputAttribute:function(i,e,r){t.getInput(r).setAttribute(i,e)},removeInputAttribute:function(i,e){t.getInput(e).removeAttribute(i)},focusInput:function(i){t.getInput(i).focus()},isInputFocused:function(i){return t.getInput(i)===document.activeElement},getThumbKnobWidth:function(i){return t.getThumbEl(i).querySelector(".mdc-slider__thumb-knob").getBoundingClientRect().width},getThumbBoundingClientRect:function(i){return t.getThumbEl(i).getBoundingClientRect()},getBoundingClientRect:function(){return t.root.getBoundingClientRect()},isRTL:function(){return"rtl"===getComputedStyle(t.root).direction},setThumbStyleProperty:function(i,e,r){t.getThumbEl(r).style.setProperty(i,e)},removeThumbStyleProperty:function(i,e){t.getThumbEl(e).style.removeProperty(i)},setTrackActiveStyleProperty:function(i,e){t.trackActive.style.setProperty(i,e)},removeTrackActiveStyleProperty:function(i){t.trackActive.style.removeProperty(i)},setValueIndicatorText:function(i,e){t.getThumbEl(e).querySelector(".mdc-slider__value-indicator-text").textContent=String(i)},getValueToAriaValueTextFn:function(){return t.valueToAriaValueTextFn},updateTickMarks:function(i){var e=t.root.querySelector("."+E);if(e||((e=document.createElement("div")).classList.add(E),t.root.querySelector(".mdc-slider__track").appendChild(e)),i.length!==e.children.length){for(;e.firstChild;)e.removeChild(e.firstChild);t.addTickMarks(e,i)}else t.updateTickMarks(e,i)},setPointerCapture:function(i){t.root.setPointerCapture(i)},emitChangeEvent:function(i,e){t.emit("MDCSlider:change",{value:i,thumb:e})},emitInputEvent:function(i,e){t.emit("MDCSlider:input",{value:i,thumb:e})},emitDragStartEvent:function(i,e){t.getRipple(e).activate()},emitDragEndEvent:function(i,e){t.getRipple(e).deactivate()},registerEventHandler:function(i,e){t.listen(i,e)},deregisterEventHandler:function(i,e){t.unlisten(i,e)},registerThumbEventHandler:function(i,e,r){t.getThumbEl(i).addEventListener(e,r)},deregisterThumbEventHandler:function(i,e,r){t.getThumbEl(i).removeEventListener(e,r)},registerInputEventHandler:function(i,e,r){t.getInput(i).addEventListener(e,r)},deregisterInputEventHandler:function(i,e,r){t.getInput(i).removeEventListener(e,r)},registerBodyEventHandler:function(t,i){document.body.addEventListener(t,i)},deregisterBodyEventHandler:function(t,i){document.body.removeEventListener(t,i)},registerWindowEventHandler:function(t,i){window.addEventListener(t,i)},deregisterWindowEventHandler:function(t,i){window.removeEventListener(t,i)}})},i.prototype.initialize=function(t){var i=(void 0===t?{}:t).skipInitialUIUpdate;this.inputs=[].slice.call(this.root.querySelectorAll(".mdc-slider__input")),this.thumbs=[].slice.call(this.root.querySelectorAll("."+y)),this.trackActive=this.root.querySelector(".mdc-slider__track--active_fill"),this.ripples=this.createRipples(),i&&(this.skipInitialUIUpdate=!0)},i.prototype.initialSyncWithDOM=function(){this.foundation.layout({skipUpdateUI:this.skipInitialUIUpdate})},i.prototype.layout=function(){this.foundation.layout()},i.prototype.getValueStart=function(){return this.foundation.getValueStart()},i.prototype.setValueStart=function(t){this.foundation.setValueStart(t)},i.prototype.getValue=function(){return this.foundation.getValue()},i.prototype.setValue=function(t){this.foundation.setValue(t)},i.prototype.getDisabled=function(){return this.foundation.getDisabled()},i.prototype.setDisabled=function(t){this.foundation.setDisabled(t)},i.prototype.setValueToAriaValueTextFn=function(t){this.valueToAriaValueTextFn=t},i.prototype.getThumbEl=function(t){return t===_.END?this.thumbs[this.thumbs.length-1]:this.thumbs[0]},i.prototype.getInput=function(t){return t===_.END?this.inputs[this.inputs.length-1]:this.inputs[0]},i.prototype.getRipple=function(t){return t===_.END?this.ripples[this.ripples.length-1]:this.ripples[0]},i.prototype.addTickMarks=function(t,i){for(var e=document.createDocumentFragment(),r=0;r<i.length;r++){var s=document.createElement("div");s.classList.add(i[r]===b.ACTIVE?C:S),e.appendChild(s)}t.appendChild(e)},i.prototype.updateTickMarks=function(t,i){for(var e=Array.from(t.children),r=0;r<e.length;r++)i[r]===b.ACTIVE?(e[r].classList.add(C),e[r].classList.remove(S)):(e[r].classList.add(S),e[r].classList.remove(C))},i.prototype.createRipples=function(){for(var t=[],i=[].slice.call(this.root.querySelectorAll("."+y)),e=function(e){var s=i[e],o=r.inputs[e],d=n(n({},h.createAdapter(r)),{addClass:function(t){s.classList.add(t)},computeBoundingRect:function(){return s.getBoundingClientRect()},deregisterInteractionHandler:function(t,i){o.removeEventListener(t,i)},isSurfaceActive:function(){return a(o,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,i){o.addEventListener(t,i,m())},removeClass:function(t){s.classList.remove(t)},updateCssVariable:function(t,i){s.style.setProperty(t,i)}}),l=new h(s,new u(d));l.unbounded=!0,t.push(l)},r=this,s=0;s<i.length;s++)e(s);return t},i}(c);const V=class{constructor(r){t(this,r),this.change=i(this,"change"),this.disabled=!1,this.readonly=!1,this.factor=1,this.required=!1,this.invalid=!1,this.displaysPercentageColors=!1,this.unit="",this.valuemax=100,this.valuemin=0,this.renderRangeContainer=()=>e("div",{class:"slider__content-range-container"},e("span",{class:"slider__content-min-label"},this.multiplyByFactor(this.valuemin),this.unit),e("span",{class:"slider__content-max-label"},this.multiplyByFactor(this.valuemax),this.unit)),this.renderSliderContainer=t=>e("div",{class:{"mdc-slider":!0,"mdc-slider--discrete":!0,"mdc-slider--disabled":this.disabled||this.readonly}},this.renderSliderInput(t),this.renderTrack(),this.renderThumb()),this.renderSliderInput=t=>e("input",Object.assign({class:"mdc-slider__input",type:"range",min:this.multiplyByFactor(this.valuemin),max:this.multiplyByFactor(this.valuemax),value:this.multiplyByFactor(this.value),name:"volume","aria-labelledby":this.labelId,"aria-describedby":this.helperText?this.helperTextId:void 0,"aria-controls":this.helperText?this.helperTextId:void 0},t)),this.renderTrack=()=>e("div",{class:"mdc-slider__track"},e("div",{class:"mdc-slider__track--inactive"}),e("div",{class:"mdc-slider__track--active"},e("div",{class:"mdc-slider__track--active_fill"}))),this.renderThumb=()=>e("div",{class:"mdc-slider__thumb"},e("div",{class:"mdc-slider__value-indicator-container","aria-hidden":"true"},e("div",{class:"mdc-slider__value-indicator"},e("span",{class:"mdc-slider__value-indicator-text"},this.multiplyByFactor(this.value)))),e("div",{class:"mdc-slider__thumb-knob"})),this.renderHelperLine=()=>{if(this.helperText)return e("limel-helper-line",{helperText:this.helperText,helperTextId:this.helperTextId,invalid:this.invalid})},this.initialize=()=>{const t=this.getInputElement();if(!t)return;const i=this.getValue();t.setAttribute("value",`${this.multiplyByFactor(i)}`);const e=i<=this.valuemax;if(!(i>=this.valuemin)){const e=this.multiplyByFactor(i);t.setAttribute("min",`${e}`)}if(!e){const e=this.multiplyByFactor(i);t.setAttribute("max",`${e}`)}if(this.step){const e=this.multiplyByFactor(this.step),r=this.multiplyByFactor(i);if(!this.isMultipleOfStep(r,e)){const i=this.roundToStep(r,e);t.setAttribute("value",`${i}`)}t.setAttribute("step",`${e}`)}this.createMDCSlider()},this.reCreateSliderWithStep=()=>{const t=this.getInputElement(),i=`${this.multiplyByFactor(this.step)}`;t.setAttribute("step",i),this.destroyMDCSlider(),this.createMDCSlider()},this.createMDCSlider=()=>{const t=this.getRootElement();this.mdcSlider=new P(t),this.mdcSlider.listen("MDCSlider:change",this.changeHandler),this.mdcSlider.listen("MDCSlider:input",this.inputHandler)},this.changeHandler=t=>{let i=t.detail.value;const e=this.multiplyByFactor(this.step);this.isMultipleOfStep(i,e)||(i=this.roundToStep(i,e)),this.change.emit(i/this.factor)},this.inputHandler=t=>{this.setPercentageClass(t.detail.value/this.factor)},this.getContainerClassList=()=>({[this.percentageClass]:!0,"displays-percentage-colors":this.displaysPercentageColors,disabled:this.disabled||this.readonly,readonly:this.readonly}),this.resizeObserverCallback=()=>{var t;null===(t=this.mdcSlider)||void 0===t||t.layout()},this.updateDisabledState=()=>{var t;this.mdcSlider&&(null===(t=this.mdcSlider)||void 0===t||t.setDisabled(this.disabled||this.readonly))},this.multiplyByFactor=t=>Math.round(t*this.factor),this.getValue=()=>{let t=this.value;return Number.isFinite(t)||(t=this.valuemin),t},this.setPercentageClass=t=>{this.percentageClass=function(t){return 0===t?"percent-0":t<.1?"percent-0-10":t<.2?"percent-10-20":t<.3?"percent-20-30":t<.4?"percent-30-40":t<.5?"percent-40-50":t<.6?"percent-50-60":t<.7?"percent-60-70":t<.8?"percent-70-80":t<.9?"percent-80-90":"percent-90-100"}((t-this.valuemin)/(this.valuemax-this.valuemin))},this.isMultipleOfStep=(t,i)=>!i||t%i==0,this.roundToStep=(t,i)=>Math.round(t/i)*i,this.getRootElement=()=>this.rootElement.shadowRoot.querySelector(".mdc-slider"),this.getInputElement=()=>{const t=this.getRootElement();if(t)return t.querySelector("input")},this.isStepConfigured=()=>{if(!this.step)return!0;const t=this.getInputElement();return!t||t.hasAttribute("step")},this.labelId=o(),this.helperTextId=o()}connectedCallback(){this.initialize(),this.observer=new ResizeObserver(this.resizeObserverCallback),this.observer.observe(this.rootElement)}componentWillLoad(){this.setPercentageClass(this.value)}componentDidLoad(){this.initialize()}disconnectedCallback(){this.destroyMDCSlider(),this.observer.disconnect()}render(){const t={};return this.step&&(t.step=this.multiplyByFactor(this.step)),(this.disabled||this.readonly)&&(t.disabled=!0),e(r,{key:"4d8742b0c40d836b9cab61988cafc42e90843e31",class:this.getContainerClassList()},e("limel-notched-outline",{key:"a775070fe819f15542ad3ba4a2a3839bcf392051",labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid,disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasFloatingLabel:!0},e("div",{key:"f01ca4b8c2f71ef4ea7466aff58d821c484e20bc",slot:"content"},this.renderRangeContainer(),this.renderSliderContainer(t))),this.renderHelperLine())}watchDisabled(){this.updateDisabledState()}watchReadonly(){this.updateDisabledState()}watchValue(){if(!this.mdcSlider)return;const t=this.multiplyByFactor(this.getValue());if(this.mdcSlider.setValue(t),this.isStepConfigured())return;const i=this.multiplyByFactor(this.step);this.isMultipleOfStep(t,i)&&this.reCreateSliderWithStep()}destroyMDCSlider(){this.mdcSlider.unlisten("MDCSlider:change",this.changeHandler),this.mdcSlider.unlisten("MDCSlider:input",this.inputHandler),this.mdcSlider.destroy(),this.mdcSlider=void 0}get rootElement(){return s(this)}static get watchers(){return{disabled:[{watchDisabled:0}],readonly:[{watchReadonly:0}],value:[{watchValue:0}]}}};V.style='@charset "UTF-8";.mdc-slider__track--active_fill,.mdc-slider__track--inactive,.mdc-slider__thumb-knob{transition:background-color 0.5s ease}:host(.displays-percentage-colors[readonly]){--mdc-theme-on-surface:var(--lime-primary-color)}:host(.displays-percentage-colors.percent-0){--lime-primary-color:var(--color-percent--0)}:host(.displays-percentage-colors.percent-0-10){--lime-primary-color:var(--color-percent--0to10)}:host(.displays-percentage-colors.percent-10-20){--lime-primary-color:var(--color-percent--10to20)}:host(.displays-percentage-colors.percent-20-30){--lime-primary-color:var(--color-percent--20to30)}:host(.displays-percentage-colors.percent-30-40){--lime-primary-color:var(--color-percent--30to40)}:host(.displays-percentage-colors.percent-40-50){--lime-primary-color:var(--color-percent--40to50)}:host(.displays-percentage-colors.percent-50-60){--lime-primary-color:var(--color-percent--50to60)}:host(.displays-percentage-colors.percent-60-70){--lime-primary-color:var(--color-percent--60to70)}:host(.displays-percentage-colors.percent-70-80){--lime-primary-color:var(--color-percent--70to80)}:host(.displays-percentage-colors.percent-80-90){--lime-primary-color:var(--color-percent--80to90)}:host(.displays-percentage-colors.percent-90-100){--lime-primary-color:var(--color-percent--90to100)}:host(.displays-percentage-colors.percent-30-40) .mdc-slider__value-indicator-text,:host(.displays-percentage-colors.percent-40-50) .mdc-slider__value-indicator-text,:host(.displays-percentage-colors.percent-70-80) .mdc-slider__value-indicator-text{color:rgb(var(--color-gray-darker))}:host(.displays-percentage-colors.percent-30-40) .mdc-slider--disabled .mdc-slider__value-indicator-text,:host(.displays-percentage-colors.percent-40-50) .mdc-slider--disabled .mdc-slider__value-indicator-text,:host(.displays-percentage-colors.percent-70-80) .mdc-slider--disabled .mdc-slider__value-indicator-text{color:rgb(var(--contrast-100))}:host(.displays-percentage-colors.percent-50-60) .mdc-slider__value-indicator-text,:host(.displays-percentage-colors.percent-60-70) .mdc-slider__value-indicator-text{color:rgb(var(--color-gray-dark))}:host(.displays-percentage-colors.percent-50-60) .mdc-slider--disabled .mdc-slider__value-indicator-text,:host(.displays-percentage-colors.percent-60-70) .mdc-slider--disabled .mdc-slider__value-indicator-text{color:rgb(var(--contrast-100))}:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled{opacity:1}:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__track,:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__track--active,:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__track--inactive,:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__value-indicator{height:1rem;border-radius:1rem}:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__track--active{top:0}:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__value-indicator{transition:all 0s;transform:translateY(1.75rem)}:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__thumb-knob{opacity:0}:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__track--active_fill,:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:var(--lime-primary-color, var(--limel-theme-primary-color))}:host(limel-slider.readonly) .mdc-slider.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.mdc-slider:not(.mdc-slider--disabled) .mdc-slider__thumb-knob:before,.mdc-slider:not(.mdc-slider--disabled) .mdc-slider__thumb-knob:after{transition:all 0.2s ease 0.2s;content:"";display:block;position:absolute;top:0;bottom:0;margin:auto;opacity:0;width:0;height:0;border:0.25rem solid transparent;border-top-color:rgba(var(--contrast-1400), 0.6)}.mdc-slider:not(.mdc-slider--disabled) .mdc-slider__thumb-knob:before{left:-1.25rem;transform:rotate(90deg)}.mdc-slider:not(.mdc-slider--disabled) .mdc-slider__thumb-knob:after{right:-1.25rem;transform:rotate(-90deg)}.mdc-slider:not(.mdc-slider--disabled) .mdc-slider__thumb-knob:hover:before{opacity:0.8;left:-1.75rem}.mdc-slider:not(.mdc-slider--disabled) .mdc-slider__thumb-knob:hover:after{opacity:0.8;right:-1.75rem}.mdc-slider .mdc-slider__thumb{top:-0.25rem}.mdc-slider .mdc-slider__value-indicator-container{z-index:1}.mdc-slider .mdc-slider__value-indicator{transition:transform 0.2s ease-out;opacity:1;transform:scale(1) translateY(2rem);border-radius:1.25rem;padding:0 0.5rem;height:1.5rem}.mdc-slider .mdc-slider__value-indicator:before{border-top-color:transparent}.mdc-slider .mdc-slider__value-indicator-text{color:rgb(var(--color-white))}.mdc-slider .mdc-ripple-upgraded--foreground-activation .mdc-slider__value-indicator{transform:scale(1.5) translateY(0);box-shadow:var(--shadow-depth-16)}.mdc-slider .mdc-ripple-upgraded--foreground-activation .mdc-slider__value-indicator:before{border-top-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.mdc-slider:not(.mdc-slider--disabled) .mdc-slider__value-indicator{box-shadow:var(--button-shadow-normal)}.mdc-slider:not(.mdc-slider--disabled) .mdc-slider__value-indicator,:host(limel-slider[readonly]) .mdc-slider__value-indicator{background-color:var(--lime-primary-color, var(--limel-theme-primary-color))}:host(limel-slider:focus),:host(limel-slider:focus-visible),:host(limel-slider:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-slider){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-slider:focus) limel-helper-line,:host(limel-slider:focus-visible) limel-helper-line,:host(limel-slider:focus-within) limel-helper-line,:host(limel-slider:hover) limel-helper-line{will-change:grid-template-rows}limel-helper-line{order:3}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-slider__thumb{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity}.mdc-slider__thumb::before,.mdc-slider__thumb::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-slider__thumb::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-slider__thumb::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-slider__thumb.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-slider__thumb.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-slider__thumb.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-slider__thumb.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-slider__thumb.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-slider__thumb::before,.mdc-slider__thumb::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-slider__thumb.mdc-ripple-upgraded::before,.mdc-slider__thumb.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-slider__thumb.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-slider__thumb::before,.mdc-slider__thumb::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-slider__thumb:hover::before,.mdc-slider__thumb.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-slider__thumb.mdc-ripple-upgraded--background-focused::before,.mdc-slider__thumb:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-slider__thumb:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-slider__thumb:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-slider__thumb.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-slider .mdc-slider__track{height:4px;position:absolute;top:50%;transform:translateY(-50%);width:100%}.mdc-slider .mdc-slider__track--active,.mdc-slider .mdc-slider__track--inactive{display:flex;height:100%;position:absolute;width:100%}.mdc-slider .mdc-slider__track--active{border-radius:3px;height:6px;overflow:hidden;top:-1px}.mdc-slider .mdc-slider__track--active_fill{border-top:6px solid;box-sizing:border-box;height:100%;width:100%;position:relative;-webkit-transform-origin:left;transform-origin:left}[dir=rtl] .mdc-slider .mdc-slider__track--active_fill,.mdc-slider .mdc-slider__track--active_fill[dir=rtl]{-webkit-transform-origin:right;transform-origin:right;}.mdc-slider .mdc-slider__track--inactive::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid transparent;border-radius:inherit;content:"";pointer-events:none}.mdc-slider .mdc-slider__track--inactive{border-radius:2px;height:4px;left:0;top:0}.mdc-slider .mdc-slider__track--active_fill{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-slider.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:#000;border-color:var(--mdc-theme-on-surface, #000)}.mdc-slider .mdc-slider__track--inactive{background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee);opacity:0.24}.mdc-slider.mdc-slider--disabled .mdc-slider__track--inactive{background-color:#000;background-color:var(--mdc-theme-on-surface, #000);opacity:0.24}.mdc-slider .mdc-slider__value-indicator-container{bottom:44px;left:50%;pointer-events:none;position:absolute;transform:translateX(-50%)}.mdc-slider .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0.4, 0, 1, 1);align-items:center;border-radius:4px;display:flex;height:32px;padding:0 12px;transform:scale(0);transform-origin:bottom}.mdc-slider .mdc-slider__value-indicator::before{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid;bottom:-5px;content:"";height:0;left:50%;position:absolute;transform:translateX(-50%);width:0}.mdc-slider .mdc-slider__value-indicator::after{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid transparent;border-radius:inherit;content:"";pointer-events:none}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator-container{pointer-events:auto}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale(1)}@media (prefers-reduced-motion){.mdc-slider .mdc-slider__value-indicator,.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:none}}.mdc-slider .mdc-slider__value-indicator-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-subtitle2-font-size, 0.875rem);line-height:1.375rem;line-height:var(--mdc-typography-subtitle2-line-height, 1.375rem);font-weight:500;font-weight:var(--mdc-typography-subtitle2-font-weight, 500);letter-spacing:0.0071428571em;letter-spacing:var(--mdc-typography-subtitle2-letter-spacing, 0.0071428571em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle2-text-transform, inherit)}.mdc-slider .mdc-slider__value-indicator{background-color:#000;opacity:0.6}.mdc-slider .mdc-slider__value-indicator::before{border-top-color:#000}.mdc-slider .mdc-slider__value-indicator{color:#fff;color:var(--mdc-theme-on-primary, #fff)}.mdc-slider .mdc-slider__thumb{display:flex;height:48px;left:-24px;outline:none;position:absolute;user-select:none;width:48px}.mdc-slider .mdc-slider__thumb--top{z-index:1}.mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-style:solid;border-width:1px;box-sizing:content-box}.mdc-slider .mdc-slider__thumb-knob{box-shadow:0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);border:10px solid;border-radius:50%;box-sizing:border-box;height:20px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:20px}.mdc-slider .mdc-slider__thumb-knob{background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee);border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mdc-slider.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:#000;background-color:var(--mdc-theme-on-surface, #000);border-color:#000;border-color:var(--mdc-theme-on-surface, #000)}.mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mdc-slider .mdc-slider__thumb::before,.mdc-slider .mdc-slider__thumb::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-slider .mdc-slider__thumb:hover::before,.mdc-slider .mdc-slider__thumb.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded--background-focused::before,.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-slider .mdc-slider__tick-marks{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding:0 1px;position:absolute;width:100%}.mdc-slider .mdc-slider__tick-mark--active,.mdc-slider .mdc-slider__tick-mark--inactive{border-radius:50%;height:2px;width:2px}.mdc-slider .mdc-slider__tick-mark--active{background-color:#fff;background-color:var(--mdc-theme-on-primary, #fff);opacity:0.6}.mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--active{background-color:#fff;background-color:var(--mdc-theme-on-primary, #fff);opacity:0.6}.mdc-slider .mdc-slider__tick-mark--inactive{background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee);opacity:0.6}.mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--inactive{background-color:#000;background-color:var(--mdc-theme-on-surface, #000);opacity:0.6}.mdc-slider{cursor:pointer;height:48px;margin:0 24px;position:relative;touch-action:pan-y}.mdc-slider.mdc-slider--disabled{opacity:0.38;cursor:auto}.mdc-slider.mdc-slider--disabled .mdc-slider__thumb{pointer-events:none}.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:transform 80ms ease}@media (prefers-reduced-motion){.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:none}}.mdc-slider__input{cursor:pointer;left:0;margin:0;height:100%;opacity:0;pointer-events:none;position:absolute;top:0;width:100%}:host(limel-slider){isolation:isolate;position:relative;display:flex;flex-direction:column}:host(limel-slider:not([invalid]):not([invalid=true])) .limel-notched-outline,:host(limel-slider[disabled]:not([disabled=false])) .limel-notched-outline{--limel-notched-outline-border-color:transparent;--limel-notched-outline-background-color:transparent}div[slot=content]{display:flex;flex-direction:column;width:100%;padding:0 0.25rem}.mdc-slider{height:2.5rem;margin:0 0.75rem}.mdc-slider .mdc-slider__track--inactive{background-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.mdc-slider .mdc-slider__track--active_fill{border-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.mdc-slider .mdc-slider__thumb-knob{border-color:var(--lime-primary-color, var(--limel-theme-primary-color));background-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.mdc-slider .mdc-slider__value-indicator-text{font-size:var(--limel-theme-default-small-font-size)}.mdc-slider .mdc-slider__value-indicator-text{font-family:inherit}.slider__content-range-container{display:flex;order:2;justify-content:space-between;margin:0 auto;margin-top:-0.75rem;width:100%}.slider__content-min-label,.slider__content-max-label{line-height:1;transition:opacity 0.2s ease;opacity:0.7;font-size:0.75rem;color:rgba(var(--contrast-1200), 1)}.mdc-slider__track:before,.mdc-slider__track:after{content:"";display:inline-block;position:absolute;top:0;bottom:0;margin:auto;width:0.375rem;height:0.375rem;border-radius:50%;background-color:rgba(var(--contrast-700), 0.6)}.mdc-slider__track:before{left:-0.75rem}.mdc-slider__track:after{right:-0.75rem}';export{V as limel_slider}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2020 Google Inc.
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
* in the Software without restriction, including without limitation the rights
|
|
8
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
* furnished to do so, subject to the following conditions:
|
|
11
|
-
*
|
|
12
|
-
* The above copyright notice and this permission notice shall be included in
|
|
13
|
-
* all copies or substantial portions of the Software.
|
|
14
|
-
*
|
|
15
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
* THE SOFTWARE.
|
|
22
|
-
*/
|
|
23
|
-
var n=function(){function n(){this.rafIDs=new Map}return n.prototype.request=function(n,t){var i=this;this.cancel(n);var r=requestAnimationFrame((function(r){i.rafIDs.delete(n),t(r)}));this.rafIDs.set(n,r)},n.prototype.cancel=function(n){var t=this.rafIDs.get(n);t&&(cancelAnimationFrame(t),this.rafIDs.delete(n))},n.prototype.cancelAll=function(){var n=this;this.rafIDs.forEach((function(t,i){n.cancel(i)}))},n.prototype.getQueue=function(){var n=[];return this.rafIDs.forEach((function(t,i){n.push(i)})),n},n}();export{n as A}
|