@oslokommune/punkt-elements 16.17.3 → 16.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/{accordion-CU2tJ5vn.js → accordion-BjYsEbSM.js} +19 -19
- package/dist/{accordion-DDZkjXFb.cjs → accordion-DaeWPWod.cjs} +5 -5
- package/dist/{alert-ePJuDtmm.js → alert-BkzC5mVu.js} +22 -22
- package/dist/{alert-BEEnTiCb.cjs → alert-D_45dWPn.cjs} +6 -6
- package/dist/{async-directive-CaQiqjyV.js → async-directive-Cz6tcqge.js} +2 -2
- package/dist/async-directive-DO1QtVmf.cjs +1 -0
- package/dist/{backlink-CiwXrQYD.js → backlink-BXAdgAte.js} +6 -6
- package/dist/{backlink-Ba03LlbB.cjs → backlink-C42-3OG3.cjs} +2 -2
- package/dist/{breadcrumbs-CD1zib3s.cjs → breadcrumbs-CkjeLh3U.cjs} +6 -6
- package/dist/{breadcrumbs-CpuVqWhF.js → breadcrumbs-Dkb9TxMp.js} +15 -15
- package/dist/{button-BIpd1xJh.js → button-CR-KWhTT.js} +21 -21
- package/dist/{button-D-TOBaJB.cjs → button-Dwv11n6R.cjs} +7 -7
- package/dist/{calendar-DkjXla0I.cjs → calendar-Buvxe4l_.cjs} +11 -11
- package/dist/{calendar-Ch1dgnBo.js → calendar-DAq6iJdx.js} +50 -50
- package/dist/{card-CEDbo1t7.js → card-5PydU247.js} +43 -43
- package/dist/{card-C3POnP3O.cjs → card-C__IlsUa.cjs} +26 -26
- package/dist/{checkbox-CF5mSBR5.js → checkbox-CC1X7fw4.js} +23 -23
- package/dist/{checkbox-BerAYcfK.cjs → checkbox-DzMc0AJX.cjs} +10 -10
- package/dist/class-map-B8Ja0q7n.cjs +1 -0
- package/dist/{class-map-C8HuhNzZ.js → class-map-DH9hlJny.js} +7 -8
- package/dist/{combobox-DjvRMKOD.js → combobox-D-DY7YcW.js} +42 -42
- package/dist/{combobox-DYttdLJ4.cjs → combobox-x4tBGP3F.cjs} +17 -17
- package/dist/components/heading/heading.d.ts +5 -8
- package/dist/components/icon/icon.d.ts +6 -1
- package/dist/components/icon/icon.test.d.ts +2 -0
- package/dist/{consent-B5dIDyLD.cjs → consent-BB3g_ByO.cjs} +3 -3
- package/dist/{consent-DSHrt9eS.js → consent-Y14WZ0JS.js} +8 -8
- package/dist/{datepicker-D3QQbd_H.cjs → datepicker-BFI-3stE.cjs} +20 -20
- package/dist/{datepicker-M_jcY3wp.js → datepicker-CRk7aiwH.js} +57 -57
- package/dist/{directive-helpers-Dkv2gKgs.js → directive-helpers-Cep_4cpj.js} +1 -1
- package/dist/{directive-helpers-D1QSxY17.cjs → directive-helpers-f36YZFOG.cjs} +1 -1
- package/dist/element-CXAtr6Gu.cjs +2 -0
- package/dist/{element-cZ85T_aa.js → element-CduG0XyF.js} +47 -23
- package/dist/{element-with-slot-4J2o3SeU.js → element-with-slot-BVj9MXzi.js} +5 -6
- package/dist/element-with-slot-Cmxb9h4H.cjs +1 -0
- package/dist/{fileupload-IXSGrqiH.js → fileupload-C8muj8qd.js} +149 -149
- package/dist/{fileupload-qc0fHcR-.cjs → fileupload-YtsrgQTY.cjs} +40 -40
- package/dist/{header-C1hDYMRX.cjs → header-CjBip0zj.cjs} +57 -57
- package/dist/{header-BGknkrEt.js → header-DONTGbD9.js} +130 -130
- package/dist/{header-menu-zhGYdnvz.js → header-menu-BU-ylGrJ.js} +45 -45
- package/dist/{header-menu-CPI1_5oZ.cjs → header-menu-CnW7nzmF.cjs} +24 -24
- package/dist/heading-3o4Dk0Wn.js +80 -0
- package/dist/heading-C40-NX0r.cjs +1 -0
- package/dist/{helptext-BdqoW19r.js → helptext-C2aQBBo_.js} +12 -12
- package/dist/{helptext-KWXjKljV.cjs → helptext-DNLg43eI.cjs} +4 -4
- package/dist/icon-Dw6I0HDV.cjs +1 -0
- package/dist/{icon-Co72KtgF.js → icon-LaKyBKON.js} +39 -19
- package/dist/if-defined-LTjAScFG.cjs +1 -0
- package/dist/{if-defined-Cjj8qN-Z.js → if-defined-VShASPdu.js} +1 -1
- package/dist/{input-element-D0egtEnr.cjs → input-element-BHQVt4Q9.cjs} +1 -1
- package/dist/{input-element-B1ciW1N2.js → input-element-BrmkXIXi.js} +30 -30
- package/dist/{input-wrapper-DVU68NcJ.js → input-wrapper-B6WowlWG.js} +33 -33
- package/dist/{input-wrapper-DOIWggEv.cjs → input-wrapper-Dhkt20WW.cjs} +17 -17
- package/dist/{link-DMKjKawh.cjs → link-B5ur0Rym.cjs} +4 -4
- package/dist/{link-F51Ho7CV.js → link-ClUNY__5.js} +13 -13
- package/dist/linkcard-BIcCW-qw.cjs +13 -0
- package/dist/{linkcard-E07qJZMP.js → linkcard-DNJm5FvA.js} +15 -15
- package/dist/{listbox-0NHJvNjz.js → listbox-DXMIBv3y.js} +35 -35
- package/dist/{listbox-CcThiNBY.cjs → listbox-DbEobJNx.cjs} +14 -14
- package/dist/{loader-q_eO6zaE.cjs → loader-Uap9qDsV.cjs} +5 -5
- package/dist/{loader-teN65oWo.js → loader-gKdQpOOQ.js} +12 -12
- package/dist/{messagebox-D1QeQqb8.cjs → messagebox-BqBxXK8c.cjs} +5 -5
- package/dist/{messagebox-Ct9lfe0Z.js → messagebox-XRFecqyS.js} +15 -15
- package/dist/{modal-Ca-6xVkg.js → modal-CWgeT-RP.js} +19 -19
- package/dist/{modal-B7-0F5q7.cjs → modal-CrYHKOmr.cjs} +8 -8
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.cjs +1 -1
- package/dist/pkt-breadcrumbs.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.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 +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +32 -32
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-CCB15L_G.js → pkt-options-controller-BTNtjEIS.js} +1 -1
- package/dist/{pkt-options-controller-CeAQ-D-i.cjs → pkt-options-controller-CBM8xHwR.cjs} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.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/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{progressbar-o-M17HPA.js → progressbar-B0P_vmGD.js} +23 -24
- package/dist/progressbar-DADdvDl5.cjs +17 -0
- package/dist/{radiobutton-B1Xg6XzP.cjs → radiobutton-BfURufrZ.cjs} +8 -8
- package/dist/{radiobutton-BAn1V_mQ.js → radiobutton-C6zERHoy.js} +20 -20
- package/dist/{ref-RS8Uv6uC.js → ref-BgoHEsEt.js} +7 -8
- package/dist/ref-CBdWMlde.cjs +1 -0
- package/dist/{repeat-DV1O43YU.js → repeat-CKIii8Mi.js} +15 -16
- package/dist/repeat-CRRgmzVn.cjs +1 -0
- package/dist/{searchinput-BVIaoetB.cjs → searchinput-BrxfRzez.cjs} +13 -13
- package/dist/{searchinput-CIseS5tL.js → searchinput-fPvXHu2O.js} +31 -31
- package/dist/{select-6XCVj1lP.js → select-BIgFPp42.js} +13 -13
- package/dist/{select-DO0xGhQQ.cjs → select-DzZHv6Bz.cjs} +3 -3
- package/dist/shared-types/index.d.ts +1 -1
- package/dist/shared-types/skin.d.ts +4 -0
- package/dist/{tabs-ClI1XQDt.js → tabs-BJx6wwXD.js} +29 -29
- package/dist/{tabs-CN_RIMWg.cjs → tabs-DxQy8U-0.cjs} +7 -7
- package/dist/{tag-DWtajZk6.cjs → tag-CBFz0R9N.cjs} +5 -5
- package/dist/{tag-hl59gziI.js → tag-CzlnHhho.js} +19 -19
- package/dist/textarea-M_S9WK7s.cjs +46 -0
- package/dist/{textarea-DBSNSvrX.js → textarea-qHtkhelz.js} +24 -25
- package/dist/{textinput-BZZnFDk3.js → textinput-CZrBM-Fj.js} +26 -26
- package/dist/{textinput-Dsc-8-BB.cjs → textinput-C_6kvf87.cjs} +12 -12
- package/dist/{timepicker-DDQ7CfOy.js → timepicker-O0iCeJyW.js} +51 -51
- package/dist/{timepicker-C2Ua6vHY.cjs → timepicker-WiYLAncb.cjs} +20 -20
- package/package.json +2 -2
- package/src/components/card/card.ts +1 -1
- package/src/components/heading/heading.test.ts +79 -70
- package/src/components/heading/heading.ts +40 -78
- package/src/components/icon/icon.test.ts +101 -0
- package/src/components/icon/icon.ts +40 -1
- package/dist/async-directive-B9P1Qa0k.cjs +0 -1
- package/dist/class-map-CJ-msbHs.cjs +0 -1
- package/dist/directive-3THFsVew.js +0 -28
- package/dist/directive-CJ2giQBZ.cjs +0 -1
- package/dist/element-DjtxO-1r.cjs +0 -2
- package/dist/element-with-slot-CWoTGA1B.cjs +0 -1
- package/dist/heading-BxvE80bb.js +0 -73
- package/dist/heading-DRJTS27k.cjs +0 -1
- package/dist/icon-Dr8sfT2X.cjs +0 -1
- package/dist/if-defined-XKOD_t_V.cjs +0 -1
- package/dist/linkcard-CBmJbSoV.cjs +0 -13
- package/dist/progressbar-Ca7pRjmt.cjs +0 -17
- package/dist/ref-BaJ0mBT_.cjs +0 -1
- package/dist/repeat-DaDFvx86.cjs +0 -1
- package/dist/textarea-CV6z3LDf.cjs +0 -46
- /package/dist/{booleanish-CRaKZ75t.js → booleanish-BmcOU-43.js} +0 -0
- /package/dist/{booleanish-B5EFqFpJ.cjs → booleanish-jJLlnr6-.cjs} +0 -0
- /package/dist/{classutils-z8YsPlOf.cjs → classutils-CVTzKF0J.cjs} +0 -0
- /package/dist/{classutils-DEL164Ur.js → classutils-lVbGcvjN.js} +0 -0
- /package/dist/{converters-Bffq_YDm.cjs → converters-C_66kHUN.cjs} +0 -0
- /package/dist/{converters-jauYkvNh.js → converters-DSQXaDQ_.js} +0 -0
- /package/dist/{dialog-polyfill.esm-B7W3teD0.js → dialog-polyfill.esm-0dVT8G1o.js} +0 -0
- /package/dist/{dialog-polyfill.esm-BnAQvMQO.cjs → dialog-polyfill.esm-CYs2AHP1.cjs} +0 -0
- /package/dist/{focus-modality-controller-pzSZkDkH.js → focus-modality-controller-CaUqYdk0.js} +0 -0
- /package/dist/{focus-modality-controller-BSZAQk8y.cjs → focus-modality-controller-wI5SR8wH.cjs} +0 -0
- /package/dist/{input-wrapper-CQGoyLdZ.cjs → input-wrapper-CYCCx8MP.cjs} +0 -0
- /package/dist/{input-wrapper-DwSsP39J.js → input-wrapper-kw2y6Jp_.js} +0 -0
- /package/dist/{utils-BOOZ0ppt.js → utils-CUqCKGvp.js} +0 -0
- /package/dist/{utils-CM67Oudc.cjs → utils-CjAbIttF.cjs} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as a } from "./element-with-slot-
|
|
3
|
-
import { t as o } from "./if-defined-
|
|
4
|
-
import { n as s, t as c } from "./ref-
|
|
5
|
-
import { t as l } from "./input-element-
|
|
6
|
-
import { t as u } from "./pkt-options-controller-
|
|
7
|
-
import "./input-wrapper-
|
|
1
|
+
import { a as e, n as t, o as n, p as r, s as i } from "./element-CduG0XyF.js";
|
|
2
|
+
import { n as a } from "./element-with-slot-BVj9MXzi.js";
|
|
3
|
+
import { t as o } from "./if-defined-VShASPdu.js";
|
|
4
|
+
import { n as s, t as c } from "./ref-BgoHEsEt.js";
|
|
5
|
+
import { t as l } from "./input-element-BrmkXIXi.js";
|
|
6
|
+
import { t as u } from "./pkt-options-controller-BTNtjEIS.js";
|
|
7
|
+
import "./input-wrapper-B6WowlWG.js";
|
|
8
8
|
//#region src/base-elements/options-input-element.ts
|
|
9
9
|
var d = class extends l {
|
|
10
10
|
constructor(...e) {
|
|
@@ -36,10 +36,10 @@ var d = class extends l {
|
|
|
36
36
|
super.willUpdate(e), this.parseOptions();
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
t([n({
|
|
40
40
|
type: Array,
|
|
41
41
|
attribute: "options"
|
|
42
|
-
})], d.prototype, "_optionsProp", void 0),
|
|
42
|
+
})], d.prototype, "_optionsProp", void 0), t([e()], d.prototype, "_options", void 0);
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/components/select/select.ts
|
|
45
45
|
var f = class extends d {
|
|
@@ -89,7 +89,7 @@ var f = class extends d {
|
|
|
89
89
|
}
|
|
90
90
|
render() {
|
|
91
91
|
let e = `pkt-input ${this.fullwidth ? "pkt-input--fullwidth" : ""}`;
|
|
92
|
-
return
|
|
92
|
+
return r`
|
|
93
93
|
<pkt-input-wrapper
|
|
94
94
|
?counter=${this.counter}
|
|
95
95
|
?disabled=${this.disabled}
|
|
@@ -134,7 +134,7 @@ var f = class extends d {
|
|
|
134
134
|
}}
|
|
135
135
|
${s(this.inputRef)}
|
|
136
136
|
>
|
|
137
|
-
${this._options.length > 0 ? this._options.map((e) =>
|
|
137
|
+
${this._options.length > 0 ? this._options.map((e) => r`<option
|
|
138
138
|
value=${e.value}
|
|
139
139
|
?selected=${this.value == e.value || e.selected}
|
|
140
140
|
?disabled=${e.disabled}
|
|
@@ -151,9 +151,9 @@ var f = class extends d {
|
|
|
151
151
|
return e == null || isNaN(e) ? null : e;
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
|
-
|
|
154
|
+
t([n({ type: String })], f.prototype, "value", void 0);
|
|
155
155
|
try {
|
|
156
|
-
|
|
156
|
+
i("pkt-select")(f);
|
|
157
157
|
} catch {
|
|
158
158
|
console.warn("Forsøker å definere <pkt-select>, men den er allerede definert");
|
|
159
159
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`./element-
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./element-with-slot-Cmxb9h4H.cjs`),n=require(`./if-defined-LTjAScFG.cjs`),r=require(`./ref-CBdWMlde.cjs`),i=require(`./input-element-BHQVt4Q9.cjs`),a=require(`./pkt-options-controller-CBM8xHwR.cjs`);require(`./input-wrapper-Dhkt20WW.cjs`);var o=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.n([e.o({type:Array,attribute:`options`})],o.prototype,`_optionsProp`,void 0),e.n([e.a()],o.prototype,`_options`,void 0);var s=class extends o{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.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)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),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(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e.p`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
3
|
?counter=${this.counter}
|
|
4
4
|
?disabled=${this.disabled}
|
|
@@ -35,7 +35,7 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1
|
|
|
35
35
|
@blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
|
|
36
36
|
${r.n(this.inputRef)}
|
|
37
37
|
>
|
|
38
|
-
${this._options.length>0?this._options.map(t=>e.
|
|
38
|
+
${this._options.length>0?this._options.map(t=>e.p`<option
|
|
39
39
|
value=${t.value}
|
|
40
40
|
?selected=${this.value==t.value||t.selected}
|
|
41
41
|
?disabled=${t.disabled}
|
|
@@ -46,4 +46,4 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1
|
|
|
46
46
|
</select>
|
|
47
47
|
<div class="pkt-contents" slot="helptext">${t.n(this,`helptext`)}</div>
|
|
48
48
|
</pkt-input-wrapper>
|
|
49
|
-
`}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.
|
|
49
|
+
`}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.n([e.o({type:String})],s.prototype,`value`,void 0);try{e.s(`pkt-select`)(s)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var c=s;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -9,7 +9,7 @@ export { DEFAULT_HEADER_FOOTER_URL } from './header-menu';
|
|
|
9
9
|
export type { TLayout, TVerticalPosition, THorizontalPosition, TPosition, TPositionWithCenter, } from './layout';
|
|
10
10
|
export type { THTMLButtonType, TSelectionMode } from './form';
|
|
11
11
|
export type { TSize3, TSize5, TSize7 } from './size';
|
|
12
|
-
export type { TAlertSkin, TMessageboxSkin, TAccordionSkin, TCardSkin } from './skin';
|
|
12
|
+
export type { TAlertSkin, TMessageboxSkin, TAccordionSkin, TCardSkin, TTagSkin } from './skin';
|
|
13
13
|
export type { IDateConstraints, ICalendarGridDimensions, IGridCellPosition, TDateRangeMap, ISelectionState, ISelectionOptions, } from './calendar';
|
|
14
14
|
export type { IDatepickerStrings } from './datepicker';
|
|
15
15
|
export { defaultSingleStrings, defaultRangeStrings } from './datepicker';
|
|
@@ -22,3 +22,7 @@ export type TAccordionSkin = 'borderless' | 'outlined' | 'beige' | 'blue' | 'plu
|
|
|
22
22
|
* Card component skin variants
|
|
23
23
|
*/
|
|
24
24
|
export type TCardSkin = 'outlined' | 'outlined-beige' | 'gray' | 'beige' | 'green' | 'blue';
|
|
25
|
+
/**
|
|
26
|
+
* Tag component skin variants
|
|
27
|
+
*/
|
|
28
|
+
export type TTagSkin = 'blue' | 'blue-light' | 'blue-dark' | 'green' | 'red' | 'beige' | 'yellow' | 'grey' | 'gray';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as a, t as o } from "./element-with-slot-
|
|
3
|
-
import { t as s } from "./if-defined-
|
|
4
|
-
import { n as c, t as l } from "./ref-
|
|
1
|
+
import { a as e, n as t, o as n, p as r, s as i } from "./element-CduG0XyF.js";
|
|
2
|
+
import { n as a, t as o } from "./element-with-slot-BVj9MXzi.js";
|
|
3
|
+
import { t as s } from "./if-defined-VShASPdu.js";
|
|
4
|
+
import { n as c, t as l } from "./ref-BgoHEsEt.js";
|
|
5
5
|
//#region ../../node_modules/@lit/context/lib/context-request-event.js
|
|
6
6
|
var u = class extends Event {
|
|
7
7
|
constructor(e, t, n, r) {
|
|
@@ -241,32 +241,32 @@ var v = d(Symbol("pkt-tabs-context")), y = class extends o {
|
|
|
241
241
|
}
|
|
242
242
|
render() {
|
|
243
243
|
let e = this.useArrowNav ? "tablist" : "navigation";
|
|
244
|
-
return
|
|
244
|
+
return r`
|
|
245
245
|
<div class=${this.separatorIconName || this.separatorIconPath ? "pkt-tabs pkt-tabs--with-separator" : "pkt-tabs"}>
|
|
246
246
|
<div class="pkt-tabs__list" role=${e}>${a(this)}</div>
|
|
247
247
|
</div>
|
|
248
248
|
`;
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
-
|
|
251
|
+
t([n({
|
|
252
252
|
type: Boolean,
|
|
253
253
|
reflect: !0,
|
|
254
254
|
attribute: "arrow-nav"
|
|
255
|
-
})], y.prototype, "arrowNav", void 0),
|
|
255
|
+
})], y.prototype, "arrowNav", void 0), t([n({
|
|
256
256
|
type: Boolean,
|
|
257
257
|
reflect: !0,
|
|
258
258
|
attribute: "disable-arrow-nav"
|
|
259
|
-
})], y.prototype, "disableArrowNav", void 0),
|
|
259
|
+
})], y.prototype, "disableArrowNav", void 0), t([n({
|
|
260
260
|
type: String,
|
|
261
261
|
reflect: !0,
|
|
262
262
|
attribute: "separator-icon-name"
|
|
263
|
-
})], y.prototype, "separatorIconName", void 0),
|
|
263
|
+
})], y.prototype, "separatorIconName", void 0), t([n({
|
|
264
264
|
type: String,
|
|
265
265
|
reflect: !0,
|
|
266
266
|
attribute: "separator-icon-path"
|
|
267
|
-
})], y.prototype, "separatorIconPath", void 0),
|
|
267
|
+
})], y.prototype, "separatorIconPath", void 0), t([e()], y.prototype, "tabRefs", void 0), t([e()], y.prototype, "disabledMap", void 0), t([e()], y.prototype, "tabCount", void 0), t([g({ context: v }), e()], y.prototype, "context", void 0);
|
|
268
268
|
try {
|
|
269
|
-
|
|
269
|
+
i("pkt-tabs")(y);
|
|
270
270
|
} catch {
|
|
271
271
|
console.warn("Forsøker å definere <pkt-tabs>, men den er allerede definert");
|
|
272
272
|
}
|
|
@@ -299,16 +299,16 @@ var b = class extends o {
|
|
|
299
299
|
this.context && this.context.handleKeyUp(e, this.index);
|
|
300
300
|
}
|
|
301
301
|
render() {
|
|
302
|
-
let e = this.context?.useArrowNav ?? !0,
|
|
303
|
-
${this.icon ?
|
|
302
|
+
let e = this.context?.useArrowNav ?? !0, t = this.active && !this.disabled, n = [t ? "active" : "", this.disabled ? "pkt-tabs__item--disabled" : ""].filter(Boolean).join(" "), i = e ? "tab" : void 0, o = e ? t : void 0, l = this.disabled ? -1 : t || !e ? void 0 : -1, u = `pkt-icon--small ${this.icon === "check" ? "pkt-tabs__status-icon" : ""}`, d = r`
|
|
303
|
+
${this.icon ? r`<pkt-icon name=${this.icon} class=${u}></pkt-icon>` : ""}
|
|
304
304
|
<span>${a(this)}</span>
|
|
305
|
-
${this.tag ?
|
|
305
|
+
${this.tag ? r`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>` : ""}
|
|
306
306
|
`;
|
|
307
|
-
return this.href ?
|
|
307
|
+
return this.href ? r`
|
|
308
308
|
<a
|
|
309
309
|
${c(this.elementRef)}
|
|
310
310
|
href=${s(this.disabled ? void 0 : this.href)}
|
|
311
|
-
class="pkt-tabs__link ${
|
|
311
|
+
class="pkt-tabs__link ${n}"
|
|
312
312
|
role=${s(i)}
|
|
313
313
|
aria-selected=${s(o)}
|
|
314
314
|
aria-disabled=${s(this.disabled ? "true" : void 0)}
|
|
@@ -319,11 +319,11 @@ var b = class extends o {
|
|
|
319
319
|
>
|
|
320
320
|
${d}
|
|
321
321
|
</a>
|
|
322
|
-
` :
|
|
322
|
+
` : r`
|
|
323
323
|
<button
|
|
324
324
|
${c(this.elementRef)}
|
|
325
325
|
type="button"
|
|
326
|
-
class="pkt-tabs__button pkt-link-button ${
|
|
326
|
+
class="pkt-tabs__button pkt-link-button ${n}"
|
|
327
327
|
?disabled=${this.disabled}
|
|
328
328
|
aria-disabled=${s(this.disabled ? "true" : void 0)}
|
|
329
329
|
role=${s(i)}
|
|
@@ -338,37 +338,37 @@ var b = class extends o {
|
|
|
338
338
|
`;
|
|
339
339
|
}
|
|
340
340
|
};
|
|
341
|
-
|
|
341
|
+
t([n({
|
|
342
342
|
type: Boolean,
|
|
343
343
|
reflect: !0
|
|
344
|
-
})], b.prototype, "active", void 0),
|
|
344
|
+
})], b.prototype, "active", void 0), t([n({
|
|
345
345
|
type: Boolean,
|
|
346
346
|
reflect: !0
|
|
347
|
-
})], b.prototype, "disabled", void 0),
|
|
347
|
+
})], b.prototype, "disabled", void 0), t([n({
|
|
348
348
|
type: String,
|
|
349
349
|
reflect: !0
|
|
350
|
-
})], b.prototype, "href", void 0),
|
|
350
|
+
})], b.prototype, "href", void 0), t([n({
|
|
351
351
|
type: String,
|
|
352
352
|
reflect: !0
|
|
353
|
-
})], b.prototype, "icon", void 0),
|
|
353
|
+
})], b.prototype, "icon", void 0), t([n({
|
|
354
354
|
type: String,
|
|
355
355
|
reflect: !0
|
|
356
|
-
})], b.prototype, "controls", void 0),
|
|
356
|
+
})], b.prototype, "controls", void 0), t([n({
|
|
357
357
|
type: String,
|
|
358
358
|
reflect: !0
|
|
359
|
-
})], b.prototype, "tag", void 0),
|
|
359
|
+
})], b.prototype, "tag", void 0), t([n({
|
|
360
360
|
type: String,
|
|
361
361
|
reflect: !0,
|
|
362
362
|
attribute: "tag-skin"
|
|
363
|
-
})], b.prototype, "tagSkin", void 0),
|
|
363
|
+
})], b.prototype, "tagSkin", void 0), t([n({
|
|
364
364
|
type: Number,
|
|
365
365
|
reflect: !0
|
|
366
|
-
})], b.prototype, "index", void 0),
|
|
366
|
+
})], b.prototype, "index", void 0), t([_({
|
|
367
367
|
context: v,
|
|
368
368
|
subscribe: !0
|
|
369
|
-
}),
|
|
369
|
+
}), n({ attribute: !1 })], b.prototype, "context", void 0);
|
|
370
370
|
try {
|
|
371
|
-
|
|
371
|
+
i("pkt-tab-item")(b);
|
|
372
372
|
} catch {
|
|
373
373
|
console.warn("Forsøker å definere <pkt-tab-item>, men den er allerede definert");
|
|
374
374
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const e=require(`./element-
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./element-with-slot-Cmxb9h4H.cjs`),n=require(`./if-defined-LTjAScFG.cjs`),r=require(`./ref-CBdWMlde.cjs`);var i=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function a(e){return e}var o=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new i(this.context,this.host,this.t,this.subscribe))}},s=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},c=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},l=class extends s{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new i(this.context,n,e,!0)));e.stopPropagation()},this.host=e,t.context===void 0?this.context=t:this.context=t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new c(this.context,this.host))}};function u({context:e}){return(t,n)=>{let r=new WeakMap;if(typeof n==`object`)return{get(){return t.get.call(this)},set(e){return r.get(this).setValue(e),t.set.call(this,e)},init(t){return r.set(this,new l(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer((t=>{r.set(t,new l(t,{context:e}))}));let i=Object.getOwnPropertyDescriptor(t,n),a;if(i===void 0){let e=new WeakMap;a={get(){return e.get(this)},set(t){r.get(this).setValue(t),e.set(this,t)},configurable:!0,enumerable:!0}}else{let e=i.set;a={...i,set(t){r.get(this).setValue(t),e?.call(this,t)}}}Object.defineProperty(t,n,a);return}}}function d({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new o(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new o(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var f=a(Symbol(`pkt-tabs-context`)),p=class extends t.t{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav}),this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let n=this.useArrowNav?`tablist`:`navigation`;return e.p`
|
|
2
2
|
<div class=${this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`}>
|
|
3
3
|
<div class="pkt-tabs__list" role=${n}>${t.n(this)}</div>
|
|
4
4
|
</div>
|
|
5
|
-
`}};e.
|
|
6
|
-
${this.icon?e.
|
|
5
|
+
`}};e.n([e.o({type:Boolean,reflect:!0,attribute:`arrow-nav`})],p.prototype,`arrowNav`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],p.prototype,`disableArrowNav`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`separator-icon-name`})],p.prototype,`separatorIconName`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`separator-icon-path`})],p.prototype,`separatorIconPath`,void 0),e.n([e.a()],p.prototype,`tabRefs`,void 0),e.n([e.a()],p.prototype,`disabledMap`,void 0),e.n([e.a()],p.prototype,`tabCount`,void 0),e.n([u({context:f}),e.a()],p.prototype,`context`,void 0);try{e.s(`pkt-tabs`)(p)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var m=class extends t.t{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=r.t()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let i=this.context?.useArrowNav??!0,a=this.active&&!this.disabled,o=[a?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),s=i?`tab`:void 0,c=i?a:void 0,l=this.disabled?-1:a||!i?void 0:-1,u=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,d=e.p`
|
|
6
|
+
${this.icon?e.p`<pkt-icon name=${this.icon} class=${u}></pkt-icon>`:``}
|
|
7
7
|
<span>${t.n(this)}</span>
|
|
8
|
-
${this.tag?e.
|
|
9
|
-
`;return this.href?e.
|
|
8
|
+
${this.tag?e.p`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:``}
|
|
9
|
+
`;return this.href?e.p`
|
|
10
10
|
<a
|
|
11
11
|
${r.n(this.elementRef)}
|
|
12
12
|
href=${n.t(this.disabled?void 0:this.href)}
|
|
@@ -21,7 +21,7 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1
|
|
|
21
21
|
>
|
|
22
22
|
${d}
|
|
23
23
|
</a>
|
|
24
|
-
`:e.
|
|
24
|
+
`:e.p`
|
|
25
25
|
<button
|
|
26
26
|
${r.n(this.elementRef)}
|
|
27
27
|
type="button"
|
|
@@ -37,4 +37,4 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1
|
|
|
37
37
|
>
|
|
38
38
|
${d}
|
|
39
39
|
</button>
|
|
40
|
-
`}};e.
|
|
40
|
+
`}};e.n([e.o({type:Boolean,reflect:!0})],m.prototype,`active`,void 0),e.n([e.o({type:Boolean,reflect:!0})],m.prototype,`disabled`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`href`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`icon`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`controls`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`tag`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`tag-skin`})],m.prototype,`tagSkin`,void 0),e.n([e.o({type:Number,reflect:!0})],m.prototype,`index`,void 0),e.n([d({context:f,subscribe:!0}),e.o({attribute:!1})],m.prototype,`context`,void 0);try{e.s(`pkt-tab-item`)(m)}catch{console.warn(`Forsøker å definere <pkt-tab-item>, men den er allerede definert`)}var h=p;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`./element-
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),n=require(`./element-with-slot-Cmxb9h4H.cjs`);require(`./icon-Dw6I0HDV.cjs`);const r=require(`./if-defined-LTjAScFG.cjs`);var i={name:`pkt-tag`,react:`PktTag`,"css-class":`pkt-tag`,isElement:!0,"dark-mode":!0,props:{size:{name:`Størrelse`,description:`Størrelsen på taggen`,required:!1,default:`medium`,type:[`small`,`medium`,`large`],category:`ui`},iconName:{name:`Ikon`,description:`Navnet på ikonet som skal vises i taggen`,type:`icon`,required:!1,category:`ui`},skin:{name:`Utseende`,description:`Utseendet til taggen`,required:!1,default:`blue`,type:[`blue`,`blue-light`,`blue-dark`,`green`,`red`,`beige`,`yellow`,`gray`],category:`ui`},closeTag:{name:`Lukk tag`,description:`Skal taggen ha en lukkeknapp?`,type:`boolean`,required:!1,default:!1,category:`ui`},textStyle:{name:`Tekststil`,description:`Stilen på teksten i taggen`,required:!1,default:`normal-text`,type:[`thin-text`,`normal-text`],category:`ui`},type:{name:`Type, dersom lukkeknapp`,description:`Type tag, brukes for å spesifisere om det er en knapp, submit eller reset`,required:!1,default:`button`,type:[`button`,`submit`,`reset`],category:`tech`},ariaLabel:{name:`aria-label`,description:`aria-label for taggen, brukes for tilgjengelighet`,type:`string`,required:!1,category:`accessibility`}},slots:{default:{description:`Teksten til tag`}}},a=class extends n.t{constructor(){super(),this.closeTag=i.props.closeTag.default,this.size=i.props.size.default,this.skin=i.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=i.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!1,composed:!0}))},this._isClosed=!1}firstUpdated(e){if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){let e=this.querySelector(`button span, .pkt-tag > span`)?.textContent?.trim();e&&(this._ariaDescription=`Klikk for å fjerne ${e}`)}}render(){let i={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},a={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?e.p`
|
|
2
2
|
<button
|
|
3
3
|
class=${t.t(a)}
|
|
4
4
|
type=${this.type}
|
|
@@ -7,7 +7,7 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),
|
|
|
7
7
|
aria-label=${r.t(this.ariaLabel||void 0)}
|
|
8
8
|
aria-description=${r.t(this._ariaDescription||void 0)}
|
|
9
9
|
>
|
|
10
|
-
${this.iconName&&e.
|
|
10
|
+
${this.iconName&&e.p`<pkt-icon
|
|
11
11
|
class="pkt-tag__icon"
|
|
12
12
|
name=${this.iconName}
|
|
13
13
|
aria-hidden="true"
|
|
@@ -15,13 +15,13 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),
|
|
|
15
15
|
<span>${n.n(this)}</span>
|
|
16
16
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
17
17
|
</button>
|
|
18
|
-
`:e.
|
|
18
|
+
`:e.p`
|
|
19
19
|
<span class=${t.t(i)}>
|
|
20
|
-
${this.iconName&&e.
|
|
20
|
+
${this.iconName&&e.p`<pkt-icon
|
|
21
21
|
class="pkt-tag__icon"
|
|
22
22
|
name=${this.iconName}
|
|
23
23
|
aria-hidden="true"
|
|
24
24
|
></pkt-icon>`}
|
|
25
25
|
<span>${n.n(this)}</span>
|
|
26
26
|
</span>
|
|
27
|
-
`}};e.
|
|
27
|
+
`}};e.n([e.o({type:Boolean,reflect:!0})],a.prototype,`closeTag`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`size`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`skin`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`textStyle`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`iconName`,void 0),e.n([e.o({type:String})],a.prototype,`type`,void 0),e.n([e.o({type:String})],a.prototype,`ariaLabel`,void 0),e.n([e.o({type:Number,attribute:`button-tabindex`})],a.prototype,`buttonTabindex`,void 0),e.n([e.a()],a.prototype,`_isClosed`,void 0),e.n([e.a()],a.prototype,`_ariaDescription`,void 0);try{e.s(`pkt-tag`)(a)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var o=a;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as a } from "./class-map-
|
|
3
|
-
import { n as o, t as s } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as c } from "./if-defined-
|
|
1
|
+
import { a as e, n as t, o as n, p as r, s as i } from "./element-CduG0XyF.js";
|
|
2
|
+
import { t as a } from "./class-map-DH9hlJny.js";
|
|
3
|
+
import { n as o, t as s } from "./element-with-slot-BVj9MXzi.js";
|
|
4
|
+
import "./icon-LaKyBKON.js";
|
|
5
|
+
import { t as c } from "./if-defined-VShASPdu.js";
|
|
6
6
|
var l = {
|
|
7
7
|
name: "pkt-tag",
|
|
8
8
|
react: "PktTag",
|
|
@@ -109,7 +109,7 @@ var l = {
|
|
|
109
109
|
[`pkt-tag--${this.size}`]: !!this.size,
|
|
110
110
|
[`pkt-tag--${this.skin}`]: !!this.skin,
|
|
111
111
|
[`pkt-tag--${this.textStyle}`]: !!this.textStyle
|
|
112
|
-
},
|
|
112
|
+
}, t = {
|
|
113
113
|
"pkt-tag": !0,
|
|
114
114
|
"pkt-btn": !0,
|
|
115
115
|
"pkt-btn--tertiary": !0,
|
|
@@ -119,16 +119,16 @@ var l = {
|
|
|
119
119
|
"pkt-btn--icons-right-and-left": this.closeTag && !!this.iconName,
|
|
120
120
|
"pkt-hide": this._isClosed
|
|
121
121
|
};
|
|
122
|
-
return this.closeTag ?
|
|
122
|
+
return this.closeTag ? r`
|
|
123
123
|
<button
|
|
124
|
-
class=${a(
|
|
124
|
+
class=${a(t)}
|
|
125
125
|
type=${this.type}
|
|
126
126
|
tabindex=${c(this.buttonTabindex)}
|
|
127
127
|
@click=${this.close}
|
|
128
128
|
aria-label=${c(this.ariaLabel || void 0)}
|
|
129
129
|
aria-description=${c(this._ariaDescription || void 0)}
|
|
130
130
|
>
|
|
131
|
-
${this.iconName &&
|
|
131
|
+
${this.iconName && r`<pkt-icon
|
|
132
132
|
class="pkt-tag__icon"
|
|
133
133
|
name=${this.iconName}
|
|
134
134
|
aria-hidden="true"
|
|
@@ -136,9 +136,9 @@ var l = {
|
|
|
136
136
|
<span>${o(this)}</span>
|
|
137
137
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
138
138
|
</button>
|
|
139
|
-
` :
|
|
139
|
+
` : r`
|
|
140
140
|
<span class=${a(e)}>
|
|
141
|
-
${this.iconName &&
|
|
141
|
+
${this.iconName && r`<pkt-icon
|
|
142
142
|
class="pkt-tag__icon"
|
|
143
143
|
name=${this.iconName}
|
|
144
144
|
aria-hidden="true"
|
|
@@ -148,27 +148,27 @@ var l = {
|
|
|
148
148
|
`;
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
|
-
|
|
151
|
+
t([n({
|
|
152
152
|
type: Boolean,
|
|
153
153
|
reflect: !0
|
|
154
|
-
})], u.prototype, "closeTag", void 0),
|
|
154
|
+
})], u.prototype, "closeTag", void 0), t([n({
|
|
155
155
|
type: String,
|
|
156
156
|
reflect: !0
|
|
157
|
-
})], u.prototype, "size", void 0),
|
|
157
|
+
})], u.prototype, "size", void 0), t([n({
|
|
158
158
|
type: String,
|
|
159
159
|
reflect: !0
|
|
160
|
-
})], u.prototype, "skin", void 0),
|
|
160
|
+
})], u.prototype, "skin", void 0), t([n({
|
|
161
161
|
type: String,
|
|
162
162
|
reflect: !0
|
|
163
|
-
})], u.prototype, "textStyle", void 0),
|
|
163
|
+
})], u.prototype, "textStyle", void 0), t([n({
|
|
164
164
|
type: String,
|
|
165
165
|
reflect: !0
|
|
166
|
-
})], u.prototype, "iconName", void 0),
|
|
166
|
+
})], u.prototype, "iconName", void 0), t([n({ type: String })], u.prototype, "type", void 0), t([n({ type: String })], u.prototype, "ariaLabel", void 0), t([n({
|
|
167
167
|
type: Number,
|
|
168
168
|
attribute: "button-tabindex"
|
|
169
|
-
})], u.prototype, "buttonTabindex", void 0),
|
|
169
|
+
})], u.prototype, "buttonTabindex", void 0), t([e()], u.prototype, "_isClosed", void 0), t([e()], u.prototype, "_ariaDescription", void 0);
|
|
170
170
|
try {
|
|
171
|
-
|
|
171
|
+
i("pkt-tag")(u);
|
|
172
172
|
} catch {
|
|
173
173
|
console.warn("Forsøker å definere <pkt-tag>, men den er allerede definert");
|
|
174
174
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),n=require(`./directive-helpers-f36YZFOG.cjs`),r=require(`./element-with-slot-Cmxb9h4H.cjs`);require(`./icon-Dw6I0HDV.cjs`);const i=require(`./if-defined-LTjAScFG.cjs`),a=require(`./ref-CBdWMlde.cjs`),o=require(`./input-element-BHQVt4Q9.cjs`);require(`./input-wrapper-Dhkt20WW.cjs`);var s=e.c(class extends e.l{constructor(t){if(super(t),t.type!==e.u.PROPERTY&&t.type!==e.u.ATTRIBUTE&&t.type!==e.u.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!n.i(t))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(t,[r]){if(r===e.f||r===e.d)return r;let i=t.element,a=t.name;if(t.type===e.u.PROPERTY){if(r===i[a])return e.f}else if(t.type===e.u.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(a))return e.f}else if(t.type===e.u.ATTRIBUTE&&i.getAttribute(a)===r+``)return e.f;return n.r(t),r}}),c=class extends o.t{constructor(...e){super(...e),this.inputRef=a.t(),this.value=``,this.autocomplete=`off`,this.rows=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}render(){let n=t.t({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),o=this.ariaLabelledby||`${this.id}-input-label`;return e.p`<pkt-input-wrapper
|
|
2
|
+
label=${this.label}
|
|
3
|
+
?counter=${this.counter}
|
|
4
|
+
?disabled=${this.disabled}
|
|
5
|
+
?hasError=${this.hasError}
|
|
6
|
+
?inline=${this.inline}
|
|
7
|
+
?optionalTag=${this.optionalTag}
|
|
8
|
+
?required=${this.required}
|
|
9
|
+
?requiredTag=${this.requiredTag}
|
|
10
|
+
useWrapper=${this.useWrapper}
|
|
11
|
+
.ariaDescribedBy=${this.ariaDescribedBy}
|
|
12
|
+
.counterCurrent=${this.counterCurrent}
|
|
13
|
+
.counterMaxLength=${this.counterMaxLength}
|
|
14
|
+
.errorMessage=${this.errorMessage}
|
|
15
|
+
.forId="${this.id+`-input`}"
|
|
16
|
+
.helptext=${this.helptext}
|
|
17
|
+
.helptextDropdown=${this.helptextDropdown}
|
|
18
|
+
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
19
|
+
.optionalText=${this.optionalText}
|
|
20
|
+
.requiredText=${this.requiredText}
|
|
21
|
+
.tagText=${this.tagText}
|
|
22
|
+
class="pkt-textarea"
|
|
23
|
+
>
|
|
24
|
+
<div class="pkt-contents" slot="helptext">${r.n(this,`helptext`)}</div>
|
|
25
|
+
<textarea
|
|
26
|
+
${a.n(this.inputRef)}
|
|
27
|
+
class=${n}
|
|
28
|
+
id=${this.id+`-input`}
|
|
29
|
+
name=${(this.name||this.id)+`-input`}
|
|
30
|
+
placeholder=${i.t(this.placeholder)}
|
|
31
|
+
.value=${s(this.value)}
|
|
32
|
+
minlength=${i.t(this.minlength)}
|
|
33
|
+
maxlength=${i.t(this.maxlength)}
|
|
34
|
+
?readonly=${this.readonly}
|
|
35
|
+
autocomplete=${this.autocomplete}
|
|
36
|
+
aria-labelledby=${o}
|
|
37
|
+
aria-invalid=${this.hasError}
|
|
38
|
+
aria-errormessage=${`${this.id}-error`}
|
|
39
|
+
rows=${this.rows}
|
|
40
|
+
?disabled=${this.disabled}
|
|
41
|
+
@input=${e=>{this.value=e.target.value,this.onInput(),e.stopImmediatePropagation()}}
|
|
42
|
+
@change=${e=>{e.stopImmediatePropagation()}}
|
|
43
|
+
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
44
|
+
@blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
|
|
45
|
+
></textarea>
|
|
46
|
+
</pkt-input-wrapper>`}};e.n([e.o({type:String,reflect:!0})],c.prototype,`value`,void 0),e.n([e.o({type:String})],c.prototype,`autocomplete`,void 0),e.n([e.o({type:Number})],c.prototype,`rows`,void 0),e.n([e.a()],c.prototype,`counterCurrent`,void 0);try{e.s(`pkt-textarea`)(c)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var l=c;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import "./input-wrapper-DVU68NcJ.js";
|
|
1
|
+
import { a as e, c as t, d as n, f as r, l as i, n as a, o, p as s, s as c, u as l } from "./element-CduG0XyF.js";
|
|
2
|
+
import { t as u } from "./class-map-DH9hlJny.js";
|
|
3
|
+
import { i as d, r as f } from "./directive-helpers-Cep_4cpj.js";
|
|
4
|
+
import { n as p } from "./element-with-slot-BVj9MXzi.js";
|
|
5
|
+
import "./icon-LaKyBKON.js";
|
|
6
|
+
import { t as m } from "./if-defined-VShASPdu.js";
|
|
7
|
+
import { n as h, t as g } from "./ref-BgoHEsEt.js";
|
|
8
|
+
import { t as _ } from "./input-element-BrmkXIXi.js";
|
|
9
|
+
import "./input-wrapper-B6WowlWG.js";
|
|
11
10
|
//#region ../../node_modules/lit-html/directives/live.js
|
|
12
|
-
var v =
|
|
11
|
+
var v = t(class extends i {
|
|
13
12
|
constructor(e) {
|
|
14
|
-
if (super(e), e.type !==
|
|
13
|
+
if (super(e), e.type !== l.PROPERTY && e.type !== l.ATTRIBUTE && e.type !== l.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
|
|
15
14
|
if (!d(e)) throw Error("`live` bindings can only contain a single expression");
|
|
16
15
|
}
|
|
17
16
|
render(e) {
|
|
18
17
|
return e;
|
|
19
18
|
}
|
|
20
19
|
update(e, [t]) {
|
|
21
|
-
if (t ===
|
|
22
|
-
let
|
|
23
|
-
if (e.type ===
|
|
24
|
-
if (t ===
|
|
25
|
-
} else if (e.type ===
|
|
26
|
-
if (!!t ===
|
|
27
|
-
} else if (e.type ===
|
|
20
|
+
if (t === r || t === n) return t;
|
|
21
|
+
let i = e.element, a = e.name;
|
|
22
|
+
if (e.type === l.PROPERTY) {
|
|
23
|
+
if (t === i[a]) return r;
|
|
24
|
+
} else if (e.type === l.BOOLEAN_ATTRIBUTE) {
|
|
25
|
+
if (!!t === i.hasAttribute(a)) return r;
|
|
26
|
+
} else if (e.type === l.ATTRIBUTE && i.getAttribute(a) === t + "") return r;
|
|
28
27
|
return f(e), t;
|
|
29
28
|
}
|
|
30
29
|
}), y = class extends _ {
|
|
@@ -42,8 +41,8 @@ var v = l(class extends s {
|
|
|
42
41
|
"pkt-input": !0,
|
|
43
42
|
"pkt-input--fullwidth": this.fullwidth,
|
|
44
43
|
"pkt-input--counter-error": this.counter && this.counterMaxLength && this.value.length && this.value.length > this.counterMaxLength
|
|
45
|
-
}),
|
|
46
|
-
return
|
|
44
|
+
}), t = this.ariaLabelledby || `${this.id}-input-label`;
|
|
45
|
+
return s`<pkt-input-wrapper
|
|
47
46
|
label=${this.label}
|
|
48
47
|
?counter=${this.counter}
|
|
49
48
|
?disabled=${this.disabled}
|
|
@@ -78,7 +77,7 @@ var v = l(class extends s {
|
|
|
78
77
|
maxlength=${m(this.maxlength)}
|
|
79
78
|
?readonly=${this.readonly}
|
|
80
79
|
autocomplete=${this.autocomplete}
|
|
81
|
-
aria-labelledby=${
|
|
80
|
+
aria-labelledby=${t}
|
|
82
81
|
aria-invalid=${this.hasError}
|
|
83
82
|
aria-errormessage=${`${this.id}-error`}
|
|
84
83
|
rows=${this.rows}
|
|
@@ -99,12 +98,12 @@ var v = l(class extends s {
|
|
|
99
98
|
</pkt-input-wrapper>`;
|
|
100
99
|
}
|
|
101
100
|
};
|
|
102
|
-
|
|
101
|
+
a([o({
|
|
103
102
|
type: String,
|
|
104
103
|
reflect: !0
|
|
105
|
-
})], y.prototype, "value", void 0),
|
|
104
|
+
})], y.prototype, "value", void 0), a([o({ type: String })], y.prototype, "autocomplete", void 0), a([o({ type: Number })], y.prototype, "rows", void 0), a([e()], y.prototype, "counterCurrent", void 0);
|
|
106
105
|
try {
|
|
107
|
-
|
|
106
|
+
c("pkt-textarea")(y);
|
|
108
107
|
} catch {
|
|
109
108
|
console.warn("Forsøker å definere <pkt-textarea>, men den er allerede definert");
|
|
110
109
|
}
|