jamespot-react-components 1.0.245 → 1.0.246

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.
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { JRCInputSelectProps } from './JRCInputSelect.types';
3
+ import type { FieldValues } from 'react-hook-form';
4
+ type SelectOption = {
5
+ label: string;
6
+ value: any;
7
+ resetOptions?: boolean;
8
+ };
9
+ export declare function JRCInputSelect<T extends FieldValues = FieldValues>(props: Omit<JRCInputSelectProps<T, SelectOption>, 'getLabel' | 'getValue'>): React.JSX.Element;
10
+ export {};
@@ -9,4 +9,4 @@ type Data = {
9
9
  export declare const InputSelect: Story<JRCInputSelectProps<{
10
10
  select: Data;
11
11
  select2: Array<Data>;
12
- }>>;
12
+ }, any>>;
@@ -8,8 +8,8 @@ import { PartialBy } from '../../../../types/utils';
8
8
  /**
9
9
  * Select
10
10
  */
11
- export type NativeSelectProps<T extends FieldValues = FieldValues> = PartialBy<ControllerRenderProps<T>, 'onBlur'> & SelectProps & IconsProp;
12
- export type JRCInputSelectProps<T extends FieldValues = FieldValues> = JRCInputFieldProps<T> & SelectProps & IconsProp;
11
+ export type NativeSelectProps<T extends FieldValues = FieldValues, U = any> = PartialBy<ControllerRenderProps<T>, 'onBlur'> & SelectProps<U> & IconsProp;
12
+ export type JRCInputSelectProps<T extends FieldValues = FieldValues, U = any> = JRCInputFieldProps<T> & SelectProps<U> & IconsProp;
13
13
  export type Getter = ((option: any) => any) | string;
14
14
  export type IconsProp = {
15
15
  iconBefore?: {
@@ -18,34 +18,34 @@ export type IconsProp = {
18
18
  onClick?: () => void;
19
19
  };
20
20
  };
21
- export type SelectProps = DataCy & {
22
- options?: Array<any>;
21
+ export type SelectProps<T = any> = DataCy & {
22
+ options?: Array<T>;
23
23
  asyncPromise?: (inputValue: string, page?: number) => Promise<any[]>;
24
24
  multiple?: boolean;
25
- getLabel?: ((option: any) => any) | string;
26
- getValue?: ((option: any) => any) | string;
27
- getDescription?: (option: any) => any;
25
+ getLabel?: ((option: T) => string) | string;
26
+ getValue?: ((option: T) => string) | string;
27
+ getDescription?: (option: T) => T;
28
28
  disabled?: boolean;
29
29
  readOnly?: boolean;
30
30
  placeholder?: string;
31
31
  searchable?: boolean;
32
- getSearch?: ((option: any) => any) | string;
32
+ getSearch?: ((option: T) => string) | string;
33
33
  group?: boolean;
34
- getGroup?: ((option: any) => any) | string;
34
+ getGroup?: ((option: T) => string) | string;
35
35
  views?: Array<'folder' | 'user' | 'group' | 'community'>;
36
36
  onConfirm?: (values: any) => void;
37
37
  hideSelectedOption?: boolean;
38
38
  hideDeleteIcon?: boolean;
39
39
  displayOption?: boolean;
40
40
  displayIndicator?: boolean;
41
- getOptionsSelected?: (options: any) => void;
42
- setOptionsSelected?: any;
41
+ getOptionsSelected?: (options: T) => void;
42
+ setOptionsSelected?: T;
43
43
  components?: {
44
44
  Option?: React.ComponentType<{
45
- option: any;
45
+ option: T;
46
46
  }>;
47
47
  SelectedOption?: React.ComponentType<{
48
- option: any;
48
+ option: T;
49
49
  }>;
50
50
  };
51
51
  /**
@@ -8,4 +8,4 @@ type Data = {
8
8
  };
9
9
  export declare const AsyncSelect: Story<JRCInputSelectProps<{
10
10
  select: Array<Data>;
11
- }>>;
11
+ }, any>>;
@@ -11,7 +11,7 @@ export type JRCInputSelectHierarchicalTreeProps = Omit<JRCInputSelectProps, 'asy
11
11
  value: any;
12
12
  }>;
13
13
  };
14
- export declare const JRCInputSelectHierarchicalTree: React.ForwardRefExoticComponent<Omit<JRCInputSelectProps<import("react-hook-form").FieldValues>, "asyncPromise"> & JRCModalLayoutProps & {
14
+ export declare const JRCInputSelectHierarchicalTree: React.ForwardRefExoticComponent<Omit<JRCInputSelectProps<import("react-hook-form").FieldValues, any>, "asyncPromise"> & JRCModalLayoutProps & {
15
15
  asyncPromise?: ((inputValue: string, page?: number) => Promise<PagingResults<any>>) | undefined;
16
16
  hierarchicalTaxonomyPromise: (uriConcept: string) => Promise<PagingResults<jObjectAutocomplete>>;
17
17
  displayModal?: boolean | undefined;
@@ -1,3 +1,3 @@
1
1
  import { NativeSelectProps } from './JRCInputSelect.types';
2
2
  import type { FieldValues } from 'react-hook-form';
3
- export declare const JRCInputSelectRaw: <T extends FieldValues = FieldValues>(props: Pick<Partial<NativeSelectProps<T>>, "ref"> & Omit<NativeSelectProps<T>, "ref">) => JSX.Element;
3
+ export declare const JRCInputSelectRaw: <T extends FieldValues = FieldValues, U = any>(props: Pick<Partial<NativeSelectProps<T, U>>, "ref"> & Omit<NativeSelectProps<T, U>, "ref">) => JSX.Element;
@@ -82,6 +82,7 @@ export { JRCInputUrl } from './components/Form/Input/JRCInputUrl/JRCInputUrl';
82
82
  export { JRCInputCommunity } from './components/Form/Input/JRCSelect/JRCAutocompleteCommunity';
83
83
  export { JRCInputAudience } from './components/Form/Input/JRCSelect/JRCInputAudience';
84
84
  export { JRCInputAutocomplete } from './components/Form/Input/JRCSelect/JRCInputAutocomplete';
85
+ export { JRCInputSelect } from './components/Form/Input/JRCSelect/JRCInputSelect';
85
86
  export { JRCInputSelectExtended } from './components/Form/Input/JRCSelect/JRCInputSelectExtended';
86
87
  export { JRCInputSelectRaw } from './components/Form/Input/JRCSelect/JRCInputSelectRaw';
87
88
  export { JRCInputSelectHierarchicalTree } from './components/Form/Input/JRCSelect/JRCInputSelectHierarchicalTree';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.245",
3
+ "version": "1.0.246",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -80,7 +80,7 @@
80
80
  "chroma-js": "^2.1.1",
81
81
  "classnames": "^2.3.1",
82
82
  "dompurify": "^3.0.5",
83
- "jamespot-user-api": "^1.0.218",
83
+ "jamespot-user-api": "^1.0.219",
84
84
  "moment": "2.29.4",
85
85
  "react": "^17.x",
86
86
  "react-beautiful-dnd": "^13.1.1",