@star-insure/sdk 3.2.9 → 3.2.10
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/dist/components/filter/Action.d.ts +1 -1
- package/dist/sdk.cjs.development.js +34 -2
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +34 -2
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/misc/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/filter/Action.tsx +37 -4
- package/src/types/misc/index.ts +1 -0
package/dist/sdk.esm.js
CHANGED
|
@@ -2407,9 +2407,41 @@ function Action(_ref) {
|
|
|
2407
2407
|
target = _ref$target === void 0 ? '_self' : _ref$target,
|
|
2408
2408
|
type = _ref.type,
|
|
2409
2409
|
_ref$onClick = _ref.onClick,
|
|
2410
|
-
_onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick
|
|
2410
|
+
_onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
2411
|
+
shortcutKey = _ref.shortcutKey;
|
|
2411
2412
|
|
|
2412
|
-
var className = 'bg-white rounded-full font-bold px-4 py-1.5 text-sm whitespace-nowrap hover:bg-gray-100 hover:border-gray-
|
|
2413
|
+
var className = 'bg-white rounded-full font-bold px-4 py-1.5 text-sm whitespace-nowrap hover:bg-gray-100 hover:border-gray-400 transition-colors border border-gray-300';
|
|
2414
|
+
|
|
2415
|
+
function runAction() {
|
|
2416
|
+
if (as === 'Link' && href) {
|
|
2417
|
+
return router.get(href);
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
if (as === 'a' && href) {
|
|
2421
|
+
return window.location.href = href;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
_onClick();
|
|
2425
|
+
}
|
|
2426
|
+
React__default.useEffect(function () {
|
|
2427
|
+
if (typeof window === 'undefined') return;
|
|
2428
|
+
if (!shortcutKey) return;
|
|
2429
|
+
|
|
2430
|
+
var listener = function listener(e) {
|
|
2431
|
+
// Check if Ctrl (Windows) or Cmd (Mac) key is pressed
|
|
2432
|
+
var isCtrlOrCmdPressed = e.ctrlKey || e.metaKey;
|
|
2433
|
+
|
|
2434
|
+
if (e.key === shortcutKey && isCtrlOrCmdPressed) {
|
|
2435
|
+
e.preventDefault();
|
|
2436
|
+
runAction();
|
|
2437
|
+
}
|
|
2438
|
+
};
|
|
2439
|
+
|
|
2440
|
+
window.addEventListener('keydown', listener);
|
|
2441
|
+
return function () {
|
|
2442
|
+
window.removeEventListener('keydown', listener);
|
|
2443
|
+
};
|
|
2444
|
+
}, [shortcutKey]);
|
|
2413
2445
|
|
|
2414
2446
|
if (as === 'Link' && href) {
|
|
2415
2447
|
return React__default.createElement(Link, {
|