tinkiet 0.3.2 → 0.3.4
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/drawer/drawer.js +2 -0
- package/package.json +1 -1
- package/umd/tinkiet.min.js +3 -3
package/drawer/drawer.js
CHANGED
package/package.json
CHANGED
package/umd/tinkiet.min.js
CHANGED
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
* Copyright 2017 Google LLC
|
|
29
29
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
30
|
*/
|
|
31
|
-
var y;b.finalized=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:b}),(null!==(d=globalThis.reactiveElementVersions)&&void 0!==d?d:globalThis.reactiveElementVersions=[]).push("1.3.
|
|
31
|
+
var y;b.finalized=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:b}),(null!==(d=globalThis.reactiveElementVersions)&&void 0!==d?d:globalThis.reactiveElementVersions=[]).push("1.3.1");const f=globalThis.trustedTypes,k=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,x=`lit$${(Math.random()+"").slice(9)}$`,w="?"+x,T=`<${w}>`,$=document,P=(t="")=>$.createComment(t),S=t=>null===t||"object"!=typeof t&&"function"!=typeof t,_=Array.isArray,E=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,z=/>/g,C=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,B=/'/g,M=/"/g,L=/^(?:script|style|textarea|title)$/i,I=(t=>(e,...r)=>({_$litType$:t,strings:e,values:r}))(1),D=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),N=new WeakMap,H=$.createTreeWalker($,129,null,!1),R=(t,e)=>{const r=t.length-1,i=[];let o,a=2===e?"<svg>":"",n=E;for(let e=0;e<r;e++){const r=t[e];let s,l,h=-1,d=0;for(;d<r.length&&(n.lastIndex=d,l=n.exec(r),null!==l);)d=n.lastIndex,n===E?"!--"===l[1]?n=A:void 0!==l[1]?n=z:void 0!==l[2]?(L.test(l[2])&&(o=RegExp("</"+l[2],"g")),n=C):void 0!==l[3]&&(n=C):n===C?">"===l[0]?(n=null!=o?o:E,h=-1):void 0===l[1]?h=-2:(h=n.lastIndex-l[2].length,s=l[1],n=void 0===l[3]?C:'"'===l[3]?M:B):n===M||n===B?n=C:n===A||n===z?n=E:(n=C,o=void 0);const c=n===C&&t[e+1].startsWith("/>")?" ":"";a+=n===E?r+T:h>=0?(i.push(s),r.slice(0,h)+"$lit$"+r.slice(h)+x+c):r+x+(-2===h?(i.push(void 0),e):c)}const s=a+(t[r]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==k?k.createHTML(s):s,i]};class q{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let o=0,a=0;const n=t.length-1,s=this.parts,[l,h]=R(t,e);if(this.el=q.createElement(l,r),H.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(i=H.nextNode())&&s.length<n;){if(1===i.nodeType){if(i.hasAttributes()){const t=[];for(const e of i.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(x)){const r=h[a++];if(t.push(e),void 0!==r){const t=i.getAttribute(r.toLowerCase()+"$lit$").split(x),e=/([.?@])?(.*)/.exec(r);s.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?F:"?"===e[1]?X:"@"===e[1]?K:V})}else s.push({type:6,index:o})}for(const e of t)i.removeAttribute(e)}if(L.test(i.tagName)){const t=i.textContent.split(x),e=t.length-1;if(e>0){i.textContent=f?f.emptyScript:"";for(let r=0;r<e;r++)i.append(t[r],P()),H.nextNode(),s.push({type:2,index:++o});i.append(t[e],P())}}}else if(8===i.nodeType)if(i.data===w)s.push({type:2,index:o});else{let t=-1;for(;-1!==(t=i.data.indexOf(x,t+1));)s.push({type:7,index:o}),t+=x.length-1}o++}}static createElement(t,e){const r=$.createElement("template");return r.innerHTML=t,r}}function G(t,e,r=t,i){var o,a,n,s;if(e===D)return e;let l=void 0!==i?null===(o=r._$Cl)||void 0===o?void 0:o[i]:r._$Cu;const h=S(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(a=null==l?void 0:l._$AO)||void 0===a||a.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,r,i)),void 0!==i?(null!==(n=(s=r)._$Cl)&&void 0!==n?n:s._$Cl=[])[i]=l:r._$Cu=l),void 0!==l&&(e=G(t,l._$AS(t,e.values),l,i)),e}class O{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:r},parts:i}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:$).importNode(r,!0);H.currentNode=o;let a=H.nextNode(),n=0,s=0,l=i[0];for(;void 0!==l;){if(n===l.index){let e;2===l.type?e=new j(a,a.nextSibling,this,t):1===l.type?e=new l.ctor(a,l.name,l.strings,this,t):6===l.type&&(e=new Q(a,this,t)),this.v.push(e),l=i[++s]}n!==(null==l?void 0:l.index)&&(a=H.nextNode(),n++)}return o}m(t){let e=0;for(const r of this.v)void 0!==r&&(void 0!==r.strings?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}class j{constructor(t,e,r,i){var o;this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cg=null===(o=null==i?void 0:i.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=G(this,t,e),S(t)?t===U||null==t||""===t?(this._$AH!==U&&this._$AR(),this._$AH=U):t!==this._$AH&&t!==D&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var e;return _(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==U&&S(this._$AH)?this._$AA.nextSibling.data=t:this.k($.createTextNode(t)),this._$AH=t}T(t){var e;const{values:r,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=q.createElement(i.h,this.options)),i);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(r);else{const t=new O(o,this),e=t.p(this.options);t.m(r),this.k(e),this._$AH=t}}_$AC(t){let e=N.get(t.strings);return void 0===e&&N.set(t.strings,e=new q(t)),e}S(t){_(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const o of t)i===e.length?e.push(r=new j(this.A(P()),this.A(P()),this,this.options)):r=e[i],r._$AI(o),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for(null===(r=this._$AP)||void 0===r||r.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class V{constructor(t,e,r,i,o){this.type=1,this._$AH=U,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=U}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,r,i){const o=this.strings;let a=!1;if(void 0===o)t=G(this,t,e,0),a=!S(t)||t!==this._$AH&&t!==D,a&&(this._$AH=t);else{const i=t;let n,s;for(t=o[0],n=0;n<o.length-1;n++)s=G(this,i[r+n],e,n),s===D&&(s=this._$AH[n]),a||(a=!S(s)||s!==this._$AH[n]),s===U?t=U:t!==U&&(t+=(null!=s?s:"")+o[n+1]),this._$AH[n]=s}a&&!i&&this.C(t)}C(t){t===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class F extends V{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===U?void 0:t}}const Y=f?f.emptyScript:"";class X extends V{constructor(){super(...arguments),this.type=4}C(t){t&&t!==U?this.element.setAttribute(this.name,Y):this.element.removeAttribute(this.name)}}class K extends V{constructor(t,e,r,i,o){super(t,e,r,i,o),this.type=5}_$AI(t,e=this){var r;if((t=null!==(r=G(this,t,e,0))&&void 0!==r?r:U)===D)return;const i=this._$AH,o=t===U&&i!==U||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==U&&(i===U||o);o&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,r;"function"==typeof this._$AH?this._$AH.call(null!==(r=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==r?r:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){G(this,t)}}const W=window.litHtmlPolyfillSupport;
|
|
32
32
|
/**
|
|
33
33
|
* @license
|
|
34
34
|
* Copyright 2017 Google LLC
|
|
35
35
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
36
36
|
*/
|
|
37
|
-
var Z,J;null==W||W(q,j),(null!==(y=globalThis.litHtmlVersions)&&void 0!==y?y:globalThis.litHtmlVersions=[]).push("2.2.
|
|
37
|
+
var Z,J;null==W||W(q,j),(null!==(y=globalThis.litHtmlVersions)&&void 0!==y?y:globalThis.litHtmlVersions=[]).push("2.2.1");class tt extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const r=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=r.firstChild),r}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,r)=>{var i,o;const a=null!==(i=null==r?void 0:r.renderBefore)&&void 0!==i?i:e;let n=a._$litPart$;if(void 0===n){const t=null!==(o=null==r?void 0:r.renderBefore)&&void 0!==o?o:null;a._$litPart$=n=new j(e.insertBefore(P(),t),t,void 0,null!=r?r:{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return D}}tt.finalized=!0,tt._$litElement$=!0,null===(Z=globalThis.litElementHydrateSupport)||void 0===Z||Z.call(globalThis,{LitElement:tt});const et=globalThis.litElementPolyfillSupport;null==et||et({LitElement:tt}),(null!==(J=globalThis.litElementVersions)&&void 0!==J?J:globalThis.litElementVersions=[]).push("3.2.0");
|
|
38
38
|
/**
|
|
39
39
|
* @license
|
|
40
40
|
* Copyright 2017 Google LLC
|
|
@@ -460,7 +460,7 @@ recognizeGestures(){this.lastRecognitionTimestamp=(new Date).getTime();for(let t
|
|
|
460
460
|
* useCapture defaults to false
|
|
461
461
|
*/parseEventsString(t){return t.trim().split(/\s+/g)}on(t,e){let r=this.parseEventsString(t);for(let t=0;t<r.length;t++){let i=r[t];i in this.eventHandlers||(this.eventHandlers[i]=[]),-1==this.eventHandlers[i].indexOf(e)&&this.eventHandlers[i].push(e),this.domElement.addEventListener(i,e,!1)}}off(t,e){let r=this.parseEventsString(t);for(let t=0;t<r.length;t++){let i=r[t];if(i in this.eventHandlers){let t=this.eventHandlers[i],r=t.indexOf(e);r>=0&&(t.splice(r,1),this.eventHandlers[i]=t),this.domElement.removeEventListener(i,e,!1)}}}destroy(){
|
|
462
462
|
// remove all EventListeners from self.domElement
|
|
463
|
-
for(let t in this.eventHandlers){let e=this.eventHandlers[t];for(let r=0;r<e.length;r++){let i=e[r];this.domElement.removeEventListener(t,i)}delete this.eventHandlers[t]}this.removePointerListeners(),this.removeTouchListeners()}}t.TkDrawer=class extends tt{constructor(){super(...arguments),this._open=!1,this.over=!1,this.right=!1,this.swipeable=!1}set open(t){const e=this._open;this._open=t,this.requestUpdate("open",e),this._open&&this.dispatchEvent(new Event("did-show")),this._open||this.dispatchEvent(new Event("did-close"))}get open(){return this._open}render(){return I`<div class="container fi"><slot name="drawer-container"></slot></div><div class="overlay" @click="${()=>this.open=!1}"></div><div class="drawer"><div class="drawer-header"><slot name="drawer-header"></slot></div><div class="drawer-content"><slot name="drawer-content"></slot></div><div class="drawer-footer"><slot name="drawer-footer"></slot></div></div>`}updated(t){if(t.has("overQuery")&&this.overMediaQuery(),t.has("openQuery")&&window.matchMedia(this.openQuery).matches&&this.show(),t.has("swipeable")&&this.swipeable){var e={supportedDirections:bt,bubbles:!1},r=new At(this.$drawer,e);this.pointerListener=new Lt(this.$drawer,{DEBUG:!0,DEBUG_CONTACT:!0,DEBUG_GESTURES:!0,
|
|
463
|
+
for(let t in this.eventHandlers){let e=this.eventHandlers[t];for(let r=0;r<e.length;r++){let i=e[r];this.domElement.removeEventListener(t,i)}delete this.eventHandlers[t]}this.removePointerListeners(),this.removeTouchListeners()}}t.TkDrawer=class extends tt{constructor(){super(...arguments),this._open=!1,this.over=!1,this.right=!1,this.swipeable=!1}set open(t){if(t===this._open)return;const e=this._open;this._open=t,this.requestUpdate("open",e),this._open&&this.dispatchEvent(new Event("did-show")),this._open||this.dispatchEvent(new Event("did-close"))}get open(){return this._open}render(){return I`<div class="container fi"><slot name="drawer-container"></slot></div><div class="overlay" @click="${()=>this.open=!1}"></div><div class="drawer"><div class="drawer-header"><slot name="drawer-header"></slot></div><div class="drawer-content"><slot name="drawer-content"></slot></div><div class="drawer-footer"><slot name="drawer-footer"></slot></div></div>`}updated(t){if(t.has("overQuery")&&this.overMediaQuery(),t.has("openQuery")&&window.matchMedia(this.openQuery).matches&&this.show(),t.has("swipeable")&&this.swipeable){var e={supportedDirections:bt,bubbles:!1},r=new At(this.$drawer,e);this.pointerListener=new Lt(this.$drawer,{DEBUG:!0,DEBUG_CONTACT:!0,DEBUG_GESTURES:!0,
|
|
464
464
|
// handleTouchEvents : false,
|
|
465
465
|
supportedGestures:[zt,r],bubbles:!1}),this.$drawer.addEventListener("tap",(t=>{const{x:e,y:r}=t.detail.live.srcEvent,i=this.shadowRoot?.elementFromPoint(e,r);i&&i.click()})),this.$drawer.addEventListener("panstart",(t=>{this.$drawer.style.transition="transform 0ms ease"})),this.$drawer.addEventListener("pan",(t=>{var e="translate3d("+(t.detail.global.deltaX>0?0:t.detail.global.deltaX)+"px, 0px, 0)";requestAnimationFrame((t=>{this.$drawer.style.transform=e}))})),this.$drawer.addEventListener("panend",(t=>{requestAnimationFrame((e=>{this.$drawer.style.transition="",this.$drawer.style.transform="",this.open=!(t.detail.global.deltaX<-50)}))}))}t.has("swipeable")&&!this.swipeable&&(this.pointerListener&&this.pointerListener.destroy(),this.pointerListener=null)}overMediaQuery(){this.mql&&this.mql.removeEventListener("change",this.overMediaQueryListener.bind(this)),this.mql=window.matchMedia(this.overQuery),this.mql.matches?this.setAttribute("over",""):this.removeAttribute("over"),this.mql.addEventListener("change",this.overMediaQueryListener.bind(this))}overMediaQueryListener(t){t.matches?this.setAttribute("over",""):this.removeAttribute("over")}hideIfOver(){(this.overQuery&&this.mql?.matches||this.over)&&(this.open=!1)}show(){this.open=!0}hide(){this.open=!1}toggle(){this.open=!this.open}},t.TkDrawer.styles=l`${s("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}:host{display:block;height:100%;overflow:hidden;position:relative;width:100%}.drawer{background-color:var(--background,#f7f7f7);color:var(--foreground,#454545);display:flex;flex-direction:column;height:100%;overflow:scroll;position:absolute;top:0;touch-action:pan-y;transform:translateX(-100%);transition:transform cubic-bezier(.4,0,.2,1) var(--transition-duration-medium,.18s);width:var(--drawer-width,256px);will-change:transform;z-index:var(--drawer-z-index,200)}.drawer .drawer-content{flex:1;overflow:scroll}:host([right]) .drawer{right:0;transform:translateX(100%)}.overlay{background-color:#00000080;bottom:0;display:none;left:0;position:absolute;right:0;top:0;z-index:var(--drawer-overlay-z-index,200)}.container{background-color:var(--background,#f7f7f7);height:100%;overflow:scroll;transition:padding cubic-bezier(.4,0,.2,1) var(--transition-duration-slow,.25s)}:host([open]) .drawer{transform:none}:host([open]) .container{padding-left:var(--drawer-width)}:host([open][over]) .container{padding-left:0}:host([open][over]) .overlay{display:block}@media (max-width:var(--drawer-trigger-width,400px)){:host([open]) .container{padding-left:0}:host([open]) .overlay{display:block}}")}`,e([ot({type:Boolean,reflect:!0}),r("design:type",Object),r("design:paramtypes",[Object])],t.TkDrawer.prototype,"open",null),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkDrawer.prototype,"over",void 0),e([ot({type:String,attribute:"open-query"}),r("design:type",String)],t.TkDrawer.prototype,"openQuery",void 0),e([ot({type:String,attribute:"over-query"}),r("design:type",String)],t.TkDrawer.prototype,"overQuery",void 0),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkDrawer.prototype,"right",void 0),e([ot({type:Boolean,reflect:!0}),r("design:type",Boolean)],t.TkDrawer.prototype,"swipeable",void 0),e([lt("div.drawer"),r("design:type",HTMLElement)],t.TkDrawer.prototype,"$drawer",void 0),t.TkDrawer=e([rt("tk-drawer")],t.TkDrawer);
|
|
466
466
|
/**
|