@onehat/ui 0.3.324 → 0.3.326
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/package.json
CHANGED
|
@@ -44,6 +44,7 @@ export default function withFilters(WrappedComponent) {
|
|
|
44
44
|
showClearFiltersButton = true,
|
|
45
45
|
defaultFilters = [], // likely a list of field names, possibly could be of shape below
|
|
46
46
|
customFilters = [], // of shape: { title, type, field, value, getRepoFilters(value) }
|
|
47
|
+
clearExceptions = [], // list of fields that should not be cleared when clearFilters button is pressed
|
|
47
48
|
minFilters = 3,
|
|
48
49
|
maxFilters = 6,
|
|
49
50
|
onFilterChange,
|
|
@@ -214,7 +215,9 @@ export default function withFilters(WrappedComponent) {
|
|
|
214
215
|
// Clears values for all active filters
|
|
215
216
|
const newFilters = [];
|
|
216
217
|
_.each(filters, (filter) => {
|
|
217
|
-
filter.
|
|
218
|
+
if (!inArray(filter.field, clearExceptions)) {
|
|
219
|
+
filter.value = null;
|
|
220
|
+
}
|
|
218
221
|
newFilters.push(filter);
|
|
219
222
|
});
|
|
220
223
|
setFilters(newFilters, false);
|
|
@@ -6,7 +6,7 @@ const downloadWithFetch = (url, options = {}, win = null) => {
|
|
|
6
6
|
if (!win) {
|
|
7
7
|
const
|
|
8
8
|
winName = 'Download',
|
|
9
|
-
opts = '
|
|
9
|
+
opts = 'location=0,menubar=0,scrollbars=0';
|
|
10
10
|
win = window.open('', winName, opts);
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -25,11 +25,13 @@ import Xmark from '../../Components/Icons/Xmark.js'
|
|
|
25
25
|
import withAlert from '../../Components/Hoc/withAlert.js';
|
|
26
26
|
import withData from '../../Components/Hoc/withData.js';
|
|
27
27
|
import downloadInBackground from '../../Functions/downloadInBackground.js';
|
|
28
|
+
import downloadWithFetch from '../../Functions/downloadWithFetch.js';
|
|
28
29
|
import _ from 'lodash';
|
|
29
30
|
|
|
30
31
|
const
|
|
31
32
|
EXPANDED_MAX = 100,
|
|
32
|
-
COLLAPSED_MAX = 4
|
|
33
|
+
COLLAPSED_MAX = 4,
|
|
34
|
+
isPwa = !!window?.navigator?.standalone;
|
|
33
35
|
|
|
34
36
|
function FileCardCustom(props) {
|
|
35
37
|
const
|
|
@@ -187,6 +189,13 @@ function AttachmentsElement(props) {
|
|
|
187
189
|
doDelete(id);
|
|
188
190
|
}
|
|
189
191
|
},
|
|
192
|
+
onDownload = (id, url) => {
|
|
193
|
+
if (isPwa) {
|
|
194
|
+
downloadWithFetch(url);
|
|
195
|
+
} else {
|
|
196
|
+
downloadInBackground(url);
|
|
197
|
+
}
|
|
198
|
+
},
|
|
190
199
|
doDelete = (id) => {
|
|
191
200
|
Repository.deleteById(id);
|
|
192
201
|
Repository.save();
|
|
@@ -282,6 +291,7 @@ function AttachmentsElement(props) {
|
|
|
282
291
|
<FileMosaic
|
|
283
292
|
{...file}
|
|
284
293
|
backgroundBlurImage={false}
|
|
294
|
+
onDownload={onDownload}
|
|
285
295
|
{..._fileMosaic}
|
|
286
296
|
/>}
|
|
287
297
|
{!useFileMosaic &&
|