@equinor/ioc-common-frontend 13.6.0 → 13.7.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/build/components/AttachmentUpload/AttachmentUpload.d.ts +1 -0
- package/build/components/AttachmentUpload/AttachmentUpload.d.ts.map +1 -1
- package/build/index.esm.js +40 -40
- package/build/index.esm.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ export type AttachmentUploadProps = {
|
|
|
4
4
|
uploadTitle?: string;
|
|
5
5
|
handleAttachmentsAdded: (AttachmentsUploaded: File[]) => void;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
acceptedFileTypes?: string;
|
|
7
8
|
};
|
|
8
9
|
export declare const AttachmentUpload: React.FC<AttachmentUploadProps>;
|
|
9
10
|
//# sourceMappingURL=AttachmentUpload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentUpload.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentUpload/AttachmentUpload.tsx"],"names":[],"mappings":";AAiBA,MAAM,MAAM,qBAAqB,GAAG;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,CAAC,mBAAmB,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AttachmentUpload.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentUpload/AttachmentUpload.tsx"],"names":[],"mappings":";AAiBA,MAAM,MAAM,qBAAqB,GAAG;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,CAAC,mBAAmB,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA2J5D,CAAC"}
|
package/build/index.esm.js
CHANGED
|
@@ -12246,54 +12246,54 @@ var jJ = H(ep)([".MuiTypography-root{display:flex;justify-content:flex-end;font-
|
|
|
12246
12246
|
}), YJ = H.div(["width:36px;height:36px;background:", ";border-radius:50%;margin-top:4px;margin-right:24px;"], V.white.transparent[84]), KJ = H.div(["display:flex;align-items:center;justify-content:center;"]), GJ = H.div(["display:flex;align-items:end;justify-content:flex-start;width:-webkit-fill-available;gap:28px;"]), ZJ = H.div(["z-index:999;margin-right:-45px;margin-top:18px;position:absolute;"]), XJ = function() {
|
|
12247
12247
|
return w("svg", { xmlns: "http://www.w3.org/2000/svg", width: "72", height: "43", viewBox: "0 0 75 45", fill: "none", children: w("path", { d: "M56.1287 8.4394L56.4424 8.05002L56.1287 8.4394ZM0.881211 4.86745C0.745249 5.1078 0.829873 5.41286 1.07022 5.54882L4.98698 7.76446C5.22733 7.90042 5.53239 7.81579 5.66836 7.57544C5.80432 7.33509 5.71969 7.03003 5.47934 6.89407L1.99778 4.92461L3.96723 1.44305C4.1032 1.2027 4.01857 0.89764 3.77822 0.761678C3.53787 0.625716 3.23281 0.71034 3.09684 0.950692L0.881211 4.86745ZM1.45006 5.59543C1.7708 5.50646 2.09287 5.41902 2.41619 5.33313L2.15944 4.36665C1.83262 4.45347 1.50703 4.54187 1.18275 4.63182L1.45006 5.59543ZM4.36152 4.83858C5.00938 4.68116 5.66147 4.52985 6.31713 4.38475L6.10105 3.40837C5.43877 3.55494 4.78 3.7078 4.1254 3.86686L4.36152 4.83858ZM8.28179 3.97062C8.9367 3.83937 9.59446 3.71428 10.2545 3.59543L10.0772 2.61126C9.41084 2.73127 8.74666 2.85758 8.0853 2.99011L8.28179 3.97062ZM12.2342 3.25866C12.8948 3.15284 13.5569 3.05326 14.2201 2.96003L14.0808 1.96977C13.4114 2.06389 12.7429 2.16441 12.076 2.27125L12.2342 3.25866ZM16.2113 2.69945C16.8764 2.61887 17.5419 2.54472 18.2071 2.47707L18.1059 1.4822C17.4343 1.5505 16.7625 1.62536 16.091 1.7067L16.2113 2.69945ZM20.2067 2.29328C20.8753 2.23838 21.543 2.19015 22.2092 2.14868L22.1471 1.15061C21.4743 1.1925 20.8 1.2412 20.1248 1.29664L20.2067 2.29328ZM24.214 2.04413C24.8851 2.01596 25.554 1.99481 26.22 1.98075L26.1989 0.980975C25.5259 0.995179 24.85 1.01655 24.172 1.04501L24.214 2.04413ZM28.2263 1.95997C28.8988 1.96033 29.5676 1.96815 30.2319 1.98352L30.255 0.983789C29.583 0.968238 28.9067 0.960329 28.2269 0.959968L28.2263 1.95997ZM32.2367 2.05359C32.9099 2.08522 33.5776 2.12493 34.2391 2.1728L34.3113 1.17541C33.6412 1.12692 32.9651 1.08671 32.2836 1.05469L32.2367 2.05359ZM36.2369 2.34423C36.9083 2.41112 37.5723 2.48687 38.2278 2.57156L38.3559 1.5798C37.6904 1.49383 37.0169 1.41698 36.336 1.34916L36.2369 2.34423ZM40.209 2.85914C40.8754 2.96688 41.5317 3.0845 42.1769 3.21209L42.3709 2.23109C41.7139 2.10115 41.0461 1.98149 40.3686 1.87196L40.209 2.85914ZM44.1266 3.63642C44.785 3.7934 45.4297 3.96168 46.0596 4.14135L46.3339 3.1797C45.6893 2.99584 45.0304 2.8239 44.3585 2.66369L44.1266 3.63642ZM47.9637 4.7349C48.6032 4.95227 49.2244 5.18273 49.8258 5.4264L50.2013 4.49957C49.5812 4.24835 48.9421 4.01127 48.2855 3.7881L47.9637 4.7349ZM51.6401 6.23112C52.2476 6.52595 52.8299 6.83637 53.3854 7.16249L53.8917 6.3001C53.312 5.95982 52.7064 5.63706 52.0767 5.33148L51.6401 6.23112ZM55.0362 8.23547C55.3042 8.4287 55.5639 8.62647 55.815 8.82878L56.4424 8.05002C56.1769 7.83618 55.903 7.62764 55.6211 7.42434L55.0362 8.23547ZM55.815 8.82878C56.0875 9.04823 56.3563 9.26875 56.6216 9.49032L57.2626 8.72283C56.9928 8.49744 56.7194 8.27316 56.4424 8.05002L55.815 8.82878ZM58.1925 10.852C58.714 11.3214 59.2203 11.7952 59.7117 12.2735L60.4092 11.5569C59.9083 11.0694 59.3925 10.5866 58.8615 10.1087L58.1925 10.852ZM61.1699 13.7517C61.6512 14.2602 62.1165 14.7735 62.5661 15.2915L63.3213 14.636C62.8622 14.107 62.3873 13.5831 61.8962 13.0643L61.1699 13.7517ZM63.891 16.8887C64.3244 17.4359 64.7411 17.9881 65.1416 18.5453L65.9536 17.9616C65.544 17.3917 65.1178 16.8271 64.6749 16.2678L63.891 16.8887ZM66.3118 20.2584C66.6902 20.842 67.0516 21.4309 67.3965 22.0249L68.2613 21.5229C67.9082 20.9146 67.5382 20.3118 67.151 19.7144L66.3118 20.2584ZM68.3929 23.8443C68.7108 24.461 69.0118 25.0831 69.2963 25.7104L70.207 25.2974C69.9157 24.6549 69.6074 24.0177 69.2817 23.3861L68.3929 23.8443ZM70.1046 27.6195C70.3584 28.2634 70.5957 28.9126 70.8167 29.5672L71.7642 29.2472C71.5378 28.5771 71.2949 27.9122 71.035 27.2528L70.1046 27.6195ZM71.4319 31.5479C71.6207 32.2123 71.7936 32.882 71.9511 33.5569L72.9249 33.3297C72.7639 32.6396 72.587 31.9545 72.3939 31.2746L71.4319 31.5479ZM72.3756 35.5882C72.5012 36.2664 72.6119 36.9496 72.7081 37.6379L73.6984 37.4995C73.6003 36.7969 73.4872 36.0991 73.3588 35.4061L72.3756 35.5882ZM72.9517 39.7016C73.0181 40.3875 73.0708 41.078 73.11 41.7733L74.1084 41.717C74.0685 41.0086 74.0148 40.3047 73.9471 39.6052L72.9517 39.7016ZM73.1872 43.8519C73.1935 44.1978 73.1966 44.5448 73.1966 44.8929H74.1966C74.1966 44.5388 74.1934 44.1857 74.187 43.8336L73.1872 43.8519Z", fill: "#73B1B5" }) });
|
|
12248
12248
|
}, ube = function(e) {
|
|
12249
|
-
var t = e.uploadButtonText, n = t === void 0 ? "Upload" : t, r = e.uploadTitle, o = r === void 0 ? "Add attachment" : r, i = e.handleAttachmentsAdded, a = e.disabled, l = At(null),
|
|
12249
|
+
var t = e.uploadButtonText, n = t === void 0 ? "Upload" : t, r = e.uploadTitle, o = r === void 0 ? "Add attachment" : r, i = e.handleAttachmentsAdded, a = e.disabled, l = e.acceptedFileTypes, u = At(null), c = we(Ee(!1), 2), d = c[0], p = c[1];
|
|
12250
12250
|
return w(yo, { onClickAway: function() {
|
|
12251
|
-
return
|
|
12252
|
-
}, disableReactTree: a, children: X(WJ, { children: [w(qJ, { htmlFor: "attachmentInput", children: o }), X(UJ, { "data-testid": "FileUploadContainer", onPaste: function(
|
|
12253
|
-
return function(
|
|
12254
|
-
var
|
|
12251
|
+
return p(!1);
|
|
12252
|
+
}, disableReactTree: a, children: X(WJ, { children: [w(qJ, { htmlFor: "attachmentInput", children: o }), X(UJ, { "data-testid": "FileUploadContainer", onPaste: function(f) {
|
|
12253
|
+
return function(h) {
|
|
12254
|
+
var m;
|
|
12255
12255
|
if (!a) {
|
|
12256
|
-
|
|
12257
|
-
var
|
|
12258
|
-
if (
|
|
12259
|
-
for (var
|
|
12260
|
-
if (
|
|
12261
|
-
var
|
|
12262
|
-
console.log(
|
|
12263
|
-
} else if (
|
|
12264
|
-
var
|
|
12265
|
-
|
|
12256
|
+
h.preventDefault();
|
|
12257
|
+
var g = (m = h.clipboardData) === null || m === void 0 ? void 0 : m.items, v = [];
|
|
12258
|
+
if (g !== void 0) {
|
|
12259
|
+
for (var b = 0; b < g.length; b++)
|
|
12260
|
+
if (g[b].type.indexOf("image") === 0) {
|
|
12261
|
+
var y = g[b].getAsFile();
|
|
12262
|
+
console.log(g[b]), y && v.push(y);
|
|
12263
|
+
} else if (g[b].type.indexOf("text/plain") === 0) {
|
|
12264
|
+
var C = h.clipboardData.getData("text/plain"), S = new Blob([C], { type: "text/plain" }), x = new File([S], "blob");
|
|
12265
|
+
x && v.push(x);
|
|
12266
12266
|
}
|
|
12267
12267
|
}
|
|
12268
|
-
|
|
12268
|
+
v.length > 0 && i(v);
|
|
12269
12269
|
}
|
|
12270
|
-
}(
|
|
12271
|
-
}, onDrop: function(
|
|
12272
|
-
return function(
|
|
12273
|
-
var
|
|
12270
|
+
}(f);
|
|
12271
|
+
}, onDrop: function(f) {
|
|
12272
|
+
return function(h) {
|
|
12273
|
+
var m, g, v;
|
|
12274
12274
|
if (!a) {
|
|
12275
|
-
|
|
12276
|
-
var
|
|
12277
|
-
(
|
|
12278
|
-
return
|
|
12279
|
-
}).reduce(function(
|
|
12280
|
-
var
|
|
12281
|
-
return
|
|
12282
|
-
}, []) : ((
|
|
12275
|
+
h.preventDefault();
|
|
12276
|
+
var b = [];
|
|
12277
|
+
(b = ((m = h.dataTransfer) === null || m === void 0 ? void 0 : m.items) !== void 0 ? Object.values(h.dataTransfer.items).filter(function(y) {
|
|
12278
|
+
return y && (y == null ? void 0 : y.kind) === "file";
|
|
12279
|
+
}).reduce(function(y, C) {
|
|
12280
|
+
var S = C.getAsFile();
|
|
12281
|
+
return S && y.push(S), y;
|
|
12282
|
+
}, []) : ((g = h.dataTransfer) === null || g === void 0 ? void 0 : g.files) !== void 0 ? Array.from((v = h.dataTransfer) === null || v === void 0 ? void 0 : v.files) : []).length > 0 && i(b);
|
|
12283
12283
|
}
|
|
12284
|
-
}(
|
|
12285
|
-
}, onDragOver: function(
|
|
12286
|
-
return function(
|
|
12287
|
-
return
|
|
12288
|
-
}(
|
|
12284
|
+
}(f);
|
|
12285
|
+
}, onDragOver: function(f) {
|
|
12286
|
+
return function(h) {
|
|
12287
|
+
return h.preventDefault();
|
|
12288
|
+
}(f);
|
|
12289
12289
|
}, onClick: function() {
|
|
12290
|
-
|
|
12291
|
-
}, $selected:
|
|
12292
|
-
var
|
|
12293
|
-
i(
|
|
12294
|
-
}, multiple: !0, accept: "image/*,application/pdf,.eml
|
|
12295
|
-
var
|
|
12296
|
-
|
|
12290
|
+
p(!d);
|
|
12291
|
+
}, $selected: d, tabIndex: 0, $disabled: a, children: [w(KJ, { id: "dot", children: w(YJ, {}) }), w(ZJ, { children: w(XJ, {}) }), w("input", { "data-testid": "inputField", type: "file", id: "attachmentInput", ref: u, onChange: function(f) {
|
|
12292
|
+
var h = f.target, m = Array.from(h.files);
|
|
12293
|
+
i(m);
|
|
12294
|
+
}, multiple: !0, accept: l ?? "image/*,application/pdf,.eml,.msg,text/plain,.xlsx", style: { display: "none" }, disabled: a }), X(GJ, { id: "action", children: [w(To, { style: { height: "36px", width: "110px" }, "data-testid": "UploadAttachButton", buttonstyle: "outlined", onClick: function() {
|
|
12295
|
+
var f = u == null ? void 0 : u.current;
|
|
12296
|
+
f == null || f.click();
|
|
12297
12297
|
}, disabled: a, children: n }), w($t, { htmlColor: V.mossGreen.tint[66], style: { width: "24px", height: "24px" }, children: w("path", { d: Lq }) })] })] })] }) });
|
|
12298
12298
|
}, JJ = H.div(["", " svg{fill:", ";}"], function(e) {
|
|
12299
12299
|
return e.$iconHeight && "height: ".concat(e.$iconHeight, ";");
|