@rn-components-dropdown/dropdown 1.0.32 → 1.0.33

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.
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { DropdownProps } from './interface/DropdownInterface';
3
- declare const DropdownComponent: <T, Mode extends "single" | "multi">(props: DropdownProps<T, Mode>) => React.JSX.Element;
2
+ import { DropdownProps, SELECTIONS_TYPE } from './interface/DropdownInterface';
3
+ declare const DropdownComponent: <T, Mode extends SELECTIONS_TYPE>(props: DropdownProps<T, Mode>) => React.JSX.Element;
4
4
  export default DropdownComponent;
@@ -6,8 +6,8 @@ import React, { useCallback } from 'react';
6
6
  import useDropdown from './hooks/useDropdown';
7
7
  import SvgButton from '../svgButton/SvgButton';
8
8
  import { useDropdownStyle } from './DropdownStyle';
9
- import { ArrowDown, ArrowUp, CheckIcon } from '../../assets/svg';
10
9
  import SearchInput from './component/input/TextInput';
10
+ import { ArrowDown, ArrowUp, CheckIcon } from '../../assets/svg';
11
11
  const DropdownComponent = (props) => {
12
12
  const { label, testID, iconStyle, renderItem, style = {}, subfixIcon, labelField, valueField, onChangeText, itemTextStyle, flatListProps, minHeight = 0, containerStyle, search = false, renderLeftIcon, checkIconColor, radioIconColor, multiSelectIcon, itemTestIDField, maxHeight = 300, inverted = true, renderRightIcon, placeholderStyle, inputSearchStyle, searchPlaceholder, selectedTextStyle, renderInputSearch, iconColor = 'gray', accessibilityLabel, itemContainerStyle, labelContainer = {}, labelTextStyle = {}, selectedTextProps = {}, chipContainerProps = {}, keyboardAvoiding = true, selectionType = 'single', activeColor = 'lightGray', dropdownPosition = 'auto', itemAccessibilityLabelField, placeholder = 'Please select', showsVerticalScrollIndicator = true, } = props;
13
13
  const { chipColor, clearIcon, textColor, onClearPress: onClear, } = chipContainerProps;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { DropdownProps, SELECTIONS_TYPE } from '../../components/dropdown/interface/DropdownInterface';
3
3
  import { Control, FieldValues, Path } from 'react-hook-form';
4
- interface DropControllerProps<U extends FieldValues, S, T extends SELECTIONS_TYPE = 'single'> extends DropdownProps<S, T> {
4
+ interface DropControllerProps<U extends FieldValues, S, T extends SELECTIONS_TYPE> extends DropdownProps<S, T> {
5
5
  control: Control<U>;
6
6
  controller: Path<U>;
7
7
  }
8
- declare const AppDropdownController: <U extends FieldValues, S, T extends SELECTIONS_TYPE = "single">(props: DropControllerProps<U, S, T>) => React.JSX.Element;
8
+ declare const AppDropdownController: <U extends FieldValues, S, T extends SELECTIONS_TYPE>(props: DropControllerProps<U, S, T>) => React.JSX.Element;
9
9
  export default AppDropdownController;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rn-components-dropdown/dropdown",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "homepage": "https://www.npmjs.com/package/@rn-components-dropdown/dropdown",
@@ -15,11 +15,11 @@ import React, { useCallback } from 'react';
15
15
  import useDropdown from './hooks/useDropdown';
16
16
  import SvgButton from '../svgButton/SvgButton';
17
17
  import { useDropdownStyle } from './DropdownStyle';
18
- import { ArrowDown, ArrowUp, CheckIcon } from '../../assets/svg';
19
18
  import SearchInput from './component/input/TextInput';
20
- import { DropdownProps } from './interface/DropdownInterface';
19
+ import { ArrowDown, ArrowUp, CheckIcon } from '../../assets/svg';
20
+ import { DropdownProps, SELECTIONS_TYPE } from './interface/DropdownInterface';
21
21
 
22
- const DropdownComponent = <T, Mode extends 'single' | 'multi'>(
22
+ const DropdownComponent = <T, Mode extends SELECTIONS_TYPE>(
23
23
  props: DropdownProps<T, Mode>,
24
24
  ) => {
25
25
  const {
@@ -12,7 +12,7 @@ import { Control, Controller, FieldValues, Path } from 'react-hook-form';
12
12
  interface DropControllerProps<
13
13
  U extends FieldValues,
14
14
  S,
15
- T extends SELECTIONS_TYPE = 'single',
15
+ T extends SELECTIONS_TYPE,
16
16
  > extends DropdownProps<S, T> {
17
17
  control: Control<U>;
18
18
  controller: Path<U>;
@@ -21,7 +21,7 @@ interface DropControllerProps<
21
21
  const AppDropdownController = <
22
22
  U extends FieldValues,
23
23
  S,
24
- T extends SELECTIONS_TYPE = 'single',
24
+ T extends SELECTIONS_TYPE,
25
25
  >(
26
26
  props: DropControllerProps<U, S, T>,
27
27
  ) => {