@elastic/eui 95.1.0 → 95.2.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/dist/eui_theme_dark.css +0 -240
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -240
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/es/components/context_menu/context_menu_item.js +1 -1
- package/es/components/form/file_picker/file_picker.js +49 -35
- package/es/components/form/file_picker/file_picker.styles.js +98 -0
- package/es/components/icon/assets/app_cases.js +9 -7
- package/es/components/icon/assets/logo_elastic_stack.js +6 -12
- package/es/components/steps/step.js +5 -3
- package/es/components/steps/step.styles.js +13 -5
- package/es/components/steps/step_horizontal.js +8 -3
- package/es/components/steps/step_horizontal.styles.js +1 -0
- package/es/components/steps/step_number.js +48 -24
- package/es/components/steps/step_number.styles.js +4 -2
- package/es/components/steps/steps.js +3 -1
- package/es/components/steps/steps_horizontal.js +1 -1
- package/es/services/theme/warning.js +7 -2
- package/eui.d.ts +72 -20
- package/i18ntokens.json +16 -16
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/lib/components/context_menu/context_menu_item.js +1 -1
- package/lib/components/form/file_picker/file_picker.js +51 -37
- package/lib/components/form/file_picker/file_picker.styles.js +102 -0
- package/lib/components/icon/assets/app_cases.js +9 -7
- package/lib/components/icon/assets/logo_elastic_stack.js +6 -12
- package/lib/components/icon/svgs/app_cases.svg +6 -5
- package/lib/components/icon/svgs/logo_elastic_stack.svg +4 -7
- package/lib/components/steps/step.js +5 -3
- package/lib/components/steps/step.styles.js +13 -5
- package/lib/components/steps/step_horizontal.js +8 -3
- package/lib/components/steps/step_horizontal.styles.js +1 -0
- package/lib/components/steps/step_number.js +48 -24
- package/lib/components/steps/step_number.styles.js +3 -1
- package/lib/components/steps/steps.js +3 -1
- package/lib/components/steps/steps_horizontal.js +1 -1
- package/lib/services/theme/warning.js +7 -2
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/es/components/form/file_picker/file_picker.js +40 -34
- package/optimize/es/components/form/file_picker/file_picker.styles.js +98 -0
- package/optimize/es/components/icon/assets/app_cases.js +9 -7
- package/optimize/es/components/icon/assets/logo_elastic_stack.js +6 -12
- package/optimize/es/components/steps/step.js +2 -2
- package/optimize/es/components/steps/step.styles.js +13 -5
- package/optimize/es/components/steps/step_horizontal.js +8 -3
- package/optimize/es/components/steps/step_horizontal.styles.js +1 -0
- package/optimize/es/components/steps/step_number.js +44 -22
- package/optimize/es/components/steps/step_number.styles.js +4 -2
- package/optimize/es/components/steps/steps_horizontal.js +1 -1
- package/optimize/es/services/theme/warning.js +7 -2
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/optimize/lib/components/form/file_picker/file_picker.js +42 -36
- package/optimize/lib/components/form/file_picker/file_picker.styles.js +102 -0
- package/optimize/lib/components/icon/assets/app_cases.js +9 -7
- package/optimize/lib/components/icon/assets/logo_elastic_stack.js +6 -12
- package/optimize/lib/components/icon/svgs/app_cases.svg +6 -5
- package/optimize/lib/components/icon/svgs/logo_elastic_stack.svg +4 -7
- package/optimize/lib/components/steps/step.js +2 -2
- package/optimize/lib/components/steps/step.styles.js +13 -5
- package/optimize/lib/components/steps/step_horizontal.js +8 -3
- package/optimize/lib/components/steps/step_horizontal.styles.js +1 -0
- package/optimize/lib/components/steps/step_number.js +44 -22
- package/optimize/lib/components/steps/step_number.styles.js +3 -1
- package/optimize/lib/components/steps/steps_horizontal.js +1 -1
- package/optimize/lib/services/theme/warning.js +7 -2
- package/package.json +1 -1
- package/src/components/form/_index.scss +0 -1
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +2 -1
- package/test-env/components/context_menu/context_menu_item.js +1 -1
- package/test-env/components/form/file_picker/file_picker.js +46 -37
- package/test-env/components/form/file_picker/file_picker.styles.js +102 -0
- package/test-env/components/icon/assets/app_cases.js +9 -7
- package/test-env/components/icon/assets/logo_elastic_stack.js +6 -12
- package/test-env/components/steps/step.js +5 -3
- package/test-env/components/steps/step.styles.js +13 -5
- package/test-env/components/steps/step_horizontal.js +8 -3
- package/test-env/components/steps/step_horizontal.styles.js +1 -0
- package/test-env/components/steps/step_number.js +48 -24
- package/test-env/components/steps/step_number.styles.js +3 -1
- package/test-env/components/steps/steps.js +3 -1
- package/test-env/components/steps/steps_horizontal.js +1 -1
- package/test-env/services/theme/warning.js +7 -2
- package/src/components/form/file_picker/_file_picker.scss +0 -212
- package/src/components/form/file_picker/_index.scss +0 -2
- package/src/components/form/file_picker/_variables.scss +0 -1
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
var providerWarning = undefined;
|
|
10
|
-
export var setEuiDevProviderWarning = function setEuiDevProviderWarning(
|
|
11
|
-
return providerWarning =
|
|
10
|
+
export var setEuiDevProviderWarning = function setEuiDevProviderWarning(warningType) {
|
|
11
|
+
return providerWarning = warningType;
|
|
12
12
|
};
|
|
13
13
|
export var getEuiDevProviderWarning = function getEuiDevProviderWarning() {
|
|
14
14
|
return providerWarning;
|
|
@@ -16,6 +16,11 @@ export var getEuiDevProviderWarning = function getEuiDevProviderWarning() {
|
|
|
16
16
|
|
|
17
17
|
// Not a public top-level EUI export, currently for internal use
|
|
18
18
|
export var emitEuiProviderWarning = function emitEuiProviderWarning(providerMessage) {
|
|
19
|
+
// Handle callback types
|
|
20
|
+
if (typeof providerWarning === 'function') {
|
|
21
|
+
return providerWarning(providerMessage);
|
|
22
|
+
}
|
|
23
|
+
// Handle level types
|
|
19
24
|
switch (providerWarning) {
|
|
20
25
|
case 'log':
|
|
21
26
|
console.log(providerMessage);
|
package/eui.d.ts
CHANGED
|
@@ -1290,9 +1290,9 @@ declare module '@elastic/eui/src/global_styling/functions/size' {
|
|
|
1290
1290
|
|
|
1291
1291
|
}
|
|
1292
1292
|
declare module '@elastic/eui/src/services/theme/warning' {
|
|
1293
|
-
type LEVELS = 'log' | 'warn' | 'error';
|
|
1294
|
-
export const setEuiDevProviderWarning: (
|
|
1295
|
-
export const getEuiDevProviderWarning: () => LEVELS | undefined;
|
|
1293
|
+
type LEVELS = 'log' | 'warn' | 'error'; type ProviderCallback = (message: string | Error) => void; let providerWarning: LEVELS | ProviderCallback | undefined;
|
|
1294
|
+
export const setEuiDevProviderWarning: (warningType: typeof providerWarning) => LEVELS | ProviderCallback | undefined;
|
|
1295
|
+
export const getEuiDevProviderWarning: () => LEVELS | ProviderCallback | undefined;
|
|
1296
1296
|
export const emitEuiProviderWarning: (providerMessage: string) => void;
|
|
1297
1297
|
export {};
|
|
1298
1298
|
|
|
@@ -4628,8 +4628,9 @@ declare module '@elastic/eui/src/components/context_menu/context_menu_item.style
|
|
|
4628
4628
|
declare module '@elastic/eui/src/components/context_menu/context_menu_item' {
|
|
4629
4629
|
import React, { PropsWithChildren, ButtonHTMLAttributes, FunctionComponent, ReactElement, ReactNode, Ref } from 'react';
|
|
4630
4630
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
4631
|
+
import { type IconType } from '@elastic/eui/src/components/icon';
|
|
4631
4632
|
import { EuiToolTipProps } from '@elastic/eui/src/components/tool_tip';
|
|
4632
|
-
export type EuiContextMenuItemIcon = ReactElement<any> |
|
|
4633
|
+
export type EuiContextMenuItemIcon = IconType | ReactElement<any> | HTMLElement;
|
|
4633
4634
|
export type EuiContextMenuItemLayoutAlignment = 'center' | 'top' | 'bottom';
|
|
4634
4635
|
export const SIZES: readonly ["s", "m"];
|
|
4635
4636
|
export interface EuiContextMenuItemProps extends PropsWithChildren, CommonProps {
|
|
@@ -6746,22 +6747,58 @@ declare module '@elastic/eui/src/components/progress' {
|
|
|
6746
6747
|
export type { EuiProgressProps } from '@elastic/eui/src/components/progress/progress';
|
|
6747
6748
|
export { EuiProgress } from '@elastic/eui/src/components/progress/progress';
|
|
6748
6749
|
|
|
6750
|
+
}
|
|
6751
|
+
declare module '@elastic/eui/src/components/form/file_picker/file_picker.styles' {
|
|
6752
|
+
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
6753
|
+
export const euiFilePickerStyles: (euiThemeContext: UseEuiTheme) => {
|
|
6754
|
+
euiFilePicker: import("@emotion/utils").SerializedStyles;
|
|
6755
|
+
isDroppingFile: import("@emotion/utils").SerializedStyles;
|
|
6756
|
+
invalid: import("@emotion/utils").SerializedStyles;
|
|
6757
|
+
hasFiles: import("@emotion/utils").SerializedStyles;
|
|
6758
|
+
loading: import("@emotion/utils").SerializedStyles;
|
|
6759
|
+
formWidth: string;
|
|
6760
|
+
fullWidth: import("@emotion/utils").SerializedStyles;
|
|
6761
|
+
input: {
|
|
6762
|
+
euiFilePicker__input: import("@emotion/utils").SerializedStyles;
|
|
6763
|
+
largeInteractive: import("@emotion/utils").SerializedStyles;
|
|
6764
|
+
};
|
|
6765
|
+
euiFilePicker__prompt: import("@emotion/utils").SerializedStyles;
|
|
6766
|
+
disabled: import("@emotion/utils").SerializedStyles;
|
|
6767
|
+
uncompressed: string;
|
|
6768
|
+
compressed: import("@emotion/utils").SerializedStyles;
|
|
6769
|
+
large: {
|
|
6770
|
+
large: import("@emotion/utils").SerializedStyles;
|
|
6771
|
+
uncompressed: string;
|
|
6772
|
+
compressed: import("@emotion/utils").SerializedStyles;
|
|
6773
|
+
};
|
|
6774
|
+
icon: {
|
|
6775
|
+
euiFilePicker__icon: import("@emotion/utils").SerializedStyles;
|
|
6776
|
+
normal: import("@emotion/utils").SerializedStyles;
|
|
6777
|
+
uncompressed: string;
|
|
6778
|
+
compresssed: import("@emotion/utils").SerializedStyles;
|
|
6779
|
+
large: import("@emotion/utils").SerializedStyles;
|
|
6780
|
+
};
|
|
6781
|
+
rightIcon: {
|
|
6782
|
+
euiFilePicker__rightIcon: import("@emotion/utils").SerializedStyles;
|
|
6783
|
+
uncompressed: string;
|
|
6784
|
+
compressed: import("@emotion/utils").SerializedStyles;
|
|
6785
|
+
};
|
|
6786
|
+
euiFilePicker__clearButton: import("@emotion/utils").SerializedStyles;
|
|
6787
|
+
};
|
|
6788
|
+
|
|
6749
6789
|
}
|
|
6750
6790
|
declare module '@elastic/eui/src/components/form/file_picker/file_picker' {
|
|
6751
6791
|
import React, { Component, InputHTMLAttributes, ReactNode } from 'react';
|
|
6792
|
+
import { WithEuiStylesMemoizerProps } from '@elastic/eui/src/services';
|
|
6752
6793
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
6753
|
-
import { FormContextValue } from '@elastic/eui/src/components/form/eui_form_context';
|
|
6754
|
-
default: null;
|
|
6755
|
-
large: string;
|
|
6756
|
-
};
|
|
6757
|
-
export const DISPLAYS: ("default" | "large")[];
|
|
6758
|
-
export type EuiFilePickerDisplay = keyof typeof displayToClassNameMap;
|
|
6794
|
+
import { FormContextValue } from '@elastic/eui/src/components/form/eui_form_context';
|
|
6759
6795
|
export interface EuiFilePickerProps extends CommonProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
6760
6796
|
id?: string;
|
|
6761
6797
|
name?: string;
|
|
6762
6798
|
className?: string;
|
|
6763
6799
|
/**
|
|
6764
6800
|
* The content that appears in the dropzone if no file is attached
|
|
6801
|
+
* @default 'Select or drag and drop a file'
|
|
6765
6802
|
*/
|
|
6766
6803
|
initialPromptText?: ReactNode;
|
|
6767
6804
|
/**
|
|
@@ -6770,14 +6807,16 @@ declare module '@elastic/eui/src/components/form/file_picker/file_picker' {
|
|
|
6770
6807
|
onChange?: (files: FileList | null) => void;
|
|
6771
6808
|
/**
|
|
6772
6809
|
* Reduces the size to a typical (compressed) input
|
|
6810
|
+
* @default false
|
|
6773
6811
|
*/
|
|
6774
6812
|
compressed?: boolean;
|
|
6775
6813
|
/**
|
|
6776
6814
|
* Size or type of display;
|
|
6777
6815
|
* `default` for normal height, similar to other controls;
|
|
6778
6816
|
* `large` for taller size
|
|
6817
|
+
* @default large
|
|
6779
6818
|
*/
|
|
6780
|
-
display?:
|
|
6819
|
+
display?: 'default' | 'large';
|
|
6781
6820
|
/**
|
|
6782
6821
|
* Expand to fill 100% of the parent.
|
|
6783
6822
|
* Defaults to `fullWidth` prop of `<EuiForm>`.
|
|
@@ -6788,7 +6827,7 @@ declare module '@elastic/eui/src/components/form/file_picker/file_picker' {
|
|
|
6788
6827
|
isLoading?: boolean;
|
|
6789
6828
|
disabled?: boolean;
|
|
6790
6829
|
}
|
|
6791
|
-
export class
|
|
6830
|
+
export class EuiFilePickerClass extends Component<EuiFilePickerProps & WithEuiStylesMemoizerProps> {
|
|
6792
6831
|
static contextType: React.Context<FormContextValue>;
|
|
6793
6832
|
static defaultProps: Partial<EuiFilePickerProps>;
|
|
6794
6833
|
state: {
|
|
@@ -6803,7 +6842,7 @@ declare module '@elastic/eui/src/components/form/file_picker/file_picker' {
|
|
|
6803
6842
|
hideDrop: () => void;
|
|
6804
6843
|
render(): React.JSX.Element;
|
|
6805
6844
|
}
|
|
6806
|
-
export
|
|
6845
|
+
export const EuiFilePicker: React.ForwardRefExoticComponent<Omit<EuiFilePickerProps, "stylesMemoizer"> & React.RefAttributes<Omit<EuiFilePickerProps, "stylesMemoizer">>>;
|
|
6807
6846
|
|
|
6808
6847
|
}
|
|
6809
6848
|
declare module '@elastic/eui/src/components/form/file_picker' {
|
|
@@ -22659,6 +22698,7 @@ declare module '@elastic/eui/src/components/steps/step.styles' {
|
|
|
22659
22698
|
export const euiStepVariables: (euiTheme: UseEuiTheme['euiTheme']) => {
|
|
22660
22699
|
numberSize: string;
|
|
22661
22700
|
numberXSSize: string;
|
|
22701
|
+
numberXXSSize: string;
|
|
22662
22702
|
numberMargin: string;
|
|
22663
22703
|
};
|
|
22664
22704
|
export const euiStepStyles: (euiThemeContext: UseEuiTheme) => {
|
|
@@ -22666,12 +22706,14 @@ declare module '@elastic/eui/src/components/steps/step.styles' {
|
|
|
22666
22706
|
m: import("@emotion/utils").SerializedStyles;
|
|
22667
22707
|
s: import("@emotion/utils").SerializedStyles;
|
|
22668
22708
|
xs: import("@emotion/utils").SerializedStyles;
|
|
22709
|
+
xxs: import("@emotion/utils").SerializedStyles;
|
|
22669
22710
|
};
|
|
22670
22711
|
export const euiStepContentStyles: (euiThemeContext: UseEuiTheme) => {
|
|
22671
22712
|
euiStep__content: import("@emotion/utils").SerializedStyles;
|
|
22672
22713
|
m: import("@emotion/utils").SerializedStyles;
|
|
22673
22714
|
readonly s: import("@emotion/utils").SerializedStyles;
|
|
22674
22715
|
xs: import("@emotion/utils").SerializedStyles;
|
|
22716
|
+
xxs: import("@emotion/utils").SerializedStyles;
|
|
22675
22717
|
};
|
|
22676
22718
|
export const euiStepTitleStyles: (euiThemeContext: UseEuiTheme) => {
|
|
22677
22719
|
euiStep__titleWrapper: import("@emotion/utils").SerializedStyles;
|
|
@@ -22680,6 +22722,7 @@ declare module '@elastic/eui/src/components/steps/step.styles' {
|
|
|
22680
22722
|
m: import("@emotion/utils").SerializedStyles;
|
|
22681
22723
|
s: import("@emotion/utils").SerializedStyles;
|
|
22682
22724
|
xs: import("@emotion/utils").SerializedStyles;
|
|
22725
|
+
xxs: import("@emotion/utils").SerializedStyles;
|
|
22683
22726
|
};
|
|
22684
22727
|
|
|
22685
22728
|
}
|
|
@@ -22690,6 +22733,7 @@ declare module '@elastic/eui/src/components/steps/step_number.styles' {
|
|
|
22690
22733
|
m: import("@emotion/utils").SerializedStyles;
|
|
22691
22734
|
s: import("@emotion/utils").SerializedStyles;
|
|
22692
22735
|
xs: import("@emotion/utils").SerializedStyles;
|
|
22736
|
+
none: import("@emotion/utils").SerializedStyles;
|
|
22693
22737
|
incomplete: import("@emotion/utils").SerializedStyles;
|
|
22694
22738
|
disabled: import("@emotion/utils").SerializedStyles;
|
|
22695
22739
|
loading: import("@emotion/utils").SerializedStyles;
|
|
@@ -22708,13 +22752,14 @@ declare module '@elastic/eui/src/components/steps/step_number.styles' {
|
|
|
22708
22752
|
loading: import("@emotion/utils").SerializedStyles;
|
|
22709
22753
|
disabled: import("@emotion/utils").SerializedStyles;
|
|
22710
22754
|
current: import("@emotion/utils").SerializedStyles;
|
|
22755
|
+
none: import("@emotion/utils").SerializedStyles;
|
|
22711
22756
|
};
|
|
22712
22757
|
|
|
22713
22758
|
}
|
|
22714
22759
|
declare module '@elastic/eui/src/components/steps/step_number' {
|
|
22715
22760
|
import { FunctionComponent, HTMLAttributes } from 'react';
|
|
22716
22761
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
22717
|
-
import {
|
|
22762
|
+
import { EuiTitleProps } from '@elastic/eui/src/components/title';
|
|
22718
22763
|
export const STATUS: readonly ["incomplete", "disabled", "loading", "warning", "danger", "complete", "current"];
|
|
22719
22764
|
export type EuiStepStatus = (typeof STATUS)[number];
|
|
22720
22765
|
export interface EuiStepNumberProps extends CommonProps, HTMLAttributes<HTMLDivElement> {
|
|
@@ -22724,9 +22769,11 @@ declare module '@elastic/eui/src/components/steps/step_number' {
|
|
|
22724
22769
|
status?: EuiStepStatus;
|
|
22725
22770
|
number?: number;
|
|
22726
22771
|
/**
|
|
22727
|
-
* Title sizing equivalent to EuiTitle, but only `m`, `s
|
|
22772
|
+
* Title sizing equivalent to EuiTitle, but only `m`, `s`, `xs`.
|
|
22773
|
+
* `none` indicates no step number should be rendered.
|
|
22774
|
+
* @default s
|
|
22728
22775
|
*/
|
|
22729
|
-
titleSize?:
|
|
22776
|
+
titleSize?: Extract<EuiTitleProps['size'], 'xs' | 's' | 'm'> | 'none';
|
|
22730
22777
|
}
|
|
22731
22778
|
export const EuiStepNumber: FunctionComponent<EuiStepNumberProps>;
|
|
22732
22779
|
|
|
@@ -22755,9 +22802,11 @@ declare module '@elastic/eui/src/components/steps/step' {
|
|
|
22755
22802
|
*/
|
|
22756
22803
|
status?: EuiStepStatus;
|
|
22757
22804
|
/**
|
|
22758
|
-
* Title sizing equivalent to EuiTitle
|
|
22805
|
+
* Title sizing equivalent to **EuiTitle**, but only `m`, `s`, `xs` font sizes.
|
|
22806
|
+
* The `xxs` size reduces the size of the accompanying step indicator, but not the title itself.
|
|
22807
|
+
* @default s
|
|
22759
22808
|
*/
|
|
22760
|
-
titleSize?:
|
|
22809
|
+
titleSize?: Extract<EuiTitleProps['size'], 'xxs' | 'xs' | 's' | 'm'>;
|
|
22761
22810
|
}
|
|
22762
22811
|
export type EuiStepProps = CommonProps & Omit<HTMLAttributes<HTMLDivElement>, 'title'> & EuiStepInterface;
|
|
22763
22812
|
export const EuiStep: FunctionComponent<EuiStepProps>;
|
|
@@ -22782,7 +22831,9 @@ declare module '@elastic/eui/src/components/steps/steps' {
|
|
|
22782
22831
|
*/
|
|
22783
22832
|
headingElement?: string;
|
|
22784
22833
|
/**
|
|
22785
|
-
* Title sizing equivalent to EuiTitle
|
|
22834
|
+
* Title sizing equivalent to **EuiTitle**, but only `m`, `s`, `xs` font sizes.
|
|
22835
|
+
* The `xxs` size reduces the size of the accompanying step indicator, but not the title itself.
|
|
22836
|
+
* @default s
|
|
22786
22837
|
*/
|
|
22787
22838
|
titleSize?: EuiStepProps['titleSize'];
|
|
22788
22839
|
}
|
|
@@ -22814,7 +22865,7 @@ declare module '@elastic/eui/src/components/steps/steps_horizontal' {
|
|
|
22814
22865
|
import { FunctionComponent, OlHTMLAttributes } from 'react';
|
|
22815
22866
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
22816
22867
|
import { EuiStepHorizontalProps } from '@elastic/eui/src/components/steps/step_horizontal';
|
|
22817
|
-
export const SIZES: readonly ["s", "m"];
|
|
22868
|
+
export const SIZES: readonly ["xs", "s", "m"];
|
|
22818
22869
|
export type EuiStepsHorizontalSizes = (typeof SIZES)[number];
|
|
22819
22870
|
export interface EuiStepsHorizontalProps extends OlHTMLAttributes<HTMLOListElement>, CommonProps {
|
|
22820
22871
|
/**
|
|
@@ -22832,6 +22883,7 @@ declare module '@elastic/eui/src/components/steps/step_horizontal.styles' {
|
|
|
22832
22883
|
euiStepHorizontal: import("@emotion/utils").SerializedStyles;
|
|
22833
22884
|
m: import("@emotion/utils").SerializedStyles;
|
|
22834
22885
|
s: import("@emotion/utils").SerializedStyles;
|
|
22886
|
+
xs: import("@emotion/utils").SerializedStyles;
|
|
22835
22887
|
enabled: import("@emotion/utils").SerializedStyles;
|
|
22836
22888
|
disabled: import("@emotion/utils").SerializedStyles;
|
|
22837
22889
|
};
|
package/i18ntokens.json
CHANGED
|
@@ -4793,14 +4793,14 @@
|
|
|
4793
4793
|
"highlighting": "string",
|
|
4794
4794
|
"loc": {
|
|
4795
4795
|
"start": {
|
|
4796
|
-
"line":
|
|
4796
|
+
"line": 76,
|
|
4797
4797
|
"column": 6,
|
|
4798
|
-
"index":
|
|
4798
|
+
"index": 2335
|
|
4799
4799
|
},
|
|
4800
4800
|
"end": {
|
|
4801
|
-
"line":
|
|
4801
|
+
"line": 79,
|
|
4802
4802
|
"column": 8,
|
|
4803
|
-
"index":
|
|
4803
|
+
"index": 2442
|
|
4804
4804
|
}
|
|
4805
4805
|
},
|
|
4806
4806
|
"filepath": "src/components/form/file_picker/file_picker.tsx"
|
|
@@ -4811,14 +4811,14 @@
|
|
|
4811
4811
|
"highlighting": "string",
|
|
4812
4812
|
"loc": {
|
|
4813
4813
|
"start": {
|
|
4814
|
-
"line":
|
|
4814
|
+
"line": 100,
|
|
4815
4815
|
"column": 10,
|
|
4816
|
-
"index":
|
|
4816
|
+
"index": 2840
|
|
4817
4817
|
},
|
|
4818
4818
|
"end": {
|
|
4819
|
-
"line":
|
|
4819
|
+
"line": 104,
|
|
4820
4820
|
"column": 12,
|
|
4821
|
-
"index":
|
|
4821
|
+
"index": 3022
|
|
4822
4822
|
}
|
|
4823
4823
|
},
|
|
4824
4824
|
"filepath": "src/components/form/file_picker/file_picker.tsx"
|
|
@@ -4829,14 +4829,14 @@
|
|
|
4829
4829
|
"highlighting": "string",
|
|
4830
4830
|
"loc": {
|
|
4831
4831
|
"start": {
|
|
4832
|
-
"line":
|
|
4832
|
+
"line": 146,
|
|
4833
4833
|
"column": 6,
|
|
4834
|
-
"index":
|
|
4834
|
+
"index": 3885
|
|
4835
4835
|
},
|
|
4836
4836
|
"end": {
|
|
4837
|
-
"line":
|
|
4837
|
+
"line": 149,
|
|
4838
4838
|
"column": 7,
|
|
4839
|
-
"index":
|
|
4839
|
+
"index": 3989
|
|
4840
4840
|
}
|
|
4841
4841
|
},
|
|
4842
4842
|
"filepath": "src/components/form/file_picker/file_picker.tsx"
|
|
@@ -4847,14 +4847,14 @@
|
|
|
4847
4847
|
"highlighting": "string",
|
|
4848
4848
|
"loc": {
|
|
4849
4849
|
"start": {
|
|
4850
|
-
"line":
|
|
4850
|
+
"line": 263,
|
|
4851
4851
|
"column": 18,
|
|
4852
|
-
"index":
|
|
4852
|
+
"index": 7913
|
|
4853
4853
|
},
|
|
4854
4854
|
"end": {
|
|
4855
|
-
"line":
|
|
4855
|
+
"line": 266,
|
|
4856
4856
|
"column": 20,
|
|
4857
|
-
"index":
|
|
4857
|
+
"index": 8036
|
|
4858
4858
|
}
|
|
4859
4859
|
},
|
|
4860
4860
|
"filepath": "src/components/form/file_picker/file_picker.tsx"
|
|
@@ -299,7 +299,8 @@ var EuiComboBoxInput = exports.EuiComboBoxInput = /*#__PURE__*/function (_Compon
|
|
|
299
299
|
},
|
|
300
300
|
placeholder: showPlaceholder ? placeholder : undefined,
|
|
301
301
|
value: this.searchValue,
|
|
302
|
-
autoFocus: autoFocus
|
|
302
|
+
autoFocus: autoFocus,
|
|
303
|
+
autoComplete: "off"
|
|
303
304
|
// Force the menu to re-open on every input click - only necessary when plain text
|
|
304
305
|
,
|
|
305
306
|
onClick: this.asPlainText ? onFocus : undefined // Type shenanigans - event should be mostly the same
|
|
@@ -126,7 +126,7 @@ EuiContextMenuItem.propTypes = {
|
|
|
126
126
|
"aria-label": _propTypes.default.string,
|
|
127
127
|
"data-test-subj": _propTypes.default.string,
|
|
128
128
|
css: _propTypes.default.any,
|
|
129
|
-
icon: _propTypes.default.oneOfType([_propTypes.default.
|
|
129
|
+
icon: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "diff", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "errorFilled", "esqlVis", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]).isRequired, _propTypes.default.element.isRequired, _propTypes.default.any.isRequired]),
|
|
130
130
|
hasPanel: _propTypes.default.bool,
|
|
131
131
|
disabled: _propTypes.default.bool,
|
|
132
132
|
onClick: _propTypes.default.func,
|
|
@@ -3,26 +3,33 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.EuiFilePickerClass = exports.EuiFilePicker = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var
|
|
11
|
-
var _validatable_control = require("../validatable_control");
|
|
10
|
+
var _services = require("../../../services");
|
|
12
11
|
var _button = require("../../button");
|
|
13
12
|
var _progress = require("../../progress");
|
|
14
13
|
var _icon = require("../../icon");
|
|
15
14
|
var _i18n = require("../../i18n");
|
|
16
15
|
var _loading = require("../../loading");
|
|
17
|
-
var _accessibility = require("../../../services/accessibility");
|
|
18
16
|
var _eui_form_context = require("../eui_form_context");
|
|
17
|
+
var _validatable_control = require("../validatable_control");
|
|
18
|
+
var _form_control_layout_clear_button = require("../form_control_layout/form_control_layout_clear_button");
|
|
19
|
+
var _file_picker = require("./file_picker.styles");
|
|
19
20
|
var _react2 = require("@emotion/react");
|
|
20
|
-
var _excluded = ["id", "name", "initialPromptText", "className", "disabled", "compressed", "onChange", "isInvalid", "fullWidth", "isLoading", "display"];
|
|
21
|
+
var _excluded = ["stylesMemoizer", "id", "name", "initialPromptText", "className", "disabled", "compressed", "onChange", "isInvalid", "fullWidth", "isLoading", "display"];
|
|
21
22
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
23
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
24
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
25
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
25
26
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
27
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
28
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
30
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
31
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
32
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
26
33
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
27
34
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
28
35
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -44,25 +51,20 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
44
51
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
45
52
|
* Side Public License, v 1.
|
|
46
53
|
*/
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
large: 'euiFilePicker--large'
|
|
50
|
-
};
|
|
51
|
-
var DISPLAYS = exports.DISPLAYS = (0, _common.keysOf)(displayToClassNameMap);
|
|
52
|
-
var EuiFilePicker = exports.EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
53
|
-
function EuiFilePicker() {
|
|
54
|
+
var EuiFilePickerClass = exports.EuiFilePickerClass = /*#__PURE__*/function (_Component) {
|
|
55
|
+
function EuiFilePickerClass() {
|
|
54
56
|
var _this;
|
|
55
|
-
_classCallCheck(this,
|
|
57
|
+
_classCallCheck(this, EuiFilePickerClass);
|
|
56
58
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
57
59
|
args[_key] = arguments[_key];
|
|
58
60
|
}
|
|
59
|
-
_this = _callSuper(this,
|
|
61
|
+
_this = _callSuper(this, EuiFilePickerClass, [].concat(args));
|
|
60
62
|
_defineProperty(_this, "state", {
|
|
61
63
|
promptText: null,
|
|
62
64
|
isHoveringDrop: false
|
|
63
65
|
});
|
|
64
66
|
_defineProperty(_this, "fileInput", null);
|
|
65
|
-
_defineProperty(_this, "generatedId", (0,
|
|
67
|
+
_defineProperty(_this, "generatedId", (0, _services.htmlIdGenerator)()());
|
|
66
68
|
_defineProperty(_this, "handleChange", function () {
|
|
67
69
|
if (!_this.fileInput) return;
|
|
68
70
|
if (_this.fileInput.files && _this.fileInput.files.length > 1) {
|
|
@@ -112,8 +114,8 @@ var EuiFilePicker = exports.EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
|
112
114
|
});
|
|
113
115
|
return _this;
|
|
114
116
|
}
|
|
115
|
-
_inherits(
|
|
116
|
-
return _createClass(
|
|
117
|
+
_inherits(EuiFilePickerClass, _Component);
|
|
118
|
+
return _createClass(EuiFilePickerClass, [{
|
|
117
119
|
key: "render",
|
|
118
120
|
value: function render() {
|
|
119
121
|
var _this2 = this;
|
|
@@ -124,6 +126,7 @@ var EuiFilePicker = exports.EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
|
124
126
|
default: "Clear selected files"
|
|
125
127
|
}, function (clearSelectedFiles) {
|
|
126
128
|
var _this2$props = _this2.props,
|
|
129
|
+
stylesMemoizer = _this2$props.stylesMemoizer,
|
|
127
130
|
id = _this2$props.id,
|
|
128
131
|
name = _this2$props.name,
|
|
129
132
|
initialPromptText = _this2$props.initialPromptText,
|
|
@@ -140,34 +143,39 @@ var EuiFilePicker = exports.EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
|
140
143
|
var promptId = "".concat(id || _this2.generatedId, "-filePicker__prompt");
|
|
141
144
|
var isOverridingInitialPrompt = _this2.state.promptText != null;
|
|
142
145
|
var normalFormControl = display === 'default';
|
|
143
|
-
var classes = (0, _classnames.default)('euiFilePicker',
|
|
144
|
-
|
|
145
|
-
'euiFilePicker--compressed': compressed,
|
|
146
|
-
'euiFilePicker--fullWidth': fullWidth,
|
|
146
|
+
var classes = (0, _classnames.default)('euiFilePicker', {
|
|
147
|
+
'euiFilePicker-isDroppingFile': _this2.state.isHoveringDrop,
|
|
147
148
|
'euiFilePicker-isInvalid': isInvalid,
|
|
148
149
|
'euiFilePicker-isLoading': isLoading,
|
|
149
150
|
'euiFilePicker-hasFiles': isOverridingInitialPrompt
|
|
150
151
|
}, className);
|
|
152
|
+
var styles = stylesMemoizer(_file_picker.euiFilePickerStyles);
|
|
153
|
+
var cssStyles = [styles.euiFilePicker, fullWidth ? styles.fullWidth : styles.formWidth, _this2.state.isHoveringDrop && styles.isDroppingFile, isInvalid && !disabled && styles.invalid, isOverridingInitialPrompt && !disabled && styles.hasFiles, isLoading && styles.loading];
|
|
154
|
+
var inputStyles = [styles.input.euiFilePicker__input, !normalFormControl && !disabled && styles.input.largeInteractive];
|
|
155
|
+
var promptStyles = [styles.euiFilePicker__prompt, disabled && styles.disabled].concat(_toConsumableArray(normalFormControl ? [compressed ? styles.compressed : styles.uncompressed] : [styles.large.large, compressed ? styles.large.compressed : styles.large.uncompressed]));
|
|
156
|
+
var iconStyles = [styles.icon.euiFilePicker__icon].concat(_toConsumableArray(normalFormControl ? [styles.icon.normal, compressed ? styles.icon.compresssed : styles.icon.uncompressed] : [styles.icon.large]));
|
|
157
|
+
var rightIconStyles = normalFormControl ? [styles.rightIcon.euiFilePicker__rightIcon, compressed ? styles.rightIcon.compressed : styles.rightIcon.uncompressed] : undefined;
|
|
151
158
|
var clearButton;
|
|
152
159
|
if (isLoading && normalFormControl) {
|
|
153
160
|
// Override clear button with loading spinner if it is in loading state
|
|
154
161
|
clearButton = (0, _react2.jsx)(_loading.EuiLoadingSpinner, {
|
|
155
|
-
|
|
162
|
+
css: rightIconStyles,
|
|
163
|
+
className: "euiFilePicker__loadingSpinner",
|
|
164
|
+
size: compressed ? 's' : 'm'
|
|
156
165
|
});
|
|
157
166
|
} else if (isOverridingInitialPrompt && !disabled) {
|
|
158
167
|
if (normalFormControl) {
|
|
159
|
-
clearButton = (0, _react2.jsx)(
|
|
160
|
-
type: "button",
|
|
168
|
+
clearButton = (0, _react2.jsx)(_form_control_layout_clear_button.EuiFormControlLayoutClearButton, {
|
|
161
169
|
"aria-label": clearSelectedFiles,
|
|
170
|
+
css: [styles.euiFilePicker__clearButton, rightIconStyles, ";label:clearButton;"],
|
|
162
171
|
className: "euiFilePicker__clearButton",
|
|
163
|
-
onClick: _this2.removeFiles
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
type: "cross"
|
|
167
|
-
}));
|
|
172
|
+
onClick: _this2.removeFiles,
|
|
173
|
+
size: compressed ? 's' : 'm'
|
|
174
|
+
});
|
|
168
175
|
} else {
|
|
169
176
|
clearButton = (0, _react2.jsx)(_button.EuiButtonEmpty, {
|
|
170
177
|
"aria-label": clearSelectedFiles,
|
|
178
|
+
css: styles.euiFilePicker__clearButton,
|
|
171
179
|
className: "euiFilePicker__clearButton",
|
|
172
180
|
size: "xs",
|
|
173
181
|
onClick: _this2.removeFiles
|
|
@@ -185,15 +193,15 @@ var EuiFilePicker = exports.EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
|
185
193
|
position: "absolute"
|
|
186
194
|
});
|
|
187
195
|
return (0, _react2.jsx)("div", {
|
|
196
|
+
css: cssStyles,
|
|
188
197
|
className: classes
|
|
189
|
-
}, (0, _react2.jsx)("div", {
|
|
190
|
-
className: "euiFilePicker__wrap"
|
|
191
198
|
}, (0, _react2.jsx)(_validatable_control.EuiValidatableControl, {
|
|
192
199
|
isInvalid: isInvalid
|
|
193
200
|
}, (0, _react2.jsx)("input", _extends({
|
|
194
201
|
type: "file",
|
|
195
202
|
id: id,
|
|
196
203
|
name: name,
|
|
204
|
+
css: inputStyles,
|
|
197
205
|
className: "euiFilePicker__input",
|
|
198
206
|
onChange: _this2.handleChange,
|
|
199
207
|
ref: function ref(input) {
|
|
@@ -205,23 +213,25 @@ var EuiFilePicker = exports.EuiFilePicker = /*#__PURE__*/function (_Component) {
|
|
|
205
213
|
disabled: disabled,
|
|
206
214
|
"aria-describedby": promptId
|
|
207
215
|
}, rest))), (0, _react2.jsx)("div", {
|
|
216
|
+
css: promptStyles,
|
|
208
217
|
className: "euiFilePicker__prompt",
|
|
209
218
|
id: promptId
|
|
210
219
|
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
220
|
+
css: iconStyles,
|
|
211
221
|
className: "euiFilePicker__icon",
|
|
212
222
|
color: isInvalid ? 'danger' : disabled ? 'subdued' : 'primary',
|
|
213
223
|
type: isInvalid ? 'alert' : 'importAction',
|
|
214
224
|
size: normalFormControl ? 'm' : 'l',
|
|
215
225
|
"aria-hidden": "true"
|
|
216
|
-
}), (0, _react2.jsx)("
|
|
226
|
+
}), (0, _react2.jsx)("span", {
|
|
217
227
|
className: "euiFilePicker__promptText"
|
|
218
|
-
}, _this2.state.promptText || initialPromptText), clearButton, loader))
|
|
228
|
+
}, _this2.state.promptText || initialPromptText), clearButton, loader));
|
|
219
229
|
});
|
|
220
230
|
}
|
|
221
231
|
}]);
|
|
222
232
|
}(_react.Component);
|
|
223
|
-
_defineProperty(
|
|
224
|
-
_defineProperty(
|
|
233
|
+
_defineProperty(EuiFilePickerClass, "contextType", _eui_form_context.FormContext);
|
|
234
|
+
_defineProperty(EuiFilePickerClass, "defaultProps", {
|
|
225
235
|
initialPromptText: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
226
236
|
token: "euiFilePicker.promptText",
|
|
227
237
|
default: "Select or drag and drop a file"
|
|
@@ -229,12 +239,13 @@ _defineProperty(EuiFilePicker, "defaultProps", {
|
|
|
229
239
|
compressed: false,
|
|
230
240
|
display: 'large'
|
|
231
241
|
});
|
|
232
|
-
|
|
242
|
+
EuiFilePickerClass.propTypes = {
|
|
233
243
|
id: _propTypes.default.string,
|
|
234
244
|
name: _propTypes.default.string,
|
|
235
245
|
className: _propTypes.default.string,
|
|
236
246
|
/**
|
|
237
247
|
* The content that appears in the dropzone if no file is attached
|
|
248
|
+
* @default 'Select or drag and drop a file'
|
|
238
249
|
*/
|
|
239
250
|
initialPromptText: _propTypes.default.node,
|
|
240
251
|
/**
|
|
@@ -243,12 +254,14 @@ EuiFilePicker.propTypes = {
|
|
|
243
254
|
onChange: _propTypes.default.func,
|
|
244
255
|
/**
|
|
245
256
|
* Reduces the size to a typical (compressed) input
|
|
257
|
+
* @default false
|
|
246
258
|
*/
|
|
247
259
|
compressed: _propTypes.default.bool,
|
|
248
260
|
/**
|
|
249
261
|
* Size or type of display;
|
|
250
262
|
* `default` for normal height, similar to other controls;
|
|
251
263
|
* `large` for taller size
|
|
264
|
+
* @default large
|
|
252
265
|
*/
|
|
253
266
|
display: _propTypes.default.oneOf(["default", "large"]),
|
|
254
267
|
/**
|
|
@@ -263,4 +276,5 @@ EuiFilePicker.propTypes = {
|
|
|
263
276
|
"aria-label": _propTypes.default.string,
|
|
264
277
|
"data-test-subj": _propTypes.default.string,
|
|
265
278
|
css: _propTypes.default.any
|
|
266
|
-
};
|
|
279
|
+
};
|
|
280
|
+
var EuiFilePicker = exports.EuiFilePicker = (0, _services.withEuiStylesMemoizer)(EuiFilePickerClass);
|