@oslokommune/punkt-elements 16.7.3 → 16.7.7

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 (248) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/accordion-BB1JrONI.cjs +34 -0
  3. package/dist/accordion-nNH87Y60.js +130 -0
  4. package/dist/alert-BEEnTiCb.cjs +33 -0
  5. package/dist/alert-ePJuDtmm.js +171 -0
  6. package/dist/async-directive-B9P1Qa0k.cjs +1 -0
  7. package/dist/async-directive-CaQiqjyV.js +55 -0
  8. package/dist/backlink-Ba03LlbB.cjs +13 -0
  9. package/dist/backlink-CiwXrQYD.js +38 -0
  10. package/dist/booleanish-BmcOU-43.js +11 -0
  11. package/dist/booleanish-jJLlnr6-.cjs +1 -0
  12. package/dist/breadcrumbs-CD1zib3s.cjs +43 -0
  13. package/dist/breadcrumbs-CpuVqWhF.js +76 -0
  14. package/dist/button-BIpd1xJh.js +95 -0
  15. package/dist/button-D-TOBaJB.cjs +27 -0
  16. package/dist/calendar-BzEtOJla.js +2031 -0
  17. package/dist/calendar-E5jJLt8D.cjs +90 -0
  18. package/dist/card-BYJu1MYm.js +339 -0
  19. package/dist/card-CUFhMVim.cjs +87 -0
  20. package/dist/checkbox-BARDb9iV.cjs +31 -0
  21. package/dist/checkbox-Cspxcvt_.js +111 -0
  22. package/dist/class-map-C8HuhNzZ.js +27 -0
  23. package/dist/class-map-CJ-msbHs.cjs +1 -0
  24. package/dist/classutils-DEL164Ur.js +7 -0
  25. package/dist/classutils-z8YsPlOf.cjs +1 -0
  26. package/dist/combobox-BcdLZRDU.js +984 -0
  27. package/dist/combobox-CGbFTWq_.cjs +135 -0
  28. package/dist/consent-DeB_5sWH.js +197 -0
  29. package/dist/consent-hwu7pp3S.cjs +11 -0
  30. package/dist/datepicker-DpmlsnH_.cjs +273 -0
  31. package/dist/datepicker-OVd8pmnZ.js +1125 -0
  32. package/dist/dialog-polyfill.esm-1hPr0gl9.js +280 -0
  33. package/dist/dialog-polyfill.esm-D3Oinvk0.cjs +1 -0
  34. package/dist/directive-3THFsVew.js +28 -0
  35. package/dist/directive-CJ2giQBZ.cjs +1 -0
  36. package/dist/directive-helpers-D1QSxY17.cjs +1 -0
  37. package/dist/directive-helpers-Dkv2gKgs.js +25 -0
  38. package/dist/element-DjtxO-1r.cjs +2 -0
  39. package/dist/element-cZ85T_aa.js +693 -0
  40. package/dist/element-with-slot-4J2o3SeU.js +166 -0
  41. package/dist/element-with-slot-CWoTGA1B.cjs +1 -0
  42. package/dist/header-DWgPgGfS.cjs +304 -0
  43. package/dist/header-a6ztVNp3.js +782 -0
  44. package/dist/heading-BgSWIRii.cjs +1 -0
  45. package/dist/heading-DiQLPxdf.js +73 -0
  46. package/dist/helptext-CCBKKLus.js +65 -0
  47. package/dist/helptext-D-3QfZv5.cjs +24 -0
  48. package/dist/icon-Co72KtgF.js +86 -0
  49. package/dist/icon-Dr8sfT2X.cjs +1 -0
  50. package/dist/if-defined-Cjj8qN-Z.js +5 -0
  51. package/dist/if-defined-XKOD_t_V.cjs +1 -0
  52. package/dist/index.d.ts +1 -2
  53. package/dist/input-element-B1yxcfz4.cjs +1 -0
  54. package/dist/input-element-Bw1s6NlF.js +643 -0
  55. package/dist/input-wrapper-BRuVELpK.cjs +54 -0
  56. package/dist/input-wrapper-CDyHTR1V.js +164 -0
  57. package/dist/input-wrapper-Dwd-_sKm.cjs +1 -0
  58. package/dist/input-wrapper-YfTmpSSY.js +117 -0
  59. package/dist/link-CKAFMz9j.js +89 -0
  60. package/dist/link-CyTCpI0k.cjs +7 -0
  61. package/dist/linkcard-B0KOGaGj.js +55 -0
  62. package/dist/linkcard-BE4-FewK.cjs +13 -0
  63. package/dist/listbox-DCA2JoPV.cjs +106 -0
  64. package/dist/listbox-DuBgTFvH.js +397 -0
  65. package/dist/loader-6kFZUErT.js +66 -0
  66. package/dist/loader-CX2rsC01.cjs +16 -0
  67. package/dist/messagebox-Cwlg5sOr.js +110 -0
  68. package/dist/messagebox-Din9X53b.cjs +13 -0
  69. package/dist/modal-C_wtsh9m.js +209 -0
  70. package/dist/modal-DS_wUOIv.cjs +36 -0
  71. package/dist/pkt-accordion.cjs +1 -1
  72. package/dist/pkt-accordion.js +2 -7
  73. package/dist/pkt-alert.cjs +1 -1
  74. package/dist/pkt-alert.js +2 -5
  75. package/dist/pkt-backlink.cjs +1 -1
  76. package/dist/pkt-backlink.js +2 -5
  77. package/dist/pkt-breadcrumbs.cjs +1 -43
  78. package/dist/pkt-breadcrumbs.js +2 -81
  79. package/dist/pkt-button.cjs +1 -1
  80. package/dist/pkt-button.js +2 -5
  81. package/dist/pkt-calendar.cjs +1 -1
  82. package/dist/pkt-calendar.js +2 -5
  83. package/dist/pkt-card.cjs +1 -1
  84. package/dist/pkt-card.js +2 -5
  85. package/dist/pkt-checkbox.cjs +1 -1
  86. package/dist/pkt-checkbox.js +2 -5
  87. package/dist/pkt-combobox.cjs +1 -1
  88. package/dist/pkt-combobox.js +2 -5
  89. package/dist/pkt-consent.cjs +1 -1
  90. package/dist/pkt-consent.js +2 -5
  91. package/dist/pkt-datepicker.cjs +1 -1
  92. package/dist/pkt-datepicker.js +5 -9
  93. package/dist/pkt-header.cjs +1 -304
  94. package/dist/pkt-header.js +2 -861
  95. package/dist/pkt-heading.cjs +1 -1
  96. package/dist/pkt-heading.js +2 -5
  97. package/dist/pkt-helptext.cjs +1 -1
  98. package/dist/pkt-helptext.js +2 -5
  99. package/dist/pkt-icon.cjs +1 -1
  100. package/dist/pkt-icon.js +2 -5
  101. package/dist/pkt-index.cjs +1 -1
  102. package/dist/pkt-index.js +30 -66
  103. package/dist/pkt-input-wrapper.cjs +1 -1
  104. package/dist/pkt-input-wrapper.js +2 -5
  105. package/dist/pkt-link.cjs +1 -1
  106. package/dist/pkt-link.js +2 -5
  107. package/dist/pkt-linkcard.cjs +1 -1
  108. package/dist/pkt-linkcard.js +2 -5
  109. package/dist/pkt-listbox.cjs +1 -1
  110. package/dist/pkt-listbox.js +2 -5
  111. package/dist/pkt-loader.cjs +1 -1
  112. package/dist/pkt-loader.js +2 -5
  113. package/dist/pkt-messagebox.cjs +1 -1
  114. package/dist/pkt-messagebox.js +2 -5
  115. package/dist/pkt-modal.cjs +1 -1
  116. package/dist/pkt-modal.js +2 -5
  117. package/dist/pkt-options-controller-CRrI6WMk.js +43 -0
  118. package/dist/pkt-options-controller-CXUGx134.cjs +1 -0
  119. package/dist/pkt-progressbar.cjs +1 -1
  120. package/dist/pkt-progressbar.js +2 -5
  121. package/dist/pkt-radiobutton.cjs +1 -1
  122. package/dist/pkt-radiobutton.js +2 -5
  123. package/dist/pkt-select.cjs +1 -1
  124. package/dist/pkt-select.js +2 -5
  125. package/dist/pkt-tabs.cjs +1 -1
  126. package/dist/pkt-tabs.js +2 -7
  127. package/dist/pkt-tag.cjs +1 -1
  128. package/dist/pkt-tag.js +2 -5
  129. package/dist/pkt-textarea.cjs +1 -1
  130. package/dist/pkt-textarea.js +2 -5
  131. package/dist/pkt-textinput.cjs +1 -1
  132. package/dist/pkt-textinput.js +2 -5
  133. package/dist/pkt-timepicker.cjs +1 -191
  134. package/dist/pkt-timepicker.js +2 -560
  135. package/dist/progressbar-CdXtmOBb.cjs +17 -0
  136. package/dist/progressbar-Dy9AiYQz.js +113 -0
  137. package/dist/radiobutton-GOnpUbCW.cjs +31 -0
  138. package/dist/radiobutton-V_KPbup_.js +84 -0
  139. package/dist/ref-BaJ0mBT_.cjs +1 -0
  140. package/dist/ref-RS8Uv6uC.js +30 -0
  141. package/dist/repeat-Cepr3469.js +57 -0
  142. package/dist/repeat-CqcDYBxr.cjs +1 -0
  143. package/dist/select-BSAFd8Wa.js +164 -0
  144. package/dist/select-C2i8sOk5.cjs +49 -0
  145. package/dist/tabs-D8nL9rWx.cjs +37 -0
  146. package/dist/tabs-Y7utmJi9.js +318 -0
  147. package/dist/tag-DLthw5b4.cjs +27 -0
  148. package/dist/tag-VwykmuQR.js +179 -0
  149. package/dist/textarea-D7aGOyDf.cjs +46 -0
  150. package/dist/textarea-DYOBhJrN.js +115 -0
  151. package/dist/textinput-BUgntXnM.js +124 -0
  152. package/dist/textinput-DFh8_9cx.cjs +70 -0
  153. package/dist/timepicker-BIfE7KKJ.cjs +191 -0
  154. package/dist/timepicker-DaSwn1FA.js +503 -0
  155. package/dist/utils-CUqCKGvp.js +7 -0
  156. package/dist/utils-CjAbIttF.cjs +1 -0
  157. package/package.json +6 -6
  158. package/src/components/alert/alert.test.ts +1 -1
  159. package/src/components/alert/alert.ts +6 -6
  160. package/src/components/datepicker/datepicker-utils.test.ts +16 -23
  161. package/dist/accordionitem-_9AiCIvd.cjs +0 -34
  162. package/dist/accordionitem-dCfSrxh5.js +0 -140
  163. package/dist/alert-BtOk8yRH.cjs +0 -33
  164. package/dist/alert-DlY2_grU.js +0 -117
  165. package/dist/async-directive-CMzWMlZ5.js +0 -65
  166. package/dist/async-directive-DoMuclel.cjs +0 -5
  167. package/dist/backlink-Ce5Vldop.js +0 -49
  168. package/dist/backlink-y3dwjKPC.cjs +0 -13
  169. package/dist/booleanish-BKVonob4.cjs +0 -1
  170. package/dist/booleanish-C9R0tdXH.js +0 -11
  171. package/dist/button-B_TXwNzt.cjs +0 -27
  172. package/dist/button-BiY-wlKF.js +0 -139
  173. package/dist/calendar-B2pji2zn.cjs +0 -90
  174. package/dist/calendar-DhjQDC4C.js +0 -2140
  175. package/dist/card-BwMNB5Bb.cjs +0 -87
  176. package/dist/card-CGlmcMSR.js +0 -233
  177. package/dist/checkbox-BsJZYA26.js +0 -147
  178. package/dist/checkbox-CTY8f_qn.cjs +0 -31
  179. package/dist/class-map-CEnykyO_.js +0 -34
  180. package/dist/class-map-CsENJXf1.cjs +0 -5
  181. package/dist/classutils-BwNK82ZQ.cjs +0 -1
  182. package/dist/classutils-RQs1k6D9.js +0 -7
  183. package/dist/combobox-DSB5WOxg.js +0 -815
  184. package/dist/combobox-DbICIgKG.cjs +0 -135
  185. package/dist/consent-DkOQpbsg.cjs +0 -11
  186. package/dist/consent-SNWV_mMU.js +0 -175
  187. package/dist/datepicker-BEWl9iz3.cjs +0 -273
  188. package/dist/datepicker-euHyzXnb.js +0 -1170
  189. package/dist/dialog-polyfill.esm-CPKZe7AL.cjs +0 -1
  190. package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -395
  191. package/dist/directive-C7oCP5Bh.cjs +0 -5
  192. package/dist/directive-helpers-BP2WOx60.cjs +0 -5
  193. package/dist/directive-helpers-rm-28gIj.js +0 -38
  194. package/dist/directive-oAbCiebi.js +0 -27
  195. package/dist/element-CPpT3rFQ.js +0 -638
  196. package/dist/element-gR_VtSiD.cjs +0 -27
  197. package/dist/element-with-slot-Dqk6-TRR.js +0 -240
  198. package/dist/element-with-slot-ZX-up7jO.cjs +0 -1
  199. package/dist/heading-D2tVS6lS.js +0 -103
  200. package/dist/heading-DrzbgDb6.cjs +0 -1
  201. package/dist/helptext-BKtU4mas.js +0 -82
  202. package/dist/helptext-DcRC7wW2.cjs +0 -24
  203. package/dist/icon-CxQcIa5F.js +0 -105
  204. package/dist/icon-q81vqPK_.cjs +0 -9
  205. package/dist/if-defined-B0krMLad.js +0 -10
  206. package/dist/if-defined-BOW3ODSj.cjs +0 -5
  207. package/dist/input-element-8nLwuQS4.js +0 -837
  208. package/dist/input-element-DdVhUvva.cjs +0 -1
  209. package/dist/input-wrapper-Bs4CRNst.js +0 -181
  210. package/dist/input-wrapper-Bv9aqqVq.cjs +0 -54
  211. package/dist/input-wrapper-CDgenrYA.js +0 -6
  212. package/dist/input-wrapper-EoSAbU-U.cjs +0 -1
  213. package/dist/link-C0rl-86s.cjs +0 -7
  214. package/dist/link-Cdqgl60z.js +0 -55
  215. package/dist/linkcard-Dimu7Rlx.cjs +0 -13
  216. package/dist/linkcard-Lbq_UhjZ.js +0 -56
  217. package/dist/listbox-Bia4_tvN.js +0 -440
  218. package/dist/listbox-La2GZQei.cjs +0 -106
  219. package/dist/loader-D1ugDXGV.cjs +0 -16
  220. package/dist/loader-DyN6RGC5.js +0 -95
  221. package/dist/messagebox-BGMVm2t9.js +0 -71
  222. package/dist/messagebox-M0yIgCz9.cjs +0 -13
  223. package/dist/modal-CMO1RtIi.cjs +0 -36
  224. package/dist/modal-DjPQDE-Z.js +0 -156
  225. package/dist/pkt-options-controller-5LXbEzuk.cjs +0 -1
  226. package/dist/pkt-options-controller-B5YalfCb.js +0 -39
  227. package/dist/progressbar-BqlMzkM_.cjs +0 -21
  228. package/dist/progressbar-sbHDFC12.js +0 -162
  229. package/dist/radiobutton-5ZqVVtTT.cjs +0 -31
  230. package/dist/radiobutton-D8Ai8ETa.js +0 -113
  231. package/dist/ref-Bg_Swj5w.js +0 -42
  232. package/dist/ref-CL-Xk9Xm.cjs +0 -5
  233. package/dist/repeat-BD8TKgJb.js +0 -61
  234. package/dist/repeat-Cfq8CDlf.cjs +0 -5
  235. package/dist/select-De-n8on9.js +0 -230
  236. package/dist/select-dTWibR6_.cjs +0 -49
  237. package/dist/state-C_1EOo3D.js +0 -12
  238. package/dist/state-Dg-53wQ8.cjs +0 -5
  239. package/dist/tabitem-B9-jeV97.js +0 -334
  240. package/dist/tabitem-BnhzqfW3.cjs +0 -65
  241. package/dist/tag-CbwO8yvD.cjs +0 -27
  242. package/dist/tag-D4FI5t3y.js +0 -117
  243. package/dist/textarea-BmLaKzsc.cjs +0 -50
  244. package/dist/textarea-CMiSJaYL.js +0 -133
  245. package/dist/textinput-em9y4yrL.cjs +0 -70
  246. package/dist/textinput-r8udK0IX.js +0 -152
  247. package/dist/utils-DznhwRXm.js +0 -8
  248. package/dist/utils-byXsEz1u.cjs +0 -1
