@oslokommune/punkt-elements 12.6.4 → 12.6.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/{class-map-DuDzlp5t.cjs → class-map-DjxCaVFk.cjs} +1 -1
- package/dist/{class-map-CC5YmUWA.js → class-map-luGhSuLj.js} +1 -1
- package/dist/{index-CBp5twsn.js → index-B-KXmo65.js} +1 -1
- package/dist/{index-D8H97G5s.cjs → index-BYZhBzXZ.cjs} +1 -1
- package/dist/{index-D8wkW6WM.js → index-BkXggpNp.js} +12 -7
- package/dist/{index-d6Lj2RhC.js → index-CF6_-ZoF.js} +13 -12
- package/dist/{index-OhFn59AM.cjs → index-CzPkBTm-.cjs} +9 -4
- package/dist/{index-kJnGegz8.cjs → index-DAWAnAW_.cjs} +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +4 -4
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +4 -4
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +4 -4
- package/dist/pkt-component-template.cjs +1 -1
- package/dist/pkt-component-template.js +3 -3
- package/dist/pkt-datepicker.cjs +14 -13
- package/dist/pkt-datepicker.js +36 -36
- 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 +2 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +2 -2
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +4 -4
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +4 -4
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +4 -4
- package/dist/pkt-tag.cjs +2 -2
- package/dist/pkt-tag.js +13 -13
- package/dist/{ref-Bi2ZZNQq.cjs → ref-BuQtfKiL.cjs} +1 -1
- package/dist/{ref-bB529lv7.js → ref-rfvuMlT1.js} +1 -1
- package/package.json +3 -3
- package/src/components/calendar/index.ts +9 -4
- package/src/components/datepicker/index.ts +18 -5
package/dist/pkt-link.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as f, x as k, E as h, n as i } from "./index-
|
|
2
|
-
import { e as m, P as d, n as u } from "./ref-
|
|
3
|
-
import { e as P } from "./class-map-
|
|
1
|
+
import { P as f, x as k, E as h, n as i } from "./index-CF6_-ZoF.js";
|
|
2
|
+
import { e as m, P as d, n as u } from "./ref-rfvuMlT1.js";
|
|
3
|
+
import { e as P } from "./class-map-luGhSuLj.js";
|
|
4
4
|
import { t as y } from "./directive-Cxhakbpr.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-B-KXmo65.js";
|
|
6
6
|
const g = "pkt-link", v = !0, _ = {
|
|
7
7
|
href: {
|
|
8
8
|
name: "URL",
|
package/dist/pkt-messagebox.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BYZhBzXZ.cjs"),c=require("./ref-BuQtfKiL.cjs"),b=require("./class-map-DjxCaVFk.cjs"),d=require("./directive-DtixNHDT.cjs");require("./index-DAWAnAW_.cjs");const k="pkt-messagebox",u=!0,g={onClose:{description:"React: Event som trigges når meldingsboksen lukkes"},"on-close":{description:"Vue: Event som trigges når meldingsboksen lukkes"}},m={title:{name:"Tittel",description:"Tittelen på meldingsboksen",type:"string"},skin:{name:"Utseende",description:"Velg farge på meldingsboksen",type:["beige","blue","red","green"],default:"beige"},compact:{name:"Kompakt",description:"Gjør meldingsboksen mindre",type:"boolean",default:!1},closable:{name:"Kan lukkes",description:"Viser lukkeknapp",type:"boolean",default:!1}},h={default:{description:"Innholdet i meldingsboksen"}},p={name:k,"css-class":"pkt-messagebox",isElement:u,events:g,props:m,slots:h};var f=Object.defineProperty,x=Object.getOwnPropertyDescriptor,o=(i,t,n,l)=>{for(var s=l>1?void 0:l?x(t,n):t,r=i.length-1,a;r>=0;r--)(a=i[r])&&(s=(l?a(t,n,s):a(s))||s);return l&&s&&f(t,n,s),s};exports.PktMessagebox=class extends e.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closable=p.props.closable.default,this.compact=p.props.compact.default,this.title="",this.skin=p.props.skin.default,this._isClosed=!1,this.close=t=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:t},bubbles:!0}))},this.slotController=new c.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const t={"pkt-messagebox":!0,"pkt-messagebox--compact":this.compact,[`pkt-messagebox--${this.skin}`]:this.skin,"pkt-messagebox--closable":this.closable,"pkt-hide":this._isClosed};return e.x`<div class=${b.e(t)}>
|
|
2
2
|
${this.closable?e.x`<div class="pkt-messagebox__close">
|
|
3
3
|
<button
|
|
4
4
|
@click=${this.close}
|
package/dist/pkt-messagebox.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as b, P as k, x as c, E as d, n } from "./index-
|
|
2
|
-
import { e as u, P as g, n as h } from "./ref-
|
|
3
|
-
import { e as f } from "./class-map-
|
|
1
|
+
import { r as b, P as k, x as c, E as d, n } from "./index-CF6_-ZoF.js";
|
|
2
|
+
import { e as u, P as g, n as h } from "./ref-rfvuMlT1.js";
|
|
3
|
+
import { e as f } from "./class-map-luGhSuLj.js";
|
|
4
4
|
import { t as v } from "./directive-Cxhakbpr.js";
|
|
5
|
-
import "./index-
|
|
5
|
+
import "./index-B-KXmo65.js";
|
|
6
6
|
const _ = "pkt-messagebox", x = !0, y = {
|
|
7
7
|
onClose: {
|
|
8
8
|
description: "React: Event som trigges når meldingsboksen lukkes"
|
package/dist/pkt-tag.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./class-map-DjxCaVFk.cjs"),g=require("./directive-DtixNHDT.cjs"),t=require("./index-BYZhBzXZ.cjs"),o=require("./ref-BuQtfKiL.cjs");require("./index-DAWAnAW_.cjs");const h="pkt-tag",d=!0,k={closeTag:{type:"boolean",required:!1,default:!1},size:{required:!1,default:"medium",type:["small","medium","large"]},iconName:{type:"string",required:!1},skin:{required:!1,default:"blue",type:["blue","green","red","beige","yellow","gray","blue-light"]},textStyle:{required:!1,default:"normal-text",type:["thin-text","normal-text"]},type:{required:!1,default:"button",type:["button","submit","reset"]},ariaLabel:{type:"string",required:!1,default:"Lukk"}},f={default:{description:"Teksten til tag"}},a={name:h,"css-class":"pkt-tag",isElement:d,props:k,slots:f};var y=Object.defineProperty,b=Object.getOwnPropertyDescriptor,s=(n,e,r,l)=>{for(var i=l>1?void 0:l?b(e,r):e,p=n.length-1,c;p>=0;p--)(c=n[p])&&(i=(l?c(e,r,i):c(i))||i);return l&&i&&y(e,r,i),i};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=o.e(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=a.props.textStyle.default,this.iconName=void 0,this.type=a.props.type.default,this.ariaLabel=a.props.ariaLabel.default,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new o.PktSlotController(this,this.defaultSlot),this._isClosed=!1}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},r={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?t.x`
|
|
2
2
|
<button
|
|
3
|
-
class=${u.e(
|
|
3
|
+
class=${u.e(r)}
|
|
4
4
|
type=${this.type}
|
|
5
5
|
aria-label=${this.ariaLabel}
|
|
6
6
|
@click=${this.close}
|
package/dist/pkt-tag.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { e as h } from "./class-map-
|
|
1
|
+
import { e as h } from "./class-map-luGhSuLj.js";
|
|
2
2
|
import { t as d } from "./directive-Cxhakbpr.js";
|
|
3
|
-
import { r as y, P as g, x as p, n as l } from "./index-
|
|
4
|
-
import { e as m, P as k, n as f } from "./ref-
|
|
5
|
-
import "./index-
|
|
3
|
+
import { r as y, P as g, x as p, n as l } from "./index-CF6_-ZoF.js";
|
|
4
|
+
import { e as m, P as k, n as f } from "./ref-rfvuMlT1.js";
|
|
5
|
+
import "./index-B-KXmo65.js";
|
|
6
6
|
const b = "pkt-tag", S = !0, $ = {
|
|
7
7
|
closeTag: {
|
|
8
8
|
type: "boolean",
|
|
@@ -55,27 +55,27 @@ const b = "pkt-tag", S = !0, $ = {
|
|
|
55
55
|
ariaLabel: {
|
|
56
56
|
type: "string",
|
|
57
57
|
required: !1,
|
|
58
|
-
default: "
|
|
58
|
+
default: "Lukk"
|
|
59
59
|
}
|
|
60
60
|
}, _ = {
|
|
61
61
|
default: {
|
|
62
62
|
description: "Teksten til tag"
|
|
63
63
|
}
|
|
64
|
-
},
|
|
64
|
+
}, a = {
|
|
65
65
|
name: b,
|
|
66
66
|
"css-class": "pkt-tag",
|
|
67
67
|
isElement: S,
|
|
68
68
|
props: $,
|
|
69
69
|
slots: _
|
|
70
70
|
};
|
|
71
|
-
var x = Object.defineProperty, C = Object.getOwnPropertyDescriptor, e = (s,
|
|
72
|
-
for (var i =
|
|
73
|
-
(u = s[c]) && (i = (
|
|
74
|
-
return
|
|
71
|
+
var x = Object.defineProperty, C = Object.getOwnPropertyDescriptor, e = (s, r, n, o) => {
|
|
72
|
+
for (var i = o > 1 ? void 0 : o ? C(r, n) : r, c = s.length - 1, u; c >= 0; c--)
|
|
73
|
+
(u = s[c]) && (i = (o ? u(r, n, i) : u(i)) || i);
|
|
74
|
+
return o && i && x(r, n, i), i;
|
|
75
75
|
};
|
|
76
76
|
let t = class extends g {
|
|
77
77
|
constructor() {
|
|
78
|
-
super(), this.defaultSlot = m(), this.closeTag =
|
|
78
|
+
super(), this.defaultSlot = m(), this.closeTag = a.props.closeTag.default, this.size = a.props.size.default, this.skin = a.props.skin.default, this.textStyle = a.props.textStyle.default, this.iconName = void 0, this.type = a.props.type.default, this.ariaLabel = a.props.ariaLabel.default, this._isClosed = !1, this.close = (s) => {
|
|
79
79
|
this._isClosed = !0, this.dispatchEvent(
|
|
80
80
|
new CustomEvent("close", { detail: { origin: s }, bubbles: !0, composed: !0 })
|
|
81
81
|
), this.dispatchEvent(
|
|
@@ -89,7 +89,7 @@ let t = class extends g {
|
|
|
89
89
|
[`pkt-tag--${this.size}`]: !!this.size,
|
|
90
90
|
[`pkt-tag--${this.skin}`]: !!this.skin,
|
|
91
91
|
[`pkt-tag--${this.textStyle}`]: !!this.textStyle
|
|
92
|
-
},
|
|
92
|
+
}, r = {
|
|
93
93
|
"pkt-tag": !0,
|
|
94
94
|
"pkt-btn": !0,
|
|
95
95
|
"pkt-btn--tertiary": !0,
|
|
@@ -101,7 +101,7 @@ let t = class extends g {
|
|
|
101
101
|
};
|
|
102
102
|
return this.closeTag ? p`
|
|
103
103
|
<button
|
|
104
|
-
class=${h(
|
|
104
|
+
class=${h(r)}
|
|
105
105
|
type=${this.type}
|
|
106
106
|
aria-label=${this.ariaLabel}
|
|
107
107
|
@click=${this.close}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const A=require("./index-
|
|
1
|
+
"use strict";const A=require("./index-BYZhBzXZ.cjs"),a=require("./directive-DtixNHDT.cjs");class p{constructor(e,...s){this.nodes=[],this.host=e,this.host.addController(this),this.slots=s,this.nodes=[]}hostConnected(){Array.from(this.host.childNodes).forEach(e=>{var s;if(e.nodeName==="#text"){if((s=e.nodeValue)!=null&&s.trim()){const i=document==null?void 0:document.createElement("template");i.content.appendChild(e),this.nodes.push(i)}}else this.nodes.push(e)})}hostUpdated(){this.slots.forEach(e=>{if(!e.value)return;const s=e.value.getAttribute("name"),i=this.nodes.flatMap(o=>o.getAttribute&&o.getAttribute("slot")==s?this.nodeFromElement(o,e):[]);i.length&&e.value.replaceChildren(...i)})}nodeFromElement(e,s){var i;return e===((i=s.value)==null?void 0:i.parentNode)?[]:e instanceof HTMLTemplateElement?Array.from(e.content.childNodes):e}}/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.6",
|
|
4
4
|
"description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo Origo",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@oslokommune/punkt-assets": "^12.4.0",
|
|
31
|
-
"@oslokommune/punkt-css": "^12.6.
|
|
31
|
+
"@oslokommune/punkt-css": "^12.6.6",
|
|
32
32
|
"sass": "^1.78.0",
|
|
33
33
|
"typescript": "^5.6.2",
|
|
34
34
|
"vite": "^5.4.4",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
56
56
|
},
|
|
57
57
|
"license": "MIT",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "936cdb5ca60100a3356cfbf03994c85eebba732e"
|
|
59
59
|
}
|
|
@@ -264,7 +264,12 @@ export class PktCalendar extends PktElement {
|
|
|
264
264
|
role="grid"
|
|
265
265
|
?aria-multiselectable=${this.range || this.multiple}
|
|
266
266
|
>
|
|
267
|
-
|
|
267
|
+
<thead>
|
|
268
|
+
${this.renderDayNames()}
|
|
269
|
+
</thead>
|
|
270
|
+
<tbody>
|
|
271
|
+
${this.renderCalendarBody()}
|
|
272
|
+
</tbody>
|
|
268
273
|
</table>
|
|
269
274
|
</div>
|
|
270
275
|
`
|
|
@@ -273,12 +278,12 @@ export class PktCalendar extends PktElement {
|
|
|
273
278
|
private renderDayNames() {
|
|
274
279
|
const days = []
|
|
275
280
|
if (this.weeknumbers) {
|
|
276
|
-
days.push(html`<
|
|
281
|
+
days.push(html`<th><div>${this.weekString}</div></th>`)
|
|
277
282
|
}
|
|
278
283
|
for (let i = 0; i < this.dayStrings.length; i++) {
|
|
279
|
-
days.push(html`<
|
|
284
|
+
days.push(html`<th><div>${this.dayStrings[i]}</div></th>`)
|
|
280
285
|
}
|
|
281
|
-
return html`<tr class="pkt-cal-week-row"
|
|
286
|
+
return html`<tr class="pkt-cal-week-row">
|
|
282
287
|
${days}
|
|
283
288
|
</tr>`
|
|
284
289
|
}
|
|
@@ -248,6 +248,10 @@ export class PktDatepicker extends PktInputElement {
|
|
|
248
248
|
if (e.key === ',' || e.key === 'Enter') {
|
|
249
249
|
this.inputRef.value?.blur()
|
|
250
250
|
}
|
|
251
|
+
if (e.key === 'Space' || e.key === ' ') {
|
|
252
|
+
e.preventDefault()
|
|
253
|
+
this.toggleCalendar(e)
|
|
254
|
+
}
|
|
251
255
|
}}
|
|
252
256
|
@input=${(e: Event) => {
|
|
253
257
|
this.onInput()
|
|
@@ -293,6 +297,10 @@ export class PktDatepicker extends PktInputElement {
|
|
|
293
297
|
if (e.key === ',' || e.key === 'Enter') {
|
|
294
298
|
this.inputRef.value?.blur()
|
|
295
299
|
}
|
|
300
|
+
if (e.key === 'Space' || e.key === ' ') {
|
|
301
|
+
e.preventDefault()
|
|
302
|
+
this.toggleCalendar(e)
|
|
303
|
+
}
|
|
296
304
|
}}
|
|
297
305
|
@input=${(e: Event) => {
|
|
298
306
|
this.onInput()
|
|
@@ -341,6 +349,10 @@ export class PktDatepicker extends PktInputElement {
|
|
|
341
349
|
if (e.key === ',' || e.key === 'Enter') {
|
|
342
350
|
this.inputRefTo.value?.blur()
|
|
343
351
|
}
|
|
352
|
+
if (e.key === 'Space' || e.key === ' ') {
|
|
353
|
+
e.preventDefault()
|
|
354
|
+
this.toggleCalendar(e)
|
|
355
|
+
}
|
|
344
356
|
}}
|
|
345
357
|
@input=${(e: Event) => {
|
|
346
358
|
this.onInput()
|
|
@@ -421,6 +433,10 @@ export class PktDatepicker extends PktInputElement {
|
|
|
421
433
|
e.preventDefault()
|
|
422
434
|
this.addToSelected(e)
|
|
423
435
|
}
|
|
436
|
+
if (e.key === 'Space' || e.key === ' ') {
|
|
437
|
+
e.preventDefault()
|
|
438
|
+
this.toggleCalendar(e)
|
|
439
|
+
}
|
|
424
440
|
}}
|
|
425
441
|
?disabled=${this.disabled || (this.maxlength && this._value.length >= this.maxlength)}
|
|
426
442
|
@change=${(e: Event) => {
|
|
@@ -442,7 +458,8 @@ export class PktDatepicker extends PktInputElement {
|
|
|
442
458
|
<pkt-tag
|
|
443
459
|
.id="${this.id + date + '-tag'}"
|
|
444
460
|
closeTag
|
|
445
|
-
|
|
461
|
+
ariaLabel="${this.strings.calendar.deleteDate} ${this.fromISOtoLocal(date)}"
|
|
462
|
+
@close=${() => this.calRef.value?.handleDateSelect(this.fromISOToDate(date))}
|
|
446
463
|
>${this.fromISOtoLocal(date)}</pkt-tag
|
|
447
464
|
>
|
|
448
465
|
`,
|
|
@@ -612,9 +629,5 @@ export class PktDatepicker extends PktInputElement {
|
|
|
612
629
|
public async toggleCalendar(e: Event) {
|
|
613
630
|
e.preventDefault()
|
|
614
631
|
this.calendarOpen ? this.hideCalendar() : this.showCalendar()
|
|
615
|
-
await sleep(20)
|
|
616
|
-
if (this.isMobileSafari) {
|
|
617
|
-
this.calRef.value?.focusOnCurrentDate()
|
|
618
|
-
}
|
|
619
632
|
}
|
|
620
633
|
}
|