@oslokommune/punkt-elements 12.4.3 → 12.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/class-map-Ch54kkX5.cjs +5 -0
- package/dist/{class-map-CL_lSLwn.js → class-map-DunDFQn7.js} +8 -8
- package/dist/{directive-DA0-wdk7.js → directive-Cxhakbpr.js} +3 -3
- package/dist/{directive-19_ixLKS.cjs → directive-DtixNHDT.cjs} +1 -1
- package/dist/{index-DQ5xnGw6.js → index-BI6-RUqp.js} +110 -102
- package/dist/index-BNOnscrA.cjs +94 -0
- package/dist/index-Bpc07w_P.cjs +9 -0
- package/dist/{index-m5WP1NKD.js → index-CsTujnXs.js} +93 -93
- package/dist/index-CyqOyy_9.js +88 -0
- package/dist/{index-BUZITHLd.cjs → index-DSyh6tUw.cjs} +8 -8
- package/dist/index.d.ts +7 -8
- package/dist/pkt-alert.cjs +8 -8
- package/dist/pkt-alert.js +20 -20
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +5 -5
- package/dist/pkt-card.cjs +10 -10
- package/dist/pkt-card.js +7 -7
- package/dist/pkt-component-template.cjs +6 -6
- package/dist/pkt-component-template.js +14 -14
- package/dist/pkt-datepicker.cjs +48 -48
- package/dist/pkt-datepicker.js +33 -33
- package/dist/pkt-element.cjs +1 -1
- package/dist/pkt-element.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +3 -3
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +2 -2
- package/dist/pkt-input-wrapper.cjs +28 -28
- package/dist/pkt-input-wrapper.js +8 -8
- package/dist/pkt-link.cjs +4 -4
- package/dist/pkt-link.js +9 -9
- package/dist/pkt-messagebox.cjs +6 -6
- package/dist/pkt-messagebox.js +7 -7
- package/dist/pkt-tag.cjs +8 -8
- package/dist/pkt-tag.js +11 -11
- package/dist/{ref-bNNrgsqL.js → ref-By_W8A-f.js} +41 -41
- package/dist/ref-C3InMDfU.cjs +13 -0
- package/package.json +3 -3
- package/src/components/calendar/index.ts +69 -45
- package/src/components/datepicker/index.ts +1 -0
- package/src/components/icon/index.ts +16 -12
- package/dist/class-map-BQ5k1q3A.cjs +0 -5
- package/dist/index-BFqUD8HI.cjs +0 -9
- package/dist/index-Bc9mksHI.cjs +0 -90
- package/dist/index-exzYRW0z.js +0 -82
- package/dist/ref-BdbjJbqo.cjs +0 -13
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const I=globalThis,W=I.ShadowRoot&&(I.ShadyCSS===void 0||I.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ct=Symbol(),Y=new WeakMap;let Et=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ct)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(W&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=Y.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Y.set(e,t))}return t}toString(){return this.cssText}};const St=r=>new Et(typeof r=="string"?r:r+"",void 0,ct),wt=(r,t)=>{if(W)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),i=I.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},tt=W?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return St(e)})(r):r;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:Ut,defineProperty:
|
|
9
|
+
*/const{is:Ut,defineProperty:Ct,getOwnPropertyDescriptor:xt,getOwnPropertyNames:Pt,getOwnPropertySymbols:Tt,getPrototypeOf:Mt}=Object,A=globalThis,et=A.trustedTypes,Ot=et?et.emptyScript:"",q=A.reactiveElementPolyfillSupport,T=(r,t)=>r,D={toAttribute(r,t){switch(t){case Boolean:r=r?Ot:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},Z=(r,t)=>!Ut(r,t),st={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:Z};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),A.litPropertyMetadata??(A.litPropertyMetadata=new WeakMap);class C extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=st){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Ct(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=xt(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return i==null?void 0:i.call(this)},set(n){const h=i==null?void 0:i.call(this);o.call(this,n),this.requestUpdate(t,h,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??st}static _$Ei(){if(this.hasOwnProperty(T("elementProperties")))return;const t=Mt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(T("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(T("properties"))){const e=this.properties,s=[...Pt(e),...Tt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const i of s)e.unshift(tt(i))}else t!==void 0&&e.push(tt(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return wt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){var o;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const n=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:D).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const n=s.getPropertyOptions(i),h=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:D;this._$Em=i,this[i]=h.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??Z)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,n]of i)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[T("elementProperties")]=new Map,C[T("finalized")]=new Map,q==null||q({ReactiveElement:C}),(A.reactiveElementVersions??(A.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const M=globalThis,
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,at=/"/g,ut=/^(?:script|style|textarea|title)$/i,
|
|
13
|
+
*/const M=globalThis,F=M.trustedTypes,it=F?F.createPolicy("lit-html",{createHTML:r=>r}):void 0,K="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,G="?"+_,Rt=`<${G}>`,S=document,R=()=>S.createComment(""),H=r=>r===null||typeof r!="object"&&typeof r!="function",Q=Array.isArray,pt=r=>Q(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",B=`[
|
|
14
|
+
\f\r]`,P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,rt=/-->/g,nt=/>/g,b=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,at=/"/g,ut=/^(?:script|style|textarea|title)$/i,Ht=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Nt=Ht(1),w=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),ht=new WeakMap,E=S.createTreeWalker(S,129);function gt(r,t){if(!Q(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return it!==void 0?it.createHTML(t):t}const mt=(r,t)=>{const e=r.length-1,s=[];let i,o=t===2?"<svg>":t===3?"<math>":"",n=P;for(let h=0;h<e;h++){const a=r[h];let p,f,l=-1,$=0;for(;$<a.length&&(n.lastIndex=$,f=n.exec(a),f!==null);)$=n.lastIndex,n===P?f[1]==="!--"?n=rt:f[1]!==void 0?n=nt:f[2]!==void 0?(ut.test(f[2])&&(i=RegExp("</"+f[2],"g")),n=b):f[3]!==void 0&&(n=b):n===b?f[0]===">"?(n=i??P,l=-1):f[1]===void 0?l=-2:(l=n.lastIndex-f[2].length,p=f[1],n=f[3]===void 0?b:f[3]==='"'?at:ot):n===at||n===ot?n=b:n===rt||n===nt?n=P:(n=b,i=void 0);const v=n===b&&r[h+1].startsWith("/>")?" ":"";o+=n===P?a+Rt:l>=0?(s.push(p),a.slice(0,l)+K+a.slice(l)+_+v):a+_+(l===-2?h:v)}return[gt(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0;const h=t.length-1,a=this.parts,[p,f]=mt(t,e);if(this.el=N.createElement(p,s),E.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=E.nextNode())!==null&&a.length<h;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(K)){const $=f[n++],v=i.getAttribute(l).split(_),V=/([.?@])?(.*)/.exec($);a.push({type:1,index:o,name:V[2],strings:v,ctor:V[1]==="."?yt:V[1]==="?"?$t:V[1]==="@"?_t:k}),i.removeAttribute(l)}else l.startsWith(_)&&(a.push({type:6,index:o}),i.removeAttribute(l));if(ut.test(i.tagName)){const l=i.textContent.split(_),$=l.length-1;if($>0){i.textContent=F?F.emptyScript:"";for(let v=0;v<$;v++)i.append(l[v],R()),E.nextNode(),a.push({type:2,index:++o});i.append(l[$],R())}}}else if(i.nodeType===8)if(i.data===G)a.push({type:2,index:o});else{let l=-1;for(;(l=i.data.indexOf(_,l+1))!==-1;)a.push({type:7,index:o}),l+=_.length-1}o++}}static createElement(t,e){const s=S.createElement("template");return s.innerHTML=t,s}}function U(r,t,e=r,s){var n,h;if(t===w)return t;let i=s!==void 0?(n=e._$Co)==null?void 0:n[s]:e._$Cl;const o=H(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((h=i==null?void 0:i._$AO)==null||h.call(i,!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=U(r,i._$AS(r,t.values),i,s)),t}class ft{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((t==null?void 0:t.creationScope)??S).importNode(e,!0);E.currentNode=i;let o=E.nextNode(),n=0,h=0,a=s[0];for(;a!==void 0;){if(n===a.index){let p;a.type===2?p=new x(o,o.nextSibling,this,t):a.type===1?p=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(p=new vt(o,this,t)),this._$AV.push(p),a=s[++h]}n!==(a==null?void 0:a.index)&&(o=E.nextNode(),n++)}return E.currentNode=S,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class x{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=U(this,t,e),H(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==w&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):pt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==d&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(gt(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const n=new ft(i,this),h=n.u(this.options);n.p(e),this.T(h),this._$AH=n}}_$AC(t){let e=ht.get(t.strings);return e===void 0&&ht.set(t.strings,e=new N(t)),e}k(t){Q(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new x(this.O(R()),this.O(R()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,i){const o=this.strings;let n=!1;if(o===void 0)t=U(this,t,e,0),n=!H(t)||t!==this._$AH&&t!==w,n&&(this._$AH=t);else{const h=t;let a,p;for(t=o[0],a=0;a<o.length-1;a++)p=U(this,h[s+a],e,a),p===w&&(p=this._$AH[a]),n||(n=!H(p)||p!==this._$AH[a]),p===d?t=d:t!==d&&(t+=(p??"")+o[a+1]),this._$AH[a]=p}n&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class yt extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class $t extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class _t extends k{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=U(this,t,e,0)??d)===w)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class vt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){U(this,t)}}const kt={M:K,P:_,A:G,C:1,L:mt,R:ft,D:pt,V:U,I:x,H:k,N:$t,U:_t,B:yt,F:vt},j=M.litHtmlPolyfillSupport;j==null||j(N,x),(M.litHtmlVersions??(M.litHtmlVersions=[])).push("3.2.1");const Vt=(r,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new x(t.insertBefore(R(),o),o,void 0,e??{})}return i._$AI(r),i};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/
|
|
19
|
+
*/let O=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Vt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return w}};var dt;O._$litElement$=!0,O.finalized=!0,(dt=globalThis.litElementHydrateSupport)==null||dt.call(globalThis,{LitElement:O});const z=globalThis.litElementPolyfillSupport;z==null||z({LitElement:O});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const Lt={attribute:!0,type:String,converter:D,reflect:!1,hasChanged:Z},It=(r=Lt,t,e)=>{const{kind:s,metadata:i}=e;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(e.name,r),s==="accessor"){const{name:n}=e;return{set(h){const a=t.get.call(this);t.set.call(this,h),this.requestUpdate(n,a,r)},init(h){return h!==void 0&&this.P(n,void 0,r),h}}}if(s==="setter"){const{name:n}=e;return function(h){const a=this[n];t.call(this,h),this.requestUpdate(n,a,r)}}throw Error("Unsupported decorator location: "+s)};function c(r){return(t,e)=>typeof e=="object"?It(r,t,e):((s,i,o)=>{const n=i.hasOwnProperty(o);return i.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(i,o):void 0})(r,t,e)}/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/function At(r){return c({...r,state:!0,attribute:!1})}var m=[];for(var J=0;J<256;++J)m.push((J+256).toString(16).slice(1));function
|
|
27
|
+
*/function At(r){return c({...r,state:!0,attribute:!1})}var m=[];for(var J=0;J<256;++J)m.push((J+256).toString(16).slice(1));function Dt(r,t=0){return(m[r[t+0]]+m[r[t+1]]+m[r[t+2]]+m[r[t+3]]+"-"+m[r[t+4]]+m[r[t+5]]+"-"+m[r[t+6]]+m[r[t+7]]+"-"+m[r[t+8]]+m[r[t+9]]+"-"+m[r[t+10]]+m[r[t+11]]+m[r[t+12]]+m[r[t+13]]+m[r[t+14]]+m[r[t+15]]).toLowerCase()}var L,Ft=new Uint8Array(16);function qt(){if(!L&&(L=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!L))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L(Ft)}var Bt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const lt={randomUUID:Bt};function bt(r,t,e){if(lt.randomUUID&&!t&&!r)return lt.randomUUID();r=r||{};var s=r.random||(r.rng||qt)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Dt(s)}const jt={hi:"Hei!"},zt={buttonAltText:"Åpne kalender"},Jt={days:["Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag","Søndag"],daysShort:["Man","Tir","Ons","Tor","Fre","Lør","Søn"],months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Des"],week:"Uke",prevMonth:"Forrige måned",nextMonth:"Neste måned"},Wt={labels:{optional:"Valgfritt",required:"Må fylles ut"},messages:{required:"Dette feltet er påkrevd",invalid:"Ugyldig verdi",invalidPattern:"Ugyldig format",tooShort:"For kort",tooLong:"For lang",rangeUnderflow:"For lav verdi",rangeOverflow:"For høy verdi",dateUnderflow:"For tidlig dato",dateOverflow:"For sen dato"},date:{multiple:"Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato."}},y={example:jt,calendar:zt,dates:Jt,forms:Wt};var Zt=Object.defineProperty,u=(r,t,e,s)=>{for(var i=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(i=n(t,e,i)||i);return i&&Zt(t,e,i),i};class X extends O{constructor(){super(),this.strings=y}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}}u([c({type:Object})],X.prototype,"strings");class g extends X{constructor(){super(),this.id=bt(),this.name=this.id,this.required=!1,this.disabled=!1,this.placeholder="",this.min=null,this.max=null,this.minlength=0,this.maxlength=0,this.pattern="",this.optionalTag=!1,this.optionalText=y.forms.labels.optional,this.requiredTag=!1,this.requiredText=y.forms.labels.required,this.hasError=!1,this.errorMessage="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){this.required&&!this.value?this.internals.setValidity({valueMissing:!0},y.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},y.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},y.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},y.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},y.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},y.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},y.forms.messages.rangeOverflow,t):t.validity.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(t){if(this.internals)if(Array.isArray(t)){const e=new FormData;t.forEach(s=>{e.append(this.name,s)}),this.internals.setFormValue(e)}else this.internals.setFormValue(t)}valueChanged(t,e){typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=t,this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&e&&e.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(e==null?void 0:e.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate())}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRef2&&this.manageValidity(this.inputRef2.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}firstUpdated(t){super.firstUpdated(t),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.disabled=!0,this.internals.ariaDisabled=!0),this.internals.setFormValue(this.value),this.manageValidity(this.inputRef.value)}}u([c({type:String,reflect:!0})],g.prototype,"id");u([c({type:String,reflect:!0})],g.prototype,"name");u([c({type:Boolean,reflect:!0})],g.prototype,"required");u([c({type:Boolean,reflect:!0})],g.prototype,"disabled");u([c({type:String,reflect:!0})],g.prototype,"placeholder");u([c({type:Number,reflect:!0})],g.prototype,"min");u([c({type:Number,reflect:!0})],g.prototype,"max");u([c({type:Number,reflect:!0})],g.prototype,"minlength");u([c({type:Number,reflect:!0})],g.prototype,"maxlength");u([c({type:String,reflect:!0})],g.prototype,"pattern");u([c({type:Boolean,reflect:!0})],g.prototype,"optionalTag");u([c({type:String,reflect:!0})],g.prototype,"optionalText");u([c({type:Boolean,reflect:!0})],g.prototype,"requiredTag");u([c({type:String,reflect:!0})],g.prototype,"requiredText");u([c({type:Boolean,reflect:!0})],g.prototype,"hasError");u([c({type:String,reflect:!0})],g.prototype,"errorMessage");u([At()],g.prototype,"touched");exports.E=d;exports.PktElement=X;exports.PktInputElement=g;exports.T=w;exports.Z=kt;exports.n=c;exports.r=At;exports.translations=y;exports.v4=bt;exports.x=Nt;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { PropertyValues } from 'lit';
|
|
|
4
4
|
import { ReactiveController } from 'lit';
|
|
5
5
|
import { ReactiveControllerHost } from 'lit';
|
|
6
6
|
import { Ref } from 'lit/directives/ref.js';
|
|
7
|
-
import { StaticValue } from 'lit/static
|
|
8
|
-
import { TemplateResult } from 'lit';
|
|
7
|
+
import { StaticValue } from 'lit-html/static';
|
|
8
|
+
import { TemplateResult } from 'lit-html';
|
|
9
9
|
|
|
10
10
|
declare type ICardSkin = 'outlined' | 'gray' | 'beige' | 'green' | 'blue';
|
|
11
11
|
|
|
@@ -36,10 +36,6 @@ export declare class PktCalendar extends PktElement {
|
|
|
36
36
|
excludedates: Date[];
|
|
37
37
|
excludeweekdays: string[];
|
|
38
38
|
currentmonth: Date | null;
|
|
39
|
-
/**
|
|
40
|
-
* If we are initializing props, slots and events from specs, we should do it in the constructor
|
|
41
|
-
*/
|
|
42
|
-
constructor();
|
|
43
39
|
/**
|
|
44
40
|
* Strings
|
|
45
41
|
*/
|
|
@@ -60,6 +56,7 @@ export declare class PktCalendar extends PktElement {
|
|
|
60
56
|
private focusedDate;
|
|
61
57
|
private selectableDates;
|
|
62
58
|
private currentmonthtouched;
|
|
59
|
+
private tabIndexSet;
|
|
63
60
|
/**
|
|
64
61
|
* Runs on mount, used to set up various values and whatever you need to run
|
|
65
62
|
*/
|
|
@@ -67,6 +64,7 @@ export declare class PktCalendar extends PktElement {
|
|
|
67
64
|
disconnectedCallback(): void;
|
|
68
65
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
69
66
|
updated(changedProperties: PropertyValues): void;
|
|
67
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
70
68
|
convertSelected(): void;
|
|
71
69
|
setCurrentMonth(): void;
|
|
72
70
|
handleKeydown(e: KeyboardEvent): void;
|
|
@@ -260,13 +258,14 @@ declare class PktElement extends LitElement {
|
|
|
260
258
|
}
|
|
261
259
|
|
|
262
260
|
export declare class PktIcon extends PktElement {
|
|
263
|
-
constructor();
|
|
264
|
-
protected willUpdate(_changedProperties: PropertyValues): void;
|
|
265
261
|
path: string | undefined;
|
|
266
262
|
name: string;
|
|
267
263
|
private icon;
|
|
268
264
|
private _updatedProps;
|
|
265
|
+
connectedCallback(): void;
|
|
269
266
|
attributeChangedCallback(name: string, _old: string | null, value: string | null): Promise<void>;
|
|
267
|
+
protected updated(_changedProperties: PropertyValues): Promise<void>;
|
|
268
|
+
protected getIcon(name?: string): Promise<void>;
|
|
270
269
|
render(): TemplateResult<1>;
|
|
271
270
|
}
|
|
272
271
|
|
package/dist/pkt-alert.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
2
|
-
<div class=${c.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DSyh6tUw.cjs"),p=require("./ref-C3InMDfU.cjs"),c=require("./class-map-Ch54kkX5.cjs"),k=require("./directive-DtixNHDT.cjs");require("./index-Bpc07w_P.cjs");var h=Object.defineProperty,u=Object.getOwnPropertyDescriptor,e=(s,r,o,i)=>{for(var l=i>1?void 0:i?u(r,o):r,a=s.length-1,n;a>=0;a--)(n=s[a])&&(l=(i?n(r,o,l):n(l))||l);return i&&l&&h(r,o,l),l};exports.PktAlert=class extends t.PktElement{constructor(){super(),this.defaultSlot=p.e(),this.closable=!1,this.compact=!1,this.title="",this.skin="info",this.isDisplayed=!0,this.ariaLive="polite",this.closeAlert=!1,this.date="",this.slotController=new p.PktSlotController(this,this.defaultSlot)}handleClose(){this.isDisplayed=!1,this.onClose&&this.onClose()}render(){const r={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-alert--closable":this.closable};return this.isDisplayed?t.x`
|
|
2
|
+
<div class=${c.e(r)} aria-live=${this.ariaLive}>
|
|
3
3
|
<pkt-icon
|
|
4
4
|
class="pkt-alert__icon"
|
|
5
5
|
name=${this.skin==="info"?"alert-information":`alert-${this.skin}`}
|
|
6
6
|
></pkt-icon>
|
|
7
7
|
|
|
8
|
-
${this.closable?t.
|
|
8
|
+
${this.closable?t.x`
|
|
9
9
|
<div class="pkt-alert__close">
|
|
10
10
|
<button
|
|
11
11
|
type="button"
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
<pkt-icon name="close" class="pkt-btn__icon" aria-hidden="true"></pkt-icon>
|
|
18
18
|
</button>
|
|
19
19
|
</div>
|
|
20
|
-
`:t.
|
|
21
|
-
${this.title?t.
|
|
20
|
+
`:t.E}
|
|
21
|
+
${this.title?t.x`<div class="pkt-alert__title">${this.title}</div>`:t.E}
|
|
22
22
|
|
|
23
|
-
<div class="pkt-alert__text" ${p.
|
|
23
|
+
<div class="pkt-alert__text" ${p.n(this.defaultSlot)}></div>
|
|
24
24
|
|
|
25
|
-
${this.date?t.
|
|
25
|
+
${this.date?t.x`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:t.E}
|
|
26
26
|
</div>
|
|
27
|
-
`:t.
|
|
27
|
+
`:t.E}};e([t.n({type:Boolean,reflect:!0})],exports.PktAlert.prototype,"closable",2);e([t.n({type:Boolean,reflect:!0})],exports.PktAlert.prototype,"compact",2);e([t.n({type:String,reflect:!0})],exports.PktAlert.prototype,"title",2);e([t.n({type:String,reflect:!0})],exports.PktAlert.prototype,"skin",2);e([t.n({type:Boolean,reflect:!0})],exports.PktAlert.prototype,"isDisplayed",2);e([t.n({type:Function,reflect:!0})],exports.PktAlert.prototype,"onClose",2);e([t.n({type:String,reflect:!0})],exports.PktAlert.prototype,"ariaLive",2);e([t.n({type:Boolean,reflect:!0})],exports.PktAlert.prototype,"closeAlert",2);e([t.n({type:String,reflect:!0})],exports.PktAlert.prototype,"date",2);exports.PktAlert=e([k.t("pkt-alert")],exports.PktAlert);
|
package/dist/pkt-alert.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { P as f,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as v } from "./directive-
|
|
5
|
-
import "./index-
|
|
1
|
+
import { P as f, E as a, x as p, n as s } from "./index-CsTujnXs.js";
|
|
2
|
+
import { e as d, P as u, n as y } from "./ref-By_W8A-f.js";
|
|
3
|
+
import { e as k } from "./class-map-DunDFQn7.js";
|
|
4
|
+
import { t as v } from "./directive-Cxhakbpr.js";
|
|
5
|
+
import "./index-CyqOyy_9.js";
|
|
6
6
|
var m = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, e = (l, r, n, o) => {
|
|
7
|
-
for (var
|
|
8
|
-
(h = l[c]) && (
|
|
9
|
-
return o &&
|
|
7
|
+
for (var i = o > 1 ? void 0 : o ? _(r, n) : r, c = l.length - 1, h; c >= 0; c--)
|
|
8
|
+
(h = l[c]) && (i = (o ? h(r, n, i) : h(i)) || i);
|
|
9
|
+
return o && i && m(r, n, i), i;
|
|
10
10
|
};
|
|
11
11
|
let t = class extends f {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(), this.defaultSlot = d(), this.closable = !1, this.compact = !1, this.title = "", this.skin = "info", this.isDisplayed = !0, this.ariaLive = "polite", this.closeAlert = !1, this.date = "", this.slotController = new
|
|
13
|
+
super(), this.defaultSlot = d(), this.closable = !1, this.compact = !1, this.title = "", this.skin = "info", this.isDisplayed = !0, this.ariaLive = "polite", this.closeAlert = !1, this.date = "", this.slotController = new u(this, this.defaultSlot);
|
|
14
14
|
}
|
|
15
15
|
handleClose() {
|
|
16
16
|
this.isDisplayed = !1, this.onClose && this.onClose();
|
|
@@ -23,7 +23,7 @@ let t = class extends f {
|
|
|
23
23
|
"pkt-alert--closable": this.closable
|
|
24
24
|
};
|
|
25
25
|
return this.isDisplayed ? p`
|
|
26
|
-
<div class=${
|
|
26
|
+
<div class=${k(l)} aria-live=${this.ariaLive}>
|
|
27
27
|
<pkt-icon
|
|
28
28
|
class="pkt-alert__icon"
|
|
29
29
|
name=${this.skin === "info" ? "alert-information" : `alert-${this.skin}`}
|
|
@@ -44,7 +44,7 @@ let t = class extends f {
|
|
|
44
44
|
` : a}
|
|
45
45
|
${this.title ? p`<div class="pkt-alert__title">${this.title}</div>` : a}
|
|
46
46
|
|
|
47
|
-
<div class="pkt-alert__text" ${
|
|
47
|
+
<div class="pkt-alert__text" ${y(this.defaultSlot)}></div>
|
|
48
48
|
|
|
49
49
|
${this.date ? p`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>` : a}
|
|
50
50
|
</div>
|
|
@@ -52,31 +52,31 @@ let t = class extends f {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
e([
|
|
55
|
-
|
|
55
|
+
s({ type: Boolean, reflect: !0 })
|
|
56
56
|
], t.prototype, "closable", 2);
|
|
57
57
|
e([
|
|
58
|
-
|
|
58
|
+
s({ type: Boolean, reflect: !0 })
|
|
59
59
|
], t.prototype, "compact", 2);
|
|
60
60
|
e([
|
|
61
|
-
|
|
61
|
+
s({ type: String, reflect: !0 })
|
|
62
62
|
], t.prototype, "title", 2);
|
|
63
63
|
e([
|
|
64
|
-
|
|
64
|
+
s({ type: String, reflect: !0 })
|
|
65
65
|
], t.prototype, "skin", 2);
|
|
66
66
|
e([
|
|
67
|
-
|
|
67
|
+
s({ type: Boolean, reflect: !0 })
|
|
68
68
|
], t.prototype, "isDisplayed", 2);
|
|
69
69
|
e([
|
|
70
|
-
|
|
70
|
+
s({ type: Function, reflect: !0 })
|
|
71
71
|
], t.prototype, "onClose", 2);
|
|
72
72
|
e([
|
|
73
|
-
|
|
73
|
+
s({ type: String, reflect: !0 })
|
|
74
74
|
], t.prototype, "ariaLive", 2);
|
|
75
75
|
e([
|
|
76
|
-
|
|
76
|
+
s({ type: Boolean, reflect: !0 })
|
|
77
77
|
], t.prototype, "closeAlert", 2);
|
|
78
78
|
e([
|
|
79
|
-
|
|
79
|
+
s({ type: String, reflect: !0 })
|
|
80
80
|
], t.prototype, "date", 2);
|
|
81
81
|
t = e([
|
|
82
82
|
v("pkt-alert")
|
package/dist/pkt-calendar.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-DSyh6tUw.cjs");require("./converters-DhM11VlY.cjs");require("./directive-DtixNHDT.cjs");require("./class-map-Ch54kkX5.cjs");const e=require("./index-BNOnscrA.cjs");require("./index-Bpc07w_P.cjs");Object.defineProperty(exports,"PktCalendar",{enumerable:!0,get:()=>e.PktCalendar});
|
package/dist/pkt-calendar.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-CsTujnXs.js";
|
|
2
2
|
import "./converters-DNCwIFwr.js";
|
|
3
|
-
import "./directive-
|
|
4
|
-
import "./class-map-
|
|
5
|
-
import { P as e } from "./index-
|
|
6
|
-
import "./index-
|
|
3
|
+
import "./directive-Cxhakbpr.js";
|
|
4
|
+
import "./class-map-DunDFQn7.js";
|
|
5
|
+
import { P as e } from "./index-BI6-RUqp.js";
|
|
6
|
+
import "./index-CyqOyy_9.js";
|
|
7
7
|
export {
|
|
8
8
|
e as PktCalendar
|
|
9
9
|
};
|
package/dist/pkt-card.cjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-
|
|
2
|
-
<div class=${c.
|
|
3
|
-
${this.image.src&&t.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DSyh6tUw.cjs"),d=require("./ref-C3InMDfU.cjs"),c=require("./class-map-Ch54kkX5.cjs"),g=require("./directive-DtixNHDT.cjs");require("./index-Bpc07w_P.cjs");require("./pkt-tag.cjs");const k="pkt-card",u=!0,h={heading:{type:"string",name:"Heading",description:"Tittel på kortet"},subheading:{type:"string",name:"Subheading",description:"Undertittel på kortet"},tags:{type:"IPktTag[]",description:"Liste av tags på kortet. Tar inn en array med IPktTag-objekter med følgende stringproperties: skin, iconName, ariaLabel, text",name:"Tags",items:{type:"object",properties:{skin:{type:["blue","green","red","yellow"],description:"Farge på tag"},iconName:{type:"string",description:"Id på ikonet du ønsker å bruke til tag"},ariaLabel:{type:"string",description:"Tekst for aria-label"},text:{type:"string",description:"Tekst på tag"}},required:["text"]}},skin:{type:["outlined","gray","blue","beige","green"],name:"Skin",description:"Farge på kortet",default:"outlined"},direction:{type:["landscape","portrait"],name:"Direction",description:"Retningen innholdet skal ligge i forhold til kortet",default:"portrait"},image:{type:"object",image:"Image",description:"Bilde på kortet. Tar inn et objekt av typen {src: string, alt: string}. src er stien til bildet, og alt er tekst for aria-label.",items:{type:"object",properties:{src:{type:"string",description:"Bilde på kortet"},alt:{type:"string",description:"Tekst for aria-label"}},required:["src","alt"]}}},m={default:{description:"Innholdet i kortet"}},l={name:k,"css-class":"pkt-card",isElement:u,props:h,slots:m};var y=Object.defineProperty,b=Object.getOwnPropertyDescriptor,r=(n,i,s,a)=>{for(var e=a>1?void 0:a?b(i,s):i,o=n.length-1,p;o>=0;o--)(p=n[o])&&(e=(a?p(i,s,e):p(e))||e);return a&&e&&y(i,s,e),e};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=d.e(),this.skin=l.props.skin.default,this.direction=l.props.direction.default,this.image={src:"",alt:""},this.heading="",this.subheading="",this.tags=[],this.slotController=new d.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){const i={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.direction}`]:this.direction};return t.x`
|
|
2
|
+
<div class=${c.e(i)}>
|
|
3
|
+
${this.image.src&&t.x`
|
|
4
4
|
<div class="pkt-card__image">
|
|
5
5
|
<img src=${this.image.src} alt=${this.image.alt||""} />
|
|
6
6
|
</div>
|
|
7
7
|
`}
|
|
8
8
|
<div class="pkt-card__wrapper">
|
|
9
|
-
${this.tags.length>0?t.
|
|
9
|
+
${this.tags.length>0?t.x`
|
|
10
10
|
<div class="pkt-card__tags">
|
|
11
|
-
${this.tags.map(s=>t.
|
|
11
|
+
${this.tags.map(s=>t.x`
|
|
12
12
|
<pkt-tag textStyle="normal-text" size="medium" skin=${s.skin}>
|
|
13
13
|
${s.text}
|
|
14
14
|
</pkt-tag>
|
|
15
15
|
`)}
|
|
16
16
|
</div>
|
|
17
|
-
`:t.
|
|
18
|
-
${this.heading&&t.
|
|
19
|
-
${this.subheading&&t.
|
|
20
|
-
${this.defaultSlot&&t.
|
|
17
|
+
`:t.E}
|
|
18
|
+
${this.heading&&t.x`<h3 class="pkt-txt-30-medium">${this.heading}</h3>`}
|
|
19
|
+
${this.subheading&&t.x`<p class="pkt-txt-20-light">${this.subheading}</p>`}
|
|
20
|
+
${this.defaultSlot&&t.x`<div class="pkt-card__content" ${d.n(this.defaultSlot)}></div>`}
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
23
|
-
`}};
|
|
23
|
+
`}};r([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"skin",2);r([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"direction",2);r([t.n({type:Object,reflect:!0})],exports.PktCard.prototype,"image",2);r([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"heading",2);r([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"subheading",2);r([t.n({type:Array,reflect:!0})],exports.PktCard.prototype,"tags",2);exports.PktCard=r([g.t("pkt-card")],exports.PktCard);
|
package/dist/pkt-card.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as g,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as f } from "./directive-
|
|
5
|
-
import "./index-
|
|
1
|
+
import { P as g, x as r, E as k, n as a } from "./index-CsTujnXs.js";
|
|
2
|
+
import { e as h, P as m, n as u } from "./ref-By_W8A-f.js";
|
|
3
|
+
import { e as y } from "./class-map-DunDFQn7.js";
|
|
4
|
+
import { t as f } from "./directive-Cxhakbpr.js";
|
|
5
|
+
import "./index-CyqOyy_9.js";
|
|
6
6
|
import "./pkt-tag.js";
|
|
7
7
|
const b = "pkt-card", v = !0, $ = {
|
|
8
8
|
heading: {
|
|
@@ -103,8 +103,8 @@ const b = "pkt-card", v = !0, $ = {
|
|
|
103
103
|
props: $,
|
|
104
104
|
slots: _
|
|
105
105
|
};
|
|
106
|
-
var S = Object.defineProperty,
|
|
107
|
-
for (var i = p > 1 ? void 0 : p ?
|
|
106
|
+
var S = Object.defineProperty, x = Object.getOwnPropertyDescriptor, s = (n, e, o, p) => {
|
|
107
|
+
for (var i = p > 1 ? void 0 : p ? x(e, o) : e, l = n.length - 1, d; l >= 0; l--)
|
|
108
108
|
(d = n[l]) && (i = (p ? d(e, o, i) : d(i)) || i);
|
|
109
109
|
return p && i && S(e, o, i), i;
|
|
110
110
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
2
|
-
<div class="${d.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DSyh6tUw.cjs"),h=require("./directive-DtixNHDT.cjs"),r=require("./ref-C3InMDfU.cjs"),d=require("./class-map-Ch54kkX5.cjs"),c=require("./converters-DhM11VlY.cjs");var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,o=(l,t,s,i)=>{for(var n=i>1?void 0:i?m(t,s):t,a=l.length-1,p;a>=0;a--)(p=l[a])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&u(t,s,n),n};exports.PktComponent=class extends e.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=r.e(),this.namedSlot=r.e(),this.slotController=new r.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(t=>{this._list.push(t.toUpperCase())}),super.connectedCallback()}render(){const t={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return e.x`
|
|
2
|
+
<div class="${d.e(t)}">
|
|
3
3
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
4
4
|
|
|
5
5
|
<h2 class="pkt-txt-22">Innhold fra attributter og funksjoner</h2>
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
<div>${this.renderList(this.doStuff(this._list))}</div>
|
|
8
8
|
|
|
9
9
|
<h2 class="pkt-txt-22">Slot</h2>
|
|
10
|
-
<div ${r.
|
|
10
|
+
<div ${r.n(this.defaultSlot)}>defaultSlotRef</div>
|
|
11
11
|
<h2 class="pkt-txt-22">Named slot</h2>
|
|
12
12
|
<select
|
|
13
13
|
name="named-slot"
|
|
14
|
-
${r.
|
|
14
|
+
${r.n(this.namedSlot)}
|
|
15
15
|
@change=${s=>alert(s.target.value)}
|
|
16
16
|
>
|
|
17
17
|
namedSlotRef
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
Si ${e.translations.example.hi}
|
|
23
23
|
</button>
|
|
24
24
|
</div>
|
|
25
|
-
`}renderList(t){return e.
|
|
25
|
+
`}renderList(t){return e.x`
|
|
26
26
|
<ul>
|
|
27
|
-
${t.map(s=>e.
|
|
27
|
+
${t.map(s=>e.x`<li>${s}</li>`)}
|
|
28
28
|
</ul>
|
|
29
29
|
`}doStuff(t){return t.reverse()}handleGreeting(){this.dispatchEvent(new CustomEvent("pkt-greeting",{detail:"Hei på deg!"}))}};o([e.n({type:String})],exports.PktComponent.prototype,"string",2);o([e.n({converter:c.csvToArray})],exports.PktComponent.prototype,"strings",2);o([e.n({type:Boolean})],exports.PktComponent.prototype,"darkmode",2);o([e.n({type:Array})],exports.PktComponent.prototype,"_list",2);exports.PktComponent=o([h.t("pkt-component")],exports.PktComponent);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { P as m,
|
|
2
|
-
import { t as f } from "./directive-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { P as m, x as h, t as u, n as i } from "./index-CsTujnXs.js";
|
|
2
|
+
import { t as f } from "./directive-Cxhakbpr.js";
|
|
3
|
+
import { e as d, P as v, n as c } from "./ref-By_W8A-f.js";
|
|
4
|
+
import { e as g } from "./class-map-DunDFQn7.js";
|
|
5
5
|
import { c as k } from "./converters-DNCwIFwr.js";
|
|
6
|
-
var S = Object.defineProperty, $ = Object.getOwnPropertyDescriptor,
|
|
6
|
+
var S = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, n = (t, e, l, o) => {
|
|
7
7
|
for (var s = o > 1 ? void 0 : o ? $(e, l) : e, a = t.length - 1, p; a >= 0; a--)
|
|
8
8
|
(p = t[a]) && (s = (o ? p(e, l, s) : p(s)) || s);
|
|
9
9
|
return o && s && S(e, l, s), s;
|
|
@@ -79,19 +79,19 @@ let r = class extends m {
|
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
n([
|
|
83
|
+
i({ type: String })
|
|
84
84
|
], r.prototype, "string", 2);
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
n([
|
|
86
|
+
i({ converter: k })
|
|
87
87
|
], r.prototype, "strings", 2);
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
n([
|
|
89
|
+
i({ type: Boolean })
|
|
90
90
|
], r.prototype, "darkmode", 2);
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
n([
|
|
92
|
+
i({ type: Array })
|
|
93
93
|
], r.prototype, "_list", 2);
|
|
94
|
-
r =
|
|
94
|
+
r = n([
|
|
95
95
|
f("pkt-component")
|
|
96
96
|
], r);
|
|
97
97
|
export {
|