@widergy/energy-ui 3.142.1 → 3.143.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
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [3.143.0](https://github.com/widergy/energy-ui/compare/v3.142.2...v3.143.0) (2026-04-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [BRILLA-339] persist file name and xls download ([#774](https://github.com/widergy/energy-ui/issues/774)) ([d2486f3](https://github.com/widergy/energy-ui/commit/d2486f3f475299954245b051defaa527c1c1e0c1))
|
|
7
|
+
|
|
8
|
+
## [3.142.2](https://github.com/widergy/energy-ui/compare/v3.142.1...v3.142.2) (2026-04-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* [OUG] token fixes ([#777](https://github.com/widergy/energy-ui/issues/777)) ([915430b](https://github.com/widergy/energy-ui/commit/915430bcc0f3841800c4e1d7ef52c0c4097415a2))
|
|
14
|
+
|
|
1
15
|
## [3.142.1](https://github.com/widergy/energy-ui/compare/v3.142.0...v3.142.1) (2026-04-14)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -76,7 +76,7 @@ const AttachmentListContainer = _ref => {
|
|
|
76
76
|
const loadPreview = file => new Promise((resolve, reject) => {
|
|
77
77
|
const reader = new FileReader();
|
|
78
78
|
reader.onload = e => {
|
|
79
|
-
if ((0, _utils.hasPreview)(file)) {
|
|
79
|
+
if ((0, _utils.hasPreview)(file) || (0, _utils.isDownloadable)(file)) {
|
|
80
80
|
resolve({
|
|
81
81
|
src: e.target.result,
|
|
82
82
|
file
|
|
@@ -190,7 +190,9 @@ const AttachmentListContainer = _ref => {
|
|
|
190
190
|
const imageUrl = Array.isArray(input.value) ? ((_input$value$index = input.value[index]) === null || _input$value$index === void 0 ? void 0 : _input$value$index.url) || ((_formattedImages$inde = formattedImages[index]) === null || _formattedImages$inde === void 0 ? void 0 : _formattedImages$inde.url) : input.value;
|
|
191
191
|
(0, _utils.getBlobFromUrl)(imageUrl, async response => {
|
|
192
192
|
if (response) {
|
|
193
|
-
|
|
193
|
+
var _input$value$index2, _formattedImages$inde2;
|
|
194
|
+
const itemName = Array.isArray(input.value) ? ((_input$value$index2 = input.value[index]) === null || _input$value$index2 === void 0 ? void 0 : _input$value$index2.name) || ((_formattedImages$inde2 = formattedImages[index]) === null || _formattedImages$inde2 === void 0 ? void 0 : _formattedImages$inde2.name) : null;
|
|
195
|
+
const newFile = new File([response], itemName || (0, _utils.getDefaultAttachment)(response.type.substring(response.type.indexOf('/') + 1), index + 1), {
|
|
194
196
|
type: response.type
|
|
195
197
|
});
|
|
196
198
|
loadDefaultValues(index + 1, [...accumulatedFiles, newFile]);
|
|
@@ -112,9 +112,9 @@ const AttachmentList = _ref => {
|
|
|
112
112
|
},
|
|
113
113
|
size: "small",
|
|
114
114
|
variant: "text"
|
|
115
|
-
}), (0, _utils.
|
|
115
|
+
}), (0, _utils.isDownloadable)(previewItem) && previewItem.src && /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
116
116
|
Icon: "IconDownload",
|
|
117
|
-
onClick: () => (0, _downloadjs.default)(previewItem.src, previewItem.name,
|
|
117
|
+
onClick: () => (0, _downloadjs.default)(previewItem.src, previewItem.name, previewItem.type),
|
|
118
118
|
size: "small",
|
|
119
119
|
variant: "text"
|
|
120
120
|
}), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.pdfAspectRatioValidation = exports.isVideo = exports.isValidFile = exports.isPDF = exports.isNewFile = exports.isImage = exports.isHTML = exports.isAudio = exports.hasPreview = exports.getSizeInMB = exports.getNotRepeatedFiles = exports.getDefaultAttachment = exports.getBlobFromUrl = exports.getAvailableFileTypesLabel = void 0;
|
|
6
|
+
exports.pdfAspectRatioValidation = exports.isXLSX = exports.isXLS = exports.isVideo = exports.isValidFile = exports.isPDF = exports.isNewFile = exports.isImage = exports.isHTML = exports.isDownloadable = exports.isCSV = exports.isAudio = exports.hasPreview = exports.getSizeInMB = exports.getNotRepeatedFiles = exports.getDefaultAttachment = exports.getBlobFromUrl = exports.getAvailableFileTypesLabel = void 0;
|
|
7
7
|
var _files = require("@widergy/web-utils/lib/constants/files");
|
|
8
8
|
var _constants = require("./constants");
|
|
9
9
|
if (window['pdfjs-dist/build/pdf']) window['pdfjs-dist/build/pdf'].GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(window['pdfjs-dist/build/pdf'].version, "/pdf.worker.js");
|
|
@@ -49,6 +49,14 @@ const isVideo = file => _files.inputFiles.video.validType.includes(file === null
|
|
|
49
49
|
exports.isVideo = isVideo;
|
|
50
50
|
const isHTML = file => _files.inputFiles.html.validType.includes(file === null || file === void 0 ? void 0 : file.type);
|
|
51
51
|
exports.isHTML = isHTML;
|
|
52
|
+
const isCSV = file => _files.inputFiles.csv.validType.includes(file === null || file === void 0 ? void 0 : file.type);
|
|
53
|
+
exports.isCSV = isCSV;
|
|
54
|
+
const isXLS = file => _files.inputFiles.xls.validType.includes(file === null || file === void 0 ? void 0 : file.type);
|
|
55
|
+
exports.isXLS = isXLS;
|
|
56
|
+
const isXLSX = file => _files.inputFiles.xlsx.validType.includes(file === null || file === void 0 ? void 0 : file.type);
|
|
57
|
+
exports.isXLSX = isXLSX;
|
|
58
|
+
const isDownloadable = file => isPDF(file) || isCSV(file) || isXLS(file) || isXLSX(file);
|
|
59
|
+
exports.isDownloadable = isDownloadable;
|
|
52
60
|
const hasPreview = file => isImage(file) || isAudio(file) || isVideo(file) || isPDF(file);
|
|
53
61
|
exports.hasPreview = hasPreview;
|
|
54
62
|
const isValidFile = file => hasPreview(file) || isPDF(file) || isHTML(file);
|
|
@@ -96,12 +96,13 @@ const baseTokens = exports.baseTokens = {
|
|
|
96
96
|
'gap-xl': 'spacing-7',
|
|
97
97
|
'gap-2xl': 'spacing-8',
|
|
98
98
|
'gap-3xl': 'spacing-9',
|
|
99
|
-
'font-heading-size-1': 'font-size-
|
|
100
|
-
'font-heading-size-2': 'font-size-
|
|
101
|
-
'font-heading-size-3': 'font-size-
|
|
99
|
+
'font-heading-size-1': 'font-size-700',
|
|
100
|
+
'font-heading-size-2': 'font-size-650',
|
|
101
|
+
'font-heading-size-3': 'font-size-600',
|
|
102
102
|
'font-heading-size-4': 'font-size-500',
|
|
103
103
|
'font-heading-size-5': 'font-size-400',
|
|
104
104
|
'font-heading-size-6': 'font-size-500',
|
|
105
|
+
'font-body-size-xs': 'font-size-100',
|
|
105
106
|
'font-body-size-sm': 'font-size-200',
|
|
106
107
|
'font-body-size-md': 'font-size-300',
|
|
107
108
|
'font-body-size-lg': 'font-size-400',
|