@oslokommune/punkt-react 12.39.5 → 12.39.6
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/punkt-react.es.js
CHANGED
|
@@ -27892,8 +27892,8 @@ let ws = class extends Gr {
|
|
|
27892
27892
|
r.key === "Escape" && this.close(r);
|
|
27893
27893
|
}
|
|
27894
27894
|
handleBackdropClick(r) {
|
|
27895
|
-
var i
|
|
27896
|
-
|
|
27895
|
+
var i;
|
|
27896
|
+
this.closeOnBackdropClick && r.target === ((i = this.dialogRef) == null ? void 0 : i.value) && this.close(r);
|
|
27897
27897
|
}
|
|
27898
27898
|
isElementInViewport(r) {
|
|
27899
27899
|
const i = r.getBoundingClientRect();
|
package/dist/punkt-react.umd.js
CHANGED
|
@@ -1147,7 +1147,7 @@ You might need to use a local HTTP server (instead of file://): https://reactjs.
|
|
|
1147
1147
|
</div>`:qe}
|
|
1148
1148
|
${this.title?be`<div class="pkt-messagebox__title">${this.title}</div>`:qe}
|
|
1149
1149
|
<div class="pkt-messagebox__text" ${qt(this.defaultSlot)}></div>
|
|
1150
|
-
</div>`}};$h([z({type:Boolean,reflect:!0})],Td.prototype,"closable",2),$h([z({type:Boolean,reflect:!0})],Td.prototype,"compact",2),$h([z({type:String,reflect:!0})],Td.prototype,"title",2),$h([z({type:String,reflect:!0})],Td.prototype,"skin",2),$h([$n()],Td.prototype,"_isClosed",2),Td=$h([dr("pkt-messagebox")],Td);const G3={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},v0={props:G3};var K3=Object.defineProperty,Q3=Object.getOwnPropertyDescriptor,hl=(n,r,i,l)=>{for(var c=l>1?void 0:l?Q3(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&K3(r,i,c),c};let Qo=class extends Hr{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=v0.props.hideCloseButton.default,this.closeOnBackdropClick=v0.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=v0.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=dn(),this.dialogRef=dn(),this._isOpen=!1,this.close=(r,i=!1)=>{var l;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const c=document.activeElement;c&&!this.isElementInViewport(c)&&c.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:r},bubbles:!0,composed:!0})),i||(l=this.dialogRef.value)==null||l.close(),this.requestUpdate()},this.showModal=(r=null)=>{var i;this._isOpen=!0,(i=this.dialogRef.value)==null||i.showModal();const l=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var c;this.dialogRef.value&&((c=this.dialogRef.value)==null||c.focus())}),l&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:r},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new _a(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(r){super.firstUpdated(r),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>Xj).then(i=>i.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(r){r.key==="Escape"&&this.close(r)}handleBackdropClick(r){var i
|
|
1150
|
+
</div>`}};$h([z({type:Boolean,reflect:!0})],Td.prototype,"closable",2),$h([z({type:Boolean,reflect:!0})],Td.prototype,"compact",2),$h([z({type:String,reflect:!0})],Td.prototype,"title",2),$h([z({type:String,reflect:!0})],Td.prototype,"skin",2),$h([$n()],Td.prototype,"_isClosed",2),Td=$h([dr("pkt-messagebox")],Td);const G3={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},v0={props:G3};var K3=Object.defineProperty,Q3=Object.getOwnPropertyDescriptor,hl=(n,r,i,l)=>{for(var c=l>1?void 0:l?Q3(r,i):r,h=n.length-1,m;h>=0;h--)(m=n[h])&&(c=(l?m(r,i,c):m(c))||c);return l&&c&&K3(r,i,c),c};let Qo=class extends Hr{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=v0.props.hideCloseButton.default,this.closeOnBackdropClick=v0.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=v0.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=dn(),this.dialogRef=dn(),this._isOpen=!1,this.close=(r,i=!1)=>{var l;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const c=document.activeElement;c&&!this.isElementInViewport(c)&&c.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:r},bubbles:!0,composed:!0})),i||(l=this.dialogRef.value)==null||l.close(),this.requestUpdate()},this.showModal=(r=null)=>{var i;this._isOpen=!0,(i=this.dialogRef.value)==null||i.showModal();const l=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var c;this.dialogRef.value&&((c=this.dialogRef.value)==null||c.focus())}),l&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:r},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new _a(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(r){super.firstUpdated(r),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>Xj).then(i=>i.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(r){r.key==="Escape"&&this.close(r)}handleBackdropClick(r){var i;this.closeOnBackdropClick&&r.target===((i=this.dialogRef)==null?void 0:i.value)&&this.close(r)}isElementInViewport(r){const i=r.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&i.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const r={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},i={"pkt-modal__headingText":!0,"pkt-txt-24":!0},l={"pkt-modal__content":!0,"pkt-txt-18-light":!0},c=this.closeButtonSkin==="blue",h={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0},m={"pkt-btn":!0,[`pkt-btn--${c?"tertiary":"primary"}`]:!0,"pkt-btn--icon-only":!0,"pkt-btn--medium":!0};return be`
|
|
1151
1151
|
<dialog
|
|
1152
1152
|
class=${It(r)}
|
|
1153
1153
|
${qt(this.dialogRef)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-react",
|
|
3
|
-
"version": "12.39.
|
|
3
|
+
"version": "12.39.6",
|
|
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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@lit-labs/ssr-dom-shim": "^1.2.1",
|
|
40
40
|
"@lit/react": "^1.0.7",
|
|
41
|
-
"@oslokommune/punkt-elements": "^12.39.
|
|
41
|
+
"@oslokommune/punkt-elements": "^12.39.6",
|
|
42
42
|
"angular-html-parser": "^6.0.2",
|
|
43
43
|
"html-format": "^1.1.7",
|
|
44
44
|
"prettier": "^3.3.3",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
113
113
|
},
|
|
114
114
|
"license": "MIT",
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "16072dee66bffd73d5729bc858e8ee0db62c98a7"
|
|
116
116
|
}
|