@atlaskit/user-picker 8.2.0 → 8.3.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 +24 -0
- package/dist/cjs/analytics.js +2 -2
- package/dist/cjs/clients/UserSourceProvider.js +97 -0
- package/dist/cjs/components/ClearIndicator.js +2 -2
- package/dist/cjs/components/ExternalUserOption/main.js +34 -15
- package/dist/cjs/components/ExternalUserSourcesContainer.js +43 -0
- package/dist/cjs/components/MessagesIntlProvider.js +2 -2
- package/dist/cjs/components/MultiValue.js +3 -1
- package/dist/cjs/components/MultiValueContainer.js +5 -3
- package/dist/cjs/components/SingleValue.js +3 -1
- package/dist/cjs/components/SingleValueContainer.js +3 -1
- package/dist/cjs/components/SizeableAvatar.js +4 -5
- package/dist/cjs/components/UserPicker.js +10 -5
- package/dist/cjs/components/components.js +2 -2
- package/dist/cjs/components/i18n.js +5 -0
- package/dist/cjs/components/smart-user-picker/components/index.js +2 -2
- package/dist/cjs/components/smart-user-picker/config/index.js +1 -1
- package/dist/cjs/components/smart-user-picker/service/recommendationClient.js +2 -2
- package/dist/cjs/components/styles.js +9 -5
- package/dist/cjs/components/utils.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/clients/UserSourceProvider.js +56 -0
- package/dist/es2019/components/ExternalUserOption/main.js +31 -14
- package/dist/es2019/components/ExternalUserSourcesContainer.js +28 -0
- package/dist/es2019/components/UserPicker.js +7 -3
- package/dist/es2019/components/i18n.js +5 -0
- package/dist/es2019/components/smart-user-picker/config/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +2 -2
- package/dist/esm/clients/UserSourceProvider.js +73 -0
- package/dist/esm/components/ClearIndicator.js +2 -2
- package/dist/esm/components/ExternalUserOption/main.js +32 -15
- package/dist/esm/components/ExternalUserSourcesContainer.js +30 -0
- package/dist/esm/components/MessagesIntlProvider.js +2 -2
- package/dist/esm/components/MultiValue.js +2 -1
- package/dist/esm/components/MultiValueContainer.js +4 -3
- package/dist/esm/components/SingleValue.js +2 -1
- package/dist/esm/components/SingleValueContainer.js +2 -1
- package/dist/esm/components/SizeableAvatar.js +3 -3
- package/dist/esm/components/UserPicker.js +9 -5
- package/dist/esm/components/components.js +2 -2
- package/dist/esm/components/i18n.js +5 -0
- package/dist/esm/components/smart-user-picker/components/index.js +2 -2
- package/dist/esm/components/smart-user-picker/config/index.js +1 -1
- package/dist/esm/components/smart-user-picker/service/recommendationClient.js +2 -2
- package/dist/esm/components/styles.js +8 -5
- package/dist/esm/components/utils.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/clients/UserSourceProvider.d.ts +11 -0
- package/dist/types/components/BaseUserPicker.d.ts +1 -1
- package/dist/types/components/ExternalUserSourcesContainer.d.ts +15 -0
- package/dist/types/components/PopupUserPicker.d.ts +1 -1
- package/dist/types/components/UserPicker.d.ts +1 -1
- package/dist/types/components/i18n.d.ts +5 -0
- package/dist/types/types.d.ts +15 -0
- package/package.json +12 -5
|
@@ -9,9 +9,9 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
11
11
|
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
13
|
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
15
|
|
|
16
16
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
17
|
|
|
@@ -10,7 +10,7 @@ var LOCAL_CONFIG = {
|
|
|
10
10
|
};
|
|
11
11
|
var PRD_CONFIG = {
|
|
12
12
|
getRecommendationServiceUrl: function getRecommendationServiceUrl(baseUrl) {
|
|
13
|
-
return baseUrl ? "
|
|
13
|
+
return baseUrl ? "".concat(baseUrl, "/gateway/api/v1/recommendations") : '/gateway/api/v1/recommendations';
|
|
14
14
|
},
|
|
15
15
|
getUsersServiceUrl: function getUsersServiceUrl(productKey) {
|
|
16
16
|
return productKey === 'jira' ? "/rest/api/3/user/bulk" : "/wiki/rest/api/user/bulk";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
4
|
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
7
|
import { transformUsers } from './users-transformer';
|
|
8
8
|
import { getConfig } from '../config';
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
var _excluded = ["paddingTop", "paddingBottom", "paddingLeft", "paddingRight"],
|
|
4
|
+
_excluded2 = ["paddingTop", "paddingBottom", "position"],
|
|
5
|
+
_excluded3 = ["margin"];
|
|
3
6
|
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
7
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
8
|
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
10
|
|
|
8
11
|
import { AVATAR_SIZES, BORDER_WIDTH } from '@atlaskit/avatar';
|
|
9
12
|
import { B100, N0, N10, N20, N30, N40, N100, R50, R400 } from '@atlaskit/theme/colors';
|
|
@@ -52,7 +55,7 @@ export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
|
52
55
|
paddingBottom = _ref.paddingBottom,
|
|
53
56
|
paddingLeft = _ref.paddingLeft,
|
|
54
57
|
paddingRight = _ref.paddingRight,
|
|
55
|
-
css = _objectWithoutProperties(_ref,
|
|
58
|
+
css = _objectWithoutProperties(_ref, _excluded);
|
|
56
59
|
|
|
57
60
|
return _objectSpread(_objectSpread({}, css), {}, {
|
|
58
61
|
opacity: 0,
|
|
@@ -73,7 +76,7 @@ export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
|
73
76
|
var paddingTop = _ref2.paddingTop,
|
|
74
77
|
paddingBottom = _ref2.paddingBottom,
|
|
75
78
|
position = _ref2.position,
|
|
76
|
-
css = _objectWithoutProperties(_ref2,
|
|
79
|
+
css = _objectWithoutProperties(_ref2, _excluded2);
|
|
77
80
|
|
|
78
81
|
var isCompact = state.selectProps.appearance === 'compact';
|
|
79
82
|
var isMulti = state.selectProps.isMulti;
|
|
@@ -142,7 +145,7 @@ export var getStyles = memoizeOne(function (width, isMulti, overrideStyles) {
|
|
|
142
145
|
},
|
|
143
146
|
input: function input(_ref3) {
|
|
144
147
|
var margin = _ref3.margin,
|
|
145
|
-
css = _objectWithoutProperties(_ref3,
|
|
148
|
+
css = _objectWithoutProperties(_ref3, _excluded3);
|
|
146
149
|
|
|
147
150
|
return _objectSpread(_objectSpread({}, css), {}, {
|
|
148
151
|
display: 'flex',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
8
|
import memoizeOne from 'memoize-one';
|
|
9
9
|
import { EmailType, TeamType, GroupType, UserType } from '../types';
|
package/dist/esm/version.json
CHANGED
|
@@ -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[] | undefined) => {
|
|
8
|
+
sources: UserSource[];
|
|
9
|
+
loading: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
};
|
|
@@ -48,7 +48,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
|
|
|
48
48
|
private getAppearance;
|
|
49
49
|
render(): JSX.Element;
|
|
50
50
|
}
|
|
51
|
-
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Pick<BaseUserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps"> & Partial<Pick<Pick<BaseUserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "subtle" | "noBorder">> & Partial<Pick<{
|
|
51
|
+
export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Pick<BaseUserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps"> & Partial<Pick<Pick<BaseUserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "SelectComponent" | "pickerProps">, "isClearable" | "isMulti" | "textFieldBackgroundColor" | "subtle" | "noBorder">> & Partial<Pick<{
|
|
52
52
|
isMulti: boolean;
|
|
53
53
|
subtle: boolean;
|
|
54
54
|
noBorder: boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { UserSource } from '../types';
|
|
3
|
+
declare type SourcesChildrenFunc = ({ sources, sourcesLoading, sourcesError, }: {
|
|
4
|
+
sources: UserSource[];
|
|
5
|
+
sourcesLoading: boolean;
|
|
6
|
+
sourcesError: string | null;
|
|
7
|
+
}) => 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 {};
|
|
@@ -27,7 +27,7 @@ export declare class PopupUserPickerWithoutAnalytics extends React.Component<Pop
|
|
|
27
27
|
};
|
|
28
28
|
render(): JSX.Element;
|
|
29
29
|
}
|
|
30
|
-
export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Pick<PopupUserPickerProps, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "offset" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle"> & Partial<Pick<Pick<PopupUserPickerProps, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "offset" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">, "isMulti" | "offset" | "width" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">> & Partial<Pick<{
|
|
30
|
+
export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Pick<PopupUserPickerProps, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "offset" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle"> & Partial<Pick<Pick<PopupUserPickerProps, "placeholder" | "target" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "offset" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions" | "popupTitle" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">, "isMulti" | "offset" | "width" | "boundariesElement" | "placement" | "rootBoundary" | "shouldFlip">> & Partial<Pick<{
|
|
31
31
|
boundariesElement: string;
|
|
32
32
|
width: number;
|
|
33
33
|
isMulti: boolean;
|
|
@@ -7,7 +7,7 @@ export declare class UserPickerWithoutAnalytics extends React.Component<UserPick
|
|
|
7
7
|
};
|
|
8
8
|
render(): JSX.Element;
|
|
9
9
|
}
|
|
10
|
-
export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions"> & Partial<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "isMulti" | "width">> & Partial<Pick<{
|
|
10
|
+
export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions"> & Partial<Pick<Pick<UserPickerProps, "placeholder" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isDisabled" | "isLoading" | "isMulti" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "options" | "styles" | "value" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadUserSource" | "search" | "anchor" | "open" | "onSelection" | "onClear" | "onClose" | "appearance" | "subtle" | "noBorder" | "addMoreMessage" | "clearValueLabel" | "allowEmail" | "suggestEmailsForDomain" | "emailLabel" | "disableInput" | "isValidEmail" | "maxOptions">, "isMulti" | "width">> & Partial<Pick<{
|
|
11
11
|
width: number;
|
|
12
12
|
isMulti: boolean;
|
|
13
13
|
}, never>> & React.RefAttributes<any>>;
|
|
@@ -64,6 +64,11 @@ export declare const messages: {
|
|
|
64
64
|
defaultMessage: string;
|
|
65
65
|
description: string;
|
|
66
66
|
};
|
|
67
|
+
externalUserSourcesError: {
|
|
68
|
+
id: string;
|
|
69
|
+
defaultMessage: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
67
72
|
slackProvider: {
|
|
68
73
|
id: string;
|
|
69
74
|
defaultMessage: string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -39,6 +39,13 @@ export declare type UserPickerProps = WithAnalyticsEventsProps & {
|
|
|
39
39
|
* sessionId?: user picker session identifier, used to track success metric for users providers
|
|
40
40
|
*/
|
|
41
41
|
loadOptions?: LoadOptions;
|
|
42
|
+
/**
|
|
43
|
+
* Function used to load user source if they are an external user.
|
|
44
|
+
* accepts two params:
|
|
45
|
+
* accountId: account ID of the user to lookup sources
|
|
46
|
+
* signal: AbortController signal to abort the request if the tooltip is closed
|
|
47
|
+
*/
|
|
48
|
+
loadUserSource?: LoadUserSource;
|
|
42
49
|
/** Callback for value change events fired whenever a selection is inserted or removed. */
|
|
43
50
|
onChange?: OnChange;
|
|
44
51
|
/** To enable multi user picker. */
|
|
@@ -203,6 +210,7 @@ export interface OptionData {
|
|
|
203
210
|
export declare const UserType = "user";
|
|
204
211
|
export declare type UserSource = 'google' | 'slack' | 'microsoft' | 'github';
|
|
205
212
|
export interface ExternalUser extends User {
|
|
213
|
+
requiresSourceHydration?: boolean;
|
|
206
214
|
sources: UserSource[];
|
|
207
215
|
}
|
|
208
216
|
export interface User extends OptionData {
|
|
@@ -253,6 +261,13 @@ export declare type Option<Data = OptionData> = {
|
|
|
253
261
|
value: string;
|
|
254
262
|
data: Data;
|
|
255
263
|
};
|
|
264
|
+
export interface UserSourceResult {
|
|
265
|
+
sourceId: string;
|
|
266
|
+
sourceType: UserSource;
|
|
267
|
+
}
|
|
268
|
+
export interface LoadUserSource {
|
|
269
|
+
(accountId: string, signal?: AbortSignal): Promise<UserSourceResult[]>;
|
|
270
|
+
}
|
|
256
271
|
export interface LoadOptions {
|
|
257
272
|
(searchText?: string, sessionId?: string): Promisable<OptionData | OptionData[]> | Iterable<Promisable<OptionData[] | OptionData> | OptionData | OptionData[]>;
|
|
258
273
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "8.2
|
|
3
|
+
"version": "8.3.2",
|
|
4
4
|
"description": "Fabric component for display a dropdown to select a user from",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,15 +28,16 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
30
30
|
"@atlaskit/avatar": "^20.5.0",
|
|
31
|
-
"@atlaskit/icon": "^21.
|
|
31
|
+
"@atlaskit/icon": "^21.10.0",
|
|
32
32
|
"@atlaskit/lozenge": "^11.0.0",
|
|
33
33
|
"@atlaskit/popper": "^5.0.0",
|
|
34
34
|
"@atlaskit/select": "^15.2.0",
|
|
35
|
-
"@atlaskit/
|
|
35
|
+
"@atlaskit/spinner": "^15.1.4",
|
|
36
|
+
"@atlaskit/theme": "^12.1.0",
|
|
36
37
|
"@atlaskit/tokens": "^0.4.0",
|
|
37
38
|
"@atlaskit/tooltip": "^17.5.0",
|
|
38
39
|
"@babel/runtime": "^7.0.0",
|
|
39
|
-
"lodash": "^4.17.
|
|
40
|
+
"lodash": "^4.17.21",
|
|
40
41
|
"memoize-one": "^6.0.0",
|
|
41
42
|
"uuid": "^3.1.0"
|
|
42
43
|
},
|
|
@@ -52,11 +53,17 @@
|
|
|
52
53
|
"@atlaskit/docs": "*",
|
|
53
54
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
54
55
|
"@atlaskit/modal-dialog": "^12.2.0",
|
|
56
|
+
"@atlaskit/radio": "^5.3.4",
|
|
55
57
|
"@atlaskit/range": "^5.0.11",
|
|
56
58
|
"@atlaskit/section-message": "^6.0.0",
|
|
57
59
|
"@atlaskit/textfield": "^5.0.0",
|
|
58
|
-
"@atlaskit/util-data-test": "^17.
|
|
60
|
+
"@atlaskit/util-data-test": "^17.1.0",
|
|
59
61
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
62
|
+
"@testing-library/dom": "^7.7.3",
|
|
63
|
+
"@testing-library/jest-dom": "^4.1.0",
|
|
64
|
+
"@testing-library/react": "^8.0.1",
|
|
65
|
+
"@testing-library/react-hooks": "^1.0.4",
|
|
66
|
+
"@testing-library/user-event": "10.4.0",
|
|
60
67
|
"@types/uuid": "^3.4.4",
|
|
61
68
|
"enzyme": "^3.10.0",
|
|
62
69
|
"enzyme-react-intl": "^2.0.6",
|