@oslokommune/punkt-elements 19.17.0 → 19.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/textarea.d.ts +17 -1
- package/dist/{consent-CxcKuGi9.cjs → consent-BwH89xk_.cjs} +1 -1
- package/dist/{consent-D2nfauO8.js → consent-DiD0iQ5h.js} +2 -2
- package/dist/{footer-D2RpIbsD.js → footer-BOwcLSsz.js} +1 -1
- package/dist/{footer-Box90zhr.cjs → footer-Cl_Da5Iq.cjs} +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +26 -26
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/shared-types/textarea.d.ts +67 -0
- package/dist/{textarea-BiCZBjOe.cjs → textarea-CjtqjgpN.cjs} +4 -4
- package/dist/{textarea-BZCUHjEj.js → textarea-eRNStC90.js} +21 -9
- package/package.json +2 -2
- package/src/components/consent/consent.ts +2 -2
- package/src/components/index.ts +1 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea.ts +34 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [19.18.0](https://github.com/oslokommune/punkt/compare/19.17.1...19.18.0) (2026-10-20)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [19.17.1](https://github.com/oslokommune/punkt/compare/19.17.0...19.17.1) (2026-10-20)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
* Cookie-banner oppdatert til v2.0.0 (#3773). - Litt mindre luft og et smalere banner (i følge deres changelog)
|
|
17
|
+
- Ingen endringer i hvordan PktConsent og footer brukes
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
|
|
8
22
|
## [19.17.0](https://github.com/oslokommune/punkt/compare/19.16.2...19.17.0) (2026-10-20)
|
|
9
23
|
|
|
10
24
|
---
|
|
@@ -33,6 +33,7 @@ export { PktRadioButton as PktRadiobutton } from './radiobutton';
|
|
|
33
33
|
export { PktTag } from './tag';
|
|
34
34
|
export { PktTabs, PktTabItem } from './tabs';
|
|
35
35
|
export { PktTextarea } from './textarea';
|
|
36
|
+
export type { IPktTextarea } from './textarea';
|
|
36
37
|
export { PktTextinput } from './textinput';
|
|
37
38
|
export { PktSelect } from './select';
|
|
38
39
|
export { PktSearchInput } from './searchinput';
|
|
@@ -2,8 +2,24 @@ import { PropertyValues } from 'lit';
|
|
|
2
2
|
import { Ref } from 'lit/directives/ref.js';
|
|
3
3
|
import { PktInputElement } from '../../base-elements/input-element';
|
|
4
4
|
import { ElementProps } from '../../types/typeUtils';
|
|
5
|
+
import { Booleanish, IPktTextareaBase } from '../../shared-types';
|
|
5
6
|
type Props = ElementProps<PktTextarea, 'autocomplete' | 'rows' | 'cols'>;
|
|
6
|
-
export
|
|
7
|
+
export interface IPktTextarea extends Omit<IPktTextareaBase, 'form' | 'label' | 'placeholder' | 'rows' | 'cols' | 'minLength' | 'maxLength' | 'readOnly' | 'autoComplete' | 'ariaDescribedby' | 'ariaLabelledby' | 'helptextDropdownButton' | 'useWrapper'> {
|
|
8
|
+
label?: string | null;
|
|
9
|
+
placeholder?: string | null;
|
|
10
|
+
rows?: number | null;
|
|
11
|
+
cols?: number | null;
|
|
12
|
+
minlength?: number | null;
|
|
13
|
+
maxlength?: number | null;
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
autocomplete?: string;
|
|
16
|
+
ariaDescribedby?: string | null;
|
|
17
|
+
ariaLabelledby?: string | null;
|
|
18
|
+
/** @deprecated Bruk `strings={{ forms: { readMore: '…' } }}` eller `setPktStrings()`. */
|
|
19
|
+
helptextDropdownButton?: string | null;
|
|
20
|
+
useWrapper?: Booleanish;
|
|
21
|
+
}
|
|
22
|
+
export declare class PktTextarea extends PktInputElement<Props> implements IPktTextarea {
|
|
7
23
|
inputRef: Ref<HTMLTextAreaElement>;
|
|
8
24
|
value: string;
|
|
9
25
|
autocomplete: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs");require("./button-Ca_V13cQ.cjs");var t={i18n:{nb:{contentPresentation:{title:`Oslo kommune bruker informasjonskapsler`,description:[`For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.`,`Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss.`],buttons:{accept:`Godta alle`,reject:`Kun nødvendige`,settings:`Innstillinger for informasjonskapsler`}},contentSettings:{title:`Innstillinger for informasjonskapsler`,description:[`Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.`,`Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler».`],buttons:{back:`Tilbake`,save:`Lagre innstillinger`}}},en:{contentPresentation:{title:`Before you visit Oslo kommune ...`,description:[`This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.`,`To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites.`],buttons:{accept:`Yes, I accept`,reject:`Only necessary`,settings:`Go to settings`}},contentSettings:{title:`Her kan du aktivt velge mellom ulike informasjonskapsler`,description:[`For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider`],buttons:{back:`Back`,save:`Save settings`}}}},cookies:[{name:`statistics`,defaultValue:null,i18n:{nb:{title:`Statistikk og analyse`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å innhente data om statistikk og brukeradferd.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Statistics and analytics`,description:`Select your preference for statistics and analytics`,buttons:{yes:`Yes`,no:`No`}}}},{name:`survey`,defaultValue:null,i18n:{nb:{title:`Skriftlige tilbakemeldinger`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å vise responsfelt og registrere tilbakemeldinger.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Survey`,description:`Select your preference for survey`,buttons:{yes:`Yes`,no:`No`}}}},{name:`functional`,defaultValue:!0,i18n:{nb:{title:`Funksjonelle informasjonskapsler`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler for å gjøre ulike funksjoner på nettstedet mulige (for eksempel skjemaer og barnehagevelger).`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Functional cookies`,description:`For the website to function optimally, we recommend that you accept these cookies`,buttons:{yes:`Yes`,no:`No`}}}}]},n={devMode:!1,i18nLanguage:`nb`,triggerType:`button`},r=null;function i(){return r||(r=new Promise((e,t)=>{if(document.querySelector(`#oslo-consent-script`)){e();return}let n=document.createElement(`script`);n.src=`https://cdn.web.oslo.kommune.no/cb/cb-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs");require("./button-Ca_V13cQ.cjs");var t={i18n:{nb:{contentPresentation:{title:`Oslo kommune bruker informasjonskapsler`,description:[`For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.`,`Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss.`],buttons:{accept:`Godta alle`,reject:`Kun nødvendige`,settings:`Innstillinger for informasjonskapsler`}},contentSettings:{title:`Innstillinger for informasjonskapsler`,description:[`Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.`,`Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler».`],buttons:{back:`Tilbake`,save:`Lagre innstillinger`}}},en:{contentPresentation:{title:`Before you visit Oslo kommune ...`,description:[`This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.`,`To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites.`],buttons:{accept:`Yes, I accept`,reject:`Only necessary`,settings:`Go to settings`}},contentSettings:{title:`Her kan du aktivt velge mellom ulike informasjonskapsler`,description:[`For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider`],buttons:{back:`Back`,save:`Save settings`}}}},cookies:[{name:`statistics`,defaultValue:null,i18n:{nb:{title:`Statistikk og analyse`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å innhente data om statistikk og brukeradferd.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Statistics and analytics`,description:`Select your preference for statistics and analytics`,buttons:{yes:`Yes`,no:`No`}}}},{name:`survey`,defaultValue:null,i18n:{nb:{title:`Skriftlige tilbakemeldinger`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler til å vise responsfelt og registrere tilbakemeldinger.`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Survey`,description:`Select your preference for survey`,buttons:{yes:`Yes`,no:`No`}}}},{name:`functional`,defaultValue:!0,i18n:{nb:{title:`Funksjonelle informasjonskapsler`,description:`Jeg godtar at Oslo kommune bruker informasjonskapsler for å gjøre ulike funksjoner på nettstedet mulige (for eksempel skjemaer og barnehagevelger).`,buttons:{yes:`Ja`,no:`Nei`}},en:{title:`Functional cookies`,description:`For the website to function optimally, we recommend that you accept these cookies`,buttons:{yes:`Yes`,no:`No`}}}}]},n={devMode:!1,i18nLanguage:`nb`,triggerType:`button`},r=null;function i(){return r||(r=new Promise((e,t)=>{if(document.querySelector(`#oslo-consent-script`)){e();return}let n=document.createElement(`script`);n.src=`https://cdn.web.oslo.kommune.no/cb/cb-v2.0.0.js`,n.id=`oslo-consent-script`,n.onload=()=>e(),n.onerror=t,document.head.appendChild(n);let r=document.createElement(`link`);r.href=`https://cdn.web.oslo.kommune.no/cb/cb-v2.0.0.css`,r.type=`text/css`,r.rel=`stylesheet`,r.id=`oslo-consent-styles`,document.head.appendChild(r)}),r)}var a=e=>{if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}},o=e=>a(e.value).items.reduce((e,t)=>(e[t.name]=t.consent,e),{}),s=class extends e.t{constructor(...e){super(...e),this.devMode=n.devMode,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType=n.triggerType,this.triggerText=null,this.i18nLanguage=n.i18nLanguage}connectedCallback(){super.connectedCallback();let e=Object.prototype.hasOwnProperty.call(t.i18n,this.i18nLanguage)?this.i18nLanguage:`nb`;this.triggerText=this.triggerText||t.i18n[e].contentPresentation.buttons.settings}disconnectedCallback(){super.disconnectedCallback(),this._cookieEventHandler&&window.__cookieEvents?.off(`CookieManager.setCookie`,this._cookieEventHandler)}returnJsonOrObject(e){return a(e)}emitCookieConsents(e){this.dispatchEvent(new CustomEvent(`toggle-consent`,{detail:o(e),bubbles:!0,cancelable:!1}))}async firstUpdated(e){window.cookieBanner_googleAnalyticsId=this.googleAnalyticsId,window.cookieBanner_hotjarId=this.hotjarId,this.cookieDomain&&(window.cookieBanner_cookieDomain=this.cookieDomain),this.cookieSecure&&(window.cookieBanner_cookieSecure=this.cookieSecure),this.cookieExpiryDays&&(window.cookieBanner_cookieExpiryDays=this.cookieExpiryDays),this.devMode&&(window.cookieBanner_devMode=this.devMode),await i(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event(`CookieBannerReady`,{bubbles:!0,cancelable:!0}));let e=window.cookieBanner,t=window.__cookieEvents;e&&t&&e.cookieConsent.validateConsentCookie().then(n=>{if(!n)return;let r=e.cookieConsent.getConsentCookie();window.setTimeout(()=>this.emitCookieConsents({value:r}),0),this._cookieEventHandler&&t.off(`CookieManager.setCookie`,this._cookieEventHandler),this._cookieEventHandler=e=>this.emitCookieConsents(e),t.on(`CookieManager.setCookie`,this._cookieEventHandler)})}openModal(e){e.preventDefault(),window.cookieBanner?.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner?.openCookieModal())}render(){return this.triggerType===`link`?e._`<a href="#" class="pkt-link" aria-haspopup="dialog" @click=${this.openModal}
|
|
2
2
|
>${this.triggerText}</a
|
|
3
3
|
>`:this.triggerType===`footerlink`?e._`<a
|
|
4
4
|
href="#"
|
|
@@ -122,9 +122,9 @@ function c() {
|
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
let n = document.createElement("script");
|
|
125
|
-
n.src = "https://cdn.web.oslo.kommune.no/cb/cb-
|
|
125
|
+
n.src = "https://cdn.web.oslo.kommune.no/cb/cb-v2.0.0.js", n.id = "oslo-consent-script", n.onload = () => e(), n.onerror = t, document.head.appendChild(n);
|
|
126
126
|
let r = document.createElement("link");
|
|
127
|
-
r.href = "https://cdn.web.oslo.kommune.no/cb/cb-
|
|
127
|
+
r.href = "https://cdn.web.oslo.kommune.no/cb/cb-v2.0.0.css", r.type = "text/css", r.rel = "stylesheet", r.id = "oslo-consent-styles", document.head.appendChild(r);
|
|
128
128
|
}), s);
|
|
129
129
|
}
|
|
130
130
|
var l = (e) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-ckeMVgMz.js";
|
|
2
|
-
import "./consent-
|
|
2
|
+
import "./consent-DiD0iQ5h.js";
|
|
3
3
|
import { t as s } from "./booleanish-OQJTYSrw.js";
|
|
4
4
|
import { n as c, r as l, t as u } from "./fetch-header-footer-data-Pc32etrk.js";
|
|
5
5
|
import "./icon-CLMJYuTL.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs");require("./consent-
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs");require("./consent-BwH89xk_.cjs");const t=require("./booleanish-BF8l4scU.cjs"),n=require("./fetch-header-footer-data-CUKV0biS.cjs");require("./icon-jPhyZD1z.cjs");const r=require("./if-defined-CiML3MTM.cjs");var i=`oslo.kommune.no`,a=/\.(?:co|com|org|net|gov|edu|ac|kommune)\.[a-z]{2}$/i;function o(e){let t=e.toLowerCase().replace(/\.$/,``),n=t.split(`.`);return n.length<=2?t:n.slice(a.test(t)?-3:-2).join(`.`)}function s(e){if(!e)return;let t;try{t=new URL(e)}catch{return}if(t.protocol===`http:`||t.protocol===`https:`)return o(t.hostname.toLowerCase().replace(/\.$/,``))}function c(e,t=i){if(!e)return;let n;try{n=new URL(e)}catch{return}if(n.protocol!==`http:`&&n.protocol!==`https:`)return;let r=n.hostname.toLowerCase().replace(/\.$/,``),a=t.toLowerCase();if(!(r===a||r.endsWith(`.${a}`)))return o(r)}var l=`#cb-trigger`,u=class extends e.t{constructor(...e){super(...e),this.locale=`nb-NO`,this.skipGlobal=!1,this.openLinksInNewTab=!1,this.includeConsent=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.devMode=!1,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null}connectedCallback(){super.connectedCallback(),!this.data&&!this.skipGlobal&&this.loadData()}disconnectedCallback(){super.disconnectedCallback(),this.abortController?.abort()}updated(e){super.updated(e),e.has(`dataUrl`)&&e.get(`dataUrl`)!==void 0&&!this.data&&this.loadData()}async loadData(){this.abortController?.abort(),this.abortController=new AbortController;try{this.fetchedData=await n.t(this.dataUrl,this.abortController.signal)}catch(e){if(e.name===`AbortError`)return;console.warn(`Failed to fetch header/footer data:`,e),this.dispatchEvent(new CustomEvent(`data-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}get globalFooterData(){return n.n(this.data??this.fetchedData,this.locale)?.footer}linkTarget(e){return e.openInNewTab||this.openLinksInNewTab?{target:`_blank`,rel:`noopener noreferrer`}:{target:`_self`}}renderLinkDomain(t,n=`pkt-footer__link-domain`){if(!t.external)return e.h;let r=s(t.href);return r?e._` <span class=${n}>(${r})</span>`:e.h}renderCustomLink(t){let{target:n,rel:i}=this.linkTarget(t);return e._`
|
|
2
2
|
<a href=${t.href} target=${n} rel=${r.t(i)}
|
|
3
3
|
>${t.text}${this.renderLinkDomain(t)}</a
|
|
4
4
|
>
|
package/dist/pkt-consent.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./consent-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./consent-BwH89xk_.cjs");exports.PktConsent=e.n,exports.default=e.t;
|
package/dist/pkt-consent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as PktConsent, t as default } from "./consent-
|
|
1
|
+
export { n as PktConsent, t as default } from "./consent-DiD0iQ5h.js";
|
package/dist/pkt-footer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./footer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./footer-Cl_Da5Iq.cjs");exports.PktFooter=e.n,exports.PktFooterSimple=e.t;
|
package/dist/pkt-footer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as PktFooter, t as PktFooterSimple } from "./footer-
|
|
1
|
+
export { n as PktFooter, t as PktFooterSimple } from "./footer-BOwcLSsz.js";
|
package/dist/pkt-index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./element-C6WTyJFE.cjs"),t=require("./consent-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./element-C6WTyJFE.cjs"),t=require("./consent-BwH89xk_.cjs"),n=require("./alert-BRZDpVMt.cjs"),r=require("./header-CvER8wo6.cjs"),i=require("./card-COseC8ZL.cjs"),a=require("./checkbox-DkFswqr-.cjs"),o=require("./radiobutton-DgkML7sd.cjs"),s=require("./icon-jPhyZD1z.cjs"),c=require("./accordion-Cx-Gh3hc.cjs"),l=require("./input-wrapper-4PTk8aX3.cjs"),u=require("./textarea-CjtqjgpN.cjs"),d=require("./messagebox-CiOQUt0C.cjs"),f=require("./calendar-CFTrX0C5.cjs"),p=require("./combobox-CaWnlvTX.cjs"),m=require("./button-Ca_V13cQ.cjs"),h=require("./backlink-CsFeerTH.cjs"),g=require("./breadcrumbs-D03id_ha.cjs"),_=require("./tag-6IPe9bwQ.cjs"),v=require("./helptext-p0nwJsyf.cjs"),y=require("./checkbox-group-lcxR3cYR.cjs"),b=require("./fileupload-Cb1c7ul0.cjs"),x=require("./modal-DGiq84MG.cjs"),S=require("./progressbar-CnX4fFfR.cjs"),C=require("./datepicker-Da8SfyVG.cjs"),w=require("./footer-Cl_Da5Iq.cjs"),T=require("./link-Dj6SbcaD.cjs"),E=require("./textinput-BZPGcxZV.cjs"),D=require("./searchinput-Mdc9Ihld.cjs"),O=require("./header-menu-D-wOwG1V.cjs"),k=require("./heading-D4Kkb6-N.cjs"),A=require("./linkcard-BoQIfci8.cjs"),j=require("./loader-BRYL5kTN.cjs"),M=require("./radio-group-XCYKqoLD.cjs"),N=require("./tabs-B63J6MXb.cjs"),P=require("./select-D8TC1msV.cjs"),F=require("./timepicker-C0d92R8u.cjs");exports.PktAccordion=c.r,exports.PktAccordionItem=c.n,exports.PktAlert=n.n,exports.PktBackLink=h.n,exports.PktBreadcrumbs=g.t,exports.PktButton=m.n,exports.PktCalendar=f.n,exports.PktCard=i.n,exports.PktCheckbox=a.n,exports.PktCheckboxGroup=y.n,exports.PktCombobox=p.n,exports.PktConsent=t.n,exports.PktDateTags=C.a,exports.PktDatepicker=C.t,Object.defineProperty(exports,"PktFileUpload",{enumerable:!0,get:function(){return b.n}}),exports.PktFooter=w.n,exports.PktFooterSimple=w.t,exports.PktHeader=r.t,exports.PktHeaderGlobal=r.n,exports.PktHeaderMenu=O.n,exports.PktHeaderService=r.r,exports.PktHeaderUserMenu=r.i,exports.PktHeading=k.n,exports.PktHelptext=v.n,exports.PktIcon=s.n,exports.PktInputWrapper=l.n,exports.PktLink=T.n,exports.PktLinkCard=A.n,exports.PktLoader=j.n,exports.PktMessagebox=d.n,exports.PktModal=x.n,exports.PktProgressbar=S.n,exports.PktRadioButton=o.n,exports.PktRadiobutton=o.n,exports.PktRadioGroup=M.n,exports.PktSearchInput=D.n,exports.PktSelect=P.n,exports.PktTabItem=N.n,exports.PktTabs=N.r,exports.PktTag=_.n,exports.PktTextarea=u.n,exports.PktTextinput=E.n,exports.PktTimepicker=F.t,exports.getPktStrings=e.r,exports.pktStringsNb=e.s,exports.resetPktStrings=e.i,exports.setPktStrings=e.a,exports.subscribePktStrings=e.o;
|
package/dist/pkt-index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, i as t, o as n, r, s as i } from "./element-ckeMVgMz.js";
|
|
2
|
-
import { n as a } from "./consent-
|
|
2
|
+
import { n as a } from "./consent-DiD0iQ5h.js";
|
|
3
3
|
import { n as o } from "./alert-JnRrtTOW.js";
|
|
4
4
|
import { i as s, n as c, r as l, t as u } from "./header-Cwr995oK.js";
|
|
5
5
|
import { n as d } from "./card-DSTEL8Kv.js";
|
|
@@ -8,30 +8,30 @@ import { n as p } from "./radiobutton-PYQKVnNQ.js";
|
|
|
8
8
|
import { n as m } from "./icon-CLMJYuTL.js";
|
|
9
9
|
import { n as h, r as g } from "./accordion-B0zAUNUV.js";
|
|
10
10
|
import { n as _ } from "./input-wrapper-BSjQc4Vx.js";
|
|
11
|
-
import { n as v } from "./
|
|
12
|
-
import { n as y } from "./
|
|
13
|
-
import { n as b } from "./
|
|
14
|
-
import { n as x } from "./
|
|
15
|
-
import { n as S } from "./
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { n as T } from "./
|
|
19
|
-
import { n as E } from "./
|
|
20
|
-
import { n as D } from "./
|
|
21
|
-
import { n as O } from "./
|
|
22
|
-
import { n as k } from "./
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { n as P } from "./
|
|
26
|
-
import { n as F } from "./
|
|
27
|
-
import { n as I } from "./
|
|
28
|
-
import { n as L } from "./
|
|
29
|
-
import { n as R } from "./
|
|
30
|
-
import { n as z } from "./
|
|
31
|
-
import { n as B } from "./
|
|
32
|
-
import { n as V } from "./
|
|
33
|
-
import { n as H
|
|
34
|
-
import { n as W } from "./
|
|
11
|
+
import { n as v } from "./textarea-eRNStC90.js";
|
|
12
|
+
import { n as y } from "./messagebox-Dr-k3pnZ.js";
|
|
13
|
+
import { n as b } from "./calendar-BQCjUQvP.js";
|
|
14
|
+
import { n as x } from "./combobox-iXYiaWbN.js";
|
|
15
|
+
import { n as S } from "./button-ChdHZYBF.js";
|
|
16
|
+
import { n as C } from "./backlink-D8Rv46lA.js";
|
|
17
|
+
import { t as w } from "./breadcrumbs-ybOBe_op.js";
|
|
18
|
+
import { n as T } from "./tag-BPvGZcKf.js";
|
|
19
|
+
import { n as E } from "./helptext-DN0jjgVu.js";
|
|
20
|
+
import { n as D } from "./checkbox-group-1ghi5uHp.js";
|
|
21
|
+
import { n as O } from "./fileupload-BNAQ9tNR.js";
|
|
22
|
+
import { n as k } from "./modal-DbzEnZNF.js";
|
|
23
|
+
import { n as A } from "./progressbar-t0zgEke0.js";
|
|
24
|
+
import { a as j, t as M } from "./datepicker-DTcow1ih.js";
|
|
25
|
+
import { n as N, t as P } from "./footer-BOwcLSsz.js";
|
|
26
|
+
import { n as F } from "./link-39EvU2ng.js";
|
|
27
|
+
import { n as I } from "./textinput-D_oEaI41.js";
|
|
28
|
+
import { n as L } from "./searchinput-BzYifHBf.js";
|
|
29
|
+
import { n as R } from "./header-menu-CsL4DZE2.js";
|
|
30
|
+
import { n as z } from "./heading-DhTyaJms.js";
|
|
31
|
+
import { n as B } from "./linkcard-K9vvKg1u.js";
|
|
32
|
+
import { n as V } from "./loader-MoI2VRFr.js";
|
|
33
|
+
import { n as H } from "./radio-group-DJikniZi.js";
|
|
34
|
+
import { n as U, r as W } from "./tabs-DDakCTkY.js";
|
|
35
35
|
import { n as G } from "./select-CorofYxz.js";
|
|
36
36
|
import { t as K } from "./timepicker-JBOeZg-7.js";
|
|
37
|
-
export { g as PktAccordion, h as PktAccordionItem, o as PktAlert,
|
|
37
|
+
export { g as PktAccordion, h as PktAccordionItem, o as PktAlert, C as PktBackLink, w as PktBreadcrumbs, S as PktButton, b as PktCalendar, d as PktCard, f as PktCheckbox, D as PktCheckboxGroup, x as PktCombobox, a as PktConsent, j as PktDateTags, M as PktDatepicker, O as PktFileUpload, N as PktFooter, P as PktFooterSimple, u as PktHeader, c as PktHeaderGlobal, R as PktHeaderMenu, l as PktHeaderService, s as PktHeaderUserMenu, z as PktHeading, E as PktHelptext, m as PktIcon, _ as PktInputWrapper, F as PktLink, B as PktLinkCard, V as PktLoader, y as PktMessagebox, k as PktModal, A as PktProgressbar, p as PktRadioButton, p as PktRadiobutton, H as PktRadioGroup, L as PktSearchInput, G as PktSelect, U as PktTabItem, W as PktTabs, T as PktTag, v as PktTextarea, I as PktTextinput, K as PktTimepicker, r as getPktStrings, i as pktStringsNb, t as resetPktStrings, e as setPktStrings, n as subscribePktStrings };
|
package/dist/pkt-textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-CjtqjgpN.cjs");exports.PktTextarea=e.n,exports.default=e.t;
|
package/dist/pkt-textarea.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as PktTextarea, t as default } from "./textarea-
|
|
1
|
+
export { n as PktTextarea, t as default } from "./textarea-eRNStC90.js";
|
|
@@ -39,6 +39,8 @@ export type { IRenderLink, TRenderLink } from './render-link';
|
|
|
39
39
|
export type { IPktStringsProps } from '../shared-strings';
|
|
40
40
|
export type { IHelptextProps, ITagOptionalRequiredProps, IFormFieldLabelProps, IFormFieldErrorProps, IFormFieldCommonProps, TFormFieldCommonSpecKeys, } from './form-field';
|
|
41
41
|
export { COUNTER_POSITIONS, INPUT_WRAPPER_DEFAULTS } from './input-wrapper';
|
|
42
|
+
export { TEXTAREA_DEFAULTS } from './textarea';
|
|
43
|
+
export type { IPktTextareaBase, ITextareaSpecProps } from './textarea';
|
|
42
44
|
export type { TPktCounterPosition, IPktInputWrapperBase, IInputWrapperSpecProps, } from './input-wrapper';
|
|
43
45
|
export type { TTagSkin } from './skin';
|
|
44
46
|
export { MESSAGEBOX_SKINS, MESSAGEBOX_DEFAULTS } from './messagebox';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* textarea.ts
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for pkt-textarea.
|
|
5
|
+
* Used by React, Elements, and typed component specs.
|
|
6
|
+
*/
|
|
7
|
+
import type { IFormFieldCommonProps } from './form-field';
|
|
8
|
+
import type { TPktInputSize } from './size';
|
|
9
|
+
/**
|
|
10
|
+
* Textarea props shared by React, Elements, and typed component specs.
|
|
11
|
+
*
|
|
12
|
+
* @remarks Keys follow the React prop names. Elements uses lowercase properties instead:
|
|
13
|
+
* `autocomplete`, `minlength`, `maxlength` and `readonly`.
|
|
14
|
+
*
|
|
15
|
+
* React requires `id` and `label`, and widens `helptext`, `helptextDropdown` and
|
|
16
|
+
* `errorMessage` to `ReactNode`. Elements widens `label`, `placeholder`, `rows`, `cols`,
|
|
17
|
+
* `ariaDescribedby`, `ariaLabelledby` and `helptextDropdownButton` to `| null` (Lit uses
|
|
18
|
+
* `null` for an unset attribute), `useWrapper` to `Booleanish`, and omits `form`, which is
|
|
19
|
+
* a getter returning the associated `HTMLFormElement`, not the form id.
|
|
20
|
+
*
|
|
21
|
+
* `counter` and `hasFieldset` are tri-state: `null` means the component derives the value.
|
|
22
|
+
*/
|
|
23
|
+
export interface IPktTextareaBase extends IFormFieldCommonProps<'forms' | 'validation'> {
|
|
24
|
+
id?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
form?: string;
|
|
27
|
+
value?: string;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
rows?: number;
|
|
30
|
+
cols?: number;
|
|
31
|
+
minLength?: number;
|
|
32
|
+
maxLength?: number;
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
autoComplete?: string;
|
|
35
|
+
required?: boolean;
|
|
36
|
+
ariaDescribedby?: string;
|
|
37
|
+
ariaLabelledby?: string;
|
|
38
|
+
inline?: boolean;
|
|
39
|
+
fullwidth?: boolean;
|
|
40
|
+
useWrapper?: boolean;
|
|
41
|
+
counter?: boolean | null;
|
|
42
|
+
counterMaxLength?: number;
|
|
43
|
+
inputSize?: TPktInputSize;
|
|
44
|
+
hasFieldset?: boolean | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Documented Textarea props (subset of `IPktTextareaBase`).
|
|
48
|
+
* Used for typed component specs in documentation.
|
|
49
|
+
*/
|
|
50
|
+
export type ITextareaSpecProps = Pick<IPktTextareaBase, 'label' | 'name' | 'form' | 'placeholder' | 'helptext' | 'helptextDropdown' | 'helptextDropdownButton' | 'rows' | 'cols' | 'minLength' | 'maxLength' | 'readOnly' | 'value' | 'autoComplete' | 'ariaLabelledby' | 'ariaDescribedby' | 'required' | 'requiredTag' | 'requiredText' | 'optionalTag' | 'optionalText' | 'tagText' | 'hasError' | 'errorMessage' | 'disabled' | 'inline' | 'fullwidth' | 'useWrapper' | 'id' | 'counter' | 'counterMaxLength' | 'inputSize' | 'hasFieldset'>;
|
|
51
|
+
/**
|
|
52
|
+
* Default values for pkt-textarea. Single source of truth for both frameworks.
|
|
53
|
+
* `counter` and `hasFieldset` are intentionally absent — `null` lets the component derive them.
|
|
54
|
+
*/
|
|
55
|
+
export declare const TEXTAREA_DEFAULTS: {
|
|
56
|
+
readonly autoComplete: 'off';
|
|
57
|
+
readonly required: false;
|
|
58
|
+
readonly readOnly: false;
|
|
59
|
+
readonly requiredTag: false;
|
|
60
|
+
readonly optionalTag: false;
|
|
61
|
+
readonly hasError: false;
|
|
62
|
+
readonly disabled: false;
|
|
63
|
+
readonly inline: false;
|
|
64
|
+
readonly fullwidth: false;
|
|
65
|
+
readonly useWrapper: true;
|
|
66
|
+
readonly inputSize: 'medium';
|
|
67
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./directive-helpers-Bv70GjQh.cjs"),r=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs");const i=require("./input-wrapper-4PTk8aX3.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./ref-CB7e9nMY.cjs"),s=require("./input-element-BOi7rBbw.cjs");var c=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.PROPERTY&&t.type!==e.m.ATTRIBUTE&&t.type!==e.m.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!n.i(t))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(t,[r]){if(r===e.g||r===e.h)return r;let i=t.element,a=t.name;if(t.type===e.m.PROPERTY){if(r===i[a])return e.g}else if(t.type===e.m.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(a))return e.g}else if(t.type===e.m.ATTRIBUTE&&i.getAttribute(a)===r+``)return e.g;return n.r(t),r}}),
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./directive-helpers-Bv70GjQh.cjs"),r=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs");const i=require("./input-wrapper-4PTk8aX3.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./ref-CB7e9nMY.cjs"),s=require("./input-element-BOi7rBbw.cjs");var c={autoComplete:`off`,required:!1,readOnly:!1,requiredTag:!1,optionalTag:!1,hasError:!1,disabled:!1,inline:!1,fullwidth:!1,useWrapper:!0,inputSize:`medium`},l=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.PROPERTY&&t.type!==e.m.ATTRIBUTE&&t.type!==e.m.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!n.i(t))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(t,[r]){if(r===e.g||r===e.h)return r;let i=t.element,a=t.name;if(t.type===e.m.PROPERTY){if(r===i[a])return e.g}else if(t.type===e.m.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(a))return e.g}else if(t.type===e.m.ATTRIBUTE&&i.getAttribute(a)===r+``)return e.g;return n.r(t),r}}),u=class extends s.t{constructor(...e){super(...e),this.inputRef=o.t(),this.value=``,this.autocomplete=c.autoComplete,this.rows=null,this.cols=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0),super.attributeChangedCallback(e,t,n)}willUpdate(e){super.willUpdate(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}updated(e){super.updated(e),this.classList.add(`pkt-textinput`,`pkt-textarea`),e.has(`value`)&&this.valueChanged(this.value,e.get(`value`))}render(){let n=this.effectiveCounter(this.counterMaxLength>0),s=t.t({"pkt-input":!0,[`pkt-input--${this.inputSize}`]:!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":n&&this.counterMaxLength>0&&this.value.length>this.counterMaxLength}),c=this.ariaLabelledby||`${this.id}-input-label`;return e._`<pkt-input-wrapper
|
|
2
2
|
${r.n(this,[`helptext`])}
|
|
3
3
|
.strings=${this.strings}
|
|
4
4
|
label=${this.label}
|
|
@@ -30,12 +30,12 @@ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),
|
|
|
30
30
|
id=${this.id+`-input`}
|
|
31
31
|
name=${(this.name||this.id)+`-input`}
|
|
32
32
|
placeholder=${a.t(this.placeholder)}
|
|
33
|
-
.value=${
|
|
33
|
+
.value=${l(this.value)}
|
|
34
34
|
minlength=${a.t(this.minlength)}
|
|
35
35
|
maxlength=${a.t(this.maxlength)}
|
|
36
36
|
?readonly=${this.readonly}
|
|
37
37
|
autocomplete=${this.autocomplete}
|
|
38
|
-
aria-labelledby=${
|
|
38
|
+
aria-labelledby=${c}
|
|
39
39
|
aria-invalid=${this.hasError}
|
|
40
40
|
aria-errormessage=${a.t(this.hasError?`${this.id}-input-error`:void 0)}
|
|
41
41
|
aria-describedby=${a.t(i.r({id:this.id+`-input`,hasHelptext:!!this.helptext||this.hasSlotContent(`helptext`),hasCounter:n,ariaDescribedby:this.ariaDescribedby}))}
|
|
@@ -47,4 +47,4 @@ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),
|
|
|
47
47
|
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
48
48
|
@blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
|
|
49
49
|
></textarea>
|
|
50
|
-
</pkt-input-wrapper>`}};e.n([e.u({type:String,reflect:!0})],
|
|
50
|
+
</pkt-input-wrapper>`}};e.n([e.u({type:String,reflect:!0})],u.prototype,`value`,void 0),e.n([e.u({type:String})],u.prototype,`autocomplete`,void 0),e.n([e.u({type:Number})],u.prototype,`rows`,void 0),e.n([e.u({type:Number})],u.prototype,`cols`,void 0),e.n([e.l()],u.prototype,`counterCurrent`,void 0);try{e.d(`pkt-textarea`)(u)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var d=u;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -7,8 +7,20 @@ import { r as m } from "./input-wrapper-BSjQc4Vx.js";
|
|
|
7
7
|
import { t as h } from "./if-defined-D18nY_K_.js";
|
|
8
8
|
import { n as g, t as _ } from "./ref-D4OwQYdf.js";
|
|
9
9
|
import { t as v } from "./input-element-0yYtRu0p.js";
|
|
10
|
-
//#region ../../
|
|
11
|
-
var y =
|
|
10
|
+
//#region ../../shared-types/textarea.ts
|
|
11
|
+
var y = {
|
|
12
|
+
autoComplete: "off",
|
|
13
|
+
required: !1,
|
|
14
|
+
readOnly: !1,
|
|
15
|
+
requiredTag: !1,
|
|
16
|
+
optionalTag: !1,
|
|
17
|
+
hasError: !1,
|
|
18
|
+
disabled: !1,
|
|
19
|
+
inline: !1,
|
|
20
|
+
fullwidth: !1,
|
|
21
|
+
useWrapper: !0,
|
|
22
|
+
inputSize: "medium"
|
|
23
|
+
}, b = n(class extends c {
|
|
12
24
|
constructor(e) {
|
|
13
25
|
if (super(e), e.type !== o.PROPERTY && e.type !== o.ATTRIBUTE && e.type !== o.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
|
|
14
26
|
if (!d(e)) throw Error("`live` bindings can only contain a single expression");
|
|
@@ -26,9 +38,9 @@ var y = n(class extends c {
|
|
|
26
38
|
} else if (e.type === o.ATTRIBUTE && n.getAttribute(a) === t + "") return r;
|
|
27
39
|
return f(e), t;
|
|
28
40
|
}
|
|
29
|
-
}),
|
|
41
|
+
}), x = class extends v {
|
|
30
42
|
constructor(...e) {
|
|
31
|
-
super(...e), this.inputRef = _(), this.value = "", this.autocomplete =
|
|
43
|
+
super(...e), this.inputRef = _(), this.value = "", this.autocomplete = y.autoComplete, this.rows = null, this.cols = null, this.counterCurrent = 0;
|
|
32
44
|
}
|
|
33
45
|
attributeChangedCallback(e, t, n) {
|
|
34
46
|
e === "value" && this.value !== t && (this.counterCurrent = n ? n.length : 0), super.attributeChangedCallback(e, t, n);
|
|
@@ -78,7 +90,7 @@ var y = n(class extends c {
|
|
|
78
90
|
id=${this.id + "-input"}
|
|
79
91
|
name=${(this.name || this.id) + "-input"}
|
|
80
92
|
placeholder=${h(this.placeholder)}
|
|
81
|
-
.value=${
|
|
93
|
+
.value=${b(this.value)}
|
|
82
94
|
minlength=${h(this.minlength)}
|
|
83
95
|
maxlength=${h(this.maxlength)}
|
|
84
96
|
?readonly=${this.readonly}
|
|
@@ -114,14 +126,14 @@ var y = n(class extends c {
|
|
|
114
126
|
s([l({
|
|
115
127
|
type: String,
|
|
116
128
|
reflect: !0
|
|
117
|
-
})],
|
|
129
|
+
})], x.prototype, "value", void 0), s([l({ type: String })], x.prototype, "autocomplete", void 0), s([l({ type: Number })], x.prototype, "rows", void 0), s([l({ type: Number })], x.prototype, "cols", void 0), s([a()], x.prototype, "counterCurrent", void 0);
|
|
118
130
|
try {
|
|
119
|
-
t("pkt-textarea")(
|
|
131
|
+
t("pkt-textarea")(x);
|
|
120
132
|
} catch {
|
|
121
133
|
console.warn("Forsøker å definere <pkt-textarea>, men den er allerede definert");
|
|
122
134
|
}
|
|
123
135
|
//#endregion
|
|
124
136
|
//#region src/components/textarea/index.ts
|
|
125
|
-
var
|
|
137
|
+
var S = x;
|
|
126
138
|
//#endregion
|
|
127
|
-
export {
|
|
139
|
+
export { x as n, S as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.18.0",
|
|
4
4
|
"description": "Komponentbiblioteket til Punkt, designsystem for Oslo kommune",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo kommune",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": "^22.19.0 || ^24.0.0 || ^26.0.0"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "6b3cae25111200ae8f8f3673e13c8b6379337ecf"
|
|
88
88
|
}
|
|
@@ -41,14 +41,14 @@ function loadConsentScript(): Promise<void> {
|
|
|
41
41
|
return
|
|
42
42
|
}
|
|
43
43
|
const script = document.createElement('script')
|
|
44
|
-
script.src = 'https://cdn.web.oslo.kommune.no/cb/cb-
|
|
44
|
+
script.src = 'https://cdn.web.oslo.kommune.no/cb/cb-v2.0.0.js'
|
|
45
45
|
script.id = 'oslo-consent-script'
|
|
46
46
|
script.onload = () => resolve()
|
|
47
47
|
script.onerror = reject
|
|
48
48
|
document.head.appendChild(script)
|
|
49
49
|
|
|
50
50
|
const styles = document.createElement('link')
|
|
51
|
-
styles.href = 'https://cdn.web.oslo.kommune.no/cb/cb-
|
|
51
|
+
styles.href = 'https://cdn.web.oslo.kommune.no/cb/cb-v2.0.0.css'
|
|
52
52
|
styles.type = 'text/css'
|
|
53
53
|
styles.rel = 'stylesheet'
|
|
54
54
|
styles.id = 'oslo-consent-styles'
|
package/src/components/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export { PktRadioButton as PktRadiobutton } from '@/components/radiobutton'
|
|
|
40
40
|
export { PktTag } from '@/components/tag'
|
|
41
41
|
export { PktTabs, PktTabItem } from '@/components/tabs'
|
|
42
42
|
export { PktTextarea } from '@/components/textarea'
|
|
43
|
+
export type { IPktTextarea } from '@/components/textarea'
|
|
43
44
|
export { PktTextinput } from '@/components/textinput'
|
|
44
45
|
export { PktSelect } from '@/components/select'
|
|
45
46
|
export { PktSearchInput } from '@/components/searchinput'
|
|
@@ -11,14 +11,46 @@ import '@/components/input-wrapper'
|
|
|
11
11
|
import '@/components/icon'
|
|
12
12
|
import { ElementProps } from '@/types/typeUtils'
|
|
13
13
|
import { describedByIds } from 'shared-utils/forms/described-by'
|
|
14
|
+
import { TEXTAREA_DEFAULTS, type Booleanish, type IPktTextareaBase } from 'shared-types'
|
|
14
15
|
|
|
15
16
|
type Props = ElementProps<PktTextarea, 'autocomplete' | 'rows' | 'cols'>
|
|
16
17
|
|
|
17
|
-
export
|
|
18
|
+
export interface IPktTextarea extends Omit<
|
|
19
|
+
IPktTextareaBase,
|
|
20
|
+
| 'form'
|
|
21
|
+
| 'label'
|
|
22
|
+
| 'placeholder'
|
|
23
|
+
| 'rows'
|
|
24
|
+
| 'cols'
|
|
25
|
+
| 'minLength'
|
|
26
|
+
| 'maxLength'
|
|
27
|
+
| 'readOnly'
|
|
28
|
+
| 'autoComplete'
|
|
29
|
+
| 'ariaDescribedby'
|
|
30
|
+
| 'ariaLabelledby'
|
|
31
|
+
| 'helptextDropdownButton'
|
|
32
|
+
| 'useWrapper'
|
|
33
|
+
> {
|
|
34
|
+
label?: string | null
|
|
35
|
+
placeholder?: string | null
|
|
36
|
+
rows?: number | null
|
|
37
|
+
cols?: number | null
|
|
38
|
+
minlength?: number | null
|
|
39
|
+
maxlength?: number | null
|
|
40
|
+
readonly?: boolean
|
|
41
|
+
autocomplete?: string
|
|
42
|
+
ariaDescribedby?: string | null
|
|
43
|
+
ariaLabelledby?: string | null
|
|
44
|
+
/** @deprecated Bruk `strings={{ forms: { readMore: '…' } }}` eller `setPktStrings()`. */
|
|
45
|
+
helptextDropdownButton?: string | null
|
|
46
|
+
useWrapper?: Booleanish
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class PktTextarea extends PktInputElement<Props> implements IPktTextarea {
|
|
18
50
|
inputRef: Ref<HTMLTextAreaElement> = createRef()
|
|
19
51
|
|
|
20
52
|
@property({ type: String, reflect: true }) value: string = ''
|
|
21
|
-
@property({ type: String }) autocomplete: string =
|
|
53
|
+
@property({ type: String }) autocomplete: string = TEXTAREA_DEFAULTS.autoComplete
|
|
22
54
|
@property({ type: Number }) rows: number | null = null
|
|
23
55
|
@property({ type: Number }) cols: number | null = null
|
|
24
56
|
|