@smart-factor/gem-ui-components 0.0.17 → 0.0.19
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/{Drawer-DRs-5EyC.js → Drawer-Bt301-Fw.js} +4 -4
- package/dist/{Stack-CrOcI22K.js → Stack-C-c-qEyo.js} +7 -11
- package/dist/{Tree-DEzkwImd.js → Tree-BQQfGoK7.js} +237 -260
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/FormComponents/ContextualSearch/ContextualSearch.d.ts +23 -13
- package/dist/components/FormComponents/ContextualSearch/ContextualSearch.stories.d.ts +5 -4
- package/dist/components/FormComponents/ContextualSearch/ContextualSearchControlled.d.ts +9 -0
- package/dist/components/FormComponents/ContextualSearch/index.d.ts +1 -1
- package/dist/components/FormComponents/ContextualSearch/mock.d.ts +13 -0
- package/dist/components/FormComponents/index.d.ts +1 -2
- package/dist/components/Tree/index.js +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +11752 -31879
- package/package.json +3 -2
- package/dist/components/FormComponents/ContextualSearch/ContextualSearchOption.d.ts +0 -13
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TextFieldVariants } from '@mui/material';
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { FilterOptionsState, TextFieldVariants } from '@mui/material';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
title?: string | string[];
|
|
9
|
-
}
|
|
10
|
-
export interface ContextualSearchProps<T extends FieldValues> {
|
|
11
|
-
name: Path<T>;
|
|
12
|
-
control: Control<T>;
|
|
13
|
-
options: IContextualSearchOption[];
|
|
4
|
+
interface ContextualBaseSearchProps<T> {
|
|
5
|
+
options: T[];
|
|
6
|
+
isOptionEqualToValue: (option: T, value: T) => boolean;
|
|
7
|
+
renderOption: (option: T) => ReactNode;
|
|
14
8
|
label: string;
|
|
15
9
|
multiple?: boolean;
|
|
16
10
|
required?: boolean;
|
|
@@ -22,5 +16,21 @@ export interface ContextualSearchProps<T extends FieldValues> {
|
|
|
22
16
|
onLastOptionInView: () => void;
|
|
23
17
|
onInputChange: (event: React.SyntheticEvent<Element, Event>, value: string) => void;
|
|
24
18
|
onAddNewEntry?: () => void;
|
|
19
|
+
errorMessage?: string;
|
|
20
|
+
getOptionKey: (option: T) => string | number;
|
|
21
|
+
getOptionLabel: (option: T) => string;
|
|
22
|
+
filterOptions?: (options: T[], state: FilterOptionsState<T>) => T[];
|
|
25
23
|
}
|
|
26
|
-
|
|
24
|
+
type ContextualSearchPropsSingle<T> = ContextualBaseSearchProps<T> & {
|
|
25
|
+
multiple: false;
|
|
26
|
+
value: T | null;
|
|
27
|
+
onChange: (value: T | null) => void;
|
|
28
|
+
};
|
|
29
|
+
type ContextualSearchPropsMultiple<T> = ContextualBaseSearchProps<T> & {
|
|
30
|
+
multiple: true;
|
|
31
|
+
value: T[];
|
|
32
|
+
onChange: (value: T[]) => void;
|
|
33
|
+
};
|
|
34
|
+
export type ContextualSearchProps<T> = ContextualSearchPropsSingle<T> | ContextualSearchPropsMultiple<T>;
|
|
35
|
+
export declare function ContextualSearch<T>(props: ContextualSearchProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { ContextualSearchProps } from './ContextualSearch';
|
|
3
|
+
import { ContextualSearchStoryOption } from './mock';
|
|
3
4
|
|
|
4
|
-
declare const meta: Meta<
|
|
5
|
+
declare const meta: Meta<ContextualSearchProps<ContextualSearchStoryOption>>;
|
|
5
6
|
export default meta;
|
|
6
|
-
type Story = StoryObj<
|
|
7
|
+
type Story = StoryObj<ContextualSearchProps<ContextualSearchStoryOption>>;
|
|
7
8
|
export declare const Single: Story;
|
|
8
9
|
export declare const Multiple: Story;
|
|
10
|
+
export declare const Loading: Story;
|
|
9
11
|
export declare const WithEntryAdd: Story;
|
|
10
|
-
export declare const WithLoading: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
2
|
+
import { ContextualSearchProps } from './ContextualSearch';
|
|
3
|
+
|
|
4
|
+
type ContextualSearchControlledProps<T extends FieldValues> = {
|
|
5
|
+
control: Control<T>;
|
|
6
|
+
name: Path<T>;
|
|
7
|
+
} & Omit<ContextualSearchProps<T>, 'value' | 'onChange'>;
|
|
8
|
+
export declare function ContextualSearchControlled<T extends FieldValues>(props: ContextualSearchControlledProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type ContextualSearchStoryOption = {
|
|
3
|
+
id: number;
|
|
4
|
+
label: string;
|
|
5
|
+
secondaryLabel: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function useLazyOptions(): {
|
|
8
|
+
options: ContextualSearchStoryOption[];
|
|
9
|
+
loading: boolean;
|
|
10
|
+
onLastOptionInView: () => Promise<void>;
|
|
11
|
+
onSearchTextChange: import('react').Dispatch<import('react').SetStateAction<string>>;
|
|
12
|
+
};
|
|
13
|
+
export declare function getOptions(): ContextualSearchStoryOption[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { ContextualSearch } from './ContextualSearch';
|
|
1
|
+
export { ContextualSearch, ContextualSearchControlled, } from './ContextualSearch';
|
|
3
2
|
export { DatePicker } from './DatePicker/DatePicker';
|
|
4
3
|
export { DateTimePicker } from './DateTimePicker/DateTimePicker';
|
|
5
4
|
export { Input } from './Input/Input';
|
package/dist/main.d.ts
CHANGED
|
@@ -23,3 +23,4 @@ export * from './helpers';
|
|
|
23
23
|
export { theme } from './theme/theme';
|
|
24
24
|
export { Accordion, AccordionDetails, styled, type Theme, ThemeProvider, Typography, useTheme, } from '@mui/material';
|
|
25
25
|
export { default as GemUIComponentsProvider } from './providers/GemUIComponentsProvider';
|
|
26
|
+
export * from '@mui/x-data-grid-pro';
|