dry-ux 1.36.0 → 1.38.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.
|
@@ -38,17 +38,20 @@ const DajaxiceProxy = ({ modules, authCheck, onError, loader: showLoaderGlobal,
|
|
|
38
38
|
reject(e);
|
|
39
39
|
};
|
|
40
40
|
const handleSuccess = (result) => {
|
|
41
|
-
|
|
41
|
+
handleResult(result);
|
|
42
42
|
if (cache) {
|
|
43
43
|
storeCache(api, args, result);
|
|
44
44
|
}
|
|
45
|
+
};
|
|
46
|
+
const handleResult = (result) => {
|
|
47
|
+
hideLoader();
|
|
45
48
|
resolve(result);
|
|
46
49
|
};
|
|
47
50
|
const fn = () => {
|
|
48
51
|
if (cache) {
|
|
49
52
|
const cached = checkCache(api, args, cacheDuration);
|
|
50
53
|
if (cached.exists) {
|
|
51
|
-
|
|
54
|
+
handleResult(cached.data);
|
|
52
55
|
return;
|
|
53
56
|
}
|
|
54
57
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toHashCode = exports.StorageUtils = exports.fnWithAuthCheck = exports.formatDollar = exports.useCountdown = exports.importStyleSheet = exports.importScript = exports.preventDefault = void 0;
|
|
3
|
+
exports.getUrlParams = exports.insertUrlParam = exports.toHashCode = exports.StorageUtils = exports.fnWithAuthCheck = exports.formatDollar = exports.useCountdown = exports.importStyleSheet = exports.importScript = exports.preventDefault = void 0;
|
|
4
4
|
const React = require("react");
|
|
5
5
|
/**
|
|
6
6
|
* Returns a function that will call the given handler and prevent the default event behavior.
|
|
@@ -129,3 +129,26 @@ const toHashCode = (input) => {
|
|
|
129
129
|
return hash;
|
|
130
130
|
};
|
|
131
131
|
exports.toHashCode = toHashCode;
|
|
132
|
+
const insertUrlParam = (key, value) => {
|
|
133
|
+
if (history.pushState) {
|
|
134
|
+
let searchParams = new URLSearchParams(window.location.search);
|
|
135
|
+
searchParams.set(key, value);
|
|
136
|
+
let newUrl = window.location.protocol +
|
|
137
|
+
"//" +
|
|
138
|
+
window.location.host +
|
|
139
|
+
window.location.pathname +
|
|
140
|
+
"?" +
|
|
141
|
+
searchParams.toString();
|
|
142
|
+
window.history.pushState({ path: newUrl }, "", newUrl);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
exports.insertUrlParam = insertUrlParam;
|
|
146
|
+
const getUrlParams = () => {
|
|
147
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
148
|
+
const params = {};
|
|
149
|
+
for (const [key, value] of searchParams.entries()) {
|
|
150
|
+
params[key] = value;
|
|
151
|
+
}
|
|
152
|
+
return params;
|
|
153
|
+
};
|
|
154
|
+
exports.getUrlParams = getUrlParams;
|