@oslokommune/punkt-elements 18.0.0 → 18.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/{accordion-1_pdxTgJ.js → accordion-CcUosZjL.js} +5 -5
  3. package/dist/{accordion-DobbH-Sv.cjs → accordion-k0pWTG1X.cjs} +1 -1
  4. package/dist/alert-BD8YVKia.cjs +35 -0
  5. package/dist/{alert-xspFetQ8.js → alert-Bmaly2Yo.js} +46 -41
  6. package/dist/{async-directive-D2Sht790.js → async-directive-COqx0IYj.js} +2 -2
  7. package/dist/{async-directive-B5pcIMfO.cjs → async-directive-DN2eg9gA.cjs} +1 -1
  8. package/dist/{backlink-C0jZFnZ2.js → backlink-C_ZO-ZbR.js} +4 -4
  9. package/dist/{backlink-ZMhqHaVs.cjs → backlink-Ch64Pivx.cjs} +1 -1
  10. package/dist/base-elements/element.d.ts +6 -1
  11. package/dist/base-elements/input-element.d.ts +2 -1
  12. package/dist/{breadcrumbs-BvMownZN.js → breadcrumbs-CF_gAbUk.js} +2 -2
  13. package/dist/{breadcrumbs-BS64xd1s.cjs → breadcrumbs-CzzbardP.cjs} +1 -1
  14. package/dist/{button-C44vNLFC.js → button-C1CQSASU.js} +5 -5
  15. package/dist/{button-CR4CXtnj.cjs → button-CF3dNKeI.cjs} +1 -1
  16. package/dist/{calendar-DQ4byeom.cjs → calendar-BxF81kB9.cjs} +1 -1
  17. package/dist/{calendar-DgjCKMMV.js → calendar-DRmxORMc.js} +3 -3
  18. package/dist/{card-Dpqi6HVt.cjs → card-Cg1daj05.cjs} +1 -1
  19. package/dist/{card-DhHqC265.js → card-W_Jb0Tlo.js} +7 -7
  20. package/dist/{checkbox-CXQxbiaX.cjs → checkbox-BHQv8lHq.cjs} +1 -1
  21. package/dist/{checkbox-BQ1K57AB.js → checkbox-BQw2dMSX.js} +4 -4
  22. package/dist/{class-map-CzCE5pqG.cjs → class-map-C33ixq7O.cjs} +1 -1
  23. package/dist/{class-map-F1DJHyb7.js → class-map-wh4Yi3oj.js} +1 -1
  24. package/dist/{combobox-BV4oDiII.cjs → combobox-BpZow9OU.cjs} +1 -1
  25. package/dist/{combobox-DPck39I2.js → combobox-C9wwnUfM.js} +12 -12
  26. package/dist/components/accordion/accordion.d.ts +2 -6
  27. package/dist/components/accordion/accordionitem.d.ts +2 -8
  28. package/dist/components/alert/alert.d.ts +5 -4
  29. package/dist/components/backlink/backlink.d.ts +4 -5
  30. package/dist/components/backlink/backlink.test.d.ts +1 -1
  31. package/dist/components/breadcrumbs/breadcrumbs.d.ts +7 -8
  32. package/dist/components/breadcrumbs/index.d.ts +1 -1
  33. package/dist/components/calendar/calendar.d.ts +2 -1
  34. package/dist/components/combobox/combobox-base.d.ts +2 -1
  35. package/dist/components/combobox/combobox.d.ts +2 -1
  36. package/dist/components/datepicker/date-tags.d.ts +2 -1
  37. package/dist/components/datepicker/datepicker.d.ts +2 -1
  38. package/dist/components/fileupload/fileupload-base.d.ts +4 -2
  39. package/dist/components/fileupload/fileupload-types.d.ts +5 -43
  40. package/dist/components/header/types.d.ts +3 -2
  41. package/dist/components/helptext/helptext.d.ts +2 -1
  42. package/dist/components/index.d.ts +2 -2
  43. package/dist/components/input-wrapper/input-wrapper.d.ts +2 -1
  44. package/dist/components/listbox/listbox.d.ts +3 -2
  45. package/dist/components/tag/tag.d.ts +2 -1
  46. package/dist/components/timepicker/timepicker.d.ts +2 -1
  47. package/dist/{consent-_N9foluG.cjs → consent-CPtr7cBw.cjs} +1 -1
  48. package/dist/{consent-BneInZov.js → consent-D8MrqGKk.js} +2 -2
  49. package/dist/{datepicker-nSSSr1U7.js → datepicker-D4YnAtWG.js} +11 -11
  50. package/dist/{datepicker-9NX5qt2z.cjs → datepicker-DaoumZT9.cjs} +1 -1
  51. package/dist/define-component-spec-BYOSeplU.js +6 -0
  52. package/dist/define-component-spec-DBNd2FJY.cjs +1 -0
  53. package/dist/{directive-helpers-BARw3nEZ.js → directive-helpers-BWSAVe00.js} +1 -1
  54. package/dist/{directive-helpers-D6AAMFKs.cjs → directive-helpers-C6J4AkFk.cjs} +1 -1
  55. package/dist/docs/components/alert.d.ts +2 -3
  56. package/dist/{element-B8OGznK0.cjs → element-DiFhBcIl.cjs} +1 -1
  57. package/dist/{element-BKSPVgs2.js → element-WEzISABa.js} +1 -0
  58. package/dist/{element-with-slot-YUAUFRqw.js → element-with-slot-BKYUx4gb.js} +2 -2
  59. package/dist/{element-with-slot-DTxILHVv.cjs → element-with-slot-CBK4zrdN.cjs} +1 -1
  60. package/dist/{fileupload-E0LGGNgj.js → fileupload-DEHSETw0.js} +110 -412
  61. package/dist/{fileupload-D05VSbEP.cjs → fileupload-DWu6FIMv.cjs} +37 -37
  62. package/dist/{footer-DYilVBMC.js → footer-BJLEw6Ab.js} +4 -4
  63. package/dist/{footer-DBApIdGh.cjs → footer-D_yYWkQ6.cjs} +1 -1
  64. package/dist/{header-B7tbX-Ok.cjs → header-B7_4Cwaq.cjs} +1 -1
  65. package/dist/{header-v3GWAzOK.js → header-DLVq7-dM.js} +11 -11
  66. package/dist/{header-menu-D522-VTV.js → header-menu-BsrrTjpT.js} +4 -4
  67. package/dist/{header-menu-1FFWhvNc.cjs → header-menu-m7nOOC1g.cjs} +1 -1
  68. package/dist/{heading-rx_oSCqe.js → heading-DSArgrDK.js} +2 -2
  69. package/dist/{heading-CvytvcL7.cjs → heading-_RPw2UW9.cjs} +1 -1
  70. package/dist/{helptext-DYFdcylX.cjs → helptext-QMVsW5g6.cjs} +1 -1
  71. package/dist/{helptext-LShGPm-b.js → helptext-dtVVufNH.js} +4 -4
  72. package/dist/{icon-HYU1f54x.js → icon-DEtOSWRK.js} +1 -1
  73. package/dist/{icon-BmMC09mi.cjs → icon-DIavy2cB.cjs} +1 -1
  74. package/dist/{if-defined-BF8XcDi5.js → if-defined-BmnvvxtR.js} +1 -1
  75. package/dist/if-defined-Dc3xFDaM.cjs +1 -0
  76. package/dist/{input-element-DumGj_oJ.cjs → input-element-DQY1Rpbp.cjs} +1 -1
  77. package/dist/{input-element-D07DmR34.js → input-element-IBypGOaV.js} +2 -2
  78. package/dist/{input-wrapper-Cci_wTvD.js → input-wrapper-CQgAL1Br.js} +6 -6
  79. package/dist/{input-wrapper-DDfapoRX.cjs → input-wrapper-mJZLVXy_.cjs} +1 -1
  80. package/dist/{link-CQK0SH4H.js → link-DwLeY37f.js} +51 -18
  81. package/dist/link-yk4IXDWm.cjs +7 -0
  82. package/dist/{linkcard-DNYsVlV6.cjs → linkcard-BinKnxQF.cjs} +1 -1
  83. package/dist/{linkcard-B4GlmjJ6.js → linkcard-D5DXpmXI.js} +4 -4
  84. package/dist/{listbox-BlFRhyI7.cjs → listbox-C5zTRNAO.cjs} +1 -1
  85. package/dist/{listbox-wd_OofyF.js → listbox-C8ooO8qZ.js} +4 -4
  86. package/dist/{loader-0C3qVk16.js → loader-C3HyayzL.js} +4 -4
  87. package/dist/{loader-B9u2qUlR.cjs → loader-DHF7M5Vn.cjs} +1 -1
  88. package/dist/{messagebox-BD5tGmT-.cjs → messagebox-DqYf6VmQ.cjs} +1 -1
  89. package/dist/{messagebox-C-y1ICmr.js → messagebox-u8i3R5QA.js} +4 -4
  90. package/dist/{modal-BzPGQYCs.cjs → modal-CnJ9y2TQ.cjs} +1 -1
  91. package/dist/{modal-Cghs3w-d.js → modal-V-jEe0aY.js} +5 -5
  92. package/dist/pkt-accordion.cjs +1 -1
  93. package/dist/pkt-accordion.js +1 -1
  94. package/dist/pkt-alert.cjs +1 -1
  95. package/dist/pkt-alert.js +1 -1
  96. package/dist/pkt-backlink.cjs +1 -1
  97. package/dist/pkt-backlink.js +1 -1
  98. package/dist/pkt-breadcrumbs.cjs +1 -1
  99. package/dist/pkt-breadcrumbs.js +1 -1
  100. package/dist/pkt-button.cjs +1 -1
  101. package/dist/pkt-button.js +1 -1
  102. package/dist/pkt-calendar.cjs +1 -1
  103. package/dist/pkt-calendar.js +1 -1
  104. package/dist/pkt-card.cjs +1 -1
  105. package/dist/pkt-card.js +1 -1
  106. package/dist/pkt-checkbox.cjs +1 -1
  107. package/dist/pkt-checkbox.js +1 -1
  108. package/dist/pkt-combobox.cjs +1 -1
  109. package/dist/pkt-combobox.js +1 -1
  110. package/dist/pkt-consent.cjs +1 -1
  111. package/dist/pkt-consent.js +1 -1
  112. package/dist/pkt-datepicker.cjs +1 -1
  113. package/dist/pkt-datepicker.js +1 -1
  114. package/dist/pkt-fileupload.cjs +1 -1
  115. package/dist/pkt-fileupload.js +1 -1
  116. package/dist/pkt-footer.cjs +1 -1
  117. package/dist/pkt-footer.js +1 -1
  118. package/dist/pkt-header-menu.cjs +1 -1
  119. package/dist/pkt-header-menu.js +1 -1
  120. package/dist/pkt-header.cjs +1 -1
  121. package/dist/pkt-header.js +1 -1
  122. package/dist/pkt-heading.cjs +1 -1
  123. package/dist/pkt-heading.js +1 -1
  124. package/dist/pkt-helptext.cjs +1 -1
  125. package/dist/pkt-helptext.js +1 -1
  126. package/dist/pkt-icon.cjs +1 -1
  127. package/dist/pkt-icon.js +1 -1
  128. package/dist/pkt-index.cjs +1 -1
  129. package/dist/pkt-index.js +34 -34
  130. package/dist/pkt-input-wrapper.cjs +1 -1
  131. package/dist/pkt-input-wrapper.js +1 -1
  132. package/dist/pkt-link.cjs +1 -1
  133. package/dist/pkt-link.js +1 -1
  134. package/dist/pkt-linkcard.cjs +1 -1
  135. package/dist/pkt-linkcard.js +1 -1
  136. package/dist/pkt-listbox.cjs +1 -1
  137. package/dist/pkt-listbox.js +1 -1
  138. package/dist/pkt-loader.cjs +1 -1
  139. package/dist/pkt-loader.js +1 -1
  140. package/dist/pkt-messagebox.cjs +1 -1
  141. package/dist/pkt-messagebox.js +1 -1
  142. package/dist/pkt-modal.cjs +1 -1
  143. package/dist/pkt-modal.js +1 -1
  144. package/dist/{pkt-options-controller-CEEAqXaB.cjs → pkt-options-controller-BhMNCWcc.cjs} +1 -1
  145. package/dist/{pkt-options-controller-PtjhmTGk.js → pkt-options-controller-CuQ6SClv.js} +1 -1
  146. package/dist/pkt-progressbar.cjs +1 -1
  147. package/dist/pkt-progressbar.js +1 -1
  148. package/dist/pkt-radiobutton.cjs +1 -1
  149. package/dist/pkt-radiobutton.js +1 -1
  150. package/dist/pkt-searchinput.cjs +1 -1
  151. package/dist/pkt-searchinput.js +1 -1
  152. package/dist/pkt-select.cjs +1 -1
  153. package/dist/pkt-select.js +1 -1
  154. package/dist/pkt-tabs.cjs +1 -1
  155. package/dist/pkt-tabs.js +1 -1
  156. package/dist/pkt-tag.cjs +1 -1
  157. package/dist/pkt-tag.js +1 -1
  158. package/dist/pkt-textarea.cjs +1 -1
  159. package/dist/pkt-textarea.js +1 -1
  160. package/dist/pkt-textinput.cjs +1 -1
  161. package/dist/pkt-textinput.js +1 -1
  162. package/dist/pkt-timepicker.cjs +1 -1
  163. package/dist/pkt-timepicker.js +1 -1
  164. package/dist/{progressbar-BexQQw1o.js → progressbar-DS4i8IWq.js} +4 -4
  165. package/dist/{progressbar-X9mSvpjw.cjs → progressbar-DY5hxImR.cjs} +1 -1
  166. package/dist/{radiobutton-CkhTasn4.js → radiobutton-BhvZztMZ.js} +4 -4
  167. package/dist/{radiobutton-ln29Ad3U.cjs → radiobutton-BswqwRnA.cjs} +1 -1
  168. package/dist/{ref-CHbJYtKE.cjs → ref-DZmN5Qgj.cjs} +1 -1
  169. package/dist/{ref-Chc_DZAb.js → ref-OU8ryfP6.js} +2 -2
  170. package/dist/{repeat-CHDs__rN.cjs → repeat-DIa_g6WL.cjs} +1 -1
  171. package/dist/{repeat-P9SMlKd5.js → repeat-Dx2H127b.js} +2 -2
  172. package/dist/{searchinput-Da7dKHBH.js → searchinput-CJo1PpM7.js} +4 -4
  173. package/dist/{searchinput-CPgMEAZZ.cjs → searchinput-Cl46nW0r.cjs} +1 -1
  174. package/dist/{select-jabMSjft.js → select-CBrjauXT.js} +7 -7
  175. package/dist/{select-DCuvdAuK.cjs → select-Dman8Skr.cjs} +1 -1
  176. package/dist/shared-strings/index.d.ts +1 -1
  177. package/dist/shared-strings/nb.d.ts +3 -0
  178. package/dist/shared-strings/types.d.ts +17 -0
  179. package/dist/shared-types/accordion.d.ts +58 -0
  180. package/dist/shared-types/alert.d.ts +20 -0
  181. package/dist/shared-types/aria.d.ts +2 -1
  182. package/dist/shared-types/backlink.d.ts +23 -0
  183. package/dist/shared-types/breadcrumbs.d.ts +33 -0
  184. package/dist/shared-types/fileupload.d.ts +56 -2
  185. package/dist/shared-types/footer.d.ts +10 -0
  186. package/dist/shared-types/form-field.d.ts +46 -0
  187. package/dist/shared-types/header-footer.d.ts +2 -0
  188. package/dist/shared-types/index.d.ts +15 -5
  189. package/dist/shared-types/render-link.d.ts +22 -0
  190. package/dist/shared-types/searchinput.d.ts +2 -1
  191. package/dist/shared-types/skin.d.ts +2 -9
  192. package/dist/{tabs-DV5CQNDL.cjs → tabs-C1m5rSrR.cjs} +1 -1
  193. package/dist/{tabs-D_hoi1zu.js → tabs-Xu3mIedh.js} +4 -4
  194. package/dist/{tag-DK5SgKry.js → tag-Azkjhkeu.js} +5 -5
  195. package/dist/{tag-BxYulmZn.cjs → tag-BS6dDPxY.cjs} +1 -1
  196. package/dist/{textarea-BR7Riace.js → textarea-D4qXcVGD.js} +9 -9
  197. package/dist/{textarea-ffBD_VHq.cjs → textarea-DftUkR6w.cjs} +1 -1
  198. package/dist/{textinput-CtHFzAux.cjs → textinput-Ar-1Sbqy.cjs} +1 -1
  199. package/dist/{textinput-CRNrsRNV.js → textinput-iCgwwNPU.js} +8 -8
  200. package/dist/{timepicker-ixs_E5RY.js → timepicker-W6HVWtmA.js} +8 -8
  201. package/dist/{timepicker-AfgJipo6.cjs → timepicker-dpAF7h49.cjs} +1 -1
  202. package/package.json +2 -2
  203. package/src/components/accordion/accordion.ts +2 -10
  204. package/src/components/accordion/accordionitem.ts +2 -9
  205. package/src/components/alert/alert.ts +21 -12
  206. package/src/components/backlink/backlink.test.ts +3 -3
  207. package/src/components/backlink/backlink.ts +4 -6
  208. package/src/components/breadcrumbs/breadcrumbs.ts +9 -10
  209. package/src/components/breadcrumbs/index.ts +1 -1
  210. package/src/components/calendar/calendar.ts +2 -1
  211. package/src/components/combobox/combobox-base.ts +2 -1
  212. package/src/components/combobox/combobox.ts +2 -1
  213. package/src/components/datepicker/date-tags.ts +2 -1
  214. package/src/components/datepicker/datepicker.ts +3 -1
  215. package/src/components/fileupload/fileupload-base.ts +4 -3
  216. package/src/components/fileupload/fileupload-types.ts +5 -42
  217. package/src/components/header/types.ts +6 -4
  218. package/src/components/helptext/helptext.ts +2 -1
  219. package/src/components/index.ts +2 -2
  220. package/src/components/input-wrapper/input-wrapper.ts +3 -2
  221. package/src/components/link/link.ts +8 -3
  222. package/src/components/listbox/listbox.ts +3 -2
  223. package/src/components/tag/tag.ts +2 -2
  224. package/src/components/timepicker/timepicker.ts +3 -2
  225. package/dist/alert-COeHz6o2.cjs +0 -33
  226. package/dist/if-defined-CVYApOgK.cjs +0 -1
  227. package/dist/link-11g2ZNin.cjs +0 -7
