@atlaskit/user-picker 10.9.1 → 10.10.0

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 10.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`faccaf9aac7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/faccaf9aac7) - Added baseUserPicker as an argument to the onSelection callback
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
3
13
  ## 10.9.1
4
14
 
5
15
  ### Patch Changes
@@ -12,7 +12,7 @@ var _utils = require("./components/utils");
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
13
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
14
  var packageName = "@atlaskit/user-picker";
15
- var packageVersion = "10.9.1";
15
+ var packageVersion = "10.10.0";
16
16
  var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
17
17
  var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
18
18
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -89,7 +89,7 @@ var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component) {
89
89
  switch (action) {
90
90
  case 'select-option':
91
91
  if (value) {
92
- (0, _utils.callCallback)(onSelection, (0, _utils.extractOptionValue)(value), _this.getSessionId());
92
+ (0, _utils.callCallback)(onSelection, (0, _utils.extractOptionValue)(value), _this.getSessionId(), (0, _assertThisInitialized2.default)(_this));
93
93
  }
94
94
  _this.fireEvent(_analytics.selectEvent, isMulti ? option : value);
95
95
  _this.session = isMulti ? (0, _analytics.startSession)() : undefined;
@@ -2,7 +2,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import { isCustom, isExternalUser } from './components/utils';
4
4
  const packageName = "@atlaskit/user-picker";
5
- const packageVersion = "10.9.1";
5
+ const packageVersion = "10.10.0";
6
6
  const UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
7
7
  const UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
8
8
  const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -82,7 +82,7 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
82
82
  switch (action) {
83
83
  case 'select-option':
84
84
  if (value) {
85
- callCallback(onSelection, extractOptionValue(value), this.getSessionId());
85
+ callCallback(onSelection, extractOptionValue(value), this.getSessionId(), this);
86
86
  }
87
87
  this.fireEvent(selectEvent, isMulti ? option : value);
88
88
  this.session = isMulti ? startSession() : undefined;
@@ -5,7 +5,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
5
5
  import { v4 as uuidv4 } from 'uuid';
6
6
  import { isCustom, isExternalUser } from './components/utils';
7
7
  var packageName = "@atlaskit/user-picker";
8
- var packageVersion = "10.9.1";
8
+ var packageVersion = "10.10.0";
9
9
  var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
10
10
  var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
11
11
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -82,7 +82,7 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
82
82
  switch (action) {
83
83
  case 'select-option':
84
84
  if (value) {
85
- callCallback(onSelection, extractOptionValue(value), _this.getSessionId());
85
+ callCallback(onSelection, extractOptionValue(value), _this.getSessionId(), _assertThisInitialized(_this));
86
86
  }
87
87
  _this.fireEvent(selectEvent, isMulti ? option : value);
88
88
  _this.session = isMulti ? startSession() : undefined;
@@ -55,7 +55,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
55
55
  get ariaProps(): {};
56
56
  render(): JSX.Element;
57
57
  }
58
- export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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<{
58
+ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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<{
59
59
  isMulti: boolean;
60
60
  subtle: boolean;
61
61
  noBorder: boolean;
@@ -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<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "target" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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" | "placement" | "rootBoundary" | "boundariesElement" | "shouldFlip">> & Partial<Pick<{
30
+ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "target" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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" | "placement" | "rootBoundary" | "boundariesElement" | "shouldFlip">> & Partial<Pick<{
31
31
  boundariesElement: string;
32
32
  width: number;
33
33
  isMulti: boolean;
@@ -10,7 +10,7 @@ export declare class UserPickerWithoutAnalytics extends React.Component<UserPick
10
10
  componentDidMount(): void;
11
11
  render(): JSX.Element;
12
12
  }
13
- export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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<{
13
+ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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
14
  width: number;
15
15
  isMulti: boolean;
16
16
  }, never>> & React.RefAttributes<any>>;
@@ -3,6 +3,7 @@ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
3
  import { Placement } from '@atlaskit/popper';
4
4
  import { EmailValidator } from './components/emailValidation';
5
5
  import { StylesConfig } from '@atlaskit/select';
6
+ import { BaseUserPickerWithoutAnalytics } from './components/BaseUserPicker';
6
7
  export type UserPickerProps = WithAnalyticsEventsProps & {
7
8
  /**
8
9
  * Used to configure additional information regarding where the
@@ -290,7 +291,7 @@ export type ActionTypes = 'select-option' | 'deselect-option' | 'remove-value' |
290
291
  export type OnChange = (value: Value, action: ActionTypes) => void;
291
292
  export type OnInputChange = (query?: string, sessionId?: string) => void;
292
293
  export type OnPicker = (sessionId?: string) => void;
293
- export type OnOption = (value: Value, sessionId?: string) => void;
294
+ export type OnOption = (value: Value, sessionId?: string, baseUserPicker?: BaseUserPickerWithoutAnalytics) => void;
294
295
  export type Option<Data = OptionData> = {
295
296
  data: Data;
296
297
  isDisabled?: boolean;
@@ -55,7 +55,7 @@ export declare class BaseUserPickerWithoutAnalytics extends React.Component<Base
55
55
  get ariaProps(): {};
56
56
  render(): JSX.Element;
57
57
  }
58
- export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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<{
58
+ export declare const BaseUserPicker: React.ForwardRefExoticComponent<Pick<Omit<BaseUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "components" | "inputId" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "width" | "menuMinWidth" | "maxPickerHeight" | "loadOptions" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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<{
59
59
  isMulti: boolean;
60
60
  subtle: boolean;
61
61
  noBorder: boolean;
@@ -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<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "target" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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" | "placement" | "rootBoundary" | "boundariesElement" | "shouldFlip">> & Partial<Pick<{
30
+ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Pick<Omit<PopupUserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "target" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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" | "placement" | "rootBoundary" | "boundariesElement" | "shouldFlip">> & Partial<Pick<{
31
31
  boundariesElement: string;
32
32
  width: number;
33
33
  isMulti: boolean;
@@ -10,7 +10,7 @@ export declare class UserPickerWithoutAnalytics extends React.Component<UserPick
10
10
  componentDidMount(): void;
11
11
  render(): JSX.Element;
12
12
  }
13
- export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "noOptionsMessage" | "placeholder" | "isDisabled" | "name" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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<{
13
+ export declare const UserPicker: React.ForwardRefExoticComponent<Pick<Omit<UserPickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, "options" | "search" | "placeholder" | "isDisabled" | "autoFocus" | "captureMenuScroll" | "closeMenuOnScroll" | "inputId" | "isClearable" | "isLoading" | "menuPosition" | "menuPortalTarget" | "menuShouldBlockScroll" | "name" | "noOptionsMessage" | "onBlur" | "onChange" | "onFocus" | "onInputChange" | "onKeyDown" | "styles" | "value" | "footer" | "defaultValue" | "fieldId" | "menuMinWidth" | "maxPickerHeight" | "textFieldBackgroundColor" | "loadOptions" | "loadOptionsErrorMessage" | "loadUserSource" | "anchor" | "open" | "onSelection" | "onClear" | "onOpen" | "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
14
  width: number;
15
15
  isMulti: boolean;
16
16
  }, never>> & React.RefAttributes<any>>;
@@ -3,6 +3,7 @@ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
3
  import { Placement } from '@atlaskit/popper';
4
4
  import { EmailValidator } from './components/emailValidation';
5
5
  import { StylesConfig } from '@atlaskit/select';
6
+ import { BaseUserPickerWithoutAnalytics } from './components/BaseUserPicker';
6
7
  export type UserPickerProps = WithAnalyticsEventsProps & {
7
8
  /**
8
9
  * Used to configure additional information regarding where the
@@ -293,7 +294,7 @@ export type ActionTypes = 'select-option' | 'deselect-option' | 'remove-value' |
293
294
  export type OnChange = (value: Value, action: ActionTypes) => void;
294
295
  export type OnInputChange = (query?: string, sessionId?: string) => void;
295
296
  export type OnPicker = (sessionId?: string) => void;
296
- export type OnOption = (value: Value, sessionId?: string) => void;
297
+ export type OnOption = (value: Value, sessionId?: string, baseUserPicker?: BaseUserPickerWithoutAnalytics) => void;
297
298
  export type Option<Data = OptionData> = {
298
299
  data: Data;
299
300
  isDisabled?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.9.1",
3
+ "version": "10.10.0",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/select": "^16.5.0",
44
44
  "@atlaskit/spinner": "^15.5.0",
45
45
  "@atlaskit/theme": "^12.6.0",
46
- "@atlaskit/tokens": "^1.20.0",
46
+ "@atlaskit/tokens": "^1.21.0",
47
47
  "@atlaskit/tooltip": "^17.8.0",
48
48
  "@atlaskit/ufo": "^0.2.0",
49
49
  "@babel/runtime": "^7.0.0",
package/report.api.md CHANGED
@@ -47,6 +47,62 @@ export type AtlasKitSelectChange = (
47
47
  // @public (undocumented)
48
48
  export type AtlaskitSelectValue = Array<Option_2> | Option_2 | null | undefined;
49
49
 
50
+ // @public (undocumented)
51
+ type BaseUserPickerProps = UserPickerProps & {
52
+ SelectComponent: React_2.ComponentClass<any>;
53
+ pickerProps?: any;
54
+ styles: any;
55
+ components: any;
56
+ width: number | string;
57
+ name?: string;
58
+ };
59
+
60
+ // @public (undocumented)
61
+ class BaseUserPickerWithoutAnalytics extends React_2.Component<
62
+ BaseUserPickerProps,
63
+ UserPickerState
64
+ > {
65
+ constructor(props: BaseUserPickerProps);
66
+ // (undocumented)
67
+ abortOptionsShownUfoExperience: () => void;
68
+ // (undocumented)
69
+ get ariaProps(): {};
70
+ // (undocumented)
71
+ blur: () => void;
72
+ // (undocumented)
73
+ componentDidMount(): void;
74
+ // (undocumented)
75
+ componentDidUpdate(_: UserPickerProps, prevState: UserPickerState): void;
76
+ // (undocumented)
77
+ static defaultProps: {
78
+ isMulti: boolean;
79
+ subtle: boolean;
80
+ noBorder: boolean;
81
+ textFieldBackgroundColor: boolean;
82
+ isClearable: boolean;
83
+ loadOptionsErrorMessage: () => JSX.Element;
84
+ };
85
+ // (undocumented)
86
+ focus: () => void;
87
+ // (undocumented)
88
+ static getDerivedStateFromProps(
89
+ nextProps: Partial<UserPickerProps>,
90
+ prevState: UserPickerState,
91
+ ): Partial<UserPickerState>;
92
+ // (undocumented)
93
+ handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
94
+ // (undocumented)
95
+ nextOption: () => void;
96
+ // (undocumented)
97
+ previousOption: () => void;
98
+ // (undocumented)
99
+ render(): JSX.Element;
100
+ // (undocumented)
101
+ selectOption: () => void;
102
+ // (undocumented)
103
+ startOptionsShownUfoExperience: () => void;
104
+ }
105
+
50
106
  // @public (undocumented)
51
107
  type BoundariesElement = 'scrollParent' | 'viewport' | 'window' | HTMLElement;
52
108
 
@@ -196,7 +252,11 @@ export type OnChange = (value: Value, action: ActionTypes) => void;
196
252
  export type OnInputChange = (query?: string, sessionId?: string) => void;
197
253
 
198
254
  // @public (undocumented)
199
- export type OnOption = (value: Value, sessionId?: string) => void;
255
+ export type OnOption = (
256
+ value: Value,
257
+ sessionId?: string,
258
+ baseUserPicker?: BaseUserPickerWithoutAnalytics,
259
+ ) => void;
200
260
 
201
261
  // @public (undocumented)
202
262
  export type OnPicker = (sessionId?: string) => void;
@@ -26,6 +26,56 @@ export type AtlasKitSelectChange = (value: AtlaskitSelectValue, extraInfo: {
26
26
  // @public (undocumented)
27
27
  export type AtlaskitSelectValue = Array<Option_2> | Option_2 | null | undefined;
28
28
 
29
+ // @public (undocumented)
30
+ type BaseUserPickerProps = UserPickerProps & {
31
+ SelectComponent: React_2.ComponentClass<any>;
32
+ pickerProps?: any;
33
+ styles: any;
34
+ components: any;
35
+ width: number | string;
36
+ name?: string;
37
+ };
38
+
39
+ // @public (undocumented)
40
+ class BaseUserPickerWithoutAnalytics extends React_2.Component<BaseUserPickerProps, UserPickerState> {
41
+ constructor(props: BaseUserPickerProps);
42
+ // (undocumented)
43
+ abortOptionsShownUfoExperience: () => void;
44
+ // (undocumented)
45
+ get ariaProps(): {};
46
+ // (undocumented)
47
+ blur: () => void;
48
+ // (undocumented)
49
+ componentDidMount(): void;
50
+ // (undocumented)
51
+ componentDidUpdate(_: UserPickerProps, prevState: UserPickerState): void;
52
+ // (undocumented)
53
+ static defaultProps: {
54
+ isMulti: boolean;
55
+ subtle: boolean;
56
+ noBorder: boolean;
57
+ textFieldBackgroundColor: boolean;
58
+ isClearable: boolean;
59
+ loadOptionsErrorMessage: () => JSX.Element;
60
+ };
61
+ // (undocumented)
62
+ focus: () => void;
63
+ // (undocumented)
64
+ static getDerivedStateFromProps(nextProps: Partial<UserPickerProps>, prevState: UserPickerState): Partial<UserPickerState>;
65
+ // (undocumented)
66
+ handleClearIndicatorHover: (hoveringClearIndicator: boolean) => void;
67
+ // (undocumented)
68
+ nextOption: () => void;
69
+ // (undocumented)
70
+ previousOption: () => void;
71
+ // (undocumented)
72
+ render(): JSX.Element;
73
+ // (undocumented)
74
+ selectOption: () => void;
75
+ // (undocumented)
76
+ startOptionsShownUfoExperience: () => void;
77
+ }
78
+
29
79
  // @public (undocumented)
30
80
  type BoundariesElement = 'scrollParent' | 'viewport' | 'window' | HTMLElement;
31
81
 
@@ -161,7 +211,7 @@ export type OnChange = (value: Value, action: ActionTypes) => void;
161
211
  export type OnInputChange = (query?: string, sessionId?: string) => void;
162
212
 
163
213
  // @public (undocumented)
164
- export type OnOption = (value: Value, sessionId?: string) => void;
214
+ export type OnOption = (value: Value, sessionId?: string, baseUserPicker?: BaseUserPickerWithoutAnalytics) => void;
165
215
 
166
216
  // @public (undocumented)
167
217
  export type OnPicker = (sessionId?: string) => void;