@oslokommune/punkt-elements 19.17.1 → 19.18.1
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 +15 -0
- package/dist/{accordion-B0zAUNUV.js → accordion-GheghzDV.js} +1 -1
- package/dist/{accordion-Cx-Gh3hc.cjs → accordion-XX12Iouj.cjs} +1 -1
- package/dist/{alert-BRZDpVMt.cjs → alert-SQdshv-F.cjs} +1 -1
- package/dist/{alert-JnRrtTOW.js → alert-gty76GoA.js} +3 -3
- package/dist/{backlink-CsFeerTH.cjs → backlink-CNRyH73A.cjs} +1 -1
- package/dist/{backlink-D8Rv46lA.js → backlink-HF3DMgLc.js} +1 -1
- package/dist/{breadcrumbs-D03id_ha.cjs → breadcrumbs-YQ1orAK_.cjs} +1 -1
- package/dist/{breadcrumbs-ybOBe_op.js → breadcrumbs-qyZMkJtA.js} +1 -1
- package/dist/{button-ChdHZYBF.js → button-Cf5ReNPj.js} +22 -25
- package/dist/button-DMytp-Jt.cjs +32 -0
- package/dist/{calendar-BQCjUQvP.js → calendar-D5xCL3xC.js} +1 -1
- package/dist/{calendar-CFTrX0C5.cjs → calendar-xmCeJYlb.cjs} +1 -1
- package/dist/{card-COseC8ZL.cjs → card-Dc9p91TY.cjs} +1 -1
- package/dist/{card-DSTEL8Kv.js → card-k-3UP5NP.js} +3 -3
- package/dist/{checkbox-CKYNnLDh.js → checkbox-C4faOikK.js} +1 -1
- package/dist/{checkbox-DkFswqr-.cjs → checkbox-CbogvdEA.cjs} +1 -1
- package/dist/{checkbox-group-1ghi5uHp.js → checkbox-group-6vOqwCRi.js} +2 -2
- package/dist/{checkbox-group-lcxR3cYR.cjs → checkbox-group-YyhtneCi.cjs} +1 -1
- package/dist/{combobox-iXYiaWbN.js → combobox-D0J03ikb.js} +6 -6
- package/dist/{combobox-CaWnlvTX.cjs → combobox-hbHEJIxp.cjs} +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/textarea.d.ts +17 -1
- package/dist/{consent-BwH89xk_.cjs → consent-BCrPGLXe.cjs} +1 -1
- package/dist/{consent-DiD0iQ5h.js → consent-hhwIP8m5.js} +1 -1
- package/dist/{datepicker-Da8SfyVG.cjs → datepicker-BSQV2yhB.cjs} +3 -3
- package/dist/{datepicker-DTcow1ih.js → datepicker-ChGCD7Gf.js} +134 -137
- package/dist/{element-with-slot-C0bH0T0H.js → element-with-slot-BP-IBGq0.js} +107 -108
- package/dist/element-with-slot-gdQbNteD.cjs +1 -0
- package/dist/{fileupload-Cb1c7ul0.cjs → fileupload-BKae4SiP.cjs} +1 -1
- package/dist/{fileupload-BNAQ9tNR.js → fileupload-CAZrdubx.js} +5 -5
- package/dist/{footer-BOwcLSsz.js → footer-JAQGiWJh.js} +2 -2
- package/dist/{footer-Cl_Da5Iq.cjs → footer-wmH_UXCd.cjs} +1 -1
- package/dist/{header-CvER8wo6.cjs → header-CB-CiwsK.cjs} +1 -1
- package/dist/{header-Cwr995oK.js → header-bvY1RA0W.js} +7 -7
- package/dist/{header-menu-CsL4DZE2.js → header-menu-BJNxDdhj.js} +2 -2
- package/dist/{header-menu-D-wOwG1V.cjs → header-menu-BlvU5Y1U.cjs} +1 -1
- package/dist/{heading-DhTyaJms.js → heading-Br5s4zO0.js} +1 -1
- package/dist/{heading-D4Kkb6-N.cjs → heading-CBxJ3UCj.cjs} +1 -1
- package/dist/{helptext-p0nwJsyf.cjs → helptext-5_uOsEMN.cjs} +1 -1
- package/dist/{helptext-DN0jjgVu.js → helptext-B6xxUfvv.js} +2 -2
- package/dist/{icon-CLMJYuTL.js → icon-D3XT49vM.js} +7 -1
- package/dist/icon-Dk8y6odR.cjs +1 -0
- package/dist/{input-element-BOi7rBbw.cjs → input-element-CCV_e85v.cjs} +1 -1
- package/dist/{input-element-0yYtRu0p.js → input-element-DhNSPDnG.js} +1 -1
- package/dist/{input-wrapper-BSjQc4Vx.js → input-wrapper-D-w6uRXZ.js} +4 -4
- package/dist/{input-wrapper-4PTk8aX3.cjs → input-wrapper-D1RqTzm4.cjs} +1 -1
- package/dist/{link-Dj6SbcaD.cjs → link-DW6O3Ko1.cjs} +1 -1
- package/dist/{link-39EvU2ng.js → link-DzWPIXm1.js} +2 -2
- package/dist/{linkcard-K9vvKg1u.js → linkcard-Dda2K5te.js} +2 -2
- package/dist/{linkcard-BoQIfci8.cjs → linkcard-EOwwQZeY.cjs} +1 -1
- package/dist/{loader-BRYL5kTN.cjs → loader-CnsELZFa.cjs} +1 -1
- package/dist/{loader-MoI2VRFr.js → loader-DXKGCBqh.js} +2 -2
- package/dist/{messagebox-CiOQUt0C.cjs → messagebox-CIgUgKhu.cjs} +1 -1
- package/dist/{messagebox-Dr-k3pnZ.js → messagebox-DPVRQ3PY.js} +2 -2
- package/dist/{modal-DbzEnZNF.js → modal-BWaMErv7.js} +2 -2
- package/dist/{modal-DGiq84MG.cjs → modal-Cp10a22a.cjs} +1 -1
- package/dist/{option-group-element-CH0sgVIl.cjs → option-group-element-D_UW097C.cjs} +1 -1
- package/dist/{option-group-element-DC364Rw_.js → option-group-element-d9TouZ2M.js} +2 -2
- 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-group.cjs +1 -1
- package/dist/pkt-checkbox-group.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 +36 -36
- 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-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-D1sKTkbR.cjs → pkt-options-controller-DcwERZzm.cjs} +1 -1
- package/dist/{pkt-options-controller-BikFfGcZ.js → pkt-options-controller-LiApNBoZ.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radio-group.cjs +1 -1
- package/dist/pkt-radio-group.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-t0zgEke0.js → progressbar-CMwFXEMB.js} +1 -1
- package/dist/{progressbar-CnX4fFfR.cjs → progressbar-eRJU41Uc.cjs} +1 -1
- package/dist/{radio-group-DJikniZi.js → radio-group-B_NEwwP7.js} +2 -2
- package/dist/{radio-group-XCYKqoLD.cjs → radio-group-dQrEQ1pX.cjs} +1 -1
- package/dist/{radiobutton-PYQKVnNQ.js → radiobutton-DWZ4VgYg.js} +1 -1
- package/dist/{radiobutton-DgkML7sd.cjs → radiobutton-mXqSvSQE.cjs} +1 -1
- package/dist/{searchinput-Mdc9Ihld.cjs → searchinput-CVpPmZAJ.cjs} +1 -1
- package/dist/{searchinput-BzYifHBf.js → searchinput-Ca6zFqH5.js} +1 -1
- package/dist/{select-CorofYxz.js → select-DhQk3S6t.js} +4 -4
- package/dist/{select-D8TC1msV.cjs → select-DkO-UPUY.cjs} +1 -1
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/shared-types/textarea.d.ts +67 -0
- package/dist/{tabs-B63J6MXb.cjs → tabs-DvVYDYVh.cjs} +1 -1
- package/dist/{tabs-DDakCTkY.js → tabs-Y2-2pD42.js} +2 -2
- package/dist/{tag-BPvGZcKf.js → tag-B9GawuIf.js} +2 -2
- package/dist/{tag-6IPe9bwQ.cjs → tag-BEFxzKsm.cjs} +1 -1
- package/dist/textarea-CEHqACey.cjs +50 -0
- package/dist/{textarea-BZCUHjEj.js → textarea-S0pRMEnT.js} +25 -13
- package/dist/{textinput-BZPGcxZV.cjs → textinput-BdQ3FZ8R.cjs} +1 -1
- package/dist/{textinput-D_oEaI41.js → textinput-DkfjnDvX.js} +4 -4
- package/dist/{timepicker-C0d92R8u.cjs → timepicker-BssDur6k.cjs} +1 -1
- package/dist/{timepicker-JBOeZg-7.js → timepicker-DI3oiK4L.js} +4 -4
- package/package.json +14 -15
- package/src/components/icon/icon.test.ts +21 -0
- package/src/components/icon/icon.ts +7 -2
- package/src/components/index.ts +1 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea.ts +34 -2
- package/dist/button-Ca_V13cQ.cjs +0 -32
- package/dist/element-with-slot-DkyaNnm0.cjs +0 -1
- package/dist/icon-jPhyZD1z.cjs +0 -1
- package/dist/textarea-BiCZBjOe.cjs +0 -50
|
@@ -11,14 +11,46 @@ import '@/components/input-wrapper'
|
|
|
11
11
|
import '@/components/icon'
|
|
12
12
|
import { ElementProps } from '@/types/typeUtils'
|
|
13
13
|
import { describedByIds } from 'shared-utils/forms/described-by'
|
|
14
|
+
import { TEXTAREA_DEFAULTS, type Booleanish, type IPktTextareaBase } from 'shared-types'
|
|
14
15
|
|
|
15
16
|
type Props = ElementProps<PktTextarea, 'autocomplete' | 'rows' | 'cols'>
|
|
16
17
|
|
|
17
|
-
export
|
|
18
|
+
export interface IPktTextarea extends Omit<
|
|
19
|
+
IPktTextareaBase,
|
|
20
|
+
| 'form'
|
|
21
|
+
| 'label'
|
|
22
|
+
| 'placeholder'
|
|
23
|
+
| 'rows'
|
|
24
|
+
| 'cols'
|
|
25
|
+
| 'minLength'
|
|
26
|
+
| 'maxLength'
|
|
27
|
+
| 'readOnly'
|
|
28
|
+
| 'autoComplete'
|
|
29
|
+
| 'ariaDescribedby'
|
|
30
|
+
| 'ariaLabelledby'
|
|
31
|
+
| 'helptextDropdownButton'
|
|
32
|
+
| 'useWrapper'
|
|
33
|
+
> {
|
|
34
|
+
label?: string | null
|
|
35
|
+
placeholder?: string | null
|
|
36
|
+
rows?: number | null
|
|
37
|
+
cols?: number | null
|
|
38
|
+
minlength?: number | null
|
|
39
|
+
maxlength?: number | null
|
|
40
|
+
readonly?: boolean
|
|
41
|
+
autocomplete?: string
|
|
42
|
+
ariaDescribedby?: string | null
|
|
43
|
+
ariaLabelledby?: string | null
|
|
44
|
+
/** @deprecated Bruk `strings={{ forms: { readMore: '…' } }}` eller `setPktStrings()`. */
|
|
45
|
+
helptextDropdownButton?: string | null
|
|
46
|
+
useWrapper?: Booleanish
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class PktTextarea extends PktInputElement<Props> implements IPktTextarea {
|
|
18
50
|
inputRef: Ref<HTMLTextAreaElement> = createRef()
|
|
19
51
|
|
|
20
52
|
@property({ type: String, reflect: true }) value: string = ''
|
|
21
|
-
@property({ type: String }) autocomplete: string =
|
|
53
|
+
@property({ type: String }) autocomplete: string = TEXTAREA_DEFAULTS.autoComplete
|
|
22
54
|
@property({ type: Number }) rows: number | null = null
|
|
23
55
|
@property({ type: Number }) cols: number | null = null
|
|
24
56
|
|
package/dist/button-Ca_V13cQ.cjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs");const r=require("./if-defined-CiML3MTM.cjs");var i=`https://punkt-cdn.oslo.kommune.no/latest/animations/`;typeof window<`u`&&(window.pktAnimationPath=window.pktAnimationPath||i);var a=class a extends n.t{constructor(...e){super(...e),this.iconName=`user`,this.secondIconName=`user`,this.size=`medium`,this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin=`primary`,this.variant=`label-only`,this.state=void 0,this.type=`button`,this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=typeof window<`u`?window.pktAnimationPath:i,this.relocatedAria={}}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener(`keydown`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}static{this.relocatedAriaAttributes=[`aria-haspopup`,`aria-expanded`,`aria-controls`,`aria-label`,`tabindex`]}willUpdate(e){super.willUpdate(e);let t=!1,n={...this.relocatedAria};for(let e of a.relocatedAriaAttributes){let r=this.getAttribute(e);r!==null&&(n[e]=r,this.removeAttribute(e),t=!0)}t&&(this.relocatedAria=n)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let i=this.form??this.getAttribute(`form`)??void 0,a={"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--isLoading":!!this.isLoading};return e._`
|
|
2
|
-
<button
|
|
3
|
-
class=${t.t(a)}
|
|
4
|
-
type=${this.type}
|
|
5
|
-
?disabled=${!!this.disabled}
|
|
6
|
-
aria-busy=${r.t(this.isLoading?`true`:void 0)}
|
|
7
|
-
aria-disabled=${r.t(this.disabled||this.isLoading?`true`:void 0)}
|
|
8
|
-
aria-haspopup=${r.t(this.relocatedAria[`aria-haspopup`])}
|
|
9
|
-
aria-expanded=${r.t(this.relocatedAria[`aria-expanded`])}
|
|
10
|
-
aria-controls=${r.t(this.relocatedAria[`aria-controls`])}
|
|
11
|
-
aria-label=${r.t(this.relocatedAria[`aria-label`])}
|
|
12
|
-
tabindex=${r.t(this.relocatedAria.tabindex)}
|
|
13
|
-
form=${r.t(i)}
|
|
14
|
-
>
|
|
15
|
-
${this.isLoading?e._`<pkt-icon
|
|
16
|
-
class="pkt-btn__icon pkt-btn__spinner"
|
|
17
|
-
name="spinner-blue"
|
|
18
|
-
path=${r.t(this.loadingAnimationPath)}
|
|
19
|
-
></pkt-icon>`:e.h}
|
|
20
|
-
${this.variant===`label-only`?e.h:e._`<pkt-icon
|
|
21
|
-
class="pkt-btn__icon pkt-icon"
|
|
22
|
-
name=${this.iconName}
|
|
23
|
-
path=${r.t(this.iconPath)}
|
|
24
|
-
></pkt-icon>`}
|
|
25
|
-
<span class="pkt-btn__text">${n.i(this)}</span>
|
|
26
|
-
${this.variant===`icons-right-and-left`?e._`<pkt-icon
|
|
27
|
-
class="pkt-btn__icon"
|
|
28
|
-
name=${this.secondIconName}
|
|
29
|
-
path=${r.t(this.secondIconPath)}
|
|
30
|
-
></pkt-icon>`:e.h}
|
|
31
|
-
</button>
|
|
32
|
-
`}};e.n([e.u({type:String})],a.prototype,`iconName`,void 0),e.n([e.u({type:String})],a.prototype,`secondIconName`,void 0),e.n([e.u({type:String})],a.prototype,`iconPath`,void 0),e.n([e.u({type:String})],a.prototype,`secondIconPath`,void 0),e.n([e.u({type:String})],a.prototype,`size`,void 0),e.n([e.u({type:Boolean,attribute:`full-width`})],a.prototype,`fullWidth`,void 0),e.n([e.u({type:Boolean,attribute:`full-width-on-mobile`})],a.prototype,`fullWidthOnMobile`,void 0),e.n([e.u({type:String})],a.prototype,`color`,void 0),e.n([e.u({type:String})],a.prototype,`skin`,void 0),e.n([e.u({type:String})],a.prototype,`variant`,void 0),e.n([e.u({type:String,reflect:!0})],a.prototype,`state`,void 0),e.n([e.u({type:String,reflect:!0})],a.prototype,`type`,void 0),e.n([e.u({type:String})],a.prototype,`form`,void 0),e.n([e.u({type:Boolean,reflect:!0})],a.prototype,`isLoading`,void 0),e.n([e.u({type:Boolean,reflect:!0})],a.prototype,`disabled`,void 0),e.n([e.u({type:String})],a.prototype,`loadingAnimationPath`,void 0),e.n([e.l()],a.prototype,`relocatedAria`,void 0);try{e.d(`pkt-button`)(a)}catch{console.warn(`Forsøker å definere <pkt-button>, 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 +0,0 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./async-directive-DpyKp6qv.cjs");function n(e){return e.classList&&(e.classList.contains(`_dialog_overlay`)||e.classList.contains(`backdrop`))?!0:typeof e.hasAttribute==`function`&&e.hasAttribute(`data-skip`)}function r(e){return e.nodeName===`OPTION`||e.nodeName===`DATA`}function i(e){return e.nodeType===Node.TEXT_NODE&&e.nodeValue?.trim()!==``}var a=new WeakMap,o=new WeakMap,s=new WeakSet;function c(e){let t=a.get(e);return t||(t=new w(e),a.set(e,t)),t}var l=Symbol(`default`);function u(e){return e===void 0?l:e}function d(e){if(e.nodeType!==Node.ELEMENT_NODE)return l;let t=e.getAttribute(`slot`);return t===null?l:u(t)}function f(e){return Array.isArray(e)?e.map(e=>{let t=e===null?l:e;return[t,t]}):Object.entries(e).map(([e,t])=>[e,t===null?l:t])}function p(e,t){return e.length===t.length&&e.every(([e,n],r)=>t[r][0]===e&&t[r][1]===n)}function m(e){if(e.nodeType===Node.TEXT_NODE)return i(e);if(e.nodeType!==Node.ELEMENT_NODE)return!1;let t=e;return!n(t)&&!r(t)}function h(e){return e.nodeType===Node.TEXT_NODE&&!!e.nodeValue&&!i(e)}function g(e,t){if(!m(e))return!1;if(e instanceof HTMLTemplateElement){let n=d(e);for(let r of Array.from(e.content.childNodes))_(t,n,r)}else _(t,d(e),e);return!0}function _(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function v(e,t,n){Node.prototype.insertBefore.call(e,t,n)}function y(e){e.parentNode&&Node.prototype.removeChild.call(e.parentNode,e)}function b(e){return Object.getOwnPropertyDescriptor(Node.prototype,`nextSibling`).get.call(e)}function x(e,t){return e.node.compareDocumentPosition(t.node)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function S(e){if(e.nodeType!==Node.TEXT_NODE||Object.prototype.hasOwnProperty.call(e,`data`))return;let t=e,n={data:Object.getOwnPropertyDescriptor(CharacterData.prototype,`data`),nodeValue:Object.getOwnPropertyDescriptor(Node.prototype,`nodeValue`)};for(let[e,r]of Object.entries(n))r?.get&&r.set&&Object.defineProperty(t,e,{configurable:!0,get:()=>r.get.call(t),set:e=>{r.set.call(t,e),C(t)}})}function C(e){let t=o.get(e);if(t){i(e)||t.releaseText(e);return}let n=e.parentNode&&a.get(e.parentNode);n&&(i(e)?n.adoptText(e):n.blankTextChanged(e))}var w=class e{static{this.PLACEHOLDER_PREFIX=`pkt-slot`}constructor(e){this.nodesBySlot=new Map,this.trackedNodes=new Set,this.placeholderToNode=new Map,this.nodeToPlaceholder=new Map,this.mirrorOf=new Map,this.hasWhitespace=!1,this.contentBounds=null,this.changedWhitespace=new Set,this.directives=new Set,this.sources=new Map,this.subscribers=new Set,this.generation=0,this.initialCollectionDone=!1,this.inOwnChange=!1,this.rendering=!1,this.contentEnd=null,this.rootMarker=null,this.observer=null,this.observing=!1,this.wantsObserver=!1,this.followsHostRenders=!1,this.host=e,typeof e.addController==`function`&&(this.followsHostRenders=!0,e.addController({hostConnected:()=>{if(!this.wantsObserver)return;let e=!this.observing;this.startObserving(),e&&this.resync()},hostDisconnected:()=>this.stopObservingIfUnused(),hostUpdate:()=>{e.hasUpdated||this.collectLateChildren(),this.flushMutations(!1),e.hasUpdated||this.insertContentEnd(),this.rendering=!0,queueMicrotask(()=>{this.rendering=!1})},hostUpdated:()=>{this.rendering=!1,!this.rootMarker&&this.contentEnd?.parentNode===e&&(this.rootMarker=b(this.contentEnd)),this.flushMutations(!0)}}))}collectNodes(){if(this.initialCollectionDone)return;this.initialCollectionDone=!0,this.generation++;let e=Array.from(this.host.childNodes);for(let t of e)this.watchHostText(t),g(t,this.nodesBySlot)&&this.track(t);this.syncWhitespace()}collectLateChildren(){if(this.initialCollectionDone){for(let e of Array.from(this.host.childNodes))this.trackedNodes.has(e)||this.placeholderToNode.has(e)||(this.watchHostText(e),m(e)&&(this.addContent(e),this.generation++));this.syncWhitespace()}}addDirective(e){this.directives.add(e),this.startObserving()}removeDirective(e){this.directives.delete(e),this.stopObservingIfUnused()}addSource(e,t,n){let r=this.sources.get(e);r&&r.manager===t&&p(r.mapping,n)||(r&&r.manager!==t&&this.detachFrom(r.manager,e),this.sources.set(e,{manager:t,mapping:n}),t.subscribers.add(this),t.startObserving(),this.handleChange())}removeSource(e){let t=this.sources.get(e);t&&(this.sources.delete(e),this.detachFrom(t.manager,e),this.handleChange())}detachFrom(e,t){[...this.sources.entries()].some(([n,r])=>n!==t&&r.manager===e)||(e.subscribers.delete(this),e.stopObservingIfUnused())}reachableParts(e=new Set){if(e.has(this))return[];e.add(this);let t=[...this.directives];for(let n of this.subscribers)t.push(...n.reachableParts(e));return t}getNodes(e){return this.placementNodes(e).filter(e=>!s.has(e))}placementNodes(e){return this.nodesFor(u(e))}hasContent(e){return this.getNodes(e).length>0}nodesFor(e){let t=this.nodesBySlot.get(e)??[];if(this.sources.size===0)return t;let n=[];for(let{manager:t,mapping:r}of this.sources.values())for(let[i,a]of r)a===e&&n.push(...t.nodesFor(i));return n.length?[...t,...n]:t}ensurePlaceholder(e){if(this.nodeToPlaceholder.has(e))return;if(e.parentNode!==this.host){for(let{manager:t}of this.sources.values())t.ensurePlaceholder(e);return}let t=this.isInTemplate(e)?this.getContentEnd():e;v(this.host,this.createPlaceholder(e),t)}createPlaceholder(t){let n=document.createComment(e.PLACEHOLDER_PREFIX);if(t.nodeType===Node.TEXT_NODE){let e=t;Object.defineProperty(n,"data",{configurable:!0,get:()=>e.data,set:t=>{e.data=t}})}return this.placeholderToNode.set(n,t),this.nodeToPlaceholder.set(t,n),n}forgetPlaceholder(e){let t=this.nodeToPlaceholder.get(e);return t&&(this.placeholderToNode.delete(t),this.nodeToPlaceholder.delete(e)),t}placeholderOf(e){return this.trackedNodes.has(e)?this.nodeToPlaceholder.get(e):void 0}handleNow(e){if(this.rendering)return e();this.flushMutations(!1);let t=e();return this.flushMutations(!1),t}positionInHost(e){if(!e||e.parentNode===this.host)return this.rendering||e&&!this.isInTemplate(e)?e:this.getContentEnd()??e;if(this.trackedNodes.has(e))return this.nodeToPlaceholder.get(e)??e;for(let t=e.previousSibling;t;t=t.previousSibling){let e=this.placeholderOf(t);if(e)return e.nextSibling}for(let t=e.nextSibling;t;t=t.nextSibling){let e=this.placeholderOf(t);if(e)return e}return this.reachableParts().some(t=>t.parentOfPart()===e.parentNode)?this.getContentEnd():e}owns(e){return this.trackedNodes.has(e)}moveDistributed(e,t){let n=this.nodeToPlaceholder.get(e);if(this.rendering||!n||!this.trackedNodes.has(e)||!e.parentNode||e.parentNode===this.host)return!1;this.flushMutations(!1);let r=this.positionInHost(t);if(r===n||r===e)return!0;if(r&&r.parentNode!==this.host)return!1;let i=d(e),a=this.nodesBySlot.get(i);if(!a||!a.includes(e))return!1;let o=null;for(let t=r;t&&!o;t=t.nextSibling){let n=this.placeholderToNode.get(t)??t;if(n!==e&&this.trackedNodes.has(n)){if(n instanceof HTMLTemplateElement)return!1;d(n)===i&&(o=n)}}let s=a[a.length-1]===e?a[a.length-2]:a[a.length-1],c=o??s;return c&&(!c.parentNode||c.parentNode===this.host)?!1:(this.asOwnChange(()=>{v(this.host,n,r),a.splice(a.indexOf(e),1),a.splice(o?a.indexOf(o):a.length,0,e),o?v(o.parentNode,e,o):s&&v(s.parentNode,e,s.nextSibling),this.handleChange()}),!0)}replaceContent(e){if(!this.initialCollectionDone)return!1;let t=e.flatMap(e=>e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Array.from(e.childNodes):[e]);if(t.some(e=>e.contains(this.host)))return!1;this.flushMutations(!1);let n=this.getContentEnd();return n?(this.asOwnChange(()=>{let e=new Set(this.trackedNodes);for(let t of this.nodesBySlot.values())t.forEach(t=>e.add(t));for(let t of e){let e=this.forgetPlaceholder(t);e&&y(e),y(t),this.untrack(t)}for(this.nodesBySlot.clear(),this.mirrorOf.clear(),this.contentBounds=null;n.previousSibling;)y(n.previousSibling);let r=document.createDocumentFragment();r.append(...t),v(this.host,r,n);for(let e of t)this.watchHostText(e),m(e)&&this.addContent(e);this.handleChange()}),!0):!1}adoptText(e){this.initialCollectionDone&&!this.trackedNodes.has(e)&&(e.parentNode!==this.host||this.isInTemplate(e)||(this.flushMutations(!1),this.asOwnChange(()=>{this.dropMirror(e),this.insertInSlotOrder(e),this.track(e),this.handleChange()})))}blankTextChanged(e){let t=this.mirrorOf.get(e);t&&(t.data=e.data,e.data)||this.initialCollectionDone&&(e.parentNode!==this.host||this.isInTemplate(e)||(this.watchHostText(e),this.changedWhitespace.add(e),this.flushMutations(!1),this.asOwnChange(()=>this.handleChange())))}releaseText(e){if(this.flushMutations(!1),!this.trackedNodes.has(e))return;let t=this.nodeToPlaceholder.get(e);(t?t.parentNode===this.host:e.parentNode===this.host)&&this.asOwnChange(()=>{t&&(this.forgetPlaceholder(e),Node.prototype.replaceChild.call(this.host,e,t)),this.removeContent(e),this.watchHostText(e),this.handleChange()})}watchHostText(e){S(e),h(e)&&(this.hasWhitespace=!0,this.changedWhitespace.add(e))}syncWhitespace(){if(!this.hasWhitespace)return;let e=this.findContentBounds(),t=this.contentBounds,n=this.changedWhitespace;if(this.contentBounds=e,this.changedWhitespace=new Set,!e)for(let e of[...this.mirrorOf.keys()])this.dropMirror(e);else{if(this.dropMirrorsOutside(),!t)this.collectBlankBetween(e.firstAt,e.lastAt,n);else{if(t.first!==e.first){let r=this.placeOf(t.first);r&&this.precedes(e.firstAt,r)?this.collectBlankBetween(e.firstAt,r,n):this.collectBlankBeside(e.firstAt,`nextSibling`,n)}if(t.last!==e.last){let r=this.placeOf(t.last);r&&this.precedes(r,e.lastAt)?this.collectBlankBetween(r,e.lastAt,n):this.collectBlankBeside(e.lastAt,`previousSibling`,n)}}for(let t of n)t.parentNode===this.host&&h(t)&&this.isBetween(t,e)?this.addMirror(t):this.dropMirror(t)}}dropMirrorsOutside(){let e=this.nodesBySlot.get(l)??[],t=[],n=e=>{if(s.has(e))t.push(this.nodeToPlaceholder.get(e));else if(this.placeOf(e))return!1;return!0};for(let t=0;t<e.length&&n(e[t]);t++);for(let t=e.length-1;t>=0&&n(e[t]);t--);t.forEach(e=>this.dropMirror(e))}precedes(e,t){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)}collectBlankBeside(e,t,n){for(let r=e[t];r;r=r[t]){if(h(r)){n.add(r);continue}let e=this.placeholderToNode.get(r)??r;if(!s.has(e)&&this.trackedNodes.has(e))return}}findContentBounds(){let e=this.nodesBySlot.get(l)??[],t=e=>s.has(e)?null:this.placeOf(e),n,r=null,i,a=null;for(let i=0;i<e.length&&!r;i++)[n,r]=[e[i],t(e[i])];for(let n=e.length-1;n>=0&&!a;n--)[i,a]=[e[n],t(e[n])];return n&&i&&r&&a?{first:n,last:i,firstAt:r,lastAt:a}:null}placeOf(e){if(!this.trackedNodes.has(e))return null;let t=this.nodeToPlaceholder.get(e)??e;return t.parentNode===this.host?t:null}isBetween(e,{firstAt:t,lastAt:n}){return this.precedes(t,e)&&this.precedes(e,n)}collectBlankBetween(e,t,n){if(e===t)return;let[r,i]=this.precedes(e,t)?[e,t]:[t,e];for(let e=r.nextSibling;e&&e!==i;e=e.nextSibling)h(e)&&n.add(e)}addMirror(e){if(this.mirrorOf.has(e))return;let t=document.createTextNode(e.data);s.add(t),this.mirrorOf.set(e,t),this.placeholderToNode.set(e,t),this.nodeToPlaceholder.set(t,e),this.insertInSlotOrder(t)}dropMirror(e){let t=this.mirrorOf.get(e);t&&(this.mirrorOf.delete(e),this.forgetPlaceholder(t),y(t),this.removeFromSlots(t))}insertContentEnd(){this.contentEnd||(this.contentEnd=document.createComment(``),Object.defineProperty(this.contentEnd,"nextSibling",{configurable:!0,get:()=>null})),this.contentEnd.parentNode!==this.host&&v(this.host,this.contentEnd,null)}getContentEnd(){let e=this.contentEnd;return e?(e.parentNode!==this.host&&this.rootMarker?.parentNode===this.host&&v(this.host,e,this.rootMarker),e.parentNode===this.host?e:null):null}isInTemplate(e){let t=this.getContentEnd();return!t||e.parentNode!==this.host?!1:e===t||!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)}startObserving(){if(this.wantsObserver=!0,this.observing)return;this.observing=!0;let e=()=>{this.observing&&typeof MutationObserver<`u`&&(this.observer=new MutationObserver(e=>{this.handleMutations(e)}),this.observer.observe(this.host,{childList:!0,subtree:!0}))};this.followsHostRenders?e():setTimeout(e,0)}stopObserving(){this.observing&&(this.observing=!1,this.observer?.disconnect(),this.observer=null)}stopObservingIfUnused(){let e=this.directives.size===0&&this.subscribers.size===0;(!this.host.isConnected||e&&!this.followsHostRenders)&&this.stopObserving()}flushMutations(e){if(this.inOwnChange)return;let t=this.observer?.takeRecords();t?.length&&this.handleMutations(t,e)}handleMutations(e,t=!1){this.inOwnChange||this.asOwnChange(()=>this.applyMutations(e,t))}applyMutations(e,t){let n=!1,r=[],i=new Map,a=[];for(let o of e){for(let e of o.removedNodes){let a=this.placeholderToNode.get(e);if(a&&e.parentNode===this.host)t||(this.removeFromSlots(a),this.insertInSlotOrder(a),y(a),s.has(a)&&this.changedWhitespace.add(e),n=!0);else if(a){if(this.placeholderToNode.delete(e),this.nodeToPlaceholder.delete(a),s.has(a)&&this.mirrorOf.delete(e),t)continue;y(a),this.removeContent(a),n=!0}else if(this.trackedNodes.has(e)&&!this.host.contains(e)&&!t){this.removeContent(e);let t=this.forgetPlaceholder(e);if(t&&(r.push(t),o.target!==this.host)){let e=i.get(o.target)??[];e.push(t),i.set(o.target,e)}n=!0}}if(o.target!==this.host)o.addedNodes.length&&a.push(o);else if(!t){for(let e of o.addedNodes)if(!this.placeholderToNode.has(e)){if(this.trackedNodes.has(e)&&e.parentNode===this.host){let t=this.forgetPlaceholder(e);t&&y(t),this.removeFromSlots(e),this.insertInSlotOrder(e),n=!0}else!this.trackedNodes.has(e)&&m(e)?(this.addContent(e),n=!0):(this.watchHostText(e),h(e)&&(n=!0))}}}i.size&&this.adoptNodesInParts(a,i)&&(n=!0);for(let e of r)y(e);this.getContentEnd(),n&&this.handleChange()}adoptNodesInParts(e,t){let n=new Set;for(let r of e)t.has(r.target)&&r.addedNodes.forEach(e=>n.add(e));if(n.size===0)return!1;let r=this.reachableParts(),i=[];for(let e of n){if(!e.parentNode||!t.has(e.parentNode)||o.has(e)||s.has(e)||this.placeholderToNode.has(e))continue;let n=r.find(t=>t.contains(e));if(!n)continue;let a=this.hostPositionFor(e,n,t);a&&i.push({node:e,before:a.before})}if(i.length===0)return!1;let a=!1;for(let{node:e,before:t}of i.sort(x))m(e)&&!(e instanceof HTMLTemplateElement)?(v(this.host,this.createPlaceholder(e),t),this.insertInSlotOrder(e),this.track(e),a=!0):v(this.host,e,t);return a}hostPositionFor(e,t,n){let{startNode:r,endNode:i}=t.bounds();for(let t=e.nextSibling;t&&t!==i;t=t.nextSibling){let e=this.placeholderOf(t);if(e)return{before:e}}for(let t=e.previousSibling;t&&t!==r;t=t.previousSibling){let e=this.placeholderOf(t);if(e)return{before:e.nextSibling}}let a=e.parentNode?n.get(e.parentNode):void 0;return a?{before:a[0]}:null}resync(){this.asOwnChange(()=>{let e=!1;for(let t of[...this.trackedNodes]){let n=this.nodeToPlaceholder.get(t),r=this.host.contains(t);(!r||n&&n.parentNode!==this.host)&&(n&&y(this.forgetPlaceholder(t)),r&&y(t),this.removeContent(t),e=!0)}let t=this.getContentEnd();for(let n=t?this.host.firstChild:null;n&&n!==t;n=n.nextSibling)this.trackedNodes.has(n)||this.placeholderToNode.has(n)||(this.watchHostText(n),m(n)&&(this.addContent(n),e=!0));this.syncWhitespace(),this.sortSlots()&&(e=!0),e&&this.handleChange()})}sortSlots(){let e=!1;for(let t of this.nodesBySlot.values()){if(!t.every(e=>this.nodeToPlaceholder.has(e)))continue;let n=t.map(e=>({node:this.nodeToPlaceholder.get(e),real:e})).sort(x).map(({real:e})=>e);n.every((e,n)=>e===t[n])||(t.splice(0,t.length,...n),n.forEach(y),e=!0)}return e}handleChange(){this.syncWhitespace(),this.generation++,this.notifyDirectives();for(let e of this.subscribers)e.handleChange();this.host.requestUpdate()}notifyDirectives(){for(let e of this.directives)e.handleNodesChanged()}asOwnChange(e){let t=this.inOwnChange;this.inOwnChange=!0;try{e()}finally{t||(this.observer?.takeRecords(),this.inOwnChange=!1)}}addContent(e){e instanceof HTMLTemplateElement?g(e,this.nodesBySlot):this.insertInSlotOrder(e),this.track(e)}removeContent(e){this.untrack(e),this.removeFromSlots(e)}track(e){this.trackedNodes.add(e),o.set(e,this),S(e)}untrack(e){this.trackedNodes.delete(e),o.get(e)===this&&o.delete(e)}insertInSlotOrder(e){let t=d(e),n=this.nodesBySlot.get(t)??[];this.nodesBySlot.set(t,n);let r=this.nodeToPlaceholder.get(e)??e,i=e=>{let t=this.nodeToPlaceholder.get(e)??e;return!!(r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)},a=n.length;for(;a>0&&i(n[a-1]);)a--;n.splice(a,0,e)}removeFromSlots(e){for(let[t,n]of this.nodesBySlot){let r=n.indexOf(e);if(r!==-1){n.splice(r,1),n.length===0&&this.nodesBySlot.delete(t);return}}}},T=class extends t.t{constructor(t){if(super(t),this.manager=null,this.host=null,this.part=null,this.lastGeneration=-1,t.type!==e.m.CHILD)throw Error(`slotContent() can only be used in child expressions`)}render(t,n){return e.g}update(t,[n,r]){return this.part=t,this.host=n,this.slotName=r,this.manager||(this.manager=c(n),this.manager.collectNodes(),this.manager.addDirective(this)),this.placeNodes(),e.g}handleNodesChanged(){this.isConnected&&this.manager&&this.placeNodes()}disconnected(){this.manager?.removeDirective(this),this.manager=null,this.lastGeneration=-1}reconnected(){this.host&&(this.manager=c(this.host),this.manager.addDirective(this),this.placeNodes())}contains(e){let t=this.parentOfPart();return!this.isConnected||!t?!1:this.isInsidePart(e,t,this.coversContainer(t))}bounds(){return{startNode:this.part?.startNode??null,endNode:this.part?.endNode??null}}parentOfPart(){return this.part?this.part.startNode?this.part.startNode.parentNode:this.part.parentNode:null}placeNodes(){if(!this.manager||!this.part)return;let e=this.manager.generation;if(e===this.lastGeneration)return;this.lastGeneration=e;let t=this.parentOfPart();if(!t)return;let n=this.manager.placementNodes(this.slotName),r=this.coversContainer(t),i=this.part.endNode;for(let e=n.length-1;e>=0;e--){let a=n[e];this.isInsidePart(a,t,r)||(this.manager.ensurePlaceholder(a),v(t,a,i)),i=a}}coversContainer(e){let{startNode:t,endNode:n}=this.part;return!n&&(!t||t===e.firstChild)}isInsidePart(e,t,n){if(!this.part||e.parentNode!==t)return!1;if(n)return!0;let{startNode:r,endNode:i}=this.part,a=!r||!!(r.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING),o=!i||!!(e.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING);return a&&o}},E=e.f(T),D=class extends t.t{constructor(t){if(super(t),this.target=null,this.source=null,this.mapping=[],t.type!==e.m.ELEMENT)throw Error(`forwardSlots() can only be used as an element directive`)}render(t,n){return e.g}update(t,[n,r]){let i=c(t.element);return this.target&&this.target!==i&&this.target.removeSource(this),this.target=i,this.source=c(n),this.source.collectNodes(),this.mapping=f(r),this.target.addSource(this,this.source,this.mapping),e.g}disconnected(){this.target?.removeSource(this)}reconnected(){this.target&&this.source&&this.target.addSource(this,this.source,this.mapping)}},O=e.f(D),k=new Map;function A(e){if(k.has(e))return k.get(e);let t,n=HTMLElement.prototype;for(;!t&&n;)t=Object.getOwnPropertyDescriptor(n,e),n=Object.getPrototypeOf(n);return k.set(e,t),t}function j(e,t){return t.some(t=>typeof t!=`string`&&t.contains(e))}var M=class extends e.t{connectedCallback(){c(this).collectNodes(),super.connectedCallback()}hasSlotContent(e){return c(this).hasContent(e)}appendChild(e){let t=c(this);return t.moveDistributed(e,null)?e:t.handleNow(()=>super.insertBefore(e,t.positionInHost(null)))}append(...e){if(j(this,e)){super.append(...e);return}let t=c(this);t.handleNow(()=>{let n=document.createDocumentFragment();n.append(...e),super.insertBefore(n,t.positionInHost(null))})}prepend(...e){c(this).handleNow(()=>super.prepend(...e))}insertBefore(e,t){let n=c(this);return n.moveDistributed(e,t)?e:n.handleNow(()=>super.insertBefore(e,n.positionInHost(t)))}removeChild(e){let t=c(this);return e.parentNode===this||!t.owns(e)?super.removeChild(e):t.handleNow(()=>(e.parentNode?.removeChild(e),e))}replaceChild(e,t){let n=c(this);return t.parentNode===this||!n.owns(t)?super.replaceChild(e,t):n.handleNow(()=>(super.insertBefore(e,n.positionInHost(t)),t.parentNode?.removeChild(t),t))}replaceChildren(...e){let t=e.map(e=>typeof e==`string`?document.createTextNode(e):e);c(this).replaceContent(t)||super.replaceChildren(...e)}get textContent(){return A(`textContent`).get.call(this)}set textContent(e){let t=e==null?``:String(e);c(this).replaceContent(t?[document.createTextNode(t)]:[])||A(`textContent`).set.call(this,e)}get innerHTML(){return A(`innerHTML`).get.call(this)}set innerHTML(e){let t=document.createElement(`template`);t.innerHTML=e,c(this).replaceContent(Array.from(t.content.childNodes))||A(`innerHTML`).set.call(this,e)}get innerText(){let e=A(`innerText`);return e?.get?e.get.call(this):this.textContent}set innerText(e){let t=A(`innerText`);if(!t?.set){this.textContent=e;return}let n=document.createElement(`div`);t.set.call(n,e),c(this).replaceContent(Array.from(n.childNodes))||t.set.call(this,e)}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return M}});
|
package/dist/icon-jPhyZD1z.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs");var t={name:``,path:`https://punkt-cdn.oslo.kommune.no/latest/icons/`},n=class extends e.p{constructor(t){if(super(t),this.it=e.h,t.type!==e.m.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(t){if(t===e.h||t==null)return this._t=void 0,this.it=t;if(t===e.g)return t;if(typeof t!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(t===this.it)return this._t;this.it=t;let n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}};n.directiveName=`unsafeHTML`,n.resultType=1;var r=e.f(n),i=class extends n{};i.directiveName=`unsafeSVG`,i.resultType=2;var a=e.f(i);typeof window<`u`&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||t.path);var o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>`,s={},c=2,l=1500,u=typeof Storage<`u`&&typeof sessionStorage<`u`,d=e=>window.pktFetch(e).then(t=>{if(!t.ok)throw Error(`Missing icon: `+e);return t.text()}),f=async(e,t=c)=>{try{return await d(e)}catch{return t>0?(await new Promise(e=>setTimeout(e,l)),f(e,t-1)):(console.error(`Failed to fetch icon: `+e),o)}},p=async(e,t)=>{let n=t+e+`.svg`;return u&&sessionStorage.getItem(n)?sessionStorage.getItem(n):n in s?s[n]:typeof window<`u`&&typeof window.pktFetch==`function`?(s[n]=f(n).then(e=>(e!==o&&u&&sessionStorage.setItem(n,e),delete s[n],e)),s[n]):o},m=class extends e.t{constructor(...e){super(...e),this.path=typeof window<`u`?window.pktIconPath:t.path,this.name=t.name,this.ariaHidden=null,this.ariaLabel=null,this.icon=a(o),this._updatedProps=[]}get effectiveAriaHidden(){return this.ariaHidden!==null&&this.ariaHidden!==void 0?this.ariaHidden===``||this.ariaHidden===`true`:!this.ariaLabel}get effectiveAriaLabel(){return this.effectiveAriaHidden?null:this.ariaLabel||this.name||null}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-icon`)}async attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),(e===`name`||e===`path`)&&this.getIcon(this.name)}async updated(e){super.updated(e),(e.has(`name`)||e.has(`path`))&&this.getIcon(this.name),this.applyAriaToSvg()}applyAriaToSvg(){let e=this.querySelector(`svg`);if(!e)return;e.setAttribute(`aria-hidden`,String(this.effectiveAriaHidden));let t=this.effectiveAriaLabel;t?e.setAttribute(`aria-label`,t):e.removeAttribute(`aria-label`)}async getIcon(e=``){if(this._updatedProps.length>0){this.path||=typeof window<`u`?window.pktIconPath:t.path;try{this.icon=a(await p(this.name||``,this.path))}catch{this.icon=a(o)}this._updatedProps=[]}else this._updatedProps.includes(e)||this._updatedProps.push(e)}render(){return e._`${this.name&&this.icon}`}};e.n([e.u({type:String,reflect:!1})],m.prototype,`path`,void 0),e.n([e.u({type:String,reflect:!0})],m.prototype,`name`,void 0),e.n([e.u({type:String,attribute:`aria-hidden`,reflect:!0})],m.prototype,`ariaHidden`,void 0),e.n([e.u({type:String,attribute:`aria-label`,reflect:!0})],m.prototype,`ariaLabel`,void 0),e.n([e.u({type:SVGElement})],m.prototype,`icon`,void 0),e.n([e.u({type:Array,noAccessor:!0})],m.prototype,`_updatedProps`,void 0);try{e.d(`pkt-icon`)(m)}catch{console.warn(`Forsøker å definere <pkt-icon>, men den er allerede definert`)}var h=m;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./directive-helpers-Bv70GjQh.cjs"),r=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs");const i=require("./input-wrapper-4PTk8aX3.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./ref-CB7e9nMY.cjs"),s=require("./input-element-BOi7rBbw.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 s.t{constructor(...e){super(...e),this.inputRef=o.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)}willUpdate(e){super.willUpdate(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}updated(e){super.updated(e),this.classList.add(`pkt-textinput`,`pkt-textarea`),e.has(`value`)&&this.valueChanged(this.value,e.get(`value`))}render(){let n=this.effectiveCounter(this.counterMaxLength>0),s=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
|
-
${r.n(this,[`helptext`])}
|
|
3
|
-
.strings=${this.strings}
|
|
4
|
-
label=${this.label}
|
|
5
|
-
?counter=${n}
|
|
6
|
-
?hasFieldset=${this.effectiveHasFieldset(!1)}
|
|
7
|
-
?disabled=${this.isDisabled}
|
|
8
|
-
?hasError=${this.hasError}
|
|
9
|
-
?inline=${this.inline}
|
|
10
|
-
?optionalTag=${this.optionalTag}
|
|
11
|
-
?required=${this.required}
|
|
12
|
-
?requiredTag=${this.requiredTag}
|
|
13
|
-
useWrapper=${this.useWrapper}
|
|
14
|
-
.ariaDescribedby=${this.ariaDescribedby}
|
|
15
|
-
.counterCurrent=${this.value?.length??0}
|
|
16
|
-
.counterMaxLength=${this.counterMaxLength}
|
|
17
|
-
.errorMessage=${this.errorMessage}
|
|
18
|
-
.forId="${this.id+`-input`}"
|
|
19
|
-
.helptext=${this.helptext}
|
|
20
|
-
.helptextDropdown=${this.helptextDropdown}
|
|
21
|
-
.helptextDropdownButton=${this.helptextDropdownButton}
|
|
22
|
-
.optionalText=${this.optionalText}
|
|
23
|
-
.requiredText=${this.requiredText}
|
|
24
|
-
.tagText=${this.tagText}
|
|
25
|
-
.size=${this.inputSize}
|
|
26
|
-
>
|
|
27
|
-
<textarea
|
|
28
|
-
${o.n(this.inputRef)}
|
|
29
|
-
class=${s}
|
|
30
|
-
id=${this.id+`-input`}
|
|
31
|
-
name=${(this.name||this.id)+`-input`}
|
|
32
|
-
placeholder=${a.t(this.placeholder)}
|
|
33
|
-
.value=${c(this.value)}
|
|
34
|
-
minlength=${a.t(this.minlength)}
|
|
35
|
-
maxlength=${a.t(this.maxlength)}
|
|
36
|
-
?readonly=${this.readonly}
|
|
37
|
-
autocomplete=${this.autocomplete}
|
|
38
|
-
aria-labelledby=${l}
|
|
39
|
-
aria-invalid=${this.hasError}
|
|
40
|
-
aria-errormessage=${a.t(this.hasError?`${this.id}-input-error`:void 0)}
|
|
41
|
-
aria-describedby=${a.t(i.r({id:this.id+`-input`,hasHelptext:!!this.helptext||this.hasSlotContent(`helptext`),hasCounter:n,ariaDescribedby:this.ariaDescribedby}))}
|
|
42
|
-
rows=${a.t(this.rows??void 0)}
|
|
43
|
-
cols=${a.t(this.cols??void 0)}
|
|
44
|
-
?disabled=${this.isDisabled}
|
|
45
|
-
@input=${e=>{this.value=e.target.value,this.onInput(),e.stopImmediatePropagation()}}
|
|
46
|
-
@change=${e=>{e.stopImmediatePropagation()}}
|
|
47
|
-
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
48
|
-
@blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
|
|
49
|
-
></textarea>
|
|
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}});
|