dt-shared-front 2.2.34 → 2.2.36
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/components/auto-complete/auto-complete.d.ts +10 -4
- package/dist/components/auto-complete/auto-complete.stories.d.ts +17 -0
- package/dist/components/auto-complete/index.d.ts +1 -1
- package/dist/components/dropdown/dropdown.stories.d.ts +6 -0
- package/dist/components/input/input.d.ts +1 -1
- package/dist/components/input/input.stories.d.ts +9 -0
- package/dist/components/popover/index.d.ts +3 -0
- package/dist/components/popover/popover-tooltip.d.ts +20 -0
- package/dist/components/popover/popover-tooltip.utils.d.ts +12 -0
- package/dist/components/popover/popover.d.ts +26 -0
- package/dist/components/popover/popover.provider.d.ts +5 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/select-modal.d.ts +10 -0
- package/dist/components/select/select.d.ts +3 -1
- package/dist/components/select/select.stories.d.ts +6 -0
- package/dist/components/text-area/text-area.d.ts +1 -1
- package/dist/components/tooltip/tooltip.stories.d.ts +6 -0
- package/dist/components/tooltip/tooltip.utils.d.ts +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.css +35 -34
- package/dist/main.css.map +1 -1
- package/package.json +1 -1
@@ -5,8 +5,13 @@ export interface ISelectOption<T> {
|
|
5
5
|
value: string | number | null | undefined;
|
6
6
|
data?: T;
|
7
7
|
}
|
8
|
-
|
8
|
+
export interface ISelectOptionsGroup<T> {
|
9
|
+
label: string;
|
10
|
+
options: ISelectOption<T>[];
|
11
|
+
}
|
12
|
+
export interface IAutoCompleteProps<T> extends Omit<AutoCompleteProps, 'options' | 'onChange'> {
|
9
13
|
options?: T[] | T;
|
14
|
+
optionsGroup?: ISelectOptionsGroup<T>[];
|
10
15
|
labels?: {
|
11
16
|
[key: string]: string;
|
12
17
|
};
|
@@ -15,12 +20,13 @@ declare type IAutoCompleteProps<T> = Omit<AutoCompleteProps, 'options' | 'onChan
|
|
15
20
|
labelKey?: string;
|
16
21
|
labelPlaceholder?: string;
|
17
22
|
onServerSearch?: (val: string) => Promise<T[]>;
|
23
|
+
onServerSearchGroup?: (val: string) => Promise<ISelectOptionsGroup<T>[]>;
|
18
24
|
onRenderOption?: (item: T) => React.ReactNode;
|
25
|
+
onRenderOptionGroup?: (item: ISelectOptionsGroup<T>) => React.ReactNode;
|
19
26
|
onChange?: (option: T, options?: T[]) => void;
|
20
27
|
debounceTimeout?: number;
|
21
28
|
stacked?: boolean;
|
22
29
|
popupClassName?: string;
|
23
30
|
icon?: any;
|
24
|
-
}
|
25
|
-
export declare function AutoComplete<T>({ labels, labelKey, valueKey, onServerSearch, icon, debounceTimeout, labelPlaceholder, onRenderOption, popupClassName, ...props }: IAutoCompleteProps<T>): React.JSX.Element;
|
26
|
-
export {};
|
31
|
+
}
|
32
|
+
export declare function AutoComplete<T>({ labels, labelKey, valueKey, onServerSearch, icon, debounceTimeout, labelPlaceholder, onRenderOption, onRenderOptionGroup, onServerSearchGroup, popupClassName, optionsGroup: optionsGroupFromProps, ...props }: IAutoCompleteProps<T>): React.JSX.Element;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
2
|
+
import { AutoComplete } from './auto-complete';
|
3
|
+
declare const meta: Meta<typeof AutoComplete>;
|
4
|
+
declare type Option = {
|
5
|
+
label: string;
|
6
|
+
value: string;
|
7
|
+
data: {
|
8
|
+
meta: string;
|
9
|
+
};
|
10
|
+
};
|
11
|
+
export default meta;
|
12
|
+
declare type Story = StoryObj<typeof AutoComplete<Option>>;
|
13
|
+
export declare const Default: Story;
|
14
|
+
export declare const DefaultWithCustomOptions: Story;
|
15
|
+
export declare const DefaultWithOptionsGroup: Story;
|
16
|
+
export declare const DefaultWithCustomOptionsGroup: Story;
|
17
|
+
export declare const DefaultBorderless: Story;
|
@@ -1 +1 @@
|
|
1
|
-
export { AutoComplete } from './auto-complete';
|
1
|
+
export { AutoComplete, IAutoCompleteProps } from './auto-complete';
|
@@ -62,4 +62,4 @@ export declare const Input: React.ForwardRefExoticComponent<{
|
|
62
62
|
onPointerUp?: (e: any) => void;
|
63
63
|
onChange?: (value: string, event: ChangeEvent<HTMLInputElement>) => void;
|
64
64
|
onSearch?: ((val: string) => void) | ((val: string) => Promise<void>);
|
65
|
-
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
65
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "size" | "variant"> & React.RefAttributes<HTMLInputElement>>;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
2
|
+
import { Input } from './input';
|
3
|
+
declare const meta: Meta<typeof Input>;
|
4
|
+
export default meta;
|
5
|
+
declare type Story = StoryObj<typeof Input>;
|
6
|
+
export declare const Default: Story;
|
7
|
+
export declare const DefaultWithIcon: Story;
|
8
|
+
export declare const DefaultWithLoading: Story;
|
9
|
+
export declare const AllDefault: Story;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React, { ReactNode } from 'react';
|
2
|
+
import { TooltipPosition } from './popover-tooltip.utils';
|
3
|
+
export declare type IPopoverTootipRef = {
|
4
|
+
open?: (target: HTMLElement) => void;
|
5
|
+
close?: () => void;
|
6
|
+
};
|
7
|
+
declare type IPopoverTootipProps = {
|
8
|
+
content: ReactNode;
|
9
|
+
className?: string;
|
10
|
+
onOpenChange?: (val: boolean) => void;
|
11
|
+
placement?: keyof typeof TooltipPosition;
|
12
|
+
trigger?: any;
|
13
|
+
closeOutsideClick?: boolean;
|
14
|
+
closeOutsideScroll?: boolean;
|
15
|
+
showClose?: boolean;
|
16
|
+
};
|
17
|
+
export declare const PopoverTooltip: React.ForwardRefExoticComponent<IPopoverTootipProps & {
|
18
|
+
children?: React.ReactNode;
|
19
|
+
} & React.RefAttributes<IPopoverTootipRef>>;
|
20
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { CSSProperties } from 'react';
|
2
|
+
export declare enum TooltipPosition {
|
3
|
+
left = "left",
|
4
|
+
top = "top",
|
5
|
+
right = "right",
|
6
|
+
bottom = "bottom"
|
7
|
+
}
|
8
|
+
export declare const isCurrent: (e: Event, element: Element) => any;
|
9
|
+
export declare const findTargetElement: (element: Element) => Element;
|
10
|
+
export declare const getScrollTopParent: (element: HTMLElement) => HTMLElement | null;
|
11
|
+
export declare const recalcArrowStyles: (targetElement: Element, tooltipProperties: CSSProperties, position: TooltipPosition) => CSSProperties;
|
12
|
+
export declare const recalcStyles: (targetElement: Element, tooltipElement: HTMLDivElement, position: TooltipPosition) => CSSProperties;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React, { ElementType, MouseEvent, PropsWithRef } from 'react';
|
2
|
+
import { ComponentProps, MutableRefObject } from 'react';
|
3
|
+
export declare type PropsWithPopover<P, D = any> = P & {
|
4
|
+
data: D;
|
5
|
+
popover: IPopoverRef<D>;
|
6
|
+
};
|
7
|
+
export interface IPopoverRef<D = any> {
|
8
|
+
open: (e: MouseEvent, data?: D) => void;
|
9
|
+
close: () => void;
|
10
|
+
}
|
11
|
+
export declare type IPopoverProps<C extends ElementType> = {
|
12
|
+
[key in keyof ComponentProps<C>]?: ComponentProps<C>[key];
|
13
|
+
} & {
|
14
|
+
component?: C;
|
15
|
+
showClose?: boolean;
|
16
|
+
closeOutsideClick?: boolean;
|
17
|
+
closeOutsideScroll?: boolean;
|
18
|
+
};
|
19
|
+
export declare const Popover: <C extends React.ElementType<any, keyof React.JSX.IntrinsicElements>>(props: React.PropsWithRef<(React.ComponentProps<C> extends infer T ? { [key in keyof T]?: React.ComponentProps<C>[key]; } : never) & {
|
20
|
+
component?: C;
|
21
|
+
showClose?: boolean;
|
22
|
+
closeOutsideClick?: boolean;
|
23
|
+
closeOutsideScroll?: boolean;
|
24
|
+
} & {
|
25
|
+
ref?: MutableRefObject<IPopoverRef>;
|
26
|
+
}>) => React.JSX.Element;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import React, { ElementType } from 'react';
|
2
|
+
import { PropsWithChildren } from 'react';
|
3
|
+
import { IPopoverProps, IPopoverRef } from './popover';
|
4
|
+
export declare const PopoverProvider: ({ children }: PropsWithChildren<any>) => React.JSX.Element;
|
5
|
+
export declare function usePopover<C extends ElementType>(component: C, initialProps?: IPopoverProps<C>): React.RefObject<IPopoverRef<any>>;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { PropsWithModal } from '@shared/modal';
|
3
|
+
interface IContactsModalData {
|
4
|
+
title?: string;
|
5
|
+
filter: any;
|
6
|
+
items: any[];
|
7
|
+
onClick: (item: any, option: any) => void;
|
8
|
+
}
|
9
|
+
export declare const SelectModal: ({ modal, data }: PropsWithModal<{}, IContactsModalData>) => React.JSX.Element;
|
10
|
+
export {};
|
@@ -27,6 +27,8 @@ declare type ISelectProps<T> = Omit<SelectProps, 'options' | 'onChange'> & {
|
|
27
27
|
stacked?: boolean;
|
28
28
|
popupClassName?: string;
|
29
29
|
suffixIcon?: any;
|
30
|
+
isMobileModal?: boolean;
|
31
|
+
modalTitle?: string;
|
30
32
|
};
|
31
|
-
export declare function Select<T = any>({ debounceTimeout, onServerSearch, onServerSearchGroup, onRenderOption, valueKey, labelKey, labelPlaceholder, labels, popupClassName, suffixIcon, stacked, error, ...props }: ISelectProps<T>): React.JSX.Element;
|
33
|
+
export declare function Select<T = any>({ debounceTimeout, onServerSearch, onServerSearchGroup, onRenderOption, valueKey, labelKey, labelPlaceholder, labels, popupClassName, suffixIcon, stacked, error, isMobileModal, modalTitle, ...props }: ISelectProps<T>): React.JSX.Element;
|
32
34
|
export {};
|
@@ -26,4 +26,4 @@ export declare const TextArea: React.ForwardRefExoticComponent<{
|
|
26
26
|
onClear?: () => void;
|
27
27
|
onSearch?: (e: any) => void;
|
28
28
|
onChange?: (value: string, event?: ChangeEvent<HTMLTextAreaElement>) => void;
|
29
|
-
} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "
|
29
|
+
} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange" | "size" | "variant"> & React.RefAttributes<HTMLTextAreaElement>>;
|
package/dist/index.d.ts
CHANGED
@@ -48,3 +48,6 @@ export { ViewsCount } from './components/views-count';
|
|
48
48
|
export { Message } from './components/message';
|
49
49
|
export { WarningBlock } from './components/warning-block';
|
50
50
|
export { Steps } from './components/steps';
|
51
|
+
export { Popover, PopoverProvider, usePopover } from './components/popover';
|
52
|
+
export type { PropsWithPopover } from './components/popover';
|
53
|
+
export type { IPopoverRef } from './components/popover/popover';
|