@bigbinary/neeto-commons-frontend 2.0.20 → 2.0.21
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/README.md +1 -1
- package/initializers.cjs.js +68 -24
- package/initializers.js +69 -25
- package/package.json +3 -2
- package/react-utils.cjs.js +2703 -1159
- package/react-utils.d.ts +17 -0
- package/react-utils.js +2689 -1146
- package/utils.cjs.js +7 -0
- package/utils.d.ts +23 -0
- package/utils.js +7 -1
package/utils.cjs.js
CHANGED
|
@@ -2782,6 +2782,12 @@ var toLocale = function toLocale(number) {
|
|
|
2782
2782
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
2783
2783
|
return Number(number).toLocaleString(((_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 ? void 0 : (_window$globalProps$u = _window$globalProps.user) === null || _window$globalProps$u === void 0 ? void 0 : _window$globalProps$u.locale) || navigator.language || navigator.languages[0], options);
|
|
2784
2784
|
};
|
|
2785
|
+
var getQueryParams = function getQueryParams() {
|
|
2786
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2787
|
+
return lib.parse(location.search, _objectSpread({
|
|
2788
|
+
ignoreQueryPrefix: true
|
|
2789
|
+
}, options));
|
|
2790
|
+
};
|
|
2785
2791
|
|
|
2786
2792
|
dayjs__default["default"].extend(relativeTime__default["default"]);
|
|
2787
2793
|
dayjs__default["default"].extend(updateLocale__default["default"]);
|
|
@@ -2818,6 +2824,7 @@ var dateFormat = timeFormat;
|
|
|
2818
2824
|
exports.buildUrl = buildUrl;
|
|
2819
2825
|
exports.copyToClipboard = copyToClipboard;
|
|
2820
2826
|
exports.dateFormat = dateFormat;
|
|
2827
|
+
exports.getQueryParams = getQueryParams;
|
|
2821
2828
|
exports.getSubdomain = getSubdomain;
|
|
2822
2829
|
exports.resetAuthTokens = resetAuthTokens;
|
|
2823
2830
|
exports.simulateApiCall = simulateApiCall;
|
package/utils.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export function withEventTargetValue(
|
|
|
13
13
|
): (event: React.ChangeEventHandler<HTMLInputElement>) => void;
|
|
14
14
|
|
|
15
15
|
export function getSubdomain(): string;
|
|
16
|
+
|
|
16
17
|
export function simulateApiCall<T>(
|
|
17
18
|
result: T,
|
|
18
19
|
error?: any,
|
|
@@ -46,3 +47,25 @@ export function toLocale(
|
|
|
46
47
|
number: string | number,
|
|
47
48
|
options?: Intl.NumberFormatOptions
|
|
48
49
|
): string;
|
|
50
|
+
|
|
51
|
+
type qsOptionsType = {
|
|
52
|
+
comma?: boolean | undefined;
|
|
53
|
+
delimiter?: string | RegExp | undefined;
|
|
54
|
+
depth?: number | false | undefined;
|
|
55
|
+
decoder?: ((str: string, defaultDecoder: any, charset: string, type: 'key' | 'value') => any) | undefined;
|
|
56
|
+
arrayLimit?: number | undefined;
|
|
57
|
+
parseArrays?: boolean | undefined;
|
|
58
|
+
allowDots?: boolean | undefined;
|
|
59
|
+
plainObjects?: boolean | undefined;
|
|
60
|
+
allowPrototypes?: boolean | undefined;
|
|
61
|
+
parameterLimit?: number | undefined;
|
|
62
|
+
strictNullHandling?: boolean | undefined;
|
|
63
|
+
ignoreQueryPrefix?: boolean | undefined;
|
|
64
|
+
charset?: 'utf-8' | 'iso-8859-1' | undefined;
|
|
65
|
+
charsetSentinel?: boolean | undefined;
|
|
66
|
+
interpretNumericEntities?: boolean | undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
type QueryParamsType = { [key: string]: any };
|
|
70
|
+
|
|
71
|
+
export function getQueryParams(options?: qsOptionsType): QueryParamsType;
|
package/utils.js
CHANGED
|
@@ -2769,6 +2769,12 @@ var toLocale = function toLocale(number) {
|
|
|
2769
2769
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
2770
2770
|
return Number(number).toLocaleString(((_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 ? void 0 : (_window$globalProps$u = _window$globalProps.user) === null || _window$globalProps$u === void 0 ? void 0 : _window$globalProps$u.locale) || navigator.language || navigator.languages[0], options);
|
|
2771
2771
|
};
|
|
2772
|
+
var getQueryParams = function getQueryParams() {
|
|
2773
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2774
|
+
return lib.parse(location.search, _objectSpread({
|
|
2775
|
+
ignoreQueryPrefix: true
|
|
2776
|
+
}, options));
|
|
2777
|
+
};
|
|
2772
2778
|
|
|
2773
2779
|
dayjs.extend(relativeTime);
|
|
2774
2780
|
dayjs.extend(updateLocale);
|
|
@@ -2802,4 +2808,4 @@ var timeFormat = {
|
|
|
2802
2808
|
};
|
|
2803
2809
|
var dateFormat = timeFormat;
|
|
2804
2810
|
|
|
2805
|
-
export { buildUrl, copyToClipboard, dateFormat, getSubdomain, resetAuthTokens, simulateApiCall, timeFormat, toLocale, withEventTargetValue };
|
|
2811
|
+
export { buildUrl, copyToClipboard, dateFormat, getQueryParams, getSubdomain, resetAuthTokens, simulateApiCall, timeFormat, toLocale, withEventTargetValue };
|