@oslokommune/punkt-elements 17.1.3 → 18.1.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 +35 -0
- package/dist/{accordion-BeLvLPrB.js → accordion-CcUosZjL.js} +27 -27
- package/dist/{accordion-B3GBlvUC.cjs → accordion-k0pWTG1X.cjs} +5 -5
- package/dist/alert-BD8YVKia.cjs +35 -0
- package/dist/{alert-DKK_Tb9J.js → alert-Bmaly2Yo.js} +57 -52
- package/dist/{async-directive-BPf6K-V2.js → async-directive-COqx0IYj.js} +5 -5
- package/dist/{async-directive-Da7TJpnq.cjs → async-directive-DN2eg9gA.cjs} +1 -1
- package/dist/{backlink-D1y26pj3.js → backlink-C_ZO-ZbR.js} +9 -9
- package/dist/{backlink-CMmrKTe4.cjs → backlink-Ch64Pivx.cjs} +3 -3
- package/dist/base-elements/element.d.ts +13 -1
- package/dist/base-elements/input-element.d.ts +4 -2
- package/dist/{breadcrumbs-CcTQ3Grm.js → breadcrumbs-CF_gAbUk.js} +16 -16
- package/dist/{breadcrumbs-B6JGhJgC.cjs → breadcrumbs-CzzbardP.cjs} +7 -7
- package/dist/{button-2-OSPJkj.js → button-C1CQSASU.js} +28 -28
- package/dist/{button-CE97NQIk.cjs → button-CF3dNKeI.cjs} +7 -7
- package/dist/{calendar-kn4SrtJy.cjs → calendar-BxF81kB9.cjs} +28 -27
- package/dist/{calendar-pOW3R5Pw.js → calendar-DRmxORMc.js} +82 -68
- package/dist/{card-CETDFkxR.cjs → card-Cg1daj05.cjs} +26 -26
- package/dist/{card-zQ0eKRMV.js → card-W_Jb0Tlo.js} +44 -44
- package/dist/{checkbox-CQNr_sEg.cjs → checkbox-BHQv8lHq.cjs} +11 -11
- package/dist/{checkbox-CH7NpINF.js → checkbox-BQw2dMSX.js} +23 -23
- package/dist/{class-map-BeimMvPv.cjs → class-map-C33ixq7O.cjs} +1 -1
- package/dist/{class-map-CnWCnBSX.js → class-map-wh4Yi3oj.js} +3 -3
- package/dist/{combobox-Bvg0UO9w.cjs → combobox-BpZow9OU.cjs} +19 -18
- package/dist/{combobox-CRdYYlxu.js → combobox-C9wwnUfM.js} +55 -54
- package/dist/components/accordion/accordion.d.ts +2 -6
- package/dist/components/accordion/accordionitem.d.ts +2 -8
- package/dist/components/alert/alert.d.ts +2 -2
- package/dist/components/backlink/backlink.d.ts +4 -5
- package/dist/components/backlink/backlink.test.d.ts +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +6 -7
- package/dist/components/breadcrumbs/index.d.ts +1 -1
- package/dist/components/calendar/calendar.d.ts +21 -6
- package/dist/components/checkbox/checkbox.d.ts +4 -2
- package/dist/components/combobox/combobox-base.d.ts +2 -1
- package/dist/components/consent/strings.d.ts +1 -85
- package/dist/components/datepicker/datepicker-base.d.ts +0 -3
- package/dist/components/datepicker/datepicker-multiple.d.ts +0 -2
- package/dist/components/datepicker/datepicker-range.d.ts +0 -2
- package/dist/components/datepicker/datepicker-single.d.ts +0 -2
- package/dist/components/datepicker/datepicker-utils.d.ts +2 -1
- package/dist/components/fileupload/fileupload-base.d.ts +7 -4
- package/dist/components/fileupload/fileupload-types.d.ts +5 -43
- package/dist/components/header/header-service.d.ts +3 -1
- package/dist/components/header/header.d.ts +2 -1
- package/dist/components/helptext/helptext.d.ts +2 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/input-wrapper/input-wrapper.d.ts +4 -2
- package/dist/components/radiobutton/radiobutton.d.ts +4 -2
- package/dist/components/searchinput/searchinput.d.ts +2 -1
- package/dist/{consent-CyY3RyoC.cjs → consent-CPtr7cBw.cjs} +5 -5
- package/dist/{consent-DZEkhgJ1.js → consent-D8MrqGKk.js} +10 -10
- package/dist/controllers/strings-controller.d.ts +27 -0
- package/dist/{datepicker-ButIas85.js → datepicker-D4YnAtWG.js} +104 -104
- package/dist/{datepicker-VTqSDQk5.cjs → datepicker-DaoumZT9.cjs} +38 -37
- package/dist/define-component-spec-BYOSeplU.js +6 -0
- package/dist/define-component-spec-DBNd2FJY.cjs +1 -0
- package/dist/{directive-helpers-CI8YZqku.js → directive-helpers-BWSAVe00.js} +1 -1
- package/dist/{directive-helpers-BlAV5EQD.cjs → directive-helpers-C6J4AkFk.cjs} +1 -1
- package/dist/docs/components/alert.d.ts +2 -3
- package/dist/docs/components/fileupload.d.ts +1 -0
- package/dist/element-DiFhBcIl.cjs +2 -0
- package/dist/{element-ChsFgr_B.js → element-WEzISABa.js} +241 -100
- package/dist/{element-with-slot-BvG9ctC-.js → element-with-slot-BKYUx4gb.js} +4 -4
- package/dist/{element-with-slot-Bj7nm7fO.cjs → element-with-slot-CBK4zrdN.cjs} +1 -1
- package/dist/{fileupload-D5IQ9HDe.js → fileupload-DEHSETw0.js} +340 -652
- package/dist/fileupload-DWu6FIMv.cjs +402 -0
- package/dist/{footer-DrR64HiK.js → footer-BJLEw6Ab.js} +91 -91
- package/dist/{footer-DbYQUYNR.cjs → footer-D_yYWkQ6.cjs} +32 -32
- package/dist/format-B8meU8Tm.cjs +1 -0
- package/dist/format-BTeSVkED.js +18 -0
- package/dist/{header-ClgIac6n.cjs → header-B7_4Cwaq.cjs} +84 -84
- package/dist/{header-KvJ1mGwA.js → header-DLVq7-dM.js} +267 -264
- package/dist/{header-menu-hVPXsb8g.js → header-menu-BsrrTjpT.js} +75 -75
- package/dist/{header-menu-BAsUNKSx.cjs → header-menu-m7nOOC1g.cjs} +24 -24
- package/dist/{heading-g-_IUB5T.js → heading-DSArgrDK.js} +16 -16
- package/dist/{heading-CFmiSuCQ.cjs → heading-_RPw2UW9.cjs} +1 -1
- package/dist/helptext-QMVsW5g6.cjs +27 -0
- package/dist/{helptext-DZng1D5i.js → helptext-dtVVufNH.js} +18 -19
- package/dist/{icon-D-LA22xD.js → icon-DEtOSWRK.js} +17 -17
- package/dist/{icon-9iwd2F2l.cjs → icon-DIavy2cB.cjs} +1 -1
- package/dist/{if-defined-CGzIlZ9-.js → if-defined-BmnvvxtR.js} +1 -1
- package/dist/if-defined-Dc3xFDaM.cjs +1 -0
- package/dist/input-element-DQY1Rpbp.cjs +1 -0
- package/dist/{input-element-DBMNBplu.js → input-element-IBypGOaV.js} +121 -120
- package/dist/input-wrapper-CQgAL1Br.js +308 -0
- package/dist/input-wrapper-mJZLVXy_.cjs +58 -0
- package/dist/link-DwLeY37f.js +131 -0
- package/dist/link-yk4IXDWm.cjs +7 -0
- package/dist/linkcard-BinKnxQF.cjs +13 -0
- package/dist/{linkcard-zqbg7Oqm.js → linkcard-D5DXpmXI.js} +16 -16
- package/dist/{listbox-Dc4rGdPi.cjs → listbox-C5zTRNAO.cjs} +15 -15
- package/dist/{listbox-va_E8afs.js → listbox-C8ooO8qZ.js} +100 -99
- package/dist/{loader-D_RDICnw.js → loader-C3HyayzL.js} +14 -14
- package/dist/{loader-CMUkVJmE.cjs → loader-DHF7M5Vn.cjs} +5 -5
- package/dist/{messagebox-Cv8LaSxv.cjs → messagebox-DqYf6VmQ.cjs} +5 -5
- package/dist/{messagebox-Cw-OWDya.js → messagebox-u8i3R5QA.js} +15 -15
- package/dist/{modal-BtInv031.cjs → modal-CnJ9y2TQ.cjs} +8 -8
- package/dist/{modal-D0t_X2dX.js → modal-V-jEe0aY.js} +20 -20
- 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-footer.cjs +1 -1
- package/dist/pkt-footer.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 +35 -34
- 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-C5EBX2T0.cjs → pkt-options-controller-BhMNCWcc.cjs} +1 -1
- package/dist/{pkt-options-controller-B77vH3PE.js → pkt-options-controller-CuQ6SClv.js} +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-CbcfLerF.js → progressbar-DS4i8IWq.js} +21 -21
- package/dist/{progressbar-D5MmnQId.cjs → progressbar-DY5hxImR.cjs} +5 -5
- package/dist/{radiobutton-BUnf3EPi.js → radiobutton-BhvZztMZ.js} +24 -24
- package/dist/{radiobutton-DpsO1F-8.cjs → radiobutton-BswqwRnA.cjs} +8 -8
- package/dist/{ref-CQoEIIp0.cjs → ref-DZmN5Qgj.cjs} +1 -1
- package/dist/{ref-CWD6PjVd.js → ref-OU8ryfP6.js} +2 -2
- package/dist/{repeat-sY6B7fAT.cjs → repeat-DIa_g6WL.cjs} +1 -1
- package/dist/{repeat-C02g7d5S.js → repeat-Dx2H127b.js} +4 -4
- package/dist/{searchinput-DwnjsvJ1.js → searchinput-CJo1PpM7.js} +43 -43
- package/dist/searchinput-Cl46nW0r.cjs +60 -0
- package/dist/{select-DMre80qs.js → select-CBrjauXT.js} +21 -20
- package/dist/{select-BOJi6H6T.cjs → select-Dman8Skr.cjs} +4 -3
- package/dist/shared-strings/consent.d.ts +71 -0
- package/dist/shared-strings/format.d.ts +21 -0
- package/dist/shared-strings/index.d.ts +14 -0
- package/dist/shared-strings/nb.d.ts +121 -0
- package/dist/shared-strings/resolve.d.ts +12 -0
- package/dist/shared-strings/store.d.ts +27 -0
- package/dist/shared-strings/types.d.ts +40 -0
- package/dist/shared-types/accordion.d.ts +58 -0
- package/dist/shared-types/alert.d.ts +20 -0
- package/dist/shared-types/aria.d.ts +2 -1
- package/dist/shared-types/backlink.d.ts +23 -0
- package/dist/shared-types/breadcrumbs.d.ts +33 -0
- package/dist/shared-types/fileupload.d.ts +55 -28
- package/dist/shared-types/footer.d.ts +10 -0
- package/dist/shared-types/form-field.d.ts +45 -0
- package/dist/shared-types/header-footer.d.ts +2 -0
- package/dist/shared-types/index.d.ts +15 -6
- package/dist/shared-types/render-link.d.ts +22 -0
- package/dist/shared-types/skin.d.ts +2 -9
- package/dist/shared-utils/combobox/index.d.ts +1 -0
- package/dist/shared-utils/combobox/input-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/messages.d.ts +7 -0
- package/dist/shared-utils/combobox/option-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/selection-manager.d.ts +3 -2
- package/dist/{tabs-Cf9ai0FD.cjs → tabs-C1m5rSrR.cjs} +7 -7
- package/dist/{tabs-TvxgbrCF.js → tabs-Xu3mIedh.js} +32 -32
- package/dist/{tag-Ds6n1LIs.js → tag-Azkjhkeu.js} +33 -32
- package/dist/tag-BS6dDPxY.cjs +27 -0
- package/dist/tests/strings-override.test.d.ts +0 -0
- package/dist/{textarea-vfzIcXhX.js → textarea-D4qXcVGD.js} +30 -29
- package/dist/{textarea-BydiLM9Z.cjs → textarea-DftUkR6w.cjs} +3 -2
- package/dist/{textinput-DGdicNSx.cjs → textinput-Ar-1Sbqy.cjs} +13 -12
- package/dist/{textinput-CMP2jPP_.js → textinput-iCgwwNPU.js} +28 -27
- package/dist/{timepicker-ClwgYywH.js → timepicker-W6HVWtmA.js} +67 -64
- package/dist/timepicker-dpAF7h49.cjs +196 -0
- package/package.json +3 -3
- package/src/components/accordion/accordion.ts +2 -10
- package/src/components/accordion/accordionitem.ts +2 -9
- package/src/components/alert/alert.ts +19 -10
- package/src/components/backlink/backlink.test.ts +3 -3
- package/src/components/backlink/backlink.ts +5 -7
- package/src/components/breadcrumbs/breadcrumbs.ts +9 -10
- package/src/components/breadcrumbs/index.ts +1 -1
- package/src/components/calendar/calendar.ts +56 -26
- package/src/components/checkbox/checkbox.test.ts +0 -2
- package/src/components/checkbox/checkbox.ts +8 -4
- package/src/components/combobox/combobox-base.ts +2 -1
- package/src/components/combobox/combobox-value.ts +10 -9
- package/src/components/combobox/combobox.selection.test.ts +5 -1
- package/src/components/combobox/combobox.ts +4 -1
- package/src/components/consent/strings.ts +1 -125
- package/src/components/datepicker/date-tags.ts +4 -1
- package/src/components/datepicker/datepicker-base.ts +2 -6
- package/src/components/datepicker/datepicker-multiple.ts +0 -3
- package/src/components/datepicker/datepicker-range.ts +4 -7
- package/src/components/datepicker/datepicker-single.ts +0 -3
- package/src/components/datepicker/datepicker-utils.test.ts +5 -5
- package/src/components/datepicker/datepicker-utils.ts +6 -11
- package/src/components/datepicker/datepicker.ts +8 -1
- package/src/components/fileupload/fileupload-base.ts +29 -19
- package/src/components/fileupload/fileupload-renderers.ts +2 -1
- package/src/components/fileupload/fileupload-types.ts +5 -42
- package/src/components/fileupload/fileupload.test.ts +16 -0
- package/src/components/fileupload/fileupload.ts +19 -15
- package/src/components/header/header-global.ts +3 -3
- package/src/components/header/header-service.ts +13 -8
- package/src/components/header/header.ts +2 -1
- package/src/components/helptext/helptext.test.ts +1 -1
- package/src/components/helptext/helptext.ts +3 -3
- package/src/components/index.ts +10 -1
- package/src/components/input-wrapper/input-wrapper.ts +18 -10
- package/src/components/link/link.ts +8 -3
- package/src/components/listbox/listbox.ts +3 -3
- package/src/components/radiobutton/radiobutton.ts +8 -4
- package/src/components/searchinput/searchinput.ts +5 -3
- package/src/components/select/select.ts +1 -0
- package/src/components/tag/tag.ts +2 -1
- package/src/components/textarea/textarea.ts +1 -0
- package/src/components/textinput/textinput.ts +1 -0
- package/src/components/timepicker/timepicker.ts +23 -21
- package/dist/alert-Cs4Rmq_J.cjs +0 -33
- package/dist/element-BA8v6S7z.cjs +0 -2
- package/dist/fileupload-BeWiTAoW.cjs +0 -401
- package/dist/helptext-CTtKJcML.cjs +0 -27
- package/dist/if-defined-B89_ZeCj.cjs +0 -1
- package/dist/input-element-DYmQw-fH.cjs +0 -1
- package/dist/input-wrapper-BmxNvznr.js +0 -128
- package/dist/input-wrapper-D-fPaTbY.js +0 -176
- package/dist/input-wrapper-D5PR0rJn.cjs +0 -1
- package/dist/input-wrapper-Q-B-aBeb.cjs +0 -54
- package/dist/link-D-Eqm5KH.js +0 -98
- package/dist/link-DK7gvmnj.cjs +0 -7
- package/dist/linkcard-B29cmZqh.cjs +0 -13
- package/dist/searchinput-Bh975rjX.cjs +0 -60
- package/dist/tag-CzojNU7z.cjs +0 -27
- package/dist/timepicker-DYrnLHqN.cjs +0 -195
- package/dist/translations/no.json.d.ts +0 -94
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as a, t as o } from "./element-with-slot-
|
|
3
|
-
import { t as s } from "./if-defined-
|
|
1
|
+
import { _ as e, d as t, l as n, n as r, u as i } from "./element-WEzISABa.js";
|
|
2
|
+
import { n as a, t as o } from "./element-with-slot-BKYUx4gb.js";
|
|
3
|
+
import { t as s } from "./if-defined-BmnvvxtR.js";
|
|
4
4
|
import { n as c, r as l, t as u } from "./consume-BDnMAp2g.js";
|
|
5
|
-
import { n as d, t as f } from "./ref-
|
|
5
|
+
import { n as d, t as f } from "./ref-OU8ryfP6.js";
|
|
6
6
|
//#region src/components/tabs/tabs-context.ts
|
|
7
7
|
var p = l(Symbol("pkt-tabs-context")), m = class extends o {
|
|
8
8
|
constructor(...e) {
|
|
@@ -75,33 +75,33 @@ var p = l(Symbol("pkt-tabs-context")), m = class extends o {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
render() {
|
|
78
|
-
let
|
|
79
|
-
return
|
|
80
|
-
<div class=${
|
|
81
|
-
<div class="pkt-tabs__list" role=${
|
|
78
|
+
let t = this.useArrowNav ? "tablist" : "navigation", n = this.separatorIconName || this.separatorIconPath ? "pkt-tabs pkt-tabs--with-separator" : "pkt-tabs";
|
|
79
|
+
return e`
|
|
80
|
+
<div class=${n}>
|
|
81
|
+
<div class="pkt-tabs__list" role=${t}>${a(this)}</div>
|
|
82
82
|
</div>
|
|
83
83
|
`;
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
|
|
86
|
+
r([i({
|
|
87
87
|
type: Boolean,
|
|
88
88
|
reflect: !0,
|
|
89
89
|
attribute: "arrow-nav"
|
|
90
|
-
})], m.prototype, "arrowNav", void 0),
|
|
90
|
+
})], m.prototype, "arrowNav", void 0), r([i({
|
|
91
91
|
type: Boolean,
|
|
92
92
|
reflect: !0,
|
|
93
93
|
attribute: "disable-arrow-nav"
|
|
94
|
-
})], m.prototype, "disableArrowNav", void 0),
|
|
94
|
+
})], m.prototype, "disableArrowNav", void 0), r([i({
|
|
95
95
|
type: String,
|
|
96
96
|
reflect: !0,
|
|
97
97
|
attribute: "separator-icon-name"
|
|
98
|
-
})], m.prototype, "separatorIconName", void 0),
|
|
98
|
+
})], m.prototype, "separatorIconName", void 0), r([i({
|
|
99
99
|
type: String,
|
|
100
100
|
reflect: !0,
|
|
101
101
|
attribute: "separator-icon-path"
|
|
102
|
-
})], m.prototype, "separatorIconPath", void 0),
|
|
102
|
+
})], m.prototype, "separatorIconPath", void 0), r([n()], m.prototype, "tabRefs", void 0), r([n()], m.prototype, "disabledMap", void 0), r([n()], m.prototype, "tabCount", void 0), r([c({ context: p }), n()], m.prototype, "context", void 0);
|
|
103
103
|
try {
|
|
104
|
-
|
|
104
|
+
t("pkt-tabs")(m);
|
|
105
105
|
} catch {
|
|
106
106
|
console.warn("Forsøker å definere <pkt-tabs>, men den er allerede definert");
|
|
107
107
|
}
|
|
@@ -134,16 +134,16 @@ var h = class extends o {
|
|
|
134
134
|
this.context && this.context.handleKeyUp(e, this.index);
|
|
135
135
|
}
|
|
136
136
|
render() {
|
|
137
|
-
let
|
|
138
|
-
${this.icon ?
|
|
137
|
+
let t = this.context?.useArrowNav ?? !0, n = this.active && !this.disabled, r = [n ? "active" : "", this.disabled ? "pkt-tabs__item--disabled" : ""].filter(Boolean).join(" "), i = t ? "tab" : void 0, o = t ? n : void 0, c = this.disabled ? -1 : n || !t ? void 0 : -1, l = `pkt-icon--small ${this.icon === "check" ? "pkt-tabs__status-icon" : ""}`, u = e`
|
|
138
|
+
${this.icon ? e`<pkt-icon name=${this.icon} class=${l}></pkt-icon>` : ""}
|
|
139
139
|
<span>${a(this)}</span>
|
|
140
|
-
${this.tag ?
|
|
140
|
+
${this.tag ? e`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>` : ""}
|
|
141
141
|
`;
|
|
142
|
-
return this.href ?
|
|
142
|
+
return this.href ? e`
|
|
143
143
|
<a
|
|
144
144
|
${d(this.elementRef)}
|
|
145
145
|
href=${s(this.disabled ? void 0 : this.href)}
|
|
146
|
-
class="pkt-tabs__link ${
|
|
146
|
+
class="pkt-tabs__link ${r}"
|
|
147
147
|
role=${s(i)}
|
|
148
148
|
aria-selected=${s(o)}
|
|
149
149
|
aria-disabled=${s(this.disabled ? "true" : void 0)}
|
|
@@ -154,11 +154,11 @@ var h = class extends o {
|
|
|
154
154
|
>
|
|
155
155
|
${u}
|
|
156
156
|
</a>
|
|
157
|
-
` :
|
|
157
|
+
` : e`
|
|
158
158
|
<button
|
|
159
159
|
${d(this.elementRef)}
|
|
160
160
|
type="button"
|
|
161
|
-
class="pkt-tabs__button pkt-link-button ${
|
|
161
|
+
class="pkt-tabs__button pkt-link-button ${r}"
|
|
162
162
|
?disabled=${this.disabled}
|
|
163
163
|
aria-disabled=${s(this.disabled ? "true" : void 0)}
|
|
164
164
|
role=${s(i)}
|
|
@@ -173,37 +173,37 @@ var h = class extends o {
|
|
|
173
173
|
`;
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
|
-
|
|
176
|
+
r([i({
|
|
177
177
|
type: Boolean,
|
|
178
178
|
reflect: !0
|
|
179
|
-
})], h.prototype, "active", void 0),
|
|
179
|
+
})], h.prototype, "active", void 0), r([i({
|
|
180
180
|
type: Boolean,
|
|
181
181
|
reflect: !0
|
|
182
|
-
})], h.prototype, "disabled", void 0),
|
|
182
|
+
})], h.prototype, "disabled", void 0), r([i({
|
|
183
183
|
type: String,
|
|
184
184
|
reflect: !0
|
|
185
|
-
})], h.prototype, "href", void 0),
|
|
185
|
+
})], h.prototype, "href", void 0), r([i({
|
|
186
186
|
type: String,
|
|
187
187
|
reflect: !0
|
|
188
|
-
})], h.prototype, "icon", void 0),
|
|
188
|
+
})], h.prototype, "icon", void 0), r([i({
|
|
189
189
|
type: String,
|
|
190
190
|
reflect: !0
|
|
191
|
-
})], h.prototype, "controls", void 0),
|
|
191
|
+
})], h.prototype, "controls", void 0), r([i({
|
|
192
192
|
type: String,
|
|
193
193
|
reflect: !0
|
|
194
|
-
})], h.prototype, "tag", void 0),
|
|
194
|
+
})], h.prototype, "tag", void 0), r([i({
|
|
195
195
|
type: String,
|
|
196
196
|
reflect: !0,
|
|
197
197
|
attribute: "tag-skin"
|
|
198
|
-
})], h.prototype, "tagSkin", void 0),
|
|
198
|
+
})], h.prototype, "tagSkin", void 0), r([i({
|
|
199
199
|
type: Number,
|
|
200
200
|
reflect: !0
|
|
201
|
-
})], h.prototype, "index", void 0),
|
|
201
|
+
})], h.prototype, "index", void 0), r([u({
|
|
202
202
|
context: p,
|
|
203
203
|
subscribe: !0
|
|
204
|
-
}),
|
|
204
|
+
}), i({ attribute: !1 })], h.prototype, "context", void 0);
|
|
205
205
|
try {
|
|
206
|
-
|
|
206
|
+
t("pkt-tab-item")(h);
|
|
207
207
|
} catch {
|
|
208
208
|
console.warn("Forsøker å definere <pkt-tab-item>, men den er allerede definert");
|
|
209
209
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as a } from "./class-map-
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { _ as e, d as t, l as n, n as r, u as i } from "./element-WEzISABa.js";
|
|
2
|
+
import { t as a } from "./class-map-wh4Yi3oj.js";
|
|
3
|
+
import { t as o } from "./format-BTeSVkED.js";
|
|
4
|
+
import { n as s, t as c } from "./element-with-slot-BKYUx4gb.js";
|
|
5
|
+
import "./icon-DEtOSWRK.js";
|
|
6
|
+
import { t as l } from "./if-defined-BmnvvxtR.js";
|
|
7
|
+
var u = {
|
|
7
8
|
name: "pkt-tag",
|
|
8
9
|
react: "PktTag",
|
|
9
10
|
"css-class": "pkt-tag",
|
|
@@ -83,9 +84,9 @@ var l = {
|
|
|
83
84
|
}
|
|
84
85
|
},
|
|
85
86
|
slots: { default: { description: "Teksten til tag" } }
|
|
86
|
-
},
|
|
87
|
+
}, d = class extends c {
|
|
87
88
|
constructor() {
|
|
88
|
-
super(), this.closeTag =
|
|
89
|
+
super(), this.closeTag = u.props.closeTag.default, this.size = u.props.size.default, this.skin = u.props.skin.default, this.textStyle = null, this.iconName = void 0, this.type = u.props.type.default, this.ariaLabel = null, this.buttonTabindex = void 0, this._isClosed = !1, this._ariaDescription = null, this.close = (e) => {
|
|
89
90
|
this._isClosed = !0, this.dispatchEvent(new CustomEvent("close", {
|
|
90
91
|
detail: { origin: e },
|
|
91
92
|
bubbles: !1,
|
|
@@ -100,77 +101,77 @@ var l = {
|
|
|
100
101
|
firstUpdated(e) {
|
|
101
102
|
if (super.firstUpdated(e), this.closeTag && !this.ariaLabel) {
|
|
102
103
|
let e = this.querySelector("button span, .pkt-tag > span")?.textContent?.trim();
|
|
103
|
-
e && (this._ariaDescription =
|
|
104
|
+
e && (this._ariaDescription = o(this.pktStrings.get("tag").remove, { label: e }));
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
render() {
|
|
107
|
-
let
|
|
108
|
+
let t = {
|
|
108
109
|
"pkt-tag": !0,
|
|
109
110
|
[`pkt-tag--${this.size}`]: !!this.size,
|
|
110
111
|
[`pkt-tag--${this.skin}`]: !!this.skin,
|
|
111
112
|
[`pkt-tag--${this.textStyle}`]: !!this.textStyle
|
|
112
|
-
},
|
|
113
|
+
}, n = {
|
|
113
114
|
"pkt-tag": !0,
|
|
114
115
|
[`pkt-tag--${this.textStyle}`]: !!this.textStyle,
|
|
115
116
|
[`pkt-tag--${this.size}`]: !!this.size,
|
|
116
117
|
[`pkt-tag--${this.skin}`]: !!this.skin,
|
|
117
118
|
"pkt-hide": this._isClosed
|
|
118
119
|
};
|
|
119
|
-
return this.closeTag ?
|
|
120
|
+
return this.closeTag ? e`
|
|
120
121
|
<button
|
|
121
|
-
class=${a(
|
|
122
|
+
class=${a(n)}
|
|
122
123
|
type=${this.type}
|
|
123
|
-
tabindex=${
|
|
124
|
+
tabindex=${l(this.buttonTabindex)}
|
|
124
125
|
@click=${this.close}
|
|
125
|
-
aria-label=${
|
|
126
|
-
aria-description=${
|
|
126
|
+
aria-label=${l(this.ariaLabel || void 0)}
|
|
127
|
+
aria-description=${l(this._ariaDescription || void 0)}
|
|
127
128
|
>
|
|
128
|
-
${this.iconName &&
|
|
129
|
+
${this.iconName && e`<pkt-icon
|
|
129
130
|
class="pkt-tag__icon"
|
|
130
131
|
name=${this.iconName}
|
|
131
132
|
aria-hidden="true"
|
|
132
133
|
></pkt-icon>`}
|
|
133
|
-
<span>${
|
|
134
|
+
<span>${s(this)}</span>
|
|
134
135
|
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
135
136
|
</button>
|
|
136
|
-
` :
|
|
137
|
-
<span class=${a(
|
|
138
|
-
${this.iconName &&
|
|
137
|
+
` : e`
|
|
138
|
+
<span class=${a(t)}>
|
|
139
|
+
${this.iconName && e`<pkt-icon
|
|
139
140
|
class="pkt-tag__icon"
|
|
140
141
|
name=${this.iconName}
|
|
141
142
|
aria-hidden="true"
|
|
142
143
|
></pkt-icon>`}
|
|
143
|
-
<span>${
|
|
144
|
+
<span>${s(this)}</span>
|
|
144
145
|
</span>
|
|
145
146
|
`;
|
|
146
147
|
}
|
|
147
148
|
};
|
|
148
|
-
|
|
149
|
+
r([i({
|
|
149
150
|
type: Boolean,
|
|
150
151
|
reflect: !0
|
|
151
|
-
})],
|
|
152
|
+
})], d.prototype, "closeTag", void 0), r([i({
|
|
152
153
|
type: String,
|
|
153
154
|
reflect: !0
|
|
154
|
-
})],
|
|
155
|
+
})], d.prototype, "size", void 0), r([i({
|
|
155
156
|
type: String,
|
|
156
157
|
reflect: !0
|
|
157
|
-
})],
|
|
158
|
+
})], d.prototype, "skin", void 0), r([i({
|
|
158
159
|
type: String,
|
|
159
160
|
reflect: !0
|
|
160
|
-
})],
|
|
161
|
+
})], d.prototype, "textStyle", void 0), r([i({
|
|
161
162
|
type: String,
|
|
162
163
|
reflect: !0
|
|
163
|
-
})],
|
|
164
|
+
})], d.prototype, "iconName", void 0), r([i({ type: String })], d.prototype, "type", void 0), r([i({ type: String })], d.prototype, "ariaLabel", void 0), r([i({
|
|
164
165
|
type: Number,
|
|
165
166
|
attribute: "button-tabindex"
|
|
166
|
-
})],
|
|
167
|
+
})], d.prototype, "buttonTabindex", void 0), r([n()], d.prototype, "_isClosed", void 0), r([n()], d.prototype, "_ariaDescription", void 0);
|
|
167
168
|
try {
|
|
168
|
-
|
|
169
|
+
t("pkt-tag")(d);
|
|
169
170
|
} catch {
|
|
170
171
|
console.warn("Forsøker å definere <pkt-tag>, men den er allerede definert");
|
|
171
172
|
}
|
|
172
173
|
//#endregion
|
|
173
174
|
//#region src/components/tag/index.ts
|
|
174
|
-
var
|
|
175
|
+
var f = d;
|
|
175
176
|
//#endregion
|
|
176
|
-
export {
|
|
177
|
+
export { d as n, f as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const e=require("./element-DiFhBcIl.cjs"),t=require("./class-map-C33ixq7O.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-CBK4zrdN.cjs");require("./icon-DIavy2cB.cjs");const i=require("./if-defined-Dc3xFDaM.cjs");var a={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`}}},o=class extends r.t{constructor(){super(),this.closeTag=a.props.closeTag.default,this.size=a.props.size.default,this.skin=a.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=a.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=n.t(this.pktStrings.get(`tag`).remove,{label:e}))}}render(){let n={"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-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-hide":this._isClosed};return this.closeTag?e._`
|
|
2
|
+
<button
|
|
3
|
+
class=${t.t(a)}
|
|
4
|
+
type=${this.type}
|
|
5
|
+
tabindex=${i.t(this.buttonTabindex)}
|
|
6
|
+
@click=${this.close}
|
|
7
|
+
aria-label=${i.t(this.ariaLabel||void 0)}
|
|
8
|
+
aria-description=${i.t(this._ariaDescription||void 0)}
|
|
9
|
+
>
|
|
10
|
+
${this.iconName&&e._`<pkt-icon
|
|
11
|
+
class="pkt-tag__icon"
|
|
12
|
+
name=${this.iconName}
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
></pkt-icon>`}
|
|
15
|
+
<span>${r.n(this)}</span>
|
|
16
|
+
<pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
|
|
17
|
+
</button>
|
|
18
|
+
`:e._`
|
|
19
|
+
<span class=${t.t(n)}>
|
|
20
|
+
${this.iconName&&e._`<pkt-icon
|
|
21
|
+
class="pkt-tag__icon"
|
|
22
|
+
name=${this.iconName}
|
|
23
|
+
aria-hidden="true"
|
|
24
|
+
></pkt-icon>`}
|
|
25
|
+
<span>${r.n(this)}</span>
|
|
26
|
+
</span>
|
|
27
|
+
`}};e.n([e.u({type:Boolean,reflect:!0})],o.prototype,`closeTag`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`size`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`skin`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`textStyle`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`iconName`,void 0),e.n([e.u({type:String})],o.prototype,`type`,void 0),e.n([e.u({type:String})],o.prototype,`ariaLabel`,void 0),e.n([e.u({type:Number,attribute:`button-tabindex`})],o.prototype,`buttonTabindex`,void 0),e.n([e.l()],o.prototype,`_isClosed`,void 0),e.n([e.l()],o.prototype,`_ariaDescription`,void 0);try{e.d(`pkt-tag`)(o)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var s=o;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
|
File without changes
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as u } from "./class-map-
|
|
3
|
-
import { i as d, r as f } from "./directive-helpers-
|
|
4
|
-
import { n as p } from "./element-with-slot-
|
|
5
|
-
import "./icon-
|
|
6
|
-
import { t as m } from "./if-defined-
|
|
7
|
-
import { n as h, t as g } from "./ref-
|
|
8
|
-
import { t as _ } from "./input-element-
|
|
9
|
-
import { r as v } from "./input-wrapper-
|
|
1
|
+
import { _ as e, d as t, f as n, g as r, h as i, l as a, m as o, n as s, p as c, u as l } from "./element-WEzISABa.js";
|
|
2
|
+
import { t as u } from "./class-map-wh4Yi3oj.js";
|
|
3
|
+
import { i as d, r as f } from "./directive-helpers-BWSAVe00.js";
|
|
4
|
+
import { n as p } from "./element-with-slot-BKYUx4gb.js";
|
|
5
|
+
import "./icon-DEtOSWRK.js";
|
|
6
|
+
import { t as m } from "./if-defined-BmnvvxtR.js";
|
|
7
|
+
import { n as h, t as g } from "./ref-OU8ryfP6.js";
|
|
8
|
+
import { t as _ } from "./input-element-IBypGOaV.js";
|
|
9
|
+
import { r as v } from "./input-wrapper-CQgAL1Br.js";
|
|
10
10
|
//#region ../../node_modules/lit-html/directives/live.js
|
|
11
|
-
var y =
|
|
11
|
+
var y = n(class extends c {
|
|
12
12
|
constructor(e) {
|
|
13
|
-
if (super(e), e.type !==
|
|
13
|
+
if (super(e), e.type !== o.PROPERTY && e.type !== o.ATTRIBUTE && e.type !== o.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
|
|
14
14
|
if (!d(e)) throw Error("`live` bindings can only contain a single expression");
|
|
15
15
|
}
|
|
16
16
|
render(e) {
|
|
17
17
|
return e;
|
|
18
18
|
}
|
|
19
19
|
update(e, [t]) {
|
|
20
|
-
if (t === r || t ===
|
|
21
|
-
let
|
|
22
|
-
if (e.type ===
|
|
23
|
-
if (t ===
|
|
24
|
-
} else if (e.type ===
|
|
25
|
-
if (!!t ===
|
|
26
|
-
} else if (e.type ===
|
|
20
|
+
if (t === r || t === i) return t;
|
|
21
|
+
let n = e.element, a = e.name;
|
|
22
|
+
if (e.type === o.PROPERTY) {
|
|
23
|
+
if (t === n[a]) return r;
|
|
24
|
+
} else if (e.type === o.BOOLEAN_ATTRIBUTE) {
|
|
25
|
+
if (!!t === n.hasAttribute(a)) return r;
|
|
26
|
+
} else if (e.type === o.ATTRIBUTE && n.getAttribute(a) === t + "") return r;
|
|
27
27
|
return f(e), t;
|
|
28
28
|
}
|
|
29
29
|
}), b = class extends _ {
|
|
@@ -37,15 +37,16 @@ var y = t(class extends i {
|
|
|
37
37
|
super.updated(e), this.classList.add("pkt-textinput", "pkt-textarea"), 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);
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
let
|
|
40
|
+
let t = this.effectiveCounter(this.counterMaxLength > 0), n = u({
|
|
41
41
|
"pkt-input": !0,
|
|
42
42
|
[`pkt-input--${this.inputSize}`]: !0,
|
|
43
43
|
"pkt-input--fullwidth": this.fullwidth,
|
|
44
|
-
"pkt-input--counter-error":
|
|
45
|
-
}),
|
|
46
|
-
return
|
|
44
|
+
"pkt-input--counter-error": t && this.counterMaxLength > 0 && this.value.length > this.counterMaxLength
|
|
45
|
+
}), r = this.ariaLabelledby || `${this.id}-input-label`;
|
|
46
|
+
return e`<pkt-input-wrapper
|
|
47
|
+
.strings=${this.strings}
|
|
47
48
|
label=${this.label}
|
|
48
|
-
?counter=${
|
|
49
|
+
?counter=${t}
|
|
49
50
|
?hasFieldset=${this.effectiveHasFieldset(!1)}
|
|
50
51
|
?disabled=${this.disabled}
|
|
51
52
|
?hasError=${this.hasError}
|
|
@@ -70,7 +71,7 @@ var y = t(class extends i {
|
|
|
70
71
|
<div class="pkt-contents" slot="helptext">${p(this, "helptext")}</div>
|
|
71
72
|
<textarea
|
|
72
73
|
${h(this.inputRef)}
|
|
73
|
-
class=${
|
|
74
|
+
class=${n}
|
|
74
75
|
id=${this.id + "-input"}
|
|
75
76
|
name=${(this.name || this.id) + "-input"}
|
|
76
77
|
placeholder=${m(this.placeholder)}
|
|
@@ -79,13 +80,13 @@ var y = t(class extends i {
|
|
|
79
80
|
maxlength=${m(this.maxlength)}
|
|
80
81
|
?readonly=${this.readonly}
|
|
81
82
|
autocomplete=${this.autocomplete}
|
|
82
|
-
aria-labelledby=${
|
|
83
|
+
aria-labelledby=${r}
|
|
83
84
|
aria-invalid=${this.hasError}
|
|
84
85
|
aria-errormessage=${m(this.hasError ? `${this.id}-input-error` : void 0)}
|
|
85
86
|
aria-describedby=${m(v({
|
|
86
87
|
id: this.id + "-input",
|
|
87
88
|
hasHelptext: !!this.helptext,
|
|
88
|
-
hasCounter:
|
|
89
|
+
hasCounter: t,
|
|
89
90
|
ariaDescribedby: this.ariaDescribedby
|
|
90
91
|
}))}
|
|
91
92
|
rows=${m(this.rows ?? void 0)}
|
|
@@ -107,12 +108,12 @@ var y = t(class extends i {
|
|
|
107
108
|
</pkt-input-wrapper>`;
|
|
108
109
|
}
|
|
109
110
|
};
|
|
110
|
-
|
|
111
|
+
s([l({
|
|
111
112
|
type: String,
|
|
112
113
|
reflect: !0
|
|
113
|
-
})], b.prototype, "value", void 0),
|
|
114
|
+
})], b.prototype, "value", void 0), s([l({ type: String })], b.prototype, "autocomplete", void 0), s([l({ type: Number })], b.prototype, "rows", void 0), s([l({ type: Number })], b.prototype, "cols", void 0), s([a()], b.prototype, "counterCurrent", void 0);
|
|
114
115
|
try {
|
|
115
|
-
|
|
116
|
+
t("pkt-textarea")(b);
|
|
116
117
|
} catch {
|
|
117
118
|
console.warn("Forsøker å definere <pkt-textarea>, men den er allerede definert");
|
|
118
119
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-DiFhBcIl.cjs"),t=require("./class-map-C33ixq7O.cjs"),n=require("./directive-helpers-C6J4AkFk.cjs"),r=require("./element-with-slot-CBK4zrdN.cjs");require("./icon-DIavy2cB.cjs");const i=require("./if-defined-Dc3xFDaM.cjs"),a=require("./ref-DZmN5Qgj.cjs"),o=require("./input-element-DQY1Rpbp.cjs"),s=require("./input-wrapper-mJZLVXy_.cjs");var c=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.PROPERTY&&t.type!==e.m.ATTRIBUTE&&t.type!==e.m.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.g||r===e.h)return r;let i=t.element,a=t.name;if(t.type===e.m.PROPERTY){if(r===i[a])return e.g}else if(t.type===e.m.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(a))return e.g}else if(t.type===e.m.ATTRIBUTE&&i.getAttribute(a)===r+``)return e.g;return n.r(t),r}}),l=class extends o.t{constructor(...e){super(...e),this.inputRef=a.t(),this.value=``,this.autocomplete=`off`,this.rows=null,this.cols=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),this.classList.add(`pkt-textinput`,`pkt-textarea`),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=this.effectiveCounter(this.counterMaxLength>0),o=t.t({"pkt-input":!0,[`pkt-input--${this.inputSize}`]:!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":n&&this.counterMaxLength>0&&this.value.length>this.counterMaxLength}),l=this.ariaLabelledby||`${this.id}-input-label`;return e._`<pkt-input-wrapper
|
|
2
|
+
.strings=${this.strings}
|
|
2
3
|
label=${this.label}
|
|
3
4
|
?counter=${n}
|
|
4
5
|
?hasFieldset=${this.effectiveHasFieldset(!1)}
|
|
@@ -46,4 +47,4 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
46
47
|
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
47
48
|
@blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
|
|
48
49
|
></textarea>
|
|
49
|
-
</pkt-input-wrapper>`}};e.n([e.
|
|
50
|
+
</pkt-input-wrapper>`}};e.n([e.u({type:String,reflect:!0})],l.prototype,`value`,void 0),e.n([e.u({type:String})],l.prototype,`autocomplete`,void 0),e.n([e.u({type:Number})],l.prototype,`rows`,void 0),e.n([e.u({type:Number})],l.prototype,`cols`,void 0),e.n([e.l()],l.prototype,`counterCurrent`,void 0);try{e.d(`pkt-textarea`)(l)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var u=l;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-DiFhBcIl.cjs"),t=require("./class-map-C33ixq7O.cjs"),n=require("./element-with-slot-CBK4zrdN.cjs");require("./icon-DIavy2cB.cjs");const r=require("./if-defined-Dc3xFDaM.cjs"),i=require("./ref-DZmN5Qgj.cjs"),a=require("./input-element-DQY1Rpbp.cjs"),o=require("./input-wrapper-mJZLVXy_.cjs");var s=class extends a.t{constructor(...e){super(...e),this.inputRef=i.t(),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}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),this.classList.add(`pkt-textinput`),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 a=this.type===`search`&&!this.iconNameRight&&!this.omitSearchIcon,s=this.effectiveCounter(this.counterMaxLength>0),c=t.t({"pkt-input":!0,[`pkt-input--${this.inputSize}`]:!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":s&&this.counterMaxLength>0&&this.value.length>this.counterMaxLength}),l=this.ariaLabelledby||`${this.id}-input-label`;return e._`
|
|
2
2
|
<pkt-input-wrapper
|
|
3
|
+
.strings=${this.strings}
|
|
3
4
|
label="${this.label}"
|
|
4
5
|
?counter=${s}
|
|
5
6
|
?hasFieldset=${this.effectiveHasFieldset(!1)}
|
|
@@ -25,7 +26,7 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
25
26
|
>
|
|
26
27
|
<div class="pkt-contents" slot="helptext">${n.n(this,`helptext`)}</div>
|
|
27
28
|
<div class=${`pkt-input__container pkt-input__container--${this.inputSize}`}>
|
|
28
|
-
${this.prefix?e.
|
|
29
|
+
${this.prefix?e._`<div class="pkt-input-prefix">${this.prefix}</div>`:e.h}
|
|
29
30
|
<input
|
|
30
31
|
${i.n(this.inputRef)}
|
|
31
32
|
class=${c}
|
|
@@ -41,7 +42,7 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
41
42
|
max=${r.t(this.max||void 0)}
|
|
42
43
|
step=${r.t(this.step||void 0)}
|
|
43
44
|
?readonly=${this.readonly}
|
|
44
|
-
size=${this.size||e.
|
|
45
|
+
size=${this.size||e.h}
|
|
45
46
|
.value=${this.value}
|
|
46
47
|
?disabled=${this.disabled}
|
|
47
48
|
aria-invalid=${this.hasError}
|
|
@@ -53,19 +54,19 @@ const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),
|
|
|
53
54
|
@blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
|
|
54
55
|
@keydown=${e=>{if(e.key===`Enter`){let e=this.internals.form;e?e.requestSubmit():this.inputRef.value?.blur()}}}
|
|
55
56
|
/>
|
|
56
|
-
${this.suffix?e.
|
|
57
|
+
${this.suffix?e._`<div class="pkt-input-suffix">
|
|
57
58
|
${this.suffix}
|
|
58
|
-
${this.iconNameRight?e.
|
|
59
|
+
${this.iconNameRight?e._`<pkt-icon
|
|
59
60
|
class="pkt-input-suffix-icon"
|
|
60
61
|
name=${this.iconNameRight}
|
|
61
|
-
></pkt-icon>`:e.
|
|
62
|
-
${a?e.
|
|
62
|
+
></pkt-icon>`:e.h}
|
|
63
|
+
${a?e._`<pkt-icon
|
|
63
64
|
class="pkt-input-suffix-icon"
|
|
64
65
|
name="magnifying-glass-big"
|
|
65
|
-
></pkt-icon>`:e.
|
|
66
|
-
</div>`:e.
|
|
67
|
-
${!this.suffix&&this.iconNameRight?e.
|
|
68
|
-
${!this.suffix&&a?e.
|
|
66
|
+
></pkt-icon>`:e.h}
|
|
67
|
+
</div>`:e.h}
|
|
68
|
+
${!this.suffix&&this.iconNameRight?e._`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:e.h}
|
|
69
|
+
${!this.suffix&&a?e._`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:e.h}
|
|
69
70
|
</div>
|
|
70
71
|
</pkt-input-wrapper>
|
|
71
|
-
`}};e.n([e.
|
|
72
|
+
`}};e.n([e.u({type:String,reflect:!0})],s.prototype,`value`,void 0),e.n([e.u({type:String})],s.prototype,`type`,void 0),e.n([e.u({type:Number})],s.prototype,`size`,void 0),e.n([e.u({type:String})],s.prototype,`autocomplete`,void 0),e.n([e.u({type:String})],s.prototype,`iconNameRight`,void 0),e.n([e.u({type:String})],s.prototype,`prefix`,void 0),e.n([e.u({type:String})],s.prototype,`suffix`,void 0),e.n([e.u({type:Boolean})],s.prototype,`omitSearchIcon`,void 0),e.n([e.l()],s.prototype,`counterCurrent`,void 0);try{e.d(`pkt-textinput`)(s)}catch{console.warn(`Forsøker å definere <pkt-textinput>, 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}});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import { n as s } from "./element-with-slot-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as c } from "./if-defined-
|
|
6
|
-
import { n as l, t as u } from "./ref-
|
|
7
|
-
import { t as d } from "./input-element-
|
|
8
|
-
import { r as f } from "./input-wrapper-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-WEzISABa.js";
|
|
2
|
+
import { t as o } from "./class-map-wh4Yi3oj.js";
|
|
3
|
+
import { n as s } from "./element-with-slot-BKYUx4gb.js";
|
|
4
|
+
import "./icon-DEtOSWRK.js";
|
|
5
|
+
import { t as c } from "./if-defined-BmnvvxtR.js";
|
|
6
|
+
import { n as l, t as u } from "./ref-OU8ryfP6.js";
|
|
7
|
+
import { t as d } from "./input-element-IBypGOaV.js";
|
|
8
|
+
import { r as f } from "./input-wrapper-CQgAL1Br.js";
|
|
9
9
|
//#region src/components/textinput/textinput.ts
|
|
10
10
|
var p = class extends d {
|
|
11
11
|
constructor(...e) {
|
|
@@ -18,16 +18,17 @@ var p = class extends d {
|
|
|
18
18
|
super.updated(e), this.classList.add("pkt-textinput"), 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);
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
let
|
|
21
|
+
let t = this.type === "search" && !this.iconNameRight && !this.omitSearchIcon, r = this.effectiveCounter(this.counterMaxLength > 0), i = o({
|
|
22
22
|
"pkt-input": !0,
|
|
23
23
|
[`pkt-input--${this.inputSize}`]: !0,
|
|
24
24
|
"pkt-input--fullwidth": this.fullwidth,
|
|
25
|
-
"pkt-input--counter-error":
|
|
25
|
+
"pkt-input--counter-error": r && this.counterMaxLength > 0 && this.value.length > this.counterMaxLength
|
|
26
26
|
}), a = this.ariaLabelledby || `${this.id}-input-label`;
|
|
27
|
-
return
|
|
27
|
+
return e`
|
|
28
28
|
<pkt-input-wrapper
|
|
29
|
+
.strings=${this.strings}
|
|
29
30
|
label="${this.label}"
|
|
30
|
-
?counter=${
|
|
31
|
+
?counter=${r}
|
|
31
32
|
?hasFieldset=${this.effectiveHasFieldset(!1)}
|
|
32
33
|
?disabled=${this.disabled}
|
|
33
34
|
?hasError=${this.hasError}
|
|
@@ -51,10 +52,10 @@ var p = class extends d {
|
|
|
51
52
|
>
|
|
52
53
|
<div class="pkt-contents" slot="helptext">${s(this, "helptext")}</div>
|
|
53
54
|
<div class=${`pkt-input__container pkt-input__container--${this.inputSize}`}>
|
|
54
|
-
${this.prefix ?
|
|
55
|
+
${this.prefix ? e`<div class="pkt-input-prefix">${this.prefix}</div>` : n}
|
|
55
56
|
<input
|
|
56
57
|
${l(this.inputRef)}
|
|
57
|
-
class=${
|
|
58
|
+
class=${i}
|
|
58
59
|
type=${this.type}
|
|
59
60
|
name=${(this.name || this.id) + "-input"}
|
|
60
61
|
id=${this.id + "-input"}
|
|
@@ -67,7 +68,7 @@ var p = class extends d {
|
|
|
67
68
|
max=${c(this.max || void 0)}
|
|
68
69
|
step=${c(this.step || void 0)}
|
|
69
70
|
?readonly=${this.readonly}
|
|
70
|
-
size=${this.size ||
|
|
71
|
+
size=${this.size || n}
|
|
71
72
|
.value=${this.value}
|
|
72
73
|
?disabled=${this.disabled}
|
|
73
74
|
aria-invalid=${this.hasError}
|
|
@@ -75,7 +76,7 @@ var p = class extends d {
|
|
|
75
76
|
aria-describedby=${c(f({
|
|
76
77
|
id: this.id + "-input",
|
|
77
78
|
hasHelptext: !!this.helptext,
|
|
78
|
-
hasCounter:
|
|
79
|
+
hasCounter: r,
|
|
79
80
|
ariaDescribedby: this.ariaDescribedby
|
|
80
81
|
}))}
|
|
81
82
|
@input=${(e) => {
|
|
@@ -97,30 +98,30 @@ var p = class extends d {
|
|
|
97
98
|
}
|
|
98
99
|
}}
|
|
99
100
|
/>
|
|
100
|
-
${this.suffix ?
|
|
101
|
+
${this.suffix ? e`<div class="pkt-input-suffix">
|
|
101
102
|
${this.suffix}
|
|
102
|
-
${this.iconNameRight ?
|
|
103
|
+
${this.iconNameRight ? e`<pkt-icon
|
|
103
104
|
class="pkt-input-suffix-icon"
|
|
104
105
|
name=${this.iconNameRight}
|
|
105
|
-
></pkt-icon>` :
|
|
106
|
-
${
|
|
106
|
+
></pkt-icon>` : n}
|
|
107
|
+
${t ? e`<pkt-icon
|
|
107
108
|
class="pkt-input-suffix-icon"
|
|
108
109
|
name="magnifying-glass-big"
|
|
109
|
-
></pkt-icon>` :
|
|
110
|
-
</div>` :
|
|
111
|
-
${!this.suffix && this.iconNameRight ?
|
|
112
|
-
${!this.suffix &&
|
|
110
|
+
></pkt-icon>` : n}
|
|
111
|
+
</div>` : n}
|
|
112
|
+
${!this.suffix && this.iconNameRight ? e`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>` : n}
|
|
113
|
+
${!this.suffix && t ? e`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>` : n}
|
|
113
114
|
</div>
|
|
114
115
|
</pkt-input-wrapper>
|
|
115
116
|
`;
|
|
116
117
|
}
|
|
117
118
|
};
|
|
118
|
-
|
|
119
|
+
i([a({
|
|
119
120
|
type: String,
|
|
120
121
|
reflect: !0
|
|
121
|
-
})], p.prototype, "value", void 0),
|
|
122
|
+
})], p.prototype, "value", void 0), i([a({ type: String })], p.prototype, "type", void 0), i([a({ type: Number })], p.prototype, "size", void 0), i([a({ type: String })], p.prototype, "autocomplete", void 0), i([a({ type: String })], p.prototype, "iconNameRight", void 0), i([a({ type: String })], p.prototype, "prefix", void 0), i([a({ type: String })], p.prototype, "suffix", void 0), i([a({ type: Boolean })], p.prototype, "omitSearchIcon", void 0), i([r()], p.prototype, "counterCurrent", void 0);
|
|
122
123
|
try {
|
|
123
|
-
|
|
124
|
+
t("pkt-textinput")(p);
|
|
124
125
|
} catch {
|
|
125
126
|
console.warn("Forsøker å definere <pkt-textinput>, men den er allerede definert");
|
|
126
127
|
}
|