@@ -1,15 +1,15 @@
1
- import { _ as e, d as t, l as n, n as r, s as i, t as a, u as o } from "./element-BKSPVgs2.js";
2
- import { t as s } from "./class-map-F1DJHyb7.js";
1
+ import { _ as e, d as t, l as n, n as r, s as i, t as a, u as o } from "./element-WEzISABa.js";
2
+ import { t as s } from "./class-map-wh4Yi3oj.js";
3
3
  import { n as c, t as l } from "./format-BTeSVkED.js";
4
- import "./alert-xspFetQ8.js";
5
- import "./icon-HYU1f54x.js";
6
- import { t as u } from "./if-defined-BF8XcDi5.js";
4
+ import "./alert-Bmaly2Yo.js";
5
+ import "./icon-DEtOSWRK.js";
6
+ import { t as u } from "./if-defined-BmnvvxtR.js";
7
7
  import { t as d } from "./converters-CkjLSYpa.js";
8
8
  import { n as f } from "./utils-BwF4QSrq.js";
9
- import "./input-wrapper-Cci_wTvD.js";
9
+ import "./input-wrapper-CQgAL1Br.js";
10
10
  import { r as p } from "./focus-trap-DG3pEuyJ.js";
11
- import "./modal-Cghs3w-d.js";
12
- import "./progressbar-BexQQw1o.js";
11
+ import "./modal-V-jEe0aY.js";
12
+ import "./progressbar-DS4i8IWq.js";
13
13
  //#region ../../shared-utils/fileupload/size.ts
