@oslokommune/punkt-react 12.10.2 → 12.10.3

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.
@@ -1518,7 +1518,7 @@ let Ke = class extends Tt {
1518
1518
  ), this.internals.reportValidity());
1519
1519
  }
1520
1520
  firstUpdated(t) {
1521
- 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);
1521
+ super.firstUpdated(t), this.required && (this.internals.ariaRequired = !0), this.disabled && (this.internals.ariaDisabled = !0), this.internals.setFormValue(this.value), this.manageValidity(this.inputRef.value);
1522
1522
  }
1523
1523
  };
1524
1524
  Ye([
@@ -92,7 +92,7 @@ React keys must be passed directly to JSX without using spread:
92
92
  * @license
93
93
  * Copyright 2017 Google LLC
94
94
  * SPDX-License-Identifier: BSD-3-Clause
95
- */function It(e){return O({...e,state:!0,attribute:!1})}for(var Je=[],ts=0;ts<256;++ts)Je.push((ts+256).toString(16).slice(1));function Ch(e,t=0){return(Je[e[t+0]]+Je[e[t+1]]+Je[e[t+2]]+Je[e[t+3]]+"-"+Je[e[t+4]]+Je[e[t+5]]+"-"+Je[e[t+6]]+Je[e[t+7]]+"-"+Je[e[t+8]]+Je[e[t+9]]+"-"+Je[e[t+10]]+Je[e[t+11]]+Je[e[t+12]]+Je[e[t+13]]+Je[e[t+14]]+Je[e[t+15]]).toLowerCase()}var Pa,_h=new Uint8Array(16);function xh(){if(!Pa&&(Pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pa(_h)}var Sh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Nl={randomUUID:Sh};function ns(e,t,n){if(Nl.randomUUID&&!t&&!e)return Nl.randomUUID();e=e||{};var r=e.random||(e.rng||xh)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ch(r)}const Eh={hi:"Hei!"},Fh={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Ah={month:"Måned",year:"År",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"},$h={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."}},Bt={example:Eh,calendar:Fh,dates:Ah,forms:$h};var Th=Object.defineProperty,Ge=(e,t,n,r)=>{for(var i=void 0,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=u(t,n,i)||i);return i&&Th(t,n,i),i};let St=class extends Rr{constructor(){super(),this.strings=Bt}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}};Ge([O({type:Object})],St.prototype,"strings");let Ye=class extends St{constructor(){super(),this.id=ns(),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=Bt.forms.labels.optional,this.requiredTag=!1,this.requiredText=Bt.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},Bt.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},Bt.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},Bt.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},Bt.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},Bt.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},Bt.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},Bt.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 n=new FormData;t.forEach(r=>{n.append(this.name,r)}),this.internals.setFormValue(n)}else this.internals.setFormValue(t)}valueChanged(t,n){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)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.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)}};Ge([O({type:String,reflect:!0})],Ye.prototype,"id"),Ge([O({type:String,reflect:!0})],Ye.prototype,"name"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"required"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"disabled"),Ge([O({type:String,reflect:!0})],Ye.prototype,"placeholder"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"min"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"max"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"minlength"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"maxlength"),Ge([O({type:String,reflect:!0})],Ye.prototype,"pattern"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"optionalTag"),Ge([O({type:String,reflect:!0})],Ye.prototype,"optionalText"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"requiredTag"),Ge([O({type:String,reflect:!0})],Ye.prototype,"requiredText"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"hasError"),Ge([O({type:String,reflect:!0})],Ye.prototype,"errorMessage"),Ge([It()],Ye.prototype,"touched");/**
95
+ */function It(e){return O({...e,state:!0,attribute:!1})}for(var Je=[],ts=0;ts<256;++ts)Je.push((ts+256).toString(16).slice(1));function Ch(e,t=0){return(Je[e[t+0]]+Je[e[t+1]]+Je[e[t+2]]+Je[e[t+3]]+"-"+Je[e[t+4]]+Je[e[t+5]]+"-"+Je[e[t+6]]+Je[e[t+7]]+"-"+Je[e[t+8]]+Je[e[t+9]]+"-"+Je[e[t+10]]+Je[e[t+11]]+Je[e[t+12]]+Je[e[t+13]]+Je[e[t+14]]+Je[e[t+15]]).toLowerCase()}var Pa,_h=new Uint8Array(16);function xh(){if(!Pa&&(Pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pa(_h)}var Sh=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Nl={randomUUID:Sh};function ns(e,t,n){if(Nl.randomUUID&&!t&&!e)return Nl.randomUUID();e=e||{};var r=e.random||(e.rng||xh)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ch(r)}const Eh={hi:"Hei!"},Fh={buttonAltText:"Åpne kalender",deleteDate:"Fjern dato"},Ah={month:"Måned",year:"År",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"},$h={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."}},Bt={example:Eh,calendar:Fh,dates:Ah,forms:$h};var Th=Object.defineProperty,Ge=(e,t,n,r)=>{for(var i=void 0,o=e.length-1,u;o>=0;o--)(u=e[o])&&(i=u(t,n,i)||i);return i&&Th(t,n,i),i};let St=class extends Rr{constructor(){super(),this.strings=Bt}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}hotReplacedCallback(){this.requestUpdate()}};Ge([O({type:Object})],St.prototype,"strings");let Ye=class extends St{constructor(){super(),this.id=ns(),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=Bt.forms.labels.optional,this.requiredTag=!1,this.requiredText=Bt.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},Bt.forms.messages.required,t):t.validity.typeMismatch||t.validity.badInput?this.internals.setValidity({typeMismatch:!0},Bt.forms.messages.invalid,t):t.validity.patternMismatch?this.internals.setValidity({patternMismatch:!0},Bt.forms.messages.invalidPattern,t):t.validity.tooShort||this.minLength>0&&this.value.length<this.minLength?this.internals.setValidity({tooShort:!0},Bt.forms.messages.tooShort,t):t.validity.tooLong||this.maxLength>0&&this.value.length>this.maxLength?this.internals.setValidity({tooLong:!0},Bt.forms.messages.tooLong,t):t.validity.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},Bt.forms.messages.rangeUnderflow,t):t.validity.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},Bt.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 n=new FormData;t.forEach(r=>{n.append(this.name,r)}),this.internals.setFormValue(n)}else this.internals.setFormValue(t)}valueChanged(t,n){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)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.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.ariaDisabled=!0),this.internals.setFormValue(this.value),this.manageValidity(this.inputRef.value)}};Ge([O({type:String,reflect:!0})],Ye.prototype,"id"),Ge([O({type:String,reflect:!0})],Ye.prototype,"name"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"required"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"disabled"),Ge([O({type:String,reflect:!0})],Ye.prototype,"placeholder"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"min"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"max"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"minlength"),Ge([O({type:Number,reflect:!0})],Ye.prototype,"maxlength"),Ge([O({type:String,reflect:!0})],Ye.prototype,"pattern"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"optionalTag"),Ge([O({type:String,reflect:!0})],Ye.prototype,"optionalText"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"requiredTag"),Ge([O({type:String,reflect:!0})],Ye.prototype,"requiredText"),Ge([O({type:Boolean,reflect:!0})],Ye.prototype,"hasError"),Ge([O({type:String,reflect:!0})],Ye.prototype,"errorMessage"),Ge([It()],Ye.prototype,"touched");/**
96
96
  * @license
97
97
  * Copyright 2017 Google LLC
98
98
  * SPDX-License-Identifier: BSD-3-Clause
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-react",
3
- "version": "12.10.2",
3
+ "version": "12.10.3",
4
4
  "description": "React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -48,7 +48,7 @@
48
48
  "devDependencies": {
49
49
  "@oslokommune/punkt-assets": "^12.7.3",
50
50
  "@oslokommune/punkt-css": "^12.10.2",
51
- "@oslokommune/punkt-elements": "^12.10.2",
51
+ "@oslokommune/punkt-elements": "^12.10.3",
52
52
  "@testing-library/jest-dom": "^6.5.0",
53
53
  "@testing-library/react": "^16.0.1",
54
54
  "@testing-library/user-event": "^14.5.2",
@@ -111,5 +111,5 @@
111
111
  "url": "https://github.com/oslokommune/punkt/issues"
112
112
  },
113
113
  "license": "MIT",
114
- "gitHead": "c3c82ba78515d746439b3b180886a8b0e6d4c358"
114
+ "gitHead": "d9dc54bfca760378252161f0c0e57251fbf8f6cd"
115
115
  }