@star-insure/sdk 3.2.8 → 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 +35 -3
- 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 +35 -3
- 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/components/filter/PageHeader.tsx +1 -1
- 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-
|
|
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, {
|
|
@@ -2954,7 +2986,7 @@ function PageHeader(_ref) {
|
|
|
2954
2986
|
placeholder: "Search " + title + "...",
|
|
2955
2987
|
focusSearchShortcut: focusSearchShortcut
|
|
2956
2988
|
}), !isSearchActive && React__default.createElement("h1", {
|
|
2957
|
-
className: "text-base font-
|
|
2989
|
+
className: "text-base font-black"
|
|
2958
2990
|
}, title)), React__default.createElement("div", {
|
|
2959
2991
|
className: "flex items-center ml-auto gap-2 h-full min-w-0 max-w-full"
|
|
2960
2992
|
}, filterOptions.length > 0 && React__default.createElement(React__default.Fragment, null, React__default.createElement("button", {
|