oolib 2.65.0 → 2.66.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.
@@ -64,7 +64,7 @@ var getPositionStyles = function (position) {
64
64
  };
65
65
  var BulletIcon = function () { return (
66
66
  // line height of SANS_3 is 21px. Dot is 8px tall. so below css (21/2 - 8/2) makes the circle perfectly aligned with the first line
67
- react_1.default.createElement("div", { style: { fontSize: 0, marginTop: "6.5px" } },
67
+ react_1.default.createElement("div", { style: { fontSize: 0, marginTop: '6.5px', lineHeight: 0 } },
68
68
  react_1.default.createElement(DisplayIcon_1.DisplayIcon, { color: greyColor100, weight: "fill", icon: "Circle", size: 8 }))); };
69
69
  var Hints = function (_a) {
70
70
  var id = _a.id, hints = _a.hints, _b = _a.title, title = _b === void 0 ? "Hints" : _b, _c = _a.btnlabel, btnlabel = _c === void 0 ? "Hints" : _c, subtitle = _a.subtitle;
@@ -1,6 +1,7 @@
1
1
  export default ImageUploadShell;
2
- declare function ImageUploadShell({ style, children, disabled, enableFilesDrop, setDragOverActive }: {
2
+ declare function ImageUploadShell({ style, isLoading, children, disabled, enableFilesDrop, setDragOverActive }: {
3
3
  style: any;
4
+ isLoading: any;
4
5
  children: any;
5
6
  disabled: any;
6
7
  enableFilesDrop: any;
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
14
  if (k2 === undefined) k2 = k;
4
15
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -37,7 +48,7 @@ var ImageInputContext_1 = require("../../ImageInputContext");
37
48
  var bannerContext_1 = require("../../../Banners/bannerContext");
38
49
  var UIContent_1 = require("../../../../UIContent");
39
50
  var ImageUploadShell = function (_a) {
40
- var style = _a.style, children = _a.children, disabled = _a.disabled, enableFilesDrop = _a.enableFilesDrop, setDragOverActive = _a.setDragOverActive;
51
+ var style = _a.style, isLoading = _a.isLoading, children = _a.children, disabled = _a.disabled, enableFilesDrop = _a.enableFilesDrop, setDragOverActive = _a.setDragOverActive;
41
52
  var SET_ALERT_BANNER = (0, bannerContext_1.useBannerContext)().SET_ALERT_BANNER;
42
53
  var inputRef = (0, react_1.useRef)(null);
43
54
  var _b = (0, ImageInputContext_1.useImageInputContext)(), handleUpload = _b.handleUpload, onChange = _b.onChange, value = _b.value, id = _b.id, multiple = _b.multiple;
@@ -55,29 +66,36 @@ var ImageUploadShell = function (_a) {
55
66
  };
56
67
  return (react_1.default.createElement(react_1.default.Fragment, null,
57
68
  react_1.default.createElement("input", { type: "file", accept: "image/*", style: { display: 'none' }, ref: inputRef, onChange: function (e) { return fireHandleUpload(e.target.files); }, multiple: multiple }),
58
- react_1.default.createElement("div", { onDragEnter: function (e) {
59
- e.preventDefault();
60
- setDragOverActive(true);
61
- }, onDragLeave: function (e) {
62
- e.preventDefault();
63
- setDragOverActive(false);
64
- }, onDragOver: enableFilesDrop
65
- ? function (e) { return e.preventDefault(); }
66
- : function () { }, onDrop: enableFilesDrop
67
- ? function (e) {
68
- var _a, _b;
69
+ react_1.default.createElement("div", __assign({}, (isLoading
70
+ ? {}
71
+ : {
72
+ onDragEnter: function (e) {
73
+ e.preventDefault();
74
+ setDragOverActive(true);
75
+ },
76
+ onDragLeave: function (e) {
69
77
  e.preventDefault();
70
- e.stopPropagation();
71
- if ((_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) {
72
- if (!multiple && ((_b = e.dataTransfer) === null || _b === void 0 ? void 0 : _b.files.length) > 1) { //then set alert saying only first image will be attempted to upload
73
- SET_ALERT_BANNER(UIContent_1.UIContent.ImageInput.onlyFirstFileConsiderErrMsg, 'red', 3000);
78
+ setDragOverActive(false);
79
+ },
80
+ onDragOver: enableFilesDrop
81
+ ? function (e) { return e.preventDefault(); }
82
+ : function () { },
83
+ onDrop: enableFilesDrop
84
+ ? function (e) {
85
+ var _a, _b;
86
+ e.preventDefault();
87
+ e.stopPropagation();
88
+ if ((_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) {
89
+ if (!multiple && ((_b = e.dataTransfer) === null || _b === void 0 ? void 0 : _b.files.length) > 1) { //then set alert saying only first image will be attempted to upload
90
+ SET_ALERT_BANNER(UIContent_1.UIContent.ImageInput.onlyFirstFileConsiderErrMsg, 'red', 3000);
91
+ }
92
+ var filesToUpload = multiple
93
+ ? Array.from(e.dataTransfer.files)
94
+ : [Array.from(e.dataTransfer.files)[0]];
95
+ fireHandleUpload(filesToUpload);
74
96
  }
75
- var filesToUpload = multiple
76
- ? Array.from(e.dataTransfer.files)
77
- : [Array.from(e.dataTransfer.files)[0]];
78
- fireHandleUpload(filesToUpload);
79
97
  }
80
- }
81
- : function () { }, onClick: function () { return inputRef.current.click(); }, style: { height: '100%', width: '100%' } }, children)));
98
+ : function () { }
99
+ }), { onClick: function () { return inputRef.current.click(); }, style: { height: '100%', width: '100%' } }), children)));
82
100
  };
83
101
  exports.default = ImageUploadShell;
@@ -84,7 +84,7 @@ var Placeholder = function (_a) {
84
84
  }),
85
85
  react_1.default.createElement(styled_1.StyledPlaceholderWrapper, { smallPlaceholderUI: smallPlaceholderUI, ref: styledPlaceholderWrapperRef, dragOverActive: dragOverActive }, isLoading ? (react_1.default.createElement(ProgressBar_1.ProgressBar, { progress: uploadProgress, text: uploadProgress && uploadProgress !== 100
86
86
  ? uploadProgress + "%"
87
- : "Almost Done..." })) : (react_1.default.createElement(ImageUploadShell_1.default, { enableFilesDrop: true, multiple: multiple, setDragOverActive: setDragOverActive },
87
+ : "Almost Done..." })) : (react_1.default.createElement(ImageUploadShell_1.default, { isLoading: isLoading, enableFilesDrop: true, multiple: multiple, setDragOverActive: setDragOverActive },
88
88
  react_1.default.createElement(styled_1.StyledPlaceholder, __assign({}, { containerShape: containerShape }, { smallPlaceholderUI: smallPlaceholderUI }), smallPlaceholderUI ? (react_1.default.createElement(react_1.Fragment, null,
89
89
  react_1.default.createElement(ImageSquare, { size: 16, color: greyColor100 }),
90
90
  react_1.default.createElement(Typo_1.SANS_0, { semibold: true }, dropzoneLabel),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.65.0",
3
+ "version": "2.66.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",