@atlaskit/user-picker 10.2.1 → 10.2.2
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/CHANGELOG.md +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.5/analytics.d.ts +24 -0
- package/dist/types-ts4.5/clients/UserSourceProvider.d.ts +11 -0
- package/dist/types-ts4.5/components/AddOptionAvatar.d.ts +6 -0
- package/dist/types-ts4.5/components/AvatarItemOption.d.ts +13 -0
- package/dist/types-ts4.5/components/BaseUserPicker.d.ts +63 -0
- package/dist/types-ts4.5/components/ClearIndicator.d.ts +6 -0
- package/dist/types-ts4.5/components/CustomOption/index.d.ts +3 -0
- package/dist/types-ts4.5/components/CustomOption/main.d.ts +15 -0
- package/dist/types-ts4.5/components/EmailOption/index.d.ts +3 -0
- package/dist/types-ts4.5/components/EmailOption/main.d.ts +18 -0
- package/dist/types-ts4.5/components/ExternalUserOption/ExternalAvatarItemOption.d.ts +11 -0
- package/dist/types-ts4.5/components/ExternalUserOption/InfoIcon.d.ts +3 -0
- package/dist/types-ts4.5/components/ExternalUserOption/SourcesTooltipContent.d.ts +6 -0
- package/dist/types-ts4.5/components/ExternalUserOption/index.d.ts +3 -0
- package/dist/types-ts4.5/components/ExternalUserOption/main.d.ts +12 -0
- package/dist/types-ts4.5/components/ExternalUserSourcesContainer.d.ts +15 -0
- package/dist/types-ts4.5/components/GroupOption/index.d.ts +3 -0
- package/dist/types-ts4.5/components/GroupOption/main.d.ts +16 -0
- package/dist/types-ts4.5/components/HighlightText.d.ts +9 -0
- package/dist/types-ts4.5/components/Input.d.ts +11 -0
- package/dist/types-ts4.5/components/MessagesIntlProvider.d.ts +3 -0
- package/dist/types-ts4.5/components/MultiValue.d.ts +26 -0
- package/dist/types-ts4.5/components/MultiValueContainer.d.ts +30 -0
- package/dist/types-ts4.5/components/Option.d.ts +14 -0
- package/dist/types-ts4.5/components/PopupControl.d.ts +7 -0
- package/dist/types-ts4.5/components/PopupInput.d.ts +13 -0
- package/dist/types-ts4.5/components/PopupUserPicker.d.ts +39 -0
- package/dist/types-ts4.5/components/SingleValue.d.ts +5 -0
- package/dist/types-ts4.5/components/SingleValueContainer.d.ts +9 -0
- package/dist/types-ts4.5/components/SizeableAvatar.d.ts +10 -0
- package/dist/types-ts4.5/components/TeamOption/index.d.ts +3 -0
- package/dist/types-ts4.5/components/TeamOption/main.d.ts +16 -0
- package/dist/types-ts4.5/components/UserOption.d.ts +15 -0
- package/dist/types-ts4.5/components/UserPicker.d.ts +16 -0
- package/dist/types-ts4.5/components/assets/github.d.ts +2 -0
- package/dist/types-ts4.5/components/assets/google.d.ts +2 -0
- package/dist/types-ts4.5/components/assets/microsoft.d.ts +2 -0
- package/dist/types-ts4.5/components/assets/slack.d.ts +2 -0
- package/dist/types-ts4.5/components/batch.d.ts +1 -0
- package/dist/types-ts4.5/components/components.d.ts +46 -0
- package/dist/types-ts4.5/components/creatable.d.ts +12 -0
- package/dist/types-ts4.5/components/creatableEmailSuggestion.d.ts +19 -0
- package/dist/types-ts4.5/components/emailValidation.d.ts +3 -0
- package/dist/types-ts4.5/components/i18n.d.ts +132 -0
- package/dist/types-ts4.5/components/popup.d.ts +48 -0
- package/dist/types-ts4.5/components/styles.d.ts +42 -0
- package/dist/types-ts4.5/components/utils.d.ts +29 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +35 -0
- package/dist/types-ts4.5/i18n/da.d.ts +35 -0
- package/dist/types-ts4.5/i18n/de.d.ts +35 -0
- package/dist/types-ts4.5/i18n/en.d.ts +35 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +35 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +34 -0
- package/dist/types-ts4.5/i18n/es.d.ts +35 -0
- package/dist/types-ts4.5/i18n/et.d.ts +15 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +35 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +35 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +35 -0
- package/dist/types-ts4.5/i18n/index.d.ts +36 -0
- package/dist/types-ts4.5/i18n/is.d.ts +7 -0
- package/dist/types-ts4.5/i18n/it.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +35 -0
- package/dist/types-ts4.5/i18n/languages.d.ts +27 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +35 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +35 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +35 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +35 -0
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +15 -0
- package/dist/types-ts4.5/i18n/ro.d.ts +7 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +35 -0
- package/dist/types-ts4.5/i18n/sk.d.ts +15 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +35 -0
- package/dist/types-ts4.5/i18n/th.d.ts +35 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +35 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +35 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +35 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +35 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +35 -0
- package/dist/types-ts4.5/index.d.ts +7 -0
- package/dist/types-ts4.5/types.d.ts +316 -0
- package/dist/types-ts4.5/util/i18n-util.d.ts +11 -0
- package/dist/types-ts4.5/util/ufoExperiences.d.ts +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
+
import { UserPickerProps, UserPickerState } from './types';
|
|
3
|
+
export type UserPickerSession = {
|
|
4
|
+
id: string;
|
|
5
|
+
start: number;
|
|
6
|
+
inputChangeTime: number;
|
|
7
|
+
upCount: number;
|
|
8
|
+
downCount: number;
|
|
9
|
+
lastKey?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const startSession: () => UserPickerSession;
|
|
12
|
+
export declare const createAndFireEventInElementsChannel: (payload: AnalyticsEventPayload) => (createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
|
|
13
|
+
export interface EventCreator {
|
|
14
|
+
(props: UserPickerProps, state: UserPickerState, session?: UserPickerSession): AnalyticsEventPayload;
|
|
15
|
+
(props: UserPickerProps, state: UserPickerState, session?: UserPickerSession, ...args: any[]): AnalyticsEventPayload;
|
|
16
|
+
}
|
|
17
|
+
export declare const focusEvent: EventCreator;
|
|
18
|
+
export declare const clearEvent: EventCreator;
|
|
19
|
+
export declare const deleteEvent: EventCreator;
|
|
20
|
+
export declare const cancelEvent: EventCreator;
|
|
21
|
+
export declare const selectEvent: EventCreator;
|
|
22
|
+
export declare const searchedEvent: EventCreator;
|
|
23
|
+
export declare const failedEvent: EventCreator;
|
|
24
|
+
export declare const userInfoEvent: (sources: string[], accountId: string) => AnalyticsEventPayload;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LoadUserSource, UserSource } from '../types';
|
|
3
|
+
export interface UserSourceContext {
|
|
4
|
+
fetchUserSource?: LoadUserSource;
|
|
5
|
+
}
|
|
6
|
+
export declare const ExusUserSourceProvider: React.FC<UserSourceContext>;
|
|
7
|
+
export declare const useUserSource: (accountId: string, shouldFetchSources: boolean, existingSources?: UserSource[]) => {
|
|
8
|
+
sources: UserSource[];
|
|
9
|
+
loading: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { LozengeProps } from '../types';
|
|
5
|
+
export declare const textWrapper: (color?: string) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export type AvatarItemOptionProps = {
|
|
7
|
+
avatar: ReactNode;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
lozenge?: ReactNode | LozengeProps;
|
|
10
|
+
primaryText?: ReactNode;
|
|
11
|
+
secondaryText?: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare const AvatarItemOption: ({ avatar, isDisabled, lozenge, primaryText, secondaryText, }: AvatarItemOptionProps) => jsx.JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UserPickerProps, UserPickerState } from '../types';
|
|
3
|
+
export type BaseUserPickerProps = UserPickerProps & {
|
|
4
|
+
SelectComponent: React.ComponentClass<any>;
|
|
5
|
+
pickerProps?: any;
|
|
6
|
+
styles: any;
|
|
7
|
+
components: any;
|
|
8
|
+
width: string | number;
|
|
9
|
+
};
|
|
10
|
+
export declare class BaseUserPickerWithoutAnalytics extends React.Component<BaseUserPickerProps, UserPickerState> {
|
|
11
|
+
static defaultProps: {
|
|
12
|
+
isMulti: boolean;
|
|
13
|
+
subtle: boolean;
|
|
14
|
+
noBorder: boolean;
|
|
15
|
+
textFieldBackgroundColor: boolean;
|
|
16
|
+
isClearable: boolean;
|
|
17
|
+
loadOptionsErrorMessage: () => JSX.Element;
|
|
18
|
+
};
|
|
19
|
+
static getDerivedStateFromProps(nextProps: Partial<UserPickerProps>, prevState: UserPickerState): Partial<UserPickerState>;
|
|
20
|
+
private selectRef;
|
|
21
|
+
private session?;
|
|
22
|
+
private journeyId?;
|
|
23
|
+
private optionsShownUfoExperienceInstance;
|
|
24
|
+
constructor(props: BaseUserPickerProps);
|
|
25
|
+
private getSessionId;
|
|
26
|
+
private withSelectRef;
|
|
27
|
+
nextOption: () => void;
|
|
28
|
+
previousOption: () => void;
|
|
29
|
+
focus: () => void;
|
|
30
|
+
blur: () => void;
|
|
31
|
+
selectOption: () => void;
|
|
32
|
+
private handleChange;
|
|
33
|
+
private handleSelectRef;
|
|
34
|
+
private addOptions;
|
|
35
|
+
private handleLoadOptionsError;
|
|
36
|
+
private debouncedLoadOptions;
|
|
37
|
+
abortOptionsShownUfoExperience: () => void;
|
|
38
|
+
startOptionsShownUfoExperience: () => void;
|
|
39
|
+
private executeLoadOptions;
|
|
40
|
+
private handleFocus;
|
|
41
|
+
private resetInputState;
|
|
42
|
+
private handleBlur;
|
|
43
|
+
private handleOpen;
|
|
44
|
+
private handleClose;
|
|
45
|
+
private handleInputChange;
|
|
46
|
+
private fireEvent;
|
|
47
|
+
private startSession;
|
|
48
|
+
componentDidMount(): void;
|
|
49
|
+
componentDidUpdate(_: UserPickerProps, prevState: UserPickerState): void;
|
|
50
|
+
private handleKeyDown;
|
|
51
|
+
handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
|
|
52
|
+
private getOptions;
|
|
53
|
+
private getAppearance;
|
|
54
|
+
render(): JSX.Element;
|
|
55
|
+
}
|
|
56
|
+
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive" | "SelectComponent" | "pickerProps"> & Partial<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "loadOptionsErrorMessage" | "subtle" | "noBorder">> & Partial<Pick<{
|
|
57
|
+
isMulti: boolean;
|
|
58
|
+
subtle: boolean;
|
|
59
|
+
noBorder: boolean;
|
|
60
|
+
textFieldBackgroundColor: boolean;
|
|
61
|
+
isClearable: boolean;
|
|
62
|
+
loadOptionsErrorMessage: () => JSX.Element;
|
|
63
|
+
}, never>> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Custom } from '../../types';
|
|
4
|
+
export type CustomOptionProps = {
|
|
5
|
+
data: Custom;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare class CustomOption extends React.PureComponent<CustomOptionProps> {
|
|
9
|
+
private getPrimaryText;
|
|
10
|
+
private getBylineComponent;
|
|
11
|
+
private renderByline;
|
|
12
|
+
private renderAvatar;
|
|
13
|
+
private getLozengeProps;
|
|
14
|
+
render(): jsx.JSX.Element;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { Email } from '../../types';
|
|
5
|
+
import { EmailValidationResponse } from '../emailValidation';
|
|
6
|
+
export type EmailOptionProps = {
|
|
7
|
+
email: Email;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
emailValidity: EmailValidationResponse;
|
|
11
|
+
};
|
|
12
|
+
export declare class EmailOption extends React.PureComponent<EmailOptionProps> {
|
|
13
|
+
private getLozengeProps;
|
|
14
|
+
private renderPrimaryText;
|
|
15
|
+
private renderSecondaryText;
|
|
16
|
+
private renderOption;
|
|
17
|
+
render(): jsx.JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export type ExternalAvatarItemOptionProps = {
|
|
5
|
+
avatar: ReactNode;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
primaryText: ReactNode;
|
|
8
|
+
secondaryText?: ReactNode;
|
|
9
|
+
sourcesInfoTooltip?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare const ExternalAvatarItemOption: ({ avatar, isDisabled, primaryText, secondaryText, sourcesInfoTooltip, }: ExternalAvatarItemOptionProps) => jsx.JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ExternalUserSourcesData } from '../ExternalUserSourcesContainer';
|
|
4
|
+
export declare const sourcesTooltipContainer: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const sourceWrapper: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const SourcesTooltipContent: React.FC<ExternalUserSourcesData>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const AsyncExternalUserOption: React.LazyExoticComponent<React.ForwardRefExoticComponent<Omit<import("./main").ExternalUserOptionProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>>;
|
|
3
|
+
export default AsyncExternalUserOption;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
|
+
import { ExternalUser } from '../../types';
|
|
5
|
+
export declare const imageContainer: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const emailDomainWrapper: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export type ExternalUserOptionProps = WithAnalyticsEventsProps & {
|
|
8
|
+
user: ExternalUser;
|
|
9
|
+
status?: string;
|
|
10
|
+
isSelected: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const ExternalUserOption: React.ForwardRefExoticComponent<Omit<ExternalUserOptionProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { UserSource } from '../types';
|
|
3
|
+
export interface ExternalUserSourcesData {
|
|
4
|
+
sources: UserSource[];
|
|
5
|
+
sourcesLoading: boolean;
|
|
6
|
+
}
|
|
7
|
+
type SourcesChildrenFunc = (sourcesData: ExternalUserSourcesData) => ReactNode;
|
|
8
|
+
interface SourcesContainerProps {
|
|
9
|
+
accountId: string;
|
|
10
|
+
shouldFetchSources: boolean;
|
|
11
|
+
initialSources: UserSource[];
|
|
12
|
+
children: SourcesChildrenFunc;
|
|
13
|
+
}
|
|
14
|
+
export declare const ExternalUserSourcesContainer: React.FC<SourcesContainerProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { Group } from '../../types';
|
|
5
|
+
export declare const groupOptionIconWrapper: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export type GroupOptionProps = {
|
|
7
|
+
group: Group;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare class GroupOption extends React.PureComponent<GroupOptionProps> {
|
|
11
|
+
private getPrimaryText;
|
|
12
|
+
private renderAvatar;
|
|
13
|
+
private renderByline;
|
|
14
|
+
private getLozengeProps;
|
|
15
|
+
render(): jsx.JSX.Element;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HighlightRange } from '../types';
|
|
3
|
+
export interface Props {
|
|
4
|
+
highlights?: HighlightRange[];
|
|
5
|
+
children: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class HighlightText extends React.PureComponent<Props> {
|
|
8
|
+
render(): (string | JSX.Element)[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type Props = {
|
|
3
|
+
selectProps?: {
|
|
4
|
+
disableInput?: boolean;
|
|
5
|
+
};
|
|
6
|
+
innerRef: (ref: React.Ref<HTMLInputElement>) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare class Input extends React.Component<Props> {
|
|
9
|
+
handleKeyPress: (e: KeyboardEvent) => void;
|
|
10
|
+
render(): JSX.Element;
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { OptionType } from '@atlaskit/select';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import { Option, UserPickerProps } from '../types';
|
|
6
|
+
import { MultiValueProps } from '@atlaskit/select';
|
|
7
|
+
export declare const scrollToValue: (valueContainer: HTMLDivElement, control: HTMLElement) => void;
|
|
8
|
+
type Props = MultiValueProps<OptionType> & {
|
|
9
|
+
isFocused?: boolean;
|
|
10
|
+
data: Option;
|
|
11
|
+
innerProps: any;
|
|
12
|
+
removeProps: {
|
|
13
|
+
onClick: Function;
|
|
14
|
+
};
|
|
15
|
+
selectProps: UserPickerProps;
|
|
16
|
+
ref?: React.RefObject<HTMLDivElement>;
|
|
17
|
+
};
|
|
18
|
+
export declare class MultiValue extends React.Component<Props> {
|
|
19
|
+
private containerRef;
|
|
20
|
+
constructor(props: Props);
|
|
21
|
+
componentDidUpdate(): void;
|
|
22
|
+
shouldComponentUpdate(nextProps: Props): boolean;
|
|
23
|
+
getElemBefore: () => jsx.JSX.Element;
|
|
24
|
+
render(): jsx.JSX.Element;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { MultiValueProps } from '@atlaskit/select';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { User, Option } from '../types';
|
|
4
|
+
export type State = {
|
|
5
|
+
valueSize: number;
|
|
6
|
+
previousValueSize: number;
|
|
7
|
+
};
|
|
8
|
+
type Props = MultiValueProps<Option<User>[], true> & {
|
|
9
|
+
innerProps?: ValueContainerInnerProps;
|
|
10
|
+
};
|
|
11
|
+
type ValueContainerInnerProps = {
|
|
12
|
+
ref: React.RefObject<HTMLDivElement>;
|
|
13
|
+
};
|
|
14
|
+
export declare class MultiValueContainer extends React.PureComponent<Props, State> {
|
|
15
|
+
static getDerivedStateFromProps(nextProps: Props, prevState: State): {
|
|
16
|
+
valueSize: number;
|
|
17
|
+
previousValueSize: number;
|
|
18
|
+
};
|
|
19
|
+
private valueContainerInnerProps;
|
|
20
|
+
private timeoutId;
|
|
21
|
+
constructor(props: Props);
|
|
22
|
+
componentDidUpdate(): void;
|
|
23
|
+
componentWillUnmount(): void;
|
|
24
|
+
scrollToBottom: () => void;
|
|
25
|
+
private showPlaceholder;
|
|
26
|
+
private addPlaceholder;
|
|
27
|
+
private renderChildren;
|
|
28
|
+
render(): JSX.Element;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OptionProps as AkOptionProps } from '@atlaskit/select';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { Option as OptionType } from '../types';
|
|
4
|
+
export type OptionProps = AkOptionProps & {
|
|
5
|
+
data: OptionType;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
isDisabled: boolean;
|
|
8
|
+
isFocused: boolean;
|
|
9
|
+
status?: string;
|
|
10
|
+
selectProps: {
|
|
11
|
+
emailLabel?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const Option: FC<OptionProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type Props = {
|
|
3
|
+
selectProps: {
|
|
4
|
+
disableInput?: boolean;
|
|
5
|
+
};
|
|
6
|
+
innerRef: (ref: React.Ref<HTMLInputElement>) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare class PopupInput extends React.Component<Props> {
|
|
9
|
+
private ref;
|
|
10
|
+
componentDidMount(): void;
|
|
11
|
+
private handleInnerRef;
|
|
12
|
+
render(): JSX.Element;
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PopupUserPickerProps } from '../types';
|
|
3
|
+
interface State {
|
|
4
|
+
flipped: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class PopupUserPickerWithoutAnalytics extends React.Component<PopupUserPickerProps, State> {
|
|
7
|
+
static defaultProps: {
|
|
8
|
+
boundariesElement: string;
|
|
9
|
+
width: number;
|
|
10
|
+
isMulti: boolean;
|
|
11
|
+
offset: number[];
|
|
12
|
+
placement: string;
|
|
13
|
+
rootBoundary: string;
|
|
14
|
+
shouldFlip: boolean;
|
|
15
|
+
};
|
|
16
|
+
state: {
|
|
17
|
+
flipped: boolean;
|
|
18
|
+
};
|
|
19
|
+
handleFlipStyle: (data: {
|
|
20
|
+
flipped: boolean;
|
|
21
|
+
styles: any;
|
|
22
|
+
popper: any;
|
|
23
|
+
}) => {
|
|
24
|
+
flipped: boolean;
|
|
25
|
+
styles: any;
|
|
26
|
+
popper: any;
|
|
27
|
+
};
|
|
28
|
+
render(): JSX.Element;
|
|
29
|
+
}
|
|
30
|
+
export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "target" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive" | "popupTitle"> & Partial<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "offset" | "isMulti" | "width" | "rootBoundary" | "boundariesElement" | "placement" | "shouldFlip">> & Partial<Pick<{
|
|
31
|
+
boundariesElement: string;
|
|
32
|
+
width: number;
|
|
33
|
+
isMulti: boolean;
|
|
34
|
+
offset: number[];
|
|
35
|
+
placement: string;
|
|
36
|
+
rootBoundary: string;
|
|
37
|
+
shouldFlip: boolean;
|
|
38
|
+
}, never>> & React.RefAttributes<any>>;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { ValueContainerProps } from '@atlaskit/select';
|
|
5
|
+
import { User, Option } from '../types';
|
|
6
|
+
export declare class SingleValueContainer extends React.Component<ValueContainerProps<Option<User>>> {
|
|
7
|
+
private renderAvatar;
|
|
8
|
+
render(): jsx.JSX.Element;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Team } from '../../types';
|
|
4
|
+
export type TeamOptionProps = {
|
|
5
|
+
team: Team;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare class TeamOption extends React.PureComponent<TeamOptionProps> {
|
|
9
|
+
private getPrimaryText;
|
|
10
|
+
private renderByline;
|
|
11
|
+
private getBylineComponent;
|
|
12
|
+
private renderAvatar;
|
|
13
|
+
private getLozengeProps;
|
|
14
|
+
private renderCustomByLine;
|
|
15
|
+
render(): jsx.JSX.Element;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { User } from '../types';
|
|
4
|
+
export type UserOptionProps = {
|
|
5
|
+
user: User;
|
|
6
|
+
status?: string;
|
|
7
|
+
isSelected: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare class UserOption extends React.PureComponent<UserOptionProps> {
|
|
10
|
+
getPrimaryText: () => jsx.JSX.Element[];
|
|
11
|
+
renderSecondaryText: () => jsx.JSX.Element | undefined;
|
|
12
|
+
private renderAvatar;
|
|
13
|
+
private getLozengeProps;
|
|
14
|
+
render(): jsx.JSX.Element;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UserPickerProps } from '../types';
|
|
3
|
+
export declare class UserPickerWithoutAnalytics extends React.Component<UserPickerProps> {
|
|
4
|
+
ufoId: string;
|
|
5
|
+
constructor(props: UserPickerProps);
|
|
6
|
+
static defaultProps: {
|
|
7
|
+
width: number;
|
|
8
|
+
isMulti: boolean;
|
|
9
|
+
};
|
|
10
|
+
componentDidMount(): void;
|
|
11
|
+
render(): JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "ariaLabelledBy" | "ariaLive"> & Partial<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "isMulti" | "width">> & Partial<Pick<{
|
|
14
|
+
width: number;
|
|
15
|
+
isMulti: boolean;
|
|
16
|
+
}, never>> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function batchByKey<T>(callback: (key: string, args: T[][]) => void): (key: string, ...args: T[]) => void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ClearIndicator } from './ClearIndicator';
|
|
3
|
+
import { MultiValue } from './MultiValue';
|
|
4
|
+
import { MultiValueContainer } from './MultiValueContainer';
|
|
5
|
+
import { Input } from './Input';
|
|
6
|
+
import { SingleValueContainer } from './SingleValueContainer';
|
|
7
|
+
import { PopupInput } from './PopupInput';
|
|
8
|
+
import { PopupControl } from './PopupControl';
|
|
9
|
+
/**
|
|
10
|
+
* Memoize getComponents to avoid rerenders.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getComponents: import("memoize-one").MemoizedFn<(multi?: boolean, anchor?: React.ComponentType<any>) => {
|
|
13
|
+
Control: import("react").ComponentType<any>;
|
|
14
|
+
Option: import("react").FC<import("./Option").OptionProps>;
|
|
15
|
+
MultiValue?: undefined;
|
|
16
|
+
DropdownIndicator?: undefined;
|
|
17
|
+
SingleValue?: undefined;
|
|
18
|
+
ClearIndicator?: undefined;
|
|
19
|
+
ValueContainer?: undefined;
|
|
20
|
+
Input?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
MultiValue: typeof MultiValue;
|
|
23
|
+
DropdownIndicator: null;
|
|
24
|
+
SingleValue: (props: import("./SingleValue").Props) => import("@emotion/react").jsx.JSX.Element | null;
|
|
25
|
+
ClearIndicator: typeof ClearIndicator | null;
|
|
26
|
+
Option: import("react").FC<import("./Option").OptionProps>;
|
|
27
|
+
ValueContainer: typeof MultiValueContainer | typeof SingleValueContainer;
|
|
28
|
+
Input: typeof Input;
|
|
29
|
+
Control?: undefined;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const getPopupComponents: import("memoize-one").MemoizedFn<(hasPopupTitle: boolean) => {
|
|
32
|
+
DropdownIndicator: null;
|
|
33
|
+
SingleValue: (props: import("./SingleValue").Props) => import("@emotion/react").jsx.JSX.Element | null;
|
|
34
|
+
ClearIndicator: typeof ClearIndicator;
|
|
35
|
+
Option: import("react").FC<import("./Option").OptionProps>;
|
|
36
|
+
ValueContainer: typeof SingleValueContainer;
|
|
37
|
+
Input: typeof PopupInput;
|
|
38
|
+
} | {
|
|
39
|
+
Control: typeof PopupControl;
|
|
40
|
+
DropdownIndicator: null;
|
|
41
|
+
SingleValue: (props: import("./SingleValue").Props) => import("@emotion/react").jsx.JSX.Element | null;
|
|
42
|
+
ClearIndicator: typeof ClearIndicator;
|
|
43
|
+
Option: import("react").FC<import("./Option").OptionProps>;
|
|
44
|
+
ValueContainer: typeof SingleValueContainer;
|
|
45
|
+
Input: typeof PopupInput;
|
|
46
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Option } from '../types';
|
|
2
|
+
import { EmailValidator } from './emailValidation';
|
|
3
|
+
declare function creatableProps(isValidEmail?: EmailValidator): {
|
|
4
|
+
allowCreateWhileLoading: boolean;
|
|
5
|
+
createOptionPosition: string;
|
|
6
|
+
isValidNewOption: (inputValue?: string | undefined) => boolean | "" | undefined;
|
|
7
|
+
getNewOptionData: (inputValue: string) => Option<import("../types").OptionData>;
|
|
8
|
+
formatCreateLabel: (inputText?: string | undefined) => string;
|
|
9
|
+
isOptionDisabled: (option: Option<import("../types").OptionData>) => boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const getCreatableProps: typeof creatableProps;
|
|
12
|
+
export {};
|