@star-insure/sdk 3.2.6 → 3.2.8

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.
@@ -9,6 +9,7 @@ interface Props {
9
9
  actions?: TPageHeaderAction[];
10
10
  backText?: string;
11
11
  filterOptions?: FilterOption[];
12
+ focusSearchShortcut?: boolean;
12
13
  }
13
- export default function PageHeader({ title, search, className, innerClassName, back, actions, filterOptions, }: Props): JSX.Element;
14
+ export default function PageHeader({ title, search, className, innerClassName, back, actions, filterOptions, focusSearchShortcut, }: Props): JSX.Element;
14
15
  export {};
@@ -1,7 +1,10 @@
1
1
  /// <reference types="react" />
2
- export default function SearchBar({ search, active, onActive, placeholder }: {
2
+ interface Props {
3
3
  search?: string;
4
4
  active: boolean;
5
5
  onActive: Function;
6
6
  placeholder?: string;
7
- }): JSX.Element;
7
+ focusSearchShortcut?: boolean;
8
+ }
9
+ export default function SearchBar({ search, active, onActive, placeholder, focusSearchShortcut }: Props): JSX.Element;
10
+ export {};
@@ -2291,7 +2291,9 @@ function SearchBar(_ref) {
2291
2291
  var search = _ref.search,
2292
2292
  active = _ref.active,
2293
2293
  onActive = _ref.onActive,
2294
- placeholder = _ref.placeholder;
2294
+ placeholder = _ref.placeholder,
2295
+ _ref$focusSearchShort = _ref.focusSearchShortcut,
2296
+ focusSearchShortcut = _ref$focusSearchShort === void 0 ? false : _ref$focusSearchShort;
2295
2297
 
2296
2298
  var _React$useState = React__default.useState(''),
2297
2299
  query = _React$useState[0],
@@ -2316,7 +2318,7 @@ function SearchBar(_ref) {
2316
2318
  }
2317
2319
 
2318
2320
  var listener = function listener(e) {
2319
- if (e.key === '/') {
2321
+ if (focusSearchShortcut && e.key === '/') {
2320
2322
  e.preventDefault();
2321
2323
  onActive(true);
2322
2324
  }
@@ -2330,7 +2332,7 @@ function SearchBar(_ref) {
2330
2332
  return function () {
2331
2333
  window.removeEventListener('keydown', listener);
2332
2334
  };
2333
- }, []);
2335
+ }, [focusSearchShortcut]);
2334
2336
  /**
2335
2337
  * Minimise the search bar on click outside if there's no search query
2336
2338
  */
@@ -2792,7 +2794,8 @@ function FilterItem(_ref) {
2792
2794
  }, "Clear"), React__default.createElement(Button, {
2793
2795
  type: "submit",
2794
2796
  status: "primary",
2795
- className: "!min-w-[0px] flex-grow !px-2 text-sm !transition-none"
2797
+ className: "!min-w-[0px] flex-grow !px-2 text-sm !transition-none",
2798
+ small: true
2796
2799
  }, "Apply"))));
2797
2800
  }
2798
2801
 
@@ -2808,7 +2811,9 @@ function PageHeader(_ref) {
2808
2811
  _ref$actions = _ref.actions,
2809
2812
  actions = _ref$actions === void 0 ? [] : _ref$actions,
2810
2813
  _ref$filterOptions = _ref.filterOptions,
2811
- filterOptions = _ref$filterOptions === void 0 ? [] : _ref$filterOptions;
2814
+ filterOptions = _ref$filterOptions === void 0 ? [] : _ref$filterOptions,
2815
+ _ref$focusSearchShort = _ref.focusSearchShortcut,
2816
+ focusSearchShortcut = _ref$focusSearchShort === void 0 ? false : _ref$focusSearchShort;
2812
2817
 
2813
2818
  var _React$useState = React__default.useState(false),
2814
2819
  isSearchActive = _React$useState[0],
@@ -2953,7 +2958,8 @@ function PageHeader(_ref) {
2953
2958
  search: search,
2954
2959
  active: isSearchActive,
2955
2960
  onActive: setSearchActive,
2956
- placeholder: "Search " + title + "..."
2961
+ placeholder: "Search " + title + "...",
2962
+ focusSearchShortcut: focusSearchShortcut
2957
2963
  }), !isSearchActive && React__default.createElement("h1", {
2958
2964
  className: "text-base font-bold"
2959
2965
  }, title)), React__default.createElement("div", {