@bothub-chat/ui 2.61.1-feat-generics-in-select-f2db91c7-24a4-49c5-bf91-1eb3c6ae1f10 → 2.61.1-fix-bugs-e66b2eca-3bb1-4291-9868-6043ab56adb6
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/README.md +23 -23
- package/dist/components/badge-select-dropdown/index.d.ts +8 -8
- package/dist/components/lang-switcher/index.d.ts +4 -4
- package/dist/components/lang-switcher/styled.d.ts +1 -1
- package/dist/components/select-field/index.d.ts +4 -4
- package/dist/components/select-field/nodes/value/index.d.ts +5 -5
- package/dist/components/select-field/select-modal/filterData.d.ts +2 -2
- package/dist/components/select-field/select-modal/index.d.ts +8 -8
- package/dist/components/select-field/select-modal/index.js +1 -1
- package/dist/components/select-field/select-modal/option/checkbox-group/index.d.ts +9 -9
- package/dist/components/select-field/select-modal/option/checkbox-group/index.js +1 -1
- package/dist/components/select-field/select-modal/option/collapse/index.d.ts +5 -5
- package/dist/components/select-field/select-modal/option/list/index.d.ts +2 -2
- package/dist/components/select-field/select-modal/option/select-field-option/index.d.ts +3 -3
- package/dist/components/select-field/select-modal/option/types.d.ts +8 -8
- package/dist/components/select-field/types.d.ts +15 -16
- package/dist/components/select-field/useSelectField.d.ts +17 -33
- package/dist/components/select-field/useSelectField.js +1 -1
- package/dist/components/switcher-select/index.js +1 -1
- package/dist/components/switcher-select/styled.d.ts +284 -4
- package/dist/components/switcher-select/styled.js +1 -1
- package/package.json +71 -71
package/README.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://bothub.chat/icon-144x144.png" />
|
|
3
|
-
</p>
|
|
4
|
-
<h1 align="center">Bothub Chat</h1>
|
|
5
|
-
<p align="center">UI Components from Bothub.</p>
|
|
6
|
-
<p align="center">
|
|
7
|
-
<a href="https://bothub-docs.vercel.app/">Documentation</a>
|
|
8
|
-
</p>
|
|
9
|
-
|
|
10
|
-
<h2>Installing</h2>
|
|
11
|
-
<p>Preliminary requirements:</p>
|
|
12
|
-
<ul>
|
|
13
|
-
<li><a href="https://nodejs.org/">Node.js</a> >= <code>18.12.1</code></li>
|
|
14
|
-
<li><a href="https://www.npmjs.com/">npm</a> >= <code>9.1.2</code></li>
|
|
15
|
-
<li><a href="https://yarnpkg.com/">yarn</a> >= <code>1.22.19</code></li>
|
|
16
|
-
</ul>
|
|
17
|
-
<p>Installing peer dependencies:</p>
|
|
18
|
-
<pre>yarn add framer-motion@10.16.3 react@18.2.0 react-dom@18.2.0 styled-components@6.0.7 react-helmet@6.1.0 normalize.css@8.0.1 react-slider@2.0.6 react-markdown@8.0.5 highlight.js@11.9.0 react-highlight@0.15.0</pre>
|
|
19
|
-
<p>Installing package:</p>
|
|
20
|
-
<pre>yarn add @bothub-chat/ui</pre>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<h2>License</h2>
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://bothub.chat/icon-144x144.png" />
|
|
3
|
+
</p>
|
|
4
|
+
<h1 align="center">Bothub Chat</h1>
|
|
5
|
+
<p align="center">UI Components from Bothub.</p>
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://bothub-docs.vercel.app/">Documentation</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<h2>Installing</h2>
|
|
11
|
+
<p>Preliminary requirements:</p>
|
|
12
|
+
<ul>
|
|
13
|
+
<li><a href="https://nodejs.org/">Node.js</a> >= <code>18.12.1</code></li>
|
|
14
|
+
<li><a href="https://www.npmjs.com/">npm</a> >= <code>9.1.2</code></li>
|
|
15
|
+
<li><a href="https://yarnpkg.com/">yarn</a> >= <code>1.22.19</code></li>
|
|
16
|
+
</ul>
|
|
17
|
+
<p>Installing peer dependencies:</p>
|
|
18
|
+
<pre>yarn add framer-motion@10.16.3 react@18.2.0 react-dom@18.2.0 styled-components@6.0.7 react-helmet@6.1.0 normalize.css@8.0.1 react-slider@2.0.6 react-markdown@8.0.5 highlight.js@11.9.0 react-highlight@0.15.0</pre>
|
|
19
|
+
<p>Installing package:</p>
|
|
20
|
+
<pre>yarn add @bothub-chat/ui</pre>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<h2>License</h2>
|
|
24
24
|
<p><a href="https://github.com/matbea-dev/bothub/blob/main/LICENSE">MIT</a></p>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SelectFieldChangeEventHandler,
|
|
1
|
+
import { SelectFieldChangeEventHandler, SelectFieldDataItem, SelectFieldSize, SelectFieldValueChangeEventHandler, UseSelectFieldProps } from '../select-field';
|
|
2
2
|
import { Variant } from './types';
|
|
3
|
-
export type BadgeSelectDropdownProps
|
|
4
|
-
options:
|
|
5
|
-
value?:
|
|
3
|
+
export type BadgeSelectDropdownProps = {
|
|
4
|
+
options: SelectFieldDataItem[];
|
|
5
|
+
value?: SelectFieldDataItem | null;
|
|
6
6
|
variant?: Variant;
|
|
7
7
|
colorButtonOpened?: string;
|
|
8
8
|
className?: string;
|
|
@@ -13,8 +13,8 @@ export type BadgeSelectDropdownProps<DataItem extends string | SelectFieldDataIt
|
|
|
13
13
|
contentWidth?: number;
|
|
14
14
|
searchPlaceholder?: string;
|
|
15
15
|
openedModel?: string;
|
|
16
|
-
onChange?: SelectFieldChangeEventHandler
|
|
17
|
-
onValueChange?: SelectFieldValueChangeEventHandler
|
|
18
|
-
} & Omit<UseSelectFieldProps
|
|
19
|
-
export declare const BadgeSelectDropdown: <
|
|
16
|
+
onChange?: SelectFieldChangeEventHandler;
|
|
17
|
+
onValueChange?: SelectFieldValueChangeEventHandler;
|
|
18
|
+
} & Omit<UseSelectFieldProps, 'onChange' | 'multiple' | 'onValueChange' | 'value'>;
|
|
19
|
+
export declare const BadgeSelectDropdown: import("react").MemoExoticComponent<({ options, value: initialValue, variant, colorButtonOpened, className, compactWidth, modalStyles, size, search, contentWidth, searchPlaceholder, openedModel, ...useSelectFieldProps }: BadgeSelectDropdownProps) => import("react/jsx-runtime").JSX.Element>;
|
|
20
20
|
export * from './styled';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SelectFieldDataItemComplex } from '../select-field';
|
|
2
|
-
export type LangSwitcherProps
|
|
2
|
+
export type LangSwitcherProps = {
|
|
3
3
|
region: {
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|
|
@@ -8,11 +8,11 @@ export type LangSwitcherProps<DataItem extends SelectFieldDataItemComplex<any>>
|
|
|
8
8
|
value: string;
|
|
9
9
|
label: string;
|
|
10
10
|
};
|
|
11
|
-
dataRegions:
|
|
12
|
-
dataLanguages:
|
|
11
|
+
dataRegions: SelectFieldDataItemComplex[];
|
|
12
|
+
dataLanguages: SelectFieldDataItemComplex[];
|
|
13
13
|
onChange: ({ lang, region }: {
|
|
14
14
|
lang: string;
|
|
15
15
|
region: string;
|
|
16
16
|
}) => void;
|
|
17
17
|
};
|
|
18
|
-
export declare const LangSwitcher: <
|
|
18
|
+
export declare const LangSwitcher: React.FC<LangSwitcherProps>;
|
|
@@ -1995,7 +1995,7 @@ export declare const LangSwitcherLabel: import("styled-components").IStyledCompo
|
|
|
1995
1995
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
1996
1996
|
ref?: import("react").Ref<HTMLSpanElement> | undefined;
|
|
1997
1997
|
}>;
|
|
1998
|
-
export declare const LangSwitcherInput: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("@/ui/components/select-field").SelectFieldProps
|
|
1998
|
+
export declare const LangSwitcherInput: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("@/ui/components/select-field").SelectFieldProps, import("styled-components/dist/types").BaseObject>>;
|
|
1999
1999
|
export declare const LangSwitcherButton: import("styled-components").IStyledComponent<"web", {
|
|
2000
2000
|
children?: import("react").ReactNode;
|
|
2001
2001
|
value?: string | number | readonly string[] | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SelectModalGeneralProps } from './select-modal';
|
|
2
|
-
import {
|
|
2
|
+
import { SelectFieldInputChangeEventHandler, SelectFieldInputType } from './types';
|
|
3
3
|
import { UseSelectFieldProps } from './useSelectField';
|
|
4
|
-
export type SelectFieldProps
|
|
4
|
+
export type SelectFieldProps = {
|
|
5
5
|
className?: string;
|
|
6
6
|
label?: string | boolean | React.ReactNode;
|
|
7
7
|
placeholder?: string;
|
|
@@ -17,8 +17,8 @@ export type SelectFieldProps<DataItem extends string | SelectFieldDataItemComple
|
|
|
17
17
|
dataTest?: string;
|
|
18
18
|
onInputChange?: SelectFieldInputChangeEventHandler;
|
|
19
19
|
onPointerLeave?: React.PointerEventHandler<HTMLDivElement>;
|
|
20
|
-
} & SelectModalGeneralProps
|
|
21
|
-
export declare const SelectField:
|
|
20
|
+
} & SelectModalGeneralProps & UseSelectFieldProps & React.PropsWithChildren;
|
|
21
|
+
export declare const SelectField: ({ className, label, placeholder, data, fullWidth, contentWidth, error, skeleton, blur, size, disableSelect, disableScrollbar, empty, after, loading, searchSampleIcon, enableInput, inputType, inputValue: initialInputValue, clearable, disablePortal, tabs, search, searchPlaceholder, resetStyleState, children, modalWidth, dataTest, selectedColor, compactWidth, modalStyles, openedModel, onSearch, onOptionClick, onGroupCheckboxClick, onInputChange, onPointerLeave, ...useSelectFieldProps }: SelectFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export * from './types';
|
|
23
23
|
export * from './styled';
|
|
24
24
|
export * from './context';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface SelectFieldInputValueProps
|
|
4
|
-
value: ValueType
|
|
5
|
-
handleValueDelete: (item:
|
|
2
|
+
import { SelectFieldDataItem, ValueType } from '../../types';
|
|
3
|
+
export interface SelectFieldInputValueProps {
|
|
4
|
+
value: ValueType;
|
|
5
|
+
handleValueDelete: (item: SelectFieldDataItem, event: React.MouseEvent) => unknown;
|
|
6
6
|
}
|
|
7
|
-
export declare const SelectFieldInputValue: <
|
|
7
|
+
export declare const SelectFieldInputValue: React.FC<SelectFieldInputValueProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const filterData:
|
|
1
|
+
import { SelectFieldData } from '../types';
|
|
2
|
+
export declare const filterData: (data: SelectFieldData, searchValue: string) => SelectFieldData;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ScrollableTabsProps } from '@/ui/components/scrollable-tabs';
|
|
3
3
|
import { UseSelectFieldReturnType } from '..';
|
|
4
|
-
import { ResetStyleStateType,
|
|
5
|
-
export type SelectModalGeneralProps
|
|
6
|
-
data?:
|
|
4
|
+
import { ResetStyleStateType, SelectFieldData, SelectFieldGroupCheckboxClickEventHandler, SelectFieldInputChangeEventHandler, SelectFieldOptionClickEventHandler, SelectFieldSize } from '../types';
|
|
5
|
+
export type SelectModalGeneralProps = {
|
|
6
|
+
data?: SelectFieldData;
|
|
7
7
|
contentWidth?: number;
|
|
8
8
|
contentHeight?: number | string;
|
|
9
9
|
size?: SelectFieldSize;
|
|
10
10
|
disableSelect?: boolean;
|
|
11
11
|
disableScrollbar?: boolean;
|
|
12
12
|
empty?: React.ReactNode;
|
|
13
|
-
after?:
|
|
13
|
+
after?: SelectFieldData;
|
|
14
14
|
tabs?: Omit<ScrollableTabsProps, 'variant' | 'component'>;
|
|
15
15
|
search?: boolean;
|
|
16
16
|
searchPlaceholder?: string;
|
|
@@ -23,10 +23,10 @@ export type SelectModalGeneralProps<DataItem extends string | SelectFieldDataIte
|
|
|
23
23
|
selectedColor?: string;
|
|
24
24
|
compactWidth?: boolean;
|
|
25
25
|
modalStyles?: React.CSSProperties;
|
|
26
|
-
onOptionClick?: SelectFieldOptionClickEventHandler
|
|
27
|
-
onGroupCheckboxClick?: SelectFieldGroupCheckboxClickEventHandler
|
|
26
|
+
onOptionClick?: SelectFieldOptionClickEventHandler;
|
|
27
|
+
onGroupCheckboxClick?: SelectFieldGroupCheckboxClickEventHandler;
|
|
28
28
|
};
|
|
29
|
-
export type SelectModalProps
|
|
30
|
-
export declare const SelectModal:
|
|
29
|
+
export type SelectModalProps = SelectModalGeneralProps & Omit<UseSelectFieldReturnType, 'disabled' | 'handleInputClick' | 'maxHeight' | 'triggerRef'>;
|
|
30
|
+
export declare const SelectModal: ({ isOpen, data: initialData, contentWidth, contentHeight, size, disableSelect, disableScrollbar, empty, after, tabs, search, searchPlaceholder, resetStyleState, placement, selectModalRef, disablePortal, blur, x, y, width, isKeyboardOpen, value, multiple, modalWidth, openedModel, selectedColor, compactWidth, modalStyles, onSearch, onOptionClick, onGroupCheckboxClick, handleClose, setValue, }: SelectModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
31
|
export * from './styled';
|
|
32
32
|
export * from './option';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i,jsxs as o}from"react/jsx-runtime";import s,{useState as n,useRef as e,useCallback as t,useEffect as r,useMemo as c}from"react";import{SelectModalStyled as d,SelectModalPositionWrapper as p,SelectModalContent as m,SelectModalGroups as x,SelectModalTabsContainer as j,SelectModalTabs as a,SelectModalSearch as l,SelectModalAfter as g}from"./styled.js";import"../../../icons/arrow-down/index.js";import"../../../icons/arrow-narrow-left/index.js";import"../../../icons/arrow-narrow-right/index.js";import"../../../icons/arrow-up/index.js";import"../../../icons/bitcoin/index.js";import"../../../icons/bot-circle/index.js";import"../../../icons/bothub-agg/index.js";import"../../../icons/business-colored/index.js";import"../../../icons/check-circle/index.js";import"../../../icons/close/index.js";import"../../../icons/email-circle/index.js";import"../../../icons/language/index.js";import"../../../icons/lock-circle/index.js";import"../../../icons/menu/index.js";import"../../../icons/medium-circle/index.js";import"../../../icons/tg-circle/index.js";import"../../../icons/tg-colored/index.js";import"../../../icons/youcassa/index.js";import"../../../icons/dashboard/index.js";import"../../../icons/user-profile/index.js";import"../../../icons/logout/index.js";import"tslib";import"../../../icons/habr-2/index.js";import"../../../icons/arrow-2-down/index.js";import"../../../icons/links/index.js";import"../../../icons/free/index.js";import"../../../icons/hotness/index.js";import"../../../icons/checked/index.js";import"../../../icons/ai/index.js";import"../../../icons/bookmarks/index.js";import"../../../icons/bookmarks-big/index.js";import"../../../icons/chat/index.js";import"../../../icons/chats/index.js";import"../../../icons/coder/index.js";import"../../../icons/copy/index.js";import"../../../icons/edit/index.js";import"../../../icons/presets-big/index.js";import"../../../icons/referal/index.js";import"../../../icons/restore/index.js";import"../../../icons/tariff/index.js";import"../../../icons/trash/index.js";import"../../../icons/update/index.js";import"../../../icons/menu-dot/index.js";import"../../../icons/plus-2/index.js";import"../../../icons/plus-1/index.js";import"../../../icons/send/index.js";import"../../../icons/settings/index.js";import"../../../icons/habr/index.js";import"../../../icons/check-small/index.js";import"../../../icons/stop/index.js";import"../../../icons/thumb-up/index.js";import"../../../icons/thumb-down/index.js";import"../../../icons/star/index.js";import"../../../icons/info-big/index.js";import"../../../icons/warning-big/index.js";import"../../../icons/error-big/index.js";import"../../../icons/success-big/index.js";import"../../../icons/mj/index.js";import"../../../icons/card/index.js";import"../../../icons/arrow-narrow-up/index.js";import"../../../icons/arrow-narrow-down/index.js";import"../../../icons/filters/index.js";import"../../../icons/info/index.js";import"../../../icons/search-circle/index.js";import"../../../icons/save/index.js";import"../../../icons/light/index.js";import"../../../icons/dark/index.js";import"../../../icons/email-colored/index.js";import"../../../icons/action-chat/index.js";import"../../../icons/attach/index.js";import"../../../icons/avatar-add/index.js";import"../../../icons/brush/index.js";import"../../../icons/calendar/index.js";import"../../../icons/claude/index.js";import"../../../icons/cookie/index.js";import"../../../icons/dalle/index.js";import"../../../icons/download-img/index.js";import"../../../icons/error/index.js";import"../../../icons/expand/index.js";import"../../../icons/eye/index.js";import"../../../icons/face/index.js";import"../../../icons/gear/index.js";import"../../../icons/gear-min/index.js";import"../../../icons/generation/index.js";import"../../../icons/gpt-3_5/index.js";import"../../../icons/gpt-4/index.js";import"../../../icons/imagine/index.js";import"../../../icons/imagine-2/index.js";import"../../../icons/loader/index.js";import"../../../icons/loader-circular/index.js";import"../../../icons/loader-circular-gradient/index.js";import"../../../icons/loader-circular-gradient-2/index.js";import"../../../icons/minus/index.js";import"../../../icons/mj-white/index.js";import"../../../icons/prompt/index.js";import"../../../icons/rabbit/index.js";import"../../../icons/ratio-1x1/index.js";import"../../../icons/ratio-2x3/index.js";import"../../../icons/ratio-3x2/index.js";import"../../../icons/ratio-4x5/index.js";import"../../../icons/ratio-4x7/index.js";import"../../../icons/ratio-5x4/index.js";import"../../../icons/ratio-7x4/index.js";import"../../../icons/ratio-16x9/index.js";import"../../../icons/ratio-9x16/index.js";import"../../../icons/ratio-21x9/index.js";import"../../../icons/ratio-9x21/index.js";import"../../../icons/refferal-min/index.js";import"../../../icons/search-data/index.js";import"../../../icons/square/index.js";import"../../../icons/turtle/index.js";import"../../../icons/upscale/index.js";import"../../../icons/withdraw/index.js";import"../../../icons/search-plus/index.js";import"../../../icons/lightning/index.js";import"../../../icons/blog-circle/index.js";import"../../../icons/stripe/index.js";import"../../../icons/corporate/index.js";import"../../../icons/public/index.js";import"../../../icons/private/index.js";import"../../../icons/mistral/index.js";import"../../../icons/gemini/index.js";import{SearchSimpleIcon as b}from"../../../icons/search-simple/index.js";import"../../../icons/sad-robot/index.js";import"../../../icons/model/index.js";import"../../../icons/phone-colored/index.js";import"../../../icons/questions/index.js";import"../../../icons/pdf-big/index.js";import"../../../icons/xls-big/index.js";import"../../../icons/word-big/index.js";import"../../../icons/txt-big/index.js";import"../../../icons/pdf/index.js";import"../../../icons/xls/index.js";import"../../../icons/word/index.js";import"../../../icons/txt/index.js";import"../../../icons/bothub-logo-gradient/index.js";import"../../../icons/telegram-logo-gradient/index.js";import"../../../icons/decline-circle/index.js";import"../../../icons/simple-gear-bg/index.js";import"../../../icons/advanced-filter/index.js";import"../../../icons/big-corporate/index.js";import"../../../icons/big-mj/index.js";import"../../../icons/big-models/index.js";import"../../../icons/big-stats/index.js";import"../../../icons/big-success/index.js";import"../../../icons/big-users/index.js";import"../../../icons/optional-presets/index.js";import"../../../icons/wallet-withdraw/index.js";import"../../../icons/big-presets/index.js";import"../../../icons/big-favorite/index.js";import"../../../icons/big-referal/index.js";import"../../../icons/attach-file/index.js";import"../../../icons/attach-file-big/index.js";import"../../../icons/voice/index.js";import"../../../icons/play-button/index.js";import"../../../icons/pause-button/index.js";import"../../../icons/text-read/index.js";import"../../../icons/text-hide/index.js";import"../../../icons/best-chat-bots/index.js";import"../../../icons/upload/index.js";import"../../../icons/enter/index.js";import"../../../icons/discord/index.js";import"../../../icons/discord-circle/index.js";import"../../../icons/black-forest-labs/index.js";import"../../../icons/flux/index.js";import"../../../icons/stable-diffusion/index.js";import"../../../icons/stability-ai/index.js";import"../../../icons/article-generator/index.js";import"../../../icons/success/index.js";import"../../../icons/google/index.js";import"../../../icons/yandex/index.js";import"../../../icons/vk/index.js";import"../../../icons/resend/index.js";import"../../../icons/big-article/index.js";import"../../../icons/add-chat/index.js";import"../../../icons/add-group/index.js";import"../../../icons/drag-dot/index.js";import"../../../icons/add-folder/index.js";import"../../../icons/temp-chat/index.js";import"../../../icons/delete-chat/index.js";import"../../../icons/sidebar-chat/index.js";import"../../../icons/organization/index.js";import"../../../icons/simple-gear/index.js";import"../../../icons/text-bold/index.js";import"../../../icons/text-italic/index.js";import"../../../icons/text-underline/index.js";import"../../../icons/text-strikethrough/index.js";import"../../../icons/refresh/index.js";import"../../../icons/copy-variants/index.js";import"../../../icons/sort-ascending/index.js";import"../../../icons/sort-descending/index.js";import"../../../icons/quote/index.js";import"../../../icons/url-circle/index.js";import"../../../icons/show-ui/index.js";import"../../../icons/hide-ui/index.js";import"../../../icons/sort-user/index.js";import"../../../icons/happy-robot/index.js";import"../../../icons/happy-robot-gradient/index.js";import"../../../icons/min-window/index.js";import"../../../icons/max-window/index.js";import"../../../icons/manage-chat/index.js";import"../../../icons/analyze-urls/index.js";import"../../../icons/web-search/index.js";import"../../../icons/include-context/index.js";import"../../../icons/queue/index.js";import"../../../icons/sort-alphabet-ascending/index.js";import"../../../icons/sort-alphabet-descending/index.js";import"../../../icons/sort-date-ascending/index.js";import"../../../icons/sort-date-descending/index.js";import"../../../icons/cot-r1/index.js";import"../../../icons/news/index.js";import"../../../icons/volume/index.js";import"../../../icons/flag-ru/index.js";import"../../../icons/flag-kz/index.js";import"../../../icons/print/index.js";import"../../../icons/pc-icon-1/index.js";import"../../../icons/pc-icon-2/index.js";import"../../../icons/pc-icon-3/index.js";import"../../../icons/star-unfilled/index.js";import"../../../icons/image-generation/index.js";import"../../../icons/speech-synthesys/index.js";import"../../../icons/transcription/index.js";import"../../../icons/text-rewrite/index.js";import"../../../icons/code-generation/index.js";import"../../../icons/essay-generation/index.js";import"../../../icons/spelling/index.js";import"../../../icons/text-generation/index.js";import"../../../icons/traffic-analisys/index.js";import"../../../icons/fav-profile/index.js";import"../../../icons/exclamation/index.js";import"../../../icons/article/index.js";import"../../../icons/setchel/index.js";import"../../../icons/assembly/index.js";import"../../../icons/data-visualisation/index.js";import"../../../icons/document-analisys/index.js";import"../../../icons/problem-solvment/index.js";import"../../../icons/setting-analisys/index.js";import"../../../icons/translation/index.js";import"../../../icons/stars/index.js";import"../../../icons/academy/index.js";import"../../../icons/articles/index.js";import"../../../icons/blog-post/index.js";import"../../../icons/book/index.js";import"../../../icons/bow-tie/index.js";import"../../../icons/case-study/index.js";import"../../../icons/comments/index.js";import"../../../icons/guide/index.js";import"../../../icons/marketing/index.js";import"../../../icons/post/index.js";import"../../../icons/report/index.js";import"../../../icons/review/index.js";import"../../../icons/scientific-article/index.js";import"../../../icons/selling-text/index.js";import"../../../icons/textbook/index.js";import"../../../icons/wind/index.js";import"../../../icons/grok/index.js";import"../../../icons/deepseek/index.js";import"../../../icons/grid-horizontal/index.js";import"../../../icons/grid-vertical/index.js";import"../../../icons/star-gradient/index.js";import"../../../icons/qwen/index.js";import"../../../icons/sidebar-toggle-left/index.js";import"../../../icons/sidebar-toggle-right/index.js";import"../../../icons/system/index.js";import"../../../icons/selector/index.js";import"../../../icons/video-camera/index.js";import"../../../icons/music-note/index.js";import"../../../icons/add-profile/index.js";import"../../../icons/token-counter/index.js";import"../../../icons/customer-support/index.js";import"../../../icons/sort-alphabet-top-bottom/index.js";import"../../../icons/sort-alphabet-bottom-top/index.js";import"../../../icons/pause/index.js";import"../../../icons/play/index.js";import"../../../icons/restore-2/index.js";import"../../../icons/video-generation/index.js";import"../../../icons/veo-model/index.js";import"../../../icons/runway/index.js";import"../../../icons/queue-select/index.js";import"../../../icons/apple/index.js";import"../../../icons/mail-colored/index.js";import"../../../icons/shield/index.js";import"../../../icons/stars-gradient/index.js";import"../../../icons/fire/index.js";import"../../../icons/brain/index.js";import"../../../icons/mj-purple/index.js";import"../../../icons/claude-black/index.js";import"../../../icons/vk-filled/index.js";import"../../../icons/tg/index.js";import"../../../icons/gift/index.js";import"../../../icons/exchange/index.js";import"../../../icons/time/index.js";import"../../../icons/folder/index.js";import"../../../icons/history/index.js";import"../../../icons/money-plus/index.js";import"../../../icons/money-stack/index.js";import"../../../icons/sort-numeric-bottom/index.js";import"../../../icons/sort-numeric-top/index.js";import"../../../icons/bulb/index.js";import"../../../icons/prompt-queue/index.js";import"../../../icons/image/index.js";import"../../../icons/text/index.js";import"../../../icons/code/index.js";import"../../../icons/blue-grok/index.js";import"../../../icons/double-image/index.js";import{Portal as u}from"../../portal/index.js";import{SelectFieldGroup as h}from"./select-field-group/index.js";import{SelectFieldOptions as f}from"./option/list/index.js";import"./option/collapse/styled.js";import"../../icon/styled.js";import"@react-spring/web";import"react-markdown";import"../../tooltip/styled.js";import"../../tooltip/arrow/styled.js";import"../../../theme/index.js";import"../../tooltip/context.js";import{filterData as y}from"./filterData.js";const w=({isOpen:w,data:k=[],contentWidth:v,contentHeight:C,size:O="small",disableSelect:$=!1,disableScrollbar:S=!1,empty:z,after:q,tabs:W,search:T,searchPlaceholder:P,resetStyleState:A,placement:G,selectModalRef:H,disablePortal:M,blur:B=!1,x:D,y:F,width:I,isKeyboardOpen:K,value:R,multiple:V,modalWidth:_,openedModel:E,selectedColor:J,compactWidth:L,modalStyles:N,onSearch:Q,onOptionClick:U,onGroupCheckboxClick:X,handleClose:Y,setValue:Z})=>{const[ii,oi]=n([]),[si,ni]=n(""),ei=e(0),ti=t(i=>{const{value:o}=i.currentTarget;null==Q||Q(o),ni(o)},[Q,ni]),ri=t(i=>{var o;if("object"!=typeof i||!i.disabled){if("object"==typeof i&&i.noSelect)return null===(o=null==i?void 0:i.onClick)||void 0===o||o.call(i,i),void Y();null==U||U(i),$||"object"==typeof i&&("checkbox"===i.type||"checkbox-group"===i.type)||(V&&Array.isArray(R)?Z([...new Set([...R,i])]):Z(i)),("object"!=typeof i||"checkbox"!==i.type&&"checkbox-group"!==i.type)&&Y()}},[R,V,$,Z,U,Y]);r(()=>{oi(E?[E]:[]),ei.current=0,ni("")},[A,E]);const ci=t(i=>{ei.current=0,oi([]),W&&W.onClick&&W.onClick(i)},[W]),di=t(i=>oi(o=>o.includes(i)?o.filter(o=>o!==i):[...o,i]),[]),pi=c(()=>M?s.Fragment:u,[M]),mi=c(()=>k.map(i=>{if(i&&"object"==typeof i&&"collapse"===i.type&&i.id&&!i.disabled){const o=()=>{i.onClick&&i.onClick(i),i.id&&di(i.id)},s=ii.includes(i.id);return Object.assign(Object.assign({},i),{open:s,onClick:o})}return i}),[k,ii,di]);return i(pi,{children:i(d,{$isOpen:w,$contentWidth:v,$disablePortal:M,$placement:G,ref:H,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},N),0!==D&&Object.assign(Object.assign({},"top-right"!==G&&{left:D}),"top-right"===G&&Object.assign(Object.assign({},void 0===v&&{left:`calc(${D}px - ${I})`}),"number"==typeof v&&{left:`calc(${D}px - ${v>I?`calc(var(--bothub-scale, 1) * ${v}px)`:`${I}px`})`}))),0!==F&&{top:F}),void 0===v&&{width:I}),"number"==typeof v&&{width:v>I?`calc(var(--bothub-scale, 1) * ${v}px)`:I}),children:i(p,{$blur:B,$placement:G,$width:_,$compactWidth:L,style:Object.assign(Object.assign({},"number"==typeof C&&C>=0&&{height:`calc(var(--bothub-scale, 1) * ${C}px)`}),"string"==typeof C&&{height:C}),children:i(m,{children:o(x,{$size:O,children:[!!W&&i(j,{children:i(a,Object.assign({},W,{onClick:ci}))}),T&&i(l,{startIcon:i(b,{}),placeholder:P,value:si,onChange:ti,onClick:()=>{K.current=!0},onBlur:()=>setTimeout(()=>{K.current=!1},500)}),mi.length>0?i(h,{scrollTop:ei.current,onScrollTopChange:i=>{ei.current=i},$size:O,$disableScrollbar:S,$followContentHeight:!!C,children:i(f,{value:R,data:Q?mi:y(mi,si),size:O,disableSelect:$,onGroupCheckboxClick:X,onOptionClick:ri,selectedColor:J})}):z,q&&i(g,{children:i(f,{value:R,data:q,size:O,disableSelect:$,onOptionClick:ri,selectedColor:J})})]})})})})})};export{f as SelectFieldOptions,w as SelectModal,g as SelectModalAfter,m as SelectModalContent,x as SelectModalGroups,p as SelectModalPositionWrapper,l as SelectModalSearch,d as SelectModalStyled,a as SelectModalTabs,j as SelectModalTabsContainer};
|
|
1
|
+
import{__rest as i}from"tslib";import{jsx as o,jsxs as s}from"react/jsx-runtime";import n,{useState as e,useRef as t,useCallback as r,useEffect as c,useMemo as d}from"react";import{SelectModalStyled as p,SelectModalPositionWrapper as m,SelectModalContent as x,SelectModalGroups as j,SelectModalTabsContainer as a,SelectModalTabs as l,SelectModalSearch as g,SelectModalAfter as b}from"./styled.js";import"../../../icons/arrow-down/index.js";import"../../../icons/arrow-narrow-left/index.js";import"../../../icons/arrow-narrow-right/index.js";import"../../../icons/arrow-up/index.js";import"../../../icons/bitcoin/index.js";import"../../../icons/bot-circle/index.js";import"../../../icons/bothub-agg/index.js";import"../../../icons/business-colored/index.js";import"../../../icons/check-circle/index.js";import"../../../icons/close/index.js";import"../../../icons/email-circle/index.js";import"../../../icons/language/index.js";import"../../../icons/lock-circle/index.js";import"../../../icons/menu/index.js";import"../../../icons/medium-circle/index.js";import"../../../icons/tg-circle/index.js";import"../../../icons/tg-colored/index.js";import"../../../icons/youcassa/index.js";import"../../../icons/dashboard/index.js";import"../../../icons/user-profile/index.js";import"../../../icons/logout/index.js";import"../../../icons/habr-2/index.js";import"../../../icons/arrow-2-down/index.js";import"../../../icons/links/index.js";import"../../../icons/free/index.js";import"../../../icons/hotness/index.js";import"../../../icons/checked/index.js";import"../../../icons/ai/index.js";import"../../../icons/bookmarks/index.js";import"../../../icons/bookmarks-big/index.js";import"../../../icons/chat/index.js";import"../../../icons/chats/index.js";import"../../../icons/coder/index.js";import"../../../icons/copy/index.js";import"../../../icons/edit/index.js";import"../../../icons/presets-big/index.js";import"../../../icons/referal/index.js";import"../../../icons/restore/index.js";import"../../../icons/tariff/index.js";import"../../../icons/trash/index.js";import"../../../icons/update/index.js";import"../../../icons/menu-dot/index.js";import"../../../icons/plus-2/index.js";import"../../../icons/plus-1/index.js";import"../../../icons/send/index.js";import"../../../icons/settings/index.js";import"../../../icons/habr/index.js";import"../../../icons/check-small/index.js";import"../../../icons/stop/index.js";import"../../../icons/thumb-up/index.js";import"../../../icons/thumb-down/index.js";import"../../../icons/star/index.js";import"../../../icons/info-big/index.js";import"../../../icons/warning-big/index.js";import"../../../icons/error-big/index.js";import"../../../icons/success-big/index.js";import"../../../icons/mj/index.js";import"../../../icons/card/index.js";import"../../../icons/arrow-narrow-up/index.js";import"../../../icons/arrow-narrow-down/index.js";import"../../../icons/filters/index.js";import"../../../icons/info/index.js";import"../../../icons/search-circle/index.js";import"../../../icons/save/index.js";import"../../../icons/light/index.js";import"../../../icons/dark/index.js";import"../../../icons/email-colored/index.js";import"../../../icons/action-chat/index.js";import"../../../icons/attach/index.js";import"../../../icons/avatar-add/index.js";import"../../../icons/brush/index.js";import"../../../icons/calendar/index.js";import"../../../icons/claude/index.js";import"../../../icons/cookie/index.js";import"../../../icons/dalle/index.js";import"../../../icons/download-img/index.js";import"../../../icons/error/index.js";import"../../../icons/expand/index.js";import"../../../icons/eye/index.js";import"../../../icons/face/index.js";import"../../../icons/gear/index.js";import"../../../icons/gear-min/index.js";import"../../../icons/generation/index.js";import"../../../icons/gpt-3_5/index.js";import"../../../icons/gpt-4/index.js";import"../../../icons/imagine/index.js";import"../../../icons/imagine-2/index.js";import"../../../icons/loader/index.js";import"../../../icons/loader-circular/index.js";import"../../../icons/loader-circular-gradient/index.js";import"../../../icons/loader-circular-gradient-2/index.js";import"../../../icons/minus/index.js";import"../../../icons/mj-white/index.js";import"../../../icons/prompt/index.js";import"../../../icons/rabbit/index.js";import"../../../icons/ratio-1x1/index.js";import"../../../icons/ratio-2x3/index.js";import"../../../icons/ratio-3x2/index.js";import"../../../icons/ratio-4x5/index.js";import"../../../icons/ratio-4x7/index.js";import"../../../icons/ratio-5x4/index.js";import"../../../icons/ratio-7x4/index.js";import"../../../icons/ratio-16x9/index.js";import"../../../icons/ratio-9x16/index.js";import"../../../icons/ratio-21x9/index.js";import"../../../icons/ratio-9x21/index.js";import"../../../icons/refferal-min/index.js";import"../../../icons/search-data/index.js";import"../../../icons/square/index.js";import"../../../icons/turtle/index.js";import"../../../icons/upscale/index.js";import"../../../icons/withdraw/index.js";import"../../../icons/search-plus/index.js";import"../../../icons/lightning/index.js";import"../../../icons/blog-circle/index.js";import"../../../icons/stripe/index.js";import"../../../icons/corporate/index.js";import"../../../icons/public/index.js";import"../../../icons/private/index.js";import"../../../icons/mistral/index.js";import"../../../icons/gemini/index.js";import{SearchSimpleIcon as u}from"../../../icons/search-simple/index.js";import"../../../icons/sad-robot/index.js";import"../../../icons/model/index.js";import"../../../icons/phone-colored/index.js";import"../../../icons/questions/index.js";import"../../../icons/pdf-big/index.js";import"../../../icons/xls-big/index.js";import"../../../icons/word-big/index.js";import"../../../icons/txt-big/index.js";import"../../../icons/pdf/index.js";import"../../../icons/xls/index.js";import"../../../icons/word/index.js";import"../../../icons/txt/index.js";import"../../../icons/bothub-logo-gradient/index.js";import"../../../icons/telegram-logo-gradient/index.js";import"../../../icons/decline-circle/index.js";import"../../../icons/simple-gear-bg/index.js";import"../../../icons/advanced-filter/index.js";import"../../../icons/big-corporate/index.js";import"../../../icons/big-mj/index.js";import"../../../icons/big-models/index.js";import"../../../icons/big-stats/index.js";import"../../../icons/big-success/index.js";import"../../../icons/big-users/index.js";import"../../../icons/optional-presets/index.js";import"../../../icons/wallet-withdraw/index.js";import"../../../icons/big-presets/index.js";import"../../../icons/big-favorite/index.js";import"../../../icons/big-referal/index.js";import"../../../icons/attach-file/index.js";import"../../../icons/attach-file-big/index.js";import"../../../icons/voice/index.js";import"../../../icons/play-button/index.js";import"../../../icons/pause-button/index.js";import"../../../icons/text-read/index.js";import"../../../icons/text-hide/index.js";import"../../../icons/best-chat-bots/index.js";import"../../../icons/upload/index.js";import"../../../icons/enter/index.js";import"../../../icons/discord/index.js";import"../../../icons/discord-circle/index.js";import"../../../icons/black-forest-labs/index.js";import"../../../icons/flux/index.js";import"../../../icons/stable-diffusion/index.js";import"../../../icons/stability-ai/index.js";import"../../../icons/article-generator/index.js";import"../../../icons/success/index.js";import"../../../icons/google/index.js";import"../../../icons/yandex/index.js";import"../../../icons/vk/index.js";import"../../../icons/resend/index.js";import"../../../icons/big-article/index.js";import"../../../icons/add-chat/index.js";import"../../../icons/add-group/index.js";import"../../../icons/drag-dot/index.js";import"../../../icons/add-folder/index.js";import"../../../icons/temp-chat/index.js";import"../../../icons/delete-chat/index.js";import"../../../icons/sidebar-chat/index.js";import"../../../icons/organization/index.js";import"../../../icons/simple-gear/index.js";import"../../../icons/text-bold/index.js";import"../../../icons/text-italic/index.js";import"../../../icons/text-underline/index.js";import"../../../icons/text-strikethrough/index.js";import"../../../icons/refresh/index.js";import"../../../icons/copy-variants/index.js";import"../../../icons/sort-ascending/index.js";import"../../../icons/sort-descending/index.js";import"../../../icons/quote/index.js";import"../../../icons/url-circle/index.js";import"../../../icons/show-ui/index.js";import"../../../icons/hide-ui/index.js";import"../../../icons/sort-user/index.js";import"../../../icons/happy-robot/index.js";import"../../../icons/happy-robot-gradient/index.js";import"../../../icons/min-window/index.js";import"../../../icons/max-window/index.js";import"../../../icons/manage-chat/index.js";import"../../../icons/analyze-urls/index.js";import"../../../icons/web-search/index.js";import"../../../icons/include-context/index.js";import"../../../icons/queue/index.js";import"../../../icons/sort-alphabet-ascending/index.js";import"../../../icons/sort-alphabet-descending/index.js";import"../../../icons/sort-date-ascending/index.js";import"../../../icons/sort-date-descending/index.js";import"../../../icons/cot-r1/index.js";import"../../../icons/news/index.js";import"../../../icons/volume/index.js";import"../../../icons/flag-ru/index.js";import"../../../icons/flag-kz/index.js";import"../../../icons/print/index.js";import"../../../icons/pc-icon-1/index.js";import"../../../icons/pc-icon-2/index.js";import"../../../icons/pc-icon-3/index.js";import"../../../icons/star-unfilled/index.js";import"../../../icons/image-generation/index.js";import"../../../icons/speech-synthesys/index.js";import"../../../icons/transcription/index.js";import"../../../icons/text-rewrite/index.js";import"../../../icons/code-generation/index.js";import"../../../icons/essay-generation/index.js";import"../../../icons/spelling/index.js";import"../../../icons/text-generation/index.js";import"../../../icons/traffic-analisys/index.js";import"../../../icons/fav-profile/index.js";import"../../../icons/exclamation/index.js";import"../../../icons/article/index.js";import"../../../icons/setchel/index.js";import"../../../icons/assembly/index.js";import"../../../icons/data-visualisation/index.js";import"../../../icons/document-analisys/index.js";import"../../../icons/problem-solvment/index.js";import"../../../icons/setting-analisys/index.js";import"../../../icons/translation/index.js";import"../../../icons/stars/index.js";import"../../../icons/academy/index.js";import"../../../icons/articles/index.js";import"../../../icons/blog-post/index.js";import"../../../icons/book/index.js";import"../../../icons/bow-tie/index.js";import"../../../icons/case-study/index.js";import"../../../icons/comments/index.js";import"../../../icons/guide/index.js";import"../../../icons/marketing/index.js";import"../../../icons/post/index.js";import"../../../icons/report/index.js";import"../../../icons/review/index.js";import"../../../icons/scientific-article/index.js";import"../../../icons/selling-text/index.js";import"../../../icons/textbook/index.js";import"../../../icons/wind/index.js";import"../../../icons/grok/index.js";import"../../../icons/deepseek/index.js";import"../../../icons/grid-horizontal/index.js";import"../../../icons/grid-vertical/index.js";import"../../../icons/star-gradient/index.js";import"../../../icons/qwen/index.js";import"../../../icons/sidebar-toggle-left/index.js";import"../../../icons/sidebar-toggle-right/index.js";import"../../../icons/system/index.js";import"../../../icons/selector/index.js";import"../../../icons/video-camera/index.js";import"../../../icons/music-note/index.js";import"../../../icons/add-profile/index.js";import"../../../icons/token-counter/index.js";import"../../../icons/customer-support/index.js";import"../../../icons/sort-alphabet-top-bottom/index.js";import"../../../icons/sort-alphabet-bottom-top/index.js";import"../../../icons/pause/index.js";import"../../../icons/play/index.js";import"../../../icons/restore-2/index.js";import"../../../icons/video-generation/index.js";import"../../../icons/veo-model/index.js";import"../../../icons/runway/index.js";import"../../../icons/queue-select/index.js";import"../../../icons/apple/index.js";import"../../../icons/mail-colored/index.js";import"../../../icons/shield/index.js";import"../../../icons/stars-gradient/index.js";import"../../../icons/fire/index.js";import"../../../icons/brain/index.js";import"../../../icons/mj-purple/index.js";import"../../../icons/claude-black/index.js";import"../../../icons/vk-filled/index.js";import"../../../icons/tg/index.js";import"../../../icons/gift/index.js";import"../../../icons/exchange/index.js";import"../../../icons/time/index.js";import"../../../icons/folder/index.js";import"../../../icons/history/index.js";import"../../../icons/money-plus/index.js";import"../../../icons/money-stack/index.js";import"../../../icons/sort-numeric-bottom/index.js";import"../../../icons/sort-numeric-top/index.js";import"../../../icons/bulb/index.js";import"../../../icons/prompt-queue/index.js";import"../../../icons/image/index.js";import"../../../icons/text/index.js";import"../../../icons/code/index.js";import"../../../icons/blue-grok/index.js";import"../../../icons/double-image/index.js";import{Portal as h}from"../../portal/index.js";import{SelectFieldGroup as f}from"./select-field-group/index.js";import{SelectFieldOptions as y}from"./option/list/index.js";import"./option/collapse/styled.js";import"../../icon/styled.js";import"@react-spring/web";import"react-markdown";import"../../tooltip/styled.js";import"../../tooltip/arrow/styled.js";import"../../../theme/index.js";import"../../tooltip/context.js";import{filterData as w}from"./filterData.js";const k=({isOpen:k,data:v=[],contentWidth:C,contentHeight:O,size:$="small",disableSelect:S=!1,disableScrollbar:z=!1,empty:q,after:W,tabs:T,search:P,searchPlaceholder:A,resetStyleState:G,placement:H,selectModalRef:M,disablePortal:B,blur:D=!1,x:F,y:I,width:K,isKeyboardOpen:R,value:V,multiple:_,modalWidth:E,openedModel:J,selectedColor:L,compactWidth:N,modalStyles:Q,onSearch:U,onOptionClick:X,onGroupCheckboxClick:Y,handleClose:Z,setValue:ii})=>{const[oi,si]=e([]),[ni,ei]=e(""),ti=t(0),ri=r(i=>{const{value:o}=i.currentTarget;null==U||U(o),ei(o)},[U,ei]),ci=r(i=>{var o;if("object"!=typeof i||!i.disabled){if("object"==typeof i&&i.noSelect)return null===(o=null==i?void 0:i.onClick)||void 0===o||o.call(i,i),void Z();null==X||X(i),S||"object"==typeof i&&("checkbox"===i.type||"checkbox-group"===i.type)||(_&&Array.isArray(V)?ii([...new Set([...V,i])]):ii(i)),("object"!=typeof i||"checkbox"!==i.type&&"checkbox-group"!==i.type)&&Z()}},[V,_,S,ii,X,Z]);c(()=>{si(J?[J]:[]),ti.current=0,ei("")},[G,J]);const di=r(i=>{ti.current=0,si([]),T&&T.onClick&&T.onClick(i)},[T]),pi=r(i=>si(o=>o.includes(i)?o.filter(o=>o!==i):[...o,i]),[]),mi=d(()=>B?n.Fragment:h,[B]),xi=d(()=>v.map(o=>{if(o&&"object"==typeof o&&"collapse"===o.type&&o.id&&!o.disabled){const{onClick:s}=o,n=i(o,["onClick"]),e=()=>{s&&s(o),o.id&&pi(o.id)},t=oi.includes(o.id);return Object.assign(Object.assign({},n),{open:t,onClick:e})}return o}),[v,oi,pi]);return o(mi,{children:o(p,{$isOpen:k,$contentWidth:C,$disablePortal:B,$placement:H,ref:M,style:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Q),0!==F&&Object.assign(Object.assign({},"top-right"!==H&&{left:F}),"top-right"===H&&Object.assign(Object.assign({},void 0===C&&{left:`calc(${F}px - ${K})`}),"number"==typeof C&&{left:`calc(${F}px - ${C>K?`calc(var(--bothub-scale, 1) * ${C}px)`:`${K}px`})`}))),0!==I&&{top:I}),void 0===C&&{width:K}),"number"==typeof C&&{width:C>K?`calc(var(--bothub-scale, 1) * ${C}px)`:K}),children:o(m,{$blur:D,$placement:H,$width:E,$compactWidth:N,style:Object.assign(Object.assign({},"number"==typeof O&&O>=0&&{height:`calc(var(--bothub-scale, 1) * ${O}px)`}),"string"==typeof O&&{height:O}),children:o(x,{children:s(j,{$size:$,children:[!!T&&o(a,{children:o(l,Object.assign({},T,{onClick:di}))}),P&&o(g,{startIcon:o(u,{}),placeholder:A,value:ni,onChange:ri,onClick:()=>{R.current=!0},onBlur:()=>setTimeout(()=>{R.current=!1},500)}),xi.length>0?o(f,{scrollTop:ti.current,onScrollTopChange:i=>{ti.current=i},$size:$,$disableScrollbar:z,$followContentHeight:!!O,children:o(y,{value:V,data:U?xi:w(xi,ni),size:$,disableSelect:S,onGroupCheckboxClick:Y,onOptionClick:ci,selectedColor:L})}):q,W&&o(b,{children:o(y,{value:V,data:W,size:$,disableSelect:S,onOptionClick:ci,selectedColor:L})})]})})})})})};export{y as SelectFieldOptions,k as SelectModal,b as SelectModalAfter,x as SelectModalContent,j as SelectModalGroups,m as SelectModalPositionWrapper,g as SelectModalSearch,p as SelectModalStyled,l as SelectModalTabs,a as SelectModalTabsContainer};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SelectFieldDataItem, SelectFieldGroupCheckboxClickEventHandler, SelectFieldSize } from '@/ui/components/select-field';
|
|
3
3
|
import { SelectFieldOptionClickEventHandler, SelectFieldOptionsProps } from '../types';
|
|
4
|
-
export type SelectFieldCheckboxGroupOptionProps
|
|
5
|
-
value:
|
|
4
|
+
export type SelectFieldCheckboxGroupOptionProps = {
|
|
5
|
+
value: SelectFieldDataItem | SelectFieldDataItem[] | null;
|
|
6
6
|
size: SelectFieldSize;
|
|
7
|
-
item:
|
|
8
|
-
data:
|
|
9
|
-
onGroupCheckboxClick?: SelectFieldGroupCheckboxClickEventHandler
|
|
10
|
-
onOptionClick: SelectFieldOptionClickEventHandler
|
|
7
|
+
item: SelectFieldDataItem;
|
|
8
|
+
data: SelectFieldDataItem[];
|
|
9
|
+
onGroupCheckboxClick?: SelectFieldGroupCheckboxClickEventHandler;
|
|
10
|
+
onOptionClick: SelectFieldOptionClickEventHandler | undefined;
|
|
11
11
|
icon?: React.ReactNode;
|
|
12
|
-
SelectFieldOptions: React.FC<SelectFieldOptionsProps
|
|
12
|
+
SelectFieldOptions: React.FC<SelectFieldOptionsProps>;
|
|
13
13
|
};
|
|
14
|
-
export declare const SelectFieldCheckboxGroupOption:
|
|
14
|
+
export declare const SelectFieldCheckboxGroupOption: ({ item, value, size, data, onOptionClick, onGroupCheckboxClick, icon, SelectFieldOptions, }: SelectFieldCheckboxGroupOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as i}from"react";import"tslib";import{IconProvider as n}from"../../../../icon/context.js";import"../../../../icon/styled.js";import"@react-spring/web";import"react-markdown";import"react-dom";import"../../../../portal/styled.js";import"../../../../tooltip/styled.js";import"../../../../tooltip/arrow/styled.js";import"../../../../../theme/index.js";import"../../../../tooltip/context.js";import{Checkbox as r}from"../../../../checkbox/index.js";import{SelectFieldCheckboxGroupOptionStyled as l,SelectFieldCheckboxGroupOptionHead as c,SelectFieldCheckboxGroupOptionHeadLeftSide as s,SelectFieldCheckboxGroupOptionHeadTextWrapper as d,SelectFieldCheckboxGroupOptionHeadText as p,SelectFieldCheckboxGroupOptionHeadCounter as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as o,useLayoutEffect as i}from"react";import"tslib";import{IconProvider as n}from"../../../../icon/context.js";import"../../../../icon/styled.js";import"@react-spring/web";import"react-markdown";import"react-dom";import"../../../../portal/styled.js";import"../../../../tooltip/styled.js";import"../../../../tooltip/arrow/styled.js";import"../../../../../theme/index.js";import"../../../../tooltip/context.js";import{Checkbox as r}from"../../../../checkbox/index.js";import{SelectFieldCheckboxGroupOptionStyled as l,SelectFieldCheckboxGroupOptionHead as c,SelectFieldCheckboxGroupOptionHeadLeftSide as s,SelectFieldCheckboxGroupOptionHeadTextWrapper as d,SelectFieldCheckboxGroupOptionHeadText as p,SelectFieldCheckboxGroupOptionHeadCounter as a,SelectFieldCheckboxGroupOptionHeadRightSide as m,SelectFieldCheckboxGroupOptionArrow as h,SelectFieldCheckboxGroupOptionContent as f,ShowMoreButton as g}from"./styled.js";import{useTheme as y}from"../../../../../theme/hook.js";const u=({item:u,value:k,size:j,data:b,onOptionClick:v,onGroupCheckboxClick:x,icon:C,SelectFieldOptions:w})=>{var z,O;const I=y(),[F,Z]=o(!1),[$,B]=o("string"!=typeof u&&(null!==(z=u.open)&&void 0!==z&&z));let D;D="string"!=typeof u&&!!u.disabled;const G="string"!=typeof u?u.open:void 0;i(()=>{"string"!=typeof u&&B(Boolean(u.open))},[G]);const P="string"==typeof u?u:null!==(O=u.label)&&void 0!==O?O:u.value,S=b.length>5,q=F?b:b.slice(0,5),A=()=>{if(!b||0===b.length)return null;const e=b.filter(e=>"string"!=typeof e),t=e.filter(e=>"selected"in e&&!0===e.selected).length,o=e.length;return 0===t?null:t===o&&o>0?"все":t},E="string"!=typeof u&&"selected"in u&&u.selected,H="string"!=typeof u&&"checkedIcon"in u&&u.checkedIcon;return e(l,{children:[e(c,Object.assign({$disabled:D},!D&&{onClick:()=>{B(e=>!e)}},{children:[e(s,{children:["object"==typeof u&&u.icon&&t(n,{size:16,fill:I.colors.base.white,children:u.icon}),e(d,{children:[t(p,{children:P}),t(a,{children:null!==A()&&`(${A()})`})]})]}),e(m,{children:[C||t(h,{style:{transform:$?"rotateZ(180deg)":"rotateZ(0deg)"}}),t("div",{onClick:e=>{e.preventDefault(),e.stopPropagation(),null==x||x(u)},children:t(r,{displayFlex:!0,checkedIcon:H,checked:E,size:16})})]})]})),$&&e(f,{children:[t(w,{value:k,data:q,size:j,onOptionClick:v}),S&&t(g,{onClick:()=>{Z(e=>!e)},children:F?"Скрыть ":"Показать "})]})]})};export{u as SelectFieldCheckboxGroupOption};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SelectFieldDataItem, SelectFieldSize } from '@/ui/components/select-field';
|
|
3
3
|
import { SelectFieldOptionClickEventHandler } from '../types';
|
|
4
|
-
export interface SelectFieldCollapseOptionProps
|
|
4
|
+
export interface SelectFieldCollapseOptionProps extends React.PropsWithChildren, Pick<React.ComponentProps<'div'>, 'onMouseEnter' | 'onMouseLeave' | 'onPointerDown' | 'onPointerUp' | 'onPointerLeave'> {
|
|
5
5
|
size: SelectFieldSize;
|
|
6
|
-
item:
|
|
7
|
-
onClick?: SelectFieldOptionClickEventHandler
|
|
6
|
+
item: SelectFieldDataItem;
|
|
7
|
+
onClick?: SelectFieldOptionClickEventHandler;
|
|
8
8
|
icon?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export declare const SelectFieldCollapseOption:
|
|
10
|
+
export declare const SelectFieldCollapseOption: ({ size, item, children, onClick, icon, ...props }: SelectFieldCollapseOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { SelectFieldOptionsProps } from '../types';
|
|
3
|
-
export declare const SelectFieldOptions: <
|
|
3
|
+
export declare const SelectFieldOptions: React.FC<SelectFieldOptionsProps>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { SelectFieldDataItemComplex, SelectFieldSize } from '../../types';
|
|
3
|
-
export type SelectFieldOptionProps
|
|
4
|
-
item:
|
|
3
|
+
export type SelectFieldOptionProps = {
|
|
4
|
+
item: SelectFieldDataItemComplex;
|
|
5
5
|
selected: boolean;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
size: SelectFieldSize;
|
|
8
8
|
selectedColor?: string;
|
|
9
9
|
} & ComponentProps<'div'>;
|
|
10
|
-
export declare const SelectFieldOption:
|
|
10
|
+
export declare const SelectFieldOption: ({ item, selected, disabled, size, selectedColor, ...rest }: SelectFieldOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export type SelectFieldOptionClickEventHandler
|
|
4
|
-
export type SelectFieldGroupCheckboxClickEventHandler
|
|
5
|
-
export interface SelectFieldOptionsProps
|
|
6
|
-
value:
|
|
7
|
-
data:
|
|
2
|
+
import { SelectFieldData, SelectFieldDataItem, SelectFieldSize } from '@/ui/components/select-field/types';
|
|
3
|
+
export type SelectFieldOptionClickEventHandler = (item: SelectFieldDataItem) => unknown;
|
|
4
|
+
export type SelectFieldGroupCheckboxClickEventHandler = (item: SelectFieldDataItem) => unknown;
|
|
5
|
+
export interface SelectFieldOptionsProps extends React.ComponentProps<'div'> {
|
|
6
|
+
value: SelectFieldDataItem | SelectFieldDataItem[] | null;
|
|
7
|
+
data: SelectFieldData;
|
|
8
8
|
size: SelectFieldSize;
|
|
9
9
|
disableSelect?: boolean;
|
|
10
10
|
selectedColor?: string;
|
|
11
|
-
onGroupCheckboxClick?: SelectFieldGroupCheckboxClickEventHandler
|
|
12
|
-
onOptionClick?: SelectFieldOptionClickEventHandler
|
|
11
|
+
onGroupCheckboxClick?: SelectFieldGroupCheckboxClickEventHandler;
|
|
12
|
+
onOptionClick?: SelectFieldOptionClickEventHandler;
|
|
13
13
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TooltipProps } from '@/ui/components/tooltip';
|
|
3
|
-
export type SelectFieldChangeEventHandler
|
|
4
|
-
export type SelectFieldValueChangeEventHandler
|
|
5
|
-
export type SelectFieldMultiChangeEventHandler
|
|
6
|
-
export type SelectFieldMultiValueChangeEventHandler
|
|
7
|
-
export type SelectFieldOptionClickEventHandler
|
|
8
|
-
export type SelectFieldGroupCheckboxClickEventHandler
|
|
3
|
+
export type SelectFieldChangeEventHandler = (item: SelectFieldDataItem | null) => unknown;
|
|
4
|
+
export type SelectFieldValueChangeEventHandler = (value: string | null) => unknown;
|
|
5
|
+
export type SelectFieldMultiChangeEventHandler = (items: SelectFieldDataItem[]) => unknown;
|
|
6
|
+
export type SelectFieldMultiValueChangeEventHandler = (value: string[]) => unknown;
|
|
7
|
+
export type SelectFieldOptionClickEventHandler = (item: SelectFieldDataItem) => unknown;
|
|
8
|
+
export type SelectFieldGroupCheckboxClickEventHandler = (item: SelectFieldDataItem) => unknown;
|
|
9
9
|
export type SelectFieldInputChangeEventHandler = (value: string) => unknown;
|
|
10
10
|
export type SelectFieldItemType = 'item' | 'divider' | 'collapse' | 'empty' | 'label' | 'radio' | 'checkbox' | 'checkbox-group';
|
|
11
11
|
export type SelectFieldDataItemSimple = string;
|
|
12
|
-
export type SelectFieldDataItemComplex
|
|
12
|
+
export type SelectFieldDataItemComplex = {
|
|
13
13
|
id?: number | string;
|
|
14
14
|
type?: SelectFieldItemType;
|
|
15
15
|
color?: string;
|
|
@@ -23,23 +23,22 @@ export type SelectFieldDataItemComplex<DataItem extends string | SelectFieldData
|
|
|
23
23
|
tooltip?: TooltipProps;
|
|
24
24
|
open?: boolean;
|
|
25
25
|
backgroundHoverColor?: 'gradient' | 'primary';
|
|
26
|
-
data?: SelectFieldDataItem
|
|
26
|
+
data?: SelectFieldDataItem[];
|
|
27
27
|
best_model?: boolean;
|
|
28
28
|
noSelect?: boolean;
|
|
29
29
|
description?: string;
|
|
30
30
|
selected?: boolean;
|
|
31
31
|
checkedIcon?: React.ReactNode;
|
|
32
32
|
radioName?: string;
|
|
33
|
-
onClick?: SelectFieldOptionClickEventHandler
|
|
34
|
-
onGroupCheckboxClick?: SelectFieldGroupCheckboxClickEventHandler
|
|
33
|
+
onClick?: SelectFieldOptionClickEventHandler;
|
|
34
|
+
onGroupCheckboxClick?: SelectFieldGroupCheckboxClickEventHandler;
|
|
35
35
|
};
|
|
36
|
-
export type SelectFieldDataItem
|
|
37
|
-
export type SelectFieldData
|
|
36
|
+
export type SelectFieldDataItem = string | SelectFieldDataItemComplex;
|
|
37
|
+
export type SelectFieldData = SelectFieldDataItem[];
|
|
38
38
|
export type SelectFieldSize = 'small' | 'md' | 'large';
|
|
39
39
|
export type SelectFieldPlacement = 'bottom-left' | 'bottom-center' | 'top-left' | 'top-right';
|
|
40
40
|
export type SelectFieldInputType = 'text' | 'search';
|
|
41
41
|
export type ResetStyleStateType = string | number | boolean | null;
|
|
42
|
-
export type SelectedItem
|
|
43
|
-
export type
|
|
44
|
-
export type
|
|
45
|
-
export type ValueSetter<DataItem extends string | SelectFieldDataItemComplex<any>> = (value: ValueType<DataItem>) => void;
|
|
42
|
+
export type SelectedItem = SelectFieldDataItem | null;
|
|
43
|
+
export type ValueType = SelectFieldDataItem | SelectFieldDataItem[] | null;
|
|
44
|
+
export type ValueSetter = (value: ValueType) => void;
|
|
@@ -1,43 +1,27 @@
|
|
|
1
|
-
import { SelectFieldChangeEventHandler,
|
|
2
|
-
|
|
1
|
+
import { SelectFieldChangeEventHandler, SelectFieldDataItem, SelectFieldMultiChangeEventHandler, SelectFieldMultiValueChangeEventHandler, SelectFieldPlacement, SelectFieldValueChangeEventHandler } from './types';
|
|
2
|
+
import { ValueType } from '.';
|
|
3
|
+
export interface UseSelectFieldDefaultProps {
|
|
3
4
|
multiple?: false;
|
|
4
|
-
value?:
|
|
5
|
-
onChange?: SelectFieldChangeEventHandler
|
|
6
|
-
onValueChange?: SelectFieldValueChangeEventHandler
|
|
5
|
+
value?: SelectFieldDataItem | null;
|
|
6
|
+
onChange?: SelectFieldChangeEventHandler;
|
|
7
|
+
onValueChange?: SelectFieldValueChangeEventHandler;
|
|
7
8
|
}
|
|
8
|
-
export interface UseSelectFieldMultiProps
|
|
9
|
+
export interface UseSelectFieldMultiProps {
|
|
9
10
|
multiple: true;
|
|
10
|
-
value?:
|
|
11
|
-
onChange?: SelectFieldMultiChangeEventHandler
|
|
12
|
-
onValueChange?: SelectFieldMultiValueChangeEventHandler
|
|
11
|
+
value?: SelectFieldDataItem[];
|
|
12
|
+
onChange?: SelectFieldMultiChangeEventHandler;
|
|
13
|
+
onValueChange?: SelectFieldMultiValueChangeEventHandler;
|
|
13
14
|
}
|
|
14
|
-
export type UseSelectFieldUnionProps
|
|
15
|
-
export type UseSelectFieldProps
|
|
15
|
+
export type UseSelectFieldUnionProps = UseSelectFieldDefaultProps | UseSelectFieldMultiProps;
|
|
16
|
+
export type UseSelectFieldProps = {
|
|
16
17
|
disabled?: boolean;
|
|
17
18
|
placement?: SelectFieldPlacement;
|
|
18
19
|
contentHeight?: number | string;
|
|
19
20
|
onClose?: () => void;
|
|
20
21
|
onSelectClick?: () => void;
|
|
21
|
-
} & UseSelectFieldUnionProps
|
|
22
|
-
export type
|
|
23
|
-
|
|
24
|
-
y: number;
|
|
25
|
-
width: number;
|
|
26
|
-
isOpen: boolean;
|
|
27
|
-
triggerRef: React.RefObject<TriggerType | null>;
|
|
28
|
-
selectModalRef: React.RefObject<HTMLDivElement | null>;
|
|
29
|
-
placement: SelectFieldPlacement;
|
|
30
|
-
isKeyboardOpen: React.RefObject<boolean>;
|
|
31
|
-
value: DataItem | SelectFieldDataItemLiteral<DataItem> | DataItem[] | null;
|
|
32
|
-
disabled: boolean;
|
|
33
|
-
multiple: boolean;
|
|
34
|
-
contentHeight?: number | string;
|
|
35
|
-
handleInputClick: (native: boolean, event: React.MouseEvent<HTMLElement>) => void;
|
|
36
|
-
handleClose: () => void;
|
|
37
|
-
setValue: (value: DataItem | DataItem[] | null) => void;
|
|
38
|
-
};
|
|
39
|
-
export type UseSelectFieldReturnType<DataItem extends string | SelectFieldDataItemComplex<any>, TriggerType extends HTMLElement = HTMLDivElement> = ReturnType<UseSelectFieldHook<DataItem, TriggerType>>;
|
|
40
|
-
export declare const useSelectField: <DataItem extends string | SelectFieldDataItemComplex<any>, TriggerType extends HTMLElement = HTMLDivElement>({ value: initialValue, multiple, disabled, placement: initialPlacement, contentHeight, onClose, onSelectClick, onChange, onValueChange, }: UseSelectFieldProps<DataItem>) => {
|
|
22
|
+
} & UseSelectFieldUnionProps;
|
|
23
|
+
export type UseSelectFieldReturnType = ReturnType<typeof useSelectField>;
|
|
24
|
+
export declare const useSelectField: <TriggerType extends HTMLElement = HTMLDivElement>({ value: initialValue, multiple, disabled, placement: initialPlacement, contentHeight, onClose, onSelectClick, onChange, onValueChange, }: UseSelectFieldProps) => {
|
|
41
25
|
x: number;
|
|
42
26
|
y: number;
|
|
43
27
|
width: number;
|
|
@@ -46,11 +30,11 @@ export declare const useSelectField: <DataItem extends string | SelectFieldDataI
|
|
|
46
30
|
selectModalRef: import("react").RefObject<HTMLDivElement | null>;
|
|
47
31
|
placement: "top-left" | "top-right" | "bottom-left" | "bottom-center";
|
|
48
32
|
isKeyboardOpen: import("react").RefObject<boolean>;
|
|
49
|
-
value:
|
|
33
|
+
value: ValueType;
|
|
50
34
|
disabled: boolean;
|
|
51
35
|
multiple: boolean;
|
|
52
36
|
contentHeight: string | number | undefined;
|
|
53
37
|
handleInputClick: (native: boolean, event: React.MouseEvent<HTMLElement>) => void;
|
|
54
38
|
handleClose: () => void;
|
|
55
|
-
setValue: (value:
|
|
39
|
+
setValue: (value: ValueType) => void;
|
|
56
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useState as e,useCallback as t,useRef as n,useEffect as o}from"react";import"unified";import"remark-parse";import"remark-gfm";import"mdast-util-to-markdown";import"../../utils/colors/calculateGrayScale.js";import"../../utils/colors/calculateAccentColors.js";import{findNearestScrollableParent as r}from"../../utils/findNearestScrollableParent.js";import"tslib";const i=({value:i,multiple:l=!1,disabled:s=!1,placement:c="bottom-left",contentHeight:u,onClose:a,onSelectClick:d,onChange:m,onValueChange:w})=>{const[p,f]=e(!1),[g,v]=e(0),[h,b]=e(0),[y,E]=e(0),[L,C]=e(u),[k,A]=e(c),H=t(e=>{if(l&&Array.isArray(e)){const t=
|
|
1
|
+
import{useState as e,useCallback as t,useRef as n,useEffect as o}from"react";import"unified";import"remark-parse";import"remark-gfm";import"mdast-util-to-markdown";import"../../utils/colors/calculateGrayScale.js";import"../../utils/colors/calculateAccentColors.js";import{findNearestScrollableParent as r}from"../../utils/findNearestScrollableParent.js";import"tslib";const i=({value:i,multiple:l=!1,disabled:s=!1,placement:c="bottom-left",contentHeight:u,onClose:a,onSelectClick:d,onChange:m,onValueChange:w})=>{const[p,f]=e(!1),[g,v]=e(0),[h,b]=e(0),[y,E]=e(0),[L,C]=e(u),[k,A]=e(c),H=t(e=>{if(l&&Array.isArray(e)){const t=w,n=e;null==m||m(e),null==t||t(n.map(e=>"string"==typeof e?e:"string"==typeof e.value?e.value:"").filter(e=>!!e))}if(!l&&!Array.isArray(e)){null==m||m(e);const t=w;e?"string"==typeof e?null==t||t(e):"string"==typeof e.value&&(null==t||t(e.value)):null==t||t(null)}},[l,m,w]);let[R,z]=e(l?[]:null);void 0!==i&&([R,z]=[i,H]);const X=n(!1),Y=n(null),j=n(null);o(()=>{const e=()=>{const e=Y.current;if(!e||!L||!u)return;let t=u;const{top:n,bottom:o}=e.getBoundingClientRect();t=k.includes("top")?n-20:window.innerHeight-o-20,"string"!=typeof u&&C(t<u?t:u)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[Y.current,L,k,u,p]);const B=t(()=>{f(!1),null==a||a()},[]);o(()=>{if(!p||!Y.current)return;const e=r(Y.current);return e?(e.addEventListener("scroll",B),()=>e.removeEventListener("scroll",B)):void 0},[p]),o(()=>{if(!p)return;const e=e=>{if(!X.current||"orientationchange"===e.type){if("mousedown"===e.type){const t=Y.current,n=j.current;if(null===t||null===n)return;if(t.contains(e.target)||n.contains(e.target))return}B()}};return document.addEventListener("mousedown",e),document.addEventListener("scroll",e),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("scroll",e),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}},[p]);const S=t((e,t)=>{null==d||d();const n=Y.current,o=j.current;if(!n||!o||s)return;e&&t.stopPropagation();const r=window.innerHeight||document.documentElement.clientHeight,{width:i,height:l,top:a,bottom:m,left:w,right:g}=n.getBoundingClientRect(),{width:h}=o.getBoundingClientRect();let y=k;y=a-186<0||"number"==typeof u&&u>a&&r-m>a?"bottom-center"===y?"bottom-center":"bottom-left":m+186>r||"number"==typeof u&&u>r-m&&r-m<a?"top-right"===c?"top-right":"top-left":c;let L=0,C=0;switch(y){case"bottom-left":L=w+window.scrollX,C=a+window.scrollY+l;break;case"bottom-center":L=Math.floor((w+g)/2+window.scrollX-h/2),C=a+window.scrollY+l;break;case"top-left":L=w+window.scrollX,C=a+window.scrollY;break;case"top-right":L=w+window.scrollX+i,C=a+window.scrollY}v(L),b(C),E(i),A(y),f(!!e||!p)},[s,p,k,c,d]);return{x:g,y:h,width:y,isOpen:p,triggerRef:Y,selectModalRef:j,placement:k,isKeyboardOpen:X,value:R,disabled:s,multiple:l,contentHeight:L,handleInputClick:S,handleClose:B,setValue:e=>{z===H?z(e):(z(e),H(e))}}};export{i as useSelectField};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as n,useRef as r,useEffect as i}from"react";import{SwitcherContainer as o,SwitcherSlider as l,SwitcherOption as c}from"./styled.js";const s=({options:s,defaultOption:u=0,onChange:d,className:f})=>{const[m,a]=n(u),[h,p]=n(0),[w,g]=n(0),C=r(null),v=r(null),j=r(null);i(()=>{k()},[m]),i(()=>{const e=()=>{k()};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[m]);const k=()=>{const e=[v,j][m];if(e.current&&C.current){const t=C.current.getBoundingClientRect(),n=e.current.getBoundingClientRect(),r=n.left-t.left,{width:i}=n;p(r),g(i)}},x=()=>{a(e=>0===e?1:0),null==d||d(0===m?1:0)};return e(o,{ref:C,className:f,children:[t(l,{style:{left:h,width:w}}),t(c,{ref:v,onClick:x,children:s[0]}),t(c,{ref:j,onClick:x,children:s[1]})]})};export{s as SwitcherSelect};
|
|
@@ -572,7 +572,287 @@ export declare const SwitcherOption: import("styled-components").IStyledComponen
|
|
|
572
572
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
|
|
573
573
|
ref?: import("react").Ref<HTMLSpanElement> | undefined;
|
|
574
574
|
}>;
|
|
575
|
-
export declare const SwitcherSlider: import("styled-components").IStyledComponent<"web",
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
575
|
+
export declare const SwitcherSlider: import("styled-components").IStyledComponent<"web", {
|
|
576
|
+
ref?: import("react").Ref<HTMLDivElement> | undefined;
|
|
577
|
+
key?: import("react").Key | null | undefined;
|
|
578
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
579
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
580
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
581
|
+
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
582
|
+
accessKey?: string | undefined | undefined;
|
|
583
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
584
|
+
autoFocus?: boolean | undefined | undefined;
|
|
585
|
+
className?: string | undefined | undefined;
|
|
586
|
+
contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
|
|
587
|
+
contextMenu?: string | undefined | undefined;
|
|
588
|
+
dir?: string | undefined | undefined;
|
|
589
|
+
draggable?: (boolean | "false" | "true") | undefined;
|
|
590
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
591
|
+
hidden?: boolean | undefined | undefined;
|
|
592
|
+
id?: string | undefined | undefined;
|
|
593
|
+
lang?: string | undefined | undefined;
|
|
594
|
+
nonce?: string | undefined | undefined;
|
|
595
|
+
slot?: string | undefined | undefined;
|
|
596
|
+
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
597
|
+
style?: import("react").CSSProperties | undefined;
|
|
598
|
+
tabIndex?: number | undefined | undefined;
|
|
599
|
+
title?: string | undefined | undefined;
|
|
600
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
601
|
+
radioGroup?: string | undefined | undefined;
|
|
602
|
+
role?: import("react").AriaRole | undefined;
|
|
603
|
+
about?: string | undefined | undefined;
|
|
604
|
+
content?: string | undefined | undefined;
|
|
605
|
+
datatype?: string | undefined | undefined;
|
|
606
|
+
inlist?: any;
|
|
607
|
+
prefix?: string | undefined | undefined;
|
|
608
|
+
property?: string | undefined | undefined;
|
|
609
|
+
rel?: string | undefined | undefined;
|
|
610
|
+
resource?: string | undefined | undefined;
|
|
611
|
+
rev?: string | undefined | undefined;
|
|
612
|
+
typeof?: string | undefined | undefined;
|
|
613
|
+
vocab?: string | undefined | undefined;
|
|
614
|
+
autoCorrect?: string | undefined | undefined;
|
|
615
|
+
autoSave?: string | undefined | undefined;
|
|
616
|
+
color?: string | undefined | undefined;
|
|
617
|
+
itemProp?: string | undefined | undefined;
|
|
618
|
+
itemScope?: boolean | undefined | undefined;
|
|
619
|
+
itemType?: string | undefined | undefined;
|
|
620
|
+
itemID?: string | undefined | undefined;
|
|
621
|
+
itemRef?: string | undefined | undefined;
|
|
622
|
+
results?: number | undefined | undefined;
|
|
623
|
+
security?: string | undefined | undefined;
|
|
624
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
625
|
+
popover?: "" | "auto" | "manual" | undefined | undefined;
|
|
626
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
627
|
+
popoverTarget?: string | undefined | undefined;
|
|
628
|
+
inert?: boolean | undefined | undefined;
|
|
629
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
630
|
+
is?: string | undefined | undefined;
|
|
631
|
+
exportparts?: string | undefined | undefined;
|
|
632
|
+
part?: string | undefined | undefined;
|
|
633
|
+
"aria-activedescendant"?: string | undefined | undefined;
|
|
634
|
+
"aria-atomic"?: (boolean | "false" | "true") | undefined;
|
|
635
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
636
|
+
"aria-braillelabel"?: string | undefined | undefined;
|
|
637
|
+
"aria-brailleroledescription"?: string | undefined | undefined;
|
|
638
|
+
"aria-busy"?: (boolean | "false" | "true") | undefined;
|
|
639
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
640
|
+
"aria-colcount"?: number | undefined | undefined;
|
|
641
|
+
"aria-colindex"?: number | undefined | undefined;
|
|
642
|
+
"aria-colindextext"?: string | undefined | undefined;
|
|
643
|
+
"aria-colspan"?: number | undefined | undefined;
|
|
644
|
+
"aria-controls"?: string | undefined | undefined;
|
|
645
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
|
|
646
|
+
"aria-describedby"?: string | undefined | undefined;
|
|
647
|
+
"aria-description"?: string | undefined | undefined;
|
|
648
|
+
"aria-details"?: string | undefined | undefined;
|
|
649
|
+
"aria-disabled"?: (boolean | "false" | "true") | undefined;
|
|
650
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
651
|
+
"aria-errormessage"?: string | undefined | undefined;
|
|
652
|
+
"aria-expanded"?: (boolean | "false" | "true") | undefined;
|
|
653
|
+
"aria-flowto"?: string | undefined | undefined;
|
|
654
|
+
"aria-grabbed"?: (boolean | "false" | "true") | undefined;
|
|
655
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
|
|
656
|
+
"aria-hidden"?: (boolean | "false" | "true") | undefined;
|
|
657
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
658
|
+
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
659
|
+
"aria-label"?: string | undefined | undefined;
|
|
660
|
+
"aria-labelledby"?: string | undefined | undefined;
|
|
661
|
+
"aria-level"?: number | undefined | undefined;
|
|
662
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
663
|
+
"aria-modal"?: (boolean | "false" | "true") | undefined;
|
|
664
|
+
"aria-multiline"?: (boolean | "false" | "true") | undefined;
|
|
665
|
+
"aria-multiselectable"?: (boolean | "false" | "true") | undefined;
|
|
666
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
|
|
667
|
+
"aria-owns"?: string | undefined | undefined;
|
|
668
|
+
"aria-placeholder"?: string | undefined | undefined;
|
|
669
|
+
"aria-posinset"?: number | undefined | undefined;
|
|
670
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
671
|
+
"aria-readonly"?: (boolean | "false" | "true") | undefined;
|
|
672
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
673
|
+
"aria-required"?: (boolean | "false" | "true") | undefined;
|
|
674
|
+
"aria-roledescription"?: string | undefined | undefined;
|
|
675
|
+
"aria-rowcount"?: number | undefined | undefined;
|
|
676
|
+
"aria-rowindex"?: number | undefined | undefined;
|
|
677
|
+
"aria-rowindextext"?: string | undefined | undefined;
|
|
678
|
+
"aria-rowspan"?: number | undefined | undefined;
|
|
679
|
+
"aria-selected"?: (boolean | "false" | "true") | undefined;
|
|
680
|
+
"aria-setsize"?: number | undefined | undefined;
|
|
681
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
|
|
682
|
+
"aria-valuemax"?: number | undefined | undefined;
|
|
683
|
+
"aria-valuemin"?: number | undefined | undefined;
|
|
684
|
+
"aria-valuenow"?: number | undefined | undefined;
|
|
685
|
+
"aria-valuetext"?: string | undefined | undefined;
|
|
686
|
+
children?: import("react").ReactNode;
|
|
687
|
+
dangerouslySetInnerHTML?: {
|
|
688
|
+
__html: string | TrustedHTML;
|
|
689
|
+
} | undefined | undefined;
|
|
690
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
691
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
692
|
+
onCut?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
693
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
694
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
695
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
696
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
697
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
698
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
699
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
700
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
701
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
702
|
+
onFocus?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
703
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
704
|
+
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
705
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
706
|
+
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
707
|
+
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
708
|
+
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement> | undefined;
|
|
709
|
+
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
710
|
+
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
711
|
+
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
712
|
+
onReset?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
713
|
+
onResetCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
714
|
+
onSubmit?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
715
|
+
onSubmitCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
716
|
+
onInvalid?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
717
|
+
onInvalidCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
718
|
+
onLoad?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
719
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
720
|
+
onError?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
721
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
722
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
723
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
724
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
725
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
726
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
727
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
728
|
+
onAbort?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
729
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
730
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
731
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
732
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
733
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
734
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
735
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
736
|
+
onEmptied?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
737
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
738
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
739
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
740
|
+
onEnded?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
741
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
742
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
743
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
744
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
745
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
746
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
747
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
748
|
+
onPause?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
749
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
750
|
+
onPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
751
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
752
|
+
onPlaying?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
753
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
754
|
+
onProgress?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
755
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
756
|
+
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
757
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
758
|
+
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
759
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
760
|
+
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
761
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
762
|
+
onStalled?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
763
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
764
|
+
onSuspend?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
765
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
766
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
767
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
768
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
769
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
770
|
+
onWaiting?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
771
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
772
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
773
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
774
|
+
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
775
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
776
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
777
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
778
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
779
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
780
|
+
onDrag?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
781
|
+
onDragCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
782
|
+
onDragEnd?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
783
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
784
|
+
onDragEnter?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
785
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
786
|
+
onDragExit?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
787
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
788
|
+
onDragLeave?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
789
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
790
|
+
onDragOver?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
791
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
792
|
+
onDragStart?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
793
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
794
|
+
onDrop?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
795
|
+
onDropCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
796
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
797
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
798
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
799
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
800
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
801
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
802
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
803
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
804
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
805
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
806
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
807
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
808
|
+
onSelect?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
809
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
810
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
811
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
812
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
813
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
814
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
815
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
816
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
817
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
818
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
819
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
820
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
821
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
822
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
823
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
824
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
825
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
826
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
827
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
828
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
829
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
830
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
831
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
832
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
833
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
834
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
835
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
836
|
+
onScroll?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
837
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
838
|
+
onScrollEnd?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
839
|
+
onScrollEndCapture?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
840
|
+
onWheel?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
841
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
842
|
+
onAnimationStart?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
843
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
844
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
845
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
846
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
847
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
848
|
+
onToggle?: import("react").ToggleEventHandler<HTMLDivElement> | undefined;
|
|
849
|
+
onBeforeToggle?: import("react").ToggleEventHandler<HTMLDivElement> | undefined;
|
|
850
|
+
onTransitionCancel?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
851
|
+
onTransitionCancelCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
852
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
853
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
854
|
+
onTransitionRun?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
855
|
+
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
856
|
+
onTransitionStart?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
857
|
+
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
858
|
+
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{styled as o}from"styled-components";import{Typography as
|
|
1
|
+
import{styled as o}from"styled-components";import{Typography as e}from"../typography/index.js";const t=o.div.withConfig({displayName:"styled__SwitcherContainer",componentId:"sc-194ajzh-0"})(["display:inline-flex;position:relative;background-color:",";border-radius:25px;padding:2px 4px;width:fit-content;"],({theme:o})=>o.colors.grayScale.gray3),i=o(e).attrs({forwardedAs:"button",variant:"button-sm"}).withConfig({displayName:"styled__SwitcherOption",componentId:"sc-194ajzh-1"})(["position:relative;z-index:2;padding:2px 12px;cursor:pointer;user-select:none;font-size:14px;background-color:transparent;color:",";transition:color 0.3s ease;border-radius:20px;white-space:nowrap;outline:none;"],({theme:o})=>o.colors.base.white),r=o.div.withConfig({displayName:"styled__SwitcherSlider",componentId:"sc-194ajzh-2"})(["position:absolute;top:4px;height:calc(100% - 8px);background-color:",";border-radius:20px;transition:all 0.3s cubic-bezier(0.4,0,0.2,1);"],({theme:o})=>o.colors.accent.primary);export{t as SwitcherContainer,i as SwitcherOption,r as SwitcherSlider};
|
package/package.json
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bothub-chat/ui",
|
|
3
|
-
"version": "2.61.1-
|
|
4
|
-
"description": "Bothub UI Components",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"bot",
|
|
7
|
-
"chat",
|
|
8
|
-
"chatgpt",
|
|
9
|
-
"ai",
|
|
10
|
-
"react"
|
|
11
|
-
],
|
|
12
|
-
"repository": {
|
|
13
|
-
"url": "https://github.com/bothubchat/bothub.git",
|
|
14
|
-
"type": "git",
|
|
15
|
-
"directory": "./packages/ui"
|
|
16
|
-
},
|
|
17
|
-
"publishConfig": {
|
|
18
|
-
"access": "public",
|
|
19
|
-
"registry": "https://registry.npmjs.org/"
|
|
20
|
-
},
|
|
21
|
-
"author": "dev2alert <atmpotn@yandex.ru>",
|
|
22
|
-
"license": "MIT",
|
|
23
|
-
"homepage": "https://bothub.chat",
|
|
24
|
-
"files": [
|
|
25
|
-
"./dist",
|
|
26
|
-
"./fonts"
|
|
27
|
-
],
|
|
28
|
-
"type": "module",
|
|
29
|
-
"main": "./dist/index.js",
|
|
30
|
-
"module": "./dist/index.js",
|
|
31
|
-
"types": "./dist/index.d.ts",
|
|
32
|
-
"exports": {
|
|
33
|
-
".": {
|
|
34
|
-
"types": "./dist/index.d.ts",
|
|
35
|
-
"import": "./dist/index.js",
|
|
36
|
-
"default": "./dist/index.js"
|
|
37
|
-
},
|
|
38
|
-
"./components/*": "./dist/components/*",
|
|
39
|
-
"./fonts/*": "./fonts/*",
|
|
40
|
-
"./utils/*": "./dist/utils/*"
|
|
41
|
-
},
|
|
42
|
-
"sideEffects": false,
|
|
43
|
-
"resolutions": {
|
|
44
|
-
"react-helmet/react": "^19.0.0"
|
|
45
|
-
},
|
|
46
|
-
"peerDependencies": {
|
|
47
|
-
"@uidotdev/usehooks": "^2.4.1",
|
|
48
|
-
"react": "^19",
|
|
49
|
-
"react-dom": "^19",
|
|
50
|
-
"react-helmet": ">=2",
|
|
51
|
-
"styled-components": "^6.0.7"
|
|
52
|
-
},
|
|
53
|
-
"dependencies": {
|
|
54
|
-
"@dnd-kit/core": "^6.1.0",
|
|
55
|
-
"@floating-ui/react": "^0.26.16",
|
|
56
|
-
"@floating-ui/react-dom": "^2.1.0",
|
|
57
|
-
"@react-spring/web": "^10",
|
|
58
|
-
"date-fns": "^3.6.0",
|
|
59
|
-
"highlight.js": "^11.11.0",
|
|
60
|
-
"katex": "^0.16.10",
|
|
61
|
-
"marked": "^16.2.1",
|
|
62
|
-
"normalize.css": "^8.0.1",
|
|
63
|
-
"rc-slider": "^11.1.8",
|
|
64
|
-
"react-markdown": "^10.0.0",
|
|
65
|
-
"rehype-katex": "^7.0.0",
|
|
66
|
-
"remark-gfm": "^4.0.1",
|
|
67
|
-
"remark-math": "^6.0.0",
|
|
68
|
-
"tslib": "^2.6.2",
|
|
69
|
-
"unist-util-visit": "^5.0.0"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bothub-chat/ui",
|
|
3
|
+
"version": "2.61.1-fix-bugs-e66b2eca-3bb1-4291-9868-6043ab56adb6",
|
|
4
|
+
"description": "Bothub UI Components",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bot",
|
|
7
|
+
"chat",
|
|
8
|
+
"chatgpt",
|
|
9
|
+
"ai",
|
|
10
|
+
"react"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"url": "https://github.com/bothubchat/bothub.git",
|
|
14
|
+
"type": "git",
|
|
15
|
+
"directory": "./packages/ui"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public",
|
|
19
|
+
"registry": "https://registry.npmjs.org/"
|
|
20
|
+
},
|
|
21
|
+
"author": "dev2alert <atmpotn@yandex.ru>",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"homepage": "https://bothub.chat",
|
|
24
|
+
"files": [
|
|
25
|
+
"./dist",
|
|
26
|
+
"./fonts"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"module": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.js",
|
|
36
|
+
"default": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./components/*": "./dist/components/*",
|
|
39
|
+
"./fonts/*": "./fonts/*",
|
|
40
|
+
"./utils/*": "./dist/utils/*"
|
|
41
|
+
},
|
|
42
|
+
"sideEffects": false,
|
|
43
|
+
"resolutions": {
|
|
44
|
+
"react-helmet/react": "^19.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@uidotdev/usehooks": "^2.4.1",
|
|
48
|
+
"react": "^19",
|
|
49
|
+
"react-dom": "^19",
|
|
50
|
+
"react-helmet": ">=2",
|
|
51
|
+
"styled-components": "^6.0.7"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@dnd-kit/core": "^6.1.0",
|
|
55
|
+
"@floating-ui/react": "^0.26.16",
|
|
56
|
+
"@floating-ui/react-dom": "^2.1.0",
|
|
57
|
+
"@react-spring/web": "^10",
|
|
58
|
+
"date-fns": "^3.6.0",
|
|
59
|
+
"highlight.js": "^11.11.0",
|
|
60
|
+
"katex": "^0.16.10",
|
|
61
|
+
"marked": "^16.2.1",
|
|
62
|
+
"normalize.css": "^8.0.1",
|
|
63
|
+
"rc-slider": "^11.1.8",
|
|
64
|
+
"react-markdown": "^10.0.0",
|
|
65
|
+
"rehype-katex": "^7.0.0",
|
|
66
|
+
"remark-gfm": "^4.0.1",
|
|
67
|
+
"remark-math": "^6.0.0",
|
|
68
|
+
"tslib": "^2.6.2",
|
|
69
|
+
"unist-util-visit": "^5.0.0"
|
|
70
|
+
}
|
|
71
|
+
}
|