@devtron-labs/devtron-fe-common-lib 0.2.2-beta-5 → 0.2.2-beta-6

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.
@@ -126,6 +126,14 @@ import { SelectPickerProps } from './type';
126
126
  * renderCustomOptions={() => <div />}
127
127
  * />
128
128
  * ```
129
+ *
130
+ * @example Align the menu at the right most end
131
+ * ```tsx
132
+ * <SelectPicker
133
+ * ...
134
+ * shouldMenuAlignRight
135
+ * />
136
+ * ```
129
137
  */
130
- declare const SelectPicker: <OptionValue, IsMulti extends boolean>({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, menuPosition, variant, disableDescriptionEllipsis, multiSelectProps, isMulti, name, classNamePrefix, renderCustomOptions, shouldRenderCustomOptions, isSearchable, selectRef, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
138
+ declare const SelectPicker: <OptionValue, IsMulti extends boolean>({ error, icon, renderMenuListFooter, helperText, placeholder, label, showSelectedOptionIcon, size, disabledTippyContent, showSelectedOptionsCount, menuSize, menuPosition, variant, disableDescriptionEllipsis, multiSelectProps, isMulti, name, classNamePrefix, renderCustomOptions, shouldRenderCustomOptions, isSearchable, selectRef, shouldMenuAlignRight, ...props }: SelectPickerProps<OptionValue, IsMulti>) => JSX.Element;
131
139
  export default SelectPicker;
@@ -91,6 +91,13 @@ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boo
91
91
  * Ref for the select picker
92
92
  */
93
93
  selectRef?: IsMulti extends true ? MutableRefObject<SelectInstance<SelectPickerOptionType<OptionValue>, true>> : MutableRefObject<SelectInstance<SelectPickerOptionType<OptionValue>>>;
94
+ /**
95
+ * If true, the menu is aligned at the right end to prevent going outside of viewport
96
+ * in case of menu being larger than the control
97
+ *
98
+ * @default false
99
+ */
100
+ shouldMenuAlignRight?: boolean;
94
101
  } & (IsMulti extends true ? {
95
102
  isMulti: IsMulti | boolean;
96
103
  multiSelectProps?: Pick<CreatableProps<SelectPickerOptionType<OptionValue>, true, GroupBase<SelectPickerOptionType<OptionValue>>>, 'onCreateOption'> & {
@@ -139,7 +146,7 @@ export type SelectPickerProps<OptionValue = number | string, IsMulti extends boo
139
146
  export type SelectPickerGroupHeadingProps<OptionValue> = GroupHeadingProps<SelectPickerOptionType<OptionValue>> & {
140
147
  isGroupHeadingSelectable: boolean;
141
148
  };
142
- export interface FilterSelectPickerProps extends Required<Pick<SelectPickerProps<number | string, true>, 'options' | 'isDisabled' | 'placeholder' | 'isLoading'>>, Pick<SelectPickerProps<number | string, true>, 'selectRef' | 'inputId' | 'menuPosition' | 'autoFocus'> {
149
+ export interface FilterSelectPickerProps extends Required<Pick<SelectPickerProps<number | string, true>, 'options' | 'isDisabled' | 'placeholder' | 'isLoading'>>, Pick<SelectPickerProps<number | string, true>, 'selectRef' | 'inputId' | 'menuPosition' | 'autoFocus' | 'shouldMenuAlignRight'> {
143
150
  appliedFilterOptions: SelectPickerProps<number | string, true>['options'];
144
151
  handleApplyFilter: (filtersToApply: SelectPickerOptionType<number | string>[]) => void;
145
152
  }
@@ -2,7 +2,7 @@ import { CHECKBOX_VALUE } from '../../../Common/Types';
2
2
  import { GroupBase, MultiValue, OptionsOrGroups, StylesConfig } from 'react-select';
3
3
  import { SelectPickerOptionType, SelectPickerProps } from './type';
4
4
 
5
- export declare const getCommonSelectStyle: <OptionValue, IsMulti extends boolean>({ error, size, menuSize, variant, getIsOptionValid, isGroupHeadingSelectable, }: Pick<SelectPickerProps<OptionValue, IsMulti>, "error" | "size" | "menuSize" | "variant"> & Pick<SelectPickerProps<OptionValue, IsMulti>["multiSelectProps"], "getIsOptionValid" | "isGroupHeadingSelectable">) => StylesConfig<SelectPickerOptionType<OptionValue>, boolean, GroupBase<SelectPickerOptionType<OptionValue>>>;
5
+ export declare const getCommonSelectStyle: <OptionValue, IsMulti extends boolean>({ error, size, menuSize, variant, getIsOptionValid, isGroupHeadingSelectable, shouldMenuAlignRight, }: Pick<SelectPickerProps<OptionValue, IsMulti>, "error" | "size" | "shouldMenuAlignRight" | "menuSize" | "variant"> & Pick<SelectPickerProps<OptionValue, IsMulti>["multiSelectProps"], "getIsOptionValid" | "isGroupHeadingSelectable">) => StylesConfig<SelectPickerOptionType<OptionValue>, boolean, GroupBase<SelectPickerOptionType<OptionValue>>>;
6
6
  export declare const getGroupCheckboxValue: <OptionValue>(groupHeadingOptions: readonly SelectPickerOptionType<OptionValue>[], selectedOptions: MultiValue<SelectPickerOptionType<OptionValue>>, getOptionValue: (option: SelectPickerOptionType<OptionValue>) => string) => CHECKBOX_VALUE.CHECKED | CHECKBOX_VALUE.INTERMEDIATE;
7
7
  /**
8
8
  * Retrieves an option from the options list based on the provided value.
@@ -1,7 +1,7 @@
1
1
  var Le = Object.defineProperty;
2
2
  var je = (e, n, i) => n in e ? Le(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
3
  var k = (e, n, i) => (je(e, typeof n != "symbol" ? n + "" : n, i), i);
4
- import { m as Ne } from "./index-81cf06c0.js";
4
+ import { m as Ne } from "./index-23b15be0.js";
5
5
  /*!-----------------------------------------------------------------------------
6
6
  * Copyright (c) Microsoft Corporation. All rights reserved.
7
7
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as F } from "./index-81cf06c0.js";
1
+ import { m as F } from "./index-23b15be0.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as i } from "./index-81cf06c0.js";
1
+ import { m as i } from "./index-23b15be0.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,4 +1,4 @@
1
- import { m as d } from "./index-81cf06c0.js";
1
+ import { m as d } from "./index-23b15be0.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
@@ -1,7 +1,7 @@
1
1
  var $e = Object.defineProperty;
2
2
  var qe = (e, n, i) => n in e ? $e(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
3
  var k = (e, n, i) => (qe(e, typeof n != "symbol" ? n + "" : n, i), i);
4
- import { m as Qe } from "./index-81cf06c0.js";
4
+ import { m as Qe } from "./index-23b15be0.js";
5
5
  /*!-----------------------------------------------------------------------------
6
6
  * Copyright (c) Microsoft Corporation. All rights reserved.
7
7
  * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)