@@ -1,133 +0,0 @@
1
- import { E as o, A as c, t as m, b as g, n as u } from "./element-CPpT3rFQ.js";
2
- import { o as p } from "./if-defined-B0krMLad.js";
3
- import { r as $ } from "./state-C_1EOo3D.js";
4
- import { e as f, n as x } from "./ref-Bg_Swj5w.js";
5
- import { e as v } from "./class-map-CEnykyO_.js";
6
- import { e as b, i as T, t as s } from "./directive-oAbCiebi.js";
7
- import { r as y, p as w } from "./directive-helpers-rm-28gIj.js";
8
- import { P as C } from "./input-element-8nLwuQS4.js";
9
- import { s as E } from "./element-with-slot-Dqk6-TRR.js";
10
- import "./input-wrapper-Bs4CRNst.js";
11
- import "./icon-CxQcIa5F.js";
12
- /**
13
- * @license
14
- * Copyright 2020 Google LLC
15
- * SPDX-License-Identifier: BSD-3-Clause
16
- */
17
- const k = b(class extends T {
18
- constructor(e) {
19
- if (super(e), e.type !== s.PROPERTY && e.type !== s.ATTRIBUTE && e.type !== s.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
20
- if (!y(e)) throw Error("`live` bindings can only contain a single expression");
21
- }
22
- render(e) {
23
- return e;
24
- }
25
- update(e, [t]) {
26
- if (t === o || t === c) return t;
27
- const i = e.element, r = e.name;
28
- if (e.type === s.PROPERTY) {
29
- if (t === i[r]) return o;
30
- } else if (e.type === s.BOOLEAN_ATTRIBUTE) {
31
- if (!!t === i.hasAttribute(r)) return o;
32
- } else if (e.type === s.ATTRIBUTE && i.getAttribute(r) === t + "") return o;
33
- return w(e), t;
34
- }
35
- });
36
- var B = Object.defineProperty, l = (e, t, i, r) => {
37
- for (var a = void 0, h = e.length - 1, d; h >= 0; h--)
38
- (d = e[h]) && (a = d(t, i, a) || a);
39
- return a && B(t, i, a), a;
40
- };
41
- class n extends C {
42
- constructor() {
43
- super(...arguments), this.inputRef = f(), this.value = "", this.autocomplete = "off", this.rows = null, this.counterCurrent = 0;
44
- }
45
- attributeChangedCallback(t, i, r) {
46
- t === "value" && this.value !== i && (this.counterCurrent = r ? r.length : 0, this.valueChanged(r, i)), super.attributeChangedCallback(t, i, r);
47
- }
48
- updated(t) {
49
- var i;
50
- super.updated(t), t.has("value") && (this.counterCurrent = ((i = this.value) == null ? void 0 : i.length) || 0, this.valueChanged(this.value, t.get("value"))), t.has("id") && !this.name && this.id && (this.name = this.id);
51
- }
52
- render() {
53
- const t = v({
54
- "pkt-input": !0,
55
- "pkt-input--fullwidth": this.fullwidth,
56
- "pkt-input--counter-error": this.counter && this.counterMaxLength && this.value.length && this.value.length > this.counterMaxLength
57
- }), i = this.ariaLabelledby || `${this.id}-input-label`;
58
- return g`<pkt-input-wrapper
59
- label=${this.label}
60
- ?counter=${this.counter}
61
- ?disabled=${this.disabled}
62
- ?hasError=${this.hasError}
63
- ?inline=${this.inline}
64
- ?optionalTag=${this.optionalTag}
65
- ?required=${this.required}
66
- ?requiredTag=${this.requiredTag}
67
- useWrapper=${this.useWrapper}
68
- .ariaDescribedBy=${this.ariaDescribedBy}
69
- .counterCurrent=${this.counterCurrent}
70
- .counterMaxLength=${this.counterMaxLength}
71
- .errorMessage=${this.errorMessage}
72
- .forId="${this.id + "-input"}"
73
- .helptext=${this.helptext}
74
- .helptextDropdown=${this.helptextDropdown}
75
- .helptextDropdownButton=${this.helptextDropdownButton}
76
- .optionalText=${this.optionalText}
77
- .requiredText=${this.requiredText}
78
- .tagText=${this.tagText}
79
- class="pkt-textarea"
80
- >
81
- <div class="pkt-contents" slot="helptext">${E(this, "helptext")}</div>
82
- <textarea
83
- ${x(this.inputRef)}
84
- class=${t}
85
- id=${this.id + "-input"}
86
- name=${(this.name || this.id) + "-input"}
87
- placeholder=${p(this.placeholder)}
88
- .value=${k(this.value)}
89
- minlength=${p(this.minlength)}
90
- maxlength=${p(this.maxlength)}
91
- ?readonly=${this.readonly}
92
- autocomplete=${this.autocomplete}
93
- aria-labelledby=${i}
94
- aria-invalid=${this.hasError}
95
- aria-errormessage=${`${this.id}-error`}
96
- rows=${this.rows}
97
- ?disabled=${this.disabled}
98
- @input=${(r) => {
99
- this.value = r.target.value, this.onInput(), r.stopImmediatePropagation();
100
- }}
101
- @change=${(r) => {
102
- r.stopImmediatePropagation();
103
- }}
104
- @focus=${(r) => {
105
- this.onFocus(), r.stopImmediatePropagation();
106
- }}
107
- @blur=${(r) => {
108
- this.value = r.target.value, this.onBlur(), r.stopImmediatePropagation();
109
- }}
110
- ></textarea>
111
- </pkt-input-wrapper>`;
112
- }
113
- }
114
- l([
115
- u({ type: String, reflect: !0 })
116
- ], n.prototype, "value");
117
- l([
118
- u({ type: String })
119
- ], n.prototype, "autocomplete");
120
- l([
121
- u({ type: Number })
122
- ], n.prototype, "rows");
123
- l([
124
- $()
125
- ], n.prototype, "counterCurrent");
126
- try {
127
- m("pkt-textarea")(n);
128
- } catch {
129
- console.warn("Forsøker å definere <pkt-textarea>, men den er allerede definert");
130
- }
131
- export {
132
- n as P
133
- };
@@ -1,70 +0,0 @@
1
- "use strict";const t=require("./element-gR_VtSiD.cjs"),h=require("./if-defined-BOW3ODSj.cjs"),c=require("./state-Dg-53wQ8.cjs"),l=require("./ref-CL-Xk9Xm.cjs"),d=require("./class-map-CsENJXf1.cjs"),$=require("./input-element-DdVhUvva.cjs"),f=require("./element-with-slot-ZX-up7jO.cjs");require("./input-wrapper-Bv9aqqVq.cjs");require("./icon-q81vqPK_.cjs");var g=Object.defineProperty,r=(u,i,s,a)=>{for(var e=void 0,o=u.length-1,p;o>=0;o--)(p=u[o])&&(e=p(i,s,e)||e);return e&&g(i,s,e),e};class n extends $.PktInputElement{constructor(){super(...arguments),this.inputRef=l.e(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0}attributeChangedCallback(i,s,a){i==="value"&&this.value!==s&&(this.counterCurrent=a?a.length:0,this.valueChanged(a,s)),super.attributeChangedCallback(i,s,a)}updated(i){var s;super.updated(i),i.has("value")&&(this.counterCurrent=((s=this.value)==null?void 0:s.length)||0,this.valueChanged(this.value,i.get("value"))),i.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const i=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,s=d.e({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),a=this.ariaLabelledby||`${this.id}-input-label`;return t.b`
2
- <pkt-input-wrapper
3
- label="${this.label}"
4
- ?counter=${this.counter}
5
- ?disabled=${this.disabled}
6
- ?hasError=${this.hasError}
7
- ?hasFieldset=${this.hasFieldset}
8
- ?inline=${this.inline}
9
- ?optionalTag=${this.optionalTag}
10
- ?required=${this.required}
11
- ?requiredTag=${this.requiredTag}
12
- useWrapper=${this.useWrapper}
13
- .ariaDescribedBy=${this.ariaDescribedBy}
14
- .counterCurrent=${this.counterCurrent}
15
- .counterMaxLength=${this.counterMaxLength}
16
- .errorMessage=${this.errorMessage}
17
- .forId="${this.id+"-input"}"
18
- .helptext=${this.helptext}
19
- .helptextDropdown=${this.helptextDropdown}
20
- .helptextDropdownButton=${this.helptextDropdownButton}
21
- .optionalText=${this.optionalText}
22
- .requiredText=${this.requiredText}
23
- .tagText=${this.tagText}
24
- class="pkt-textinput"
25
- >
26
- <div class="pkt-contents" slot="helptext">${f.slotContent(this,"helptext")}</div>
27
- <div class="pkt-input__container">
28
- ${this.prefix?t.b`<div class="pkt-input-prefix">${this.prefix}</div>`:t.A}
29
- <input
30
- ${l.n(this.inputRef)}
31
- class=${s}
32
- type=${this.type}
33
- name=${(this.name||this.id)+"-input"}
34
- id=${this.id+"-input"}
35
- placeholder=${h.o(this.placeholder)}
36
- aria-labelledby=${a}
37
- autocomplete=${this.autocomplete||"off"}
38
- minlength=${h.o(this.minlength||void 0)}
39
- maxlength=${h.o(this.maxlength||void 0)}
40
- min=${h.o(this.min||void 0)}
41
- max=${h.o(this.max||void 0)}
42
- step=${h.o(this.step||void 0)}
43
- ?readonly=${this.readonly}
44
- size=${this.size||t.A}
45
- .value=${this.value}
46
- ?disabled=${this.disabled}
47
- aria-invalid=${this.hasError}
48
- aria-errormessage=${`${this.id}-error`}
49
- @input=${e=>{this.value=e.target.value,this.onInput(),e.stopImmediatePropagation()}}
50
- @change=${e=>{e.stopImmediatePropagation()}}
51
- @focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
52
- @blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
53
- @keydown=${e=>{var o;if(e.key==="Enter"){const p=this.internals.form;p?p.requestSubmit():(o=this.inputRef.value)==null||o.blur()}}}
54
- />
55
- ${this.suffix?t.b`<div class="pkt-input-suffix">
56
- ${this.suffix}
57
- ${this.iconNameRight?t.b`<pkt-icon
58
- class="pkt-input-suffix-icon"
59
- name=${this.iconNameRight}
60
- ></pkt-icon>`:t.A}
61
- ${i?t.b`<pkt-icon
62
- class="pkt-input-suffix-icon"
63
- name="magnifying-glass-big"
64
- ></pkt-icon>`:t.A}
65
- </div>`:t.A}
66
- ${!this.suffix&&this.iconNameRight?t.b`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>`:t.A}
67
- ${!this.suffix&&i?t.b`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>`:t.A}
68
- </div>
69
- </pkt-input-wrapper>
70
- `}}r([t.n({type:String,reflect:!0})],n.prototype,"value");r([t.n({type:String})],n.prototype,"type");r([t.n({type:Number})],n.prototype,"size");r([t.n({type:String})],n.prototype,"autocomplete");r([t.n({type:String})],n.prototype,"iconNameRight");r([t.n({type:String})],n.prototype,"prefix");r([t.n({type:String})],n.prototype,"suffix");r([t.n({type:Boolean})],n.prototype,"omitSearchIcon");r([c.r()],n.prototype,"counterCurrent");try{t.t("pkt-textinput")(n)}catch{console.warn("Forsøker å definere <pkt-textinput>, men den er allerede definert")}exports.PktTextinput=n;
@@ -1,152 +0,0 @@
1
- import { t as d, A as a, b as p, n } from "./element-CPpT3rFQ.js";
2
- import { o as l } from "./if-defined-B0krMLad.js";
3
- import { r as m } from "./state-C_1EOo3D.js";
4
- import { e as $, n as f } from "./ref-Bg_Swj5w.js";
5
- import { e as g } from "./class-map-CEnykyO_.js";
6
- import { P as x } from "./input-element-8nLwuQS4.js";
7
- import { s as v } from "./element-with-slot-Dqk6-TRR.js";
8
- import "./input-wrapper-Bs4CRNst.js";
9
- import "./icon-CxQcIa5F.js";
10
- var y = Object.defineProperty, r = (c, i, e, o) => {
11
- for (var t = void 0, h = c.length - 1, u; h >= 0; h--)
12
- (u = c[h]) && (t = u(i, e, t) || t);
13
- return t && y(i, e, t), t;
14
- };
15
- class s extends x {
16
- constructor() {
17
- super(...arguments), this.inputRef = $(), this.value = "", this.type = "text", this.size = null, this.autocomplete = null, this.iconNameRight = null, this.prefix = null, this.suffix = null, this.omitSearchIcon = !1, this.counterCurrent = 0;
18
- }
19
- attributeChangedCallback(i, e, o) {
20
- i === "value" && this.value !== e && (this.counterCurrent = o ? o.length : 0, this.valueChanged(o, e)), super.attributeChangedCallback(i, e, o);
21
- }
22
- updated(i) {
23
- var e;
24
- super.updated(i), i.has("value") && (this.counterCurrent = ((e = this.value) == null ? void 0 : e.length) || 0, this.valueChanged(this.value, i.get("value"))), i.has("id") && !this.name && this.id && (this.name = this.id);
25
- }
26
- render() {
27
- const i = this.type === "search" && !this.iconNameRight && !this.omitSearchIcon, e = g({
28
- "pkt-input": !0,
29
- "pkt-input--fullwidth": this.fullwidth,
30
- "pkt-input--counter-error": this.counter && this.counterMaxLength && this.value.length && this.value.length > this.counterMaxLength
31
- }), o = this.ariaLabelledby || `${this.id}-input-label`;
32
- return p`
33
- <pkt-input-wrapper
34
- label="${this.label}"
35
- ?counter=${this.counter}
36
- ?disabled=${this.disabled}
37
- ?hasError=${this.hasError}
38
- ?hasFieldset=${this.hasFieldset}
39
- ?inline=${this.inline}
40
- ?optionalTag=${this.optionalTag}
41
- ?required=${this.required}
42
- ?requiredTag=${this.requiredTag}
43
- useWrapper=${this.useWrapper}
44
- .ariaDescribedBy=${this.ariaDescribedBy}
45
- .counterCurrent=${this.counterCurrent}
46
- .counterMaxLength=${this.counterMaxLength}
47
- .errorMessage=${this.errorMessage}
48
- .forId="${this.id + "-input"}"
49
- .helptext=${this.helptext}
50
- .helptextDropdown=${this.helptextDropdown}
51
- .helptextDropdownButton=${this.helptextDropdownButton}
52
- .optionalText=${this.optionalText}
53
- .requiredText=${this.requiredText}
54
- .tagText=${this.tagText}
55
- class="pkt-textinput"
56
- >
57
- <div class="pkt-contents" slot="helptext">${v(this, "helptext")}</div>
58
- <div class="pkt-input__container">
59
- ${this.prefix ? p`<div class="pkt-input-prefix">${this.prefix}</div>` : a}
60
- <input
61
- ${f(this.inputRef)}
62
- class=${e}
63
- type=${this.type}
64
- name=${(this.name || this.id) + "-input"}
65
- id=${this.id + "-input"}
66
- placeholder=${l(this.placeholder)}
67
- aria-labelledby=${o}
68
- autocomplete=${this.autocomplete || "off"}
69
- minlength=${l(this.minlength || void 0)}
70
- maxlength=${l(this.maxlength || void 0)}
71
- min=${l(this.min || void 0)}
72
- max=${l(this.max || void 0)}
73
- step=${l(this.step || void 0)}
74
- ?readonly=${this.readonly}
75
- size=${this.size || a}
76
- .value=${this.value}
77
- ?disabled=${this.disabled}
78
- aria-invalid=${this.hasError}
79
- aria-errormessage=${`${this.id}-error`}
80
- @input=${(t) => {
81
- this.value = t.target.value, this.onInput(), t.stopImmediatePropagation();
82
- }}
83
- @change=${(t) => {
84
- t.stopImmediatePropagation();
85
- }}
86
- @focus=${(t) => {
87
- this.onFocus(), t.stopImmediatePropagation();
88
- }}
89
- @blur=${(t) => {
90
- this.value = t.target.value, this.onBlur(), t.stopImmediatePropagation();
91
- }}
92
- @keydown=${(t) => {
93
- var h;
94
- if (t.key === "Enter") {
95
- const u = this.internals.form;
96
- u ? u.requestSubmit() : (h = this.inputRef.value) == null || h.blur();
97
- }
98
- }}
99
- />
100
- ${this.suffix ? p`<div class="pkt-input-suffix">
101
- ${this.suffix}
102
- ${this.iconNameRight ? p`<pkt-icon
103
- class="pkt-input-suffix-icon"
104
- name=${this.iconNameRight}
105
- ></pkt-icon>` : a}
106
- ${i ? p`<pkt-icon
107
- class="pkt-input-suffix-icon"
108
- name="magnifying-glass-big"
109
- ></pkt-icon>` : a}
110
- </div>` : a}
111
- ${!this.suffix && this.iconNameRight ? p`<pkt-icon class="pkt-input-icon" name=${this.iconNameRight}></pkt-icon>` : a}
112
- ${!this.suffix && i ? p`<pkt-icon class="pkt-input-icon" name="magnifying-glass-big"></pkt-icon>` : a}
113
- </div>
114
- </pkt-input-wrapper>
115
- `;
116
- }
117
- }
118
- r([
119
- n({ type: String, reflect: !0 })
120
- ], s.prototype, "value");
121
- r([
122
- n({ type: String })
123
- ], s.prototype, "type");
124
- r([
125
- n({ type: Number })
126
- ], s.prototype, "size");
127
- r([
128
- n({ type: String })
129
- ], s.prototype, "autocomplete");
130
- r([
131
- n({ type: String })
132
- ], s.prototype, "iconNameRight");
133
- r([
134
- n({ type: String })
135
- ], s.prototype, "prefix");
136
- r([
137
- n({ type: String })
138
- ], s.prototype, "suffix");
139
- r([
140
- n({ type: Boolean })
141
- ], s.prototype, "omitSearchIcon");
142
- r([
143
- m()
144
- ], s.prototype, "counterCurrent");
145
- try {
146
- d("pkt-textinput")(s);
147
- } catch {
148
- console.warn("Forsøker å definere <pkt-textinput>, men den er allerede definert");
149
- }
150
- export {
151
- s as P
152
- };
@@ -1,8 +0,0 @@
1
- const t = () => ("00000000000000000" + (Math.random() * 18446744073709552e3).toString(16)).slice(-16), c = (e) => new Promise((s) => setTimeout(s, e)), i = () => {
2
- const e = t(), s = t();
3
- return e.slice(0, 8) + "-" + e.slice(8, 12) + "-4" + e.slice(13) + "-a" + s.slice(1, 4) + "-" + s.slice(4);
4
- };
5
- export {
6
- c as s,
7
- i as u
8
- };
@@ -1 +0,0 @@
1
- "use strict";const i=()=>("00000000000000000"+(Math.random()*18446744073709552e3).toString(16)).slice(-16),t=e=>new Promise(s=>setTimeout(s,e)),c=()=>{const e=i(),s=i();return e.slice(0,8)+"-"+e.slice(8,12)+"-4"+e.slice(13)+"-a"+s.slice(1,4)+"-"+s.slice(4)};exports.sleep=t;exports.uuidish=c;