14
14
  function m(e) {
15
15
  if (e == null || e === "") return;
@@ -106,7 +106,7 @@ function T(e) {
106
106
  function E(e) {
107
107
  return typeof e == "number" ? "in-progress" : e === "error" ? "error" : "idle";
108
108
  }
109
- function D(e, t, n) {
109
+ function ee(e, t, n) {
110
110
  let r = {
111
111
  "in-progress": 0,
112
112
  error: 1,
@@ -125,7 +125,7 @@ function D(e, t, n) {
125
125
  }
126
126
  //#endregion
127
127
  //#region ../../shared-utils/fileupload/truncate.ts
128
- function O(e, t) {
128
+ function D(e, t) {
129
129
  return !t || t <= 0 || e.length <= t + 3 ? null : {
130
130
  head: e.slice(0, e.length - t),
131
131
  tail: e.slice(-t)
@@ -133,12 +133,12 @@ function O(e, t) {
133
133
  }
134
134
  //#endregion
135
135
  //#region ../../shared-utils/fileupload/navigation.ts
136
- function k(e, t, n) {
136
+ function O(e, t, n) {
137
137
  return n <= 0 ? 0 : t === "prev" ? e <= 0 ? n - 1 : e - 1 : e >= n - 1 ? 0 : e + 1;
138
138
  }
139
139
  //#endregion
140
140
  //#region ../../shared-utils/fileupload/announcements.ts
141
- function A(e, t) {
141
+ function k(e, t) {
142
142
  let n = e.length;
143
143
  if (n === 0 || !t || t.length === 0) return {
144
144
  totalCount: n,
@@ -158,316 +158,14 @@ function A(e, t) {
158
158
  }
159
159
  //#endregion
160
160
  //#region ../../shared-utils/fileupload/filename.ts
161
- function j(e, t = i.fileupload.unknownFilename) {
161
+ function A(e, t = i.fileupload.unknownFilename) {
162
162
  return e.attributes?.targetFilename || e.file?.name || t;
163
163
  }
164
- var M = {
165
- name: "pkt-fileupload",
166
- react: "PktFileUpload",
167
- "css-class": "pkt-fileupload",
168
- isElement: !1,
169
- isPureReact: !0,
170
- "dark-mode": !0,
171
- props: {
172
- name: {
173
- type: "string",
174
- name: "Navn for innsending",
175
- category: "tech",
176
- required: !0
177
- },
178
- label: {
179
- type: "string",
180
- name: "Etikett",
181
- description: "Etikett/tittel over komponenten",
182
- category: "form"
183
- },
184
- helptext: {
185
- type: "string | ReactNode",
186
- name: "Hjelpetekst",
187
- description: "Hjelpetekst under etiketten",
188
- category: "form"
189
- },
190
- helptextDropdown: {
191
- type: "string",
192
- name: "Utvidet hjelpetekst",
193
- description: "Hjelpetekst som vises i en lukket boks man kan åpne",
194
- category: "contents"
195
- },
196
- helptextDropdownButton: {
197
- type: "string",
198
- name: "Knappetekst for utvidet hjelpetekst",
199
- default: "Les mer",
200
- category: "contents"
201
- },
202
- required: {
203
- type: "boolean",
204
- name: "Påkrevd",
205
- description: "Gjør feltet obligatorisk. I `uploadStrategy='form'` brukes native validering på file input. I `uploadStrategy='custom'` valideres kravet ved submit og komponenten viser feilmelding hvis ingen filer er valgt.",
206
- default: !1,
207
- category: "form"
208
- },
209
- value: {
210
- type: "FileItemList",
211
- name: "Fil-liste (controlled)",
212
- description: "Liste over filer i komponenten. Bruk denne for controlled-modus.",
213
- category: "form"
214
- },
215
- defaultValue: {
216
- type: "FileItem[]",
217
- name: "Default-verdi (uncontrolled)",
218
- description: "Default-verdi når komponenten brukes 'uncontrolled'. Ingen grunn til at denne ikke skal være tom array `[]`",
219
- category: "form"
220
- },
221
- onFilesChanged: {
222
- type: "(files: FileItem[]) => void",
223
- name: "Callback ved fil-endring",
224
- description: "Kalles når fil(er) legges til, fjernes eller oppdateres",
225
- category: "tech"
226
- },
227
- uploadStrategy: {
228
- name: "Opplastingstype",
229
- type: ["form", "custom"],
230
- values: {
231
- form: "form (når filer lastes opp ved submit)",
232
- custom: "custom (når filer lastes opp via webappens egen logikk)"
233
- },
234
- description: "Velg mellom skjemaopplasting (filene sendes når skjemaet sendes inn) og bakgrunnsopplasting (webappen håndterer opplasting via `onFileUploadRequested` og oppdaterer `transfers`).",
235
- default: "form",
236
- category: "functionality"
237
- },
238
- multiple: {
239
- type: "boolean",
240
- name: "Tillat opplasting av flere filer",
241
- default: !1,
242
- category: "functionality"
243
- },
244
- itemRenderer: {
245
- type: ["filename", "thumbnail"],
246
- name: "Visningtype av filer",
247
- description: "Hvordan filer skal vises i opplastings-køen. Enten filnavn eller som thumbnails. Du kan også (eksperimentelt) lage din egen komponent.",
248
- default: "filename",
249
- category: "functionality"
250
- },
251
- optionalTag: {
252
- type: "boolean",
253
- name: "Vis 'Valgfritt'-tag",
254
- description: "Vis 'Valgfritt'-tag ved etiketten",
255
- category: "form"
256
- },
257
- optionalText: {
258
- type: "string",
259
- name: "Valgfritt-tekst",
260
- description: "Tekst som vises i valgfritt-merkingen",
261
- default: "Valgfritt",
262
- category: "contents"
263
- },
264
- requiredTag: {
265
- type: "boolean",
266
- name: "Vis 'Må fylles ut'-tag",
267
- description: "Vis 'Må fylles ut'-tag ved etiketten",
268
- category: "form"
269
- },
270
- requiredText: {
271
- type: "string",
272
- name: "Påkrevd-tekst",
273
- description: "Tekst som vises i påkrevd-merkingen",
274
- default: "Må fylles ut",
275
- category: "contents"
276
- },
277
- tagText: {
278
- type: "string",
279
- name: "Tag-tekst",
280
- description: "Tekst som vises i en tag ved siden av label",
281
- category: "ui"
282
- },
283
- disabled: {
284
- type: "boolean",
285
- name: "Deaktivert",
286
- description: "Deaktiverer hele komponenten - ingen interaksjon mulig",
287
- default: !1,
288
- category: "form"
289
- },
290
- errorMessage: {
291
- type: "string",
292
- name: "Feilmelding",
293
- description: "Feilmelding for å vise under komponenten (ekstern/programmatisk feil)",
294
- default: "Det oppstod en feil ved opplastingen av fil(ene).",
295
- category: "form"
296
- },
297
- hasError: {
298
- type: "boolean",
299
- name: "Har feil",
300
- description: "Om komponenten har en feiltilstand",
301
- default: !1,
302
- category: "form"
303
- },
304
- allowedFormats: {
305
- type: "string[]",
306
- name: "Tillatte filformater",
307
- description: "Liste over tillatte filformater. F.eks. ['pdf', 'jpg', 'png'] eller ['image/*', 'application/pdf']",
308
- category: "validation"
309
- },
310
- formatErrorMessage: {
311
- type: "string",
312
- name: "Feilmelding for ugyldig format",
313
- description: "Tilpasset feilmelding ved ugyldig filtype.",
314
- category: "validation"
315
- },
316
- maxFileSize: {
317
- type: "string | number",
318
- name: "Maks filstørrelse",
319
- description: "Maksimal filstørrelse. F.eks. '5MB', '500KB', '1GB' eller antall bytes",
320
- category: "validation"
321
- },
322
- onFileValidation: {
323
- type: "(file: File) => string | null",
324
- name: "Egendefinert validering",
325
- description: "Kjører etter innebygd format/størrelse-validering. Returner feilmeldingsstreng hvis ugyldig, null hvis gyldig.",
326
- category: "validation"
327
- },
328
- sizeErrorMessage: {
329
- type: "string",
330
- name: "Feilmelding for stor fil",
331
- description: "Tilpasset feilmelding ved for stor fil.",
332
- category: "validation"
333
- },
334
- addCommentsEnabled: {
335
- type: "boolean",
336
- name: "Tillat kommentarer",
337
- description: "La brukeren skrive en kommentar pr fil. Kommentarene postes i felter med navn `{fileupload-navn}-comment`",
338
- default: !1,
339
- showIf: { itemRenderer: "filename" },
340
- category: "functionality"
341
- },
342
- enableImagePreview: {
343
- type: "boolean",
344
- name: "Forhåndsvisning av bilder",
345
- description: "Aktiver forhåndsvisning av bilder i modal (kun for thumbnail-visning)",
346
- default: !1,
347
- showIf: { itemRenderer: "thumbnail" },
348
- category: "functionality"
349
- },
350
- extraOperations: {
351
- type: "Array<QueueItemOperation>",
352
- name: "Ekstra operasjoner",
353
- description: "Ekstra operasjoner pr fil (eksperimentelt). Hver operasjon er et objekt med stabil `id`, `title` og valgfrie `onClick`/`renderInlineUI`/`renderExtendedUI`/`renderContent`/`renderHidden`. Callbacks får et `context`-objekt med file, disabled, isActive, activate, close, getAttribute og setAttribute.",
354
- category: "functionality"
355
- },
356
- fullwidth: {
357
- type: "boolean",
358
- name: "Full bredde",
359
- description: "Om komponenten skal ta full bredde av foreldreelementet",
360
- default: !1,
361
- category: "styling"
362
- },
363
- onFileUploadRequested: {
364
- type: "(fileItem: FileItem) => void",
365
- name: "Callback for opplastingsforespørsel",
366
- description: "Ved <code>uploadStrategy='custom'</code> blir denne funksjonen kalt når brukeren velger en eller flere filer. Dette lar webappen sette i gang opplasting i bakgrunnen.",
367
- relatedTypes: ["FileItem"],
368
- category: "functionality"
369
- },
370
- onTransferCancelled: {
371
- type: "(fileItemId: string) => void",
372
- name: "Callback for avbrutt opplasting",
373
- description: "Kalles når brukeren klikker 'Slett' eller 'Avbryt'. Webappen må dermed avbryte opplastingen av denne fila.",
374
- category: "functionality"
375
- },
376
- renameFilesEnabled: {
377
- type: "boolean",
378
- name: "Tillat å gi nytt navn",
379
- description: "La brukeren angi et navn pr fil. Filnavnene postes i felter med navn `{fileupload-navn}-targetFilename`",
380
- default: !1,
381
- showIf: { itemRenderer: "filename" },
382
- category: "functionality"
383
- },
384
- transfers: {
385
- type: "Array<FileTransfer>",
386
- name: "Pågående filoverføringer",
387
- description: "Ved <code>uploadStrategy='custom'</code> vil du fortelle komponenten om pågående overføringer her. Hver fil har en progress-verdi.",
388
- items: {
389
- type: "object",
390
- elementType: "FileTransfer",
391
- ref: "FileTransfer"
392
- },
393
- category: "functionality"
394
- },
395
- truncateTail: {
396
- type: "number",
397
- name: "Forkort filnavn",
398
- description: "Hvordan lange filnavn skal forkortes med ellipse i køen. Med `4` vil filnavnet vises som `langt-filnavn-med ... .pdf`. Med verdi `0` kommer ellipsen til slutt.",
399
- category: "functionality"
400
- },
401
- previewUploadIntervalMs: {
402
- type: "number",
403
- name: "Demo: opplastingshastighet (ms/5%)",
404
- description: "Kun for dokumentasjons-forhåndsvisning. Senker simulert opplasting for å demonstrere statusvisning. Gjelder kun i `uploadStrategy='custom'`.",
405
- default: 100,
406
- showIf: { uploadStrategy: "custom" },
407
- category: "demo"
408
- },
409
- previewSimulateUploadError: {
410
- type: "boolean",
411
- name: "Demo: simuler feil ved 90% opplasting",
412
- description: "Kun for dokumentasjons-forhåndsvisning. Hvis aktivert feiler simulert opplasting rundt 90%.",
413
- default: !1,
414
- showIf: { uploadStrategy: "custom" },
415
- category: "demo"
416
- },
417
- previewUploadStatus: {
418
- type: ["progressbar", "text"],
419
- name: "Visning av opplastingstatus",
420
- description: "Kun for dokumentasjons-forhåndsvisning. Vises kun når `uploadStrategy='custom'`. Status vises først etter at brukeren faktisk har valgt fil(er).",
421
- default: "progressbar",
422
- showIf: { uploadStrategy: "custom" },
423
- category: "demo"
424
- }
425
- },
426
- types: {
427
- FileItem: {
428
- description: "En valgt fil i køen. <code>FileItemList</code> er en array av <code>FileItem</code>. Brukes som parameter i callbacks som <code>onFileUploadRequested</code> og i <code>FileItemList</code> (<code>value</code> / <code>defaultValue</code>).",
429
- properties: {
430
- fileId: {
431
- type: "string",
432
- description: "Unik id for filen i komponenten."
433
- },
434
- file: {
435
- type: "File",
436
- description: "Fil-objektet fra nettleseren."
437
- },
438
- attributes: {
439
- type: "Record<string, unknown>",
440
- description: "Metadata per fil (f.eks. <code>targetFilename</code> for visningsnavn)."
441
- }
442
- }
443
- },
444
- FileTransfer: {
445
- description: "Status for én pågående opplasting når <code>uploadStrategy=\"custom\"</code>.",
446
- properties: {
447
- fileId: {
448
- type: "string",
449
- description: "Kobler til <code>FileItem.fileId</code>."
450
- },
451
- progress: {
452
- type: "number | 'done' | 'error' | 'canceled' | 'queued'",
453
- description: "Fremdrift (<code>0..1</code>) eller tilstand."
454
- },
455
- errorMessage: {
456
- type: "string",
457
- description: "Feilmelding ved <code>error</code>.",
458
- required: !1
459
- },
460
- showProgress: {
461
- type: "boolean",
462
- description: "Vis determinate progress vs. «Laster opp…».",
463
- required: !1
464
- }
465
- }
466
- }
467
- }
468
- }, N = class extends a {
164
+ //#endregion
165
+ //#region src/components/fileupload/fileupload-base.ts
166
+ var j = class extends a {
469
167
  constructor(...e) {
470
- super(...e), this.id = `pkt-fileupload-${f()}`, this.name = "files", this.label = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = M.props.helptextDropdownButton.default, this.required = !1, this.multiple = !1, this.disabled = !1, this.fullwidth = !1, this.uploadStrategy = "form", this.itemRenderer = "filename", this.accept = "", this.allowedFormats = [], this.formatErrorMessage = "", this.sizeErrorMessage = "", this.transfers = [], this.addCommentsEnabled = !1, this.renameFilesEnabled = !1, this.extraOperations = [], this.enableImagePreview = !1, this.hasError = !1, this.errorMessage = "", this.optionalTag = !1, this.requiredTag = !1, this.requiredText = M.props.requiredText.default, this.tagText = null, this.truncateTail = 4, this.files = [], this.isDragActive = !1, this.validationErrorMessage = null, this.addedAnnouncement = "", this.thumbnailUrls = {}, this.hasInitializedValue = !1, this.hasWarnedInvalidValueCombo = !1, this.thumbnailFileById = /* @__PURE__ */ new Map(), this.connectedForm = null, this.addedAnnouncementTimer = null, this.onNativeFileChange = (e) => {
168
+ super(...e), this.id = `pkt-fileupload-${f()}`, this.name = "files", this.label = "", this.helptext = "", this.helptextDropdown = "", this.required = !1, this.multiple = !1, this.disabled = !1, this.fullwidth = !1, this.uploadStrategy = "form", this.itemRenderer = "filename", this.accept = "", this.allowedFormats = [], this.formatErrorMessage = "", this.sizeErrorMessage = "", this.transfers = [], this.addCommentsEnabled = !1, this.renameFilesEnabled = !1, this.extraOperations = [], this.enableImagePreview = !1, this.hasError = !1, this.errorMessage = "", this.optionalTag = !1, this.requiredTag = !1, this.tagText = null, this.truncateTail = 4, this.files = [], this.isDragActive = !1, this.validationErrorMessage = null, this.addedAnnouncement = "", this.thumbnailUrls = {}, this.hasInitializedValue = !1, this.hasWarnedInvalidValueCombo = !1, this.thumbnailFileById = /* @__PURE__ */ new Map(), this.connectedForm = null, this.addedAnnouncementTimer = null, this.onNativeFileChange = (e) => {
471
169
  let t = e.target;
472
170
  this.addFiles(t.files ? Array.from(t.files) : []), this.uploadStrategy === "custom" && (t.value = "");
473
171
  }, this.openFileDialog = (e) => {
@@ -624,7 +322,7 @@ var M = {
624
322
  return S(this.allowedFormats, this.accept);
625
323
  }
626
324
  getSortedFilesAndTransfers() {
627
- return D(this.getCurrentFiles(), this.transfers, this.uploadStrategy);
325
+ return ee(this.getCurrentFiles(), this.transfers, this.uploadStrategy);
628
326
  }
629
327
  validateFile(e) {
630
328
  let t = w(e, {
@@ -678,7 +376,7 @@ var M = {
678
376
  }
679
377
  getSrUploadedMessage() {
680
378
  if (this.addedAnnouncement) return this.addedAnnouncement;
681
- let { totalCount: e, uploadedCount: t } = A(this.getCurrentFiles(), this.transfers);
379
+ let { totalCount: e, uploadedCount: t } = k(this.getCurrentFiles(), this.transfers);
682
380
  if (e === 0 || t === 0) return "";
683
381
  let n = this.pktStrings.get("fileupload");
684
382
  return l(n.srFilesUploadedOfTotal, {
@@ -688,7 +386,7 @@ var M = {
688
386
  });
689
387
  }
690
388
  getSrErrorsMessage() {
691
- let { totalCount: e, failedCount: t } = A(this.getCurrentFiles(), this.transfers);
389
+ let { totalCount: e, failedCount: t } = k(this.getCurrentFiles(), this.transfers);
692
390
  if (e === 0 || t === 0) return "";
693
391
  let n = this.pktStrings.get("fileupload");
694
392
  return l(n.srFilesFailedOfTotal, {
@@ -705,92 +403,92 @@ var M = {
705
403
  this.connectedForm &&= (this.connectedForm.removeEventListener("submit", this.onHostFormSubmit), null);
706
404
  }
707
405
  };
708
- r([o({ type: String })], N.prototype, "id", void 0), r([o({ type: String })], N.prototype, "name", void 0), r([o({ type: String })], N.prototype, "label", void 0), r([o({ type: String })], N.prototype, "helptext", void 0), r([o({
406
+ r([o({ type: String })], j.prototype, "id", void 0), r([o({ type: String })], j.prototype, "name", void 0), r([o({ type: String })], j.prototype, "label", void 0), r([o({ type: String })], j.prototype, "helptext", void 0), r([o({
709
407
  type: String,
710
408
  attribute: "helptext-dropdown"
711
- })], N.prototype, "helptextDropdown", void 0), r([o({
409
+ })], j.prototype, "helptextDropdown", void 0), r([o({
712
410
  type: String,
713
411
  attribute: "helptext-dropdown-button"
714
- })], N.prototype, "helptextDropdownButton", void 0), r([o({
412
+ })], j.prototype, "helptextDropdownButton", void 0), r([o({
715
413
  type: Boolean,
716
414
  reflect: !0
717
- })], N.prototype, "required", void 0), r([o({
415
+ })], j.prototype, "required", void 0), r([o({
718
416
  type: Boolean,
719
417
  reflect: !0
720
- })], N.prototype, "multiple", void 0), r([o({
418
+ })], j.prototype, "multiple", void 0), r([o({
721
419
  type: Boolean,
722
420
  reflect: !0
723
- })], N.prototype, "disabled", void 0), r([o({
421
+ })], j.prototype, "disabled", void 0), r([o({
724
422
  type: Boolean,
725
423
  reflect: !0,
726
424
  attribute: "fullwidth"
727
- })], N.prototype, "fullwidth", void 0), r([o({
425
+ })], j.prototype, "fullwidth", void 0), r([o({
728
426
  type: String,
729
427
  reflect: !0,
730
428
  attribute: "upload-strategy"
731
- })], N.prototype, "uploadStrategy", void 0), r([o({
429
+ })], j.prototype, "uploadStrategy", void 0), r([o({
732
430
  type: String,
733
431
  reflect: !0,
734
432
  attribute: "item-renderer"
735
- })], N.prototype, "itemRenderer", void 0), r([o({ type: String })], N.prototype, "accept", void 0), r([o({
433
+ })], j.prototype, "itemRenderer", void 0), r([o({ type: String })], j.prototype, "accept", void 0), r([o({
736
434
  converter: d.csvToArray,
737
435
  attribute: "allowed-formats"
738
- })], N.prototype, "allowedFormats", void 0), r([o({
436
+ })], j.prototype, "allowedFormats", void 0), r([o({
739
437
  type: String,
740
438
  attribute: "format-error-message"
741
- })], N.prototype, "formatErrorMessage", void 0), r([o({ attribute: "max-file-size" })], N.prototype, "maxFileSize", void 0), r([o({
439
+ })], j.prototype, "formatErrorMessage", void 0), r([o({ attribute: "max-file-size" })], j.prototype, "maxFileSize", void 0), r([o({
742
440
  type: String,
743
441
  attribute: "size-error-message"
744
- })], N.prototype, "sizeErrorMessage", void 0), r([o({ attribute: !1 })], N.prototype, "onFileValidation", void 0), r([o({ attribute: !1 })], N.prototype, "transfers", void 0), r([o({
442
+ })], j.prototype, "sizeErrorMessage", void 0), r([o({ attribute: !1 })], j.prototype, "onFileValidation", void 0), r([o({ attribute: !1 })], j.prototype, "transfers", void 0), r([o({
745
443
  type: Boolean,
746
444
  attribute: "add-comments-enabled"
747
- })], N.prototype, "addCommentsEnabled", void 0), r([o({
445
+ })], j.prototype, "addCommentsEnabled", void 0), r([o({
748
446
  type: Boolean,
749
447
  attribute: "rename-files-enabled"
750
- })], N.prototype, "renameFilesEnabled", void 0), r([o({ attribute: !1 })], N.prototype, "extraOperations", void 0), r([o({
448
+ })], j.prototype, "renameFilesEnabled", void 0), r([o({ attribute: !1 })], j.prototype, "extraOperations", void 0), r([o({
751
449
  type: Boolean,
752
450
  reflect: !0,
753
451
  attribute: "enable-image-preview"
754
- })], N.prototype, "enableImagePreview", void 0), r([o({
452
+ })], j.prototype, "enableImagePreview", void 0), r([o({
755
453
  type: Boolean,
756
454
  attribute: "has-error"
757
- })], N.prototype, "hasError", void 0), r([o({
455
+ })], j.prototype, "hasError", void 0), r([o({
758
456
  type: String,
759
457
  attribute: "error-message"
760
- })], N.prototype, "errorMessage", void 0), r([o({
458
+ })], j.prototype, "errorMessage", void 0), r([o({
761
459
  type: Boolean,
762
460
  attribute: "optional-tag"
763
- })], N.prototype, "optionalTag", void 0), r([o({
461
+ })], j.prototype, "optionalTag", void 0), r([o({
764
462
  type: String,
765
463
  attribute: "optional-text"
766
- })], N.prototype, "optionalText", void 0), r([o({
464
+ })], j.prototype, "optionalText", void 0), r([o({
767
465
  type: Boolean,
768
466
  attribute: "required-tag"
769
- })], N.prototype, "requiredTag", void 0), r([o({
467
+ })], j.prototype, "requiredTag", void 0), r([o({
770
468
  type: String,
771
469
  attribute: "required-text"
772
- })], N.prototype, "requiredText", void 0), r([o({
470
+ })], j.prototype, "requiredText", void 0), r([o({
773
471
  type: String,
774
472
  attribute: "tag-text"
775
- })], N.prototype, "tagText", void 0), r([o({
473
+ })], j.prototype, "tagText", void 0), r([o({
776
474
  type: Number,
777
475
  attribute: "truncate-tail"
778
- })], N.prototype, "truncateTail", void 0), r([o({ attribute: !1 })], N.prototype, "value", void 0), r([o({ attribute: !1 })], N.prototype, "defaultValue", void 0), r([n()], N.prototype, "files", void 0), r([n()], N.prototype, "isDragActive", void 0), r([n()], N.prototype, "validationErrorMessage", void 0), r([n()], N.prototype, "addedAnnouncement", void 0), r([n()], N.prototype, "thumbnailUrls", void 0);
476
+ })], j.prototype, "truncateTail", void 0), r([o({ attribute: !1 })], j.prototype, "value", void 0), r([o({ attribute: !1 })], j.prototype, "defaultValue", void 0), r([n()], j.prototype, "files", void 0), r([n()], j.prototype, "isDragActive", void 0), r([n()], j.prototype, "validationErrorMessage", void 0), r([n()], j.prototype, "addedAnnouncement", void 0), r([n()], j.prototype, "thumbnailUrls", void 0);
779
477
  //#endregion
780
478
  //#region src/components/fileupload/fileupload-operations.ts
781
- var P = "comments", F = (e) => {
479
+ var M = "comments", N = (e) => {
782
480
  let t = new Date(e);
783
481
  return Number.isNaN(t.getTime()) ? e : `${String(t.getDate()).padStart(2, "0")}.${String(t.getMonth() + 1).padStart(2, "0")}.${t.getFullYear()} kl. ${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
784
- }, I = (e, t, n) => {
482
+ }, P = (e, t, n) => {
785
483
  e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), t()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), n());
786
- }, L = (e, t, n) => {
484
+ }, F = (e, t, n) => {
787
485
  e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), n()), (e.metaKey || e.ctrlKey) && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), t());
788
- }, R = (e) => ({
486
+ }, I = (e) => ({
789
487
  id: "remove",
790
488
  title: "Slett",
791
489
  ariaLabel: "Slett fil",
792
490
  onClick: ({ file: t }) => e(t.fileId)
793
- }), z = () => ({
491
+ }), L = () => ({
794
492
  id: "rename",
795
493
  title: "Rediger",
796
494
  ariaLabel: "Rediger filnavn",
@@ -807,7 +505,7 @@ var P = "comments", F = (e) => {
807
505
  class="pkt-fileupload__queue-display__item__rename-input"
808
506
  ?disabled=${t.disabled}
809
507
  .value=${n}
810
- @keydown=${(e) => I(e, i, t.close)}
508
+ @keydown=${(e) => P(e, i, t.close)}
811
509
  />
812
510
  <button
813
511
  type="button"
@@ -835,14 +533,14 @@ var P = "comments", F = (e) => {
835
533
  value=${n}
836
534
  />`;
837
535
  }
838
- }), B = () => ({
536
+ }), R = () => ({
839
537
  id: "comment",
840
- title: (e) => (e.attributes?.[P] ?? []).length > 0 ? "" : "Legg til kommentar",
538
+ title: (e) => (e.attributes?.[M] ?? []).length > 0 ? "" : "Legg til kommentar",
841
539
  ariaLabel: "Legg til kommentar",
842
540
  renderExtendedUI: (t) => {
843
- let n = (t.getAttribute(P) ?? [])[0], r = `pkt-fileupload-comment-${t.file.fileId}`, i = () => {
541
+ let n = (t.getAttribute(M) ?? [])[0], r = `pkt-fileupload-comment-${t.file.fileId}`, i = () => {
844
542
  let e = document.getElementById(r)?.value?.trim();
845
- e && t.setAttribute(P, [{
543
+ e && t.setAttribute(M, [{
846
544
  text: e,
847
545
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
848
546
  }]), t.close();
@@ -858,7 +556,7 @@ var P = "comments", F = (e) => {
858
556
  .value=${n?.text ?? ""}
859
557
  rows="2"
860
558
  placeholder="Skriv inn kommentar"
861
- @keydown=${(e) => L(e, i, t.close)}
559
+ @keydown=${(e) => F(e, i, t.close)}
862
560
  ></textarea>
863
561
  <button
864
562
  type="button"
@@ -880,7 +578,7 @@ var P = "comments", F = (e) => {
880
578
  },
881
579
  renderContent: (t) => {
882
580
  if (t.isActive) return null;
883
- let n = t.getAttribute(P) ?? [];
581
+ let n = t.getAttribute(M) ?? [];
884
582
  if (n.length === 0) return null;
885
583
  let r = n[0];
886
584
  return e`
@@ -891,7 +589,7 @@ var P = "comments", F = (e) => {
891
589
  ${r.text}
892
590
  </span>
893
591
  <time class="pkt-fileupload__queue-display__item__comment__time">
894
- ${F(r.timestamp)}
592
+ ${N(r.timestamp)}
895
593
  </time>
896
594
  </div>
897
595
  <div class="pkt-fileupload__queue-display__item__comment__actions">
@@ -909,7 +607,7 @@ var P = "comments", F = (e) => {
909
607
  class="pkt-fileupload__queue-display__item__comment__action"
910
608
  aria-label="Slett kommentar"
911
609
  ?disabled=${t.disabled}
912
- @click=${() => t.setAttribute(P, void 0)}
610
+ @click=${() => t.setAttribute(M, void 0)}
913
611
  >
914
612
  <pkt-icon name="trash-can"></pkt-icon>
915
613
  </button>
@@ -919,15 +617,15 @@ var P = "comments", F = (e) => {
919
617
  `;
920
618
  },
921
619
  renderHidden: (t) => {
922
- let n = t.getAttribute(P);
620
+ let n = t.getAttribute(M);
923
621
  return e`<input
924
622
  type="hidden"
925
623
  name=${`${t.inputName}-comments`}
926
624
  value=${n ? JSON.stringify(n) : ""}
927
625
  />`;
928
626
  }
929
- }), V = (t, n) => {
930
- let r = O(t, n);
627
+ }), z = (t, n) => {
628
+ let r = D(t, n);
931
629
  return r ? e`<span
932
630
  class="pkt-fileupload__queue-display__item__title__head"
933
631
  data-pkt-truncate-part="first"
@@ -937,13 +635,13 @@ var P = "comments", F = (e) => {
937
635
  data-pkt-truncate-part="tail"
938
636
  >${r.tail}</span
939
637
  >` : e`<span data-pkt-truncate-part="first">${t}</span>`;
940
- }, H = (t, n, r) => e`
638
+ }, B = (t, n, r) => e`
941
639
  <p class="pkt-fileupload__queue-display__item__title">
942
- ${V(t, r)}${n ? e`<span class="pkt-fileupload__queue-display__item__filesize"> (${n})</span>` : null}
640
+ ${z(t, r)}${n ? e`<span class="pkt-fileupload__queue-display__item__filesize"> (${n})</span>` : null}
943
641
  </p>
944
- `, U = (e) => typeof e == "number" ? "in-progress" : e === "error" ? "error" : "idle", W = (t) => e`<span class="pkt-fileupload__queue-display__item__loading-text" aria-label="Laster opp fil"
642
+ `, V = (e) => typeof e == "number" ? "in-progress" : e === "error" ? "error" : "idle", H = (t) => e`<span class="pkt-fileupload__queue-display__item__loading-text" aria-label="Laster opp fil"
945
643
  >${t ?? "Laster opp..."}</span
946
- >`, G = ({ operationId: e, file: t, inputName: n, disabled: r, isActive: i, onActivateOperation: a, onCloseOperation: o, getFileAttribute: s, setFileAttribute: c }) => ({
644
+ >`, U = ({ operationId: e, file: t, inputName: n, disabled: r, isActive: i, onActivateOperation: a, onCloseOperation: o, getFileAttribute: s, setFileAttribute: c }) => ({
947
645
  file: t,
948
646
  inputName: n,
949
647
  disabled: r,
@@ -952,15 +650,15 @@ var P = "comments", F = (e) => {
952
650
  close: () => o(t.fileId),
953
651
  getAttribute: (e) => s(t.fileId, e),
954
652
  setAttribute: (e, n) => c(t.fileId, e, n)
955
- }), K = ({ file: t, fileSize: n, disabled: r, transferProgress: i, transferShowProgress: a, loadingText: o, truncateTail: s, onCancel: c, iconName: l = "document-text" }) => {
956
- let u = j(t), d = a ?? i !== 0;
653
+ }), W = ({ file: t, fileSize: n, disabled: r, transferProgress: i, transferShowProgress: a, loadingText: o, truncateTail: s, onCancel: c, iconName: l = "document-text" }) => {
654
+ let u = A(t), d = a ?? i !== 0;
957
655
  return e`
958
656
  <pkt-icon
959
657
  name=${l}
960
658
  class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
961
659
  aria-hidden="true"
962
660
  ></pkt-icon>
963
- ${H(u, n, s)}
661
+ ${B(u, n, s)}
964
662
  <button
965
663
  type="button"
966
664
  class="pkt-fileupload__queue-display__item__cancel-button"
@@ -981,17 +679,17 @@ var P = "comments", F = (e) => {
981
679
  <span class="pkt-fileupload__queue-display__item__percentage" aria-hidden="true"
982
680
  >${Math.round(i * 100)}%</span
983
681
  >
984
- ` : W(o)}
682
+ ` : H(o)}
985
683
  `;
986
- }, q = ({ file: t, fileSize: n, disabled: r, transferShowProgress: i, transferLastProgress: a, transferErrorMessage: o, truncateTail: s, onCancel: c }) => {
987
- let l = j(t), u = !!i, d = Math.round((a ?? 1) * 100);
684
+ }, G = ({ file: t, fileSize: n, disabled: r, transferShowProgress: i, transferLastProgress: a, transferErrorMessage: o, truncateTail: s, onCancel: c }) => {
685
+ let l = A(t), u = !!i, d = Math.round((a ?? 1) * 100);
988
686
  return e`
989
687
  <pkt-icon
990
688
  name="alert-error"
991
689
  class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
992
690
  aria-hidden="true"
993
691
  ></pkt-icon>
994
- ${H(l, n, s)}
692
+ ${B(l, n, s)}
995
693
  <button
996
694
  type="button"
997
695
  class="pkt-fileupload__queue-display__item__cancel-button"
@@ -1014,11 +712,11 @@ var P = "comments", F = (e) => {
1014
712
  >${o}</span
1015
713
  >` : null}
1016
714
  `;
1017
- }, J = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => {
715
+ }, K = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => {
1018
716
  let d = i.find((e) => e.id === a);
1019
717
  if (d?.renderInlineUI || d?.renderExtendedUI) return null;
1020
718
  let f = i.map((i) => {
1021
- let d = G({
719
+ let d = U({
1022
720
  operationId: i.id,
1023
721
  file: t,
1024
722
  inputName: r,
@@ -1044,9 +742,9 @@ var P = "comments", F = (e) => {
1044
742
  </button>`;
1045
743
  }).filter(Boolean);
1046
744
  return f.length === 0 ? null : e`<div class="pkt-fileupload__queue-display__item__actions">${f}</div>`;
1047
- }, Y = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => i.map((i) => {
745
+ }, q = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => i.map((i) => {
1048
746
  if (!i.renderContent) return null;
1049
- let u = G({
747
+ let u = U({
1050
748
  operationId: i.id,
1051
749
  file: t,
1052
750
  inputName: r,
@@ -1060,11 +758,11 @@ var P = "comments", F = (e) => {
1060
758
  return d == null ? null : e`<div class="pkt-fileupload__queue-display__item__operation-content">
1061
759
  ${d}
1062
760
  </div>`;
1063
- }), X = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => {
761
+ }), J = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => {
1064
762
  if (!a) return null;
1065
763
  let u = i.find((e) => e.id === a);
1066
764
  if (!u?.renderExtendedUI) return null;
1067
- let d = G({
765
+ let d = U({
1068
766
  operationId: u.id,
1069
767
  file: t,
1070
768
  inputName: r,
@@ -1078,9 +776,9 @@ var P = "comments", F = (e) => {
1078
776
  return e`<div class="pkt-fileupload__queue-display__item__expanded-operation-ui">
1079
777
  ${u.renderExtendedUI(d)}
1080
778
  </div>`;
1081
- }, Z = ({ file: e, disabled: t, inputName: n, operations: r, activeOperationId: i, onActivateOperation: a, onCloseOperation: o, getFileAttribute: s, setFileAttribute: c }) => r.map((r) => {
779
+ }, Y = ({ file: e, disabled: t, inputName: n, operations: r, activeOperationId: i, onActivateOperation: a, onCloseOperation: o, getFileAttribute: s, setFileAttribute: c }) => r.map((r) => {
1082
780
  if (!r.renderHidden) return null;
1083
- let l = G({
781
+ let l = U({
1084
782
  operationId: r.id,
1085
783
  file: e,
1086
784
  inputName: n,
@@ -1092,18 +790,18 @@ var P = "comments", F = (e) => {
1092
790
  setFileAttribute: c
1093
791
  });
1094
792
  return r.renderHidden(l);
1095
- }), Q = (t, n, r) => {
1096
- let i = j(t);
793
+ }), X = (t, n, r) => {
794
+ let i = A(t);
1097
795
  return e`
1098
796
  <pkt-icon
1099
797
  name="document-text"
1100
798
  class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
1101
799
  aria-hidden="true"
1102
800
  ></pkt-icon>
1103
- ${H(i, n, r)}
801
+ ${B(i, n, r)}
1104
802
  `;
1105
- }, ee = ({ file: t, thumbnailUrl: n, previewEnabled: r, canOpenPreview: a, truncateTail: o, onOpenPreview: c, onThumbnailImageError: d }) => {
1106
- let f = j(t), p = !!n, m = !!r && !!a, h = m && !!c;
803
+ }, Z = ({ file: t, thumbnailUrl: n, previewEnabled: r, canOpenPreview: a, truncateTail: o, onOpenPreview: c, onThumbnailImageError: d }) => {
804
+ let f = A(t), p = !!n, m = !!r && !!a, h = m && !!c;
1107
805
  return e`
1108
806
  <div
1109
807
  class=${s({
@@ -1138,12 +836,12 @@ var P = "comments", F = (e) => {
1138
836
  </span>
1139
837
  </button>
1140
838
  <span class="pkt-fileupload__queue-display__item__thumbnail__title"
1141
- >${V(f, o)}</span
839
+ >${z(f, o)}</span
1142
840
  >
1143
841
  </div>
1144
842
  `;
1145
- }, te = ({ file: t, inputName: n, disabled: r, fileSize: i, operations: a, activeOperationId: o, onActivateOperation: c, onCloseOperation: l, getFileAttribute: u, setFileAttribute: d, transferProgress: f, transferErrorMessage: p, transferShowProgress: m, transferLastProgress: h, loadingText: g, truncateTail: _, onCancel: v }) => {
1146
- let y = U(f), b = a.find((e) => e.id === o), x = b?.renderInlineUI ? b.renderInlineUI(G({
843
+ }, Q = ({ file: t, inputName: n, disabled: r, fileSize: i, operations: a, activeOperationId: o, onActivateOperation: c, onCloseOperation: l, getFileAttribute: u, setFileAttribute: d, transferProgress: f, transferErrorMessage: p, transferShowProgress: m, transferLastProgress: h, loadingText: g, truncateTail: _, onCancel: v }) => {
844
+ let y = V(f), b = a.find((e) => e.id === o), x = b?.renderInlineUI ? b.renderInlineUI(U({
1147
845
  operationId: b.id,
1148
846
  file: t,
1149
847
  inputName: n,
@@ -1163,7 +861,7 @@ var P = "comments", F = (e) => {
1163
861
  [`pkt-fileupload__queue-display__item--${f}`]: typeof f == "string"
1164
862
  })}
1165
863
  >
1166
- ${Z({
864
+ ${Y({
1167
865
  file: t,
1168
866
  disabled: r,
1169
867
  inputName: n,
@@ -1174,7 +872,7 @@ var P = "comments", F = (e) => {
1174
872
  getFileAttribute: u,
1175
873
  setFileAttribute: d
1176
874
  })}
1177
- ${y === "in-progress" ? K({
875
+ ${y === "in-progress" ? W({
1178
876
  file: t,
1179
877
  fileSize: i,
1180
878
  disabled: r,
@@ -1183,7 +881,7 @@ var P = "comments", F = (e) => {
1183
881
  loadingText: g,
1184
882
  truncateTail: _,
1185
883
  onCancel: v
1186
- }) : y === "error" ? q({
884
+ }) : y === "error" ? G({
1187
885
  file: t,
1188
886
  fileSize: i,
1189
887
  disabled: r,
@@ -1201,8 +899,8 @@ var P = "comments", F = (e) => {
1201
899
  <div class="pkt-fileupload__queue-display__item__inline-ui">
1202
900
  ${x}
1203
901
  </div>
1204
- ` : Q(t, i, _)}
1205
- ${y === "idle" ? J({
902
+ ` : X(t, i, _)}
903
+ ${y === "idle" ? K({
1206
904
  file: t,
1207
905
  disabled: r,
1208
906
  inputName: n,
@@ -1213,7 +911,7 @@ var P = "comments", F = (e) => {
1213
911
  getFileAttribute: u,
1214
912
  setFileAttribute: d
1215
913
  }) : null}
1216
- ${y === "idle" ? Y({
914
+ ${y === "idle" ? q({
1217
915
  file: t,
1218
916
  disabled: r,
1219
917
  inputName: n,
@@ -1224,7 +922,7 @@ var P = "comments", F = (e) => {
1224
922
  getFileAttribute: u,
1225
923
  setFileAttribute: d
1226
924
  }) : null}
1227
- ${y === "idle" ? X({
925
+ ${y === "idle" ? J({
1228
926
  file: t,
1229
927
  disabled: r,
1230
928
  inputName: n,
@@ -1237,8 +935,8 @@ var P = "comments", F = (e) => {
1237
935
  }) : null}
1238
936
  </li>
1239
937
  `;
1240
- }, ne = ({ file: t, inputName: n, disabled: r, fileSize: i, thumbnailUrl: a, previewEnabled: o, canOpenPreview: c, operations: l, activeOperationId: u, onActivateOperation: d, onCloseOperation: f, getFileAttribute: p, setFileAttribute: m, transferProgress: h, transferErrorMessage: g, transferShowProgress: _, transferLastProgress: v, loadingText: y, truncateTail: b, onCancel: x, onOpenPreview: S, onThumbnailImageError: C }) => {
1241
- let w = U(h), T = l.find((e) => e.id === u), E = T?.renderInlineUI ? T.renderInlineUI(G({
938
+ }, te = ({ file: t, inputName: n, disabled: r, fileSize: i, thumbnailUrl: a, previewEnabled: o, canOpenPreview: c, operations: l, activeOperationId: u, onActivateOperation: d, onCloseOperation: f, getFileAttribute: p, setFileAttribute: m, transferProgress: h, transferErrorMessage: g, transferShowProgress: _, transferLastProgress: v, loadingText: y, truncateTail: b, onCancel: x, onOpenPreview: S, onThumbnailImageError: C }) => {
939
+ let w = V(h), T = l.find((e) => e.id === u), E = T?.renderInlineUI ? T.renderInlineUI(U({
1242
940
  operationId: T.id,
1243
941
  file: t,
1244
942
  inputName: n,
@@ -1258,7 +956,7 @@ var P = "comments", F = (e) => {
1258
956
  [`pkt-fileupload__queue-display__item--${h}`]: typeof h == "string"
1259
957
  })}
1260
958
  >
1261
- ${Z({
959
+ ${Y({
1262
960
  file: t,
1263
961
  disabled: r,
1264
962
  inputName: n,
@@ -1269,7 +967,7 @@ var P = "comments", F = (e) => {
1269
967
  getFileAttribute: p,
1270
968
  setFileAttribute: m
1271
969
  })}
1272
- ${w === "in-progress" ? K({
970
+ ${w === "in-progress" ? W({
1273
971
  file: t,
1274
972
  fileSize: i,
1275
973
  disabled: r,
@@ -1279,7 +977,7 @@ var P = "comments", F = (e) => {
1279
977
  truncateTail: b,
1280
978
  onCancel: x,
1281
979
  iconName: "picture"
1282
- }) : w === "error" ? q({
980
+ }) : w === "error" ? G({
1283
981
  file: t,
1284
982
  fileSize: i,
1285
983
  disabled: r,
@@ -1297,7 +995,7 @@ var P = "comments", F = (e) => {
1297
995
  <div class="pkt-fileupload__queue-display__item__inline-ui">
1298
996
  ${E}
1299
997
  </div>
1300
- ` : ee({
998
+ ` : Z({
1301
999
  file: t,
1302
1000
  thumbnailUrl: a,
1303
1001
  previewEnabled: o,
@@ -1306,7 +1004,7 @@ var P = "comments", F = (e) => {
1306
1004
  onOpenPreview: S,
1307
1005
  onThumbnailImageError: C
1308
1006
  })}
1309
- ${w === "idle" ? J({
1007
+ ${w === "idle" ? K({
1310
1008
  file: t,
1311
1009
  disabled: r,
1312
1010
  inputName: n,
@@ -1317,7 +1015,7 @@ var P = "comments", F = (e) => {
1317
1015
  getFileAttribute: p,
1318
1016
  setFileAttribute: m
1319
1017
  }) : null}
1320
- ${w === "idle" ? Y({
1018
+ ${w === "idle" ? q({
1321
1019
  file: t,
1322
1020
  disabled: r,
1323
1021
  inputName: n,
@@ -1328,7 +1026,7 @@ var P = "comments", F = (e) => {
1328
1026
  getFileAttribute: p,
1329
1027
  setFileAttribute: m
1330
1028
  }) : null}
1331
- ${w === "idle" ? X({
1029
+ ${w === "idle" ? J({
1332
1030
  file: t,
1333
1031
  disabled: r,
1334
1032
  inputName: n,
@@ -1341,7 +1039,7 @@ var P = "comments", F = (e) => {
1341
1039
  }) : null}
1342
1040
  </li>
1343
1041
  `;
1344
- }, $ = class extends N {
1042
+ }, $ = class extends j {
1345
1043
  constructor(...e) {
1346
1044
  super(...e), this.activeOperationByFileId = {}, this.isPreviewModalOpen = !1, this.previewCurrentIndex = 0, this.failedImageFileIds = {}, this.closePreview = () => {
1347
1045
  this.isPreviewModalOpen = !1;
@@ -1497,7 +1195,7 @@ var P = "comments", F = (e) => {
1497
1195
  let n = typeof e.file?.size == "number" ? this.formatFileSize(e.file.size) : "", r = this.getQueueItemOperations();
1498
1196
  if (this.itemRenderer === "thumbnail") {
1499
1197
  let i = this.canOpenPreview(e), a = this.failedImageFileIds[e.fileId]?.thumbnail ? void 0 : this.getThumbnailUrl(e);
1500
- return ne({
1198
+ return te({
1501
1199
  file: e,
1502
1200
  inputName: this.name,
1503
1201
  disabled: this.disabled,
@@ -1522,7 +1220,7 @@ var P = "comments", F = (e) => {
1522
1220
  onThumbnailImageError: (e) => this.markImageFailed(e, "thumbnail")
1523
1221
  });
1524
1222
  }
1525
- return te({
1223
+ return Q({
1526
1224
  file: e,
1527
1225
  inputName: this.name,
1528
1226
  disabled: this.disabled,
@@ -1568,7 +1266,7 @@ var P = "comments", F = (e) => {
1568
1266
  });
1569
1267
  }
1570
1268
  navigatePreview(e, t) {
1571
- t.length !== 0 && (this.previewCurrentIndex = k(this.previewCurrentIndex, e, t.length));
1269
+ t.length !== 0 && (this.previewCurrentIndex = O(this.previewCurrentIndex, e, t.length));
1572
1270
  }
1573
1271
  renderPreviewModal(t) {
1574
1272
  if (!this.enableImagePreview || t.length === 0) return null;
@@ -1634,7 +1332,7 @@ var P = "comments", F = (e) => {
1634
1332
  }
1635
1333
  getQueueItemOperations() {
1636
1334
  let e = [];
1637
- return this.renameFilesEnabled && this.itemRenderer !== "thumbnail" && e.push(z()), this.addCommentsEnabled && this.itemRenderer !== "thumbnail" && e.push(B()), e.push(...this.extraOperations), e.push(R((e) => this.removeFileItem(e))), e;
1335
+ return this.renameFilesEnabled && this.itemRenderer !== "thumbnail" && e.push(L()), this.addCommentsEnabled && this.itemRenderer !== "thumbnail" && e.push(R()), e.push(...this.extraOperations), e.push(I((e) => this.removeFileItem(e))), e;
1638
1336
  }
1639
1337
  activateOperation(e, t) {
1640
1338
  this.activeOperationByFileId = {
@@ -1665,6 +1363,6 @@ var P = "comments", F = (e) => {
1665
1363
  r([n()], $.prototype, "activeOperationByFileId", void 0), r([n()], $.prototype, "isPreviewModalOpen", void 0), r([n()], $.prototype, "previewCurrentIndex", void 0), r([n()], $.prototype, "failedImageFileIds", void 0), $ = r([t("pkt-fileupload")], $);
1666
1364
  //#endregion
1667
1365
  //#region src/components/fileupload/index.ts
1668
- var re = $;
1366
+ var ne = $;
1669
1367
  //#endregion
1670
- export { $ as n, re as t };
1368
+ export { $ as n, ne as t };