oolib 2.111.2 → 2.112.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.
|
@@ -81,7 +81,8 @@ function PDFInput(_a) {
|
|
|
81
81
|
},
|
|
82
82
|
handleUploadProgess: handleUploadProgess,
|
|
83
83
|
})) || (0, useFakeUploadImpression_1.useFakeUploadImpression)({ handleUploadProgess: handleUploadProgess, fileType: "pdf" }), upload = _c.mutate, isLoading = _c.isLoading;
|
|
84
|
-
var handleUpload = function (
|
|
84
|
+
var handleUpload = function (_a) {
|
|
85
|
+
var files = _a.files;
|
|
85
86
|
if (!files)
|
|
86
87
|
return;
|
|
87
88
|
if (!upload)
|
|
@@ -98,13 +99,13 @@ function PDFInput(_a) {
|
|
|
98
99
|
};
|
|
99
100
|
(0, react_1.useEffect)(function () {
|
|
100
101
|
if (files) {
|
|
101
|
-
handleUpload(files);
|
|
102
|
+
handleUpload({ files: files });
|
|
102
103
|
}
|
|
103
104
|
}, []);
|
|
104
105
|
return (react_1.default.createElement(react_3.Fragment, null,
|
|
105
106
|
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, getBlockLabelProps_1.getBlockLabelProps)(props), { invert: invert })),
|
|
106
107
|
(readOnly && value) ? (value === null || value === void 0 ? void 0 : value.map(function (d, i) { return (react_1.default.createElement(PDFEmbed_1.default, { key: i, filePath: d.publicUrl, fileName: d.originalFilename, fileID: d.generation })); }))
|
|
107
|
-
: !value || (value === null || value === void 0 ? void 0 : value.length) === 0 && !isLoading ? (react_1.default.createElement(FileUploadWrapper_1.FileUploadWrapper, { height: "18rem", isLoading: isLoading, mediaType: "pdf", handleUpload: handleUpload, uploadProgress: uploadProgress, enableClickUpload: false },
|
|
108
|
+
: !value || (value === null || value === void 0 ? void 0 : value.length) === 0 && !isLoading ? (react_1.default.createElement(FileUploadWrapper_1.FileUploadWrapper, { height: "18rem", isLoading: isLoading, mediaType: "pdf", handleUpload: handleUpload, onChange: parentOnChange, uploadProgress: uploadProgress, enableClickUpload: false },
|
|
108
109
|
react_1.default.createElement(Buttons_1.ButtonSecondary, { onClick: function () { return inputRef.current.click(); }, icon: "UploadSimple", value: "Upload Pdf", invert: invert }))) : (value === null || value === void 0 ? void 0 : value.map(function (d, i) { return (react_1.default.createElement("div", { style: { position: 'relative' }, key: i },
|
|
109
110
|
react_1.default.createElement(PDFEmbed_1.default, { filePath: d.publicUrl, fileName: d.originalFilename, fileID: d.generation }),
|
|
110
111
|
react_1.default.createElement(StyledActionsButtonWrapper, null,
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Wrapper650 = exports.Wrapper700 = exports.Wrapper820 = exports.Wrapper800 = exports.Wrapper900 = exports.Wrapper1000 = exports.Wrapper1120 = exports.Wrapper1500 = void 0;
|
|
17
|
+
exports.Wrapper650 = exports.Wrapper700 = exports.Wrapper820 = exports.Wrapper800 = exports.Wrapper900 = exports.Wrapper1000 = exports.Wrapper1120 = exports.Wrapper1500 = exports.WrapperCardGrid = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
19
|
var index_styled_1 = require("./index.styled");
|
|
20
20
|
var Wrapper = function (_a) {
|
|
@@ -22,6 +22,8 @@ var Wrapper = function (_a) {
|
|
|
22
22
|
align = align || (left ? 'left' : 'center');
|
|
23
23
|
return (react_1.default.createElement(index_styled_1.StyledWrapper, { maxWidth: maxWidth, align: align, className: className || "", style: style }, children));
|
|
24
24
|
};
|
|
25
|
+
var WrapperCardGrid_1 = require("./WrapperCardGrid");
|
|
26
|
+
Object.defineProperty(exports, "WrapperCardGrid", { enumerable: true, get: function () { return WrapperCardGrid_1.WrapperCardGrid; } });
|
|
25
27
|
var Wrapper1500 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 1500 })); };
|
|
26
28
|
exports.Wrapper1500 = Wrapper1500;
|
|
27
29
|
var Wrapper1120 = function (props) { return react_1.default.createElement(Wrapper, __assign({}, props, { maxWidth: 1120 })); };
|
|
@@ -6,8 +6,38 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ReactNode } from 'react';
|
|
8
8
|
import { ColorsType } from '../themes/colors';
|
|
9
|
+
/**
|
|
10
|
+
* Generates a function that localizes a value based on the current theme.
|
|
11
|
+
*
|
|
12
|
+
* @param {ReactNode} value - The value to be localized
|
|
13
|
+
* @return {ReactNode} The localized value
|
|
14
|
+
*/
|
|
9
15
|
export declare const useLocale: () => (value: ReactNode) => ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the primary color at 10% opacity from the provided colors object or falls back to a default primary color
|
|
18
|
+
*
|
|
19
|
+
* @param {ColorsType} colors - An optional ColorsType object to retrieve the primary color from
|
|
20
|
+
* @return {string} The primary color value at 10% opacity
|
|
21
|
+
*/
|
|
10
22
|
export declare const getPrimaryColor10: (colors?: ColorsType) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the primary color at 40% opacity from the provided colors object or falls back to a default primary color.
|
|
25
|
+
*
|
|
26
|
+
* @param {ColorsType} colors - An optional ColorsType object to retrieve the primary color from
|
|
27
|
+
* @return {string} The primary color at 40% opacity.
|
|
28
|
+
*/
|
|
11
29
|
export declare const getPrimaryColor40: (colors?: ColorsType) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Returns the primary color at 100% opacity from the provided colors object or falls back to a default primary color.
|
|
32
|
+
*
|
|
33
|
+
* @param {ColorsType} colors - Optional colors object containing primary color levels.
|
|
34
|
+
* @return {string} The primary color at 100 level.
|
|
35
|
+
*/
|
|
12
36
|
export declare const getPrimaryColor100: (colors?: ColorsType) => string;
|
|
37
|
+
/**
|
|
38
|
+
* Get the primary color text.
|
|
39
|
+
*
|
|
40
|
+
* @param {ColorsType} colors - Optional colors object
|
|
41
|
+
* @return {string} The primary color text
|
|
42
|
+
*/
|
|
13
43
|
export declare const getPrimaryColorText: (colors?: ColorsType) => string;
|
package/dist/utilsOolib/index.js
CHANGED
|
@@ -14,6 +14,12 @@ var react_1 = __importDefault(require("react"));
|
|
|
14
14
|
var styled_components_1 = require("styled-components");
|
|
15
15
|
var colors_1 = require("../themes/colors");
|
|
16
16
|
var primaryColor10 = colors_1.colors.primaryColor10, primaryColor40 = colors_1.colors.primaryColor40, primaryColor100 = colors_1.colors.primaryColor100, primaryColorText = colors_1.colors.primaryColorText;
|
|
17
|
+
/**
|
|
18
|
+
* Generates a function that localizes a value based on the current theme.
|
|
19
|
+
*
|
|
20
|
+
* @param {ReactNode} value - The value to be localized
|
|
21
|
+
* @return {ReactNode} The localized value
|
|
22
|
+
*/
|
|
17
23
|
var useLocale = function () {
|
|
18
24
|
var currentTheme = (0, styled_components_1.useTheme)();
|
|
19
25
|
;
|
|
@@ -32,18 +38,42 @@ var useLocale = function () {
|
|
|
32
38
|
return localize;
|
|
33
39
|
};
|
|
34
40
|
exports.useLocale = useLocale;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the primary color at 10% opacity from the provided colors object or falls back to a default primary color
|
|
43
|
+
*
|
|
44
|
+
* @param {ColorsType} colors - An optional ColorsType object to retrieve the primary color from
|
|
45
|
+
* @return {string} The primary color value at 10% opacity
|
|
46
|
+
*/
|
|
35
47
|
var getPrimaryColor10 = function (colors) {
|
|
36
48
|
return (colors === null || colors === void 0 ? void 0 : colors.primaryColor10) || primaryColor10;
|
|
37
49
|
};
|
|
38
50
|
exports.getPrimaryColor10 = getPrimaryColor10;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the primary color at 40% opacity from the provided colors object or falls back to a default primary color.
|
|
53
|
+
*
|
|
54
|
+
* @param {ColorsType} colors - An optional ColorsType object to retrieve the primary color from
|
|
55
|
+
* @return {string} The primary color at 40% opacity.
|
|
56
|
+
*/
|
|
39
57
|
var getPrimaryColor40 = function (colors) {
|
|
40
58
|
return (colors === null || colors === void 0 ? void 0 : colors.primaryColor40) || primaryColor40;
|
|
41
59
|
};
|
|
42
60
|
exports.getPrimaryColor40 = getPrimaryColor40;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the primary color at 100% opacity from the provided colors object or falls back to a default primary color.
|
|
63
|
+
*
|
|
64
|
+
* @param {ColorsType} colors - Optional colors object containing primary color levels.
|
|
65
|
+
* @return {string} The primary color at 100 level.
|
|
66
|
+
*/
|
|
43
67
|
var getPrimaryColor100 = function (colors) {
|
|
44
68
|
return (colors === null || colors === void 0 ? void 0 : colors.primaryColor100) || primaryColor100;
|
|
45
69
|
};
|
|
46
70
|
exports.getPrimaryColor100 = getPrimaryColor100;
|
|
71
|
+
/**
|
|
72
|
+
* Get the primary color text.
|
|
73
|
+
*
|
|
74
|
+
* @param {ColorsType} colors - Optional colors object
|
|
75
|
+
* @return {string} The primary color text
|
|
76
|
+
*/
|
|
47
77
|
var getPrimaryColorText = function (colors) {
|
|
48
78
|
return (colors === null || colors === void 0 ? void 0 : colors.primaryColorText) || primaryColorText;
|
|
49
79
|
};
|