@oslokommune/punkt-elements 12.18.0 → 12.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/alert-BbVWu2lm.cjs +27 -0
  2. package/dist/alert-Dh6A96vo.js +159 -0
  3. package/dist/{index-D2jSRMrn.js → calendar-BUqcNvfI.js} +41 -29
  4. package/dist/calendar-QSulz7im.cjs +108 -0
  5. package/dist/card-B0GPdG5M.cjs +23 -0
  6. package/dist/card-kWt0BA2a.js +170 -0
  7. package/dist/{class-map-a5HUzP83.cjs → class-map-Boa7BqCc.cjs} +2 -2
  8. package/dist/{class-map-CBvUV2N3.js → class-map-hz16xq5a.js} +9 -10
  9. package/dist/datepicker-BhavwiBZ.js +659 -0
  10. package/dist/datepicker-vX74tb3R.cjs +154 -0
  11. package/dist/helptext--4FLdAWi.js +194 -0
  12. package/dist/helptext-iZEgxz2U.cjs +23 -0
  13. package/dist/icon-CdMQ6zBT.cjs +250 -0
  14. package/dist/{index-CFDwiDTU.js → icon-wUXeHiBk.js} +7371 -7559
  15. package/dist/if-defined-DEDlGbAc.cjs +5 -0
  16. package/dist/if-defined-ZFE4ti2t.js +10 -0
  17. package/dist/index.d.ts +49 -51
  18. package/dist/input-element-BQTCZtNQ.js +185 -0
  19. package/dist/input-element-DNklGY_O.cjs +1 -0
  20. package/dist/{input-wrapper-DVXNuxVu.js → input-wrapper-BTQk3W8T.js} +10 -11
  21. package/dist/input-wrapper-D-PNRJB_.cjs +46 -0
  22. package/dist/link-BpqavGSD.cjs +8 -0
  23. package/dist/link-Bx9nVgZi.js +108 -0
  24. package/dist/linkcard-CUrbzjLK.js +53 -0
  25. package/dist/linkcard-DSu3A4Yx.cjs +13 -0
  26. package/dist/messagebox-C1aWoQbu.cjs +12 -0
  27. package/dist/messagebox-LpiVQIoM.js +107 -0
  28. package/dist/modal-Avai5eVz.cjs +30 -0
  29. package/dist/{modal-lQfiTbGh.js → modal-Co1YFmHi.js} +7 -8
  30. package/dist/pkt-alert.cjs +1 -27
  31. package/dist/pkt-alert.js +4 -158
  32. package/dist/pkt-calendar.cjs +1 -1
  33. package/dist/pkt-calendar.js +4 -7
  34. package/dist/pkt-card.cjs +1 -23
  35. package/dist/pkt-card.js +4 -169
  36. package/dist/pkt-datepicker.cjs +1 -154
  37. package/dist/pkt-datepicker.js +4 -657
  38. package/dist/pkt-helptext.cjs +1 -1
  39. package/dist/pkt-helptext.js +1 -1
  40. package/dist/pkt-icon.cjs +1 -1
  41. package/dist/pkt-icon.js +4 -4
  42. package/dist/pkt-index.cjs +29 -1
  43. package/dist/pkt-index.js +127 -32
  44. package/dist/pkt-input-wrapper.cjs +1 -1
  45. package/dist/pkt-input-wrapper.js +1 -1
  46. package/dist/pkt-link.cjs +1 -8
  47. package/dist/pkt-link.js +4 -108
  48. package/dist/pkt-linkcard.cjs +1 -1
  49. package/dist/pkt-linkcard.js +1 -1
  50. package/dist/pkt-messagebox.cjs +1 -12
  51. package/dist/pkt-messagebox.js +4 -106
  52. package/dist/pkt-modal.cjs +1 -1
  53. package/dist/pkt-modal.js +1 -1
  54. package/dist/pkt-progressbar.cjs +1 -1
  55. package/dist/pkt-progressbar.js +2 -2
  56. package/dist/pkt-tag.cjs +1 -17
  57. package/dist/pkt-tag.js +4 -149
  58. package/dist/pkt-textarea.cjs +1 -1
  59. package/dist/pkt-textarea.js +1 -1
  60. package/dist/pkt-textinput.cjs +1 -1
  61. package/dist/pkt-textinput.js +1 -1
  62. package/dist/{progressbar-1PEs_SMc.js → progressbar-BS_oawSB.js} +42 -47
  63. package/dist/{progressbar-BlzTFI9U.cjs → progressbar-CuXkbAhJ.cjs} +7 -11
  64. package/dist/ref-DCOsLZQg.cjs +13 -0
  65. package/dist/{ref-Dzme4zb6.js → ref-DuFGTLVX.js} +26 -27
  66. package/dist/state-BfyXV7EL.js +12 -0
  67. package/dist/state-SKYD8kRO.cjs +5 -0
  68. package/dist/stringutils-CkVRq4jP.cjs +1 -0
  69. package/dist/stringutils-DJjRa8dG.js +7 -0
  70. package/dist/tag-CGy2mSLE.cjs +17 -0
  71. package/dist/tag-DGFgUF3l.js +150 -0
  72. package/dist/textarea-BFWHQHLs.cjs +48 -0
  73. package/dist/{textarea-BXzQA_ub.js → textarea-BYtGXst8.js} +29 -29
  74. package/dist/{textinput-52G3CfwA.cjs → textinput-33wZwZ4O.cjs} +2 -2
  75. package/dist/{textinput-CTNWiIaP.js → textinput-IgHewJDJ.js} +23 -23
  76. package/package.json +2 -2
  77. package/src/components/alert/alert.ts +115 -0
  78. package/src/components/alert/index.ts +4 -113
  79. package/src/components/calendar/calendar.ts +711 -0
  80. package/src/components/calendar/index.ts +3 -711
  81. package/src/components/card/card.ts +78 -0
  82. package/src/components/card/index.ts +4 -77
  83. package/src/components/datepicker/datepicker.ts +619 -0
  84. package/src/components/datepicker/index.ts +3 -618
  85. package/src/components/helptext/helptext.ts +2 -2
  86. package/src/components/icon/icon.ts +99 -0
  87. package/src/components/icon/index.ts +3 -98
  88. package/src/components/index.ts +21 -17
  89. package/src/components/input-wrapper/input-wrapper.ts +2 -2
  90. package/src/components/link/index.ts +3 -56
  91. package/src/components/link/link.ts +57 -0
  92. package/src/components/linkcard/index.ts +1 -1
  93. package/src/components/linkcard/linkcard.ts +5 -6
  94. package/src/components/messagebox/index.ts +4 -69
  95. package/src/components/messagebox/messagebox.ts +69 -0
  96. package/src/components/modal/index.ts +0 -1
  97. package/src/components/modal/modal.ts +5 -7
  98. package/src/components/progressbar/progressbar.ts +2 -2
  99. package/src/components/tag/index.ts +4 -109
  100. package/src/components/tag/tag.ts +118 -0
  101. package/src/components/textarea/textarea.ts +5 -4
  102. package/src/components/textinput/textinput.ts +3 -3
  103. package/dist/component-template.d.ts +0 -8
  104. package/dist/converters-DNCwIFwr.js +0 -17
  105. package/dist/converters-DhM11VlY.cjs +0 -1
  106. package/dist/custom-element-B-TlBwRu.cjs +0 -9
  107. package/dist/custom-element-CWfU4dcr.js +0 -38
  108. package/dist/element.d.ts +0 -8
  109. package/dist/helptext-DBolvFI4.js +0 -72
  110. package/dist/helptext-_fMLOOCL.cjs +0 -23
  111. package/dist/index-CR7t1zY9.cjs +0 -238
  112. package/dist/index-CmTjXoAb.cjs +0 -9
  113. package/dist/index-RwtTBIhT.js +0 -88
  114. package/dist/index-tvpcg-ad.cjs +0 -108
  115. package/dist/input-wrapper-tJE-X4Ac.cjs +0 -46
  116. package/dist/linkcard-BHokvuVN.js +0 -55
  117. package/dist/linkcard-CUXMP6BH.cjs +0 -13
  118. package/dist/modal-CjsQgmmH.cjs +0 -30
  119. package/dist/pkt-component-template.cjs +0 -29
  120. package/dist/pkt-component-template.js +0 -100
  121. package/dist/pkt-element.cjs +0 -1
  122. package/dist/pkt-element.js +0 -5
  123. package/dist/ref-CA2-0S_W.cjs +0 -13
  124. package/dist/textarea-D_ud1Mpa.cjs +0 -48
  125. package/src/components/component-template/index.ts +0 -129
  126. package/src/components/element/index.ts +0 -353
