@oslokommune/punkt-elements 16.18.0 → 16.21.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 +34 -0
- package/dist/{accordion-CU2tJ5vn.js → accordion-BjYsEbSM.js} +19 -19
- package/dist/{accordion-DDZkjXFb.cjs → accordion-DaeWPWod.cjs} +5 -5
- package/dist/{alert-D_eXGOez.js → alert-BkzC5mVu.js} +22 -22
- package/dist/{alert-NyLr62jZ.cjs → alert-D_45dWPn.cjs} +6 -6
- package/dist/{async-directive-CaQiqjyV.js → async-directive-Cz6tcqge.js} +2 -2
- package/dist/async-directive-DO1QtVmf.cjs +1 -0
- package/dist/{backlink-CTu44BHn.js → backlink-BXAdgAte.js} +6 -6
- package/dist/{backlink-BsQ0Rmxj.cjs → backlink-C42-3OG3.cjs} +2 -2
- package/dist/{breadcrumbs-BNZ1L-0q.cjs → breadcrumbs-CkjeLh3U.cjs} +6 -6
- package/dist/{breadcrumbs-DPnoURvl.js → breadcrumbs-Dkb9TxMp.js} +15 -15
- package/dist/{button-ZYlrRRfu.js → button-CR-KWhTT.js} +21 -21
- package/dist/{button-DsGvcLIn.cjs → button-Dwv11n6R.cjs} +7 -7
- package/dist/{calendar-CDDVoUby.cjs → calendar-Buvxe4l_.cjs} +11 -11
- package/dist/{calendar-VOqO5um6.js → calendar-DAq6iJdx.js} +50 -50
- package/dist/{card-B4oDGIRP.js → card-5PydU247.js} +43 -43
- package/dist/{card-DZuZy0ay.cjs → card-C__IlsUa.cjs} +26 -26
- package/dist/{checkbox-CF5mSBR5.js → checkbox-CC1X7fw4.js} +23 -23
- package/dist/{checkbox-BerAYcfK.cjs → checkbox-DzMc0AJX.cjs} +10 -10
- package/dist/class-map-B8Ja0q7n.cjs +1 -0
- package/dist/{class-map-C8HuhNzZ.js → class-map-DH9hlJny.js} +7 -8
- package/dist/{combobox-BDYoPZmg.js → combobox-D-DY7YcW.js} +42 -42
- package/dist/{combobox-Ct9gCFa1.cjs → combobox-x4tBGP3F.cjs} +17 -17
- package/dist/components/heading/heading.d.ts +5 -8
- package/dist/{consent-BME_rQ2w.cjs → consent-BB3g_ByO.cjs} +3 -3
- package/dist/{consent-1IUuWZAh.js → consent-Y14WZ0JS.js} +8 -8
- package/dist/{datepicker-ByqXCpCd.cjs → datepicker-BFI-3stE.cjs} +20 -20
- package/dist/{datepicker-BGpoabCM.js → datepicker-CRk7aiwH.js} +57 -57
- package/dist/{directive-helpers-Dkv2gKgs.js → directive-helpers-Cep_4cpj.js} +1 -1
- package/dist/{directive-helpers-D1QSxY17.cjs → directive-helpers-f36YZFOG.cjs} +1 -1
- package/dist/docs/components/loader.d.ts +6 -0
- package/dist/element-CXAtr6Gu.cjs +2 -0
- package/dist/{element-cZ85T_aa.js → element-CduG0XyF.js} +47 -23
- package/dist/{element-with-slot-4J2o3SeU.js → element-with-slot-BVj9MXzi.js} +5 -6
- package/dist/element-with-slot-Cmxb9h4H.cjs +1 -0
- package/dist/{fileupload-B6W7qOQT.js → fileupload-C8muj8qd.js} +149 -149
- package/dist/{fileupload-a2OL3dzG.cjs → fileupload-YtsrgQTY.cjs} +40 -40
- package/dist/{header-BZFSan0_.cjs → header-CjBip0zj.cjs} +57 -57
- package/dist/{header-BgVpJMHQ.js → header-DONTGbD9.js} +130 -130
- package/dist/{header-menu-BXzVVOHq.js → header-menu-BU-ylGrJ.js} +45 -45
- package/dist/{header-menu-BLngov1D.cjs → header-menu-CnW7nzmF.cjs} +24 -24
- package/dist/heading-3o4Dk0Wn.js +80 -0
- package/dist/heading-C40-NX0r.cjs +1 -0
- package/dist/{helptext-BeU-enix.js → helptext-C2aQBBo_.js} +12 -12
- package/dist/{helptext-DWMFqMnV.cjs → helptext-DNLg43eI.cjs} +4 -4
- package/dist/icon-Dw6I0HDV.cjs +1 -0
- package/dist/{icon-CZQkrK6B.js → icon-LaKyBKON.js} +18 -19
- package/dist/if-defined-LTjAScFG.cjs +1 -0
- package/dist/{if-defined-Cjj8qN-Z.js → if-defined-VShASPdu.js} +1 -1
- package/dist/{input-element-D0egtEnr.cjs → input-element-BHQVt4Q9.cjs} +1 -1
- package/dist/{input-element-B1ciW1N2.js → input-element-BrmkXIXi.js} +30 -30
- package/dist/{input-wrapper-oYcbCFow.js → input-wrapper-B6WowlWG.js} +33 -33
- package/dist/{input-wrapper-Y98KV-sy.cjs → input-wrapper-Dhkt20WW.cjs} +17 -17
- package/dist/{link-BMMIjg50.cjs → link-B5ur0Rym.cjs} +4 -4
- package/dist/{link-CT0LB3S7.js → link-ClUNY__5.js} +13 -13
- package/dist/linkcard-BIcCW-qw.cjs +13 -0
- package/dist/{linkcard-Bz5zb69P.js → linkcard-DNJm5FvA.js} +15 -15
- package/dist/{listbox-0NHJvNjz.js → listbox-DXMIBv3y.js} +35 -35
- package/dist/{listbox-CcThiNBY.cjs → listbox-DbEobJNx.cjs} +14 -14
- package/dist/{loader-8T6M0FCQ.cjs → loader-Uap9qDsV.cjs} +5 -5
- package/dist/{loader-Cbrc4FFx.js → loader-gKdQpOOQ.js} +12 -12
- package/dist/{messagebox-C6LHT78_.cjs → messagebox-BqBxXK8c.cjs} +5 -5
- package/dist/{messagebox-TKKUVTo4.js → messagebox-XRFecqyS.js} +15 -15
- package/dist/{modal-BVHH8koz.js → modal-CWgeT-RP.js} +19 -19
- package/dist/{modal-CRzbtqL3.cjs → modal-CrYHKOmr.cjs} +8 -8
- 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-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 +32 -32
- 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-CCB15L_G.js → pkt-options-controller-BTNtjEIS.js} +1 -1
- package/dist/{pkt-options-controller-CeAQ-D-i.cjs → pkt-options-controller-CBM8xHwR.cjs} +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-C-5oESiB.js → progressbar-B0P_vmGD.js} +23 -24
- package/dist/progressbar-DADdvDl5.cjs +17 -0
- package/dist/{radiobutton-B1Xg6XzP.cjs → radiobutton-BfURufrZ.cjs} +8 -8
- package/dist/{radiobutton-BAn1V_mQ.js → radiobutton-C6zERHoy.js} +20 -20
- package/dist/{ref-RS8Uv6uC.js → ref-BgoHEsEt.js} +7 -8
- package/dist/ref-CBdWMlde.cjs +1 -0
- package/dist/{repeat-DV1O43YU.js → repeat-CKIii8Mi.js} +15 -16
- package/dist/repeat-CRRgmzVn.cjs +1 -0
- package/dist/{searchinput-DUgZb_zm.cjs → searchinput-BrxfRzez.cjs} +13 -13
- package/dist/{searchinput-C9FP89qD.js → searchinput-fPvXHu2O.js} +31 -31
- package/dist/{select-DkKIW7zD.js → select-BIgFPp42.js} +13 -13
- package/dist/{select-DAs8kzN4.cjs → select-DzZHv6Bz.cjs} +3 -3
- package/dist/{tabs-ClI1XQDt.js → tabs-BJx6wwXD.js} +29 -29
- package/dist/{tabs-CN_RIMWg.cjs → tabs-DxQy8U-0.cjs} +7 -7
- package/dist/{tag-vgKH9B4k.cjs → tag-CBFz0R9N.cjs} +5 -5
- package/dist/{tag-DSZ-czu-.js → tag-CzlnHhho.js} +19 -19
- package/dist/textarea-M_S9WK7s.cjs +46 -0
- package/dist/{textarea-BfjI6d7Q.js → textarea-qHtkhelz.js} +24 -25
- package/dist/{textinput-DhoupEyI.js → textinput-CZrBM-Fj.js} +26 -26
- package/dist/{textinput-BM66vo5e.cjs → textinput-C_6kvf87.cjs} +12 -12
- package/dist/{timepicker-CtRGbypF.js → timepicker-O0iCeJyW.js} +51 -51
- package/dist/{timepicker-C4oRmmRd.cjs → timepicker-WiYLAncb.cjs} +20 -20
- package/package.json +2 -2
- package/src/components/card/card.ts +1 -1
- package/src/components/heading/heading.test.ts +79 -70
- package/src/components/heading/heading.ts +40 -78
- package/dist/async-directive-B9P1Qa0k.cjs +0 -1
- package/dist/class-map-CJ-msbHs.cjs +0 -1
- package/dist/directive-3THFsVew.js +0 -28
- package/dist/directive-CJ2giQBZ.cjs +0 -1
- package/dist/element-DjtxO-1r.cjs +0 -2
- package/dist/element-with-slot-CWoTGA1B.cjs +0 -1
- package/dist/heading-BxvE80bb.js +0 -73
- package/dist/heading-DRJTS27k.cjs +0 -1
- package/dist/icon-PbaC9uUg.cjs +0 -1
- package/dist/if-defined-XKOD_t_V.cjs +0 -1
- package/dist/linkcard-CupEMkvj.cjs +0 -13
- package/dist/progressbar-C0g830Tk.cjs +0 -17
- package/dist/ref-BaJ0mBT_.cjs +0 -1
- package/dist/repeat-DaDFvx86.cjs +0 -1
- package/dist/textarea-C7YiheLo.cjs +0 -46
- /package/dist/{booleanish-CRaKZ75t.js → booleanish-BmcOU-43.js} +0 -0
- /package/dist/{booleanish-B5EFqFpJ.cjs → booleanish-jJLlnr6-.cjs} +0 -0
- /package/dist/{classutils-z8YsPlOf.cjs → classutils-CVTzKF0J.cjs} +0 -0
- /package/dist/{classutils-DEL164Ur.js → classutils-lVbGcvjN.js} +0 -0
- /package/dist/{converters-Bffq_YDm.cjs → converters-C_66kHUN.cjs} +0 -0
- /package/dist/{converters-jauYkvNh.js → converters-DSQXaDQ_.js} +0 -0
- /package/dist/{dialog-polyfill.esm-B7W3teD0.js → dialog-polyfill.esm-0dVT8G1o.js} +0 -0
- /package/dist/{dialog-polyfill.esm-BnAQvMQO.cjs → dialog-polyfill.esm-CYs2AHP1.cjs} +0 -0
- /package/dist/{focus-modality-controller-pzSZkDkH.js → focus-modality-controller-CaUqYdk0.js} +0 -0
- /package/dist/{focus-modality-controller-BSZAQk8y.cjs → focus-modality-controller-wI5SR8wH.cjs} +0 -0
- /package/dist/{input-wrapper-CQGoyLdZ.cjs → input-wrapper-CYCCx8MP.cjs} +0 -0
- /package/dist/{input-wrapper-DwSsP39J.js → input-wrapper-kw2y6Jp_.js} +0 -0
- /package/dist/{utils-BOOZ0ppt.js → utils-CUqCKGvp.js} +0 -0
- /package/dist/{utils-CM67Oudc.cjs → utils-CjAbIttF.cjs} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as o } from "./class-map-
|
|
3
|
-
import "./alert-
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { t as s } from "./if-defined-
|
|
6
|
-
import { t as c } from "./converters-
|
|
7
|
-
import { n as l } from "./utils-
|
|
8
|
-
import "./input-wrapper-
|
|
9
|
-
import "./modal-
|
|
10
|
-
import "./progressbar-
|
|
1
|
+
import { a as e, n as t, o as n, p as r, s as i, t as a } from "./element-CduG0XyF.js";
|
|
2
|
+
import { t as o } from "./class-map-DH9hlJny.js";
|
|
3
|
+
import "./alert-BkzC5mVu.js";
|
|
4
|
+
import "./icon-LaKyBKON.js";
|
|
5
|
+
import { t as s } from "./if-defined-VShASPdu.js";
|
|
6
|
+
import { t as c } from "./converters-DSQXaDQ_.js";
|
|
7
|
+
import { n as l } from "./utils-CUqCKGvp.js";
|
|
8
|
+
import "./input-wrapper-B6WowlWG.js";
|
|
9
|
+
import "./modal-CWgeT-RP.js";
|
|
10
|
+
import "./progressbar-B0P_vmGD.js";
|
|
11
11
|
//#region ../../shared-types/fileupload.ts
|
|
12
12
|
var u = {
|
|
13
13
|
dropZoneDragMultiple: "Dra filer hit for å laste dem opp eller",
|
|
@@ -434,62 +434,62 @@ var A = class extends a {
|
|
|
434
434
|
this.connectedForm &&= (this.connectedForm.removeEventListener("submit", this.onHostFormSubmit), null);
|
|
435
435
|
}
|
|
436
436
|
};
|
|
437
|
-
|
|
437
|
+
t([n({ type: String })], A.prototype, "id", void 0), t([n({ type: String })], A.prototype, "name", void 0), t([n({ type: String })], A.prototype, "label", void 0), t([n({ type: String })], A.prototype, "helptext", void 0), t([n({
|
|
438
438
|
type: Boolean,
|
|
439
439
|
reflect: !0
|
|
440
|
-
})], A.prototype, "required", void 0),
|
|
440
|
+
})], A.prototype, "required", void 0), t([n({
|
|
441
441
|
type: Boolean,
|
|
442
442
|
reflect: !0
|
|
443
|
-
})], A.prototype, "multiple", void 0),
|
|
443
|
+
})], A.prototype, "multiple", void 0), t([n({
|
|
444
444
|
type: Boolean,
|
|
445
445
|
reflect: !0
|
|
446
|
-
})], A.prototype, "disabled", void 0),
|
|
446
|
+
})], A.prototype, "disabled", void 0), t([n({
|
|
447
447
|
type: Boolean,
|
|
448
448
|
reflect: !0,
|
|
449
449
|
attribute: "fullwidth"
|
|
450
|
-
})], A.prototype, "fullwidth", void 0),
|
|
450
|
+
})], A.prototype, "fullwidth", void 0), t([n({
|
|
451
451
|
type: String,
|
|
452
452
|
reflect: !0,
|
|
453
453
|
attribute: "upload-strategy"
|
|
454
|
-
})], A.prototype, "uploadStrategy", void 0),
|
|
454
|
+
})], A.prototype, "uploadStrategy", void 0), t([n({
|
|
455
455
|
type: String,
|
|
456
456
|
reflect: !0,
|
|
457
457
|
attribute: "item-renderer"
|
|
458
|
-
})], A.prototype, "itemRenderer", void 0),
|
|
458
|
+
})], A.prototype, "itemRenderer", void 0), t([n({ type: String })], A.prototype, "accept", void 0), t([n({
|
|
459
459
|
converter: c.csvToArray,
|
|
460
460
|
attribute: "allowed-formats"
|
|
461
|
-
})], A.prototype, "allowedFormats", void 0),
|
|
461
|
+
})], A.prototype, "allowedFormats", void 0), t([n({
|
|
462
462
|
type: String,
|
|
463
463
|
attribute: "format-error-message"
|
|
464
|
-
})], A.prototype, "formatErrorMessage", void 0),
|
|
464
|
+
})], A.prototype, "formatErrorMessage", void 0), t([n({ attribute: "max-file-size" })], A.prototype, "maxFileSize", void 0), t([n({
|
|
465
465
|
type: String,
|
|
466
466
|
attribute: "size-error-message"
|
|
467
|
-
})], A.prototype, "sizeErrorMessage", void 0),
|
|
467
|
+
})], A.prototype, "sizeErrorMessage", void 0), t([n({ attribute: !1 })], A.prototype, "onFileValidation", void 0), t([n({ attribute: !1 })], A.prototype, "transfers", void 0), t([n({
|
|
468
468
|
type: Boolean,
|
|
469
469
|
attribute: "add-comments-enabled"
|
|
470
|
-
})], A.prototype, "addCommentsEnabled", void 0),
|
|
470
|
+
})], A.prototype, "addCommentsEnabled", void 0), t([n({
|
|
471
471
|
type: Boolean,
|
|
472
472
|
attribute: "rename-files-enabled"
|
|
473
|
-
})], A.prototype, "renameFilesEnabled", void 0),
|
|
473
|
+
})], A.prototype, "renameFilesEnabled", void 0), t([n({ attribute: !1 })], A.prototype, "extraOperations", void 0), t([n({
|
|
474
474
|
type: Boolean,
|
|
475
475
|
reflect: !0,
|
|
476
476
|
attribute: "enable-image-preview"
|
|
477
|
-
})], A.prototype, "enableImagePreview", void 0),
|
|
477
|
+
})], A.prototype, "enableImagePreview", void 0), t([n({
|
|
478
478
|
type: Boolean,
|
|
479
479
|
attribute: "has-error"
|
|
480
|
-
})], A.prototype, "hasError", void 0),
|
|
480
|
+
})], A.prototype, "hasError", void 0), t([n({
|
|
481
481
|
type: String,
|
|
482
482
|
attribute: "error-message"
|
|
483
|
-
})], A.prototype, "errorMessage", void 0),
|
|
483
|
+
})], A.prototype, "errorMessage", void 0), t([n({
|
|
484
484
|
type: Boolean,
|
|
485
485
|
attribute: "optional-tag"
|
|
486
|
-
})], A.prototype, "optionalTag", void 0),
|
|
486
|
+
})], A.prototype, "optionalTag", void 0), t([n({
|
|
487
487
|
type: Boolean,
|
|
488
488
|
attribute: "required-tag"
|
|
489
|
-
})], A.prototype, "requiredTag", void 0),
|
|
489
|
+
})], A.prototype, "requiredTag", void 0), t([n({
|
|
490
490
|
type: Number,
|
|
491
491
|
attribute: "truncate-tail"
|
|
492
|
-
})], A.prototype, "truncateTail", void 0),
|
|
492
|
+
})], A.prototype, "truncateTail", void 0), t([n({ attribute: !1 })], A.prototype, "value", void 0), t([n({ attribute: !1 })], A.prototype, "defaultValue", void 0), t([e()], A.prototype, "files", void 0), t([e()], A.prototype, "isDragActive", void 0), t([e()], A.prototype, "validationErrorMessage", void 0), t([e()], A.prototype, "addedAnnouncement", void 0), t([e()], A.prototype, "thumbnailUrls", void 0);
|
|
493
493
|
//#endregion
|
|
494
494
|
//#region src/components/fileupload/fileupload-operations.ts
|
|
495
495
|
var j = "comments", M = (e) => {
|
|
@@ -509,18 +509,18 @@ var j = "comments", M = (e) => {
|
|
|
509
509
|
title: "Rediger",
|
|
510
510
|
ariaLabel: "Rediger filnavn",
|
|
511
511
|
renderInlineUI: (e) => {
|
|
512
|
-
let
|
|
513
|
-
let t = document.getElementById(
|
|
512
|
+
let t = e.getAttribute("targetFilename") || e.file.attributes?.targetFilename || e.file.file?.name || "", n = `pkt-fileupload-rename-${e.file.fileId}`, i = () => {
|
|
513
|
+
let t = document.getElementById(n)?.value?.trim();
|
|
514
514
|
t && e.setAttribute("targetFilename", t), e.close();
|
|
515
515
|
};
|
|
516
|
-
return
|
|
517
|
-
<label for=${
|
|
516
|
+
return r`
|
|
517
|
+
<label for=${n} class="pkt-sr-only">Endre filnavn</label>
|
|
518
518
|
<input
|
|
519
|
-
id=${
|
|
519
|
+
id=${n}
|
|
520
520
|
type="text"
|
|
521
521
|
class="pkt-fileupload__queue-display__item__rename-input"
|
|
522
522
|
?disabled=${e.disabled}
|
|
523
|
-
.value=${
|
|
523
|
+
.value=${t}
|
|
524
524
|
@keydown=${(t) => N(t, i, e.close)}
|
|
525
525
|
/>
|
|
526
526
|
<button
|
|
@@ -542,11 +542,11 @@ var j = "comments", M = (e) => {
|
|
|
542
542
|
`;
|
|
543
543
|
},
|
|
544
544
|
renderHidden: (e) => {
|
|
545
|
-
let
|
|
546
|
-
return
|
|
545
|
+
let t = e.getAttribute("targetFilename") || e.file.attributes?.targetFilename || e.file.file?.name || "";
|
|
546
|
+
return r`<input
|
|
547
547
|
type="hidden"
|
|
548
548
|
name=${`${e.inputName}-targetFilename`}
|
|
549
|
-
value=${
|
|
549
|
+
value=${t}
|
|
550
550
|
/>`;
|
|
551
551
|
}
|
|
552
552
|
}), L = () => ({
|
|
@@ -554,22 +554,22 @@ var j = "comments", M = (e) => {
|
|
|
554
554
|
title: (e) => (e.attributes?.[j] ?? []).length > 0 ? "" : "Legg til kommentar",
|
|
555
555
|
ariaLabel: "Legg til kommentar",
|
|
556
556
|
renderExtendedUI: (e) => {
|
|
557
|
-
let
|
|
558
|
-
let t = document.getElementById(
|
|
557
|
+
let t = (e.getAttribute(j) ?? [])[0], n = `pkt-fileupload-comment-${e.file.fileId}`, i = () => {
|
|
558
|
+
let t = document.getElementById(n)?.value?.trim();
|
|
559
559
|
t && e.setAttribute(j, [{
|
|
560
560
|
text: t,
|
|
561
561
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
562
562
|
}]), e.close();
|
|
563
563
|
};
|
|
564
|
-
return
|
|
565
|
-
<label for=${
|
|
566
|
-
${
|
|
564
|
+
return r`
|
|
565
|
+
<label for=${n} class="pkt-fileupload__queue-display__item__comment-label">
|
|
566
|
+
${t ? "Rediger kommentar" : "Legg til kommentar"}
|
|
567
567
|
</label>
|
|
568
568
|
<textarea
|
|
569
|
-
id=${
|
|
569
|
+
id=${n}
|
|
570
570
|
class="pkt-fileupload__queue-display__item__comment-input"
|
|
571
571
|
?disabled=${e.disabled}
|
|
572
|
-
.value=${
|
|
572
|
+
.value=${t?.text ?? ""}
|
|
573
573
|
rows="2"
|
|
574
574
|
placeholder="Skriv inn kommentar"
|
|
575
575
|
@keydown=${(t) => P(t, i, e.close)}
|
|
@@ -580,7 +580,7 @@ var j = "comments", M = (e) => {
|
|
|
580
580
|
?disabled=${e.disabled}
|
|
581
581
|
@click=${i}
|
|
582
582
|
>
|
|
583
|
-
${
|
|
583
|
+
${t ? "Lagre kommentar" : "Legg til kommentar"}
|
|
584
584
|
</button>
|
|
585
585
|
<button
|
|
586
586
|
type="button"
|
|
@@ -594,18 +594,18 @@ var j = "comments", M = (e) => {
|
|
|
594
594
|
},
|
|
595
595
|
renderContent: (e) => {
|
|
596
596
|
if (e.isActive) return null;
|
|
597
|
-
let
|
|
598
|
-
if (
|
|
599
|
-
let
|
|
600
|
-
return
|
|
597
|
+
let t = e.getAttribute(j) ?? [];
|
|
598
|
+
if (t.length === 0) return null;
|
|
599
|
+
let n = t[0];
|
|
600
|
+
return r`
|
|
601
601
|
<div class="pkt-fileupload__queue-display__item__comments">
|
|
602
602
|
<div class="pkt-fileupload__queue-display__item__comment">
|
|
603
603
|
<div class="pkt-fileupload__queue-display__item__comment__content">
|
|
604
604
|
<span class="pkt-fileupload__queue-display__item__comment__text" aria-label="Kommentar tekst">
|
|
605
|
-
${
|
|
605
|
+
${n.text}
|
|
606
606
|
</span>
|
|
607
607
|
<time class="pkt-fileupload__queue-display__item__comment__time">
|
|
608
|
-
${M(
|
|
608
|
+
${M(n.timestamp)}
|
|
609
609
|
</time>
|
|
610
610
|
</div>
|
|
611
611
|
<div class="pkt-fileupload__queue-display__item__comment__actions">
|
|
@@ -633,29 +633,29 @@ var j = "comments", M = (e) => {
|
|
|
633
633
|
`;
|
|
634
634
|
},
|
|
635
635
|
renderHidden: (e) => {
|
|
636
|
-
let
|
|
637
|
-
return
|
|
636
|
+
let t = e.getAttribute(j);
|
|
637
|
+
return r`<input
|
|
638
638
|
type="hidden"
|
|
639
639
|
name=${`${e.inputName}-comments`}
|
|
640
|
-
value=${
|
|
640
|
+
value=${t ? JSON.stringify(t) : ""}
|
|
641
641
|
/>`;
|
|
642
642
|
}
|
|
643
|
-
}), R = (e,
|
|
644
|
-
let
|
|
645
|
-
return
|
|
643
|
+
}), R = (e, t) => {
|
|
644
|
+
let n = D(e, t);
|
|
645
|
+
return n ? r`<span
|
|
646
646
|
class="pkt-fileupload__queue-display__item__title__head"
|
|
647
647
|
data-pkt-truncate-part="first"
|
|
648
|
-
>${
|
|
648
|
+
>${n.head}</span
|
|
649
649
|
><span
|
|
650
650
|
class="pkt-fileupload__queue-display__item__title__tail"
|
|
651
651
|
data-pkt-truncate-part="tail"
|
|
652
|
-
>${
|
|
653
|
-
>` :
|
|
654
|
-
}, z = (e,
|
|
652
|
+
>${n.tail}</span
|
|
653
|
+
>` : r`<span data-pkt-truncate-part="first">${e}</span>`;
|
|
654
|
+
}, z = (e, t, n) => r`
|
|
655
655
|
<p class="pkt-fileupload__queue-display__item__title">
|
|
656
|
-
${R(e,
|
|
656
|
+
${R(e, n)}${t ? r`<span class="pkt-fileupload__queue-display__item__filesize"> (${t})</span>` : null}
|
|
657
657
|
</p>
|
|
658
|
-
`, B = (e) => typeof e == "number" ? "in-progress" : e === "error" ? "error" : "idle", V = (e) =>
|
|
658
|
+
`, B = (e) => typeof e == "number" ? "in-progress" : e === "error" ? "error" : "idle", V = (e) => r`<span class="pkt-fileupload__queue-display__item__loading-text" aria-label="Laster opp fil"
|
|
659
659
|
>${e ?? "Laster opp..."}</span
|
|
660
660
|
>`, H = ({ operationId: e, file: t, inputName: n, disabled: r, isActive: i, onActivateOperation: a, onCloseOperation: o, getFileAttribute: s, setFileAttribute: c }) => ({
|
|
661
661
|
file: t,
|
|
@@ -666,25 +666,25 @@ var j = "comments", M = (e) => {
|
|
|
666
666
|
close: () => o(t.fileId),
|
|
667
667
|
getAttribute: (e) => s(t.fileId, e),
|
|
668
668
|
setAttribute: (e, n) => c(t.fileId, e, n)
|
|
669
|
-
}), U = ({ file: e, fileSize:
|
|
669
|
+
}), U = ({ file: e, fileSize: t, disabled: n, transferProgress: i, transferShowProgress: a, loadingText: o, truncateTail: s, onCancel: c, iconName: l = "document-text" }) => {
|
|
670
670
|
let u = k(e), d = a ?? i !== 0;
|
|
671
|
-
return
|
|
671
|
+
return r`
|
|
672
672
|
<pkt-icon
|
|
673
673
|
name=${l}
|
|
674
674
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
675
675
|
aria-hidden="true"
|
|
676
676
|
></pkt-icon>
|
|
677
|
-
${z(u,
|
|
677
|
+
${z(u, t, s)}
|
|
678
678
|
<button
|
|
679
679
|
type="button"
|
|
680
680
|
class="pkt-fileupload__queue-display__item__cancel-button"
|
|
681
681
|
aria-label="Avbryt opplasting"
|
|
682
|
-
?disabled=${
|
|
682
|
+
?disabled=${n}
|
|
683
683
|
@click=${() => c(e.fileId)}
|
|
684
684
|
>
|
|
685
685
|
Avbryt
|
|
686
686
|
</button>
|
|
687
|
-
${d ?
|
|
687
|
+
${d ? r`
|
|
688
688
|
<pkt-progressbar
|
|
689
689
|
class="pkt-fileupload__queue-display__item__progress"
|
|
690
690
|
valueCurrent=${Math.round(i * 100)}
|
|
@@ -697,25 +697,25 @@ var j = "comments", M = (e) => {
|
|
|
697
697
|
>
|
|
698
698
|
` : V(o)}
|
|
699
699
|
`;
|
|
700
|
-
}, W = ({ file: e, fileSize:
|
|
700
|
+
}, W = ({ file: e, fileSize: t, disabled: n, transferShowProgress: i, transferLastProgress: a, transferErrorMessage: o, truncateTail: s, onCancel: c }) => {
|
|
701
701
|
let l = k(e), u = !!i, d = Math.round((a ?? 1) * 100);
|
|
702
|
-
return
|
|
702
|
+
return r`
|
|
703
703
|
<pkt-icon
|
|
704
704
|
name="alert-error"
|
|
705
705
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
706
706
|
aria-hidden="true"
|
|
707
707
|
></pkt-icon>
|
|
708
|
-
${z(l,
|
|
708
|
+
${z(l, t, s)}
|
|
709
709
|
<button
|
|
710
710
|
type="button"
|
|
711
711
|
class="pkt-fileupload__queue-display__item__cancel-button"
|
|
712
712
|
aria-label="Fjern fil som feilet under opplasting"
|
|
713
|
-
?disabled=${
|
|
713
|
+
?disabled=${n}
|
|
714
714
|
@click=${() => c(e.fileId)}
|
|
715
715
|
>
|
|
716
716
|
Fjern
|
|
717
717
|
</button>
|
|
718
|
-
${u ?
|
|
718
|
+
${u ? r`
|
|
719
719
|
<pkt-progressbar
|
|
720
720
|
class="pkt-fileupload__queue-display__item__progress pkt-fileupload__queue-display__item__progress--error"
|
|
721
721
|
valueCurrent=${d}
|
|
@@ -724,30 +724,30 @@ var j = "comments", M = (e) => {
|
|
|
724
724
|
statusPlacement="following"
|
|
725
725
|
></pkt-progressbar>
|
|
726
726
|
` : null}
|
|
727
|
-
${o ?
|
|
727
|
+
${o ? r`<span class="pkt-fileupload__queue-display__item__error-message"
|
|
728
728
|
>${o}</span
|
|
729
729
|
>` : null}
|
|
730
730
|
`;
|
|
731
|
-
}, G = ({ file: e, disabled:
|
|
731
|
+
}, G = ({ file: e, disabled: t, inputName: n, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: c, getFileAttribute: l, setFileAttribute: u }) => {
|
|
732
732
|
let d = i.find((e) => e.id === a);
|
|
733
733
|
if (d?.renderInlineUI || d?.renderExtendedUI) return null;
|
|
734
734
|
let f = i.map((i) => {
|
|
735
735
|
let d = H({
|
|
736
736
|
operationId: i.id,
|
|
737
737
|
file: e,
|
|
738
|
-
inputName:
|
|
739
|
-
disabled:
|
|
738
|
+
inputName: n,
|
|
739
|
+
disabled: t,
|
|
740
740
|
isActive: i.id === a,
|
|
741
741
|
onActivateOperation: o,
|
|
742
742
|
onCloseOperation: c,
|
|
743
743
|
getFileAttribute: l,
|
|
744
744
|
setFileAttribute: u
|
|
745
745
|
}), f = typeof i.title == "function" ? i.title(e) : i.title;
|
|
746
|
-
return f ?
|
|
746
|
+
return f ? r`<button
|
|
747
747
|
type="button"
|
|
748
748
|
class="pkt-fileupload__queue-display__item__operation"
|
|
749
749
|
aria-label=${s(typeof i.ariaLabel == "function" ? i.ariaLabel(e) : i.ariaLabel)}
|
|
750
|
-
?disabled=${
|
|
750
|
+
?disabled=${t}
|
|
751
751
|
@click=${() => {
|
|
752
752
|
(i.renderInlineUI || i.renderExtendedUI) && d.activate(), i.onClick?.(d);
|
|
753
753
|
}}
|
|
@@ -755,39 +755,39 @@ var j = "comments", M = (e) => {
|
|
|
755
755
|
${f}
|
|
756
756
|
</button>` : null;
|
|
757
757
|
}).filter(Boolean);
|
|
758
|
-
return f.length === 0 ? null :
|
|
759
|
-
}, K = ({ file: e, disabled:
|
|
758
|
+
return f.length === 0 ? null : r`<div class="pkt-fileupload__queue-display__item__actions">${f}</div>`;
|
|
759
|
+
}, K = ({ file: e, disabled: t, inputName: n, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => i.map((i) => {
|
|
760
760
|
if (!i.renderContent) return null;
|
|
761
761
|
let u = H({
|
|
762
762
|
operationId: i.id,
|
|
763
763
|
file: e,
|
|
764
|
-
inputName:
|
|
765
|
-
disabled:
|
|
764
|
+
inputName: n,
|
|
765
|
+
disabled: t,
|
|
766
766
|
isActive: i.id === a,
|
|
767
767
|
onActivateOperation: o,
|
|
768
768
|
onCloseOperation: s,
|
|
769
769
|
getFileAttribute: c,
|
|
770
770
|
setFileAttribute: l
|
|
771
771
|
}), d = i.renderContent(u);
|
|
772
|
-
return d == null ? null :
|
|
772
|
+
return d == null ? null : r`<div class="pkt-fileupload__queue-display__item__operation-content">
|
|
773
773
|
${d}
|
|
774
774
|
</div>`;
|
|
775
|
-
}), q = ({ file: e, disabled:
|
|
775
|
+
}), q = ({ file: e, disabled: t, inputName: n, operations: i, activeOperationId: a, onActivateOperation: o, onCloseOperation: s, getFileAttribute: c, setFileAttribute: l }) => {
|
|
776
776
|
if (!a) return null;
|
|
777
777
|
let u = i.find((e) => e.id === a);
|
|
778
778
|
if (!u?.renderExtendedUI) return null;
|
|
779
779
|
let d = H({
|
|
780
780
|
operationId: u.id,
|
|
781
781
|
file: e,
|
|
782
|
-
inputName:
|
|
783
|
-
disabled:
|
|
782
|
+
inputName: n,
|
|
783
|
+
disabled: t,
|
|
784
784
|
isActive: !0,
|
|
785
785
|
onActivateOperation: o,
|
|
786
786
|
onCloseOperation: s,
|
|
787
787
|
getFileAttribute: c,
|
|
788
788
|
setFileAttribute: l
|
|
789
789
|
});
|
|
790
|
-
return
|
|
790
|
+
return r`<div class="pkt-fileupload__queue-display__item__expanded-operation-ui">
|
|
791
791
|
${u.renderExtendedUI(d)}
|
|
792
792
|
</div>`;
|
|
793
793
|
}, J = ({ file: e, disabled: t, inputName: n, operations: r, activeOperationId: i, onActivateOperation: a, onCloseOperation: o, getFileAttribute: s, setFileAttribute: c }) => r.map((r) => {
|
|
@@ -804,16 +804,16 @@ var j = "comments", M = (e) => {
|
|
|
804
804
|
setFileAttribute: c
|
|
805
805
|
});
|
|
806
806
|
return r.renderHidden(l);
|
|
807
|
-
}), Y = (e,
|
|
807
|
+
}), Y = (e, t, n) => r`
|
|
808
808
|
<pkt-icon
|
|
809
809
|
name="document-text"
|
|
810
810
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
811
811
|
aria-hidden="true"
|
|
812
812
|
></pkt-icon>
|
|
813
|
-
${z(k(e),
|
|
814
|
-
`, X = ({ file: e, thumbnailUrl:
|
|
815
|
-
let u = k(e), d = !!
|
|
816
|
-
return
|
|
813
|
+
${z(k(e), t, n)}
|
|
814
|
+
`, X = ({ file: e, thumbnailUrl: t, previewEnabled: n, canOpenPreview: i, truncateTail: a, onOpenPreview: c, onThumbnailImageError: l }) => {
|
|
815
|
+
let u = k(e), d = !!t, f = !!n && !!i, p = f && !!c;
|
|
816
|
+
return r`
|
|
817
817
|
<div
|
|
818
818
|
class=${o({
|
|
819
819
|
"pkt-fileupload__queue-display__item__thumbnail": !0,
|
|
@@ -830,16 +830,16 @@ var j = "comments", M = (e) => {
|
|
|
830
830
|
}}
|
|
831
831
|
>
|
|
832
832
|
<span class="pkt-btn__text">
|
|
833
|
-
${f ?
|
|
833
|
+
${f ? r`<pkt-icon
|
|
834
834
|
name="expand"
|
|
835
835
|
class="pkt-fileupload__queue-display__item__thumbnail__expand-icon"
|
|
836
836
|
aria-hidden="true"
|
|
837
837
|
></pkt-icon>` : null}
|
|
838
|
-
${d ?
|
|
839
|
-
src=${s(
|
|
838
|
+
${d ? r`<img
|
|
839
|
+
src=${s(t)}
|
|
840
840
|
alt=${u}
|
|
841
841
|
@error=${() => l?.(e.fileId)}
|
|
842
|
-
/>` :
|
|
842
|
+
/>` : r`<pkt-icon
|
|
843
843
|
name="document-text"
|
|
844
844
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
845
845
|
aria-hidden="true"
|
|
@@ -851,19 +851,19 @@ var j = "comments", M = (e) => {
|
|
|
851
851
|
>
|
|
852
852
|
</div>
|
|
853
853
|
`;
|
|
854
|
-
}, Z = ({ file: e, inputName:
|
|
854
|
+
}, Z = ({ file: e, inputName: t, disabled: n, fileSize: i, operations: a, activeOperationId: s, onActivateOperation: c, onCloseOperation: l, getFileAttribute: u, setFileAttribute: d, transferProgress: f, transferErrorMessage: p, transferShowProgress: m, transferLastProgress: h, loadingText: g, truncateTail: _, onCancel: v }) => {
|
|
855
855
|
let y = B(f), b = a.find((e) => e.id === s), x = b?.renderInlineUI ? b.renderInlineUI(H({
|
|
856
856
|
operationId: b.id,
|
|
857
857
|
file: e,
|
|
858
|
-
inputName:
|
|
859
|
-
disabled:
|
|
858
|
+
inputName: t,
|
|
859
|
+
disabled: n,
|
|
860
860
|
isActive: !0,
|
|
861
861
|
onActivateOperation: c,
|
|
862
862
|
onCloseOperation: l,
|
|
863
863
|
getFileAttribute: u,
|
|
864
864
|
setFileAttribute: d
|
|
865
865
|
})) : null;
|
|
866
|
-
return
|
|
866
|
+
return r`
|
|
867
867
|
<li
|
|
868
868
|
class=${o({
|
|
869
869
|
"pkt-fileupload__queue-display__item": !0,
|
|
@@ -874,8 +874,8 @@ var j = "comments", M = (e) => {
|
|
|
874
874
|
>
|
|
875
875
|
${J({
|
|
876
876
|
file: e,
|
|
877
|
-
disabled:
|
|
878
|
-
inputName:
|
|
877
|
+
disabled: n,
|
|
878
|
+
inputName: t,
|
|
879
879
|
operations: a,
|
|
880
880
|
activeOperationId: s,
|
|
881
881
|
onActivateOperation: c,
|
|
@@ -886,7 +886,7 @@ var j = "comments", M = (e) => {
|
|
|
886
886
|
${y === "in-progress" ? U({
|
|
887
887
|
file: e,
|
|
888
888
|
fileSize: i,
|
|
889
|
-
disabled:
|
|
889
|
+
disabled: n,
|
|
890
890
|
transferProgress: f,
|
|
891
891
|
transferShowProgress: m,
|
|
892
892
|
loadingText: g,
|
|
@@ -895,13 +895,13 @@ var j = "comments", M = (e) => {
|
|
|
895
895
|
}) : y === "error" ? W({
|
|
896
896
|
file: e,
|
|
897
897
|
fileSize: i,
|
|
898
|
-
disabled:
|
|
898
|
+
disabled: n,
|
|
899
899
|
transferShowProgress: m,
|
|
900
900
|
transferLastProgress: h,
|
|
901
901
|
transferErrorMessage: p,
|
|
902
902
|
truncateTail: _,
|
|
903
903
|
onCancel: v
|
|
904
|
-
}) : x ?
|
|
904
|
+
}) : x ? r`
|
|
905
905
|
<pkt-icon
|
|
906
906
|
name="document-text"
|
|
907
907
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
@@ -913,8 +913,8 @@ var j = "comments", M = (e) => {
|
|
|
913
913
|
` : Y(e, i, _)}
|
|
914
914
|
${y === "idle" ? G({
|
|
915
915
|
file: e,
|
|
916
|
-
disabled:
|
|
917
|
-
inputName:
|
|
916
|
+
disabled: n,
|
|
917
|
+
inputName: t,
|
|
918
918
|
operations: a,
|
|
919
919
|
activeOperationId: s,
|
|
920
920
|
onActivateOperation: c,
|
|
@@ -924,8 +924,8 @@ var j = "comments", M = (e) => {
|
|
|
924
924
|
}) : null}
|
|
925
925
|
${y === "idle" ? K({
|
|
926
926
|
file: e,
|
|
927
|
-
disabled:
|
|
928
|
-
inputName:
|
|
927
|
+
disabled: n,
|
|
928
|
+
inputName: t,
|
|
929
929
|
operations: a,
|
|
930
930
|
activeOperationId: s,
|
|
931
931
|
onActivateOperation: c,
|
|
@@ -935,8 +935,8 @@ var j = "comments", M = (e) => {
|
|
|
935
935
|
}) : null}
|
|
936
936
|
${y === "idle" ? q({
|
|
937
937
|
file: e,
|
|
938
|
-
disabled:
|
|
939
|
-
inputName:
|
|
938
|
+
disabled: n,
|
|
939
|
+
inputName: t,
|
|
940
940
|
operations: a,
|
|
941
941
|
activeOperationId: s,
|
|
942
942
|
onActivateOperation: c,
|
|
@@ -946,19 +946,19 @@ var j = "comments", M = (e) => {
|
|
|
946
946
|
}) : null}
|
|
947
947
|
</li>
|
|
948
948
|
`;
|
|
949
|
-
}, Q = ({ file: e, inputName:
|
|
949
|
+
}, Q = ({ file: e, inputName: t, disabled: n, fileSize: i, thumbnailUrl: a, previewEnabled: s, 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 }) => {
|
|
950
950
|
let w = B(h), T = l.find((e) => e.id === u), E = T?.renderInlineUI ? T.renderInlineUI(H({
|
|
951
951
|
operationId: T.id,
|
|
952
952
|
file: e,
|
|
953
|
-
inputName:
|
|
954
|
-
disabled:
|
|
953
|
+
inputName: t,
|
|
954
|
+
disabled: n,
|
|
955
955
|
isActive: !0,
|
|
956
956
|
onActivateOperation: d,
|
|
957
957
|
onCloseOperation: f,
|
|
958
958
|
getFileAttribute: p,
|
|
959
959
|
setFileAttribute: m
|
|
960
960
|
})) : null;
|
|
961
|
-
return
|
|
961
|
+
return r`
|
|
962
962
|
<li
|
|
963
963
|
class=${o({
|
|
964
964
|
"pkt-fileupload__queue-display__item": !0,
|
|
@@ -969,8 +969,8 @@ var j = "comments", M = (e) => {
|
|
|
969
969
|
>
|
|
970
970
|
${J({
|
|
971
971
|
file: e,
|
|
972
|
-
disabled:
|
|
973
|
-
inputName:
|
|
972
|
+
disabled: n,
|
|
973
|
+
inputName: t,
|
|
974
974
|
operations: l,
|
|
975
975
|
activeOperationId: u,
|
|
976
976
|
onActivateOperation: d,
|
|
@@ -981,7 +981,7 @@ var j = "comments", M = (e) => {
|
|
|
981
981
|
${w === "in-progress" ? U({
|
|
982
982
|
file: e,
|
|
983
983
|
fileSize: i,
|
|
984
|
-
disabled:
|
|
984
|
+
disabled: n,
|
|
985
985
|
transferProgress: h,
|
|
986
986
|
transferShowProgress: _,
|
|
987
987
|
loadingText: y,
|
|
@@ -991,13 +991,13 @@ var j = "comments", M = (e) => {
|
|
|
991
991
|
}) : w === "error" ? W({
|
|
992
992
|
file: e,
|
|
993
993
|
fileSize: i,
|
|
994
|
-
disabled:
|
|
994
|
+
disabled: n,
|
|
995
995
|
transferShowProgress: _,
|
|
996
996
|
transferLastProgress: v,
|
|
997
997
|
transferErrorMessage: g,
|
|
998
998
|
truncateTail: b,
|
|
999
999
|
onCancel: x
|
|
1000
|
-
}) : E ?
|
|
1000
|
+
}) : E ? r`
|
|
1001
1001
|
<pkt-icon
|
|
1002
1002
|
name="picture"
|
|
1003
1003
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
@@ -1017,8 +1017,8 @@ var j = "comments", M = (e) => {
|
|
|
1017
1017
|
})}
|
|
1018
1018
|
${w === "idle" ? G({
|
|
1019
1019
|
file: e,
|
|
1020
|
-
disabled:
|
|
1021
|
-
inputName:
|
|
1020
|
+
disabled: n,
|
|
1021
|
+
inputName: t,
|
|
1022
1022
|
operations: l,
|
|
1023
1023
|
activeOperationId: u,
|
|
1024
1024
|
onActivateOperation: d,
|
|
@@ -1028,8 +1028,8 @@ var j = "comments", M = (e) => {
|
|
|
1028
1028
|
}) : null}
|
|
1029
1029
|
${w === "idle" ? K({
|
|
1030
1030
|
file: e,
|
|
1031
|
-
disabled:
|
|
1032
|
-
inputName:
|
|
1031
|
+
disabled: n,
|
|
1032
|
+
inputName: t,
|
|
1033
1033
|
operations: l,
|
|
1034
1034
|
activeOperationId: u,
|
|
1035
1035
|
onActivateOperation: d,
|
|
@@ -1039,8 +1039,8 @@ var j = "comments", M = (e) => {
|
|
|
1039
1039
|
}) : null}
|
|
1040
1040
|
${w === "idle" ? q({
|
|
1041
1041
|
file: e,
|
|
1042
|
-
disabled:
|
|
1043
|
-
inputName:
|
|
1042
|
+
disabled: n,
|
|
1043
|
+
inputName: t,
|
|
1044
1044
|
operations: l,
|
|
1045
1045
|
activeOperationId: u,
|
|
1046
1046
|
onActivateOperation: d,
|
|
@@ -1077,7 +1077,7 @@ var j = "comments", M = (e) => {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
render() {
|
|
1079
1079
|
let e = this.renderContent();
|
|
1080
|
-
return this.label ?
|
|
1080
|
+
return this.label ? r`
|
|
1081
1081
|
<pkt-input-wrapper
|
|
1082
1082
|
.forId=${`${this.id}-input`}
|
|
1083
1083
|
.label=${this.label}
|
|
@@ -1096,7 +1096,7 @@ var j = "comments", M = (e) => {
|
|
|
1096
1096
|
` : e;
|
|
1097
1097
|
}
|
|
1098
1098
|
renderContent() {
|
|
1099
|
-
let e = this.getSortedFilesAndTransfers(),
|
|
1099
|
+
let e = this.getSortedFilesAndTransfers(), t = this.getPreviewableImages(e), n = this.getSupportedFormatsText(), i = [!this.label && this.helptext ? `${this.id}-helptext` : void 0, this.hasEffectiveError ? `${this.id}-error` : void 0].filter(Boolean).join(" ") || void 0, a = this.itemRenderer === "thumbnail" ? this.multiple ? {
|
|
1100
1100
|
dragInactive: u.dropZoneDragMultipleThumbnail,
|
|
1101
1101
|
dragActive: u.dropZoneDragActiveMultipleThumbnail,
|
|
1102
1102
|
openFileDialog: u.dropZoneOpenFileDialogMultipleThumbnail
|
|
@@ -1113,7 +1113,7 @@ var j = "comments", M = (e) => {
|
|
|
1113
1113
|
dragActive: u.dropZoneDragActiveSingle,
|
|
1114
1114
|
openFileDialog: u.dropZoneOpenFileDialogSingle
|
|
1115
1115
|
};
|
|
1116
|
-
return
|
|
1116
|
+
return r`
|
|
1117
1117
|
<div
|
|
1118
1118
|
class=${o({
|
|
1119
1119
|
"pkt-fileupload": !0,
|
|
@@ -1155,7 +1155,7 @@ var j = "comments", M = (e) => {
|
|
|
1155
1155
|
aria-describedby=${s(i)}
|
|
1156
1156
|
@change=${this.onNativeFileChange}
|
|
1157
1157
|
/>
|
|
1158
|
-
${this.uploadStrategy === "custom" ? e.map((e) =>
|
|
1158
|
+
${this.uploadStrategy === "custom" ? e.map((e) => r`<input type="hidden" name=${this.name} value=${e.fileId} />`) : null}
|
|
1159
1159
|
<div class="pkt-fileupload__drop-zone__placeholder">
|
|
1160
1160
|
<pkt-icon
|
|
1161
1161
|
name="attachment"
|
|
@@ -1163,7 +1163,7 @@ var j = "comments", M = (e) => {
|
|
|
1163
1163
|
aria-hidden="true"
|
|
1164
1164
|
></pkt-icon>
|
|
1165
1165
|
<p class="pkt-fileupload__drop-zone__placeholder__title">
|
|
1166
|
-
${this.isDragActive ? `${a.dragActive} ...` :
|
|
1166
|
+
${this.isDragActive ? `${a.dragActive} ...` : r`${a.dragInactive}
|
|
1167
1167
|
<button
|
|
1168
1168
|
type="button"
|
|
1169
1169
|
class="pkt-fileupload__drop-zone__placeholder__title__open-file-dialog"
|
|
@@ -1172,12 +1172,12 @@ var j = "comments", M = (e) => {
|
|
|
1172
1172
|
${a.openFileDialog}
|
|
1173
1173
|
</button>`}
|
|
1174
1174
|
</p>
|
|
1175
|
-
${
|
|
1176
|
-
${u.supportedFormatsPrefix} ${
|
|
1175
|
+
${n ? r`<p class="pkt-fileupload__drop-zone__placeholder__formats">
|
|
1176
|
+
${u.supportedFormatsPrefix} ${n}
|
|
1177
1177
|
</p>` : null}
|
|
1178
1178
|
</div>
|
|
1179
1179
|
</div>
|
|
1180
|
-
${this.hasEffectiveError ?
|
|
1180
|
+
${this.hasEffectiveError ? r`
|
|
1181
1181
|
<pkt-alert
|
|
1182
1182
|
skin="error"
|
|
1183
1183
|
role="alert"
|
|
@@ -1189,10 +1189,10 @@ var j = "comments", M = (e) => {
|
|
|
1189
1189
|
${this.effectiveErrorMessage}
|
|
1190
1190
|
</pkt-alert>
|
|
1191
1191
|
` : null}
|
|
1192
|
-
${e.length > 0 ?
|
|
1193
|
-
${e.map((e) => this.renderQueueItem(e,
|
|
1192
|
+
${e.length > 0 ? r`<ul class="pkt-fileupload__queue-display">
|
|
1193
|
+
${e.map((e) => this.renderQueueItem(e, t))}
|
|
1194
1194
|
</ul>` : null}
|
|
1195
|
-
${this.renderPreviewModal(
|
|
1195
|
+
${this.renderPreviewModal(t)}
|
|
1196
1196
|
</div>
|
|
1197
1197
|
`;
|
|
1198
1198
|
}
|
|
@@ -1275,10 +1275,10 @@ var j = "comments", M = (e) => {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
renderPreviewModal(e) {
|
|
1277
1277
|
if (!this.enableImagePreview || e.length === 0) return null;
|
|
1278
|
-
let
|
|
1279
|
-
if (!
|
|
1280
|
-
let
|
|
1281
|
-
return
|
|
1278
|
+
let t = e[this.previewCurrentIndex];
|
|
1279
|
+
if (!t) return null;
|
|
1280
|
+
let n = e.length > 1, i = this.getThumbnailUrl(t), a = !!i && !this.failedImageFileIds[t.fileId]?.preview, o = t.attributes?.targetFilename || t.file?.name || "Forhåndsvisning";
|
|
1281
|
+
return r`
|
|
1282
1282
|
<pkt-modal
|
|
1283
1283
|
.open=${this.isPreviewModalOpen}
|
|
1284
1284
|
.headingText=${o}
|
|
@@ -1288,7 +1288,7 @@ var j = "comments", M = (e) => {
|
|
|
1288
1288
|
@keydown=${(t) => this.onPreviewKeyDown(t, e)}
|
|
1289
1289
|
>
|
|
1290
1290
|
<div class="pkt-fileupload__image-preview">
|
|
1291
|
-
${
|
|
1291
|
+
${n ? r`<button
|
|
1292
1292
|
type="button"
|
|
1293
1293
|
class="pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--prev pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--icon-only"
|
|
1294
1294
|
aria-label=${`Forrige bilde ${this.previewCurrentIndex} / ${e.length}`}
|
|
@@ -1303,22 +1303,22 @@ var j = "comments", M = (e) => {
|
|
|
1303
1303
|
</button>` : null}
|
|
1304
1304
|
|
|
1305
1305
|
<div class="pkt-fileupload__image-preview__content">
|
|
1306
|
-
${a ?
|
|
1306
|
+
${a ? r`<img
|
|
1307
1307
|
src=${i}
|
|
1308
1308
|
alt=${`${o} - ${this.previewCurrentIndex + 1} av ${e.length}`}
|
|
1309
1309
|
class="pkt-fileupload__image-preview__image"
|
|
1310
|
-
@error=${() => this.markImageFailed(
|
|
1311
|
-
/>` :
|
|
1310
|
+
@error=${() => this.markImageFailed(t.fileId, "preview")}
|
|
1311
|
+
/>` : r`<pkt-icon
|
|
1312
1312
|
name="picture"
|
|
1313
1313
|
class="pkt-fileupload__queue-display__item__icon pkt-icon--medium"
|
|
1314
1314
|
aria-hidden="true"
|
|
1315
1315
|
></pkt-icon>`}
|
|
1316
1316
|
</div>
|
|
1317
1317
|
|
|
1318
|
-
${
|
|
1318
|
+
${n ? r`<span class="pkt-fileupload__image-preview__counter">
|
|
1319
1319
|
${this.previewCurrentIndex + 1} / ${e.length}
|
|
1320
1320
|
</span>` : null}
|
|
1321
|
-
${
|
|
1321
|
+
${n ? r`<button
|
|
1322
1322
|
type="button"
|
|
1323
1323
|
class="pkt-fileupload__image-preview__nav pkt-fileupload__image-preview__nav--next pkt-btn pkt-btn--medium pkt-btn--secondary pkt-btn--icon-only"
|
|
1324
1324
|
aria-label=${`Neste bilde ${this.previewCurrentIndex + 2} / ${e.length}`}
|
|
@@ -1365,7 +1365,7 @@ var j = "comments", M = (e) => {
|
|
|
1365
1365
|
n === void 0 && delete i[t], this.updateFileItem(e, { attributes: i });
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
|
-
|
|
1368
|
+
t([e()], $.prototype, "activeOperationByFileId", void 0), t([e()], $.prototype, "isPreviewModalOpen", void 0), t([e()], $.prototype, "previewCurrentIndex", void 0), t([e()], $.prototype, "failedImageFileIds", void 0), $ = t([i("pkt-fileupload")], $);
|
|
1369
1369
|
//#endregion
|
|
1370
1370
|
//#region src/components/fileupload/index.ts
|
|
1371
1371
|
var te = $;
|