@limetech/lime-elements 40.6.1 → 40.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/{component-CFk7Dfoi.js → component-Cz24PdGy.js} +3 -3
- package/dist/cjs/{component-BrNWuGdj.js → component-DNiVfYHV.js} +1 -1
- package/dist/cjs/{component-y8swlNNR.js → component-GW2n79GH.js} +1 -1
- package/dist/cjs/{component-UyqdiWGc.js → component-xiw46M1b.js} +1 -1
- package/dist/cjs/{isArrayLikeObject-BhSkOTkw.js → isArrayLikeObject-U2Ddbw4n.js} +0 -17
- package/dist/cjs/{keycodes-k-EdzcMX.js → keycodes-BQ_AERli.js} +4 -0
- package/dist/cjs/limel-breadcrumbs_6.cjs.entry.js +6 -6
- package/dist/cjs/limel-chip-set.cjs.entry.js +5 -5
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +4 -4
- package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
- package/dist/cjs/limel-form.cjs.entry.js +18 -2
- package/dist/cjs/limel-helper-line_3.cjs.entry.js +2 -2
- package/dist/cjs/limel-pagination-jump.cjs.entry.js +1 -1
- package/dist/cjs/limel-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +3 -3
- package/dist/cjs/limel-tab-bar.cjs.entry.js +202 -1972
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +1 -1
- package/dist/cjs/{ponyfill-BgIFyUG5.js → ponyfill-CHp7Zocr.js} +0 -1
- package/dist/collection/components/tab-bar/tab-bar.js +61 -46
- package/dist/collection/util/keyboard-navigation.js +144 -0
- package/dist/collection/util/keycodes.js +2 -0
- package/dist/esm/{component-wGVqvUmL.js → component-CVihTrav.js} +3 -3
- package/dist/esm/{component-7QB0OUSF.js → component-CrjPGt1I.js} +1 -1
- package/dist/esm/{component-D4qgwaTf.js → component-CyFeUQ0l.js} +1 -1
- package/dist/esm/{component-B2Vy44Z3.js → component-kP1jCDLp.js} +1 -1
- package/dist/esm/{isArrayLikeObject-tmUOLOWr.js → isArrayLikeObject-CJB8HbtH.js} +1 -17
- package/dist/esm/{keycodes-C4_9qUMP.js → keycodes-DQ5DmW_Y.js} +3 -1
- package/dist/esm/limel-breadcrumbs_6.entry.js +6 -6
- package/dist/esm/limel-chip-set.entry.js +5 -5
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +4 -4
- package/dist/esm/limel-dialog.entry.js +2 -2
- package/dist/esm/limel-form.entry.js +17 -1
- package/dist/esm/limel-helper-line_3.entry.js +2 -2
- package/dist/esm/limel-pagination-jump.entry.js +1 -1
- package/dist/esm/limel-picker.entry.js +1 -1
- package/dist/esm/limel-popover_2.entry.js +1 -1
- package/dist/esm/limel-select.entry.js +3 -3
- package/dist/esm/limel-tab-bar.entry.js +202 -1972
- package/dist/esm/limel-text-editor-link-menu.entry.js +1 -1
- package/dist/esm/{ponyfill-ChRGk668.js → ponyfill-6YuZiAPi.js} +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-6adc7c88.entry.js → p-02a06cf7.entry.js} +1 -1
- package/dist/lime-elements/{p-80153f45.entry.js → p-0ece667e.entry.js} +1 -1
- package/dist/lime-elements/p-107654bb.entry.js +13 -0
- package/dist/lime-elements/{p-440a0b43.entry.js → p-120ca628.entry.js} +1 -1
- package/dist/lime-elements/{p-BwJGg-WI.js → p-1CgnIGyd.js} +4 -4
- package/dist/lime-elements/{p-5386c629.entry.js → p-45461ec5.entry.js} +1 -1
- package/dist/lime-elements/{p-8988b7e1.entry.js → p-5e448070.entry.js} +1 -1
- package/dist/lime-elements/{p-ChRGk668.js → p-6YuZiAPi.js} +3 -3
- package/dist/lime-elements/{p-159603cf.entry.js → p-74060535.entry.js} +3 -3
- package/dist/lime-elements/{p-b6c0dc91.entry.js → p-7fa85785.entry.js} +2 -2
- package/dist/lime-elements/p-958396b5.entry.js +1 -0
- package/dist/lime-elements/{p-92669910.entry.js → p-970e0810.entry.js} +1 -1
- package/dist/lime-elements/p-9e084e7c.entry.js +1 -0
- package/dist/lime-elements/{p-BN1-aIOw.js → p-BZXGwiAr.js} +1 -1
- package/dist/lime-elements/{p-DZkKQUDM.js → p-C1FFnUvf.js} +3 -3
- package/dist/lime-elements/{p-C9yTLqR8.js → p-CmtleG1y.js} +1 -1
- package/dist/lime-elements/{p-C4_9qUMP.js → p-DQ5DmW_Y.js} +1 -1
- package/dist/lime-elements/{p-31f314e6.entry.js → p-a42f8c2d.entry.js} +1 -1
- package/dist/lime-elements/{p-f04e2897.entry.js → p-d1b7cc55.entry.js} +1 -1
- package/dist/lime-elements/p-pk5KIdKH.js +1 -0
- package/dist/types/components/tab-bar/tab-bar.d.ts +11 -6
- package/dist/types/components.d.ts +4 -0
- package/dist/types/util/keyboard-navigation.d.ts +105 -0
- package/dist/types/util/keycodes.d.ts +2 -0
- package/package.json +1 -1
- package/dist/lime-elements/p-31226737.entry.js +0 -13
- package/dist/lime-elements/p-4dfd1962.entry.js +0 -67
- package/dist/lime-elements/p-DWMfAkOE.js +0 -1
- package/dist/lime-elements/p-ab8021b9.entry.js +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as n,a as e}from"./p-BU9IJqli.js";import{g as r,b as o}from"./p-CgNJbSP4.js";import{i as a}from"./p-COdirXg1.js";import{_ as c,a as s,f as l,M as u,c as d,m as f,b as h}from"./p-ChRGk668.js";import{a as m,b,M as p}from"./p-BN1-aIOw.js";import{a as g,b as v,i as _,c as y,n as C}from"./p-DWMfAkOE.js";import{S as w,c as x}from"./p-B6-3WXAv.js";import"./p-CK4jS9_E.js";import"./p-9W8bTt2G.js";import"./p-DbBZn7JO.js";import"./p-BcJ-TDVt.js";import"./p-BJQylLSL.js";import"./p-DK0pjX-Y.js";import"./p-oiMYqRQ0.js";import"./p-BYfPV0O4.js";import"./p-B8VKuhvH.js";import"./p-CZ30nDJE.js";import"./p-B--C3qwe.js";var E,T=v((function(t,i){return _(t)?function(t,i){var n=-1,e=g,r=!0,o=t.length,a=[],c=i.length;if(!o)return a;i.length>=200&&(e=x,r=!1,i=new w(i));t:for(;++n<o;){var s=t[n],l=s;if(s=0!==s?s:0,r&&l==l){for(var u=c;u--;)if(i[u]===l)continue t;a.push(s)}else e(i,l,undefined)||a.push(s)}return a}(t,y(i,1,_)):[]})),A={ANIMATING:"mdc-tab-scroller--animating",SCROLL_AREA_SCROLL:"mdc-tab-scroller__scroll-area--scroll",SCROLL_TEST:"mdc-tab-scroller__test"},S={AREA_SELECTOR:".mdc-tab-scroller__scroll-area",CONTENT_SELECTOR:".mdc-tab-scroller__scroll-content"},O=function(t){this.adapter=t},k=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return c(i,t),i.prototype.getScrollPositionRTL=function(){var t=this.adapter.getScrollAreaScrollLeft(),i=this.calculateScrollEdges().right;return Math.round(i-t)},i.prototype.scrollToRTL=function(t){var i=this.calculateScrollEdges(),n=this.adapter.getScrollAreaScrollLeft(),e=this.clampScrollValue(i.right-t);return{finalScrollPosition:e,scrollDelta:e-n}},i.prototype.incrementScrollRTL=function(t){var i=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(i-t);return{finalScrollPosition:n,scrollDelta:n-i}},i.prototype.getAnimatingScrollPosition=function(t){return t},i.prototype.calculateScrollEdges=function(){return{left:0,right:this.adapter.getScrollContentOffsetWidth()-this.adapter.getScrollAreaOffsetWidth()}},i.prototype.clampScrollValue=function(t){var i=this.calculateScrollEdges();return Math.min(Math.max(i.left,t),i.right)},i}(O),R=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return c(i,t),i.prototype.getScrollPositionRTL=function(t){var i=this.adapter.getScrollAreaScrollLeft();return Math.round(t-i)},i.prototype.scrollToRTL=function(t){var i=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(-t);return{finalScrollPosition:n,scrollDelta:n-i}},i.prototype.incrementScrollRTL=function(t){var i=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(i-t);return{finalScrollPosition:n,scrollDelta:n-i}},i.prototype.getAnimatingScrollPosition=function(t,i){return t-i},i.prototype.calculateScrollEdges=function(){var t=this.adapter.getScrollContentOffsetWidth();return{left:this.adapter.getScrollAreaOffsetWidth()-t,right:0}},i.prototype.clampScrollValue=function(t){var i=this.calculateScrollEdges();return Math.max(Math.min(i.right,t),i.left)},i}(O),I=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return c(i,t),i.prototype.getScrollPositionRTL=function(t){var i=this.adapter.getScrollAreaScrollLeft();return Math.round(i-t)},i.prototype.scrollToRTL=function(t){var i=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(t);return{finalScrollPosition:n,scrollDelta:i-n}},i.prototype.incrementScrollRTL=function(t){var i=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(i+t);return{finalScrollPosition:n,scrollDelta:i-n}},i.prototype.getAnimatingScrollPosition=function(t,i){return t+i},i.prototype.calculateScrollEdges=function(){return{left:this.adapter.getScrollContentOffsetWidth()-this.adapter.getScrollAreaOffsetWidth(),right:0}},i.prototype.clampScrollValue=function(t){var i=this.calculateScrollEdges();return Math.min(Math.max(i.right,t),i.left)},i}(O),j=function(t){function i(n){var e=t.call(this,s(s({},i.defaultAdapter),n))||this;return e.isAnimating=!1,e}return c(i,t),Object.defineProperty(i,"cssClasses",{get:function(){return A},enumerable:!1,configurable:!0}),Object.defineProperty(i,"strings",{get:function(){return S},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{eventTargetMatchesSelector:function(){return!1},addClass:function(){},removeClass:function(){},addScrollAreaClass:function(){},setScrollAreaStyleProperty:function(){},setScrollContentStyleProperty:function(){},getScrollContentStyleValue:function(){return""},setScrollAreaScrollLeft:function(){},getScrollAreaScrollLeft:function(){return 0},getScrollContentOffsetWidth:function(){return 0},getScrollAreaOffsetWidth:function(){return 0},computeScrollAreaClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},computeScrollContentClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},computeHorizontalScrollbarHeight:function(){return 0}}},enumerable:!1,configurable:!0}),i.prototype.init=function(){var t=this.adapter.computeHorizontalScrollbarHeight();this.adapter.setScrollAreaStyleProperty("margin-bottom",-t+"px"),this.adapter.addScrollAreaClass(i.cssClasses.SCROLL_AREA_SCROLL)},i.prototype.getScrollPosition=function(){if(this.isRTL())return this.computeCurrentScrollPositionRTL();var t=this.calculateCurrentTranslateX();return this.adapter.getScrollAreaScrollLeft()-t},i.prototype.handleInteraction=function(){this.isAnimating&&this.stopScrollAnimation()},i.prototype.handleTransitionEnd=function(t){this.isAnimating&&this.adapter.eventTargetMatchesSelector(t.target,i.strings.CONTENT_SELECTOR)&&(this.isAnimating=!1,this.adapter.removeClass(i.cssClasses.ANIMATING))},i.prototype.incrementScroll=function(t){0!==t&&this.animate(this.getIncrementScrollOperation(t))},i.prototype.incrementScrollImmediate=function(t){if(0!==t){var i=this.getIncrementScrollOperation(t);0!==i.scrollDelta&&(this.stopScrollAnimation(),this.adapter.setScrollAreaScrollLeft(i.finalScrollPosition))}},i.prototype.scrollTo=function(t){this.isRTL()?this.scrollToImplRTL(t):this.scrollToImpl(t)},i.prototype.getRTLScroller=function(){return this.rtlScrollerInstance||(this.rtlScrollerInstance=this.rtlScrollerFactory()),this.rtlScrollerInstance},i.prototype.calculateCurrentTranslateX=function(){var t=this.adapter.getScrollContentStyleValue("transform");if("none"===t)return 0;var i=/\((.+?)\)/.exec(t);if(!i)return 0;var n=l(i[1].split(","),6);return parseFloat(n[4])},i.prototype.clampScrollValue=function(t){var i=this.calculateScrollEdges();return Math.min(Math.max(i.left,t),i.right)},i.prototype.computeCurrentScrollPositionRTL=function(){var t=this.calculateCurrentTranslateX();return this.getRTLScroller().getScrollPositionRTL(t)},i.prototype.calculateScrollEdges=function(){return{left:0,right:this.adapter.getScrollContentOffsetWidth()-this.adapter.getScrollAreaOffsetWidth()}},i.prototype.scrollToImpl=function(t){var i=this.getScrollPosition(),n=this.clampScrollValue(t);this.animate({finalScrollPosition:n,scrollDelta:n-i})},i.prototype.scrollToImplRTL=function(t){var i=this.getRTLScroller().scrollToRTL(t);this.animate(i)},i.prototype.getIncrementScrollOperation=function(t){if(this.isRTL())return this.getRTLScroller().incrementScrollRTL(t);var i=this.getScrollPosition(),n=this.clampScrollValue(t+i);return{finalScrollPosition:n,scrollDelta:n-i}},i.prototype.animate=function(t){var n=this;0!==t.scrollDelta&&(this.stopScrollAnimation(),this.adapter.setScrollAreaScrollLeft(t.finalScrollPosition),this.adapter.setScrollContentStyleProperty("transform","translateX("+t.scrollDelta+"px)"),this.adapter.computeScrollAreaClientRect(),requestAnimationFrame((function(){n.adapter.addClass(i.cssClasses.ANIMATING),n.adapter.setScrollContentStyleProperty("transform","none")})),this.isAnimating=!0)},i.prototype.stopScrollAnimation=function(){this.isAnimating=!1;var t=this.getAnimatingScrollPosition();this.adapter.removeClass(i.cssClasses.ANIMATING),this.adapter.setScrollContentStyleProperty("transform","translateX(0px)"),this.adapter.setScrollAreaScrollLeft(t)},i.prototype.getAnimatingScrollPosition=function(){var t=this.calculateCurrentTranslateX(),i=this.adapter.getScrollAreaScrollLeft();return this.isRTL()?this.getRTLScroller().getAnimatingScrollPosition(i,t):i-t},i.prototype.rtlScrollerFactory=function(){var t=this.adapter.getScrollAreaScrollLeft();this.adapter.setScrollAreaScrollLeft(t-1);var i=this.adapter.getScrollAreaScrollLeft();if(i<0)return this.adapter.setScrollAreaScrollLeft(t),new R(this.adapter);var n=this.adapter.computeScrollAreaClientRect(),e=this.adapter.computeScrollContentClientRect(),r=Math.round(e.right-n.right);return this.adapter.setScrollAreaScrollLeft(t),r===i?new I(this.adapter):new k(this.adapter)},i.prototype.isRTL=function(){return"rtl"===this.adapter.getScrollContentStyleValue("direction")},i}(u),L=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return c(i,t),i.attachTo=function(t){return new i(t)},i.prototype.initialize=function(){this.area=this.root.querySelector(j.strings.AREA_SELECTOR),this.content=this.root.querySelector(j.strings.CONTENT_SELECTOR)},i.prototype.initialSyncWithDOM=function(){var t=this;this.handleInteraction=function(){t.foundation.handleInteraction()},this.handleTransitionEnd=function(i){t.foundation.handleTransitionEnd(i)},this.area.addEventListener("wheel",this.handleInteraction,m()),this.area.addEventListener("touchstart",this.handleInteraction,m()),this.area.addEventListener("pointerdown",this.handleInteraction,m()),this.area.addEventListener("mousedown",this.handleInteraction,m()),this.area.addEventListener("keydown",this.handleInteraction,m()),this.content.addEventListener("transitionend",this.handleTransitionEnd)},i.prototype.destroy=function(){t.prototype.destroy.call(this),this.area.removeEventListener("wheel",this.handleInteraction,m()),this.area.removeEventListener("touchstart",this.handleInteraction,m()),this.area.removeEventListener("pointerdown",this.handleInteraction,m()),this.area.removeEventListener("mousedown",this.handleInteraction,m()),this.area.removeEventListener("keydown",this.handleInteraction,m()),this.content.removeEventListener("transitionend",this.handleTransitionEnd)},i.prototype.getDefaultFoundation=function(){var t=this;return new j({eventTargetMatchesSelector:function(t,i){return f(t,i)},addClass:function(i){t.root.classList.add(i)},removeClass:function(i){t.root.classList.remove(i)},addScrollAreaClass:function(i){t.area.classList.add(i)},setScrollAreaStyleProperty:function(i,n){t.area.style.setProperty(i,n)},setScrollContentStyleProperty:function(i,n){t.content.style.setProperty(i,n)},getScrollContentStyleValue:function(i){return window.getComputedStyle(t.content).getPropertyValue(i)},setScrollAreaScrollLeft:function(i){return t.area.scrollLeft=i},getScrollAreaScrollLeft:function(){return t.area.scrollLeft},getScrollContentOffsetWidth:function(){return t.content.offsetWidth},getScrollAreaOffsetWidth:function(){return t.area.offsetWidth},computeScrollAreaClientRect:function(){return t.area.getBoundingClientRect()},computeScrollContentClientRect:function(){return t.content.getBoundingClientRect()},computeHorizontalScrollbarHeight:function(){return function(t,i){if(void 0===i&&(i=!0),i&&void 0!==E)return E;var n=t.createElement("div");n.classList.add(A.SCROLL_TEST),t.body.appendChild(n);var e=n.offsetHeight-n.clientHeight;return t.body.removeChild(n),i&&(E=e),e}
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2018 Google Inc.
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in
|
|
14
|
-
* all copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
-
* THE SOFTWARE.
|
|
23
|
-
*/(document)}})},i.prototype.getScrollPosition=function(){return this.foundation.getScrollPosition()},i.prototype.getScrollContentWidth=function(){return this.content.offsetWidth},i.prototype.incrementScroll=function(t){this.foundation.incrementScroll(t)},i.prototype.scrollTo=function(t){this.foundation.scrollTo(t)},i}(d),z={ACTIVE:"mdc-tab-indicator--active",FADE:"mdc-tab-indicator--fade",NO_TRANSITION:"mdc-tab-indicator--no-transition"},D={CONTENT_SELECTOR:".mdc-tab-indicator__content"},M=function(t){function i(n){return t.call(this,s(s({},i.defaultAdapter),n))||this}return c(i,t),Object.defineProperty(i,"cssClasses",{get:function(){return z},enumerable:!1,configurable:!0}),Object.defineProperty(i,"strings",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},computeContentClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},setContentStyleProperty:function(){}}},enumerable:!1,configurable:!0}),i.prototype.computeContentClientRect=function(){return this.adapter.computeContentClientRect()},i}(u),N=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return c(i,t),i.prototype.activate=function(){this.adapter.addClass(M.cssClasses.ACTIVE)},i.prototype.deactivate=function(){this.adapter.removeClass(M.cssClasses.ACTIVE)},i}(M),P=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return c(i,t),i.prototype.activate=function(t){if(t){var i=this.computeContentClientRect(),n=t.width/i.width,e=t.left-i.left;this.adapter.addClass(M.cssClasses.NO_TRANSITION),this.adapter.setContentStyleProperty("transform","translateX("+e+"px) scaleX("+n+")"),this.computeContentClientRect(),this.adapter.removeClass(M.cssClasses.NO_TRANSITION),this.adapter.addClass(M.cssClasses.ACTIVE),this.adapter.setContentStyleProperty("transform","")}else this.adapter.addClass(M.cssClasses.ACTIVE)},i.prototype.deactivate=function(){this.adapter.removeClass(M.cssClasses.ACTIVE)},i}(M),B=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return c(i,t),i.attachTo=function(t){return new i(t)},i.prototype.initialize=function(){this.content=this.root.querySelector(M.strings.CONTENT_SELECTOR)},i.prototype.computeContentClientRect=function(){return this.foundation.computeContentClientRect()},i.prototype.getDefaultFoundation=function(){var t=this,i={addClass:function(i){return t.root.classList.add(i)},removeClass:function(i){return t.root.classList.remove(i)},computeContentClientRect:function(){return t.content.getBoundingClientRect()},setContentStyleProperty:function(i,n){t.content.style.setProperty(i,n)}};return this.root.classList.contains(M.cssClasses.FADE)?new N(i):new P(i)},i.prototype.activate=function(t){this.foundation.activate(t)},i.prototype.deactivate=function(){this.foundation.deactivate()},i}(d),W={ACTIVE:"mdc-tab--active"},Y={ARIA_SELECTED:"aria-selected",CONTENT_SELECTOR:".mdc-tab__content",INTERACTED_EVENT:"MDCTab:interacted",RIPPLE_SELECTOR:".mdc-tab__ripple",TABINDEX:"tabIndex",TAB_INDICATOR_SELECTOR:".mdc-tab-indicator"},K=function(t){function i(n){var e=t.call(this,s(s({},i.defaultAdapter),n))||this;return e.focusOnActivate=!0,e}return c(i,t),Object.defineProperty(i,"cssClasses",{get:function(){return W},enumerable:!1,configurable:!0}),Object.defineProperty(i,"strings",{get:function(){return Y},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},activateIndicator:function(){},deactivateIndicator:function(){},notifyInteracted:function(){},getOffsetLeft:function(){return 0},getOffsetWidth:function(){return 0},getContentOffsetLeft:function(){return 0},getContentOffsetWidth:function(){return 0},focus:function(){}}},enumerable:!1,configurable:!0}),i.prototype.handleClick=function(){this.adapter.notifyInteracted()},i.prototype.isActive=function(){return this.adapter.hasClass(W.ACTIVE)},i.prototype.setFocusOnActivate=function(t){this.focusOnActivate=t},i.prototype.activate=function(t){this.adapter.addClass(W.ACTIVE),this.adapter.setAttr(Y.ARIA_SELECTED,"true"),this.adapter.setAttr(Y.TABINDEX,"0"),this.adapter.activateIndicator(t),this.focusOnActivate&&this.adapter.focus()},i.prototype.deactivate=function(){this.isActive()&&(this.adapter.removeClass(W.ACTIVE),this.adapter.setAttr(Y.ARIA_SELECTED,"false"),this.adapter.setAttr(Y.TABINDEX,"-1"),this.adapter.deactivateIndicator())},i.prototype.computeDimensions=function(){var t=this.adapter.getOffsetWidth(),i=this.adapter.getOffsetLeft(),n=this.adapter.getContentOffsetWidth(),e=this.adapter.getContentOffsetLeft();return{contentLeft:i+e,contentRight:i+e+n,rootLeft:i,rootRight:i+t}},i}(u),V=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return c(i,t),i.attachTo=function(t){return new i(t)},i.prototype.initialize=function(t,i){void 0===t&&(t=function(t,i){return new p(t,i)}),void 0===i&&(i=function(t){return new B(t)}),this.id=this.root.id;var n=new b(p.createAdapter(this));this.ripple=t(this.root,n);var e=this.root.querySelector(K.strings.TAB_INDICATOR_SELECTOR);this.tabIndicator=i(e),this.content=this.root.querySelector(K.strings.CONTENT_SELECTOR)},i.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick=function(){t.foundation.handleClick()},this.listen("click",this.handleClick)},i.prototype.destroy=function(){this.unlisten("click",this.handleClick),this.ripple.destroy(),t.prototype.destroy.call(this)},i.prototype.getDefaultFoundation=function(){var t=this;return new K({setAttr:function(i,n){return t.root.setAttribute(i,n)},addClass:function(i){return t.root.classList.add(i)},removeClass:function(i){return t.root.classList.remove(i)},hasClass:function(i){return t.root.classList.contains(i)},activateIndicator:function(i){t.tabIndicator.activate(i)},deactivateIndicator:function(){t.tabIndicator.deactivate()},notifyInteracted:function(){return t.emit(K.strings.INTERACTED_EVENT,{tabId:t.id},!0)},getOffsetLeft:function(){return t.root.offsetLeft},getOffsetWidth:function(){return t.root.offsetWidth},getContentOffsetLeft:function(){return t.content.offsetLeft},getContentOffsetWidth:function(){return t.content.offsetWidth},focus:function(){return t.root.focus()}})},Object.defineProperty(i.prototype,"active",{get:function(){return this.foundation.isActive()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"focusOnActivate",{set:function(t){this.foundation.setFocusOnActivate(t)},enumerable:!1,configurable:!0}),i.prototype.activate=function(t){this.foundation.activate(t)},i.prototype.deactivate=function(){this.foundation.deactivate()},i.prototype.computeIndicatorClientRect=function(){return this.tabIndicator.computeContentClientRect()},i.prototype.computeDimensions=function(){return this.foundation.computeDimensions()},i.prototype.focus=function(){this.root.focus()},i}(d),H={ARROW_LEFT_KEY:"ArrowLeft",ARROW_RIGHT_KEY:"ArrowRight",END_KEY:"End",ENTER_KEY:"Enter",HOME_KEY:"Home",SPACE_KEY:"Space",TAB_ACTIVATED_EVENT:"MDCTabBar:activated",TAB_SCROLLER_SELECTOR:".mdc-tab-scroller",TAB_SELECTOR:".mdc-tab"},X={ARROW_LEFT_KEYCODE:37,ARROW_RIGHT_KEYCODE:39,END_KEYCODE:35,ENTER_KEYCODE:13,EXTRA_SCROLL_AMOUNT:20,HOME_KEYCODE:36,SPACE_KEYCODE:32},F=new Set;
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2018 Google Inc.
|
|
27
|
-
*
|
|
28
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
30
|
-
* in the Software without restriction, including without limitation the rights
|
|
31
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
33
|
-
* furnished to do so, subject to the following conditions:
|
|
34
|
-
*
|
|
35
|
-
* The above copyright notice and this permission notice shall be included in
|
|
36
|
-
* all copies or substantial portions of the Software.
|
|
37
|
-
*
|
|
38
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
44
|
-
* THE SOFTWARE.
|
|
45
|
-
*/F.add(H.ARROW_LEFT_KEY),F.add(H.ARROW_RIGHT_KEY),F.add(H.END_KEY),F.add(H.HOME_KEY),F.add(H.ENTER_KEY),F.add(H.SPACE_KEY);var J=new Map;J.set(X.ARROW_LEFT_KEYCODE,H.ARROW_LEFT_KEY),J.set(X.ARROW_RIGHT_KEYCODE,H.ARROW_RIGHT_KEY),J.set(X.END_KEYCODE,H.END_KEY),J.set(X.HOME_KEYCODE,H.HOME_KEY),J.set(X.ENTER_KEYCODE,H.ENTER_KEY),J.set(X.SPACE_KEYCODE,H.SPACE_KEY);var q=function(t){function i(n){var e=t.call(this,s(s({},i.defaultAdapter),n))||this;return e.useAutomaticActivation=!1,e}return c(i,t),Object.defineProperty(i,"strings",{get:function(){return H},enumerable:!1,configurable:!0}),Object.defineProperty(i,"numbers",{get:function(){return X},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{scrollTo:function(){},incrementScroll:function(){},getScrollPosition:function(){return 0},getScrollContentWidth:function(){return 0},getOffsetWidth:function(){return 0},isRTL:function(){return!1},setActiveTab:function(){},activateTabAtIndex:function(){},deactivateTabAtIndex:function(){},focusTabAtIndex:function(){},getTabIndicatorClientRectAtIndex:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getTabDimensionsAtIndex:function(){return{rootLeft:0,rootRight:0,contentLeft:0,contentRight:0}},getPreviousActiveTabIndex:function(){return-1},getFocusedTabIndex:function(){return-1},getIndexOfTabById:function(){return-1},getTabListLength:function(){return 0},notifyTabActivated:function(){}}},enumerable:!1,configurable:!0}),i.prototype.setUseAutomaticActivation=function(t){this.useAutomaticActivation=t},i.prototype.activateTab=function(t){var i,n=this.adapter.getPreviousActiveTabIndex();this.indexIsInRange(t)&&t!==n&&(-1!==n&&(this.adapter.deactivateTabAtIndex(n),i=this.adapter.getTabIndicatorClientRectAtIndex(n)),this.adapter.activateTabAtIndex(t,i),this.scrollIntoView(t),this.adapter.notifyTabActivated(t))},i.prototype.handleKeyDown=function(t){var i=this.getKeyFromEvent(t);if(void 0!==i)if(this.isActivationKey(i)||t.preventDefault(),this.useAutomaticActivation){if(this.isActivationKey(i))return;var n=this.determineTargetFromKey(this.adapter.getPreviousActiveTabIndex(),i);this.adapter.setActiveTab(n),this.scrollIntoView(n)}else{var e=this.adapter.getFocusedTabIndex();this.isActivationKey(i)?this.adapter.setActiveTab(e):(n=this.determineTargetFromKey(e,i),this.adapter.focusTabAtIndex(n),this.scrollIntoView(n))}},i.prototype.handleTabInteraction=function(t){this.adapter.setActiveTab(this.adapter.getIndexOfTabById(t.detail.tabId))},i.prototype.scrollIntoView=function(t){this.indexIsInRange(t)&&(0!==t?t!==this.adapter.getTabListLength()-1?this.isRTL()?this.scrollIntoViewImplRTL(t):this.scrollIntoViewImpl(t):this.adapter.scrollTo(this.adapter.getScrollContentWidth()):this.adapter.scrollTo(0))},i.prototype.determineTargetFromKey=function(t,i){var n=this.isRTL(),e=this.adapter.getTabListLength()-1,r=t;return i===H.END_KEY?r=e:i===H.ARROW_LEFT_KEY&&!n||i===H.ARROW_RIGHT_KEY&&n?r-=1:i===H.ARROW_RIGHT_KEY&&!n||i===H.ARROW_LEFT_KEY&&n?r+=1:r=0,r<0?r=e:r>e&&(r=0),r},i.prototype.calculateScrollIncrement=function(t,i,n,e){var r=this.adapter.getTabDimensionsAtIndex(i),o=r.contentLeft-n-e+X.EXTRA_SCROLL_AMOUNT;return i<t?Math.min(r.contentRight-n-X.EXTRA_SCROLL_AMOUNT,0):Math.max(o,0)},i.prototype.calculateScrollIncrementRTL=function(t,i,n,e,r){var o=this.adapter.getTabDimensionsAtIndex(i),a=r-o.contentLeft-n-X.EXTRA_SCROLL_AMOUNT;return i>t?Math.max(r-o.contentRight-n-e+X.EXTRA_SCROLL_AMOUNT,0):Math.min(a,0)},i.prototype.findAdjacentTabIndexClosestToEdge=function(t,i,n,e){var r=i.rootLeft-n,o=i.rootRight-n-e,a=r+o;return r<0||a<0?t-1:o>0||a>0?t+1:-1},i.prototype.findAdjacentTabIndexClosestToEdgeRTL=function(t,i,n,e,r){var o=r-i.rootLeft-e-n,a=r-i.rootRight-n,c=o+a;return o>0||c>0?t+1:a<0||c<0?t-1:-1},i.prototype.getKeyFromEvent=function(t){return F.has(t.key)?t.key:J.get(t.keyCode)},i.prototype.isActivationKey=function(t){return t===H.SPACE_KEY||t===H.ENTER_KEY},i.prototype.indexIsInRange=function(t){return t>=0&&t<this.adapter.getTabListLength()},i.prototype.isRTL=function(){return this.adapter.isRTL()},i.prototype.scrollIntoViewImpl=function(t){var i=this.adapter.getScrollPosition(),n=this.adapter.getOffsetWidth(),e=this.adapter.getTabDimensionsAtIndex(t),r=this.findAdjacentTabIndexClosestToEdge(t,e,i,n);if(this.indexIsInRange(r)){var o=this.calculateScrollIncrement(t,r,i,n);this.adapter.incrementScroll(o)}},i.prototype.scrollIntoViewImplRTL=function(t){var i=this.adapter.getScrollPosition(),n=this.adapter.getOffsetWidth(),e=this.adapter.getTabDimensionsAtIndex(t),r=this.adapter.getScrollContentWidth(),o=this.findAdjacentTabIndexClosestToEdgeRTL(t,e,i,n,r);if(this.indexIsInRange(o)){var a=this.calculateScrollIncrementRTL(t,o,i,n,r);this.adapter.incrementScroll(a)}},i}(u),G=q.strings,U=0,Q=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return c(i,t),i.attachTo=function(t){return new i(t)},Object.defineProperty(i.prototype,"focusOnActivate",{set:function(t){var i,n;try{for(var e=h(this.tabList),r=e.next();!r.done;r=e.next())r.value.focusOnActivate=t}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=e.return)&&n.call(e)}finally{if(i)throw i.error}}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"useAutomaticActivation",{set:function(t){this.foundation.setUseAutomaticActivation(t)},enumerable:!1,configurable:!0}),i.prototype.initialize=function(t,i){void 0===t&&(t=function(t){return new V(t)}),void 0===i&&(i=function(t){return new L(t)}),this.tabList=this.instantiateTabs(t),this.tabScroller=this.instantiatetabScroller(i)},i.prototype.initialSyncWithDOM=function(){var t=this;this.handleTabInteraction=function(i){t.foundation.handleTabInteraction(i)},this.handleKeyDown=function(i){t.foundation.handleKeyDown(i)},this.listen(K.strings.INTERACTED_EVENT,this.handleTabInteraction),this.listen("keydown",this.handleKeyDown);for(var i=0;i<this.tabList.length;i++)if(this.tabList[i].active){this.scrollIntoView(i);break}},i.prototype.destroy=function(){var i,n;t.prototype.destroy.call(this),this.unlisten(K.strings.INTERACTED_EVENT,this.handleTabInteraction),this.unlisten("keydown",this.handleKeyDown);try{for(var e=h(this.tabList),r=e.next();!r.done;r=e.next())r.value.destroy()}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=e.return)&&n.call(e)}finally{if(i)throw i.error}}this.tabScroller&&this.tabScroller.destroy()},i.prototype.getDefaultFoundation=function(){var t=this;return new q({scrollTo:function(i){t.tabScroller.scrollTo(i)},incrementScroll:function(i){t.tabScroller.incrementScroll(i)},getScrollPosition:function(){return t.tabScroller.getScrollPosition()},getScrollContentWidth:function(){return t.tabScroller.getScrollContentWidth()},getOffsetWidth:function(){return t.root.offsetWidth},isRTL:function(){return"rtl"===window.getComputedStyle(t.root).getPropertyValue("direction")},setActiveTab:function(i){t.foundation.activateTab(i)},activateTabAtIndex:function(i,n){t.tabList[i].activate(n)},deactivateTabAtIndex:function(i){t.tabList[i].deactivate()},focusTabAtIndex:function(i){t.tabList[i].focus()},getTabIndicatorClientRectAtIndex:function(i){return t.tabList[i].computeIndicatorClientRect()},getTabDimensionsAtIndex:function(i){return t.tabList[i].computeDimensions()},getPreviousActiveTabIndex:function(){for(var i=0;i<t.tabList.length;i++)if(t.tabList[i].active)return i;return-1},getFocusedTabIndex:function(){var i=t.getTabElements(),n=document.activeElement;return i.indexOf(n)},getIndexOfTabById:function(i){for(var n=0;n<t.tabList.length;n++)if(t.tabList[n].id===i)return n;return-1},getTabListLength:function(){return t.tabList.length},notifyTabActivated:function(i){return t.emit(G.TAB_ACTIVATED_EVENT,{index:i},!0)}})},i.prototype.activateTab=function(t){this.foundation.activateTab(t)},i.prototype.scrollIntoView=function(t){this.foundation.scrollIntoView(t)},i.prototype.getTabElements=function(){return[].slice.call(this.root.querySelectorAll(G.TAB_SELECTOR))},i.prototype.instantiateTabs=function(t){return this.getTabElements().map((function(i){return i.id=i.id||"mdc-tab-"+ ++U,t(i)}))},i.prototype.instantiatetabScroller=function(t){var i=this.root.querySelector(G.TAB_SCROLLER_SELECTOR);return i?t(i):null},i}(d);
|
|
46
|
-
/**
|
|
47
|
-
* @license
|
|
48
|
-
* Copyright 2018 Google Inc.
|
|
49
|
-
*
|
|
50
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
51
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
52
|
-
* in the Software without restriction, including without limitation the rights
|
|
53
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
54
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
55
|
-
* furnished to do so, subject to the following conditions:
|
|
56
|
-
*
|
|
57
|
-
* The above copyright notice and this permission notice shall be included in
|
|
58
|
-
* all copies or substantial portions of the Software.
|
|
59
|
-
*
|
|
60
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
61
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
62
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
63
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
64
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
65
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
66
|
-
* THE SOFTWARE.
|
|
67
|
-
*/const{TAB_ACTIVATED_EVENT:Z}=H,$={scrollTo:C,incrementScroll:C,getScrollPosition:()=>0,getScrollContentWidth:()=>0,destroy:C},tt=class{constructor(n){t(this,n),this.changeTab=i(this,"changeTab",7),this.tabs=[],this.setupMdc=!1,this.hasLoaded=!1,this.handleTabActivated=this.handleTabActivated.bind(this),this.renderTab=this.renderTab.bind(this)}async connectedCallback(){this.setup(),this.hasLoaded&&(this.revealedTabId=void 0,await this.revealActiveTab("auto"))}componentDidLoad(){this.hasLoaded=!0,this.setup(),this.triggerIconColorWarning()}async componentDidRender(){await this.revealActiveTab(this.hasLoaded?void 0:"auto")}componentDidUpdate(){this.setupMdc&&(this.setup(),this.setupMdc=!1)}disconnectedCallback(){this.tearDown()}render(){return n("div",{key:"343865b4ddac8aa25042cb91916ad411366b4602",class:"mdc-tab-bar",role:"tablist"},n("limel-scroller",{key:"7329ad9bb97c09afc79c3770d27db9fbb16093f3",class:"mdc-tab-scroller"},this.tabs.map(this.renderTab)))}tabsChanged(t=[],i=[]){const n=t.map((t=>t.id)),e=i.map((t=>t.id));a(n,e)||(this.setupMdc=!0,this.revealedTabId=void 0,this.tearDown())}setup(){const t=this.host.shadowRoot.querySelector(".mdc-tab-bar");t&&(this.mdcTabBar=new Q(t,void 0,void 0,(()=>$)),this.mdcTabBar.focusOnActivate=!0,this.mdcTabBar.useAutomaticActivation=!0,this.mdcTabBar.listen(Z,this.handleTabActivated))}tearDown(){this.mdcTabBar&&(this.mdcTabBar.unlisten(Z,this.handleTabActivated),this.mdcTabBar.destroy())}async revealActiveTab(t){const i=this.tabs.findIndex((t=>t.active));if(-1===i)return void(this.revealedTabId=void 0);if(this.tabs[i].id===this.revealedTabId)return;this.revealedTabId=this.tabs[i].id;const n=this.host.shadowRoot.querySelectorAll('button[role="tab"]')[i],e=this.host.shadowRoot.querySelector("limel-scroller");n&&e&&!n.matches(":focus")&&(await e.componentOnReady(),await e.reveal(n,t))}handleTabActivated(t){const i=function(t,i){const n=t.findIndex((t=>!0===t.active)),e=[...t];return-1!==n&&(e[n]=Object.assign(Object.assign({},t[n]),{active:!1})),e[i]=Object.assign(Object.assign({},t[i]),{active:!0}),e}(this.tabs,t.detail.index),n=T(i,this.tabs).sort(this.sortByInactive);for(const t of n)this.changeTab.emit(t);this.tabs=i}sortByInactive(t,i){return Number(t.active)-Number(i.active)}renderIcon(t){if(!t.icon)return;const i=r(t.icon),e=o(t.icon,t.iconColor),a={color:""};return e&&(a.color=e),n("limel-icon",{class:"mdc-tab__icon",name:i,style:a,size:"small","aria-hidden":"true"})}renderTab(t){return n("button",{class:{"mdc-tab":!0,"mdc-tab--active":!!t.active},role:"tab","aria-selected":t.active?"true":"false",tabindex:t.active?0:-1},n("span",{class:"mdc-tab__content"},this.renderIcon(t),n("span",{class:"mdc-tab__text-label"},t.text),t.badge?n("limel-badge",{label:t.badge}):""),n("span",{class:{"mdc-tab-indicator":!0,"mdc-tab-indicator--active":!!t.active}},n("span",{class:"mdc-tab-indicator__content mdc-tab-indicator__content--underline"})),n("span",{class:"mdc-tab__ripple"}))}triggerIconColorWarning(){this.tabs.some((t=>t.iconColor))&&console.warn("The `iconColor` prop is deprecated now! Use the new `Icon` interface and instead of `iconColor: 'color-name'` write `icon {name: 'icon-name', color: 'color-name'}`.")}get host(){return e(this)}static get watchers(){return{tabs:[{tabsChanged:0}]}}};tt.style=".mdc-tab-bar{width:100%}.mdc-tab{height:48px}.mdc-tab--stacked{height:72px}.mdc-tab-indicator .mdc-tab-indicator__content--underline{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-tab-indicator .mdc-tab-indicator__content--icon{color:#018786;color:var(--mdc-theme-secondary, #018786)}.mdc-tab-indicator .mdc-tab-indicator__content--underline{border-top-width:2px}.mdc-tab-indicator .mdc-tab-indicator__content--icon{height:34px;font-size:34px}.mdc-tab-indicator{display:flex;position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;pointer-events:none;z-index:1}.mdc-tab-indicator__content{transform-origin:left;opacity:0}.mdc-tab-indicator__content--underline{align-self:flex-end;box-sizing:border-box;width:100%;border-top-style:solid}.mdc-tab-indicator__content--icon{align-self:center;margin:0 auto}.mdc-tab-indicator--active .mdc-tab-indicator__content{opacity:1}.mdc-tab-indicator .mdc-tab-indicator__content{transition:250ms transform cubic-bezier(0.4, 0, 0.2, 1)}.mdc-tab-indicator--no-transition .mdc-tab-indicator__content{transition:none}.mdc-tab-indicator--fade .mdc-tab-indicator__content{transition:150ms opacity linear}.mdc-tab-indicator--active.mdc-tab-indicator--fade .mdc-tab-indicator__content{transition-delay:100ms}.mdc-tab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-button-font-size, 0.875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight, 500);letter-spacing:0.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, 0.0892857143em);text-decoration:none;text-decoration:var(--mdc-typography-button-text-decoration, none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform, uppercase)}.mdc-tab .mdc-tab__text-label{color:rgba(0, 0, 0, 0.6)}.mdc-tab .mdc-tab__icon{color:rgba(0, 0, 0, 0.54);fill:currentColor}.mdc-tab{position:relative}.mdc-tab__content{position:relative}.mdc-tab__icon{width:24px;height:24px;font-size:24px}.mdc-tab--active .mdc-tab__text-label{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}.mdc-tab--active .mdc-tab__icon{color:#6200ee;color:var(--mdc-theme-primary, #6200ee);fill:currentColor}.mdc-tab{background:none}.mdc-tab{min-width:90px;padding-right:24px;padding-left:24px;display:flex;flex:1 0 auto;justify-content:center;box-sizing:border-box;margin:0;padding-top:0;padding-bottom:0;border:none;outline:none;text-align:center;white-space:nowrap;cursor:pointer;-webkit-appearance:none;z-index:1}.mdc-tab::-moz-focus-inner{padding:0;border:0}.mdc-tab--min-width{flex:0 1 auto}.mdc-tab__content{display:flex;align-items:center;justify-content:center;height:inherit;pointer-events:none}.mdc-tab__text-label{transition:150ms color linear;display:inline-block;line-height:1;z-index:2}.mdc-tab__icon{transition:150ms color linear;z-index:2}.mdc-tab--stacked .mdc-tab__content{flex-direction:column;align-items:center;justify-content:center}.mdc-tab--stacked .mdc-tab__text-label{padding-top:6px;padding-bottom:4px}.mdc-tab--active .mdc-tab__text-label,.mdc-tab--active .mdc-tab__icon{transition-delay:100ms}.mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon+.mdc-tab__text-label{padding-left:8px;padding-right:0}[dir=rtl] .mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon+.mdc-tab__text-label,.mdc-tab:not(.mdc-tab--stacked) .mdc-tab__icon+.mdc-tab__text-label[dir=rtl]{padding-left:0;padding-right:8px;}@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-tab{--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)}.mdc-tab .mdc-tab__ripple::before,.mdc-tab .mdc-tab__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.mdc-tab .mdc-tab__ripple::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-tab .mdc-tab__ripple::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-tab.mdc-ripple-upgraded--unbounded .mdc-tab__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-tab.mdc-ripple-upgraded--foreground-activation .mdc-tab__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-tab.mdc-ripple-upgraded--foreground-deactivation .mdc-tab__ripple::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-tab .mdc-tab__ripple::before,.mdc-tab .mdc-tab__ripple::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-tab.mdc-ripple-upgraded .mdc-tab__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-tab .mdc-tab__ripple::before,.mdc-tab .mdc-tab__ripple::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-tab:hover .mdc-tab__ripple::before,.mdc-tab.mdc-ripple-surface--hover .mdc-tab__ripple::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-tab.mdc-ripple-upgraded--background-focused .mdc-tab__ripple::before,.mdc-tab:not(.mdc-ripple-upgraded):focus .mdc-tab__ripple::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-tab:not(.mdc-ripple-upgraded) .mdc-tab__ripple::after{transition:opacity 150ms linear}.mdc-tab:not(.mdc-ripple-upgraded):active .mdc-tab__ripple::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-tab.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-tab__ripple{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;will-change:transform, opacity}:host(limel-tab-bar){--limel-tab-background-color:var(--contrast-300);--limel-tab-border-radius:0.625rem;--limel-active-tab-background-color:var( --tab-panel-background-color, rgb(var(--contrast-100)) );--limel-tab-active-outer-edge-curve-size:0.75rem;--limel-tab-separator-width:0.125rem;--limel-tab-separator-background-color:rgb(var(--contrast-600));isolation:isolate;display:block;position:relative}limel-scroller{--limel-scroller-fade-color:var(--limel-tab-background-color);--limel-scroller-content-padding:0.25rem var(--limel-tab-active-outer-edge-curve-size) 0;background-color:rgb(var(--limel-tab-background-color))}:host(.has-tabs-with-equal-width) .mdc-tab{flex:1 0 auto}.mdc-tab{font-family:inherit;font-weight:400;letter-spacing:normal;font-size:var(--limel-theme-default-font-size);text-transform:none}.mdc-tab-indicator .mdc-tab-indicator__content{border:none}.mdc-tab__ripple{box-sizing:border-box;border-radius:var(--limel-tab-border-radius);border-style:solid;border-color:transparent;border-width:0.25rem;opacity:0.7}.mdc-tab__ripple:before,.mdc-tab__ripple:after{transition:background-color 0.5s ease}.mdc-tab{border-radius:0;padding-right:1rem;padding-left:1rem;min-width:2.5rem;background-color:transparent;flex:0 0 auto;height:2.5rem}.mdc-tab:not(.mdc-tab--active):after{content:\"\";display:block;background-color:var(--limel-tab-separator-background-color);width:var(--limel-tab-separator-width);height:1rem;margin:auto;position:absolute;top:0;bottom:0;border-radius:1rem;right:calc(-1 * var(--limel-tab-separator-width))}.mdc-tab:not(.mdc-tab--active):last-of-type:after{display:none}.mdc-tab .mdc-tab__icon{color:rgb(var(--contrast-800));margin-left:-0.25rem}.mdc-tab limel-badge{margin-right:-0.25rem;box-shadow:0 0 0 1px rgb(var(--contrast-600))}.mdc-tab--active{border-radius:var(--limel-tab-border-radius) var(--limel-tab-border-radius) 0 0;background-color:var(--limel-active-tab-background-color);z-index:2}.mdc-tab--active:before,.mdc-tab--active:after{content:\"\";display:block;width:var(--limel-tab-active-outer-edge-curve-size);height:var(--limel-tab-active-outer-edge-curve-size);position:absolute;bottom:0;background-color:var(--limel-active-tab-background-color);-webkit-mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2050%2050'%3E%3Cdefs/%3E%3Cpath%20d='M0%200c0%2027.594%2022.406%2050%2050%2050H0V0z'/%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2050%2050'%3E%3Cdefs/%3E%3Cpath%20d='M0%200c0%2027.594%2022.406%2050%2050%2050H0V0z'/%3E%3C/svg%3E\")}.mdc-tab--active:before{left:calc(-1 * var(--limel-tab-active-outer-edge-curve-size));transform:rotateY(180deg)}.mdc-tab--active:after{right:calc(-1 * var(--limel-tab-active-outer-edge-curve-size))}.mdc-tab--active .mdc-ripple-upgraded--background-focused:before{background-color:transparent;transition:background-color 1s ease}.mdc-tab--active .mdc-tab__icon{color:var(--mdc-theme-primary)}.mdc-tab__content{gap:0.375rem}.mdc-tab .mdc-tab__text-label{transition:color 0.2s ease;padding-left:0 !important;color:var(--limel-theme-on-surface-color)}.mdc-tab:hover .mdc-tab__text-label{color:var(--limel-theme-text-primary-on-background-color)}.mdc-tab.mdc-tab--active .mdc-tab__text-label{color:var(--lime-primary-color, var(--limel-theme-primary-color))}";export{tt as limel_tab_bar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as r}from"./p-CK4jS9_E.js";import{d as n}from"./p-9W8bTt2G.js";import{d as t}from"./p-B6-3WXAv.js";import{S as o}from"./p-BJQylLSL.js";import{i}from"./p-DK0pjX-Y.js";import{i as u}from"./p-B8VKuhvH.js";import{i as a}from"./p-BYfPV0O4.js";import{i as e}from"./p-oiMYqRQ0.js";function f(){}var s,c,p,m=Date.now,v=n?function(r,t){return n(r,"toString",{configurable:!0,enumerable:!1,value:(o=t,function(){return o}),writable:!0});var o}:r,j=(s=v,c=0,p=0,function(){var r=m(),n=16-(r-p);if(p=r,n>0){if(++c>=800)return arguments[0]}else c=0;return s.apply(void 0,arguments)});function l(r){return r!=r}function b(r,n){return!(null==r||!r.length)&&function(r,n){return n==n?function(r,n){for(var t=-1,o=r.length;++t<o;)if(r[t]===n)return t;return-1}(r,n):function(r,n){for(var t=r.length,o=-1;++o<t;)if(n(r[o],o,r))return o;return-1}(r,l)}(r,n)>-1}var d=Math.max;function h(n,t){return j(function(r,n,t){return n=d(void 0===n?r.length-1:n,0),function(){for(var o=arguments,i=-1,u=d(o.length-n,0),a=Array(u);++i<u;)a[i]=o[n+i];i=-1;for(var e=Array(n+1);++i<n;)e[i]=o[i];return e[n]=t(a),function(r,n,t){switch(t.length){case 0:return r.call(n);case 1:return r.call(n,t[0]);case 2:return r.call(n,t[0],t[1]);case 3:return r.call(n,t[0],t[1],t[2])}return r.apply(n,t)}(r,this,e)}}(n,t,r),n+"")}var B=o?o.isConcatSpreadable:void 0;function S(r){return u(r)||i(r)||!!(B&&r&&r[B])}function y(r,n,o,i,u){var a=-1,e=r.length;for(o||(o=S),u||(u=[]);++a<e;){var f=r[a];o(f)&&t(u,f)}return u}function A(r){return e(r)&&a(r)}export{b as a,h as b,y as c,A as i,f as n}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,a as e}from"./p-BU9IJqli.js";import{c as h}from"./p-BrjD-ITe.js";import{i as a,a as n}from"./p-B-tmXAXV.js";import"./p-ZDFVISfu.js";import{m as r}from"./p-DTcfed02.js";import{g as o}from"./p-ChagAaNf.js";import{M as l}from"./p-DZkKQUDM.js";import"./p-B85MJLTf.js";import"./p-ChRGk668.js";import"./p-BN1-aIOw.js";import"./p-C9yTLqR8.js";class d{constructor(t="en"){this.language=t}formatDate(t,i){return t?r(t).locale(this.getLanguage()).format(i):""}parseDate(t,i){return t?r(t,i).toDate():null}getLanguage(){const t=o(this.language);return"no"===t?"nb":t}getDateFormat(t){return{date:"L",time:"LT",week:"[w] W GGGG",month:"MM/YYYY",quarter:"[Q]Q YYYY",year:"YYYY",datetime:"L - LT"}[t]||"L - LT"}}const m={date:"date",time:"time",week:a()?"date":"week",month:"month",quarter:"date",year:"date",datetime:"datetime-local",default:"datetime-local"},p={date:"Y-MM-DD",time:"HH:mm",week:"GGGG-[W]WW",month:"Y-MM","datetime-local":"Y-MM-DD[T]HH:mm"},u=class{constructor(s){t(this,s),this.change=i(this,"change",7),this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.type="datetime",this.language="en",this.showPortal=!1,this.portalId=`date-picker-calendar-${h()}`,this.documentClickListener=t=>{t.composedPath().includes(this.textField)||document.querySelector(`#${this.portalId}`).contains(t.target)||this.hideCalendar()},this.formatValue=t=>this.dateFormatter.formatDate(t,this.internalFormat),this.handleCalendarChange=this.handleCalendarChange.bind(this),this.handleInputElementChange=this.handleInputElementChange.bind(this),this.showCalendar=this.showCalendar.bind(this),this.dateFormatter=new d(this.language),this.clearValue=this.clearValue.bind(this),this.hideCalendar=this.hideCalendar.bind(this),this.onInputClick=this.onInputClick.bind(this),this.nativeChangeHandler=this.nativeChangeHandler.bind(this),this.preventBlurFromCalendarContainer=this.preventBlurFromCalendarContainer.bind(this)}componentWillLoad(){this.useNative=!this.readonly&&(a()||n()),this.updateInternalFormatAndType()}componentWillUpdate(){this.updateInternalFormatAndType()}disconnectedCallback(){this.removeDocumentListeners()}render(){const t={onAction:this.clearValue};!this.value||this.readonly||this.disabled||(t.trailingIcon="clear_symbol");const i=this.disabled||this.readonly?void 0:this.helperText;if(this.useNative)return s("limel-input-field",{disabled:this.disabled,readonly:this.readonly,invalid:this.invalid,label:this.label,helperText:i,required:this.required,value:this.formatValue(this.value),type:this.nativeType,onChange:this.nativeChangeHandler});const e=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index"),h=this.formatter||this.formatValue;return[s("limel-input-field",Object.assign({disabled:this.disabled,readonly:this.readonly,invalid:this.invalid,label:this.label,placeholder:this.placeholder,helperText:i,required:this.required,value:this.value?h(this.value):"",onFocus:this.showCalendar,onBlur:this.hideCalendar,onClick:this.onInputClick,onChange:this.handleInputElementChange,ref:t=>this.textField=t},t)),s("limel-portal",{containerId:this.portalId,visible:this.showPortal,containerStyle:{"z-index":e}},s("limel-flatpickr-adapter",{format:this.internalFormat,language:this.language,type:this.type,value:this.value,ref:t=>this.datePickerCalendar=t,isOpen:this.showPortal,formatter:h,onChange:this.handleCalendarChange}))]}updateInternalFormatAndType(){this.nativeType=m[this.type||"default"],this.nativeFormat=p[this.nativeType],this.internalFormat=this.useNative?this.nativeFormat:this.formatter||this.format?this.format:this.dateFormatter.getDateFormat(this.type)}nativeChangeHandler(t){t.stopPropagation();const i=this.dateFormatter.parseDate(t.detail,this.internalFormat);this.change.emit(i)}showCalendar(t){if(this.disabled||this.readonly)return void t.stopPropagation();this.showPortal=!0;const i=this.textField.shadowRoot.querySelector("input");setTimeout((()=>{this.datePickerCalendar.inputElement=i}),0),t.stopPropagation(),document.addEventListener("mousedown",this.documentClickListener,{passive:!0}),document.addEventListener("blur",this.preventBlurFromCalendarContainer,{capture:!0})}preventBlurFromCalendarContainer(t){t.relatedTarget===this.datePickerCalendar&&t.stopPropagation()}hideCalendar(){setTimeout((()=>{this.showPortal=!1}),0),this.removeDocumentListeners(),this.pickerIsAutoClosing()||this.fixFlatpickrFocusBug()}removeDocumentListeners(){document.removeEventListener("mousedown",this.documentClickListener),document.removeEventListener("blur",this.preventBlurFromCalendarContainer,{capture:!0})}fixFlatpickrFocusBug(){var t,i;const s=null===(i=null===(t=this.textField)||void 0===t?void 0:t.shadowRoot)||void 0===i?void 0:i.querySelector(".mdc-text-field");if(!s)return;const e=new l(s);e.getDefaultFoundation().deactivateFocus(),e.valid=!this.invalid}handleCalendarChange(t){const i=t.detail;t.stopPropagation(),this.pickerIsAutoClosing()&&this.hideCalendar(),this.change.emit(i)}onInputClick(t){this.disabled||this.readonly||this.showPortal||this.showCalendar(t)}handleInputElementChange(t){this.disabled||this.readonly||""===t.detail&&this.clearValue(),t.stopPropagation()}pickerIsAutoClosing(){return"datetime"!==this.type&&"time"!==this.type}clearValue(){this.change.emit(null)}get host(){return e(this)}};u.style=":host(limel-date-picker){position:relative}limel-input-field[disabled],limel-input-field[readonly]{pointer-events:none}";export{u as limel_date_picker}
|