@@ -1,110 +1,5 @@
1
- import { classMap } from 'lit/directives/class-map.js'
2
- import { customElement, property, state } from 'lit/decorators.js'
3
- import { html } from 'lit'
4
- import { PktElement } from '../element'
5
- import { PktSlotController } from '@/controllers/pkt-slot-controller'
6
- import { ref } from 'lit/directives/ref.js'
7
- import { Ref, createRef } from 'lit/directives/ref.js'
8
- import specs from 'componentSpecs/tag.json'
1
+ import { PktTag } from './tag'
2
+ export { PktTag } from './tag'
3
+ export default PktTag
9
4
 
10
- import '../icon'
11
-
12
- type TagSize = 'small' | 'medium' | 'large'
13
- type TagSkin = 'blue' | 'green' | 'red' | 'yellow' | 'beige' | 'blue-light' | 'gray' | 'grey'
14
- type TagType = 'button' | 'reset' | 'submit'
15
-
16
- export interface IPktTag {
17
- closeTag?: boolean
18
- size?: TagSize
19
- skin?: TagSkin
20
- textStyle?: string
21
- iconName?: string
22
- type?: TagType
23
- ariaLabel?: string
24
- }
25
-
26
- @customElement('pkt-tag')
27
- export class PktTag extends PktElement {
28
- slotController: PktSlotController
29
- defaultSlot: Ref<HTMLElement> = createRef()
30
-
31
- constructor() {
32
- super()
33
- this.slotController = new PktSlotController(this, this.defaultSlot)
34
- this._isClosed = false
35
- }
36
-
37
- /**
38
- * Element attributes
39
- */
40
- @property({ type: Boolean, reflect: true }) closeTag: boolean = specs.props.closeTag.default
41
- @property({ type: String, reflect: true }) size: TagSize = specs.props.size.default as TagSize
42
- @property({ type: String, reflect: true }) skin: TagSkin = specs.props.skin.default as TagSkin
43
- @property({ type: String, reflect: true }) textStyle: string = specs.props.textStyle.default
44
- @property({ type: String, reflect: true }) iconName: string | undefined = undefined
45
- @property({ type: String, reflect: true }) type: TagType = specs.props.type.default as TagType
46
- @property({ type: String, reflect: true }) ariaLabel: string = specs.props.ariaLabel.default
47
-
48
- /**
49
- * Element state
50
- */
51
- @state() _isClosed: boolean = false
52
-
53
- /**
54
- * Element functions
55
- */
56
- private close = (event: MouseEvent) => {
57
- this._isClosed = true
58
- this.dispatchEvent(
59
- new CustomEvent('close', { detail: { origin: event }, bubbles: true, composed: true }),
60
- )
61
- // Historical support of old Vue implementations…
62
- this.dispatchEvent(
63
- new CustomEvent('on-close', { detail: { origin: event }, bubbles: true, composed: true }),
64
- )
65
- }
66
-
67
- render() {
68
- const classes = {
69
- 'pkt-tag': true,
70
- [`pkt-tag--${this.size}`]: !!this.size,
71
- [`pkt-tag--${this.skin}`]: !!this.skin,
72
- [`pkt-tag--${this.textStyle}`]: !!this.textStyle,
73
- }
74
-
75
- const btnClasses = {
76
- 'pkt-tag': true,
77
- 'pkt-btn': true,
78
- 'pkt-btn--tertiary': true,
79
- [`pkt-tag--${this.size}`]: !!this.size,
80
- [`pkt-tag--${this.skin}`]: !!this.skin,
81
- [`pkt-tag--${this.textStyle}`]: !!this.textStyle,
82
- 'pkt-btn--icons-right-and-left': this.closeTag && !!this.iconName,
83
- 'pkt-hide': this._isClosed,
84
- }
85
-
86
- if (this.closeTag) {
87
- return html`
88
- <button
89
- class=${classMap(btnClasses)}
90
- type=${this.type}
91
- aria-label=${this.ariaLabel}
92
- @click=${this.close}
93
- >
94
- ${this.iconName &&
95
- html`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
96
- <span ${ref(this.defaultSlot)}></span>
97
- <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
98
- </button>
99
- `
100
- } else {
101
- return html`
102
- <span class=${classMap(classes)}>
103
- ${this.iconName &&
104
- html` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
105
- <span ${ref(this.defaultSlot)}></span>
106
- </span>
107
- `
108
- }
109
- }
110
- }
5
+ export type { TTagSkin, TTagType } from './tag'
@@ -0,0 +1,118 @@
1
+ import { classMap } from 'lit/directives/class-map.js'
2
+ import { customElement, property, state } from 'lit/decorators.js'
3
+ import { html } from 'lit'
4
+ import { PktElement } from '@/base-elements/element'
5
+ import { PktSlotController } from '@/controllers/pkt-slot-controller'
6
+ import { ref } from 'lit/directives/ref.js'
7
+ import { Ref, createRef } from 'lit/directives/ref.js'
8
+ import { TPktSize } from '@/types/size'
9
+ import specs from 'componentSpecs/tag.json'
10
+
11
+ import '@/components/icon'
12
+
13
+ export type TTagSkin =
14
+ | 'blue'
15
+ | 'green'
16
+ | 'red'
17
+ | 'yellow'
18
+ | 'beige'
19
+ | 'blue-light'
20
+ | 'gray'
21
+ | 'grey'
22
+ export type TTagType = 'button' | 'reset' | 'submit'
23
+
24
+ export interface IPktTag {
25
+ closeTag?: boolean
26
+ size?: TPktSize
27
+ skin?: TTagSkin
28
+ textStyle?: string
29
+ iconName?: string
30
+ type?: TTagType
31
+ ariaLabel?: string
32
+ }
33
+
34
+ @customElement('pkt-tag')
35
+ export class PktTag extends PktElement {
36
+ slotController: PktSlotController
37
+ defaultSlot: Ref<HTMLElement> = createRef()
38
+
39
+ constructor() {
40
+ super()
41
+ this.slotController = new PktSlotController(this, this.defaultSlot)
42
+ this._isClosed = false
43
+ }
44
+
45
+ /**
46
+ * Element attributes
47
+ */
48
+ @property({ type: Boolean, reflect: true }) closeTag: boolean = specs.props.closeTag.default
49
+ @property({ type: String, reflect: true }) size: TPktSize = specs.props.size.default as TPktSize
50
+ @property({ type: String, reflect: true }) skin: TTagSkin = specs.props.skin.default as TTagSkin
51
+ @property({ type: String, reflect: true }) textStyle: string = specs.props.textStyle.default
52
+ @property({ type: String, reflect: true }) iconName: string | undefined = undefined
53
+ @property({ type: String, reflect: true }) type: TTagType = specs.props.type.default as TTagType
54
+ @property({ type: String, reflect: true }) ariaLabel: string = specs.props.ariaLabel.default
55
+
56
+ /**
57
+ * Element state
58
+ */
59
+ @state() _isClosed: boolean = false
60
+
61
+ /**
62
+ * Element functions
63
+ */
64
+ private close = (event: MouseEvent) => {
65
+ this._isClosed = true
66
+ this.dispatchEvent(
67
+ new CustomEvent('close', { detail: { origin: event }, bubbles: true, composed: true }),
68
+ )
69
+ // Historical support of old Vue implementations…
70
+ this.dispatchEvent(
71
+ new CustomEvent('on-close', { detail: { origin: event }, bubbles: true, composed: true }),
72
+ )
73
+ }
74
+
75
+ render() {
76
+ const classes = {
77
+ 'pkt-tag': true,
78
+ [`pkt-tag--${this.size}`]: !!this.size,
79
+ [`pkt-tag--${this.skin}`]: !!this.skin,
80
+ [`pkt-tag--${this.textStyle}`]: !!this.textStyle,
81
+ }
82
+
83
+ const btnClasses = {
84
+ 'pkt-tag': true,
85
+ 'pkt-btn': true,
86
+ 'pkt-btn--tertiary': true,
87
+ [`pkt-tag--${this.size}`]: !!this.size,
88
+ [`pkt-tag--${this.skin}`]: !!this.skin,
89
+ [`pkt-tag--${this.textStyle}`]: !!this.textStyle,
90
+ 'pkt-btn--icons-right-and-left': this.closeTag && !!this.iconName,
91
+ 'pkt-hide': this._isClosed,
92
+ }
93
+
94
+ if (this.closeTag) {
95
+ return html`
96
+ <button
97
+ class=${classMap(btnClasses)}
98
+ type=${this.type}
99
+ aria-label=${this.ariaLabel}
100
+ @click=${this.close}
101
+ >
102
+ ${this.iconName &&
103
+ html`<pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon>`}
104
+ <span ${ref(this.defaultSlot)}></span>
105
+ <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
106
+ </button>
107
+ `
108
+ } else {
109
+ return html`
110
+ <span class=${classMap(classes)}>
111
+ ${this.iconName &&
112
+ html` <pkt-icon class="pkt-tag__icon" name=${this.iconName}></pkt-icon> `}
113
+ <span ${ref(this.defaultSlot)}></span>
114
+ </span>
115
+ `
116
+ }
117
+ }
118
+ }
@@ -3,9 +3,10 @@ import { customElement, property, state } from 'lit/decorators.js'
3
3
  import { Ref, createRef, ref } from 'lit/directives/ref.js'
4
4
  import { classMap } from 'lit/directives/class-map.js'
5
5
  import { live } from 'lit/directives/live.js'
6
- import { PktInputElement } from '../element'
7
- import '../input-wrapper'
8
- import '../icon'
6
+ import { PktInputElement } from '@/base-elements/input-element'
7
+
8
+ import '@/components/input-wrapper'
9
+ import '@/components/icon'
9
10
 
10
11
  @customElement('pkt-textarea')
11
12
  export class PktTextarea extends PktInputElement {
@@ -57,7 +58,7 @@ export class PktTextarea extends PktInputElement {
57
58
  const labelledBy = this.ariaLabelledby || `${this.id}-input-label`
58
59
 
59
60
  return html`<pkt-input-wrapper
60
- label="${this.label}"
61
+ label=${this.label}
61
62
  ?counter=${this.counter}
62
63
  ?disabled=${this.disabled}
63
64
  ?hasError=${this.hasError}
@@ -2,9 +2,9 @@ import { html, nothing, PropertyValues } from 'lit'
2
2
  import { customElement, property, state } from 'lit/decorators.js'
3
3
  import { Ref, createRef, ref } from 'lit/directives/ref.js'
4
4
  import { classMap } from 'lit/directives/class-map.js'
5
- import { PktInputElement } from '../element'
6
- import '../input-wrapper'
7
- import '../icon'
5
+ import { PktInputElement } from '@/base-elements/input-element'
6
+ import '@/components/input-wrapper'
7
+ import '@/components/icon'
8
8
 
9
9
  @customElement('pkt-textinput')
10
10
  export class PktTextinput extends PktInputElement {
@@ -1,8 +0,0 @@
1
- export { }
2
-
3
-
4
- declare global {
5
- interface Window {
6
- pktTz: string;
7
- }
8
- }
@@ -1,17 +0,0 @@
1
- const n = (r) => {
2
- if (Array.isArray(r)) return r;
3
- if (typeof r == "string") return r.split(",");
4
- }, s = (r) => r ? new Date(r) : null, e = (r) => {
5
- if (typeof r == "string")
6
- return r.split(",").map((t) => new Date(t));
7
- if (Array.isArray(r))
8
- return r.map((t) => new Date(t));
9
- }, i = {
10
- csvToArray: n,
11
- stringToDate: s,
12
- stringsToDate: e
13
- };
14
- export {
15
- i as a,
16
- n as c
17
- };
@@ -1 +0,0 @@
1
- "use strict";const n=r=>{if(Array.isArray(r))return r;if(typeof r=="string")return r.split(",")},s=r=>r?new Date(r):null,e=r=>{if(typeof r=="string")return r.split(",").map(t=>new Date(t));if(Array.isArray(r))return r.map(t=>new Date(t))},i={csvToArray:n,stringToDate:s,stringsToDate:e};exports.converters=i;exports.csvToArray=n;
@@ -1,9 +0,0 @@
1
- "use strict";/**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */const r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},n=i=>(...t)=>({_$litDirective$:i,values:t});class ${constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
6
- * @license
7
- * Copyright 2017 Google LLC
8
- * SPDX-License-Identifier: BSD-3-Clause
9
- */const E=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};exports.e=n;exports.i=$;exports.t=E;exports.t$1=r;
@@ -1,38 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- const r = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, n = (i) => (...t) => ({ _$litDirective$: i, values: t });
7
- class E {
8
- constructor(t) {
9
- }
10
- get _$AU() {
11
- return this._$AM._$AU;
12
- }
13
- _$AT(t, e, s) {
14
- this._$Ct = t, this._$AM = e, this._$Ci = s;
15
- }
16
- _$AS(t, e) {
17
- return this.update(t, e);
18
- }
19
- update(t, e) {
20
- return this.render(...e);
21
- }
22
- }
23
- /**
24
- * @license
25
- * Copyright 2017 Google LLC
26
- * SPDX-License-Identifier: BSD-3-Clause
27
- */
28
- const $ = (i) => (t, e) => {
29
- e !== void 0 ? e.addInitializer(() => {
30
- customElements.define(i, t);
31
- }) : customElements.define(i, t);
32
- };
33
- export {
34
- r as a,
35
- n as e,
36
- E as i,
37
- $ as t
38
- };
package/dist/element.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export { }
2
-
3
-
4
- declare global {
5
- interface Window {
6
- pktTz: string;
7
- }
8
- }
@@ -1,72 +0,0 @@
1
- import { r as d, P as c, u as _, s as f, x as s, n as i, E as a } from "./index-CFDwiDTU.js";
2
- import { o as u } from "./index-RwtTBIhT.js";
3
- import { e as w } from "./class-map-CBvUV2N3.js";
4
- import { t as v } from "./custom-element-CWfU4dcr.js";
5
- var b = Object.defineProperty, k = Object.getOwnPropertyDescriptor, p = (n, r, l, o) => {
6
- for (var t = o > 1 ? void 0 : o ? k(r, l) : r, h = n.length - 1, x; h >= 0; h--)
7
- (x = n[h]) && (t = (o ? x(r, l, t) : x(t)) || t);
8
- return o && t && b(r, l, t), t;
9
- };
10
- let e = class extends c {
11
- constructor() {
12
- super(), this.forId = _(), this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = f.props.helptextDropdownButton.default, this.isHelpTextOpen = !1;
13
- }
14
- render() {
15
- const n = () => {
16
- this.isHelpTextOpen = !this.isHelpTextOpen, this.dispatchEvent(
17
- new CustomEvent("toggleHelpText", {
18
- bubbles: !0,
19
- detail: { isOpen: !this.isHelpTextOpen }
20
- })
21
- );
22
- };
23
- return s`${this.helptext || this.helptextDropdown ? s`<div>
24
- ${this.helptext ? s`<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
25
- ${u(this.helptext)}
26
- </div>` : a}
27
- ${this.helptextDropdown ? s`<div class="pkt-inputwrapper__helptext-expandable">
28
- <button
29
- class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
30
- type="button"
31
- @click=${n}
32
- >
33
- <pkt-icon
34
- class="pkt-btn__icon"
35
- name="${this.isHelpTextOpen ? "chevron-thin-up" : "chevron-thin-down"}"
36
- ></pkt-icon>
37
- <span class="pkt-btn__text">${u(this.helptextDropdownButton)}</span>
38
- </button>
39
- <div
40
- class="${w({
41
- "pkt-inputwrapper__helptext": !0,
42
- "pkt-inputwrapper__helptext-expandable-open": this.isHelpTextOpen,
43
- "pkt-inputwrapper__helptext-expandable-closed": !this.isHelpTextOpen
44
- })}"
45
- >
46
- ${u(this.helptextDropdown)}
47
- </div>
48
- </div>` : a}
49
- </div>` : a}`;
50
- }
51
- };
52
- p([
53
- i({ type: String, reflect: !0 })
54
- ], e.prototype, "forId", 2);
55
- p([
56
- i({ type: String, reflect: !0 })
57
- ], e.prototype, "helptext", 2);
58
- p([
59
- i({ type: String, reflect: !0 })
60
- ], e.prototype, "helptextDropdown", 2);
61
- p([
62
- i({ type: String, reflect: !0 })
63
- ], e.prototype, "helptextDropdownButton", 2);
64
- p([
65
- d()
66
- ], e.prototype, "isHelpTextOpen", 2);
67
- e = p([
68
- v("pkt-helptext")
69
- ], e);
70
- export {
71
- e as P
72
- };
@@ -1,23 +0,0 @@
1
- "use strict";const t=require("./index-CR7t1zY9.cjs"),h=require("./index-CmTjXoAb.cjs"),x=require("./class-map-a5HUzP83.cjs"),c=require("./custom-element-B-TlBwRu.cjs");var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,n=(s,p,r,l)=>{for(var e=l>1?void 0:l?d(p,r):p,i=s.length-1,o;i>=0;i--)(o=s[i])&&(e=(l?o(p,r,e):o(e))||e);return l&&e&&u(p,r,e),e};exports.PktHelptext=class extends t.PktElement{constructor(){super(),this.forId=t.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=t.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){const p=()=>{this.isHelpTextOpen=!this.isHelpTextOpen,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:!this.isHelpTextOpen}}))},r=()=>this.helptext||this.helptextDropdown?t.x`<div>
2
- ${this.helptext?t.x`<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
3
- ${h.o(this.helptext)}
4
- </div>`:t.E}
5
- ${this.helptextDropdown?t.x`<div class="pkt-inputwrapper__helptext-expandable">
6
- <button
7
- class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
8
- type="button"
9
- @click=${p}
10
- >
11
- <pkt-icon
12
- class="pkt-btn__icon"
13
- name="${this.isHelpTextOpen?"chevron-thin-up":"chevron-thin-down"}"
14
- ></pkt-icon>
15
- <span class="pkt-btn__text">${h.o(this.helptextDropdownButton)}</span>
16
- </button>
17
- <div
18
- class="${x.e({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
19
- >
20
- ${h.o(this.helptextDropdown)}
21
- </div>
22
- </div>`:t.E}
23
- </div>`:t.E;return t.x`${r()}`}};n([t.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"forId",2);n([t.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"helptext",2);n([t.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"helptextDropdown",2);n([t.n({type:String,reflect:!0})],exports.PktHelptext.prototype,"helptextDropdownButton",2);n([t.r()],exports.PktHelptext.prototype,"isHelpTextOpen",2);exports.PktHelptext=n([c.t("pkt-helptext")],exports.PktHelptext);