@oslokommune/punkt-elements 17.1.3 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/{accordion-BeLvLPrB.js → accordion-1_pdxTgJ.js} +27 -27
- package/dist/{accordion-B3GBlvUC.cjs → accordion-DobbH-Sv.cjs} +5 -5
- package/dist/{alert-Cs4Rmq_J.cjs → alert-COeHz6o2.cjs} +6 -6
- package/dist/{alert-DKK_Tb9J.js → alert-xspFetQ8.js} +26 -26
- package/dist/{async-directive-Da7TJpnq.cjs → async-directive-B5pcIMfO.cjs} +1 -1
- package/dist/{async-directive-BPf6K-V2.js → async-directive-D2Sht790.js} +5 -5
- package/dist/{backlink-D1y26pj3.js → backlink-C0jZFnZ2.js} +8 -8
- package/dist/{backlink-CMmrKTe4.cjs → backlink-ZMhqHaVs.cjs} +3 -3
- package/dist/base-elements/element.d.ts +13 -1
- package/dist/base-elements/input-element.d.ts +4 -2
- package/dist/{breadcrumbs-B6JGhJgC.cjs → breadcrumbs-BS64xd1s.cjs} +7 -7
- package/dist/{breadcrumbs-CcTQ3Grm.js → breadcrumbs-BvMownZN.js} +16 -16
- package/dist/{button-2-OSPJkj.js → button-C44vNLFC.js} +28 -28
- package/dist/{button-CE97NQIk.cjs → button-CR4CXtnj.cjs} +7 -7
- package/dist/{calendar-kn4SrtJy.cjs → calendar-DQ4byeom.cjs} +28 -27
- package/dist/{calendar-pOW3R5Pw.js → calendar-DgjCKMMV.js} +82 -68
- package/dist/{card-zQ0eKRMV.js → card-DhHqC265.js} +44 -44
- package/dist/{card-CETDFkxR.cjs → card-Dpqi6HVt.cjs} +26 -26
- package/dist/{checkbox-CH7NpINF.js → checkbox-BQ1K57AB.js} +23 -23
- package/dist/{checkbox-CQNr_sEg.cjs → checkbox-CXQxbiaX.cjs} +11 -11
- package/dist/{class-map-BeimMvPv.cjs → class-map-CzCE5pqG.cjs} +1 -1
- package/dist/{class-map-CnWCnBSX.js → class-map-F1DJHyb7.js} +3 -3
- package/dist/{combobox-Bvg0UO9w.cjs → combobox-BV4oDiII.cjs} +19 -18
- package/dist/{combobox-CRdYYlxu.js → combobox-DPck39I2.js} +55 -54
- package/dist/components/calendar/calendar.d.ts +21 -6
- package/dist/components/checkbox/checkbox.d.ts +4 -2
- package/dist/components/combobox/combobox-base.d.ts +2 -1
- package/dist/components/consent/strings.d.ts +1 -85
- package/dist/components/datepicker/datepicker-base.d.ts +0 -3
- package/dist/components/datepicker/datepicker-multiple.d.ts +0 -2
- package/dist/components/datepicker/datepicker-range.d.ts +0 -2
- package/dist/components/datepicker/datepicker-single.d.ts +0 -2
- package/dist/components/datepicker/datepicker-utils.d.ts +2 -1
- package/dist/components/fileupload/fileupload-base.d.ts +3 -2
- package/dist/components/header/header-service.d.ts +3 -1
- package/dist/components/header/header.d.ts +2 -1
- package/dist/components/helptext/helptext.d.ts +2 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/input-wrapper/input-wrapper.d.ts +4 -2
- package/dist/components/radiobutton/radiobutton.d.ts +4 -2
- package/dist/components/searchinput/searchinput.d.ts +2 -1
- package/dist/{consent-DZEkhgJ1.js → consent-BneInZov.js} +10 -10
- package/dist/{consent-CyY3RyoC.cjs → consent-_N9foluG.cjs} +5 -5
- package/dist/controllers/strings-controller.d.ts +27 -0
- package/dist/{datepicker-VTqSDQk5.cjs → datepicker-9NX5qt2z.cjs} +38 -37
- package/dist/{datepicker-ButIas85.js → datepicker-nSSSr1U7.js} +104 -104
- package/dist/{directive-helpers-CI8YZqku.js → directive-helpers-BARw3nEZ.js} +1 -1
- package/dist/{directive-helpers-BlAV5EQD.cjs → directive-helpers-D6AAMFKs.cjs} +1 -1
- package/dist/docs/components/fileupload.d.ts +1 -0
- package/dist/element-B8OGznK0.cjs +2 -0
- package/dist/{element-ChsFgr_B.js → element-BKSPVgs2.js} +240 -100
- package/dist/{element-with-slot-Bj7nm7fO.cjs → element-with-slot-DTxILHVv.cjs} +1 -1
- package/dist/{element-with-slot-BvG9ctC-.js → element-with-slot-YUAUFRqw.js} +4 -4
- package/dist/fileupload-D05VSbEP.cjs +402 -0
- package/dist/{fileupload-D5IQ9HDe.js → fileupload-E0LGGNgj.js} +370 -380
- package/dist/{footer-DbYQUYNR.cjs → footer-DBApIdGh.cjs} +32 -32
- package/dist/{footer-DrR64HiK.js → footer-DYilVBMC.js} +91 -91
- package/dist/format-B8meU8Tm.cjs +1 -0
- package/dist/format-BTeSVkED.js +18 -0
- package/dist/{header-ClgIac6n.cjs → header-B7tbX-Ok.cjs} +84 -84
- package/dist/{header-menu-BAsUNKSx.cjs → header-menu-1FFWhvNc.cjs} +24 -24
- package/dist/{header-menu-hVPXsb8g.js → header-menu-D522-VTV.js} +75 -75
- package/dist/{header-KvJ1mGwA.js → header-v3GWAzOK.js} +267 -264
- package/dist/{heading-CFmiSuCQ.cjs → heading-CvytvcL7.cjs} +1 -1
- package/dist/{heading-g-_IUB5T.js → heading-rx_oSCqe.js} +16 -16
- package/dist/helptext-DYFdcylX.cjs +27 -0
- package/dist/{helptext-DZng1D5i.js → helptext-LShGPm-b.js} +18 -19
- package/dist/{icon-9iwd2F2l.cjs → icon-BmMC09mi.cjs} +1 -1
- package/dist/{icon-D-LA22xD.js → icon-HYU1f54x.js} +17 -17
- package/dist/{if-defined-CGzIlZ9-.js → if-defined-BF8XcDi5.js} +1 -1
- package/dist/if-defined-CVYApOgK.cjs +1 -0
- package/dist/{input-element-DBMNBplu.js → input-element-D07DmR34.js} +121 -120
- package/dist/input-element-DumGj_oJ.cjs +1 -0
- package/dist/input-wrapper-Cci_wTvD.js +308 -0
- package/dist/input-wrapper-DDfapoRX.cjs +58 -0
- package/dist/{link-DK7gvmnj.cjs → link-11g2ZNin.cjs} +4 -4
- package/dist/{link-D-Eqm5KH.js → link-CQK0SH4H.js} +13 -13
- package/dist/{linkcard-zqbg7Oqm.js → linkcard-B4GlmjJ6.js} +16 -16
- package/dist/linkcard-DNYsVlV6.cjs +13 -0
- package/dist/{listbox-Dc4rGdPi.cjs → listbox-BlFRhyI7.cjs} +15 -15
- package/dist/{listbox-va_E8afs.js → listbox-wd_OofyF.js} +100 -99
- package/dist/{loader-D_RDICnw.js → loader-0C3qVk16.js} +14 -14
- package/dist/{loader-CMUkVJmE.cjs → loader-B9u2qUlR.cjs} +5 -5
- package/dist/{messagebox-Cv8LaSxv.cjs → messagebox-BD5tGmT-.cjs} +5 -5
- package/dist/{messagebox-Cw-OWDya.js → messagebox-C-y1ICmr.js} +15 -15
- package/dist/{modal-BtInv031.cjs → modal-BzPGQYCs.cjs} +8 -8
- package/dist/{modal-D0t_X2dX.js → modal-Cghs3w-d.js} +20 -20
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.cjs +1 -1
- package/dist/pkt-breadcrumbs.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +35 -34
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-C5EBX2T0.cjs → pkt-options-controller-CEEAqXaB.cjs} +1 -1
- package/dist/{pkt-options-controller-B77vH3PE.js → pkt-options-controller-PtjhmTGk.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{progressbar-CbcfLerF.js → progressbar-BexQQw1o.js} +21 -21
- package/dist/{progressbar-D5MmnQId.cjs → progressbar-X9mSvpjw.cjs} +5 -5
- package/dist/{radiobutton-BUnf3EPi.js → radiobutton-CkhTasn4.js} +24 -24
- package/dist/{radiobutton-DpsO1F-8.cjs → radiobutton-ln29Ad3U.cjs} +8 -8
- package/dist/{ref-CQoEIIp0.cjs → ref-CHbJYtKE.cjs} +1 -1
- package/dist/{ref-CWD6PjVd.js → ref-Chc_DZAb.js} +2 -2
- package/dist/{repeat-sY6B7fAT.cjs → repeat-CHDs__rN.cjs} +1 -1
- package/dist/{repeat-C02g7d5S.js → repeat-P9SMlKd5.js} +4 -4
- package/dist/searchinput-CPgMEAZZ.cjs +60 -0
- package/dist/{searchinput-DwnjsvJ1.js → searchinput-Da7dKHBH.js} +43 -43
- package/dist/{select-BOJi6H6T.cjs → select-DCuvdAuK.cjs} +4 -3
- package/dist/{select-DMre80qs.js → select-jabMSjft.js} +21 -20
- package/dist/shared-strings/consent.d.ts +71 -0
- package/dist/shared-strings/format.d.ts +21 -0
- package/dist/shared-strings/index.d.ts +14 -0
- package/dist/shared-strings/nb.d.ts +118 -0
- package/dist/shared-strings/resolve.d.ts +12 -0
- package/dist/shared-strings/store.d.ts +27 -0
- package/dist/shared-strings/types.d.ts +29 -0
- package/dist/shared-types/fileupload.d.ts +0 -27
- package/dist/shared-types/index.d.ts +1 -2
- package/dist/shared-utils/combobox/index.d.ts +1 -0
- package/dist/shared-utils/combobox/input-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/messages.d.ts +7 -0
- package/dist/shared-utils/combobox/option-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/selection-manager.d.ts +3 -2
- package/dist/{tabs-Cf9ai0FD.cjs → tabs-DV5CQNDL.cjs} +7 -7
- package/dist/{tabs-TvxgbrCF.js → tabs-D_hoi1zu.js} +32 -32
- package/dist/tag-BxYulmZn.cjs +27 -0
- package/dist/{tag-Ds6n1LIs.js → tag-DK5SgKry.js} +33 -32
- package/dist/tests/strings-override.test.d.ts +0 -0
- package/dist/{textarea-vfzIcXhX.js → textarea-BR7Riace.js} +30 -29
- package/dist/{textarea-BydiLM9Z.cjs → textarea-ffBD_VHq.cjs} +3 -2
- package/dist/{textinput-CMP2jPP_.js → textinput-CRNrsRNV.js} +28 -27
- package/dist/{textinput-DGdicNSx.cjs → textinput-CtHFzAux.cjs} +13 -12
- package/dist/timepicker-AfgJipo6.cjs +196 -0
- package/dist/{timepicker-ClwgYywH.js → timepicker-ixs_E5RY.js} +67 -64
- package/package.json +3 -3
- package/src/components/backlink/backlink.ts +1 -1
- package/src/components/breadcrumbs/breadcrumbs.ts +1 -1
- package/src/components/calendar/calendar.ts +56 -26
- package/src/components/checkbox/checkbox.test.ts +0 -2
- package/src/components/checkbox/checkbox.ts +8 -4
- package/src/components/combobox/combobox-base.ts +2 -1
- package/src/components/combobox/combobox-value.ts +10 -9
- package/src/components/combobox/combobox.selection.test.ts +5 -1
- package/src/components/combobox/combobox.ts +4 -1
- package/src/components/consent/strings.ts +1 -125
- package/src/components/datepicker/date-tags.ts +4 -1
- package/src/components/datepicker/datepicker-base.ts +2 -6
- package/src/components/datepicker/datepicker-multiple.ts +0 -3
- package/src/components/datepicker/datepicker-range.ts +4 -7
- package/src/components/datepicker/datepicker-single.ts +0 -3
- package/src/components/datepicker/datepicker-utils.test.ts +5 -5
- package/src/components/datepicker/datepicker-utils.ts +6 -11
- package/src/components/datepicker/datepicker.ts +8 -1
- package/src/components/fileupload/fileupload-base.ts +25 -16
- package/src/components/fileupload/fileupload-renderers.ts +2 -1
- package/src/components/fileupload/fileupload.test.ts +16 -0
- package/src/components/fileupload/fileupload.ts +19 -15
- package/src/components/header/header-global.ts +3 -3
- package/src/components/header/header-service.ts +13 -8
- package/src/components/header/header.ts +2 -1
- package/src/components/helptext/helptext.test.ts +1 -1
- package/src/components/helptext/helptext.ts +3 -3
- package/src/components/index.ts +9 -0
- package/src/components/input-wrapper/input-wrapper.ts +18 -10
- package/src/components/listbox/listbox.ts +3 -3
- package/src/components/radiobutton/radiobutton.ts +8 -4
- package/src/components/searchinput/searchinput.ts +5 -3
- package/src/components/select/select.ts +1 -0
- package/src/components/tag/tag.ts +2 -1
- package/src/components/textarea/textarea.ts +1 -0
- package/src/components/textinput/textinput.ts +1 -0
- package/src/components/timepicker/timepicker.ts +23 -21
- package/dist/element-BA8v6S7z.cjs +0 -2
- package/dist/fileupload-BeWiTAoW.cjs +0 -401
- package/dist/helptext-CTtKJcML.cjs +0 -27
- package/dist/if-defined-B89_ZeCj.cjs +0 -1
- package/dist/input-element-DYmQw-fH.cjs +0 -1
- package/dist/input-wrapper-BmxNvznr.js +0 -128
- package/dist/input-wrapper-D-fPaTbY.js +0 -176
- package/dist/input-wrapper-D5PR0rJn.cjs +0 -1
- package/dist/input-wrapper-Q-B-aBeb.cjs +0 -54
- package/dist/linkcard-B29cmZqh.cjs +0 -13
- package/dist/searchinput-Bh975rjX.cjs +0 -60
- package/dist/tag-CzojNU7z.cjs +0 -27
- package/dist/timepicker-DYrnLHqN.cjs +0 -195
- package/dist/translations/no.json.d.ts +0 -94
|
@@ -1,43 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import "./
|
|
9
|
-
import
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
12
|
-
|
|
13
|
-
var d = {
|
|
14
|
-
dropZoneDragMultiple: "Dra filer hit for å laste dem opp eller",
|
|
15
|
-
dropZoneDragSingle: "Dra en fil hit for å laste den opp eller",
|
|
16
|
-
dropZoneDragMultipleThumbnail: "Dra bilder hit for å laste dem opp eller",
|
|
17
|
-
dropZoneDragSingleThumbnail: "Dra et bilde hit for å laste det opp eller",
|
|
18
|
-
dropZoneDragActiveMultiple: "Slipp filene her",
|
|
19
|
-
dropZoneDragActiveSingle: "Slipp filen her",
|
|
20
|
-
dropZoneDragActiveMultipleThumbnail: "Slipp bildene her",
|
|
21
|
-
dropZoneDragActiveSingleThumbnail: "Slipp bildet her",
|
|
22
|
-
dropZoneOpenFileDialogMultiple: "velg filer",
|
|
23
|
-
dropZoneOpenFileDialogSingle: "velg en fil",
|
|
24
|
-
dropZoneOpenFileDialogMultipleThumbnail: "velg fra kamerarull",
|
|
25
|
-
dropZoneOpenFileDialogSingleThumbnail: "velg fra kamerarull",
|
|
26
|
-
supportedFormatsPrefix: "Format:",
|
|
27
|
-
invalidFormatDefault: (e) => `Ugyldig filtype. Tillatte formater: ${e}`,
|
|
28
|
-
sizeTooLargeDefault: (e) => `Filen er for stor. Maks størrelse er ${e}.`,
|
|
29
|
-
requiredMissing: "Du må laste opp minst én fil.",
|
|
30
|
-
genericValidationRejection: "Filen ble avvist av validering.",
|
|
31
|
-
unknownFilename: "Ukjent fil",
|
|
32
|
-
fileLabel: (e) => e === 1 ? "fil" : "filer",
|
|
33
|
-
srFileAdded: (e) => `Filen «${e}» er lagt til`,
|
|
34
|
-
srFilesAdded: (e) => `${e} filer er lagt til`,
|
|
35
|
-
srFilesUploadedOfTotal: (e, t, n) => `${e} av ${t} ${n} lastet opp`,
|
|
36
|
-
srFilesFailedOfTotal: (e, t, n) => `Feil ved opplasting: ${e} av ${t} ${n} feilet`
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
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";
|
|
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";
|
|
7
|
+
import { t as d } from "./converters-CkjLSYpa.js";
|
|
8
|
+
import { n as f } from "./utils-BwF4QSrq.js";
|
|
9
|
+
import "./input-wrapper-Cci_wTvD.js";
|
|
10
|
+
import { r as p } from "./focus-trap-DG3pEuyJ.js";
|
|
11
|
+
import "./modal-Cghs3w-d.js";
|
|
12
|
+
import "./progressbar-BexQQw1o.js";
|
|
39
13
|
//#region ../../shared-utils/fileupload/size.ts
|
|
40
|
-
function
|
|
14
|
+
function m(e) {
|
|
41
15
|
if (e == null || e === "") return;
|
|
42
16
|
if (typeof e == "number") return Number.isFinite(e) && e > 0 ? e : void 0;
|
|
43
17
|
let t = String(e).trim(), n = Number(t);
|
|
@@ -56,18 +30,18 @@ function f(e) {
|
|
|
56
30
|
default: return;
|
|
57
31
|
}
|
|
58
32
|
}
|
|
59
|
-
function
|
|
33
|
+
function h(e) {
|
|
60
34
|
return e < 1024 ? `${Math.round(e)} B` : e < 1048576 ? `${Math.round(e / 1024)} KB` : e < 1073741824 ? `${Math.round(e / 1048576)} MB` : `${Math.round(e / 1073741824)} GB`;
|
|
61
35
|
}
|
|
62
36
|
//#endregion
|
|
63
37
|
//#region ../../shared-utils/fileupload/formats.ts
|
|
64
|
-
function
|
|
38
|
+
function g(e) {
|
|
65
39
|
return Array.isArray(e) ? e.map((e) => String(e).trim().toLowerCase()).filter(Boolean) : [];
|
|
66
40
|
}
|
|
67
|
-
function
|
|
41
|
+
function _(e) {
|
|
68
42
|
return e ? e.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean) : [];
|
|
69
43
|
}
|
|
70
|
-
function
|
|
44
|
+
function v(e, t, n) {
|
|
71
45
|
let r = e.toLowerCase().replace(/^\./, "");
|
|
72
46
|
if (r.includes("/")) {
|
|
73
47
|
if (r.endsWith("/*")) {
|
|
@@ -78,42 +52,42 @@ function g(e, t, n) {
|
|
|
78
52
|
}
|
|
79
53
|
return t === r;
|
|
80
54
|
}
|
|
81
|
-
function
|
|
82
|
-
let n =
|
|
55
|
+
function y(e, t) {
|
|
56
|
+
let n = g(t);
|
|
83
57
|
if (n.length === 0) return !0;
|
|
84
58
|
let r = e.name.split(".").pop()?.toLowerCase() ?? "", i = e.type.toLowerCase();
|
|
85
|
-
return n.some((e) =>
|
|
59
|
+
return n.some((e) => v(e, r, i));
|
|
86
60
|
}
|
|
87
|
-
function
|
|
61
|
+
function b(e, t) {
|
|
88
62
|
let n = (e ?? "").trim();
|
|
89
63
|
if (n) return n;
|
|
90
|
-
let r =
|
|
64
|
+
let r = g(t);
|
|
91
65
|
return r.length === 0 ? "" : r.map((e) => e.includes("/") || e.startsWith(".") ? e : `.${e}`).join(", ");
|
|
92
66
|
}
|
|
93
|
-
function
|
|
67
|
+
function x(e) {
|
|
94
68
|
return e.includes("/") ? e : e.replace(/^\./, "").toUpperCase();
|
|
95
69
|
}
|
|
96
|
-
function
|
|
97
|
-
let n =
|
|
98
|
-
if (n.length > 0) return n.map(
|
|
99
|
-
let r =
|
|
100
|
-
return r.length > 0 ? r.map(
|
|
70
|
+
function S(e, t) {
|
|
71
|
+
let n = g(e);
|
|
72
|
+
if (n.length > 0) return n.map(x).join(", ");
|
|
73
|
+
let r = _(t);
|
|
74
|
+
return r.length > 0 ? r.map(x).join(", ") : "";
|
|
101
75
|
}
|
|
102
76
|
//#endregion
|
|
103
77
|
//#region ../../shared-utils/fileupload/validation.ts
|
|
104
|
-
function
|
|
78
|
+
function C(e, t, n) {
|
|
105
79
|
return ((e ?? "").trim() || t).replace(/\{(\w+)\}/g, (e, t) => n[t] ?? `{${t}}`);
|
|
106
80
|
}
|
|
107
|
-
function
|
|
108
|
-
let n =
|
|
109
|
-
if (n.length > 0 && !
|
|
110
|
-
let e = n.join(", "), r =
|
|
111
|
-
return
|
|
81
|
+
function w(e, t) {
|
|
82
|
+
let n = g(t.allowedFormats);
|
|
83
|
+
if (n.length > 0 && !y(e, n)) {
|
|
84
|
+
let e = n.join(", "), r = i.fileupload.invalidFormat;
|
|
85
|
+
return C(t.formatErrorMessage, r, { formats: e });
|
|
112
86
|
}
|
|
113
|
-
let r =
|
|
87
|
+
let r = m(t.maxFileSize);
|
|
114
88
|
if (r !== void 0 && e.size > r) {
|
|
115
|
-
let e =
|
|
116
|
-
return
|
|
89
|
+
let e = h(r), n = i.fileupload.sizeTooLarge;
|
|
90
|
+
return C(t.sizeErrorMessage, n, { maxSize: e });
|
|
117
91
|
}
|
|
118
92
|
if (t.onFileValidation) {
|
|
119
93
|
let n = t.onFileValidation(e);
|
|
@@ -121,7 +95,7 @@ function S(e, t) {
|
|
|
121
95
|
}
|
|
122
96
|
return null;
|
|
123
97
|
}
|
|
124
|
-
function
|
|
98
|
+
function T(e) {
|
|
125
99
|
let t = e.file;
|
|
126
100
|
if (t?.type?.startsWith("image/")) return !0;
|
|
127
101
|
let n = e.attributes?.targetFilename || t?.name || "";
|
|
@@ -129,10 +103,10 @@ function C(e) {
|
|
|
129
103
|
}
|
|
130
104
|
//#endregion
|
|
131
105
|
//#region ../../shared-utils/fileupload/transfers.ts
|
|
132
|
-
function
|
|
106
|
+
function E(e) {
|
|
133
107
|
return typeof e == "number" ? "in-progress" : e === "error" ? "error" : "idle";
|
|
134
108
|
}
|
|
135
|
-
function
|
|
109
|
+
function D(e, t, n) {
|
|
136
110
|
let r = {
|
|
137
111
|
"in-progress": 0,
|
|
138
112
|
error: 1,
|
|
@@ -147,11 +121,11 @@ function T(e, t, n) {
|
|
|
147
121
|
showProgress: r?.showProgress,
|
|
148
122
|
lastProgress: r?.lastProgress
|
|
149
123
|
};
|
|
150
|
-
}).sort((e, t) => r[
|
|
124
|
+
}).sort((e, t) => r[E(e.progress)] - r[E(t.progress)]);
|
|
151
125
|
}
|
|
152
126
|
//#endregion
|
|
153
127
|
//#region ../../shared-utils/fileupload/truncate.ts
|
|
154
|
-
function
|
|
128
|
+
function O(e, t) {
|
|
155
129
|
return !t || t <= 0 || e.length <= t + 3 ? null : {
|
|
156
130
|
head: e.slice(0, e.length - t),
|
|
157
131
|
tail: e.slice(-t)
|
|
@@ -159,12 +133,12 @@ function E(e, t) {
|
|
|
159
133
|
}
|
|
160
134
|
//#endregion
|
|
161
135
|
//#region ../../shared-utils/fileupload/navigation.ts
|
|
162
|
-
function
|
|
136
|
+
function k(e, t, n) {
|
|
163
137
|
return n <= 0 ? 0 : t === "prev" ? e <= 0 ? n - 1 : e - 1 : e >= n - 1 ? 0 : e + 1;
|
|
164
138
|
}
|
|
165
139
|
//#endregion
|
|
166
140
|
//#region ../../shared-utils/fileupload/announcements.ts
|
|
167
|
-
function
|
|
141
|
+
function A(e, t) {
|
|
168
142
|
let n = e.length;
|
|
169
143
|
if (n === 0 || !t || t.length === 0) return {
|
|
170
144
|
totalCount: n,
|
|
@@ -184,10 +158,10 @@ function O(e, t) {
|
|
|
184
158
|
}
|
|
185
159
|
//#endregion
|
|
186
160
|
//#region ../../shared-utils/fileupload/filename.ts
|
|
187
|
-
function
|
|
161
|
+
function j(e, t = i.fileupload.unknownFilename) {
|
|
188
162
|
return e.attributes?.targetFilename || e.file?.name || t;
|
|
189
163
|
}
|
|
190
|
-
var
|
|
164
|
+
var M = {
|
|
191
165
|
name: "pkt-fileupload",
|
|
192
166
|
react: "PktFileUpload",
|
|
193
167
|
"css-class": "pkt-fileupload",
|
|
@@ -491,9 +465,9 @@ var A = {
|
|
|
491
465
|
}
|
|
492
466
|
}
|
|
493
467
|
}
|
|
494
|
-
},
|
|
468
|
+
}, N = class extends a {
|
|
495
469
|
constructor(...e) {
|
|
496
|
-
super(...e), this.id = `pkt-fileupload-${
|
|
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) => {
|
|
497
471
|
let t = e.target;
|
|
498
472
|
this.addFiles(t.files ? Array.from(t.files) : []), this.uploadStrategy === "custom" && (t.value = "");
|
|
499
473
|
}, this.openFileDialog = (e) => {
|
|
@@ -512,6 +486,9 @@ var A = {
|
|
|
512
486
|
!this.required || this.uploadStrategy !== "custom" || this.getCurrentFiles().length > 0 || (this.validationErrorMessage = this.requiredSelectionMessage, e.preventDefault());
|
|
513
487
|
};
|
|
514
488
|
}
|
|
489
|
+
get requiredSelectionMessage() {
|
|
490
|
+
return this.pktStrings.get("fileupload").requiredMissing;
|
|
491
|
+
}
|
|
515
492
|
get isControlled() {
|
|
516
493
|
return this.value !== void 0;
|
|
517
494
|
}
|
|
@@ -567,13 +544,13 @@ var A = {
|
|
|
567
544
|
}
|
|
568
545
|
this.validationErrorMessage = null;
|
|
569
546
|
let n = t.map((e) => ({
|
|
570
|
-
fileId:
|
|
547
|
+
fileId: f(),
|
|
571
548
|
file: e,
|
|
572
549
|
attributes: { targetFilename: e.name }
|
|
573
|
-
}));
|
|
574
|
-
this.setAddedAnnouncement(n.length === 1 ?
|
|
575
|
-
let
|
|
576
|
-
this.commitFiles(
|
|
550
|
+
})), r = this.pktStrings.get("fileupload");
|
|
551
|
+
this.setAddedAnnouncement(n.length === 1 ? l(r.srFileAdded, { filename: n[0].attributes.targetFilename }) : l(r.srFilesAdded, { count: n.length }));
|
|
552
|
+
let i = this.getCurrentFiles(), a = this.multiple ? [...i, ...n] : [n[0]];
|
|
553
|
+
this.commitFiles(a, "add", n.map((e) => e.fileId)), this.uploadStrategy === "custom" && n.forEach((e) => {
|
|
577
554
|
this.dispatchEvent(new CustomEvent("file-upload-requested", {
|
|
578
555
|
detail: {
|
|
579
556
|
fileId: e.fileId,
|
|
@@ -635,22 +612,22 @@ var A = {
|
|
|
635
612
|
return this.transfers.find((t) => t.fileId === e);
|
|
636
613
|
}
|
|
637
614
|
isImageFile(e) {
|
|
638
|
-
return
|
|
615
|
+
return T(e);
|
|
639
616
|
}
|
|
640
617
|
formatFileSize(e) {
|
|
641
|
-
return
|
|
618
|
+
return h(e);
|
|
642
619
|
}
|
|
643
620
|
getResolvedAcceptValue() {
|
|
644
|
-
return
|
|
621
|
+
return b(this.accept, this.allowedFormats);
|
|
645
622
|
}
|
|
646
623
|
getSupportedFormatsText() {
|
|
647
|
-
return
|
|
624
|
+
return S(this.allowedFormats, this.accept);
|
|
648
625
|
}
|
|
649
626
|
getSortedFilesAndTransfers() {
|
|
650
|
-
return
|
|
627
|
+
return D(this.getCurrentFiles(), this.transfers, this.uploadStrategy);
|
|
651
628
|
}
|
|
652
629
|
validateFile(e) {
|
|
653
|
-
let t =
|
|
630
|
+
let t = w(e, {
|
|
654
631
|
allowedFormats: this.allowedFormats,
|
|
655
632
|
maxFileSize: this.maxFileSize,
|
|
656
633
|
formatErrorMessage: this.formatErrorMessage,
|
|
@@ -667,7 +644,7 @@ var A = {
|
|
|
667
644
|
composed: !0,
|
|
668
645
|
cancelable: !0
|
|
669
646
|
});
|
|
670
|
-
return this.dispatchEvent(r), n.errorMessage ? n.errorMessage : r.defaultPrevented ?
|
|
647
|
+
return this.dispatchEvent(r), n.errorMessage ? n.errorMessage : r.defaultPrevented ? this.pktStrings.get("fileupload").genericValidationRejection : null;
|
|
671
648
|
}
|
|
672
649
|
syncThumbnailUrls(e) {
|
|
673
650
|
if (!(typeof URL < "u" && typeof URL.createObjectURL == "function" && typeof URL.revokeObjectURL == "function")) {
|
|
@@ -701,12 +678,24 @@ var A = {
|
|
|
701
678
|
}
|
|
702
679
|
getSrUploadedMessage() {
|
|
703
680
|
if (this.addedAnnouncement) return this.addedAnnouncement;
|
|
704
|
-
let { totalCount: e, uploadedCount: t } =
|
|
705
|
-
|
|
681
|
+
let { totalCount: e, uploadedCount: t } = A(this.getCurrentFiles(), this.transfers);
|
|
682
|
+
if (e === 0 || t === 0) return "";
|
|
683
|
+
let n = this.pktStrings.get("fileupload");
|
|
684
|
+
return l(n.srFilesUploadedOfTotal, {
|
|
685
|
+
uploaded: t,
|
|
686
|
+
total: e,
|
|
687
|
+
label: c(e, n.fileLabelOne, n.fileLabelOther)
|
|
688
|
+
});
|
|
706
689
|
}
|
|
707
690
|
getSrErrorsMessage() {
|
|
708
|
-
let { totalCount: e, failedCount: t } =
|
|
709
|
-
|
|
691
|
+
let { totalCount: e, failedCount: t } = A(this.getCurrentFiles(), this.transfers);
|
|
692
|
+
if (e === 0 || t === 0) return "";
|
|
693
|
+
let n = this.pktStrings.get("fileupload");
|
|
694
|
+
return l(n.srFilesFailedOfTotal, {
|
|
695
|
+
failed: t,
|
|
696
|
+
total: e,
|
|
697
|
+
label: c(e, n.fileLabelOne, n.fileLabelOther)
|
|
698
|
+
});
|
|
710
699
|
}
|
|
711
700
|
syncFormSubmitListener() {
|
|
712
701
|
let e = this.closest("form");
|
|
@@ -716,114 +705,114 @@ var A = {
|
|
|
716
705
|
this.connectedForm &&= (this.connectedForm.removeEventListener("submit", this.onHostFormSubmit), null);
|
|
717
706
|
}
|
|
718
707
|
};
|
|
719
|
-
|
|
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({
|
|
720
709
|
type: String,
|
|
721
710
|
attribute: "helptext-dropdown"
|
|
722
|
-
})],
|
|
711
|
+
})], N.prototype, "helptextDropdown", void 0), r([o({
|
|
723
712
|
type: String,
|
|
724
713
|
attribute: "helptext-dropdown-button"
|
|
725
|
-
})],
|
|
714
|
+
})], N.prototype, "helptextDropdownButton", void 0), r([o({
|
|
726
715
|
type: Boolean,
|
|
727
716
|
reflect: !0
|
|
728
|
-
})],
|
|
717
|
+
})], N.prototype, "required", void 0), r([o({
|
|
729
718
|
type: Boolean,
|
|
730
719
|
reflect: !0
|
|
731
|
-
})],
|
|
720
|
+
})], N.prototype, "multiple", void 0), r([o({
|
|
732
721
|
type: Boolean,
|
|
733
722
|
reflect: !0
|
|
734
|
-
})],
|
|
723
|
+
})], N.prototype, "disabled", void 0), r([o({
|
|
735
724
|
type: Boolean,
|
|
736
725
|
reflect: !0,
|
|
737
726
|
attribute: "fullwidth"
|
|
738
|
-
})],
|
|
727
|
+
})], N.prototype, "fullwidth", void 0), r([o({
|
|
739
728
|
type: String,
|
|
740
729
|
reflect: !0,
|
|
741
730
|
attribute: "upload-strategy"
|
|
742
|
-
})],
|
|
731
|
+
})], N.prototype, "uploadStrategy", void 0), r([o({
|
|
743
732
|
type: String,
|
|
744
733
|
reflect: !0,
|
|
745
734
|
attribute: "item-renderer"
|
|
746
|
-
})],
|
|
747
|
-
converter:
|
|
735
|
+
})], N.prototype, "itemRenderer", void 0), r([o({ type: String })], N.prototype, "accept", void 0), r([o({
|
|
736
|
+
converter: d.csvToArray,
|
|
748
737
|
attribute: "allowed-formats"
|
|
749
|
-
})],
|
|
738
|
+
})], N.prototype, "allowedFormats", void 0), r([o({
|
|
750
739
|
type: String,
|
|
751
740
|
attribute: "format-error-message"
|
|
752
|
-
})],
|
|
741
|
+
})], N.prototype, "formatErrorMessage", void 0), r([o({ attribute: "max-file-size" })], N.prototype, "maxFileSize", void 0), r([o({
|
|
753
742
|
type: String,
|
|
754
743
|
attribute: "size-error-message"
|
|
755
|
-
})],
|
|
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({
|
|
756
745
|
type: Boolean,
|
|
757
746
|
attribute: "add-comments-enabled"
|
|
758
|
-
})],
|
|
747
|
+
})], N.prototype, "addCommentsEnabled", void 0), r([o({
|
|
759
748
|
type: Boolean,
|
|
760
749
|
attribute: "rename-files-enabled"
|
|
761
|
-
})],
|
|
750
|
+
})], N.prototype, "renameFilesEnabled", void 0), r([o({ attribute: !1 })], N.prototype, "extraOperations", void 0), r([o({
|
|
762
751
|
type: Boolean,
|
|
763
752
|
reflect: !0,
|
|
764
753
|
attribute: "enable-image-preview"
|
|
765
|
-
})],
|
|
754
|
+
})], N.prototype, "enableImagePreview", void 0), r([o({
|
|
766
755
|
type: Boolean,
|
|
767
756
|
attribute: "has-error"
|
|
768
|
-
})],
|
|
757
|
+
})], N.prototype, "hasError", void 0), r([o({
|
|
769
758
|
type: String,
|
|
770
759
|
attribute: "error-message"
|
|
771
|
-
})],
|
|
760
|
+
})], N.prototype, "errorMessage", void 0), r([o({
|
|
772
761
|
type: Boolean,
|
|
773
762
|
attribute: "optional-tag"
|
|
774
|
-
})],
|
|
763
|
+
})], N.prototype, "optionalTag", void 0), r([o({
|
|
775
764
|
type: String,
|
|
776
765
|
attribute: "optional-text"
|
|
777
|
-
})],
|
|
766
|
+
})], N.prototype, "optionalText", void 0), r([o({
|
|
778
767
|
type: Boolean,
|
|
779
768
|
attribute: "required-tag"
|
|
780
|
-
})],
|
|
769
|
+
})], N.prototype, "requiredTag", void 0), r([o({
|
|
781
770
|
type: String,
|
|
782
771
|
attribute: "required-text"
|
|
783
|
-
})],
|
|
772
|
+
})], N.prototype, "requiredText", void 0), r([o({
|
|
784
773
|
type: String,
|
|
785
774
|
attribute: "tag-text"
|
|
786
|
-
})],
|
|
775
|
+
})], N.prototype, "tagText", void 0), r([o({
|
|
787
776
|
type: Number,
|
|
788
777
|
attribute: "truncate-tail"
|
|
789
|
-
})],
|
|
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);
|
|
790
779
|
//#endregion
|
|
791
780
|
//#region src/components/fileupload/fileupload-operations.ts
|
|
792
|
-
var
|
|
781
|
+
var P = "comments", F = (e) => {
|
|
793
782
|
let t = new Date(e);
|
|
794
783
|
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")}`;
|
|
795
|
-
},
|
|
784
|
+
}, I = (e, t, n) => {
|
|
796
785
|
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), t()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), n());
|
|
797
|
-
},
|
|
786
|
+
}, L = (e, t, n) => {
|
|
798
787
|
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), n()), (e.metaKey || e.ctrlKey) && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), t());
|
|
799
|
-
},
|
|
788
|
+
}, R = (e) => ({
|
|
800
789
|
id: "remove",
|
|
801
790
|
title: "Slett",
|
|
802
791
|
ariaLabel: "Slett fil",
|
|
803
792
|
onClick: ({ file: t }) => e(t.fileId)
|
|
804
|
-
}),
|
|
793
|
+
}), z = () => ({
|
|
805
794
|
id: "rename",
|
|
806
795
|
title: "Rediger",
|
|
807
796
|
ariaLabel: "Rediger filnavn",
|
|
808
|
-
renderInlineUI: (
|
|
809
|
-
let
|
|
810
|
-
let
|
|
811
|
-
|
|
797
|
+
renderInlineUI: (t) => {
|
|
798
|
+
let n = t.getAttribute("targetFilename") || t.file.attributes?.targetFilename || t.file.file?.name || "", r = `pkt-fileupload-rename-${t.file.fileId}`, i = () => {
|
|
799
|
+
let e = document.getElementById(r)?.value?.trim();
|
|
800
|
+
e && t.setAttribute("targetFilename", e), t.close();
|
|
812
801
|
};
|
|
813
|
-
return
|
|
814
|
-
<label for=${
|
|
802
|
+
return e`
|
|
803
|
+
<label for=${r} class="pkt-sr-only">Endre filnavn</label>
|
|
815
804
|
<input
|
|
816
|
-
id=${
|
|
805
|
+
id=${r}
|
|
817
806
|
type="text"
|
|
818
807
|
class="pkt-fileupload__queue-display__item__rename-input"
|
|
819
|
-
?disabled=${
|
|
820
|
-
.value=${
|
|
821
|
-
@keydown=${(
|
|
808
|
+
?disabled=${t.disabled}
|
|
809
|
+
.value=${n}
|
|
810
|
+
@keydown=${(e) => I(e, i, t.close)}
|
|
822
811
|
/>
|
|
823
812
|
<button
|
|
824
813
|
type="button"
|
|
825
814
|
class="pkt-btn pkt-btn--secondary pkt-btn--small"
|
|
826
|
-
?disabled=${
|
|
815
|
+
?disabled=${t.disabled}
|
|
827
816
|
@click=${i}
|
|
828
817
|
>
|
|
829
818
|
Lagre
|
|
@@ -831,78 +820,78 @@ var M = "comments", N = (e) => {
|
|
|
831
820
|
<button
|
|
832
821
|
type="button"
|
|
833
822
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small"
|
|
834
|
-
?disabled=${
|
|
835
|
-
@click=${
|
|
823
|
+
?disabled=${t.disabled}
|
|
824
|
+
@click=${t.close}
|
|
836
825
|
>
|
|
837
826
|
Avbryt
|
|
838
827
|
</button>
|
|
839
828
|
`;
|
|
840
829
|
},
|
|
841
|
-
renderHidden: (
|
|
842
|
-
let
|
|
843
|
-
return
|
|
830
|
+
renderHidden: (t) => {
|
|
831
|
+
let n = t.getAttribute("targetFilename") || t.file.attributes?.targetFilename || t.file.file?.name || "";
|
|
832
|
+
return e`<input
|
|
844
833
|
type="hidden"
|
|
845
|
-
name=${`${
|
|
846
|
-
value=${
|
|
834
|
+
name=${`${t.inputName}-targetFilename`}
|
|
835
|
+
value=${n}
|
|
847
836
|
/>`;
|
|
848
837
|
}
|
|
849
|
-
}),
|
|
838
|
+
}), B = () => ({
|
|
850
839
|
id: "comment",
|
|
851
|
-
title: (e) => (e.attributes?.[
|
|
840
|
+
title: (e) => (e.attributes?.[P] ?? []).length > 0 ? "" : "Legg til kommentar",
|
|
852
841
|
ariaLabel: "Legg til kommentar",
|
|
853
|
-
renderExtendedUI: (
|
|
854
|
-
let
|
|
855
|
-
let
|
|
856
|
-
|
|
857
|
-
text:
|
|
842
|
+
renderExtendedUI: (t) => {
|
|
843
|
+
let n = (t.getAttribute(P) ?? [])[0], r = `pkt-fileupload-comment-${t.file.fileId}`, i = () => {
|
|
844
|
+
let e = document.getElementById(r)?.value?.trim();
|
|
845
|
+
e && t.setAttribute(P, [{
|
|
846
|
+
text: e,
|
|
858
847
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
859
|
-
}]),
|
|
848
|
+
}]), t.close();
|
|
860
849
|
};
|
|
861
|
-
return
|
|
862
|
-
<label for=${
|
|
863
|
-
${
|
|
850
|
+
return e`
|
|
851
|
+
<label for=${r} class="pkt-fileupload__queue-display__item__comment-label">
|
|
852
|
+
${n ? "Rediger kommentar" : "Legg til kommentar"}
|
|
864
853
|
</label>
|
|
865
854
|
<textarea
|
|
866
|
-
id=${
|
|
855
|
+
id=${r}
|
|
867
856
|
class="pkt-fileupload__queue-display__item__comment-input"
|
|
868
|
-
?disabled=${
|
|
869
|
-
.value=${
|
|
857
|
+
?disabled=${t.disabled}
|
|
858
|
+
.value=${n?.text ?? ""}
|
|
870
859
|
rows="2"
|
|
871
860
|
placeholder="Skriv inn kommentar"
|
|
872
|
-
@keydown=${(
|
|
861
|
+
@keydown=${(e) => L(e, i, t.close)}
|
|
873
862
|
></textarea>
|
|
874
863
|
<button
|
|
875
864
|
type="button"
|
|
876
865
|
class="pkt-btn pkt-btn--secondary pkt-btn--small"
|
|
877
|
-
?disabled=${
|
|
866
|
+
?disabled=${t.disabled}
|
|
878
867
|
@click=${i}
|
|
879
868
|
>
|
|
880
|
-
${
|
|
869
|
+
${n ? "Lagre kommentar" : "Legg til kommentar"}
|
|
881
870
|
</button>
|
|
882
871
|
<button
|
|
883
872
|
type="button"
|
|
884
873
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small"
|
|
885
|
-
?disabled=${
|
|
886
|
-
@click=${
|
|
874
|
+
?disabled=${t.disabled}
|
|
875
|
+
@click=${t.close}
|
|
887
876
|
>
|
|
888
877
|
Avbryt
|
|
889
878
|
</button>
|
|
890
879
|
`;
|
|
891
880
|
},
|
|
892
|
-
renderContent: (
|
|
893
|
-
if (
|
|
894
|
-
let
|
|
895
|
-
if (
|
|
896
|
-
let
|
|
897
|
-
return
|
|
881
|
+
renderContent: (t) => {
|
|
882
|
+
if (t.isActive) return null;
|
|
883
|
+
let n = t.getAttribute(P) ?? [];
|
|
884
|
+
if (n.length === 0) return null;
|
|
885
|
+
let r = n[0];
|
|
886
|
+
return e`
|
|
898
887
|
<div class="pkt-fileupload__queue-display__item__comments">
|
|
899
888
|
<div class="pkt-fileupload__queue-display__item__comment">
|
|
900
889
|
<div class="pkt-fileupload__queue-display__item__comment__content">
|
|
901
890
|
<span class="pkt-fileupload__queue-display__item__comment__text" aria-label="Kommentar tekst">
|
|
902
|
-
${
|
|
891
|
+
${r.text}
|
|
903
892
|
</span>
|
|
904
893
|
<time class="pkt-fileupload__queue-display__item__comment__time">
|
|
905
|
-
${
|
|
894
|
+
${F(r.timestamp)}
|
|
906
895
|
</time>
|
|
907
896
|
</div>
|
|
908
897
|
<div class="pkt-fileupload__queue-display__item__comment__actions">
|
|
@@ -910,8 +899,8 @@ var M = "comments", N = (e) => {
|
|
|
910
899
|
type="button"
|
|
911
900
|
class="pkt-fileupload__queue-display__item__comment__action"
|
|
912
901
|
aria-label="Rediger kommentar"
|
|
913
|
-
?disabled=${
|
|
914
|
-
@click=${
|
|
902
|
+
?disabled=${t.disabled}
|
|
903
|
+
@click=${t.activate}
|
|
915
904
|
>
|
|
916
905
|
<pkt-icon name="edit"></pkt-icon>
|
|
917
906
|
</button>
|
|
@@ -919,8 +908,8 @@ var M = "comments", N = (e) => {
|
|
|
919
908
|
type="button"
|
|
920
909
|
class="pkt-fileupload__queue-display__item__comment__action"
|
|
921
910
|
aria-label="Slett kommentar"
|
|
922
|
-
?disabled=${
|
|
923
|
-
@click=${() =>
|
|
911
|
+
?disabled=${t.disabled}
|
|
912
|
+
@click=${() => t.setAttribute(P, void 0)}
|
|
924
913
|
>
|
|
925
914
|
<pkt-icon name="trash-can"></pkt-icon>
|
|
926
915
|
</button>
|
|
@@ -929,32 +918,32 @@ var M = "comments", N = (e) => {
|
|
|
929
918
|
</div>
|
|
930
919
|
`;
|
|
931
920
|
},
|
|
932
|
-
renderHidden: (
|
|
933
|
-
let
|
|
934
|
-
return
|
|
921
|
+
renderHidden: (t) => {
|
|
922
|
+
let n = t.getAttribute(P);
|
|
923
|
+
return e`<input
|
|
935
924
|
type="hidden"
|
|
936
|
-
name=${`${
|
|
937
|
-
value=${
|
|
925
|
+
name=${`${t.inputName}-comments`}
|
|
926
|
+
value=${n ? JSON.stringify(n) : ""}
|
|
938
927
|
/>`;
|
|
939
928
|
}
|
|
940
|
-
}),
|
|
941
|
-
let
|
|
942
|
-
return
|
|
929
|
+
}), V = (t, n) => {
|
|
930
|
+
let r = O(t, n);
|
|
931
|
+
return r ? e`<span
|
|
943
932
|
class="pkt-fileupload__queue-display__item__title__head"
|
|
944
933
|
data-pkt-truncate-part="first"
|
|
945
|
-
>${
|
|
934
|
+
>${r.head}</span
|
|
946
935
|
><span
|
|
947
936
|
class="pkt-fileupload__queue-display__item__title__tail"
|
|
948
937
|
data-pkt-truncate-part="tail"
|
|
949
|
-
>${
|
|
950
|
-
>` :
|
|
951
|
-
},
|
|
938
|
+
>${r.tail}</span
|
|
939
|
+
>` : e`<span data-pkt-truncate-part="first">${t}</span>`;
|
|
940
|
+
}, H = (t, n, r) => e`
|
|
952
941
|
<p class="pkt-fileupload__queue-display__item__title">
|
|
953
|
-
${
|
|
942
|
+
${V(t, r)}${n ? e`<span class="pkt-fileupload__queue-display__item__filesize"> (${n})</span>` : null}
|
|
954
943
|
</p>
|
|
955
|
-
`,
|
|
956
|
-
>${
|
|
957
|
-
>`,
|
|
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"
|
|
945
|
+
>${t ?? "Laster opp..."}</span
|
|
946
|
+
>`, G = ({ operationId: e, file: t, inputName: n, disabled: r, isActive: i, onActivateOperation: a, onCloseOperation: o, getFileAttribute: s, setFileAttribute: c }) => ({
|
|
958
947
|
file: t,
|
|
959
948
|
inputName: n,
|
|
960
949
|
disabled: r,
|
|
@@ -963,25 +952,25 @@ var M = "comments", N = (e) => {
|
|
|
963
952
|
close: () => o(t.fileId),
|
|
964
953
|
getAttribute: (e) => s(t.fileId, e),
|
|
965
954
|
setAttribute: (e, n) => c(t.fileId, e, n)
|
|
966
|
-
}),
|
|
967
|
-
let u =
|
|
968
|
-
return
|
|
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;
|
|
957
|
+
return e`
|
|
969
958
|
<pkt-icon
|
|
970
959
|
name=${l}
|
|
971
960
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
972
961
|
aria-hidden="true"
|
|
973
962
|
></pkt-icon>
|
|
974
|
-
${
|
|
963
|
+
${H(u, n, s)}
|
|
975
964
|
<button
|
|
976
965
|
type="button"
|
|
977
966
|
class="pkt-fileupload__queue-display__item__cancel-button"
|
|
978
967
|
aria-label="Avbryt opplasting"
|
|
979
|
-
?disabled=${
|
|
980
|
-
@click=${() => c(
|
|
968
|
+
?disabled=${r}
|
|
969
|
+
@click=${() => c(t.fileId)}
|
|
981
970
|
>
|
|
982
971
|
Avbryt
|
|
983
972
|
</button>
|
|
984
|
-
${d ?
|
|
973
|
+
${d ? e`
|
|
985
974
|
<pkt-progressbar
|
|
986
975
|
class="pkt-fileupload__queue-display__item__progress"
|
|
987
976
|
valueCurrent=${Math.round(i * 100)}
|
|
@@ -992,27 +981,27 @@ var M = "comments", N = (e) => {
|
|
|
992
981
|
<span class="pkt-fileupload__queue-display__item__percentage" aria-hidden="true"
|
|
993
982
|
>${Math.round(i * 100)}%</span
|
|
994
983
|
>
|
|
995
|
-
` :
|
|
984
|
+
` : W(o)}
|
|
996
985
|
`;
|
|
997
|
-
},
|
|
998
|
-
let l =
|
|
999
|
-
return
|
|
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);
|
|
988
|
+
return e`
|
|
1000
989
|
<pkt-icon
|
|
1001
990
|
name="alert-error"
|
|
1002
991
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
1003
992
|
aria-hidden="true"
|
|
1004
993
|
></pkt-icon>
|
|
1005
|
-
${
|
|
994
|
+
${H(l, n, s)}
|
|
1006
995
|
<button
|
|
1007
996
|
type="button"
|
|
1008
997
|
class="pkt-fileupload__queue-display__item__cancel-button"
|
|
1009
998
|
aria-label="Fjern fil som feilet under opplasting"
|
|
1010
|
-
?disabled=${
|
|
1011
|
-
@click=${() => c(
|
|
999
|
+
?disabled=${r}
|
|
1000
|
+
@click=${() => c(t.fileId)}
|
|
1012
1001
|
>
|
|
1013
1002
|
Fjern
|
|
1014
1003
|
</button>
|
|
1015
|
-
${u ?
|
|
1004
|
+
${u ? e`
|
|
1016
1005
|
<pkt-progressbar
|
|
1017
1006
|
class="pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"
|
|
1018
1007
|
valueCurrent=${d}
|
|
@@ -1021,32 +1010,32 @@ var M = "comments", N = (e) => {
|
|
|
1021
1010
|
statusPlacement="following"
|
|
1022
1011
|
></pkt-progressbar>
|
|
1023
1012
|
` : null}
|
|
1024
|
-
${o ?
|
|
1013
|
+
${o ? e`<span class="pkt-fileupload__queue-display__item__error-message"
|
|
1025
1014
|
>${o}</span
|
|
1026
1015
|
>` : null}
|
|
1027
1016
|
`;
|
|
1028
|
-
},
|
|
1017
|
+
}, J = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => {
|
|
1029
1018
|
let d = i.find((e) => e.id === a);
|
|
1030
1019
|
if (d?.renderInlineUI || d?.renderExtendedUI) return null;
|
|
1031
1020
|
let f = i.map((i) => {
|
|
1032
|
-
let d =
|
|
1021
|
+
let d = G({
|
|
1033
1022
|
operationId: i.id,
|
|
1034
|
-
file:
|
|
1035
|
-
inputName:
|
|
1036
|
-
disabled:
|
|
1023
|
+
file: t,
|
|
1024
|
+
inputName: r,
|
|
1025
|
+
disabled: n,
|
|
1037
1026
|
isActive: i.id === a,
|
|
1038
1027
|
onActivateOperation: o,
|
|
1039
|
-
onCloseOperation:
|
|
1040
|
-
getFileAttribute:
|
|
1041
|
-
setFileAttribute:
|
|
1042
|
-
}), f = typeof i.title == "function" ? i.title(
|
|
1028
|
+
onCloseOperation: s,
|
|
1029
|
+
getFileAttribute: c,
|
|
1030
|
+
setFileAttribute: l
|
|
1031
|
+
}), f = typeof i.title == "function" ? i.title(t) : i.title;
|
|
1043
1032
|
if (!f) return null;
|
|
1044
|
-
let p = typeof i.ariaLabel == "function" ? i.ariaLabel(
|
|
1045
|
-
return
|
|
1033
|
+
let p = typeof i.ariaLabel == "function" ? i.ariaLabel(t) : i.ariaLabel;
|
|
1034
|
+
return e`<button
|
|
1046
1035
|
type="button"
|
|
1047
1036
|
class="pkt-fileupload__queue-display__item__operation"
|
|
1048
|
-
aria-label=${
|
|
1049
|
-
?disabled=${
|
|
1037
|
+
aria-label=${u(p)}
|
|
1038
|
+
?disabled=${n}
|
|
1050
1039
|
@click=${() => {
|
|
1051
1040
|
(i.renderInlineUI || i.renderExtendedUI) && d.activate(), i.onClick?.(d);
|
|
1052
1041
|
}}
|
|
@@ -1054,44 +1043,44 @@ var M = "comments", N = (e) => {
|
|
|
1054
1043
|
${f}
|
|
1055
1044
|
</button>`;
|
|
1056
1045
|
}).filter(Boolean);
|
|
1057
|
-
return f.length === 0 ? null :
|
|
1058
|
-
},
|
|
1046
|
+
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) => {
|
|
1059
1048
|
if (!i.renderContent) return null;
|
|
1060
|
-
let u =
|
|
1049
|
+
let u = G({
|
|
1061
1050
|
operationId: i.id,
|
|
1062
|
-
file:
|
|
1063
|
-
inputName:
|
|
1064
|
-
disabled:
|
|
1051
|
+
file: t,
|
|
1052
|
+
inputName: r,
|
|
1053
|
+
disabled: n,
|
|
1065
1054
|
isActive: i.id === a,
|
|
1066
1055
|
onActivateOperation: o,
|
|
1067
1056
|
onCloseOperation: s,
|
|
1068
1057
|
getFileAttribute: c,
|
|
1069
1058
|
setFileAttribute: l
|
|
1070
1059
|
}), d = i.renderContent(u);
|
|
1071
|
-
return d == null ? null :
|
|
1060
|
+
return d == null ? null : e`<div class="pkt-fileupload__queue-display__item__operation-content">
|
|
1072
1061
|
${d}
|
|
1073
1062
|
</div>`;
|
|
1074
|
-
}),
|
|
1063
|
+
}), X = ({ file: t, disabled: n, inputName: r, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => {
|
|
1075
1064
|
if (!a) return null;
|
|
1076
1065
|
let u = i.find((e) => e.id === a);
|
|
1077
1066
|
if (!u?.renderExtendedUI) return null;
|
|
1078
|
-
let d =
|
|
1067
|
+
let d = G({
|
|
1079
1068
|
operationId: u.id,
|
|
1080
|
-
file:
|
|
1081
|
-
inputName:
|
|
1082
|
-
disabled:
|
|
1069
|
+
file: t,
|
|
1070
|
+
inputName: r,
|
|
1071
|
+
disabled: n,
|
|
1083
1072
|
isActive: !0,
|
|
1084
1073
|
onActivateOperation: o,
|
|
1085
1074
|
onCloseOperation: s,
|
|
1086
1075
|
getFileAttribute: c,
|
|
1087
1076
|
setFileAttribute: l
|
|
1088
1077
|
});
|
|
1089
|
-
return
|
|
1078
|
+
return e`<div class="pkt-fileupload__queue-display__item__expanded-operation-ui">
|
|
1090
1079
|
${u.renderExtendedUI(d)}
|
|
1091
1080
|
</div>`;
|
|
1092
|
-
},
|
|
1081
|
+
}, Z = ({ file: e, disabled: t, inputName: n, operations: r, activeOperationId: i, onActivateOperation: a, onCloseOperation: o, getFileAttribute: s, setFileAttribute: c }) => r.map((r) => {
|
|
1093
1082
|
if (!r.renderHidden) return null;
|
|
1094
|
-
let l =
|
|
1083
|
+
let l = G({
|
|
1095
1084
|
operationId: r.id,
|
|
1096
1085
|
file: e,
|
|
1097
1086
|
inputName: n,
|
|
@@ -1103,45 +1092,45 @@ var M = "comments", N = (e) => {
|
|
|
1103
1092
|
setFileAttribute: c
|
|
1104
1093
|
});
|
|
1105
1094
|
return r.renderHidden(l);
|
|
1106
|
-
}),
|
|
1107
|
-
let i =
|
|
1108
|
-
return
|
|
1095
|
+
}), Q = (t, n, r) => {
|
|
1096
|
+
let i = j(t);
|
|
1097
|
+
return e`
|
|
1109
1098
|
<pkt-icon
|
|
1110
1099
|
name="document-text"
|
|
1111
1100
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
1112
1101
|
aria-hidden="true"
|
|
1113
1102
|
></pkt-icon>
|
|
1114
|
-
${
|
|
1103
|
+
${H(i, n, r)}
|
|
1115
1104
|
`;
|
|
1116
|
-
},
|
|
1117
|
-
let
|
|
1118
|
-
return
|
|
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;
|
|
1107
|
+
return e`
|
|
1119
1108
|
<div
|
|
1120
|
-
class=${
|
|
1109
|
+
class=${s({
|
|
1121
1110
|
"pkt-fileupload__queue-display__item__thumbnail": !0,
|
|
1122
|
-
"pkt-fileupload__queue-display__item__thumbnail--fallback": !
|
|
1111
|
+
"pkt-fileupload__queue-display__item__thumbnail--fallback": !p
|
|
1123
1112
|
})}
|
|
1124
1113
|
>
|
|
1125
1114
|
<button
|
|
1126
1115
|
type="button"
|
|
1127
1116
|
class="pkt-fileupload__queue-display__item__thumbnail__image-wrapper pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--label-only"
|
|
1128
|
-
aria-label=${
|
|
1129
|
-
?disabled=${!
|
|
1117
|
+
aria-label=${l(i.fileupload.previewImage, { filename: f })}
|
|
1118
|
+
?disabled=${!h}
|
|
1130
1119
|
@click=${() => {
|
|
1131
|
-
!
|
|
1120
|
+
!h || !c || c(t.fileId);
|
|
1132
1121
|
}}
|
|
1133
1122
|
>
|
|
1134
1123
|
<span class="pkt-btn__text">
|
|
1135
|
-
${
|
|
1124
|
+
${m ? e`<pkt-icon
|
|
1136
1125
|
name="expand"
|
|
1137
1126
|
class="pkt-fileupload__queue-display__item__thumbnail__expand-icon"
|
|
1138
1127
|
aria-hidden="true"
|
|
1139
1128
|
></pkt-icon>` : null}
|
|
1140
|
-
${
|
|
1141
|
-
src=${
|
|
1142
|
-
alt=${
|
|
1143
|
-
@error=${() =>
|
|
1144
|
-
/>` :
|
|
1129
|
+
${p ? e`<img
|
|
1130
|
+
src=${u(n)}
|
|
1131
|
+
alt=${f}
|
|
1132
|
+
@error=${() => d?.(t.fileId)}
|
|
1133
|
+
/>` : e`<pkt-icon
|
|
1145
1134
|
name="document-text"
|
|
1146
1135
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
1147
1136
|
aria-hidden="true"
|
|
@@ -1149,61 +1138,61 @@ var M = "comments", N = (e) => {
|
|
|
1149
1138
|
</span>
|
|
1150
1139
|
</button>
|
|
1151
1140
|
<span class="pkt-fileupload__queue-display__item__thumbnail__title"
|
|
1152
|
-
>${
|
|
1141
|
+
>${V(f, o)}</span
|
|
1153
1142
|
>
|
|
1154
1143
|
</div>
|
|
1155
1144
|
`;
|
|
1156
|
-
},
|
|
1157
|
-
let y =
|
|
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({
|
|
1158
1147
|
operationId: b.id,
|
|
1159
|
-
file:
|
|
1160
|
-
inputName:
|
|
1161
|
-
disabled:
|
|
1148
|
+
file: t,
|
|
1149
|
+
inputName: n,
|
|
1150
|
+
disabled: r,
|
|
1162
1151
|
isActive: !0,
|
|
1163
1152
|
onActivateOperation: c,
|
|
1164
1153
|
onCloseOperation: l,
|
|
1165
1154
|
getFileAttribute: u,
|
|
1166
1155
|
setFileAttribute: d
|
|
1167
1156
|
})) : null;
|
|
1168
|
-
return
|
|
1157
|
+
return e`
|
|
1169
1158
|
<li
|
|
1170
|
-
class=${
|
|
1159
|
+
class=${s({
|
|
1171
1160
|
"pkt-fileupload__queue-display__item": !0,
|
|
1172
1161
|
"pkt-fileupload__queue-display__item--in-progress": y === "in-progress",
|
|
1173
1162
|
"pkt-fileupload__queue-display__item--error": y === "error",
|
|
1174
1163
|
[`pkt-fileupload__queue-display__item--${f}`]: typeof f == "string"
|
|
1175
1164
|
})}
|
|
1176
1165
|
>
|
|
1177
|
-
${
|
|
1178
|
-
file:
|
|
1179
|
-
disabled:
|
|
1180
|
-
inputName:
|
|
1166
|
+
${Z({
|
|
1167
|
+
file: t,
|
|
1168
|
+
disabled: r,
|
|
1169
|
+
inputName: n,
|
|
1181
1170
|
operations: a,
|
|
1182
|
-
activeOperationId:
|
|
1171
|
+
activeOperationId: o,
|
|
1183
1172
|
onActivateOperation: c,
|
|
1184
1173
|
onCloseOperation: l,
|
|
1185
1174
|
getFileAttribute: u,
|
|
1186
1175
|
setFileAttribute: d
|
|
1187
1176
|
})}
|
|
1188
|
-
${y === "in-progress" ?
|
|
1189
|
-
file:
|
|
1177
|
+
${y === "in-progress" ? K({
|
|
1178
|
+
file: t,
|
|
1190
1179
|
fileSize: i,
|
|
1191
|
-
disabled:
|
|
1180
|
+
disabled: r,
|
|
1192
1181
|
transferProgress: f,
|
|
1193
1182
|
transferShowProgress: m,
|
|
1194
1183
|
loadingText: g,
|
|
1195
1184
|
truncateTail: _,
|
|
1196
1185
|
onCancel: v
|
|
1197
|
-
}) : y === "error" ?
|
|
1198
|
-
file:
|
|
1186
|
+
}) : y === "error" ? q({
|
|
1187
|
+
file: t,
|
|
1199
1188
|
fileSize: i,
|
|
1200
|
-
disabled:
|
|
1189
|
+
disabled: r,
|
|
1201
1190
|
transferShowProgress: m,
|
|
1202
1191
|
transferLastProgress: h,
|
|
1203
1192
|
transferErrorMessage: p,
|
|
1204
1193
|
truncateTail: _,
|
|
1205
1194
|
onCancel: v
|
|
1206
|
-
}) : x ?
|
|
1195
|
+
}) : x ? e`
|
|
1207
1196
|
<pkt-icon
|
|
1208
1197
|
name="document-text"
|
|
1209
1198
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
@@ -1212,35 +1201,35 @@ var M = "comments", N = (e) => {
|
|
|
1212
1201
|
<div class="pkt-fileupload__queue-display__item__inline-ui">
|
|
1213
1202
|
${x}
|
|
1214
1203
|
</div>
|
|
1215
|
-
` :
|
|
1216
|
-
${y === "idle" ?
|
|
1217
|
-
file:
|
|
1218
|
-
disabled:
|
|
1219
|
-
inputName:
|
|
1204
|
+
` : Q(t, i, _)}
|
|
1205
|
+
${y === "idle" ? J({
|
|
1206
|
+
file: t,
|
|
1207
|
+
disabled: r,
|
|
1208
|
+
inputName: n,
|
|
1220
1209
|
operations: a,
|
|
1221
|
-
activeOperationId:
|
|
1210
|
+
activeOperationId: o,
|
|
1222
1211
|
onActivateOperation: c,
|
|
1223
1212
|
onCloseOperation: l,
|
|
1224
1213
|
getFileAttribute: u,
|
|
1225
1214
|
setFileAttribute: d
|
|
1226
1215
|
}) : null}
|
|
1227
|
-
${y === "idle" ?
|
|
1228
|
-
file:
|
|
1229
|
-
disabled:
|
|
1230
|
-
inputName:
|
|
1216
|
+
${y === "idle" ? Y({
|
|
1217
|
+
file: t,
|
|
1218
|
+
disabled: r,
|
|
1219
|
+
inputName: n,
|
|
1231
1220
|
operations: a,
|
|
1232
|
-
activeOperationId:
|
|
1221
|
+
activeOperationId: o,
|
|
1233
1222
|
onActivateOperation: c,
|
|
1234
1223
|
onCloseOperation: l,
|
|
1235
1224
|
getFileAttribute: u,
|
|
1236
1225
|
setFileAttribute: d
|
|
1237
1226
|
}) : null}
|
|
1238
|
-
${y === "idle" ?
|
|
1239
|
-
file:
|
|
1240
|
-
disabled:
|
|
1241
|
-
inputName:
|
|
1227
|
+
${y === "idle" ? X({
|
|
1228
|
+
file: t,
|
|
1229
|
+
disabled: r,
|
|
1230
|
+
inputName: n,
|
|
1242
1231
|
operations: a,
|
|
1243
|
-
activeOperationId:
|
|
1232
|
+
activeOperationId: o,
|
|
1244
1233
|
onActivateOperation: c,
|
|
1245
1234
|
onCloseOperation: l,
|
|
1246
1235
|
getFileAttribute: u,
|
|
@@ -1248,31 +1237,31 @@ var M = "comments", N = (e) => {
|
|
|
1248
1237
|
}) : null}
|
|
1249
1238
|
</li>
|
|
1250
1239
|
`;
|
|
1251
|
-
},
|
|
1252
|
-
let w =
|
|
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({
|
|
1253
1242
|
operationId: T.id,
|
|
1254
|
-
file:
|
|
1255
|
-
inputName:
|
|
1256
|
-
disabled:
|
|
1243
|
+
file: t,
|
|
1244
|
+
inputName: n,
|
|
1245
|
+
disabled: r,
|
|
1257
1246
|
isActive: !0,
|
|
1258
1247
|
onActivateOperation: d,
|
|
1259
1248
|
onCloseOperation: f,
|
|
1260
1249
|
getFileAttribute: p,
|
|
1261
1250
|
setFileAttribute: m
|
|
1262
1251
|
})) : null;
|
|
1263
|
-
return
|
|
1252
|
+
return e`
|
|
1264
1253
|
<li
|
|
1265
|
-
class=${
|
|
1254
|
+
class=${s({
|
|
1266
1255
|
"pkt-fileupload__queue-display__item": !0,
|
|
1267
1256
|
"pkt-fileupload__queue-display__item--in-progress": w === "in-progress",
|
|
1268
1257
|
"pkt-fileupload__queue-display__item--error": w === "error",
|
|
1269
1258
|
[`pkt-fileupload__queue-display__item--${h}`]: typeof h == "string"
|
|
1270
1259
|
})}
|
|
1271
1260
|
>
|
|
1272
|
-
${
|
|
1273
|
-
file:
|
|
1274
|
-
disabled:
|
|
1275
|
-
inputName:
|
|
1261
|
+
${Z({
|
|
1262
|
+
file: t,
|
|
1263
|
+
disabled: r,
|
|
1264
|
+
inputName: n,
|
|
1276
1265
|
operations: l,
|
|
1277
1266
|
activeOperationId: u,
|
|
1278
1267
|
onActivateOperation: d,
|
|
@@ -1280,26 +1269,26 @@ var M = "comments", N = (e) => {
|
|
|
1280
1269
|
getFileAttribute: p,
|
|
1281
1270
|
setFileAttribute: m
|
|
1282
1271
|
})}
|
|
1283
|
-
${w === "in-progress" ?
|
|
1284
|
-
file:
|
|
1272
|
+
${w === "in-progress" ? K({
|
|
1273
|
+
file: t,
|
|
1285
1274
|
fileSize: i,
|
|
1286
|
-
disabled:
|
|
1275
|
+
disabled: r,
|
|
1287
1276
|
transferProgress: h,
|
|
1288
1277
|
transferShowProgress: _,
|
|
1289
1278
|
loadingText: y,
|
|
1290
1279
|
truncateTail: b,
|
|
1291
1280
|
onCancel: x,
|
|
1292
1281
|
iconName: "picture"
|
|
1293
|
-
}) : w === "error" ?
|
|
1294
|
-
file:
|
|
1282
|
+
}) : w === "error" ? q({
|
|
1283
|
+
file: t,
|
|
1295
1284
|
fileSize: i,
|
|
1296
|
-
disabled:
|
|
1285
|
+
disabled: r,
|
|
1297
1286
|
transferShowProgress: _,
|
|
1298
1287
|
transferLastProgress: v,
|
|
1299
1288
|
transferErrorMessage: g,
|
|
1300
1289
|
truncateTail: b,
|
|
1301
1290
|
onCancel: x
|
|
1302
|
-
}) : E ?
|
|
1291
|
+
}) : E ? e`
|
|
1303
1292
|
<pkt-icon
|
|
1304
1293
|
name="picture"
|
|
1305
1294
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
@@ -1308,19 +1297,19 @@ var M = "comments", N = (e) => {
|
|
|
1308
1297
|
<div class="pkt-fileupload__queue-display__item__inline-ui">
|
|
1309
1298
|
${E}
|
|
1310
1299
|
</div>
|
|
1311
|
-
` :
|
|
1312
|
-
file:
|
|
1300
|
+
` : ee({
|
|
1301
|
+
file: t,
|
|
1313
1302
|
thumbnailUrl: a,
|
|
1314
|
-
previewEnabled:
|
|
1303
|
+
previewEnabled: o,
|
|
1315
1304
|
canOpenPreview: c,
|
|
1316
1305
|
truncateTail: b,
|
|
1317
1306
|
onOpenPreview: S,
|
|
1318
1307
|
onThumbnailImageError: C
|
|
1319
1308
|
})}
|
|
1320
|
-
${w === "idle" ?
|
|
1321
|
-
file:
|
|
1322
|
-
disabled:
|
|
1323
|
-
inputName:
|
|
1309
|
+
${w === "idle" ? J({
|
|
1310
|
+
file: t,
|
|
1311
|
+
disabled: r,
|
|
1312
|
+
inputName: n,
|
|
1324
1313
|
operations: l,
|
|
1325
1314
|
activeOperationId: u,
|
|
1326
1315
|
onActivateOperation: d,
|
|
@@ -1328,10 +1317,10 @@ var M = "comments", N = (e) => {
|
|
|
1328
1317
|
getFileAttribute: p,
|
|
1329
1318
|
setFileAttribute: m
|
|
1330
1319
|
}) : null}
|
|
1331
|
-
${w === "idle" ?
|
|
1332
|
-
file:
|
|
1333
|
-
disabled:
|
|
1334
|
-
inputName:
|
|
1320
|
+
${w === "idle" ? Y({
|
|
1321
|
+
file: t,
|
|
1322
|
+
disabled: r,
|
|
1323
|
+
inputName: n,
|
|
1335
1324
|
operations: l,
|
|
1336
1325
|
activeOperationId: u,
|
|
1337
1326
|
onActivateOperation: d,
|
|
@@ -1339,10 +1328,10 @@ var M = "comments", N = (e) => {
|
|
|
1339
1328
|
getFileAttribute: p,
|
|
1340
1329
|
setFileAttribute: m
|
|
1341
1330
|
}) : null}
|
|
1342
|
-
${w === "idle" ?
|
|
1343
|
-
file:
|
|
1344
|
-
disabled:
|
|
1345
|
-
inputName:
|
|
1331
|
+
${w === "idle" ? X({
|
|
1332
|
+
file: t,
|
|
1333
|
+
disabled: r,
|
|
1334
|
+
inputName: n,
|
|
1346
1335
|
operations: l,
|
|
1347
1336
|
activeOperationId: u,
|
|
1348
1337
|
onActivateOperation: d,
|
|
@@ -1352,14 +1341,14 @@ var M = "comments", N = (e) => {
|
|
|
1352
1341
|
}) : null}
|
|
1353
1342
|
</li>
|
|
1354
1343
|
`;
|
|
1355
|
-
}, $ = class extends
|
|
1344
|
+
}, $ = class extends N {
|
|
1356
1345
|
constructor(...e) {
|
|
1357
1346
|
super(...e), this.activeOperationByFileId = {}, this.isPreviewModalOpen = !1, this.previewCurrentIndex = 0, this.failedImageFileIds = {}, this.closePreview = () => {
|
|
1358
1347
|
this.isPreviewModalOpen = !1;
|
|
1359
1348
|
}, this.onPreviewKeyDown = (e, t) => {
|
|
1360
1349
|
if (this.isPreviewModalOpen) {
|
|
1361
1350
|
if (e.key === "Tab") {
|
|
1362
|
-
|
|
1351
|
+
p(e, e.currentTarget);
|
|
1363
1352
|
return;
|
|
1364
1353
|
}
|
|
1365
1354
|
switch (e.key) {
|
|
@@ -1378,9 +1367,10 @@ var M = "comments", N = (e) => {
|
|
|
1378
1367
|
super.updated(e), this.classList.add("pkt-fileupload-component");
|
|
1379
1368
|
}
|
|
1380
1369
|
render() {
|
|
1381
|
-
let
|
|
1382
|
-
return this.label ?
|
|
1370
|
+
let t = this.renderContent();
|
|
1371
|
+
return this.label ? e`
|
|
1383
1372
|
<pkt-input-wrapper
|
|
1373
|
+
.strings=${this.strings}
|
|
1384
1374
|
.forId=${`${this.id}-input`}
|
|
1385
1375
|
.label=${this.label}
|
|
1386
1376
|
.helptext=${this.helptext}
|
|
@@ -1393,36 +1383,36 @@ var M = "comments", N = (e) => {
|
|
|
1393
1383
|
?requiredTag=${this.requiredTag}
|
|
1394
1384
|
.requiredText=${this.requiredText}
|
|
1395
1385
|
.tagText=${this.tagText}
|
|
1396
|
-
class=${
|
|
1386
|
+
class=${s({
|
|
1397
1387
|
"pkt-fileupload-wrapper": !0,
|
|
1398
1388
|
"pkt-fileupload-wrapper--full-width": this.fullwidth
|
|
1399
1389
|
})}
|
|
1400
1390
|
>
|
|
1401
|
-
${
|
|
1391
|
+
${t}
|
|
1402
1392
|
</pkt-input-wrapper>
|
|
1403
|
-
` :
|
|
1393
|
+
` : t;
|
|
1404
1394
|
}
|
|
1405
1395
|
renderContent() {
|
|
1406
|
-
let
|
|
1407
|
-
dragInactive:
|
|
1408
|
-
dragActive:
|
|
1409
|
-
openFileDialog:
|
|
1396
|
+
let t = this.getSortedFilesAndTransfers(), n = this.getPreviewableImages(t), r = this.pktStrings.get("fileupload"), i = this.getSupportedFormatsText(), a = [!this.label && this.helptext ? `${this.id}-helptext` : void 0, this.hasEffectiveError ? `${this.id}-error` : void 0].filter(Boolean).join(" ") || void 0, o = this.itemRenderer === "thumbnail" ? this.multiple ? {
|
|
1397
|
+
dragInactive: r.dropZoneDragMultipleThumbnail,
|
|
1398
|
+
dragActive: r.dropZoneDragActiveMultipleThumbnail,
|
|
1399
|
+
openFileDialog: r.dropZoneOpenFileDialogMultipleThumbnail
|
|
1410
1400
|
} : {
|
|
1411
|
-
dragInactive:
|
|
1412
|
-
dragActive:
|
|
1413
|
-
openFileDialog:
|
|
1401
|
+
dragInactive: r.dropZoneDragSingleThumbnail,
|
|
1402
|
+
dragActive: r.dropZoneDragActiveSingleThumbnail,
|
|
1403
|
+
openFileDialog: r.dropZoneOpenFileDialogSingleThumbnail
|
|
1414
1404
|
} : this.multiple ? {
|
|
1415
|
-
dragInactive:
|
|
1416
|
-
dragActive:
|
|
1417
|
-
openFileDialog:
|
|
1405
|
+
dragInactive: r.dropZoneDragMultiple,
|
|
1406
|
+
dragActive: r.dropZoneDragActiveMultiple,
|
|
1407
|
+
openFileDialog: r.dropZoneOpenFileDialogMultiple
|
|
1418
1408
|
} : {
|
|
1419
|
-
dragInactive:
|
|
1420
|
-
dragActive:
|
|
1421
|
-
openFileDialog:
|
|
1409
|
+
dragInactive: r.dropZoneDragSingle,
|
|
1410
|
+
dragActive: r.dropZoneDragActiveSingle,
|
|
1411
|
+
openFileDialog: r.dropZoneOpenFileDialogSingle
|
|
1422
1412
|
};
|
|
1423
|
-
return
|
|
1413
|
+
return e`
|
|
1424
1414
|
<div
|
|
1425
|
-
class=${
|
|
1415
|
+
class=${s({
|
|
1426
1416
|
"pkt-fileupload": !0,
|
|
1427
1417
|
"pkt-fileupload--full-width": this.fullwidth,
|
|
1428
1418
|
"pkt-fileupload--error": this.hasEffectiveError,
|
|
@@ -1438,7 +1428,7 @@ var M = "comments", N = (e) => {
|
|
|
1438
1428
|
${this.getSrErrorsMessage()}
|
|
1439
1429
|
</div>
|
|
1440
1430
|
<div
|
|
1441
|
-
class=${
|
|
1431
|
+
class=${s({
|
|
1442
1432
|
"pkt-fileupload__drop-zone": !0,
|
|
1443
1433
|
"pkt-fileupload__drop-zone--drag-active": this.isDragActive,
|
|
1444
1434
|
"pkt-fileupload__drop-zone--disabled": this.disabled
|
|
@@ -1451,18 +1441,18 @@ var M = "comments", N = (e) => {
|
|
|
1451
1441
|
<input
|
|
1452
1442
|
id=${`${this.id}-input`}
|
|
1453
1443
|
type="file"
|
|
1454
|
-
name=${
|
|
1444
|
+
name=${u(this.uploadStrategy === "form" ? this.name : void 0)}
|
|
1455
1445
|
?multiple=${this.multiple}
|
|
1456
1446
|
?disabled=${this.disabled}
|
|
1457
1447
|
?required=${this.required && this.uploadStrategy === "form"}
|
|
1458
1448
|
accept=${this.getResolvedAcceptValue()}
|
|
1459
|
-
aria-label=${
|
|
1460
|
-
aria-required=${
|
|
1461
|
-
aria-invalid=${
|
|
1462
|
-
aria-describedby=${
|
|
1449
|
+
aria-label=${u(this.label ? void 0 : this.multiple ? "Velg filer" : "Velg fil")}
|
|
1450
|
+
aria-required=${u(this.required ? "true" : void 0)}
|
|
1451
|
+
aria-invalid=${u(this.hasEffectiveError ? "true" : void 0)}
|
|
1452
|
+
aria-describedby=${u(a)}
|
|
1463
1453
|
@change=${this.onNativeFileChange}
|
|
1464
1454
|
/>
|
|
1465
|
-
${this.uploadStrategy === "custom" ?
|
|
1455
|
+
${this.uploadStrategy === "custom" ? t.map((t) => e`<input type="hidden" name=${this.name} value=${t.fileId} />`) : null}
|
|
1466
1456
|
<div class="pkt-fileupload__drop-zone__placeholder">
|
|
1467
1457
|
<pkt-icon
|
|
1468
1458
|
name="attachment"
|
|
@@ -1470,21 +1460,21 @@ var M = "comments", N = (e) => {
|
|
|
1470
1460
|
aria-hidden="true"
|
|
1471
1461
|
></pkt-icon>
|
|
1472
1462
|
<p class="pkt-fileupload__drop-zone__placeholder__title">
|
|
1473
|
-
${this.isDragActive ? `${
|
|
1463
|
+
${this.isDragActive ? `${o.dragActive} ...` : e`${o.dragInactive}
|
|
1474
1464
|
<button
|
|
1475
1465
|
type="button"
|
|
1476
1466
|
class="pkt-fileupload__drop-zone__placeholder__title__open-file-dialog"
|
|
1477
1467
|
@click=${this.openFileDialog}
|
|
1478
1468
|
>
|
|
1479
|
-
${
|
|
1469
|
+
${o.openFileDialog}
|
|
1480
1470
|
</button>`}
|
|
1481
1471
|
</p>
|
|
1482
|
-
${
|
|
1483
|
-
${
|
|
1472
|
+
${i ? e`<p class="pkt-fileupload__drop-zone__placeholder__formats">
|
|
1473
|
+
${r.supportedFormatsPrefix} ${i}
|
|
1484
1474
|
</p>` : null}
|
|
1485
1475
|
</div>
|
|
1486
1476
|
</div>
|
|
1487
|
-
${this.hasEffectiveError ?
|
|
1477
|
+
${this.hasEffectiveError ? e`
|
|
1488
1478
|
<pkt-alert
|
|
1489
1479
|
skin="error"
|
|
1490
1480
|
role="alert"
|
|
@@ -1496,10 +1486,10 @@ var M = "comments", N = (e) => {
|
|
|
1496
1486
|
${this.effectiveErrorMessage}
|
|
1497
1487
|
</pkt-alert>
|
|
1498
1488
|
` : null}
|
|
1499
|
-
${
|
|
1500
|
-
${
|
|
1489
|
+
${t.length > 0 ? e`<ul class="pkt-fileupload__queue-display">
|
|
1490
|
+
${t.map((e) => this.renderQueueItem(e, n))}
|
|
1501
1491
|
</ul>` : null}
|
|
1502
|
-
${this.renderPreviewModal(
|
|
1492
|
+
${this.renderPreviewModal(n)}
|
|
1503
1493
|
</div>
|
|
1504
1494
|
`;
|
|
1505
1495
|
}
|
|
@@ -1507,7 +1497,7 @@ var M = "comments", N = (e) => {
|
|
|
1507
1497
|
let n = typeof e.file?.size == "number" ? this.formatFileSize(e.file.size) : "", r = this.getQueueItemOperations();
|
|
1508
1498
|
if (this.itemRenderer === "thumbnail") {
|
|
1509
1499
|
let i = this.canOpenPreview(e), a = this.failedImageFileIds[e.fileId]?.thumbnail ? void 0 : this.getThumbnailUrl(e);
|
|
1510
|
-
return
|
|
1500
|
+
return ne({
|
|
1511
1501
|
file: e,
|
|
1512
1502
|
inputName: this.name,
|
|
1513
1503
|
disabled: this.disabled,
|
|
@@ -1532,7 +1522,7 @@ var M = "comments", N = (e) => {
|
|
|
1532
1522
|
onThumbnailImageError: (e) => this.markImageFailed(e, "thumbnail")
|
|
1533
1523
|
});
|
|
1534
1524
|
}
|
|
1535
|
-
return
|
|
1525
|
+
return te({
|
|
1536
1526
|
file: e,
|
|
1537
1527
|
inputName: this.name,
|
|
1538
1528
|
disabled: this.disabled,
|
|
@@ -1578,28 +1568,28 @@ var M = "comments", N = (e) => {
|
|
|
1578
1568
|
});
|
|
1579
1569
|
}
|
|
1580
1570
|
navigatePreview(e, t) {
|
|
1581
|
-
t.length !== 0 && (this.previewCurrentIndex =
|
|
1571
|
+
t.length !== 0 && (this.previewCurrentIndex = k(this.previewCurrentIndex, e, t.length));
|
|
1582
1572
|
}
|
|
1583
|
-
renderPreviewModal(
|
|
1584
|
-
if (!this.enableImagePreview ||
|
|
1585
|
-
let
|
|
1586
|
-
if (!
|
|
1587
|
-
let
|
|
1588
|
-
return
|
|
1573
|
+
renderPreviewModal(t) {
|
|
1574
|
+
if (!this.enableImagePreview || t.length === 0) return null;
|
|
1575
|
+
let n = this.pktStrings.get("fileupload"), r = t[this.previewCurrentIndex];
|
|
1576
|
+
if (!r) return null;
|
|
1577
|
+
let i = t.length > 1, a = this.getThumbnailUrl(r), o = !!a && !this.failedImageFileIds[r.fileId]?.preview, s = r.attributes?.targetFilename || r.file?.name || n.previewFallbackName;
|
|
1578
|
+
return e`
|
|
1589
1579
|
<pkt-modal
|
|
1590
1580
|
.open=${this.isPreviewModalOpen}
|
|
1591
|
-
.headingText=${
|
|
1581
|
+
.headingText=${s}
|
|
1592
1582
|
closeOnBackdropClick
|
|
1593
1583
|
class="pkt-fileupload__image-preview-modal"
|
|
1594
1584
|
@close=${this.closePreview}
|
|
1595
|
-
@keydown=${(
|
|
1585
|
+
@keydown=${(e) => this.onPreviewKeyDown(e, t)}
|
|
1596
1586
|
>
|
|
1597
1587
|
<div class="pkt-fileupload__image-preview">
|
|
1598
|
-
${
|
|
1588
|
+
${i ? e`<button
|
|
1599
1589
|
type="button"
|
|
1600
1590
|
class="pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--icon-only"
|
|
1601
|
-
aria-label=${`Forrige bilde ${this.previewCurrentIndex} / ${
|
|
1602
|
-
@click=${() => this.navigatePreview("prev",
|
|
1591
|
+
aria-label=${`Forrige bilde ${this.previewCurrentIndex} / ${t.length}`}
|
|
1592
|
+
@click=${() => this.navigatePreview("prev", t)}
|
|
1603
1593
|
>
|
|
1604
1594
|
<pkt-icon
|
|
1605
1595
|
class="pkt-btn__icon pkt-icon"
|
|
@@ -1610,26 +1600,26 @@ var M = "comments", N = (e) => {
|
|
|
1610
1600
|
</button>` : null}
|
|
1611
1601
|
|
|
1612
1602
|
<div class="pkt-fileupload__image-preview__content">
|
|
1613
|
-
${
|
|
1614
|
-
src=${
|
|
1615
|
-
alt=${`${
|
|
1603
|
+
${o ? e`<img
|
|
1604
|
+
src=${a}
|
|
1605
|
+
alt=${`${s} - ${this.previewCurrentIndex + 1} av ${t.length}`}
|
|
1616
1606
|
class="pkt-fileupload__image-preview__image"
|
|
1617
|
-
@error=${() => this.markImageFailed(
|
|
1618
|
-
/>` :
|
|
1607
|
+
@error=${() => this.markImageFailed(r.fileId, "preview")}
|
|
1608
|
+
/>` : e`<pkt-icon
|
|
1619
1609
|
name="picture"
|
|
1620
1610
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
1621
1611
|
aria-hidden="true"
|
|
1622
1612
|
></pkt-icon>`}
|
|
1623
1613
|
</div>
|
|
1624
1614
|
|
|
1625
|
-
${
|
|
1626
|
-
${this.previewCurrentIndex + 1} / ${
|
|
1615
|
+
${i ? e`<span class="pkt-fileupload__image-preview__counter">
|
|
1616
|
+
${this.previewCurrentIndex + 1} / ${t.length}
|
|
1627
1617
|
</span>` : null}
|
|
1628
|
-
${
|
|
1618
|
+
${i ? e`<button
|
|
1629
1619
|
type="button"
|
|
1630
1620
|
class="pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--icon-only"
|
|
1631
|
-
aria-label=${`Neste bilde ${this.previewCurrentIndex + 2} / ${
|
|
1632
|
-
@click=${() => this.navigatePreview("next",
|
|
1621
|
+
aria-label=${`Neste bilde ${this.previewCurrentIndex + 2} / ${t.length}`}
|
|
1622
|
+
@click=${() => this.navigatePreview("next", t)}
|
|
1633
1623
|
>
|
|
1634
1624
|
<pkt-icon
|
|
1635
1625
|
class="pkt-btn__icon pkt-icon"
|
|
@@ -1644,7 +1634,7 @@ var M = "comments", N = (e) => {
|
|
|
1644
1634
|
}
|
|
1645
1635
|
getQueueItemOperations() {
|
|
1646
1636
|
let e = [];
|
|
1647
|
-
return this.renameFilesEnabled && this.itemRenderer !== "thumbnail" && e.push(
|
|
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;
|
|
1648
1638
|
}
|
|
1649
1639
|
activateOperation(e, t) {
|
|
1650
1640
|
this.activeOperationByFileId = {
|
|
@@ -1672,9 +1662,9 @@ var M = "comments", N = (e) => {
|
|
|
1672
1662
|
n === void 0 && delete i[t], this.updateFileItem(e, { attributes: i });
|
|
1673
1663
|
}
|
|
1674
1664
|
};
|
|
1675
|
-
|
|
1665
|
+
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")], $);
|
|
1676
1666
|
//#endregion
|
|
1677
1667
|
//#region src/components/fileupload/index.ts
|
|
1678
|
-
var
|
|
1668
|
+
var re = $;
|
|
1679
1669
|
//#endregion
|
|
1680
|
-
export { $ as n,
|
|
1670
|
+
export { $ as n, re as t };
|