@jetbrains/ring-ui 5.0.67 → 5.0.69
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/components/date-picker/date-picker.css +22 -1
- package/components/date-picker/date-picker.d.ts +3 -0
- package/components/date-picker/date-picker.js +5 -2
- package/components/error-message/error-message.d.ts +2 -0
- package/components/error-message/error-message.js +5 -3
- package/components/query-assist/query-assist.d.ts +5 -0
- package/components/query-assist/query-assist.js +5 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +15 -0
- package/dist/_helpers/date-picker.js +1 -1
- package/dist/date-picker/date-picker.d.ts +3 -0
- package/dist/date-picker/date-picker.js +10 -8
- package/dist/error-message/error-message.d.ts +2 -0
- package/dist/error-message/error-message.js +7 -3
- package/dist/query-assist/query-assist.d.ts +5 -0
- package/dist/query-assist/query-assist.js +5 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
|
@@ -34,6 +34,26 @@
|
|
|
34
34
|
&.inline {
|
|
35
35
|
padding: 0;
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
&.sizeS {
|
|
39
|
+
width: calc(unit * 12);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.sizeM {
|
|
43
|
+
width: calc(unit * 30);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.sizeL {
|
|
47
|
+
width: calc(unit * 50);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&.sizeFULL {
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.sizeAUTO {
|
|
55
|
+
max-width: 100%;
|
|
56
|
+
}
|
|
37
57
|
}
|
|
38
58
|
|
|
39
59
|
.displayDate {
|
|
@@ -95,10 +115,11 @@
|
|
|
95
115
|
}
|
|
96
116
|
|
|
97
117
|
.anchor {
|
|
98
|
-
|
|
118
|
+
width: 100%;
|
|
99
119
|
padding: 0 unit;
|
|
100
120
|
|
|
101
121
|
text-align: start;
|
|
122
|
+
white-space: nowrap;
|
|
102
123
|
|
|
103
124
|
@nest .inline & {
|
|
104
125
|
min-width: initial;
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import type { Locale } from 'date-fns';
|
|
4
4
|
import Popup from '../popup/popup';
|
|
5
5
|
import { DropdownAttrs } from '../dropdown/dropdown';
|
|
6
|
+
import { Size } from '../input/input';
|
|
6
7
|
import { DatePopupProps } from './date-popup';
|
|
7
8
|
import { DateInputTranslations, DatePickerChange } from './consts';
|
|
8
9
|
export interface DatePickerTranslations extends Partial<DateInputTranslations> {
|
|
@@ -26,6 +27,7 @@ export type DatePickerProps = Omit<DatePopupProps, 'translations' | 'parseDateIn
|
|
|
26
27
|
rangePlaceholder: string;
|
|
27
28
|
disabled?: boolean | null | undefined;
|
|
28
29
|
parseDateInput: (input: string | null | undefined) => Date | null;
|
|
30
|
+
size?: Size;
|
|
29
31
|
};
|
|
30
32
|
/**
|
|
31
33
|
* @name Date Picker
|
|
@@ -57,6 +59,7 @@ export default class DatePicker extends PureComponent<DatePickerProps> {
|
|
|
57
59
|
maxDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
|
58
60
|
translations: PropTypes.Requireable<object>;
|
|
59
61
|
locale: PropTypes.Requireable<object>;
|
|
62
|
+
size: PropTypes.Requireable<Size>;
|
|
60
63
|
};
|
|
61
64
|
static defaultProps: DatePickerProps;
|
|
62
65
|
handleChange: (change: DatePickerChange | Date | null | undefined) => void;
|
|
@@ -16,6 +16,7 @@ import Dropdown from '../dropdown/dropdown';
|
|
|
16
16
|
import Icon from '../icon';
|
|
17
17
|
import Button from '../button/button';
|
|
18
18
|
import Link from '../link/link';
|
|
19
|
+
import { Size } from '../input/input';
|
|
19
20
|
import DatePopup from './date-popup';
|
|
20
21
|
import { dateType } from './consts';
|
|
21
22
|
import styles from './date-picker.css';
|
|
@@ -66,7 +67,8 @@ export default class DatePicker extends PureComponent {
|
|
|
66
67
|
minDate: dateType,
|
|
67
68
|
maxDate: dateType,
|
|
68
69
|
translations: PropTypes.object,
|
|
69
|
-
locale: PropTypes.object
|
|
70
|
+
locale: PropTypes.object,
|
|
71
|
+
size: PropTypes.oneOf(Object.values(Size))
|
|
70
72
|
};
|
|
71
73
|
static defaultProps = {
|
|
72
74
|
className: '',
|
|
@@ -77,6 +79,7 @@ export default class DatePicker extends PureComponent {
|
|
|
77
79
|
to: null,
|
|
78
80
|
clear: false,
|
|
79
81
|
inline: false,
|
|
82
|
+
size: Size.M,
|
|
80
83
|
displayFormat: (date, locale) => (date ? formatDate(date, 'd MMM yyyy', { locale }) : ''),
|
|
81
84
|
displayMonthFormat: (date, locale) => (date ? formatDate(date, 'd MMM', { locale }) : ''),
|
|
82
85
|
displayDayFormat: (date, locale) => (date ? formatDate(date, 'd', { locale }) : ''),
|
|
@@ -202,7 +205,7 @@ export default class DatePicker extends PureComponent {
|
|
|
202
205
|
</Button>);
|
|
203
206
|
}
|
|
204
207
|
const { className, popupClassName, clear, inline, dropdownProps, translations, ...datePopupProps } = this.props;
|
|
205
|
-
const classes = classNames(styles.datePicker, className, {
|
|
208
|
+
const classes = classNames(styles.datePicker, className, styles[`size${this.props.size}`], {
|
|
206
209
|
[styles.inline]: inline
|
|
207
210
|
});
|
|
208
211
|
return (<Dropdown className={classes} anchor={inline
|
|
@@ -8,6 +8,7 @@ export interface ErrorMessageProps {
|
|
|
8
8
|
message?: string | null | undefined;
|
|
9
9
|
description?: string | null | undefined;
|
|
10
10
|
className?: string | null | undefined;
|
|
11
|
+
'data-test'?: string | null | undefined;
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* @name Error Message
|
|
@@ -20,6 +21,7 @@ export default class ErrorMessage extends Component<ErrorMessageProps> {
|
|
|
20
21
|
description: PropTypes.Requireable<string>;
|
|
21
22
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
22
23
|
className: PropTypes.Requireable<string>;
|
|
24
|
+
'data-test': PropTypes.Requireable<string>;
|
|
23
25
|
};
|
|
24
26
|
render(): JSX.Element;
|
|
25
27
|
}
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import Icon from '../icon/icon';
|
|
5
5
|
import { Size } from '../icon/icon__constants';
|
|
6
|
+
import dataTests from '../global/data-tests';
|
|
6
7
|
import styles from './error-message.css';
|
|
7
8
|
/**
|
|
8
9
|
* @name Error Message
|
|
@@ -14,12 +15,13 @@ export default class ErrorMessage extends Component {
|
|
|
14
15
|
message: PropTypes.string,
|
|
15
16
|
description: PropTypes.string,
|
|
16
17
|
children: PropTypes.node,
|
|
17
|
-
className: PropTypes.string
|
|
18
|
+
className: PropTypes.string,
|
|
19
|
+
'data-test': PropTypes.string
|
|
18
20
|
};
|
|
19
21
|
render() {
|
|
20
|
-
const { className, icon, code, message, description, children } = this.props;
|
|
22
|
+
const { className, icon, code, message, description, children, 'data-test': dataTest } = this.props;
|
|
21
23
|
const classes = classNames(styles.errorMessage, className);
|
|
22
|
-
return (<div className={classes}>
|
|
24
|
+
return (<div className={classes} data-test={dataTests('ring-error-message', dataTest)}>
|
|
23
25
|
{icon && (<Icon className={styles.icon} glyph={icon} size={Size.Size64} suppressSizeWarning/>)}
|
|
24
26
|
<div className={styles.content}>
|
|
25
27
|
<div className={styles.title}>
|
|
@@ -46,6 +46,7 @@ export interface QueryAssistProps {
|
|
|
46
46
|
clear?: boolean | null | undefined;
|
|
47
47
|
className?: string | null | undefined;
|
|
48
48
|
popupClassName?: string | null | undefined;
|
|
49
|
+
inputClassName?: string | null | undefined;
|
|
49
50
|
dataSource: (params: QueryAssistRequestParams) => Promise<QueryAssistResponse> | QueryAssistResponse;
|
|
50
51
|
delay?: number | null | undefined;
|
|
51
52
|
disabled?: boolean | undefined;
|
|
@@ -147,6 +148,10 @@ export default class QueryAssist extends Component<QueryAssistProps> {
|
|
|
147
148
|
* Additional class for the popup
|
|
148
149
|
*/
|
|
149
150
|
popupClassName: PropTypes.Requireable<string>;
|
|
151
|
+
/**
|
|
152
|
+
* Additional class for the input
|
|
153
|
+
*/
|
|
154
|
+
inputClassName: PropTypes.Requireable<string>;
|
|
150
155
|
/**
|
|
151
156
|
* Data source function
|
|
152
157
|
*/
|
|
@@ -89,6 +89,10 @@ export default class QueryAssist extends Component {
|
|
|
89
89
|
* Additional class for the popup
|
|
90
90
|
*/
|
|
91
91
|
popupClassName: PropTypes.string,
|
|
92
|
+
/**
|
|
93
|
+
* Additional class for the input
|
|
94
|
+
*/
|
|
95
|
+
inputClassName: PropTypes.string,
|
|
92
96
|
/**
|
|
93
97
|
* Data source function
|
|
94
98
|
*/
|
|
@@ -769,7 +773,7 @@ export default class QueryAssist extends Component {
|
|
|
769
773
|
[styles.withIcon]: (renderGlass && !huge) || renderLoader,
|
|
770
774
|
[styles.huge]: huge
|
|
771
775
|
});
|
|
772
|
-
const inputClasses = classNames({
|
|
776
|
+
const inputClasses = classNames(this.props.inputClassName, {
|
|
773
777
|
[`${styles.input} ring-js-shortcuts`]: true,
|
|
774
778
|
[styles.inputGap]: actions.length || this.isRenderingGlassOrLoader() && !glass,
|
|
775
779
|
[styles.inputGap2]: actions.length === 2,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) {
|
|
2
|
+
key = _toPropertyKey(key);
|
|
2
3
|
if (key in obj) {
|
|
3
4
|
Object.defineProperty(obj, key, {
|
|
4
5
|
value: value,
|
|
@@ -25,5 +26,19 @@ function _extends() {
|
|
|
25
26
|
};
|
|
26
27
|
return _extends.apply(this, arguments);
|
|
27
28
|
}
|
|
29
|
+
function _toPrimitive(input, hint) {
|
|
30
|
+
if (typeof input !== "object" || input === null) return input;
|
|
31
|
+
var prim = input[Symbol.toPrimitive];
|
|
32
|
+
if (prim !== undefined) {
|
|
33
|
+
var res = prim.call(input, hint || "default");
|
|
34
|
+
if (typeof res !== "object") return res;
|
|
35
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
36
|
+
}
|
|
37
|
+
return (hint === "string" ? String : Number)(input);
|
|
38
|
+
}
|
|
39
|
+
function _toPropertyKey(arg) {
|
|
40
|
+
var key = _toPrimitive(arg, "string");
|
|
41
|
+
return typeof key === "symbol" ? key : String(key);
|
|
42
|
+
}
|
|
28
43
|
|
|
29
44
|
export { _defineProperty as _, _extends as a };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var modules_0c7b7d96 = {"unit":"8px","footer-height":"64px","breakpoint-small":"640px","breakpoint-middle":"960px","breakpoint-large":"1200px","extra-small-screen-media":"(max-width: 639px)","small-screen-media":"(min-width: 640px) and (max-width: 959px)","middle-screen-media":"(min-width: 960px) and (max-width: 1199px)","large-screen-media":"(min-width: 1200px)","cellSize":"24px","calHeight":"288px","calWidth":"296px","yearHeight":"32px","yearWidth":"48px","light":"light_rui_e0bd","clearfix":"clearfix_rui_e0bd","font":"font_rui_e0bd","font-lower":"font-lower_rui_e0bd font_rui_e0bd","font-smaller":"font-smaller_rui_e0bd font-lower_rui_e0bd font_rui_e0bd","font-smaller-lower":"font-smaller-lower_rui_e0bd font-smaller_rui_e0bd font-lower_rui_e0bd font_rui_e0bd","font-larger-lower":"font-larger-lower_rui_e0bd font-lower_rui_e0bd font_rui_e0bd","font-larger":"font-larger_rui_e0bd font-larger-lower_rui_e0bd font-lower_rui_e0bd font_rui_e0bd","thin-font":"thin-font_rui_e0bd","monospace-font":"monospace-font_rui_e0bd","ellipsis":"ellipsis_rui_e0bd","resetButton":"resetButton_rui_e0bd","container":"container_rui_e0bd","hoverable":"hoverable_rui_e0bd","datePicker":"datePicker_rui_e0bd","inline":"inline_rui_e0bd","displayDate":"displayDate_rui_e0bd","displayRange":"displayRange_rui_e0bd","clear":"clear_rui_e0bd","datePopup":"datePopup_rui_e0bd","filterWrapper":"filterWrapper_rui_e0bd filterWrapper_rui_531d","filter":"filter_rui_e0bd filter_rui_531d","calendarIcon":"calendarIcon_rui_e0bd","anchor":"anchor_rui_e0bd","anchorContent":"anchorContent_rui_e0bd","chevronDownIcon":"chevronDownIcon_rui_e0bd","fromInput":"fromInput_rui_e0bd","fromInputWithDivider":"fromInputWithDivider_rui_e0bd","toInput":"toInput_rui_e0bd","dateInput":"dateInput_rui_e0bd","timeInputWithDivider":"timeInputWithDivider_rui_e0bd","weekdays":"weekdays_rui_e0bd","weekday":"weekday_rui_e0bd","weekend":"weekend_rui_e0bd","calendar":"calendar_rui_e0bd","months":"months_rui_e0bd","days":"days_rui_e0bd","month":"month_rui_e0bd","monthTitle":"monthTitle_rui_e0bd","day":"day_rui_e0bd resetButton_rui_8bff","between":"between_rui_e0bd","activeBetween":"activeBetween_rui_e0bd","current":"current_rui_e0bd","active":"active_rui_e0bd","disabled":"disabled_rui_e0bd","from":"from_rui_e0bd","to":"to_rui_e0bd","Monday":"Monday_rui_e0bd","spread":"spread_rui_e0bd","activeSpread":"activeSpread_rui_e0bd","first":"first_rui_e0bd","Tuesday":"Tuesday_rui_e0bd","Friday":"Friday_rui_e0bd","Saturday":"Saturday_rui_e0bd","Sunday":"Sunday_rui_e0bd","empty":"empty_rui_e0bd","today":"today_rui_e0bd","year":"year_rui_e0bd hoverable_rui_e0bd resetButton_rui_8bff","monthNames":"monthNames_rui_e0bd","monthName":"monthName_rui_e0bd hoverable_rui_e0bd resetButton_rui_8bff","monthSlider":"monthSlider_rui_e0bd resetButton_rui_8bff","dragging":"dragging_rui_e0bd","range":"range_rui_e0bd","years":"years_rui_e0bd","currentYear":"currentYear_rui_e0bd"};
|
|
1
|
+
var modules_0c7b7d96 = {"unit":"8px","footer-height":"64px","breakpoint-small":"640px","breakpoint-middle":"960px","breakpoint-large":"1200px","extra-small-screen-media":"(max-width: 639px)","small-screen-media":"(min-width: 640px) and (max-width: 959px)","middle-screen-media":"(min-width: 960px) and (max-width: 1199px)","large-screen-media":"(min-width: 1200px)","cellSize":"24px","calHeight":"288px","calWidth":"296px","yearHeight":"32px","yearWidth":"48px","light":"light_rui_e0bd","clearfix":"clearfix_rui_e0bd","font":"font_rui_e0bd","font-lower":"font-lower_rui_e0bd font_rui_e0bd","font-smaller":"font-smaller_rui_e0bd font-lower_rui_e0bd font_rui_e0bd","font-smaller-lower":"font-smaller-lower_rui_e0bd font-smaller_rui_e0bd font-lower_rui_e0bd font_rui_e0bd","font-larger-lower":"font-larger-lower_rui_e0bd font-lower_rui_e0bd font_rui_e0bd","font-larger":"font-larger_rui_e0bd font-larger-lower_rui_e0bd font-lower_rui_e0bd font_rui_e0bd","thin-font":"thin-font_rui_e0bd","monospace-font":"monospace-font_rui_e0bd","ellipsis":"ellipsis_rui_e0bd","resetButton":"resetButton_rui_e0bd","container":"container_rui_e0bd","hoverable":"hoverable_rui_e0bd","datePicker":"datePicker_rui_e0bd","inline":"inline_rui_e0bd","sizeS":"sizeS_rui_e0bd","sizeM":"sizeM_rui_e0bd","sizeL":"sizeL_rui_e0bd","sizeFULL":"sizeFULL_rui_e0bd","sizeAUTO":"sizeAUTO_rui_e0bd","displayDate":"displayDate_rui_e0bd","displayRange":"displayRange_rui_e0bd","clear":"clear_rui_e0bd","datePopup":"datePopup_rui_e0bd","filterWrapper":"filterWrapper_rui_e0bd filterWrapper_rui_531d","filter":"filter_rui_e0bd filter_rui_531d","calendarIcon":"calendarIcon_rui_e0bd","anchor":"anchor_rui_e0bd","anchorContent":"anchorContent_rui_e0bd","chevronDownIcon":"chevronDownIcon_rui_e0bd","fromInput":"fromInput_rui_e0bd","fromInputWithDivider":"fromInputWithDivider_rui_e0bd","toInput":"toInput_rui_e0bd","dateInput":"dateInput_rui_e0bd","timeInputWithDivider":"timeInputWithDivider_rui_e0bd","weekdays":"weekdays_rui_e0bd","weekday":"weekday_rui_e0bd","weekend":"weekend_rui_e0bd","calendar":"calendar_rui_e0bd","months":"months_rui_e0bd","days":"days_rui_e0bd","month":"month_rui_e0bd","monthTitle":"monthTitle_rui_e0bd","day":"day_rui_e0bd resetButton_rui_8bff","between":"between_rui_e0bd","activeBetween":"activeBetween_rui_e0bd","current":"current_rui_e0bd","active":"active_rui_e0bd","disabled":"disabled_rui_e0bd","from":"from_rui_e0bd","to":"to_rui_e0bd","Monday":"Monday_rui_e0bd","spread":"spread_rui_e0bd","activeSpread":"activeSpread_rui_e0bd","first":"first_rui_e0bd","Tuesday":"Tuesday_rui_e0bd","Friday":"Friday_rui_e0bd","Saturday":"Saturday_rui_e0bd","Sunday":"Sunday_rui_e0bd","empty":"empty_rui_e0bd","today":"today_rui_e0bd","year":"year_rui_e0bd hoverable_rui_e0bd resetButton_rui_8bff","monthNames":"monthNames_rui_e0bd","monthName":"monthName_rui_e0bd hoverable_rui_e0bd resetButton_rui_8bff","monthSlider":"monthSlider_rui_e0bd resetButton_rui_8bff","dragging":"dragging_rui_e0bd","range":"range_rui_e0bd","years":"years_rui_e0bd","currentYear":"currentYear_rui_e0bd"};
|
|
2
2
|
|
|
3
3
|
export { modules_0c7b7d96 as m };
|
|
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import type { Locale } from 'date-fns';
|
|
4
4
|
import Popup from '../popup/popup';
|
|
5
5
|
import { DropdownAttrs } from '../dropdown/dropdown';
|
|
6
|
+
import { Size } from '../input/input';
|
|
6
7
|
import { DatePopupProps } from './date-popup';
|
|
7
8
|
import { DateInputTranslations, DatePickerChange } from './consts';
|
|
8
9
|
export interface DatePickerTranslations extends Partial<DateInputTranslations> {
|
|
@@ -26,6 +27,7 @@ export type DatePickerProps = Omit<DatePopupProps, 'translations' | 'parseDateIn
|
|
|
26
27
|
rangePlaceholder: string;
|
|
27
28
|
disabled?: boolean | null | undefined;
|
|
28
29
|
parseDateInput: (input: string | null | undefined) => Date | null;
|
|
30
|
+
size?: Size;
|
|
29
31
|
};
|
|
30
32
|
/**
|
|
31
33
|
* @name Date Picker
|
|
@@ -57,6 +59,7 @@ export default class DatePicker extends PureComponent<DatePickerProps> {
|
|
|
57
59
|
maxDate: PropTypes.Requireable<NonNullable<string | number | Date | null | undefined>>;
|
|
58
60
|
translations: PropTypes.Requireable<object>;
|
|
59
61
|
locale: PropTypes.Requireable<object>;
|
|
62
|
+
size: PropTypes.Requireable<Size>;
|
|
60
63
|
};
|
|
61
64
|
static defaultProps: DatePickerProps;
|
|
62
65
|
handleChange: (change: DatePickerChange | Date | null | undefined) => void;
|
|
@@ -17,6 +17,7 @@ import Dropdown from '../dropdown/dropdown.js';
|
|
|
17
17
|
import Icon from '../icon/icon.js';
|
|
18
18
|
import { Button } from '../button/button.js';
|
|
19
19
|
import Link from '../link/link.js';
|
|
20
|
+
import { Size } from '../input/input.js';
|
|
20
21
|
import DatePopup from './date-popup.js';
|
|
21
22
|
import { dateType } from './consts.js';
|
|
22
23
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
|
@@ -48,6 +49,11 @@ import '../link/clickableLink.js';
|
|
|
48
49
|
import '../global/controls-height.js';
|
|
49
50
|
import '../_helpers/button__classes.js';
|
|
50
51
|
import '../_helpers/link.js';
|
|
52
|
+
import '@jetbrains/icons/close-12px';
|
|
53
|
+
import '../global/prop-types.js';
|
|
54
|
+
import '../global/composeRefs.js';
|
|
55
|
+
import '../_helpers/input.js';
|
|
56
|
+
import '../input/input-label.js';
|
|
51
57
|
import 'date-fns/isAfter';
|
|
52
58
|
import 'date-fns/isBefore';
|
|
53
59
|
import 'date-fns/startOfDay';
|
|
@@ -77,12 +83,6 @@ import 'date-fns/isThisYear';
|
|
|
77
83
|
import 'date-fns/setYear';
|
|
78
84
|
import './weekdays.js';
|
|
79
85
|
import 'date-fns/add';
|
|
80
|
-
import '../input/input.js';
|
|
81
|
-
import '@jetbrains/icons/close-12px';
|
|
82
|
-
import '../global/prop-types.js';
|
|
83
|
-
import '../global/composeRefs.js';
|
|
84
|
-
import '../_helpers/input.js';
|
|
85
|
-
import '../input/input-label.js';
|
|
86
86
|
|
|
87
87
|
const PopupComponent = _ref => {
|
|
88
88
|
let {
|
|
@@ -242,7 +242,7 @@ class DatePicker extends PureComponent {
|
|
|
242
242
|
translations,
|
|
243
243
|
...datePopupProps
|
|
244
244
|
} = this.props;
|
|
245
|
-
const classes = classNames(modules_0c7b7d96.datePicker, className, {
|
|
245
|
+
const classes = classNames(modules_0c7b7d96.datePicker, className, modules_0c7b7d96[`size${this.props.size}`], {
|
|
246
246
|
[modules_0c7b7d96.inline]: inline
|
|
247
247
|
});
|
|
248
248
|
return /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
@@ -298,7 +298,8 @@ _defineProperty(DatePicker, "propTypes", {
|
|
|
298
298
|
minDate: dateType,
|
|
299
299
|
maxDate: dateType,
|
|
300
300
|
translations: PropTypes.object,
|
|
301
|
-
locale: PropTypes.object
|
|
301
|
+
locale: PropTypes.object,
|
|
302
|
+
size: PropTypes.oneOf(Object.values(Size))
|
|
302
303
|
});
|
|
303
304
|
_defineProperty(DatePicker, "defaultProps", {
|
|
304
305
|
className: '',
|
|
@@ -309,6 +310,7 @@ _defineProperty(DatePicker, "defaultProps", {
|
|
|
309
310
|
to: null,
|
|
310
311
|
clear: false,
|
|
311
312
|
inline: false,
|
|
313
|
+
size: Size.M,
|
|
312
314
|
displayFormat: (date, locale) => date ? format(date, 'd MMM yyyy', {
|
|
313
315
|
locale
|
|
314
316
|
}) : '',
|
|
@@ -8,6 +8,7 @@ export interface ErrorMessageProps {
|
|
|
8
8
|
message?: string | null | undefined;
|
|
9
9
|
description?: string | null | undefined;
|
|
10
10
|
className?: string | null | undefined;
|
|
11
|
+
'data-test'?: string | null | undefined;
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
14
|
* @name Error Message
|
|
@@ -20,6 +21,7 @@ export default class ErrorMessage extends Component<ErrorMessageProps> {
|
|
|
20
21
|
description: PropTypes.Requireable<string>;
|
|
21
22
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
22
23
|
className: PropTypes.Requireable<string>;
|
|
24
|
+
'data-test': PropTypes.Requireable<string>;
|
|
23
25
|
};
|
|
24
26
|
render(): JSX.Element;
|
|
25
27
|
}
|
|
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import Icon from '../icon/icon.js';
|
|
6
6
|
import { Size } from '../icon/icon__constants.js';
|
|
7
|
+
import joinDataTestAttributes from '../global/data-tests.js';
|
|
7
8
|
import { m as modules_2c5e8509 } from '../_helpers/error-message.js';
|
|
8
9
|
import 'util-deprecate';
|
|
9
10
|
import '../_helpers/icon.js';
|
|
@@ -21,11 +22,13 @@ class ErrorMessage extends Component {
|
|
|
21
22
|
code,
|
|
22
23
|
message,
|
|
23
24
|
description,
|
|
24
|
-
children
|
|
25
|
+
children,
|
|
26
|
+
'data-test': dataTest
|
|
25
27
|
} = this.props;
|
|
26
28
|
const classes = classNames(modules_2c5e8509.errorMessage, className);
|
|
27
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
28
|
-
className: classes
|
|
30
|
+
className: classes,
|
|
31
|
+
"data-test": joinDataTestAttributes('ring-error-message', dataTest)
|
|
29
32
|
}, icon && /*#__PURE__*/React.createElement(Icon, {
|
|
30
33
|
className: modules_2c5e8509.icon,
|
|
31
34
|
glyph: icon,
|
|
@@ -46,7 +49,8 @@ _defineProperty(ErrorMessage, "propTypes", {
|
|
|
46
49
|
message: PropTypes.string,
|
|
47
50
|
description: PropTypes.string,
|
|
48
51
|
children: PropTypes.node,
|
|
49
|
-
className: PropTypes.string
|
|
52
|
+
className: PropTypes.string,
|
|
53
|
+
'data-test': PropTypes.string
|
|
50
54
|
});
|
|
51
55
|
|
|
52
56
|
export { ErrorMessage as default };
|
|
@@ -46,6 +46,7 @@ export interface QueryAssistProps {
|
|
|
46
46
|
clear?: boolean | null | undefined;
|
|
47
47
|
className?: string | null | undefined;
|
|
48
48
|
popupClassName?: string | null | undefined;
|
|
49
|
+
inputClassName?: string | null | undefined;
|
|
49
50
|
dataSource: (params: QueryAssistRequestParams) => Promise<QueryAssistResponse> | QueryAssistResponse;
|
|
50
51
|
delay?: number | null | undefined;
|
|
51
52
|
disabled?: boolean | undefined;
|
|
@@ -147,6 +148,10 @@ export default class QueryAssist extends Component<QueryAssistProps> {
|
|
|
147
148
|
* Additional class for the popup
|
|
148
149
|
*/
|
|
149
150
|
popupClassName: PropTypes.Requireable<string>;
|
|
151
|
+
/**
|
|
152
|
+
* Additional class for the input
|
|
153
|
+
*/
|
|
154
|
+
inputClassName: PropTypes.Requireable<string>;
|
|
150
155
|
/**
|
|
151
156
|
* Data source function
|
|
152
157
|
*/
|
|
@@ -784,7 +784,7 @@ class QueryAssist extends Component {
|
|
|
784
784
|
[modules_da7ab055.withIcon]: renderGlass && !huge || renderLoader,
|
|
785
785
|
[modules_da7ab055.huge]: huge
|
|
786
786
|
});
|
|
787
|
-
const inputClasses = classNames({
|
|
787
|
+
const inputClasses = classNames(this.props.inputClassName, {
|
|
788
788
|
[`${modules_da7ab055.input} ring-js-shortcuts`]: true,
|
|
789
789
|
[modules_da7ab055.inputGap]: actions.length || this.isRenderingGlassOrLoader() && !glass,
|
|
790
790
|
[modules_da7ab055.inputGap2]: actions.length === 2,
|
|
@@ -894,6 +894,10 @@ _defineProperty(QueryAssist, "propTypes", {
|
|
|
894
894
|
* Additional class for the popup
|
|
895
895
|
*/
|
|
896
896
|
popupClassName: PropTypes.string,
|
|
897
|
+
/**
|
|
898
|
+
* Additional class for the input
|
|
899
|
+
*/
|
|
900
|
+
inputClassName: PropTypes.string,
|
|
897
901
|
/**
|
|
898
902
|
* Data source function
|
|
899
903
|
*/
|