@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
|
@@ -103,7 +103,7 @@ describe('PktHelptext', () => {
|
|
|
103
103
|
expect(helptext.forId).toBeTruthy() // Should have a generated ID
|
|
104
104
|
expect(helptext.helptext).toBe('')
|
|
105
105
|
expect(helptext.helptextDropdown).toBe('')
|
|
106
|
-
expect(helptext.helptextDropdownButton).
|
|
106
|
+
expect(helptext.helptextDropdownButton).toBeUndefined()
|
|
107
107
|
expect(helptext.isHelpTextOpen).toBe(false)
|
|
108
108
|
})
|
|
109
109
|
|
|
@@ -4,7 +4,6 @@ import { unsafeHTML } from 'lit/directives/unsafe-html.js'
|
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js'
|
|
5
5
|
import { customElement, property, state } from 'lit/decorators.js'
|
|
6
6
|
import { uuidish } from 'shared-utils/utils'
|
|
7
|
-
import specs from 'componentSpecs/input-wrapper.json'
|
|
8
7
|
import '@/components/icon'
|
|
9
8
|
import { slotContent } from '@/directives/slot-content'
|
|
10
9
|
|
|
@@ -18,8 +17,9 @@ export class PktHelptext extends PktElementWithSlot {
|
|
|
18
17
|
@property({ type: String })
|
|
19
18
|
helptextDropdown: string = ''
|
|
20
19
|
|
|
20
|
+
/** @deprecated Bruk `strings={{ forms: { readMore: '…' } }}` eller `setPktStrings()`. */
|
|
21
21
|
@property({ type: String })
|
|
22
|
-
helptextDropdownButton
|
|
22
|
+
helptextDropdownButton?: string
|
|
23
23
|
|
|
24
24
|
@state() isHelpTextOpen: boolean = false
|
|
25
25
|
|
|
@@ -55,7 +55,7 @@ export class PktHelptext extends PktElementWithSlot {
|
|
|
55
55
|
class="pkt-btn__icon"
|
|
56
56
|
name="${this.isHelpTextOpen ? 'chevron-thin-up' : 'chevron-thin-down'}"
|
|
57
57
|
></pkt-icon>
|
|
58
|
-
<span class="pkt-btn__text">${unsafeHTML(this.helptextDropdownButton)}</span>
|
|
58
|
+
<span class="pkt-btn__text">${unsafeHTML(this.helptextDropdownButton ?? this.pktStrings.get('forms').readMore)}</span>
|
|
59
59
|
</button>
|
|
60
60
|
<div
|
|
61
61
|
id="${this.forId}-helptext-expandable"
|
package/src/components/index.ts
CHANGED
|
@@ -97,7 +97,7 @@ export type { IPktSelectOption, TSelectOption } from '@/components/select'
|
|
|
97
97
|
|
|
98
98
|
export type { IPktBackLink } from '@/components/backlink'
|
|
99
99
|
|
|
100
|
-
export type { IPktBreadcrumbs, IBreadcrumbItem } from '@/components/breadcrumbs'
|
|
100
|
+
export type { IPktBreadcrumbs, IBreadcrumb, IBreadcrumbItem } from '@/components/breadcrumbs'
|
|
101
101
|
|
|
102
102
|
export type { IPktLoader, TPktLoaderVariant } from '@/components/loader'
|
|
103
103
|
|
|
@@ -132,3 +132,12 @@ export type {
|
|
|
132
132
|
TPktSearchInputAppearance,
|
|
133
133
|
TPktSearchInputMethod,
|
|
134
134
|
} from '@/components/searchinput'
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
getPktStrings,
|
|
138
|
+
nb as pktStringsNb,
|
|
139
|
+
resetPktStrings,
|
|
140
|
+
setPktStrings,
|
|
141
|
+
subscribePktStrings,
|
|
142
|
+
} from 'shared-strings'
|
|
143
|
+
export type { TPktStrings, TPktStringsNamespace, TPktStringsOverride, IPktStringsProps } from 'shared-strings'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PktElementWithSlot } from '@/base-elements/element-with-slot'
|
|
2
2
|
import { slotContent } from '@/directives/slot-content'
|
|
3
3
|
import { counterStatusId, isCounterExceeded } from 'shared-utils/forms/described-by'
|
|
4
|
-
import
|
|
4
|
+
import { formatString } from 'shared-strings'
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
6
6
|
import { html, nothing, PropertyValues } from 'lit'
|
|
7
7
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js'
|
|
@@ -58,9 +58,11 @@ export class PktInputWrapper extends PktElementWithSlot<Props> {
|
|
|
58
58
|
@property({ type: String }) counterError: string | null = null
|
|
59
59
|
@property({ type: String, reflect: false }) counterPosition: TCounterPosition = 'bottom'
|
|
60
60
|
@property({ type: Boolean }) optionalTag: boolean = specs.props.optionalTag.default
|
|
61
|
-
@
|
|
61
|
+
/** @deprecated Bruk `strings={{ forms: { optional: '…' } }}` eller `setPktStrings()`. */
|
|
62
|
+
@property({ type: String }) optionalText?: string
|
|
62
63
|
@property({ type: Boolean }) requiredTag: boolean = specs.props.requiredTag.default
|
|
63
|
-
@
|
|
64
|
+
/** @deprecated Bruk `strings={{ forms: { required: '…' } }}` eller `setPktStrings()`. */
|
|
65
|
+
@property({ type: String }) requiredText?: string
|
|
64
66
|
@property({ type: String }) tagText: string | null = null
|
|
65
67
|
@property({ type: Boolean }) hasError: boolean = specs.props.hasError.default
|
|
66
68
|
@property({ type: String }) errorMessage: string = ''
|
|
@@ -102,16 +104,22 @@ export class PktInputWrapper extends PktElementWithSlot<Props> {
|
|
|
102
104
|
? `${this.forId}-helptext`
|
|
103
105
|
: nothing
|
|
104
106
|
|
|
107
|
+
const formStrings = this.pktStrings.get('forms')
|
|
108
|
+
|
|
105
109
|
const tagElement = () => {
|
|
106
110
|
return html`
|
|
107
111
|
${this.tagText
|
|
108
112
|
? html`<span class=${tagClasses + ' pkt-tag--gray'}>${this.tagText}</span>`
|
|
109
113
|
: nothing}
|
|
110
114
|
${this.optionalTag
|
|
111
|
-
? html`<span class=${tagClasses + ' pkt-tag--blue-light'}
|
|
115
|
+
? html`<span class=${tagClasses + ' pkt-tag--blue-light'}
|
|
116
|
+
>${this.optionalText ?? formStrings.optional}</span
|
|
117
|
+
>`
|
|
112
118
|
: nothing}
|
|
113
119
|
${this.requiredTag
|
|
114
|
-
? html`<span class=${tagClasses + ' pkt-tag--beige'}
|
|
120
|
+
? html`<span class=${tagClasses + ' pkt-tag--beige'}
|
|
121
|
+
>${this.requiredText ?? formStrings.required}</span
|
|
122
|
+
>`
|
|
115
123
|
: nothing}
|
|
116
124
|
`
|
|
117
125
|
}
|
|
@@ -149,8 +157,7 @@ export class PktInputWrapper extends PktElementWithSlot<Props> {
|
|
|
149
157
|
.forId=${this.forId}
|
|
150
158
|
.helptext=${this.helptext}
|
|
151
159
|
.helptextDropdown=${this.helptextDropdown}
|
|
152
|
-
.helptextDropdownButton=${this.helptextDropdownButton
|
|
153
|
-
specs.props.helptextDropdownButton.default}
|
|
160
|
+
.helptextDropdownButton=${this.helptextDropdownButton ?? formStrings.readMore}
|
|
154
161
|
@toggleHelpText=${(e: CustomEvent) => {
|
|
155
162
|
this.toggleDropdown(e)
|
|
156
163
|
}}
|
|
@@ -170,9 +177,10 @@ export class PktInputWrapper extends PktElementWithSlot<Props> {
|
|
|
170
177
|
</div>
|
|
171
178
|
<div class="pkt-sr-only" id=${counterStatusId(this.forId)} aria-live="polite">
|
|
172
179
|
${exceeded
|
|
173
|
-
?
|
|
174
|
-
|
|
175
|
-
|
|
180
|
+
? formatString(this.pktStrings.get('validation').counterExceeded, {
|
|
181
|
+
current: this.counterCurrent ?? 0,
|
|
182
|
+
max: this.counterMaxLength,
|
|
183
|
+
})
|
|
176
184
|
: ''}
|
|
177
185
|
</div>`
|
|
178
186
|
}
|
|
@@ -3,18 +3,23 @@ import { slotContent } from '@/directives/slot-content'
|
|
|
3
3
|
import { html, nothing } from 'lit'
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js'
|
|
5
5
|
import { customElement, property } from 'lit/decorators.js'
|
|
6
|
-
import specs from 'componentSpecs/link.
|
|
6
|
+
import specs from 'componentSpecs/link.spec'
|
|
7
|
+
import type { TPropObject } from 'componentSpecs/lib/define-component-spec'
|
|
7
8
|
import '@/components/icon'
|
|
8
9
|
|
|
10
|
+
/** Spec defaults — narrow cast for `@property` initializers. */
|
|
11
|
+
const specDefaults = specs.props! as Record<string, TPropObject>
|
|
12
|
+
|
|
9
13
|
export class PktLink extends PktElementWithSlot {
|
|
10
14
|
/**
|
|
11
15
|
* Element attributes
|
|
12
16
|
*/
|
|
13
|
-
@property({ type: String, reflect: true }) href: string =
|
|
17
|
+
@property({ type: String, reflect: true }) href: string = specDefaults.href.default as string
|
|
14
18
|
@property({ type: String, reflect: true }) iconName: string | undefined = undefined
|
|
15
19
|
@property({ type: String, reflect: true }) iconPosition: string | undefined = undefined
|
|
16
20
|
@property({ type: Boolean, reflect: true }) external: boolean = false
|
|
17
|
-
@property({ type: String, reflect: true }) target: string | null =
|
|
21
|
+
@property({ type: String, reflect: true }) target: string | null =
|
|
22
|
+
specDefaults.target.default as string
|
|
18
23
|
|
|
19
24
|
render() {
|
|
20
25
|
const classes = {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { html, nothing, PropertyValues } from 'lit'
|
|
2
2
|
import { customElement, property, state } from 'lit/decorators.js'
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
4
|
-
import strings from '@/translations/no.json'
|
|
5
4
|
import { PktElement } from '@/base-elements/element'
|
|
6
5
|
import { repeat } from 'lit/directives/repeat.js'
|
|
7
6
|
import { classMap } from 'lit/directives/class-map.js'
|
|
@@ -263,6 +262,7 @@ export class PktListbox extends PktElement implements IPktListbox {
|
|
|
263
262
|
}
|
|
264
263
|
|
|
265
264
|
private renderSearch() {
|
|
265
|
+
const listboxStrings = this.pktStrings.get('listbox')
|
|
266
266
|
return this.includeSearch
|
|
267
267
|
? html`
|
|
268
268
|
<div class="pkt-listbox__search">
|
|
@@ -272,9 +272,9 @@ export class PktListbox extends PktElement implements IPktListbox {
|
|
|
272
272
|
<input
|
|
273
273
|
class="pkt-txt-16-light"
|
|
274
274
|
type="text"
|
|
275
|
-
aria-label
|
|
275
|
+
aria-label=${listboxStrings.searchLabel}
|
|
276
276
|
form=""
|
|
277
|
-
placeholder=${this.searchPlaceholder
|
|
277
|
+
placeholder=${this.searchPlaceholder ?? listboxStrings.searchPlaceholder}
|
|
278
278
|
@input=${this.handleSearchInput}
|
|
279
279
|
@keydown=${this.handleSearchKeydown}
|
|
280
280
|
.value=${this.searchValue}
|
|
@@ -29,9 +29,11 @@ export class PktRadioButton extends PktInputElement<Props> {
|
|
|
29
29
|
@property({ type: String, reflect: true }) type: string = 'radio'
|
|
30
30
|
@property({ type: String }) tagText: string | null = null
|
|
31
31
|
@property({ type: Boolean }) optionalTag: boolean = false
|
|
32
|
-
@
|
|
32
|
+
/** @deprecated Bruk `strings={{ forms: { optional: '…' } }}` eller `setPktStrings()`. */
|
|
33
|
+
@property({ type: String }) optionalText?: string
|
|
33
34
|
@property({ type: Boolean }) requiredTag: boolean = false
|
|
34
|
-
@
|
|
35
|
+
/** @deprecated Bruk `strings={{ forms: { required: '…' } }}` eller `setPktStrings()`. */
|
|
36
|
+
@property({ type: String }) requiredText?: string
|
|
35
37
|
|
|
36
38
|
@state() _checked: boolean = false
|
|
37
39
|
|
|
@@ -69,16 +71,18 @@ export class PktRadioButton extends PktInputElement<Props> {
|
|
|
69
71
|
|
|
70
72
|
const tagClasses = 'pkt-tag pkt-tag--small pkt-tag--thin-text'
|
|
71
73
|
|
|
74
|
+
const formStrings = this.pktStrings.get('forms')
|
|
75
|
+
|
|
72
76
|
const tags = () => {
|
|
73
77
|
return html`
|
|
74
78
|
${this.tagText
|
|
75
79
|
? html`<span class=${tagClasses + ' pkt-tag--gray'}>${this.tagText}</span>`
|
|
76
80
|
: nothing}
|
|
77
81
|
${this.optionalTag
|
|
78
|
-
? html`<span class=${tagClasses + ' pkt-tag--blue-light'}>${this.optionalText}</span>`
|
|
82
|
+
? html`<span class=${tagClasses + ' pkt-tag--blue-light'}>${this.optionalText ?? formStrings.optional}</span>`
|
|
79
83
|
: nothing}
|
|
80
84
|
${this.requiredTag
|
|
81
|
-
? html`<span class=${tagClasses + ' pkt-tag--beige'}>${this.requiredText}</span>`
|
|
85
|
+
? html`<span class=${tagClasses + ' pkt-tag--beige'}>${this.requiredText ?? formStrings.required}</span>`
|
|
82
86
|
: nothing}
|
|
83
87
|
`
|
|
84
88
|
}
|
|
@@ -30,7 +30,8 @@ export class PktSearchInput extends PktElement<IPktSearchInput> implements IPktS
|
|
|
30
30
|
@property({ type: String, reflect: true }) id: string = ''
|
|
31
31
|
@property({ type: String }) label: string | undefined
|
|
32
32
|
@property({ type: String }) name: string | undefined
|
|
33
|
-
@
|
|
33
|
+
/** @deprecated Bruk `strings={{ searchinput: { placeholder: '…' } }}` eller `setPktStrings()`. */
|
|
34
|
+
@property({ type: String }) placeholder?: string
|
|
34
35
|
@property({ type: String }) value: string = ''
|
|
35
36
|
@property({ type: Array }) suggestions: IPktSearchInputSuggestion[] | undefined
|
|
36
37
|
@property({ type: String }) action: string | undefined
|
|
@@ -135,6 +136,7 @@ export class PktSearchInput extends PktElement<IPktSearchInput> implements IPktS
|
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
render() {
|
|
139
|
+
const searchStrings = this.pktStrings.get('searchinput')
|
|
138
140
|
const wrapperClasses = classMap({
|
|
139
141
|
'pkt-searchinput': true,
|
|
140
142
|
[`pkt-searchinput--${this.appearance}`]: true,
|
|
@@ -173,7 +175,7 @@ export class PktSearchInput extends PktElement<IPktSearchInput> implements IPktS
|
|
|
173
175
|
type="search"
|
|
174
176
|
name=${this.name || this.id}
|
|
175
177
|
id=${this.id}
|
|
176
|
-
placeholder=${this.placeholder ||
|
|
178
|
+
placeholder=${this.placeholder || searchStrings.placeholder}
|
|
177
179
|
.value=${this.value}
|
|
178
180
|
?disabled=${this.disabled}
|
|
179
181
|
autocomplete="off"
|
|
@@ -190,7 +192,7 @@ export class PktSearchInput extends PktElement<IPktSearchInput> implements IPktS
|
|
|
190
192
|
@click=${this.onSearchClick}
|
|
191
193
|
>
|
|
192
194
|
<pkt-icon class="pkt-btn__icon" name="magnifying-glass-big"></pkt-icon>
|
|
193
|
-
<span class="pkt-btn__text">${this.label || this.placeholder ||
|
|
195
|
+
<span class="pkt-btn__text">${this.label || this.placeholder || searchStrings.placeholder}</span>
|
|
194
196
|
</button>
|
|
195
197
|
</div>
|
|
196
198
|
${this.suggestions
|
|
@@ -10,6 +10,7 @@ import '@/components/icon'
|
|
|
10
10
|
import type { IAriaAttributes, THTMLButtonType } from 'shared-types'
|
|
11
11
|
import { PktIconName } from '@oslokommune/punkt-assets/dist/icons/icon'
|
|
12
12
|
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
13
|
+
import { formatString } from 'shared-strings'
|
|
13
14
|
|
|
14
15
|
export type TTagSkin =
|
|
15
16
|
| 'blue'
|
|
@@ -68,7 +69,7 @@ export class PktTag extends PktElementWithSlot<IPktTag> implements IPktTag {
|
|
|
68
69
|
if (this.closeTag && !this.ariaLabel) {
|
|
69
70
|
const label = this.querySelector('button span, .pkt-tag > span')?.textContent?.trim()
|
|
70
71
|
if (label) {
|
|
71
|
-
this._ariaDescription =
|
|
72
|
+
this._ariaDescription = formatString(this.pktStrings.get('tag').remove, { label })
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
}
|
|
@@ -55,6 +55,7 @@ export class PktTextarea extends PktInputElement<Props> {
|
|
|
55
55
|
const labelledBy = this.ariaLabelledby || `${this.id}-input-label`
|
|
56
56
|
|
|
57
57
|
return html`<pkt-input-wrapper
|
|
58
|
+
.strings=${this.strings}
|
|
58
59
|
label=${this.label}
|
|
59
60
|
?counter=${showCounter}
|
|
60
61
|
?hasFieldset=${this.effectiveHasFieldset(false)}
|
|
@@ -6,7 +6,7 @@ import { classMap } from 'lit/directives/class-map.js'
|
|
|
6
6
|
import { PktInputElement } from '@/base-elements/input-element'
|
|
7
7
|
import { slotContent } from '@/directives/slot-content'
|
|
8
8
|
import { ElementProps } from '@/types/typeUtils'
|
|
9
|
-
import
|
|
9
|
+
import { formatString } from 'shared-strings'
|
|
10
10
|
import { isValidTimeString, timeToMinutes } from 'shared-utils/timepicker/time-utils'
|
|
11
11
|
import { getMinuteStep, getHourOptions, getMinuteOptions } from 'shared-utils/timepicker/options'
|
|
12
12
|
import { stepTime } from 'shared-utils/timepicker/stepper'
|
|
@@ -71,8 +71,10 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
71
71
|
const anchor = this.hoursInputRef.value
|
|
72
72
|
if (!anchor) return
|
|
73
73
|
|
|
74
|
+
const messages = this.pktStrings.get('validation')
|
|
75
|
+
|
|
74
76
|
if (this.required && !this.value) {
|
|
75
|
-
this.internals.setValidity({ valueMissing: true },
|
|
77
|
+
this.internals.setValidity({ valueMissing: true }, messages.valueMissing, anchor)
|
|
76
78
|
this._setAriaInvalid(true)
|
|
77
79
|
return
|
|
78
80
|
}
|
|
@@ -89,7 +91,7 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
89
91
|
if (this.min && totalMinutes < timeToMinutes(String(this.min))) {
|
|
90
92
|
this.internals.setValidity(
|
|
91
93
|
{ rangeUnderflow: true },
|
|
92
|
-
|
|
94
|
+
formatString(messages.rangeUnderflowMin, { min: String(this.min) }),
|
|
93
95
|
anchor,
|
|
94
96
|
)
|
|
95
97
|
this._setAriaInvalid(true)
|
|
@@ -99,7 +101,7 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
99
101
|
if (this.max && totalMinutes > timeToMinutes(String(this.max))) {
|
|
100
102
|
this.internals.setValidity(
|
|
101
103
|
{ rangeOverflow: true },
|
|
102
|
-
|
|
104
|
+
formatString(messages.rangeOverflowMax, { max: String(this.max) }),
|
|
103
105
|
anchor,
|
|
104
106
|
)
|
|
105
107
|
this._setAriaInvalid(true)
|
|
@@ -109,13 +111,12 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
109
111
|
if (this.step && totalMinutes % minuteStep !== 0) {
|
|
110
112
|
const stepMessage =
|
|
111
113
|
minuteStep === 60
|
|
112
|
-
?
|
|
114
|
+
? messages.timeStepMismatchHour
|
|
113
115
|
: minuteStep === 30
|
|
114
|
-
?
|
|
115
|
-
:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
)
|
|
116
|
+
? messages.timeStepMismatchHalfHour
|
|
117
|
+
: formatString(messages.timeStepMismatch, {
|
|
118
|
+
step: `${minuteStep}, ${minuteStep * 2}, ${minuteStep * 3}`,
|
|
119
|
+
})
|
|
119
120
|
this.internals.setValidity({ stepMismatch: true }, stepMessage, anchor)
|
|
120
121
|
this._setAriaInvalid(true)
|
|
121
122
|
return
|
|
@@ -583,7 +584,7 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
583
584
|
id=${this.id + '-popup'}
|
|
584
585
|
?hidden=${!this._isOpen}
|
|
585
586
|
role="group"
|
|
586
|
-
aria-label=${this.
|
|
587
|
+
aria-label=${this.pktStrings.get('timepicker').selectTime}
|
|
587
588
|
@keydown=${this._handlePopupKeydown}
|
|
588
589
|
@focusout=${(e: FocusEvent) => {
|
|
589
590
|
if (!this.querySelector('.pkt-timepicker-popup')?.contains(e.relatedTarget as Node)) {
|
|
@@ -594,7 +595,7 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
594
595
|
<div
|
|
595
596
|
class="pkt-timepicker-popup__col"
|
|
596
597
|
role="listbox"
|
|
597
|
-
aria-label=${this.
|
|
598
|
+
aria-label=${this.pktStrings.get('timepicker').hours}
|
|
598
599
|
aria-orientation="vertical"
|
|
599
600
|
>
|
|
600
601
|
${this._hourOptions.map((h) => this._renderOption(h, 'hour'))}
|
|
@@ -602,7 +603,7 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
602
603
|
<div
|
|
603
604
|
class="pkt-timepicker-popup__col"
|
|
604
605
|
role="listbox"
|
|
605
|
-
aria-label=${this.
|
|
606
|
+
aria-label=${this.pktStrings.get('timepicker').minutes}
|
|
606
607
|
aria-orientation="vertical"
|
|
607
608
|
>
|
|
608
609
|
${this._minuteOptions.map((m) => this._renderOption(m, 'minute'))}
|
|
@@ -612,8 +613,8 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
612
613
|
}
|
|
613
614
|
|
|
614
615
|
private _renderContainer() {
|
|
615
|
-
const hoursLabel = this.
|
|
616
|
-
const minutesLabel = this.
|
|
616
|
+
const hoursLabel = this.pktStrings.get('timepicker').hours
|
|
617
|
+
const minutesLabel = this.pktStrings.get('timepicker').minutes
|
|
617
618
|
const hoursAriaLabel = this.label ? `${hoursLabel}, ${this.label}` : hoursLabel
|
|
618
619
|
const minutesAriaLabel = this.label ? `${minutesLabel}, ${this.label}` : minutesLabel
|
|
619
620
|
return html`
|
|
@@ -631,13 +632,13 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
631
632
|
class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-btn--${this
|
|
632
633
|
.inputSize} pkt-timepicker__button pkt-timepicker__button--prev"
|
|
633
634
|
type="button"
|
|
634
|
-
aria-label=${this.
|
|
635
|
+
aria-label=${this.pktStrings.get('timepicker').prevTime}
|
|
635
636
|
?disabled=${this.disabled}
|
|
636
637
|
@click=${() => this._stepTime(-1)}
|
|
637
638
|
>
|
|
638
639
|
<pkt-icon name="chevron-thin-left"></pkt-icon>
|
|
639
640
|
<span class="pkt-btn__text"
|
|
640
|
-
>${this.
|
|
641
|
+
>${this.pktStrings.get('timepicker').prevTime}</span
|
|
641
642
|
>
|
|
642
643
|
</button>
|
|
643
644
|
`
|
|
@@ -719,7 +720,7 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
719
720
|
class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-btn--${this
|
|
720
721
|
.inputSize} pkt-timepicker__button"
|
|
721
722
|
type="button"
|
|
722
|
-
aria-label=${this.
|
|
723
|
+
aria-label=${this.pktStrings.get('timepicker').openPicker}
|
|
723
724
|
aria-haspopup="listbox"
|
|
724
725
|
aria-expanded=${this._isOpen ? 'true' : 'false'}
|
|
725
726
|
aria-controls=${this.id + '-popup'}
|
|
@@ -728,7 +729,7 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
728
729
|
>
|
|
729
730
|
<pkt-icon name="clock"></pkt-icon>
|
|
730
731
|
<span class="pkt-btn__text"
|
|
731
|
-
>${this.
|
|
732
|
+
>${this.pktStrings.get('timepicker').openPicker}</span
|
|
732
733
|
>
|
|
733
734
|
</button>
|
|
734
735
|
`
|
|
@@ -739,13 +740,13 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
739
740
|
class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-btn--${this
|
|
740
741
|
.inputSize} pkt-timepicker__button pkt-timepicker__button--next"
|
|
741
742
|
type="button"
|
|
742
|
-
aria-label=${this.
|
|
743
|
+
aria-label=${this.pktStrings.get('timepicker').nextTime}
|
|
743
744
|
?disabled=${this.disabled}
|
|
744
745
|
@click=${() => this._stepTime(1)}
|
|
745
746
|
>
|
|
746
747
|
<pkt-icon name="chevron-thin-right"></pkt-icon>
|
|
747
748
|
<span class="pkt-btn__text"
|
|
748
|
-
>${this.
|
|
749
|
+
>${this.pktStrings.get('timepicker').nextTime}</span
|
|
749
750
|
>
|
|
750
751
|
</button>
|
|
751
752
|
`
|
|
@@ -771,6 +772,7 @@ export class PktTimepicker extends PktInputElement<Props> {
|
|
|
771
772
|
render() {
|
|
772
773
|
return html`
|
|
773
774
|
<pkt-input-wrapper
|
|
775
|
+
.strings=${this.strings}
|
|
774
776
|
label="${this.label}"
|
|
775
777
|
?disabled=${this.disabled}
|
|
776
778
|
?fullwidth=${this.fullwidth}
|
package/dist/alert-Cs4Rmq_J.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const e=require("./element-BA8v6S7z.cjs"),t=require("./class-map-BeimMvPv.cjs"),n=require("./element-with-slot-Bj7nm7fO.cjs"),r=require("./classutils-CbklAJDe.cjs");require("./icon-9iwd2F2l.cjs"),require("./button-CE97NQIk.cjs");var i={name:`pkt-alert`,react:`PktAlert`,"css-class":`pkt-alert`,"dark-mode":!0,isElement:!0,isPureReact:!0,events:{onClose:{description:`React: Klikk-event for 'Lukk'-knappen`},close:{description:`Vue: Klikk-event for 'Lukk'-knappen`}},props:{title:{name:`Tittel`,description:`Tittelen som vises øverst i på meldingen`,type:`string`,category:`contents`},skin:{name:`Utseende`,description:`Hvordan type melding er dette?`,type:[`info`,`success`,`warning`,`error`],default:`info`,category:`ui`},date:{name:`Sist oppdatert`,description:`Dato som vises nederst i på meldingen`,type:`string`,category:`contents`},ariaLive:{name:`aria-live`,description:`Hvordan skal skjermleseren lese opp meldingen?`,type:[`off`,`polite`,`assertive`],default:`polite`,category:`accessibility`},size:{name:`Størrelse`,description:`Endrer størrelsen på ulike elementer i alerten.`,type:[`medium`,`small`,`xsmall`],default:`medium`,category:`ui`},closeAlert:{name:`Vis 'Lukk'-knapp`,description:`Viser 'Lukk'-knappen`,type:`boolean`,default:!1,category:`ui`}},slots:{default:{description:`Innholdet i meldingen`}},deprecated:{compact:{name:`Kompakt (deprecated)`,description:`Bruk size i stedet; uten eksplisitt size gir compact størrelsen 'small'.`,type:`boolean`,category:`ui`,default:!1}}},a=class extends n.t{constructor(){super(),this.compact=i.deprecated.compact.default,this.title=``,this.skin=i.props.skin.default,this.ariaLive=i.props.ariaLive.default,this.ariaLiveAttr=null,this.closeAlert=i.props.closeAlert.default,this.date=null,this.role=`status`,this._isClosed=!1,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!0,composed:!0}))},this._isClosed=!1}connectedCallback(){super.connectedCallback(),this.ariaLiveAttr=this.getAttribute(`aria-live`)||this.ariaLive}attributeChangedCallback(e,t,n){e===`ariaLive`&&(this.ariaLiveAttr=n),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`ariaLive`)&&(this.ariaLiveAttr=this.ariaLive),e.has(`_isClosed`)&&r.t(this,`pkt-hide`,this._isClosed)}render(){let r=this.size??(this.compact?`small`:`medium`),i={"pkt-alert":!0,[`pkt-alert--${r}`]:!0,[`pkt-alert--${this.skin}`]:!0,"pkt-hide":this._isClosed},a={"pkt-alert__grid":!0,"pkt-alert__noTitle":!this.title,"pkt-alert__noDate":!this.date};return e.p`
|
|
2
|
-
<div class=${t.t(i)} aria-live=${this.ariaLiveAttr}>
|
|
3
|
-
<div class=${t.t(a)}>
|
|
4
|
-
<pkt-icon
|
|
5
|
-
class="pkt-alert__icon"
|
|
6
|
-
aria-hidden="true"
|
|
7
|
-
name=${this.skin===`info`?`alert-information`:`alert-${this.skin}`}
|
|
8
|
-
></pkt-icon>
|
|
9
|
-
|
|
10
|
-
${this.closeAlert?e.p`
|
|
11
|
-
<div class="pkt-alert__close">
|
|
12
|
-
<pkt-button
|
|
13
|
-
tabindex="0"
|
|
14
|
-
aria-label="close"
|
|
15
|
-
size=${r}
|
|
16
|
-
type="button"
|
|
17
|
-
skin="tertiary"
|
|
18
|
-
iconName="close"
|
|
19
|
-
variant="icon-only"
|
|
20
|
-
@click=${this.close}
|
|
21
|
-
>
|
|
22
|
-
<span class="sr-only">Lukk</span>
|
|
23
|
-
</pkt-button>
|
|
24
|
-
</div>
|
|
25
|
-
`:e.d}
|
|
26
|
-
${this.title?e.p`<div class="pkt-alert__title">${this.title}</div>`:e.d}
|
|
27
|
-
|
|
28
|
-
<div class="pkt-alert__text">${n.n(this)}</div>
|
|
29
|
-
|
|
30
|
-
${this.date?e.p`<div class="pkt-alert__date">Sist oppdatert: ${this.date}</div>`:e.d}
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
`}};e.n([e.o({type:Boolean,reflect:!1})],a.prototype,`compact`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`title`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`skin`,void 0),e.n([e.o({type:String})],a.prototype,`ariaLive`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`aria-live`})],a.prototype,`ariaLiveAttr`,void 0),e.n([e.o({type:Boolean,reflect:!0})],a.prototype,`closeAlert`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`date`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`role`,void 0),e.n([e.o({type:String,attribute:`size`})],a.prototype,`size`,void 0),e.n([e.a()],a.prototype,`_isClosed`,void 0);try{e.s(`pkt-alert`)(a)}catch{console.warn(`Forsøker å definere <pkt-alert>, 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,2 +0,0 @@
|
|
|
1
|
-
var e=globalThis,t=e=>e,n=e.trustedTypes,r=n?n.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,i=`$lit$`,a=`lit$${Math.random().toFixed(9).slice(2)}$`,o=`?`+a,s=`<${o}>`,c=document,l=()=>c.createComment(``),u=e=>e===null||typeof e!=`object`&&typeof e!=`function`,d=Array.isArray,f=e=>d(e)||typeof e?.[Symbol.iterator]==`function`,p=`[
|
|
2
|
-
\f\r]`,m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,h=/-->/g,g=/>/g,_=RegExp(`>|${p}(?:([^\\s"'>=/]+)(${p}*=${p}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),v=/'/g,y=/"/g,b=/^(?:script|style|textarea|title)$/i,x=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),S=Symbol.for(`lit-noChange`),C=Symbol.for(`lit-nothing`),w=new WeakMap,T=c.createTreeWalker(c,129);function E(e,t){if(!d(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return r===void 0?t:r.createHTML(t)}var D=(e,t)=>{let n=e.length-1,r=[],o,c=t===2?`<svg>`:t===3?`<math>`:``,l=m;for(let t=0;t<n;t++){let n=e[t],u,d,f=-1,p=0;for(;p<n.length&&(l.lastIndex=p,d=l.exec(n),d!==null);)p=l.lastIndex,l===m?d[1]===`!--`?l=h:d[1]===void 0?d[2]===void 0?d[3]!==void 0&&(l=_):(b.test(d[2])&&(o=RegExp(`</`+d[2],`g`)),l=_):l=g:l===_?d[0]===`>`?(l=o??m,f=-1):d[1]===void 0?f=-2:(f=l.lastIndex-d[2].length,u=d[1],l=d[3]===void 0?_:d[3]===`"`?y:v):l===y||l===v?l=_:l===h||l===g?l=m:(l=_,o=void 0);let x=l===_&&e[t+1].startsWith(`/>`)?` `:``;c+=l===m?n+s:f>=0?(r.push(u),n.slice(0,f)+i+n.slice(f)+a+x):n+a+(f===-2?t:x)}return[E(e,c+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},O=class e{constructor({strings:t,_$litType$:r},s){let c;this.parts=[];let u=0,d=0,f=t.length-1,p=this.parts,[m,h]=D(t,r);if(this.el=e.createElement(m,s),T.currentNode=this.el.content,r===2||r===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(c=T.nextNode())!==null&&p.length<f;){if(c.nodeType===1){if(c.hasAttributes())for(let e of c.getAttributeNames())if(e.endsWith(i)){let t=h[d++],n=c.getAttribute(e).split(a),r=/([.?@])?(.*)/.exec(t);p.push({type:1,index:u,name:r[2],strings:n,ctor:r[1]===`.`?N:r[1]===`?`?P:r[1]===`@`?F:M}),c.removeAttribute(e)}else e.startsWith(a)&&(p.push({type:6,index:u}),c.removeAttribute(e));if(b.test(c.tagName)){let e=c.textContent.split(a),t=e.length-1;if(t>0){c.textContent=n?n.emptyScript:``;for(let n=0;n<t;n++)c.append(e[n],l()),T.nextNode(),p.push({type:2,index:++u});c.append(e[t],l())}}}else if(c.nodeType===8){if(c.data===o)p.push({type:2,index:u});else{let e=-1;for(;(e=c.data.indexOf(a,e+1))!==-1;)p.push({type:7,index:u}),e+=a.length-1}}u++}}static createElement(e,t){let n=c.createElement(`template`);return n.innerHTML=e,n}};function k(e,t,n=e,r){if(t===S)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=u(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=k(e,i._$AS(e,t.values),i,r)),t}var A=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??c).importNode(t,!0);T.currentNode=r;let i=T.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new j(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new I(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=T.nextNode(),a++)}return T.currentNode=c,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},j=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=k(this,e,t),u(e)?e===C||e==null||e===``?(this._$AH!==C&&this._$AR(),this._$AH=C):e!==this._$AH&&e!==S&&this._(e):e._$litType$===void 0?e.nodeType===void 0?f(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==C&&u(this._$AH)?this._$AA.nextSibling.data=e:this.T(c.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=O.createElement(E(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new A(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=w.get(e.strings);return t===void 0&&w.set(e.strings,t=new O(e)),t}k(t){d(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(l()),this.O(l()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);e!==this._$AB;){let n=t(e).nextSibling;t(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},M=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=C,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=C}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=k(this,e,t,0),a=!u(e)||e!==this._$AH&&e!==S,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=k(this,r[n+o],t,o),s===S&&(s=this._$AH[o]),a||=!u(s)||s!==this._$AH[o],s===C?e=C:e!==C&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},N=class extends M{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===C?void 0:e}},P=class extends M{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==C)}},F=class extends M{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=k(this,e,t,0)??C)===S)return;let n=this._$AH,r=e===C&&n!==C||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==C&&(n===C||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},I=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){k(this,e)}},ee={M:i,P:a,A:o,C:1,L:D,R:A,D:f,V:k,I:j,H:M,N:P,U:F,B:N,F:I},te=e.litHtmlPolyfillSupport;te?.(O,j),(e.litHtmlVersions??=[]).push(`3.3.3`);var ne=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new j(t.insertBefore(l(),e),e,void 0,n??{})}return i._$AI(e),i},re={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ie=e=>(...t)=>({_$litDirective$:e,values:t}),ae=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},oe=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},L=globalThis,R=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,z=Symbol(),B=new WeakMap,se=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==z)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(R&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=B.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&B.set(t,e))}return e}toString(){return this.cssText}},ce=e=>new se(typeof e==`string`?e:e+``,void 0,z),le=(e,t)=>{if(R)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=L.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},V=R?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return ce(t)})(e):e,{is:ue,defineProperty:de,getOwnPropertyDescriptor:fe,getOwnPropertyNames:pe,getOwnPropertySymbols:me,getPrototypeOf:he}=Object,H=globalThis,U=H.trustedTypes,ge=U?U.emptyScript:``,_e=H.reactiveElementPolyfillSupport,W=(e,t)=>e,G={toAttribute(e,t){switch(t){case Boolean:e=e?ge:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},K=(e,t)=>!ue(e,t),q={attribute:!0,type:String,converter:G,reflect:!1,useDefault:!1,hasChanged:K};Symbol.metadata??=Symbol(`metadata`),H.litPropertyMetadata??=new WeakMap;var J=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=q){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&de(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=fe(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??q}static _$Ei(){if(this.hasOwnProperty(W(`elementProperties`)))return;let e=he(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(W(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W(`properties`))){let e=this.properties,t=[...pe(e),...me(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(V(e))}else e!==void 0&&t.push(V(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return le(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?G:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?G:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??K)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};J.elementStyles=[],J.shadowRootOptions={mode:`open`},J[W(`elementProperties`)]=new Map,J[W(`finalized`)]=new Map,_e?.({ReactiveElement:J}),(H.reactiveElementVersions??=[]).push(`2.1.2`);var ve={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:K},ye=(e=ve,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function Y(e){return(t,n)=>typeof n==`object`?ye(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function be(e){return Y({...e,state:!0,attribute:!1})}var X=globalThis,Z=class extends J{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ne(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return S}};Z._$litElement$=!0,Z.finalized=!0,X.litElementHydrateSupport?.({LitElement:Z});var xe=X.litElementPolyfillSupport;xe?.({LitElement:Z}),(X.litElementVersions??=[]).push(`4.2.2`);var Se={example:{hi:`Hei!`},generic:{from:`Fra`,to:`Til`},calendar:{buttonAltText:`Åpne kalender`,deleteDate:`Fjern dato`},dates:{month:`Måned`,year:`År`,days:[`Mandag`,`Tirsdag`,`Onsdag`,`Torsdag`,`Fredag`,`Lørdag`,`Søndag`],daysShort:[`Man`,`Tir`,`Ons`,`Tor`,`Fre`,`Lør`,`Søn`],months:[`Januar`,`Februar`,`Mars`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Desember`],monthsShort:[`Jan`,`Feb`,`Mar`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Des`],week:`Uke`,prevMonth:`Forrige måned`,nextMonth:`Neste måned`},timepicker:{hours:`Timer`,minutes:`Minutter`,openPicker:`Åpne tidspunkt-velger`,prevTime:`Forrige tidspunkt`,nextTime:`Neste tidspunkt`,selectTime:`Velg tidspunkt`},forms:{search:{placeholder:`Søk…`},labels:{optional:`Valgfritt`,required:`Må fylles ut`},messages:{required:`Dette feltet er påkrevd`,invalid:`Ugyldig verdi`,invalidPattern:`Ugyldig format`,tooShort:`For kort`,tooLong:`For lang`,rangeUnderflow:`For lav verdi`,rangeOverflow:`For høy verdi`,stepMismatch:`Må treffe på steget som er definert i elementet`,timeStepMismatch:`Må treffe på et steg, for eksempel 0, {step} minutter`,timeStepMismatchHour:`Må treffe på hver hele time`,timeStepMismatchHalfHour:`Må treffe på hver hele eller halve time`,rangeUnderflowMin:`Verdien må være større enn eller lik {min}.`,rangeOverflowMax:`Verdien må være mindre enn eller lik {max}.`,dateUnderflow:`For tidlig dato`,dateOverflow:`For sen dato`,counterExceeded:`Du har brukt {current} av {max}`},helptext:{helptextDropdownButton:`Les mer`},date:{multiple:`Her kan du velge flere datoer. Trykk komma eller enter når du har skrevet inn en dato.`}}};function Q(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var $=class extends Z{constructor(...e){super(...e),this.strings=Se,this.role=null}hotReplacedCallback(){this.requestUpdate()}};Q([Y({type:Object})],$.prototype,`strings`,void 0),Q([Y({type:String})],$.prototype,`role`,void 0);var Ce=class extends ${createRenderRoot(){return this}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return be}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return re}});
|