@oslokommune/punkt-elements 13.13.1 → 13.15.2
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 +35 -0
- package/dist/{alert-Dh1YhaBq.js → alert-BD1H1Rxn.js} +1 -1
- package/dist/{alert-Ci7WvRXi.cjs → alert-BXbmjri0.cjs} +1 -1
- package/dist/button-1jYzMALk.cjs +19 -0
- package/dist/{button-CCFAUJa0.js → button-lDOnZON6.js} +24 -16
- package/dist/{combobox-BJ1gA0f0.cjs → combobox-BX1YbDHV.cjs} +1 -1
- package/dist/{combobox-Ct0NNY1p.js → combobox-BdDZU1bk.js} +1 -1
- package/dist/{consent-B2hIQh4b.js → consent-CYFXjOXF.js} +1 -1
- package/dist/{consent-BeOjxQdR.cjs → consent-Cgc6nuiP.cjs} +1 -1
- package/dist/{datepicker-DVqmQAOe.cjs → datepicker-C4joeEiQ.cjs} +9 -9
- package/dist/{datepicker-B8mifBAm.js → datepicker-lnxklOi4.js} +63 -57
- package/dist/index.d.ts +4 -0
- package/dist/{input-wrapper-CKJU0QWG.js → input-wrapper-CiqUL7my.js} +1 -1
- package/dist/{input-wrapper-BsQ7oFMd.cjs → input-wrapper-D9kFsTCN.cjs} +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +9 -9
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/{select-D-m1PhpA.cjs → select-D7Ne5gv0.cjs} +1 -1
- package/dist/{select-BG2MBQbh.js → select-_KoHkDbx.js} +1 -1
- package/dist/{textarea-aUG3S7C2.cjs → textarea-CYHYvdCf.cjs} +1 -1
- package/dist/{textarea-DCKKhs1B.js → textarea-DuOBX5is.js} +1 -1
- package/dist/{textinput-B5Ai5R8L.js → textinput-CrcXv_is.js} +1 -1
- package/dist/{textinput-mUERucRy.cjs → textinput-DYVtoRMy.cjs} +1 -1
- package/package.json +3 -3
- package/src/components/button/button.ts +7 -0
- package/src/components/datepicker/datepicker.ts +9 -0
- package/dist/button-CXJQ_Wgl.cjs +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [13.15.2](https://github.com/oslokommune/punkt/compare/13.15.1...13.15.2) (2025-11-07)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
Ingen
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
Ingen
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
Ingen
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [13.13.2](https://github.com/oslokommune/punkt/compare/13.13.1...13.13.2) (2025-11-03)
|
|
26
|
+
|
|
27
|
+
### ⚠ BREAKING CHANGES
|
|
28
|
+
Ingen
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
Ingen
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
* Støtt full bredde for knapper også utenom mobilvisning (#3103).
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Chores
|
|
38
|
+
Ingen
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
|
|
8
43
|
## [13.13.1](https://github.com/oslokommune/punkt/compare/13.13.0...13.13.1) (2025-11-03)
|
|
9
44
|
|
|
10
45
|
### ⚠ BREAKING CHANGES
|
|
@@ -5,7 +5,7 @@ import { P as m } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
|
5
5
|
import { e as _, n as b } from "./ref-Xa5dbh--.js";
|
|
6
6
|
import { u as y } from "./classutils-RQs1k6D9.js";
|
|
7
7
|
import "./icon-1dy7UZcu.js";
|
|
8
|
-
import "./button-
|
|
8
|
+
import "./button-lDOnZON6.js";
|
|
9
9
|
const C = { skin: { default: "info" }, ariaLive: { default: "polite" }, compact: { default: !1 }, closeAlert: { default: !1 } }, c = {
|
|
10
10
|
props: C
|
|
11
11
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const c=require("./class-map-C_erArZz.cjs"),t=require("./element-CJ_QKaki.cjs"),d=require("./state-DSjcvzDN.cjs"),h=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./ref-BFa5Utho.cjs"),k=require("./classutils-BwNK82ZQ.cjs");require("./icon-BGuizDwk.cjs");require("./button-
|
|
1
|
+
"use strict";const c=require("./class-map-C_erArZz.cjs"),t=require("./element-CJ_QKaki.cjs"),d=require("./state-DSjcvzDN.cjs"),h=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./ref-BFa5Utho.cjs"),k=require("./classutils-BwNK82ZQ.cjs");require("./icon-BGuizDwk.cjs");require("./button-1jYzMALk.cjs");const v={skin:{default:"info"},ariaLive:{default:"polite"},compact:{default:!1},closeAlert:{default:!1}},a={props:v};var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,i=(o,e,s,l)=>{for(var r=l>1?void 0:l?_(e,s):e,p=o.length-1,n;p>=0;p--)(n=o[p])&&(r=(l?n(e,s,r):n(r))||r);return l&&r&&f(e,s,r),r};exports.PktAlert=class extends t.PktElement{constructor(){super(),this.defaultSlot=u.e(),this.compact=a.props.compact.default,this.title="",this.skin=a.props.skin.default,this.ariaLive=a.props.ariaLive.default,this["aria-live"]=null,this.closeAlert=a.props.closeAlert.default,this.date=null,this.role="status",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 h.PktSlotController(this,this.defaultSlot),this._isClosed=!1}connectedCallback(){super.connectedCallback(),this["aria-live"]=this.getAttribute("aria-live")||this.ariaLive}attributeChangedCallback(e,s,l){e==="ariaLive"&&(this["aria-live"]=l),super.attributeChangedCallback(e,s,l)}updated(e){super.updated(e),e.has("ariaLive")&&(this["aria-live"]=this.ariaLive),e.has("_isClosed")&&k.updateClassAttribute(this,"pkt-hide",this._isClosed)}render(){const e={"pkt-alert":!0,"pkt-alert--compact":this.compact,[`pkt-alert--${this.skin}`]:this.skin,"pkt-hide":this._isClosed},s={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return t.x`
|
|
2
2
|
<div class=${c.e(e)} aria-live=${this["aria-live"]}>
|
|
3
3
|
<div class=${c.e(s)}>
|
|
4
4
|
<pkt-icon
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";const t=require("./element-CJ_QKaki.cjs"),h=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./class-map-C_erArZz.cjs"),a=require("./if-defined-Bc9-_I01.cjs"),d=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");var c=Object.defineProperty,k=Object.getOwnPropertyDescriptor,e=(r,i,s,n)=>{for(var o=n>1?void 0:n?k(i,s):i,l=r.length-1,p;l>=0;l--)(p=r[l])&&(o=(n?p(i,s,o):p(o))||o);return n&&o&&c(i,s,o),o};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/latest/animations/";exports.PktButton=class extends t.PktElement{constructor(){super(),this.defaultSlot=d.e(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new h.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.preventDefault(),i.stopImmediatePropagation())},!0),this.addEventListener("keydown",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopImmediatePropagation())},!0)}attributeChangedCallback(i,s,n){super.attributeChangedCallback(i,s,n),i==="disabled"&&n==="false"&&(this.disabled=!1),(i==="isloading"||i==="isLoading")&&n==="false"&&(this.isLoading=!1)}firstUpdated(i){super.firstUpdated(i),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const i=this.form??this.getAttribute("form")??void 0,s={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return t.x`
|
|
2
|
+
<button
|
|
3
|
+
class=${u.e(s)}
|
|
4
|
+
type=${this.type}
|
|
5
|
+
?disabled=${!!this.disabled}
|
|
6
|
+
aria-busy=${a.o(this.isLoading?"true":void 0)}
|
|
7
|
+
aria-disabled=${a.o(this.disabled||this.isLoading?"true":void 0)}
|
|
8
|
+
form=${a.o(i)}
|
|
9
|
+
>
|
|
10
|
+
${this.isLoading?t.x`<pkt-icon
|
|
11
|
+
class="pkt-btn__icon pkt-btn__spinner"
|
|
12
|
+
name="spinner-blue"
|
|
13
|
+
path=${a.o(this.loadingAnimationPath)}
|
|
14
|
+
></pkt-icon>`:t.E}
|
|
15
|
+
${this.variant!=="label-only"?t.x`<pkt-icon class="pkt-btn__icon pkt-icon" name=${this.iconName}></pkt-icon>`:t.E}
|
|
16
|
+
<span class="pkt-btn__text" ${d.n(this.defaultSlot)}></span>
|
|
17
|
+
${this.variant==="icons-right-and-left"?t.x`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:t.E}
|
|
18
|
+
</button>
|
|
19
|
+
`}};e([t.n({type:String})],exports.PktButton.prototype,"iconName",2);e([t.n({type:String})],exports.PktButton.prototype,"secondIconName",2);e([t.n({type:String})],exports.PktButton.prototype,"mode",2);e([t.n({type:String})],exports.PktButton.prototype,"size",2);e([t.n({type:Boolean,attribute:"full-width"})],exports.PktButton.prototype,"fullWidth",2);e([t.n({type:Boolean,attribute:"full-width-on-mobile"})],exports.PktButton.prototype,"fullWidthOnMobile",2);e([t.n({type:String})],exports.PktButton.prototype,"color",2);e([t.n({type:String})],exports.PktButton.prototype,"skin",2);e([t.n({type:String})],exports.PktButton.prototype,"variant",2);e([t.n({type:String,reflect:!0})],exports.PktButton.prototype,"state",2);e([t.n({type:String,reflect:!0})],exports.PktButton.prototype,"type",2);e([t.n({type:String})],exports.PktButton.prototype,"form",2);e([t.n({type:Boolean,reflect:!0})],exports.PktButton.prototype,"isLoading",2);e([t.n({type:Boolean,reflect:!0})],exports.PktButton.prototype,"disabled",2);e([t.n({type:String})],exports.PktButton.prototype,"loadingAnimationPath",2);exports.PktButton=e([t.t("pkt-button")],exports.PktButton);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { P as b, E as
|
|
2
|
-
import { P as
|
|
3
|
-
import { e as
|
|
4
|
-
import { o as
|
|
1
|
+
import { P as b, E as f, x as l, n as s, a as c } from "./element-CRDRygXu.js";
|
|
2
|
+
import { P as u } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
3
|
+
import { e as m } from "./class-map-wy7PUk0P.js";
|
|
4
|
+
import { o as p } from "./if-defined-BWZGb3bh.js";
|
|
5
5
|
import { e as y, n as k } from "./ref-Xa5dbh--.js";
|
|
6
6
|
import "./icon-1dy7UZcu.js";
|
|
7
7
|
var g = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, e = (t, o, n, r) => {
|
|
@@ -12,7 +12,7 @@ var g = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, e = (t, o, n
|
|
|
12
12
|
window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/latest/animations/";
|
|
13
13
|
let i = class extends b {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(), this.defaultSlot = y(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.form = void 0, this.isLoading = !1, this.disabled = !1, this.loadingAnimationPath = window.pktAnimationPath, this.slotController = new
|
|
15
|
+
super(), this.defaultSlot = y(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.fullWidth = !1, this.fullWidthOnMobile = !1, this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.form = void 0, this.isLoading = !1, this.disabled = !1, this.loadingAnimationPath = window.pktAnimationPath, this.slotController = new u(this, this.defaultSlot);
|
|
16
16
|
}
|
|
17
17
|
// Lifecycle
|
|
18
18
|
connectedCallback() {
|
|
@@ -45,26 +45,28 @@ let i = class extends b {
|
|
|
45
45
|
[`pkt-btn--${this.variant}`]: !!this.variant,
|
|
46
46
|
[`pkt-btn--${this.color}`]: !!this.color,
|
|
47
47
|
[`pkt-btn--${this.state}`]: !!this.state,
|
|
48
|
+
"pkt-btn--full": !!this.fullWidth,
|
|
49
|
+
"pkt-btn--full-small": !!this.fullWidthOnMobile,
|
|
48
50
|
"pkt-btn--disabled": !!this.disabled,
|
|
49
51
|
"pkt-btn--isLoading": !!this.isLoading
|
|
50
52
|
};
|
|
51
|
-
return
|
|
53
|
+
return l`
|
|
52
54
|
<button
|
|
53
|
-
class=${
|
|
55
|
+
class=${m(o)}
|
|
54
56
|
type=${this.type}
|
|
55
57
|
?disabled=${!!this.disabled}
|
|
56
|
-
aria-busy=${
|
|
57
|
-
aria-disabled=${
|
|
58
|
-
form=${
|
|
58
|
+
aria-busy=${p(this.isLoading ? "true" : void 0)}
|
|
59
|
+
aria-disabled=${p(this.disabled || this.isLoading ? "true" : void 0)}
|
|
60
|
+
form=${p(t)}
|
|
59
61
|
>
|
|
60
|
-
${this.isLoading ?
|
|
62
|
+
${this.isLoading ? l`<pkt-icon
|
|
61
63
|
class="pkt-btn__icon pkt-btn__spinner"
|
|
62
64
|
name="spinner-blue"
|
|
63
|
-
path=${
|
|
64
|
-
></pkt-icon>` :
|
|
65
|
-
${this.variant !== "label-only" ?
|
|
65
|
+
path=${p(this.loadingAnimationPath)}
|
|
66
|
+
></pkt-icon>` : f}
|
|
67
|
+
${this.variant !== "label-only" ? l`<pkt-icon class="pkt-btn__icon pkt-icon" name=${this.iconName}></pkt-icon>` : f}
|
|
66
68
|
<span class="pkt-btn__text" ${k(this.defaultSlot)}></span>
|
|
67
|
-
${this.variant === "icons-right-and-left" ?
|
|
69
|
+
${this.variant === "icons-right-and-left" ? l`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>` : f}
|
|
68
70
|
</button>
|
|
69
71
|
`;
|
|
70
72
|
}
|
|
@@ -81,6 +83,12 @@ e([
|
|
|
81
83
|
e([
|
|
82
84
|
s({ type: String })
|
|
83
85
|
], i.prototype, "size", 2);
|
|
86
|
+
e([
|
|
87
|
+
s({ type: Boolean, attribute: "full-width" })
|
|
88
|
+
], i.prototype, "fullWidth", 2);
|
|
89
|
+
e([
|
|
90
|
+
s({ type: Boolean, attribute: "full-width-on-mobile" })
|
|
91
|
+
], i.prototype, "fullWidthOnMobile", 2);
|
|
84
92
|
e([
|
|
85
93
|
s({ type: String })
|
|
86
94
|
], i.prototype, "color", 2);
|
|
@@ -109,7 +117,7 @@ e([
|
|
|
109
117
|
s({ type: String })
|
|
110
118
|
], i.prototype, "loadingAnimationPath", 2);
|
|
111
119
|
i = e([
|
|
112
|
-
|
|
120
|
+
c("pkt-button")
|
|
113
121
|
], i);
|
|
114
122
|
export {
|
|
115
123
|
i as P
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("./element-CJ_QKaki.cjs"),c=require("./if-defined-Bc9-_I01.cjs"),d=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),y=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs"),$=require("./input-element-j9znzLWz.cjs"),I=require("./pkt-options-controller-CiuBG6Lt.cjs"),w=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-
|
|
1
|
+
"use strict";const a=require("./element-CJ_QKaki.cjs"),c=require("./if-defined-Bc9-_I01.cjs"),d=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),y=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs"),$=require("./input-element-j9znzLWz.cjs"),I=require("./pkt-options-controller-CiuBG6Lt.cjs"),w=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-D9kFsTCN.cjs");require("./icon-BGuizDwk.cjs");require("./tag-EFUKrc8q.cjs");require("./listbox-CsGiqzD0.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,h=(v,e,t,i)=>{for(var s=i>1?void 0:i?A(e,t):e,n=v.length-1,l;n>=0;n--)(l=v[n])&&(s=(i?l(e,t,s):l(s))||s);return i&&s&&V(e,t,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new I.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e;if(super.connectedCallback(),document&&document.body.addEventListener("click",t=>{this._isOptionsOpen&&!this.contains(t.target)&&this.handleFocusOut(t)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const t=((e=this.options)==null?void 0:e.filter(i=>i.userAdded))||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const t=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(s.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(s.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(s.description=i.getAttribute("description")||void 0),s.fulltext=s.value+s.label+(s.prefix||""),t.push(s)}),t.length&&(this.options=[...t],this._options=[...t])}}updated(e){if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("defaultOptions")&&this.defaultOptions.length){const t=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const s=(e.get("options")||this._options||[]).filter(l=>l&&l.userAdded).filter(l=>!(Array.isArray(this.options)?this.options:[]).some(o=>o.value===l.value)),n=[...s,...this.options];this._options=n,s.length>0&&(this.options=n),this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const o=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,o)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return a.x`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
.label=${this.label}
|
|
4
4
|
.helptext=${this.helptext}
|
|
@@ -7,7 +7,7 @@ import { c as R } from "./repeat-CJ79egkN.js";
|
|
|
7
7
|
import { P as V } from "./input-element-BcFmygSF.js";
|
|
8
8
|
import { P as A } from "./pkt-options-controller-CZO1nxZ8.js";
|
|
9
9
|
import { P as C } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
10
|
-
import "./input-wrapper-
|
|
10
|
+
import "./input-wrapper-CiqUL7my.js";
|
|
11
11
|
import "./icon-1dy7UZcu.js";
|
|
12
12
|
import "./tag-CqMgt01I.js";
|
|
13
13
|
import "./listbox-DlJevu8O.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./element-CJ_QKaki.cjs");require("./button-
|
|
1
|
+
"use strict";const o=require("./element-CJ_QKaki.cjs");require("./button-1jYzMALk.cjs");require("./icon-BGuizDwk.cjs");const k={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"}}}}};var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,s=(r,e,t,n)=>{for(var i=n>1?void 0:n?p(e,t):e,a=r.length-1,l;a>=0;a--)(l=r[a])&&(i=(n?l(e,t,i):l(i))||i);return n&&i&&d(e,t,i),i};let c=null;function u(){return c||(c=new Promise((r,e)=>{if(document.querySelector("#oslo-consent-script")){r();return}const t=document.createElement("script");t.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.js",t.id="oslo-consent-script",t.onload=()=>r(),t.onerror=e,document.head.appendChild(t);const n=document.createElement("link");n.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.1.0.css",n.type="text/css",n.rel="stylesheet",n.id="oslo-consent-styles",document.head.appendChild(n)}),c)}exports.PktConsent=class extends o.PktElement{constructor(){super(),this.devMode=!1,this.hotjarId=null,this.googleAnalyticsId=null,this.cookieDomain=null,this.cookieSecure=null,this.cookieExpiryDays=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||k.i18n[this.i18nLanguage].contentPresentation.buttons.settings}disconnectedCallback(){var e;super.disconnectedCallback(),this._cookieEventHandler&&((e=window.__cookieEvents)==null||e.off("CookieManager.setCookie",this._cookieEventHandler))}returnJsonOrObject(e){let t;try{t=JSON.parse(e)}catch{t=e}return t}emitCookieConsents(e){const n=this.returnJsonOrObject(e.value).items.reduce((i,a)=>(i[a.name]=a.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:n,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 u(),this.triggerInit()}triggerInit(){window.document.dispatchEvent(new Event("CookieBannerReady",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const n={value:window.cookieBanner.cookieConsent.getConsentCookie()};window.setTimeout(()=>this.emitCookieConsents(n),0),this._cookieEventHandler&&window.__cookieEvents.off("CookieManager.setCookie",this._cookieEventHandler),this._cookieEventHandler=i=>{this.emitCookieConsents(i)},window.__cookieEvents.on("CookieManager.setCookie",this._cookieEventHandler)}})}openModal(e){var t;e.preventDefault(),(t=window.cookieBanner)!=null&&t.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?o.x`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?o.x`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
|
|
2
2
|
<pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
|
|
3
3
|
${this.triggerText}
|
|
4
4
|
</a>`:this.triggerType==="icon"?o.x`<pkt-button
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";const a=require("./element-CJ_QKaki.cjs"),S=require("./state-DSjcvzDN.cjs"),
|
|
1
|
+
"use strict";const a=require("./element-CJ_QKaki.cjs"),S=require("./state-DSjcvzDN.cjs"),o=require("./calendar-BaMrdMDZ.cjs"),_=require("./input-element-j9znzLWz.cjs"),p=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");require("./input-wrapper-D9kFsTCN.cjs");const k=require("./class-map-C_erArZz.cjs"),I=require("./repeat-BZb41H64.cjs");require("./tag-EFUKrc8q.cjs");const O=require("./stringutils-CkVRq4jP.cjs"),f=require("./if-defined-Bc9-_I01.cjs"),B=require("./pkt-slot-controller-BzddBp7z.cjs"),A=i=>new Promise(e=>setTimeout(e,i)),$={isIOS(){const i=navigator.userAgent;return!!(/iP(hone|od|ad)/.test(i)||/Macintosh/.test(i)&&"ontouchend"in document)}},v={parseValue(i){return i?Array.isArray(i)?i.filter(Boolean):typeof i=="string"?i.split(",").filter(Boolean):String(i).split(",").filter(Boolean):[]},formatValue(i){return i.join(",")},normalizeNameForMultiple(i,e,t){return i?(e||t)&&!i.endsWith("[]")?i+"[]":i:null},normalizeStringArray(i){return typeof i=="string"?i.split(",").filter(Boolean):Array.isArray(i)?i:[]},validateRangeOrder(i){return!i||i.length!==2?!0:o.isValidDateRange(i[0],i[1])},sortDates(i){return o.sortDateStrings(i)},filterSelectableDates(i,e,t,s,n){return o.filterSelectableDates(i,e,t,s,n)}},M={getInputType(){return $.isIOS()?"text":"date"}},w={submitForm(i){var t;const e=(t=i.internals)==null?void 0:t.form;e&&e.requestSubmit()},submitFormOrFallback(i,e){const t=i==null?void 0:i.form;t?t.requestSubmit():e()},validateDateInput(i,e,t,s,n){var l,h,E,T;const r=i.value;r&&(t&&t>r?e.setValidity({rangeUnderflow:!0},((h=(l=n==null?void 0:n.forms)==null?void 0:l.messages)==null?void 0:h.rangeUnderflow)||"Value is below minimum",i):s&&s<r&&e.setValidity({rangeOverflow:!0},((T=(E=n==null?void 0:n.forms)==null?void 0:E.messages)==null?void 0:T.rangeOverflow)||"Value is above maximum",i))}},x={addToSelected(i,e,t,s){const n=i.target;if(!n.value)return;const r=t?o.newDate(t):null,l=s?o.newDate(s):null,h=o.newDate(n.value.split(",")[0]);h&&!isNaN(h.getTime())&&(!r||h>=r)&&(!l||h<=l)&&e.value&&e.value.handleDateSelect(h),n.value=""},handleCalendarPosition(i,e,t=!1){var h;if(!i.value||!e.value)return;const s=((h=e.value.parentElement)==null?void 0:h.getBoundingClientRect())||e.value.getBoundingClientRect(),n=t?s.height+30:s.height,r=i.value.getBoundingClientRect().height;let l=t?"calc(100% - 30px)":"100%";s&&s.top+r>window.innerHeight&&s.top-r>0&&(l=`calc(100% - ${n}px - ${r}px)`),i.value.style.top=l}},C={getInputClasses(i,e,t,s,n,r){return{"pkt-input":!0,"pkt-datepicker__input":!0,"pkt-input--fullwidth":i,"pkt-datepicker--hasrangelabels":e,"pkt-datepicker--multiple":t,"pkt-datepicker--range":s,"ios-readonly-hack":n===!1&&r==="text"}},getButtonClasses(){return{"pkt-input-icon":!0,"pkt-btn":!0,"pkt-btn--icon-only":!0,"pkt-btn--tertiary":!0,"pkt-datepicker__calendar-button":!0}},getRangeLabelClasses(i){return{"pkt-input-prefix":i,"pkt-hide":!i}}},R={processDateSelection(i,e,t){return!e&&!t?i[0]||"":Array.isArray(i)?i.join(","):i},updateInputValues(i,e,t,s,n,r){i.value&&(s&&(e!=null&&e.value)?(i.value.value=t[0]??"",e.value.value=t[1]??"",r(i.value),r(e.value)):n||(i.value.value=t.length?t[0]:"",r(i.value)))},processRangeBlur(i,e,t,s,n){var l;const r=i.target;if(r.value){n(r);const h=o.fromISOToDate(r.value);h&&e[0]!==r.value&&e[1]&&(s(),(l=t==null?void 0:t.value)==null||l.handleDateSelect(h))}else e[0]&&s()}},b={handleInputKeydown(i,e,t,s,n,r){const{key:l}=i;l===","&&(i.preventDefault(),r?r(i):n&&n()),(l==="Space"||l===" ")&&(i.preventDefault(),e(i)),l==="Enter"&&(i.preventDefault(),t?t():s?s():n&&n())},handleButtonKeydown(i,e){const{key:t}=i;(t==="Enter"||t===" "||t==="Space")&&(i.preventDefault(),e(i))}};var F=Object.defineProperty,j=Object.getOwnPropertyDescriptor,P=(i,e,t,s)=>{for(var n=s>1?void 0:s?j(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&F(e,t,n),n};exports.PktDateTags=class extends a.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=O.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},a.x`
|
|
2
2
|
<div class=${k.e(this.classes)} aria-live="polite">
|
|
3
3
|
${Array.isArray(this.dates)&&this.dates[0]?I.c(v.sortDates((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return a.x` <pkt-tag
|
|
4
4
|
id=${this.idBase+e+"-tag"}
|
|
5
5
|
closeTag
|
|
6
6
|
@close=${()=>{this.dispatchEvent(new CustomEvent("date-tag-removed",{detail:e}))}}
|
|
7
|
-
.ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${
|
|
7
|
+
.ariaLabel=${`${(t=this.strings)==null?void 0:t.calendar.deleteDate} ${o.fromISOtoLocal(e,this.dateformat)}`}
|
|
8
8
|
>
|
|
9
|
-
<time datetime=${e}>${
|
|
9
|
+
<time datetime=${e}>${o.fromISOtoLocal(e,this.dateformat)}</time>
|
|
10
10
|
</pkt-tag>`}):a.E}
|
|
11
11
|
</div>
|
|
12
|
-
`}};P([a.n({type:Array})],exports.PktDateTags.prototype,"dates",2);P([a.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);P([a.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);P([a.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=P([a.t("pkt-date-tags")],exports.PktDateTags);const q={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},D={props:q};var
|
|
12
|
+
`}};P([a.n({type:Array})],exports.PktDateTags.prototype,"dates",2);P([a.n({type:String})],exports.PktDateTags.prototype,"dateformat",2);P([a.n({type:String,attribute:"class"})],exports.PktDateTags.prototype,"className",2);P([a.n({type:String,attribute:"id-base"})],exports.PktDateTags.prototype,"idBase",2);exports.PktDateTags=P([a.t("pkt-date-tags")],exports.PktDateTags);const q={dateformat:{default:"dd.MM.yyyy"},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},D={props:q};var V=Object.defineProperty,L=Object.getOwnPropertyDescriptor,c=(i,e,t,s)=>{for(var n=s>1?void 0:s?L(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&V(e,t,n),n};let d=class extends a.PktElement{constructor(){super(...arguments),this.open=!1,this.multiple=!1,this.range=!1,this.weeknumbers=!1,this.withcontrols=!1,this.maxMultiple=null,this.selected=[],this.earliest=null,this.latest=null,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.popupRef=p.e(),this.calendarRef=p.e(),this.handleDocumentClick=i=>{if(!this.open)return;const e=i.composedPath(),t=this.parentElement,s=this.popupRef.value;!e.includes(this)&&!e.includes(s)&&!(t&&e.includes(t))&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))},this.handleDocumentKeydown=i=>{this.open&&i.key==="Escape"&&(this.hide(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}}firstUpdated(){this.calRef=this.calendarRef,document.addEventListener("keydown",this.handleDocumentKeydown),document.addEventListener("click",this.handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleDocumentClick),document.removeEventListener("keydown",this.handleDocumentKeydown)}show(){var i;this.open=!0,(i=this.calendarRef.value)==null||i.focus()}hide(){this.open=!1}toggle(){this.open?this.hide():this.show()}contains(i){var e;return!!i&&!!((e=this.popupRef.value)!=null&&e.contains(i))}focusOnCurrentDate(){const i=this.calendarRef.value;i&&typeof i.focusOnCurrentDate=="function"&&i.focusOnCurrentDate()}addToSelected(i,e,t){if(typeof x.addToSelected=="function")return x.addToSelected(i,this.calendarRef,e,t)}handleDateSelect(i){const e=this.calendarRef.value;if(e&&typeof e.handleDateSelect=="function")return e.handleDateSelect(i)}render(){const i={"pkt-calendar-popup":!0,show:this.open,hide:!this.open};return a.x`
|
|
13
13
|
<div
|
|
14
14
|
class="${k.e(i)}"
|
|
15
15
|
${p.n(this.popupRef)}
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
<span class="pkt-btn__text">${this.strings.calendar.buttonAltText}</span>
|
|
159
159
|
</button>
|
|
160
160
|
</div>
|
|
161
|
-
`}};m([a.n({type:Array})],exports.PktDatepickerMultiple.prototype,"value",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"inputType",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"id",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"min",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"max",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"placeholder",2);m([a.n({type:Boolean})],exports.PktDatepickerMultiple.prototype,"readonly",2);m([a.n({type:Boolean})],exports.PktDatepickerMultiple.prototype,"disabled",2);m([a.n({type:Number})],exports.PktDatepickerMultiple.prototype,"maxlength",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"inputClasses",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"internals",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"strings",2);exports.PktDatepickerMultiple=m([a.t("pkt-datepicker-multiple")],exports.PktDatepickerMultiple);var G=Object.defineProperty,J=Object.getOwnPropertyDescriptor,
|
|
161
|
+
`}};m([a.n({type:Array})],exports.PktDatepickerMultiple.prototype,"value",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"inputType",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"id",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"min",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"max",2);m([a.n({type:String})],exports.PktDatepickerMultiple.prototype,"placeholder",2);m([a.n({type:Boolean})],exports.PktDatepickerMultiple.prototype,"readonly",2);m([a.n({type:Boolean})],exports.PktDatepickerMultiple.prototype,"disabled",2);m([a.n({type:Number})],exports.PktDatepickerMultiple.prototype,"maxlength",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"inputClasses",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"internals",2);m([a.n({type:Object})],exports.PktDatepickerMultiple.prototype,"strings",2);exports.PktDatepickerMultiple=m([a.t("pkt-datepicker-multiple")],exports.PktDatepickerMultiple);var G=Object.defineProperty,J=Object.getOwnPropertyDescriptor,u=(i,e,t,s)=>{for(var n=s>1?void 0:s?J(e,t):e,r=i.length-1,l;r>=0;r--)(l=i[r])&&(n=(s?l(e,t,n):l(n))||n);return s&&n&&G(e,t,n),n};exports.PktDatepicker=class extends _.PktInputElement{constructor(){super(),this._valueProperty="",this.datepickerPopupRef=p.e(),this._value=[],this.label="Datovelger",this.dateformat=D.props.dateformat.default,this.multiple=D.props.multiple.default,this.maxlength=null,this.range=D.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=D.props.weeknumbers.default,this.withcontrols=D.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.calRef=p.e(),this.popupRef=p.e(),this.helptextSlot=p.e(),this.singleInputRef=p.e(),this.rangeInputRef=p.e(),this.multipleInputRef=p.e(),this.addToSelected=e=>{const t=this.datepickerPopupRef.value;return t&&typeof t.addToSelected=="function"?t.addToSelected(e,this.min,this.max):x.addToSelected(e,this.calRef,this.min,this.max)},this.slotController=new B.PktSlotController(this,this.helptextSlot)}get value(){return this._valueProperty}set value(e){const t=this._valueProperty;this._valueProperty=Array.isArray(e)?e.join(","):e||"",this.valueChanged(this._valueProperty,t),this.requestUpdate("value",t)}get inputType(){return M.getInputType()}connectedCallback(){super.connectedCallback(),this.timezone&&this.timezone!==window.pktTz&&(window.pktTz=this.timezone),this.name=v.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name}disconnectedCallback(){super.disconnectedCallback()}onInput(){this.dispatchEvent(new Event("input",{bubbles:!0}))}valueChanged(e,t){if(e===t)return;const s=v.parseValue(e),n=this.multiple&&s.length>1?v.filterSelectableDates(s,this.min,this.max,this.excludedates,this.excludeweekdays):s;if(this.range&&!v.validateRangeOrder(n)){this._value=[],this._valueProperty="",super.valueChanged("",t);return}this._value=n;const r=v.formatValue(n);this._valueProperty!==r&&(this._valueProperty=r),super.valueChanged(r,t)}attributeChangedCallback(e,t,s){e==="value"&&this.value!==t&&this.valueChanged(s,t),e==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=v.normalizeStringArray(s||"")),e==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=v.normalizeStringArray(s||"")),super.attributeChangedCallback(e,t,s)}updated(e){if(e.has("value")){const t=Array.isArray(this.value)?this.value.join(","):this.value,s=e.get("value"),n=Array.isArray(s)?s.join(","):s;this.valueChanged(t,n)}(e.has("multiple")||e.has("range"))&&(this.name=v.normalizeNameForMultiple(this.name,this.multiple,this.range)||this.name),e.has("multiple")&&(this.multiple&&!Array.isArray(this._value)?this._value=v.parseValue(this.value):!this.multiple&&Array.isArray(this._value)&&(this._value=this._value.filter(Boolean)),!this.multiple&&!this.range&&Array.isArray(this._value)&&(this._value=[this._value[0]??""])),super.updated(e)}get inputRef(){return{value:this.currentInputElement}}get inputRefTo(){return{value:this.currentInputElementTo}}get currentInputElement(){var e,t,s;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.inputElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.inputElement:(s=this.singleInputRef.value)==null?void 0:s.inputElement}get currentInputElementTo(){var e;if(this.range)return(e=this.rangeInputRef.value)==null?void 0:e.inputElementTo}get currentButtonElement(){var e,t,s;return this.multiple?(e=this.multipleInputRef.value)==null?void 0:e.buttonElement:this.range?(t=this.rangeInputRef.value)==null?void 0:t.buttonElement:(s=this.singleInputRef.value)==null?void 0:s.buttonElement}get btnRef(){return{value:this.currentButtonElement}}renderInput(){return a.x`
|
|
162
162
|
<pkt-datepicker-single
|
|
163
163
|
.value=${this._value[0]??""}
|
|
164
164
|
.inputType=${this.inputType}
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
@range-blur=${e=>{R.processRangeBlur(e.detail.event,e.detail.values,this.calRef,()=>this.clearInputValue(),t=>this.manageValidity(t))}}
|
|
202
202
|
@manage-validity=${e=>this.manageValidity(e.detail)}
|
|
203
203
|
@validate-date-input=${e=>{w.validateDateInput(e.detail,this.internals,this.min,this.max,this.strings)}}
|
|
204
|
-
@handle-date-select=${e=>{var s,n;const t=
|
|
204
|
+
@handle-date-select=${e=>{var s,n;const t=o.fromISOToDate(e.detail);t&&this._value[1]!==o.formatISODate(t)&&((n=(s=this.calRef)==null?void 0:s.value)==null||n.handleDateSelect(t))}}
|
|
205
205
|
@input-changed=${()=>{this.touched=!0}}
|
|
206
206
|
${p.n(this.rangeInputRef)}
|
|
207
207
|
></pkt-datepicker-range>
|
|
@@ -241,7 +241,7 @@
|
|
|
241
241
|
.latest=${this.max}
|
|
242
242
|
.excludedates=${Array.isArray(this.excludedates)?this.excludedates:this.excludedates.split(",")}
|
|
243
243
|
.excludeweekdays=${this.excludeweekdays}
|
|
244
|
-
.currentmonth=${this.currentmonth?
|
|
244
|
+
.currentmonth=${this.currentmonth?o.parseISODateString(this.currentmonth):null}
|
|
245
245
|
@date-selected=${e=>{this.value=R.processDateSelection(e.detail,this.multiple,this.range),this._value=e.detail,R.updateInputValues(this.inputRef,this.inputRefTo,this._value,this.range,this.multiple,t=>this.manageValidity(t))}}
|
|
246
246
|
@close=${()=>{this.onBlur(),this.hideCalendar()}}
|
|
247
247
|
${p.n(this.datepickerPopupRef)}
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
dateformat=${this.dateformat}
|
|
278
278
|
strings=${this.strings}
|
|
279
279
|
id-base=${this.id}
|
|
280
|
-
@date-tag-removed=${e=>{var n;const t=this.datepickerPopupRef.value,s=
|
|
280
|
+
@date-tag-removed=${e=>{var n;const t=this.datepickerPopupRef.value,s=o.fromISOToDate(e.detail);t&&s&&typeof t.handleDateSelect=="function"?t.handleDateSelect(s):(n=this.calRef.value)==null||n.handleDateSelect(s)}}
|
|
281
281
|
></pkt-date-tags>`:a.E}
|
|
282
282
|
<div
|
|
283
283
|
class="pkt-datepicker__inputs ${this.range&&this.showRangeLabels?"pkt-input__range-inputs":""}"
|
|
@@ -286,4 +286,4 @@
|
|
|
286
286
|
</div>
|
|
287
287
|
</pkt-input-wrapper>
|
|
288
288
|
${this.renderCalendar()}
|
|
289
|
-
`}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;x.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),$.isIOS()&&e.focusOnCurrentDate();return}await A(20),this.handleCalendarPosition(),$.isIOS()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const s=!!t.open;t.toggle(),this.calendarOpen=!s;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value=""}};
|
|
289
|
+
`}handleCalendarPosition(){const e=this.multiple&&!!this.maxlength;x.handleCalendarPosition(this.popupRef,this.inputRef,e)}async showCalendar(){var t;const e=this.datepickerPopupRef.value;if(this.calendarOpen=!0,e&&typeof e.show=="function"){e.show(),$.isIOS()&&e.focusOnCurrentDate();return}await A(20),this.handleCalendarPosition(),$.isIOS()&&((t=this.calRef.value)==null||t.focusOnCurrentDate())}hideCalendar(){const e=this.datepickerPopupRef.value;if(this.calendarOpen=!1,e&&typeof e.hide=="function")return e.hide()}async toggleCalendar(e){e.preventDefault();const t=this.datepickerPopupRef.value;if(t&&typeof t.toggle=="function"){const s=!!t.open;t.toggle(),this.calendarOpen=!s;return}this.calendarOpen?this.hideCalendar():this.showCalendar()}clearInputValue(){this._value=[],this.value="",this.internals.setFormValue(this.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this._value,bubbles:!0,composed:!0}))}};u([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"value",1);u([a.n({type:Array})],exports.PktDatepicker.prototype,"_value",2);u([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"label",2);u([a.n({type:String})],exports.PktDatepicker.prototype,"dateformat",2);u([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"multiple",2);u([a.n({type:Number,reflect:!0})],exports.PktDatepicker.prototype,"maxlength",2);u([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"range",2);u([a.n({type:Boolean})],exports.PktDatepicker.prototype,"showRangeLabels",2);u([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"min",2);u([a.n({type:String,reflect:!0})],exports.PktDatepicker.prototype,"max",2);u([a.n({type:Boolean})],exports.PktDatepicker.prototype,"weeknumbers",2);u([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"withcontrols",2);u([a.n({converter:o.converters.csvToArray})],exports.PktDatepicker.prototype,"excludedates",2);u([a.n({converter:o.converters.csvToArray})],exports.PktDatepicker.prototype,"excludeweekdays",2);u([a.n({type:String})],exports.PktDatepicker.prototype,"currentmonth",2);u([a.n({type:Boolean,reflect:!0})],exports.PktDatepicker.prototype,"calendarOpen",2);u([a.n({type:String})],exports.PktDatepicker.prototype,"timezone",2);u([S.r()],exports.PktDatepicker.prototype,"inputClasses",2);exports.PktDatepicker=u([a.t("pkt-datepicker")],exports.PktDatepicker);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { P as O, E as B, x as d, n as a, a as _ } from "./element-CRDRygXu.js";
|
|
2
2
|
import { r as N } from "./state-DS_kr2Fy.js";
|
|
3
|
-
import { f as U, s as q, i as W, n as
|
|
3
|
+
import { f as U, s as q, i as W, n as F, a as M, b as z, d as H, p as G, e as K } from "./calendar-DtJh7UYD.js";
|
|
4
4
|
import { P as J } from "./input-element-BcFmygSF.js";
|
|
5
5
|
import { e as u, n as c } from "./ref-Xa5dbh--.js";
|
|
6
6
|
import "./icon-1dy7UZcu.js";
|
|
7
|
-
import "./input-wrapper-
|
|
7
|
+
import "./input-wrapper-CiqUL7my.js";
|
|
8
8
|
import { e as x } from "./class-map-wy7PUk0P.js";
|
|
9
9
|
import { c as Q } from "./repeat-CJ79egkN.js";
|
|
10
10
|
import "./tag-CqMgt01I.js";
|
|
11
11
|
import { u as X } from "./stringutils-DJjRa8dG.js";
|
|
12
|
-
import { o as
|
|
12
|
+
import { o as w } from "./if-defined-BWZGb3bh.js";
|
|
13
13
|
import { P as Y } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
14
|
-
const Z = (t) => new Promise((e) => setTimeout(e, t)),
|
|
14
|
+
const Z = (t) => new Promise((e) => setTimeout(e, t)), T = {
|
|
15
15
|
/**
|
|
16
16
|
* Detects if the current device is iOS (iPhone, iPad, iPod)
|
|
17
17
|
* Handles modern iPad Safari which uses desktop user agent since iOS 13
|
|
@@ -69,7 +69,7 @@ const Z = (t) => new Promise((e) => setTimeout(e, t)), R = {
|
|
|
69
69
|
* Mobile Safari does not play well with type="date" amd custom datepickers
|
|
70
70
|
*/
|
|
71
71
|
getInputType() {
|
|
72
|
-
return
|
|
72
|
+
return T.isIOS() ? "text" : "date";
|
|
73
73
|
}
|
|
74
74
|
}, D = {
|
|
75
75
|
/**
|
|
@@ -110,7 +110,7 @@ const Z = (t) => new Promise((e) => setTimeout(e, t)), R = {
|
|
|
110
110
|
addToSelected(t, e, s, n) {
|
|
111
111
|
const i = t.target;
|
|
112
112
|
if (!i.value) return;
|
|
113
|
-
const l = s ?
|
|
113
|
+
const l = s ? F(s) : null, r = n ? F(n) : null, h = F(i.value.split(",")[0]);
|
|
114
114
|
h && !isNaN(h.getTime()) && (!l || h >= l) && (!r || h <= r) && e.value && e.value.handleDateSelect(h), i.value = "";
|
|
115
115
|
},
|
|
116
116
|
/**
|
|
@@ -159,7 +159,7 @@ const Z = (t) => new Promise((e) => setTimeout(e, t)), R = {
|
|
|
159
159
|
"pkt-hide": !t
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
},
|
|
162
|
+
}, j = {
|
|
163
163
|
/**
|
|
164
164
|
* Handles date selection from calendar events
|
|
165
165
|
*/
|
|
@@ -184,7 +184,7 @@ const Z = (t) => new Promise((e) => setTimeout(e, t)), R = {
|
|
|
184
184
|
h && e[0] !== l.value && e[1] && (n(), (r = s == null ? void 0 : s.value) == null || r.handleDateSelect(h));
|
|
185
185
|
} else e[0] && n();
|
|
186
186
|
}
|
|
187
|
-
},
|
|
187
|
+
}, E = {
|
|
188
188
|
/**
|
|
189
189
|
* Handles common keyboard interactions for datepicker inputs
|
|
190
190
|
*/
|
|
@@ -205,7 +205,7 @@ var et = Object.defineProperty, st = Object.getOwnPropertyDescriptor, P = (t, e,
|
|
|
205
205
|
(r = t[l]) && (i = (n ? r(e, s, i) : r(i)) || i);
|
|
206
206
|
return n && i && et(e, s, i), i;
|
|
207
207
|
};
|
|
208
|
-
let
|
|
208
|
+
let R = class extends O {
|
|
209
209
|
constructor() {
|
|
210
210
|
super(...arguments), this.dates = [], this.dateformat = "dd.MM.yyyy", this.className = "pkt-datepicker__tags", this.idBase = X();
|
|
211
211
|
}
|
|
@@ -238,19 +238,19 @@ let E = class extends O {
|
|
|
238
238
|
};
|
|
239
239
|
P([
|
|
240
240
|
a({ type: Array })
|
|
241
|
-
],
|
|
241
|
+
], R.prototype, "dates", 2);
|
|
242
242
|
P([
|
|
243
243
|
a({ type: String })
|
|
244
|
-
],
|
|
244
|
+
], R.prototype, "dateformat", 2);
|
|
245
245
|
P([
|
|
246
246
|
a({ type: String, attribute: "class" })
|
|
247
|
-
],
|
|
247
|
+
], R.prototype, "className", 2);
|
|
248
248
|
P([
|
|
249
249
|
a({ type: String, attribute: "id-base" })
|
|
250
|
-
],
|
|
251
|
-
|
|
250
|
+
], R.prototype, "idBase", 2);
|
|
251
|
+
R = P([
|
|
252
252
|
_("pkt-date-tags")
|
|
253
|
-
],
|
|
253
|
+
], R);
|
|
254
254
|
const it = { dateformat: { default: "dd.MM.yyyy" }, weeknumbers: { default: !1 }, withcontrols: { default: !1 }, multiple: { default: !1 }, range: { default: !1 } }, S = {
|
|
255
255
|
props: it
|
|
256
256
|
};
|
|
@@ -376,7 +376,7 @@ v([
|
|
|
376
376
|
g = v([
|
|
377
377
|
_("pkt-datepicker-popup")
|
|
378
378
|
], g);
|
|
379
|
-
var lt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor,
|
|
379
|
+
var lt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, C = (t, e, s, n) => {
|
|
380
380
|
for (var i = n > 1 ? void 0 : n ? rt(e, s) : e, l = t.length - 1, r; l >= 0; l--)
|
|
381
381
|
(r = t[l]) && (i = (n ? r(e, s, i) : r(i)) || i);
|
|
382
382
|
return n && i && lt(e, s, i), i;
|
|
@@ -458,9 +458,9 @@ let y = class extends O {
|
|
|
458
458
|
.type=${this.inputType}
|
|
459
459
|
id="${this.id}-input"
|
|
460
460
|
.value=${this.value}
|
|
461
|
-
min=${
|
|
462
|
-
max=${
|
|
463
|
-
placeholder=${
|
|
461
|
+
min=${w(this.min)}
|
|
462
|
+
max=${w(this.max)}
|
|
463
|
+
placeholder=${w(this.placeholder)}
|
|
464
464
|
?readonly=${this.isInputReadonly}
|
|
465
465
|
aria-describedby="${this.id}-helptext"
|
|
466
466
|
@click=${(t) => {
|
|
@@ -470,7 +470,7 @@ let y = class extends O {
|
|
|
470
470
|
t.preventDefault(), this.dispatchToggleCalendar(t);
|
|
471
471
|
}}
|
|
472
472
|
?disabled=${this.disabled}
|
|
473
|
-
@keydown=${(t) =>
|
|
473
|
+
@keydown=${(t) => E.handleInputKeydown(
|
|
474
474
|
t,
|
|
475
475
|
(e) => this.dispatchToggleCalendar(e),
|
|
476
476
|
() => D.submitFormOrFallback(this.internals, () => {
|
|
@@ -487,7 +487,7 @@ let y = class extends O {
|
|
|
487
487
|
this.dispatchInput(t), t.stopImmediatePropagation();
|
|
488
488
|
}}
|
|
489
489
|
@focus=${() => {
|
|
490
|
-
this.dispatchFocus(),
|
|
490
|
+
this.dispatchFocus(), T.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
|
|
491
491
|
}}
|
|
492
492
|
@blur=${(t) => {
|
|
493
493
|
this.dispatchBlur(t), this.dispatchManageValidity(t.target), this.dispatchEvent(
|
|
@@ -507,7 +507,7 @@ let y = class extends O {
|
|
|
507
507
|
class="${x(I.getButtonClasses())}"
|
|
508
508
|
type="button"
|
|
509
509
|
@click=${(t) => this.dispatchToggleCalendar(t)}
|
|
510
|
-
@keydown=${(t) =>
|
|
510
|
+
@keydown=${(t) => E.handleButtonKeydown(t, (e) => this.dispatchToggleCalendar(e))}
|
|
511
511
|
?disabled=${this.disabled}
|
|
512
512
|
${c(this.btnRef)}
|
|
513
513
|
>
|
|
@@ -518,40 +518,40 @@ let y = class extends O {
|
|
|
518
518
|
`;
|
|
519
519
|
}
|
|
520
520
|
};
|
|
521
|
-
|
|
521
|
+
C([
|
|
522
522
|
a({ type: String })
|
|
523
523
|
], y.prototype, "value", 2);
|
|
524
|
-
|
|
524
|
+
C([
|
|
525
525
|
a({ type: String })
|
|
526
526
|
], y.prototype, "inputType", 2);
|
|
527
|
-
|
|
527
|
+
C([
|
|
528
528
|
a({ type: String })
|
|
529
529
|
], y.prototype, "id", 2);
|
|
530
|
-
|
|
530
|
+
C([
|
|
531
531
|
a({ type: String })
|
|
532
532
|
], y.prototype, "min", 2);
|
|
533
|
-
|
|
533
|
+
C([
|
|
534
534
|
a({ type: String })
|
|
535
535
|
], y.prototype, "max", 2);
|
|
536
|
-
|
|
536
|
+
C([
|
|
537
537
|
a({ type: String })
|
|
538
538
|
], y.prototype, "placeholder", 2);
|
|
539
|
-
|
|
539
|
+
C([
|
|
540
540
|
a({ type: Boolean })
|
|
541
541
|
], y.prototype, "readonly", 2);
|
|
542
|
-
|
|
542
|
+
C([
|
|
543
543
|
a({ type: Boolean })
|
|
544
544
|
], y.prototype, "disabled", 2);
|
|
545
|
-
|
|
545
|
+
C([
|
|
546
546
|
a({ type: Object })
|
|
547
547
|
], y.prototype, "inputClasses", 2);
|
|
548
|
-
|
|
548
|
+
C([
|
|
549
549
|
a({ type: Object })
|
|
550
550
|
], y.prototype, "internals", 2);
|
|
551
|
-
|
|
551
|
+
C([
|
|
552
552
|
a({ type: Object })
|
|
553
553
|
], y.prototype, "strings", 2);
|
|
554
|
-
y =
|
|
554
|
+
y = C([
|
|
555
555
|
_("pkt-datepicker-single")
|
|
556
556
|
], y);
|
|
557
557
|
var pt = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, b = (t, e, s, n) => {
|
|
@@ -641,9 +641,9 @@ let m = class extends O {
|
|
|
641
641
|
.type=${this.inputType}
|
|
642
642
|
id="${this.id}-input"
|
|
643
643
|
.value=${this.value[0] ?? ""}
|
|
644
|
-
min=${
|
|
645
|
-
max=${
|
|
646
|
-
placeholder=${
|
|
644
|
+
min=${w(this.min)}
|
|
645
|
+
max=${w(this.max)}
|
|
646
|
+
placeholder=${w(this.placeholder)}
|
|
647
647
|
?readonly=${this.isInputReadonly}
|
|
648
648
|
?disabled=${this.disabled}
|
|
649
649
|
@click=${(e) => {
|
|
@@ -652,7 +652,7 @@ let m = class extends O {
|
|
|
652
652
|
@touchend=${(e) => {
|
|
653
653
|
e.preventDefault(), this.dispatchToggleCalendar(e);
|
|
654
654
|
}}
|
|
655
|
-
@keydown=${(e) =>
|
|
655
|
+
@keydown=${(e) => E.handleInputKeydown(
|
|
656
656
|
e,
|
|
657
657
|
(s) => this.dispatchToggleCalendar(s),
|
|
658
658
|
() => D.submitFormOrFallback(
|
|
@@ -675,7 +675,7 @@ let m = class extends O {
|
|
|
675
675
|
this.dispatchInput(e), e.stopImmediatePropagation();
|
|
676
676
|
}}
|
|
677
677
|
@focus=${() => {
|
|
678
|
-
this.dispatchFocus(),
|
|
678
|
+
this.dispatchFocus(), T.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
|
|
679
679
|
}}
|
|
680
680
|
@blur=${(e) => {
|
|
681
681
|
this.dispatchEvent(
|
|
@@ -705,9 +705,9 @@ let m = class extends O {
|
|
|
705
705
|
id="${this.id}-to"
|
|
706
706
|
aria-labelledby="${this.id}-to-label"
|
|
707
707
|
.value=${this.value[1] ?? ""}
|
|
708
|
-
min=${
|
|
709
|
-
max=${
|
|
710
|
-
placeholder=${
|
|
708
|
+
min=${w(this.min)}
|
|
709
|
+
max=${w(this.max)}
|
|
710
|
+
placeholder=${w(this.placeholder)}
|
|
711
711
|
?readonly=${this.isInputReadonly}
|
|
712
712
|
?disabled=${this.disabled}
|
|
713
713
|
@click=${(e) => {
|
|
@@ -716,7 +716,7 @@ let m = class extends O {
|
|
|
716
716
|
@touchend=${(e) => {
|
|
717
717
|
e.preventDefault(), this.dispatchToggleCalendar(e);
|
|
718
718
|
}}
|
|
719
|
-
@keydown=${(e) =>
|
|
719
|
+
@keydown=${(e) => E.handleInputKeydown(
|
|
720
720
|
e,
|
|
721
721
|
(s) => this.dispatchToggleCalendar(s),
|
|
722
722
|
() => D.submitFormOrFallback(this.internals, () => {
|
|
@@ -733,7 +733,7 @@ let m = class extends O {
|
|
|
733
733
|
this.dispatchInput(e), e.stopImmediatePropagation();
|
|
734
734
|
}}
|
|
735
735
|
@focus=${() => {
|
|
736
|
-
this.dispatchFocus(),
|
|
736
|
+
this.dispatchFocus(), T.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
|
|
737
737
|
}}
|
|
738
738
|
@blur=${(e) => {
|
|
739
739
|
this.dispatchBlur(e), e.target.value && (this.dispatchManageValidity(e.target), this.dispatchEvent(
|
|
@@ -759,7 +759,7 @@ let m = class extends O {
|
|
|
759
759
|
class="${x(I.getButtonClasses())}"
|
|
760
760
|
type="button"
|
|
761
761
|
@click=${(e) => this.dispatchToggleCalendar(e)}
|
|
762
|
-
@keydown=${(e) =>
|
|
762
|
+
@keydown=${(e) => E.handleButtonKeydown(e, (s) => this.dispatchToggleCalendar(s))}
|
|
763
763
|
?disabled=${this.disabled}
|
|
764
764
|
${c(this.btnRef)}
|
|
765
765
|
>
|
|
@@ -893,9 +893,9 @@ let f = class extends O {
|
|
|
893
893
|
class=${x(this.inputClasses)}
|
|
894
894
|
.type=${this.inputType}
|
|
895
895
|
id="${this.id}-input"
|
|
896
|
-
min=${
|
|
897
|
-
max=${
|
|
898
|
-
placeholder=${
|
|
896
|
+
min=${w(this.min)}
|
|
897
|
+
max=${w(this.max)}
|
|
898
|
+
placeholder=${w(this.placeholder)}
|
|
899
899
|
?readonly=${this.isInputReadonly}
|
|
900
900
|
?disabled=${this.isInputDisabled}
|
|
901
901
|
@click=${(t) => {
|
|
@@ -911,9 +911,9 @@ let f = class extends O {
|
|
|
911
911
|
this.dispatchInput(t), t.stopImmediatePropagation();
|
|
912
912
|
}}
|
|
913
913
|
@focus=${() => {
|
|
914
|
-
this.dispatchFocus(),
|
|
914
|
+
this.dispatchFocus(), T.isIOS() && this.dispatchToggleCalendar(new Event("focus"));
|
|
915
915
|
}}
|
|
916
|
-
@keydown=${(t) =>
|
|
916
|
+
@keydown=${(t) => E.handleInputKeydown(
|
|
917
917
|
t,
|
|
918
918
|
(e) => this.dispatchToggleCalendar(e),
|
|
919
919
|
() => D.submitFormOrFallback(this.internals, () => {
|
|
@@ -933,7 +933,7 @@ let f = class extends O {
|
|
|
933
933
|
class="${x(I.getButtonClasses())}"
|
|
934
934
|
type="button"
|
|
935
935
|
@click=${(t) => this.dispatchToggleCalendar(t)}
|
|
936
|
-
@keydown=${(t) =>
|
|
936
|
+
@keydown=${(t) => E.handleButtonKeydown(t, (e) => this.dispatchToggleCalendar(e))}
|
|
937
937
|
?disabled=${this.disabled}
|
|
938
938
|
${c(this.btnRef)}
|
|
939
939
|
>
|
|
@@ -1133,7 +1133,7 @@ let p = class extends J {
|
|
|
1133
1133
|
(e = this.calRef.value) != null && e.contains(t.detail.relatedTarget) || this.onBlur();
|
|
1134
1134
|
}}
|
|
1135
1135
|
@range-blur=${(t) => {
|
|
1136
|
-
|
|
1136
|
+
j.processRangeBlur(
|
|
1137
1137
|
t.detail.event,
|
|
1138
1138
|
t.detail.values,
|
|
1139
1139
|
this.calRef,
|
|
@@ -1204,7 +1204,7 @@ let p = class extends J {
|
|
|
1204
1204
|
.excludeweekdays=${this.excludeweekdays}
|
|
1205
1205
|
.currentmonth=${this.currentmonth ? G(this.currentmonth) : null}
|
|
1206
1206
|
@date-selected=${(t) => {
|
|
1207
|
-
this.value =
|
|
1207
|
+
this.value = j.processDateSelection(t.detail, this.multiple, this.range), this._value = t.detail, j.updateInputValues(
|
|
1208
1208
|
this.inputRef,
|
|
1209
1209
|
this.inputRefTo,
|
|
1210
1210
|
this._value,
|
|
@@ -1285,10 +1285,10 @@ let p = class extends J {
|
|
|
1285
1285
|
var e;
|
|
1286
1286
|
const t = this.datepickerPopupRef.value;
|
|
1287
1287
|
if (this.calendarOpen = !0, t && typeof t.show == "function") {
|
|
1288
|
-
t.show(),
|
|
1288
|
+
t.show(), T.isIOS() && t.focusOnCurrentDate();
|
|
1289
1289
|
return;
|
|
1290
1290
|
}
|
|
1291
|
-
await Z(20), this.handleCalendarPosition(),
|
|
1291
|
+
await Z(20), this.handleCalendarPosition(), T.isIOS() && ((e = this.calRef.value) == null || e.focusOnCurrentDate());
|
|
1292
1292
|
}
|
|
1293
1293
|
hideCalendar() {
|
|
1294
1294
|
const t = this.datepickerPopupRef.value;
|
|
@@ -1305,7 +1305,13 @@ let p = class extends J {
|
|
|
1305
1305
|
this.calendarOpen ? this.hideCalendar() : this.showCalendar();
|
|
1306
1306
|
}
|
|
1307
1307
|
clearInputValue() {
|
|
1308
|
-
this._value = [], this.value = ""
|
|
1308
|
+
this._value = [], this.value = "", this.internals.setFormValue(this.value), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(
|
|
1309
|
+
new CustomEvent("value-change", {
|
|
1310
|
+
detail: this._value,
|
|
1311
|
+
bubbles: !0,
|
|
1312
|
+
composed: !0
|
|
1313
|
+
})
|
|
1314
|
+
);
|
|
1309
1315
|
}
|
|
1310
1316
|
};
|
|
1311
1317
|
o([
|
|
@@ -1366,7 +1372,7 @@ p = o([
|
|
|
1366
1372
|
_("pkt-datepicker")
|
|
1367
1373
|
], p);
|
|
1368
1374
|
export {
|
|
1369
|
-
|
|
1375
|
+
R as P,
|
|
1370
1376
|
p as a,
|
|
1371
1377
|
y as b,
|
|
1372
1378
|
m as c,
|
package/dist/index.d.ts
CHANGED
|
@@ -112,6 +112,8 @@ export declare interface IPktButton {
|
|
|
112
112
|
secondIconName?: PktIconName;
|
|
113
113
|
mode?: TPktButtonMode;
|
|
114
114
|
size?: TPktButtonSize;
|
|
115
|
+
fullWidth?: Booleanish;
|
|
116
|
+
fullWidthOnMobile?: Booleanish;
|
|
115
117
|
color?: TPktButtonColor;
|
|
116
118
|
skin?: TPktButtonSkin;
|
|
117
119
|
variant?: TPktButtonVariant;
|
|
@@ -393,6 +395,8 @@ export declare class PktButton extends PktElement<IPktButton> implements IPktBut
|
|
|
393
395
|
secondIconName: string;
|
|
394
396
|
mode?: TPktButtonMode;
|
|
395
397
|
size: TPktButtonSize;
|
|
398
|
+
fullWidth: Booleanish;
|
|
399
|
+
fullWidthOnMobile: Booleanish;
|
|
396
400
|
color?: TPktButtonColor;
|
|
397
401
|
skin: TPktButtonSkin;
|
|
398
402
|
variant: TPktButtonVariant;
|
|
@@ -7,7 +7,7 @@ import { e as E } from "./class-map-wy7PUk0P.js";
|
|
|
7
7
|
import { u as v } from "./stringutils-DJjRa8dG.js";
|
|
8
8
|
import { s } from "./input-wrapper-CDgenrYA.js";
|
|
9
9
|
import "./helptext-DuvVSH7d.js";
|
|
10
|
-
import "./alert-
|
|
10
|
+
import "./alert-BD1H1Rxn.js";
|
|
11
11
|
var S = Object.defineProperty, D = Object.getOwnPropertyDescriptor, e = (o, a, n, h) => {
|
|
12
12
|
for (var l = h > 1 ? void 0 : h ? D(a, n) : a, d = o.length - 1, u; d >= 0; d--)
|
|
13
13
|
(u = o[d]) && (l = (h ? u(a, n, l) : u(l)) || l);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-CJ_QKaki.cjs"),b=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./ref-BFa5Utho.cjs"),k=require("./if-defined-Bc9-_I01.cjs"),x=require("./icon-BGuizDwk.cjs"),y=require("./class-map-C_erArZz.cjs"),$=require("./stringutils-CkVRq4jP.cjs"),s=require("./input-wrapper-EoSAbU-U.cjs");require("./helptext-CVQP3pis.cjs");require("./alert-
|
|
1
|
+
"use strict";const t=require("./element-CJ_QKaki.cjs"),b=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./ref-BFa5Utho.cjs"),k=require("./if-defined-Bc9-_I01.cjs"),x=require("./icon-BGuizDwk.cjs"),y=require("./class-map-C_erArZz.cjs"),$=require("./stringutils-CkVRq4jP.cjs"),s=require("./input-wrapper-EoSAbU-U.cjs");require("./helptext-CVQP3pis.cjs");require("./alert-BXbmjri0.cjs");var I=Object.defineProperty,P=Object.getOwnPropertyDescriptor,e=(r,p,i,n)=>{for(var o=n>1?void 0:n?P(p,i):p,l=r.length-1,a;l>=0;l--)(a=r[l])&&(o=(n?a(p,i,o):a(o))||o);return n&&o&&I(p,i,o),o};const W={fromAttribute(r){return r==null?!1:r===""||r==="true"||r===!0?!0:r==="false"||r===!1?!1:!!r},toAttribute(r){return r?"true":"false"}};exports.PktInputWrapper=class extends t.PktElement{constructor(){super(),this.defaultSlot=u.e(),this.helptextSlot=u.e(),this.forId=$.uuidish(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=s.specs.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=s.specs.props.optionalTag.default,this.optionalText=s.specs.props.optionalText.default,this.requiredTag=s.specs.props.requiredTag.default,this.requiredText=s.specs.props.requiredText.default,this.tagText=null,this.hasError=s.specs.props.hasError.default,this.errorMessage="",this.disabled=s.specs.props.disabled.default,this.inline=s.specs.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=s.specs.props.hasFieldset.default,this.role="group",this.useWrapper=s.specs.props.useWrapper.default,this.slotController=new b.PktSlotController(this,this.defaultSlot,this.helptextSlot)}updated(p){super.updated(p)}render(){const p={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},i="pkt-tag pkt-tag--small pkt-tag--thin-text",n=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:t.E,o=()=>t.x`
|
|
2
2
|
${this.tagText?t.x`<span class=${i+" pkt-tag--gray"}>${this.tagText}</span>`:t.E}
|
|
3
3
|
${this.optionalTag?t.x`<span class=${i+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.E}
|
|
4
4
|
${this.requiredTag?t.x`<span class=${i+" pkt-tag--beige"}>${this.requiredText}</span>`:t.E}
|
package/dist/pkt-alert.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./alert-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./alert-BXbmjri0.cjs"),t=e.PktAlert;Object.defineProperty(exports,"PktAlert",{enumerable:!0,get:()=>e.PktAlert});exports.default=t;
|
package/dist/pkt-alert.js
CHANGED
package/dist/pkt-button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./button-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./button-1jYzMALk.cjs"),e=t.PktButton;Object.defineProperty(exports,"PktButton",{enumerable:!0,get:()=>t.PktButton});exports.default=e;
|
package/dist/pkt-button.js
CHANGED
package/dist/pkt-combobox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./combobox-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./combobox-BX1YbDHV.cjs"),o=e.PktCombobox;Object.defineProperty(exports,"PktCombobox",{enumerable:!0,get:()=>e.PktCombobox});exports.default=o;
|
package/dist/pkt-combobox.js
CHANGED
package/dist/pkt-consent.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./consent-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./consent-Cgc6nuiP.cjs"),t=e.PktConsent;Object.defineProperty(exports,"PktConsent",{enumerable:!0,get:()=>e.PktConsent});exports.default=t;
|
package/dist/pkt-consent.js
CHANGED
package/dist/pkt-datepicker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-C4joeEiQ.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});Object.defineProperty(exports,"PktDatepickerMultiple",{enumerable:!0,get:()=>e.PktDatepickerMultiple});Object.defineProperty(exports,"PktDatepickerRange",{enumerable:!0,get:()=>e.PktDatepickerRange});Object.defineProperty(exports,"PktDatepickerSingle",{enumerable:!0,get:()=>e.PktDatepickerSingle});exports.default=t;
|
package/dist/pkt-datepicker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as e } from "./datepicker-
|
|
2
|
-
import { d as p, c as i, b as c } from "./datepicker-
|
|
1
|
+
import { a as e } from "./datepicker-lnxklOi4.js";
|
|
2
|
+
import { d as p, c as i, b as c } from "./datepicker-lnxklOi4.js";
|
|
3
3
|
const a = e;
|
|
4
4
|
export {
|
|
5
5
|
e as PktDatepicker,
|
package/dist/pkt-index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./alert-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./alert-BXbmjri0.cjs"),l=require("./accordionitem-DCZrHVNR.cjs"),m=require("./backlink-BzEvli8m.cjs"),g=require("./button-1jYzMALk.cjs"),P=require("./calendar-BaMrdMDZ.cjs"),h=require("./card-Cf-UcGAP.cjs"),f=require("./combobox-BX1YbDHV.cjs"),y=require("./consent-Cgc6nuiP.cjs"),O=require("./checkbox-CTxc8wQe.cjs"),t=require("./element-CJ_QKaki.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs"),s=require("./ref-BFa5Utho.cjs"),q=require("./class-map-C_erArZz.cjs"),k=require("./datepicker-C4joeEiQ.cjs"),x=require("./helptext-CVQP3pis.cjs"),C=require("./heading--JKFppLS.cjs"),v=require("./icon-BGuizDwk.cjs"),S=require("./input-wrapper-D9kFsTCN.cjs"),T=require("./link-Da3pZ_CW.cjs"),$=require("./linkcard-BM23gzhS.cjs"),L=require("./loader-Bo8RCbCJ.cjs"),_=require("./messagebox-C76IcXTl.cjs"),I=require("./modal-Cdz9JcCX.cjs"),A=require("./progressbar-CazcIzVT.cjs"),p=require("./radiobutton-D1fihs8R.cjs"),B=require("./tag-EFUKrc8q.cjs"),d=require("./tabitem-D5zyipN1.cjs"),D=require("./textarea-CYHYvdCf.cjs"),M=require("./textinput-DYVtoRMy.cjs"),R=require("./select-D7Ne5gv0.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new j.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
|
|
2
2
|
<div class="${q.e(e)}">
|
|
3
3
|
<h1 class="pkt-txt-28">${this.string}</h1>
|
|
4
4
|
|
package/dist/pkt-index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { P as T } from "./alert-
|
|
1
|
+
import { P as T } from "./alert-BD1H1Rxn.js";
|
|
2
2
|
import { P as I, a as w } from "./accordionitem-C_URrDjP.js";
|
|
3
3
|
import { P as D } from "./backlink-CI_jMGzZ.js";
|
|
4
|
-
import { P as O } from "./button-
|
|
4
|
+
import { P as O } from "./button-lDOnZON6.js";
|
|
5
5
|
import { c as f } from "./calendar-DtJh7UYD.js";
|
|
6
6
|
import { P as j } from "./calendar-DtJh7UYD.js";
|
|
7
7
|
import { P as G } from "./card-M1X36b6i.js";
|
|
8
|
-
import { P as K } from "./combobox-
|
|
9
|
-
import { P as U } from "./consent-
|
|
8
|
+
import { P as K } from "./combobox-BdDZU1bk.js";
|
|
9
|
+
import { P as U } from "./consent-CYFXjOXF.js";
|
|
10
10
|
import { P as q } from "./checkbox-_5LbXU7N.js";
|
|
11
11
|
import { P as d, t as h, x as P, n, a as c } from "./element-CRDRygXu.js";
|
|
12
12
|
import { P as x } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
13
13
|
import { e as m, n as k } from "./ref-Xa5dbh--.js";
|
|
14
14
|
import { e as u } from "./class-map-wy7PUk0P.js";
|
|
15
|
-
import { P as F, a as J } from "./datepicker-
|
|
15
|
+
import { P as F, a as J } from "./datepicker-lnxklOi4.js";
|
|
16
16
|
import { P as V } from "./helptext-DuvVSH7d.js";
|
|
17
17
|
import { P as Y } from "./heading-Cs5yGnJg.js";
|
|
18
18
|
import { P as tt } from "./icon-1dy7UZcu.js";
|
|
19
|
-
import { P as rt } from "./input-wrapper-
|
|
19
|
+
import { P as rt } from "./input-wrapper-CiqUL7my.js";
|
|
20
20
|
import { P as st } from "./link-DzZCw8j2.js";
|
|
21
21
|
import { P as nt } from "./linkcard-RIK5xqbd.js";
|
|
22
22
|
import { P as pt } from "./loader-BVvBzaPI.js";
|
|
@@ -26,9 +26,9 @@ import { P as dt } from "./progressbar-BbVei20_.js";
|
|
|
26
26
|
import { P as ct, P as xt } from "./radiobutton-DODROIBF.js";
|
|
27
27
|
import { P as gt } from "./tag-CqMgt01I.js";
|
|
28
28
|
import { a as bt, P as St } from "./tabitem-NV2fzs_-.js";
|
|
29
|
-
import { P as $t } from "./textarea-
|
|
30
|
-
import { P as _t } from "./textinput-
|
|
31
|
-
import { P as Tt } from "./select-
|
|
29
|
+
import { P as $t } from "./textarea-DuOBX5is.js";
|
|
30
|
+
import { P as _t } from "./textinput-CrcXv_is.js";
|
|
31
|
+
import { P as Tt } from "./select-_KoHkDbx.js";
|
|
32
32
|
var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, s = (t, e, i, a) => {
|
|
33
33
|
for (var r = a > 1 ? void 0 : a ? v(e, i) : e, p = t.length - 1, l; p >= 0; p--)
|
|
34
34
|
(l = t[p]) && (r = (a ? l(e, i, r) : l(r)) || r);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./input-wrapper-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./input-wrapper-D9kFsTCN.cjs"),t=e.PktInputWrapper;Object.defineProperty(exports,"PktInputWrapper",{enumerable:!0,get:()=>e.PktInputWrapper});exports.default=t;
|
package/dist/pkt-select.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./select-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./select-D7Ne5gv0.cjs"),t=e.PktSelect;Object.defineProperty(exports,"PktSelect",{enumerable:!0,get:()=>e.PktSelect});exports.default=t;
|
package/dist/pkt-select.js
CHANGED
package/dist/pkt-textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-CYHYvdCf.cjs"),t=e.PktTextarea;Object.defineProperty(exports,"PktTextarea",{enumerable:!0,get:()=>e.PktTextarea});exports.default=t;
|
package/dist/pkt-textarea.js
CHANGED
package/dist/pkt-textinput.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-DYVtoRMy.cjs"),t=e.PktTextinput;Object.defineProperty(exports,"PktTextinput",{enumerable:!0,get:()=>e.PktTextinput});exports.default=t;
|
package/dist/pkt-textinput.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const h=require("./element-CJ_QKaki.cjs"),u=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),o=require("./if-defined-Bc9-_I01.cjs"),d=require("./input-element-j9znzLWz.cjs"),c=require("./pkt-options-controller-CiuBG6Lt.cjs"),v=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-
|
|
1
|
+
"use strict";const h=require("./element-CJ_QKaki.cjs"),u=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),o=require("./if-defined-Bc9-_I01.cjs"),d=require("./input-element-j9znzLWz.cjs"),c=require("./pkt-options-controller-CiuBG6Lt.cjs"),v=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-D9kFsTCN.cjs");var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,a=(p,t,e,s)=>{for(var i=s>1?void 0:s?_(t,e):t,l=p.length-1,n;l>=0;l--)(n=p[l])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&f(t,e,i),i};exports.PktSelect=class extends d.PktInputElement{constructor(){super(),this.inputRef=r.e(),this.helptextSlot=r.e(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new c.PktOptionsSlotController(this),this.slotController=new v.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(s=>{const i={value:s.hasAttribute("value")?s.getAttribute("value")??"":s.textContent??"",label:s.textContent||s.getAttribute("value")||"",disabled:s.hasAttribute("disabled"),selected:s.hasAttribute("selected"),hidden:s.hasAttribute("data-hidden")};s.getAttribute("selected")&&!this.value&&(this.value=i.value),this._options.push(i)}):(this._options=this._optionsProp,this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)}))}add(t,e){const s={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(s);else if(typeof e=="number")this._options.splice(e,0,s);else{const i=e.value||e.text,l=this._options.findIndex(n=>n.value===i);l>=0?this._options.splice(l,0,s):this._options.push(s)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(i=>i.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,s){var i,l;t==="options"&&(this._options=s?JSON.parse(s):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this._options.findIndex(n=>n.value===s),this.selectedOptions=(l=this.inputRef.value)==null?void 0:l.selectedOptions,this.valueChanged(s,e)),super.attributeChangedCallback(t,e,s)}update(t){var e,s;super.update(t),t.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(s=this.inputRef.value)==null?void 0:s.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(s=>s.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return h.x`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
?counter=${this.counter}
|
|
4
4
|
?disabled=${this.disabled}
|
|
@@ -5,7 +5,7 @@ import { o as l } from "./if-defined-BWZGb3bh.js";
|
|
|
5
5
|
import { P as _ } from "./input-element-BcFmygSF.js";
|
|
6
6
|
import { P as x } from "./pkt-options-controller-CZO1nxZ8.js";
|
|
7
7
|
import { P as b } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
8
|
-
import "./input-wrapper-
|
|
8
|
+
import "./input-wrapper-CiqUL7my.js";
|
|
9
9
|
var $ = Object.defineProperty, m = Object.getOwnPropertyDescriptor, a = (t, e, s, i) => {
|
|
10
10
|
for (var o = i > 1 ? void 0 : i ? m(e, s) : e, n = t.length - 1, p; n >= 0; n--)
|
|
11
11
|
(p = t[n]) && (o = (i ? p(e, s, o) : p(o)) || o);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const s=require("./element-CJ_QKaki.cjs"),p=require("./if-defined-Bc9-_I01.cjs"),c=require("./state-DSjcvzDN.cjs"),l=require("./ref-BFa5Utho.cjs"),$=require("./class-map-C_erArZz.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-4oOjKnGY.cjs"),x=require("./input-element-j9znzLWz.cjs"),T=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-
|
|
1
|
+
"use strict";const s=require("./element-CJ_QKaki.cjs"),p=require("./if-defined-Bc9-_I01.cjs"),c=require("./state-DSjcvzDN.cjs"),l=require("./ref-BFa5Utho.cjs"),$=require("./class-map-C_erArZz.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-4oOjKnGY.cjs"),x=require("./input-element-j9znzLWz.cjs"),T=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-D9kFsTCN.cjs");require("./icon-BGuizDwk.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2020 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -7,7 +7,7 @@ import { e as T, i as b, t as a } from "./directive-oAbCiebi.js";
|
|
|
7
7
|
import { f as y, m as w } from "./directive-helpers-BzAtj9by.js";
|
|
8
8
|
import { P as C } from "./input-element-BcFmygSF.js";
|
|
9
9
|
import { P as E } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
10
|
-
import "./input-wrapper-
|
|
10
|
+
import "./input-wrapper-CiqUL7my.js";
|
|
11
11
|
import "./icon-1dy7UZcu.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
@@ -5,7 +5,7 @@ import { e as d, n as m } from "./ref-Xa5dbh--.js";
|
|
|
5
5
|
import { e as g } from "./class-map-wy7PUk0P.js";
|
|
6
6
|
import { P as x } from "./input-element-BcFmygSF.js";
|
|
7
7
|
import { P as v } from "./pkt-slot-controller-BPGj-LC5.js";
|
|
8
|
-
import "./input-wrapper-
|
|
8
|
+
import "./input-wrapper-CiqUL7my.js";
|
|
9
9
|
import "./icon-1dy7UZcu.js";
|
|
10
10
|
var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (i, e, r, t) => {
|
|
11
11
|
for (var n = t > 1 ? void 0 : t ? b(e, r) : e, l = i.length - 1, c; l >= 0; l--)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./element-CJ_QKaki.cjs"),a=require("./if-defined-Bc9-_I01.cjs"),l=require("./state-DSjcvzDN.cjs"),h=require("./ref-BFa5Utho.cjs"),c=require("./class-map-C_erArZz.cjs"),d=require("./input-element-j9znzLWz.cjs"),x=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-
|
|
1
|
+
"use strict";const t=require("./element-CJ_QKaki.cjs"),a=require("./if-defined-Bc9-_I01.cjs"),l=require("./state-DSjcvzDN.cjs"),h=require("./ref-BFa5Utho.cjs"),c=require("./class-map-C_erArZz.cjs"),d=require("./input-element-j9znzLWz.cjs"),x=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-D9kFsTCN.cjs");require("./icon-BGuizDwk.cjs");var $=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(u,i,s,n)=>{for(var e=n>1?void 0:n?f(i,s):i,o=u.length-1,p;o>=0;o--)(p=u[o])&&(e=(n?p(i,s,e):p(e))||e);return n&&e&&$(i,s,e),e};exports.PktTextinput=class extends d.PktInputElement{constructor(){super(),this.inputRef=h.e(),this.helptextSlot=h.e(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new x.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(i,s,n){i==="value"&&this.value!==s&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,s)),super.attributeChangedCallback(i,s,n)}updated(i){var s;super.updated(i),i.has("value")&&(this.counterCurrent=((s=this.value)==null?void 0:s.length)||0,this.valueChanged(this.value,i.get("value"))),i.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const i=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,s=c.e({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),n=this.ariaLabelledby||`${this.id}-input-label`;return t.x`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
label="${this.label}"
|
|
4
4
|
?counter=${this.counter}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.15.2",
|
|
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",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@babel/preset-env": "^7.28.3",
|
|
45
45
|
"@babel/preset-typescript": "^7.25.9",
|
|
46
46
|
"@oslokommune/punkt-assets": "^13.11.0",
|
|
47
|
-
"@oslokommune/punkt-css": "^13.13.
|
|
47
|
+
"@oslokommune/punkt-css": "^13.13.2",
|
|
48
48
|
"@testing-library/jest-dom": "^6.6.3",
|
|
49
49
|
"@typescript-eslint/eslint-plugin": "^8.46.0",
|
|
50
50
|
"@typescript-eslint/parser": "^8.46.0",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"url": "https://github.com/oslokommune/punkt/issues"
|
|
82
82
|
},
|
|
83
83
|
"license": "MIT",
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "b9f90e34e22049d0504e4583f464e86f288af2e8"
|
|
85
85
|
}
|
|
@@ -44,6 +44,8 @@ export interface IPktButton {
|
|
|
44
44
|
secondIconName?: PktIconName
|
|
45
45
|
mode?: TPktButtonMode
|
|
46
46
|
size?: TPktButtonSize
|
|
47
|
+
fullWidth?: Booleanish
|
|
48
|
+
fullWidthOnMobile?: Booleanish
|
|
47
49
|
color?: TPktButtonColor
|
|
48
50
|
skin?: TPktButtonSkin
|
|
49
51
|
variant?: TPktButtonVariant
|
|
@@ -68,6 +70,9 @@ export class PktButton extends PktElement<IPktButton> implements IPktButton {
|
|
|
68
70
|
@property({ type: String }) secondIconName: string = 'user'
|
|
69
71
|
@property({ type: String }) mode?: TPktButtonMode = 'light'
|
|
70
72
|
@property({ type: String }) size: TPktButtonSize = 'medium'
|
|
73
|
+
@property({ type: Boolean, attribute: 'full-width' }) fullWidth: Booleanish = false
|
|
74
|
+
@property({ type: Boolean, attribute: 'full-width-on-mobile' }) fullWidthOnMobile: Booleanish =
|
|
75
|
+
false
|
|
71
76
|
@property({ type: String }) color?: TPktButtonColor
|
|
72
77
|
@property({ type: String }) skin: TPktButtonSkin = 'primary'
|
|
73
78
|
@property({ type: String }) variant: TPktButtonVariant = 'label-only'
|
|
@@ -140,6 +145,8 @@ export class PktButton extends PktElement<IPktButton> implements IPktButton {
|
|
|
140
145
|
[`pkt-btn--${this.variant}`]: !!this.variant,
|
|
141
146
|
[`pkt-btn--${this.color}`]: !!this.color,
|
|
142
147
|
[`pkt-btn--${this.state}`]: !!this.state,
|
|
148
|
+
'pkt-btn--full': !!this.fullWidth,
|
|
149
|
+
'pkt-btn--full-small': !!this.fullWidthOnMobile,
|
|
143
150
|
'pkt-btn--disabled': !!this.disabled,
|
|
144
151
|
'pkt-btn--isLoading': !!this.isLoading,
|
|
145
152
|
}
|
|
@@ -567,5 +567,14 @@ export class PktDatepicker extends PktInputElement<Props> {
|
|
|
567
567
|
public clearInputValue() {
|
|
568
568
|
this._value = []
|
|
569
569
|
this.value = ''
|
|
570
|
+
this.internals.setFormValue(this.value)
|
|
571
|
+
this.dispatchEvent(new Event('change', { bubbles: true, composed: true }))
|
|
572
|
+
this.dispatchEvent(
|
|
573
|
+
new CustomEvent('value-change', {
|
|
574
|
+
detail: this._value,
|
|
575
|
+
bubbles: true,
|
|
576
|
+
composed: true,
|
|
577
|
+
}),
|
|
578
|
+
)
|
|
570
579
|
}
|
|
571
580
|
}
|
package/dist/button-CXJQ_Wgl.cjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./element-CJ_QKaki.cjs"),h=require("./pkt-slot-controller-BzddBp7z.cjs"),u=require("./class-map-C_erArZz.cjs"),a=require("./if-defined-Bc9-_I01.cjs"),d=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");var c=Object.defineProperty,k=Object.getOwnPropertyDescriptor,e=(r,i,s,n)=>{for(var o=n>1?void 0:n?k(i,s):i,p=r.length-1,l;p>=0;p--)(l=r[p])&&(o=(n?l(i,s,o):l(o))||o);return n&&o&&c(i,s,o),o};window.pktAnimationPath=window.pktAnimationPath||"https://punkt-cdn.oslo.kommune.no/latest/animations/";exports.PktButton=class extends t.PktElement{constructor(){super(),this.defaultSlot=d.e(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath,this.slotController=new h.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback(),this.addEventListener("click",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.preventDefault(),i.stopImmediatePropagation())},!0),this.addEventListener("keydown",i=>{(this.disabled||this.hasAttribute("disabled")||this.isLoading)&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopImmediatePropagation())},!0)}attributeChangedCallback(i,s,n){super.attributeChangedCallback(i,s,n),i==="disabled"&&n==="false"&&(this.disabled=!1),(i==="isloading"||i==="isLoading")&&n==="false"&&(this.isLoading=!1)}firstUpdated(i){super.firstUpdated(i),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}render(){const i=this.form??this.getAttribute("form")??void 0,s={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading};return t.x`
|
|
2
|
-
<button
|
|
3
|
-
class=${u.e(s)}
|
|
4
|
-
type=${this.type}
|
|
5
|
-
?disabled=${!!this.disabled}
|
|
6
|
-
aria-busy=${a.o(this.isLoading?"true":void 0)}
|
|
7
|
-
aria-disabled=${a.o(this.disabled||this.isLoading?"true":void 0)}
|
|
8
|
-
form=${a.o(i)}
|
|
9
|
-
>
|
|
10
|
-
${this.isLoading?t.x`<pkt-icon
|
|
11
|
-
class="pkt-btn__icon pkt-btn__spinner"
|
|
12
|
-
name="spinner-blue"
|
|
13
|
-
path=${a.o(this.loadingAnimationPath)}
|
|
14
|
-
></pkt-icon>`:t.E}
|
|
15
|
-
${this.variant!=="label-only"?t.x`<pkt-icon class="pkt-btn__icon pkt-icon" name=${this.iconName}></pkt-icon>`:t.E}
|
|
16
|
-
<span class="pkt-btn__text" ${d.n(this.defaultSlot)}></span>
|
|
17
|
-
${this.variant==="icons-right-and-left"?t.x`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:t.E}
|
|
18
|
-
</button>
|
|
19
|
-
`}};e([t.n({type:String})],exports.PktButton.prototype,"iconName",2);e([t.n({type:String})],exports.PktButton.prototype,"secondIconName",2);e([t.n({type:String})],exports.PktButton.prototype,"mode",2);e([t.n({type:String})],exports.PktButton.prototype,"size",2);e([t.n({type:String})],exports.PktButton.prototype,"color",2);e([t.n({type:String})],exports.PktButton.prototype,"skin",2);e([t.n({type:String})],exports.PktButton.prototype,"variant",2);e([t.n({type:String,reflect:!0})],exports.PktButton.prototype,"state",2);e([t.n({type:String,reflect:!0})],exports.PktButton.prototype,"type",2);e([t.n({type:String})],exports.PktButton.prototype,"form",2);e([t.n({type:Boolean,reflect:!0})],exports.PktButton.prototype,"isLoading",2);e([t.n({type:Boolean,reflect:!0})],exports.PktButton.prototype,"disabled",2);e([t.n({type:String})],exports.PktButton.prototype,"loadingAnimationPath",2);exports.PktButton=e([t.t("pkt-button")],exports.PktButton);
|