@bigbinary/neeto-commons-frontend 2.0.51 → 2.0.53
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/configs/webpack/index.js +10 -3
- package/package.json +2 -2
- package/react-utils.cjs.js +15 -6
- package/react-utils.js +15 -6
package/configs/webpack/index.js
CHANGED
|
@@ -11,11 +11,18 @@ const rules = require("./rules");
|
|
|
11
11
|
const dotEnvFileSuffix =
|
|
12
12
|
process.env.NODE_ENV === "production" ? "" : `.${process.env.NODE_ENV}`;
|
|
13
13
|
|
|
14
|
-
let devtool = "source-map"
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
let devtool = "source-map",
|
|
15
|
+
mode = "production";
|
|
16
|
+
if (process.env.RAILS_ENV === "test") {
|
|
17
|
+
devtool = false;
|
|
18
|
+
mode = "none";
|
|
19
|
+
} else if (process.env.RAILS_ENV === "development") {
|
|
20
|
+
devtool = "eval";
|
|
21
|
+
mode = "development";
|
|
22
|
+
}
|
|
17
23
|
|
|
18
24
|
const commonOptions = {
|
|
25
|
+
mode,
|
|
19
26
|
infrastructureLogging: { level: "warn" },
|
|
20
27
|
devtool,
|
|
21
28
|
resolve,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-commons-frontend",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.53",
|
|
4
4
|
"description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"sass-loader": "10.0.2",
|
|
137
137
|
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
|
|
138
138
|
"yup": "^0.32.11",
|
|
139
|
-
"zustand": "
|
|
139
|
+
"zustand": "4.3.2"
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {},
|
|
142
142
|
"peerDependencies": {
|
package/react-utils.cjs.js
CHANGED
|
@@ -3502,24 +3502,33 @@ var OS = {
|
|
|
3502
3502
|
mac: "OS X",
|
|
3503
3503
|
windows: "Windows"
|
|
3504
3504
|
};
|
|
3505
|
+
var KEY_NAMES = {
|
|
3506
|
+
"delete": "delete",
|
|
3507
|
+
backspace: "backspace"
|
|
3508
|
+
};
|
|
3505
3509
|
|
|
3510
|
+
var isMultipleHotkey = function isMultipleHotkey(hotkey) {
|
|
3511
|
+
return Array.isArray(hotkey);
|
|
3512
|
+
};
|
|
3513
|
+
var replaceKeys = function replaceKeys(hotkey, keyName, replaceWith) {
|
|
3514
|
+
return isMultipleHotkey(hotkey) ? hotkey.map(function (item) {
|
|
3515
|
+
return item.replaceAll(keyName, replaceWith);
|
|
3516
|
+
}) : hotkey.replaceAll(keyName, replaceWith);
|
|
3517
|
+
};
|
|
3506
3518
|
var convertHotKeyToWindows = function convertHotKeyToWindows(hotkey) {
|
|
3507
3519
|
ramda.toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
|
|
3508
3520
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
3509
3521
|
macKey = _ref2[0],
|
|
3510
3522
|
windowsKey = _ref2[1];
|
|
3511
|
-
hotkey = hotkey
|
|
3523
|
+
hotkey = replaceKeys(hotkey, macKey, windowsKey);
|
|
3512
3524
|
});
|
|
3513
3525
|
return hotkey;
|
|
3514
3526
|
};
|
|
3515
|
-
var replaceDeleteKeyWithBackspace = function replaceDeleteKeyWithBackspace(hotkey) {
|
|
3516
|
-
return hotkey.replaceAll("delete", "backspace");
|
|
3517
|
-
};
|
|
3518
3527
|
var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
|
|
3519
3528
|
var _platformInfo$os, _platformInfo$os$fami;
|
|
3520
3529
|
var platformInfo = platform.parse(navigator.userAgent);
|
|
3521
3530
|
var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
|
|
3522
|
-
if (isOSX) return
|
|
3531
|
+
if (isOSX) return replaceKeys(hotkey, KEY_NAMES["delete"], KEY_NAMES.backspace);
|
|
3523
3532
|
return convertHotKeyToWindows(hotkey);
|
|
3524
3533
|
};
|
|
3525
3534
|
|
|
@@ -4484,9 +4493,9 @@ var DateRangeFilter = function DateRangeFilter(_ref) {
|
|
|
4484
4493
|
autoFocus: true,
|
|
4485
4494
|
className: "ml-3 w-full",
|
|
4486
4495
|
dateFormat: initializers.globalProps === null || initializers.globalProps === void 0 ? void 0 : (_globalProps$user = initializers.globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.dateFormat,
|
|
4487
|
-
defaultValue: [dayjs__default["default"](startDate), dayjs__default["default"](endDate)],
|
|
4488
4496
|
picker: "date",
|
|
4489
4497
|
type: "range",
|
|
4498
|
+
defaultValue: [startDate ? dayjs__default["default"](startDate) : null, endDate ? dayjs__default["default"](endDate) : null],
|
|
4490
4499
|
onChange: function onChange(_, _ref2) {
|
|
4491
4500
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
4492
4501
|
startDate = _ref3[0],
|
package/react-utils.js
CHANGED
|
@@ -3465,24 +3465,33 @@ var OS = {
|
|
|
3465
3465
|
mac: "OS X",
|
|
3466
3466
|
windows: "Windows"
|
|
3467
3467
|
};
|
|
3468
|
+
var KEY_NAMES = {
|
|
3469
|
+
"delete": "delete",
|
|
3470
|
+
backspace: "backspace"
|
|
3471
|
+
};
|
|
3468
3472
|
|
|
3473
|
+
var isMultipleHotkey = function isMultipleHotkey(hotkey) {
|
|
3474
|
+
return Array.isArray(hotkey);
|
|
3475
|
+
};
|
|
3476
|
+
var replaceKeys = function replaceKeys(hotkey, keyName, replaceWith) {
|
|
3477
|
+
return isMultipleHotkey(hotkey) ? hotkey.map(function (item) {
|
|
3478
|
+
return item.replaceAll(keyName, replaceWith);
|
|
3479
|
+
}) : hotkey.replaceAll(keyName, replaceWith);
|
|
3480
|
+
};
|
|
3469
3481
|
var convertHotKeyToWindows = function convertHotKeyToWindows(hotkey) {
|
|
3470
3482
|
toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
|
|
3471
3483
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
3472
3484
|
macKey = _ref2[0],
|
|
3473
3485
|
windowsKey = _ref2[1];
|
|
3474
|
-
hotkey = hotkey
|
|
3486
|
+
hotkey = replaceKeys(hotkey, macKey, windowsKey);
|
|
3475
3487
|
});
|
|
3476
3488
|
return hotkey;
|
|
3477
3489
|
};
|
|
3478
|
-
var replaceDeleteKeyWithBackspace = function replaceDeleteKeyWithBackspace(hotkey) {
|
|
3479
|
-
return hotkey.replaceAll("delete", "backspace");
|
|
3480
|
-
};
|
|
3481
3490
|
var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
|
|
3482
3491
|
var _platformInfo$os, _platformInfo$os$fami;
|
|
3483
3492
|
var platformInfo = platform.parse(navigator.userAgent);
|
|
3484
3493
|
var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
|
|
3485
|
-
if (isOSX) return
|
|
3494
|
+
if (isOSX) return replaceKeys(hotkey, KEY_NAMES["delete"], KEY_NAMES.backspace);
|
|
3486
3495
|
return convertHotKeyToWindows(hotkey);
|
|
3487
3496
|
};
|
|
3488
3497
|
|
|
@@ -4447,9 +4456,9 @@ var DateRangeFilter = function DateRangeFilter(_ref) {
|
|
|
4447
4456
|
autoFocus: true,
|
|
4448
4457
|
className: "ml-3 w-full",
|
|
4449
4458
|
dateFormat: globalProps$1 === null || globalProps$1 === void 0 ? void 0 : (_globalProps$user = globalProps$1.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.dateFormat,
|
|
4450
|
-
defaultValue: [dayjs(startDate), dayjs(endDate)],
|
|
4451
4459
|
picker: "date",
|
|
4452
4460
|
type: "range",
|
|
4461
|
+
defaultValue: [startDate ? dayjs(startDate) : null, endDate ? dayjs(endDate) : null],
|
|
4453
4462
|
onChange: function onChange(_, _ref2) {
|
|
4454
4463
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
4455
4464
|
startDate = _ref3[0],
|