@jetbrains/ring-ui 5.0.6 → 5.0.9
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/checkbox-ng/checkbox-ng.js +10 -1
- package/components/date-picker/date-picker.css +22 -2
- package/components/date-picker/date-picker.js +16 -4
- package/components/date-picker/date-popup.js +0 -4
- package/components/global/variables_dark.css +4 -1
- package/components/list/list.d.ts +1 -0
- package/components/list/list.js +17 -10
- package/components/markdown/markdown.js +2 -2
- package/components/select/select-popup.css +0 -4
- package/components/select/select.css +4 -4
- package/components/table/table.css +2 -2
- package/dist/_helpers/date-picker.js +1 -1
- package/dist/checkbox-ng/checkbox-ng.js +9 -1
- package/dist/date-picker/date-picker.js +33 -17
- package/dist/date-picker/date-popup.js +8 -12
- package/dist/list/list.d.ts +1 -0
- package/dist/list/list.js +18 -14
- package/dist/markdown/markdown.js +2 -1
- package/dist/select/select.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +8 -7
|
@@ -41,13 +41,22 @@ angularModule.directive('rgCheckbox', function rgCheckboxDirective() {
|
|
|
41
41
|
</span><span class="${styles.label}" ng-transclude></span>
|
|
42
42
|
</label>
|
|
43
43
|
`),
|
|
44
|
-
link: function link(scope, iElement) {
|
|
44
|
+
link: function link(scope, iElement, attrs, controller, transcludeFn) {
|
|
45
45
|
scope.checkmarkIcon = checkmarkIcon;
|
|
46
46
|
const input = iElement[0].querySelector('input[type="checkbox"]');
|
|
47
|
+
const label = iElement[0].querySelector(`*[class~="${styles.label}"]`);
|
|
47
48
|
|
|
48
49
|
const id = CHECKBOX_ID_PREFIX + idCounter++;
|
|
49
50
|
iElement[0].setAttribute('for', id);
|
|
50
51
|
input.setAttribute('id', id);
|
|
52
|
+
|
|
53
|
+
transcludeFn(clone => {
|
|
54
|
+
if (clone.length) {
|
|
55
|
+
label.style.display = 'initial';
|
|
56
|
+
} else {
|
|
57
|
+
label.style.display = 'none';
|
|
58
|
+
}
|
|
59
|
+
});
|
|
51
60
|
}
|
|
52
61
|
};
|
|
53
62
|
});
|
|
@@ -74,14 +74,34 @@
|
|
|
74
74
|
composes: filterWrapper from "../select/select-popup.css";
|
|
75
75
|
|
|
76
76
|
display: flex;
|
|
77
|
+
|
|
78
|
+
padding-left: calc(unit * 2);
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
.filter {
|
|
80
82
|
composes: filter from "../select/select-popup.css";
|
|
81
83
|
}
|
|
82
84
|
|
|
83
|
-
.
|
|
84
|
-
|
|
85
|
+
.calendarIcon {
|
|
86
|
+
margin-right: calc(unit / 2);
|
|
87
|
+
|
|
88
|
+
color: var(--ring-icon-color);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.anchor {
|
|
92
|
+
min-width: calc(unit * 30);
|
|
93
|
+
padding: 0 calc(unit * 1.5) 0 unit;
|
|
94
|
+
|
|
95
|
+
text-align: start;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.anchorContent {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: baseline;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.chevronDownIcon {
|
|
104
|
+
margin-left: auto;
|
|
85
105
|
}
|
|
86
106
|
|
|
87
107
|
.fromInput {
|
|
@@ -8,9 +8,13 @@ import isSameYear from 'date-fns/isSameYear';
|
|
|
8
8
|
import isValid from 'date-fns/isValid';
|
|
9
9
|
import parse from 'date-fns/parse';
|
|
10
10
|
import set from 'date-fns/set';
|
|
11
|
+
import calendarIcon from '@jetbrains/icons/calendar';
|
|
12
|
+
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
11
13
|
import memoize from '../global/memoize';
|
|
12
14
|
import Popup from '../popup/popup';
|
|
13
|
-
import Dropdown
|
|
15
|
+
import Dropdown from '../dropdown/dropdown';
|
|
16
|
+
import Icon from '../icon';
|
|
17
|
+
import Button from '../button/button';
|
|
14
18
|
import DatePopup from './date-popup';
|
|
15
19
|
import { dateType } from './consts';
|
|
16
20
|
import styles from './date-picker.css';
|
|
@@ -184,13 +188,21 @@ export default class DatePicker extends PureComponent {
|
|
|
184
188
|
}
|
|
185
189
|
};
|
|
186
190
|
render() {
|
|
187
|
-
const
|
|
191
|
+
const anchorContent = (<div className={styles.anchorContent}>
|
|
192
|
+
<Icon glyph={calendarIcon} className={styles.calendarIcon}/>
|
|
193
|
+
{this.getAnchorText()}
|
|
194
|
+
<Icon glyph={chevronDownIcon} className={styles.chevronDownIcon}/>
|
|
195
|
+
</div>);
|
|
188
196
|
if (this.props.disabled) {
|
|
189
|
-
return <
|
|
197
|
+
return (<Button data-test-ring-dropdown-anchor className={styles.anchor} disabled text={false}>
|
|
198
|
+
{anchorContent}
|
|
199
|
+
</Button>);
|
|
190
200
|
}
|
|
191
201
|
const { className, popupClassName, clear, dropdownProps, translations, ...datePopupProps } = this.props;
|
|
192
202
|
const classes = classNames(styles.datePicker, className);
|
|
193
|
-
return (<Dropdown className={classes} anchor={
|
|
203
|
+
return (<Dropdown className={classes} anchor={(<Button data-test-ring-dropdown-anchor className={styles.anchor} text={false}>
|
|
204
|
+
{anchorContent}
|
|
205
|
+
</Button>)} {...dropdownProps}>
|
|
194
206
|
<PopupComponent className={popupClassName} popupRef={this.popupRef} onClear={clear ? this.clear : null} datePopupProps={{
|
|
195
207
|
...datePopupProps,
|
|
196
208
|
// We want to provide translations further down to DateInput.
|
|
@@ -4,8 +4,6 @@ import isAfter from 'date-fns/isAfter';
|
|
|
4
4
|
import isBefore from 'date-fns/isBefore';
|
|
5
5
|
import isSameDay from 'date-fns/isSameDay';
|
|
6
6
|
import startOfDay from 'date-fns/startOfDay';
|
|
7
|
-
import calendarIcon from '@jetbrains/icons/calendar';
|
|
8
|
-
import Icon from '../icon/icon';
|
|
9
7
|
import memoize from '../global/memoize';
|
|
10
8
|
import DateInput from './date-input';
|
|
11
9
|
import Months from './months';
|
|
@@ -317,8 +315,6 @@ export default class DatePopup extends Component {
|
|
|
317
315
|
const clearable = Boolean(this.props.onClear);
|
|
318
316
|
return (<div className={styles.datePopup} data-test="ring-date-popup" ref={this.componentRef}>
|
|
319
317
|
<div className={styles.filterWrapper}>
|
|
320
|
-
<Icon glyph={calendarIcon} className={styles.filterIcon}/>
|
|
321
|
-
|
|
322
318
|
{names.map(name => {
|
|
323
319
|
let onClear;
|
|
324
320
|
if (clearable && name !== 'from' && !this.isInTimeMode()) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* stylelint-disable color-no-hex */
|
|
2
2
|
|
|
3
|
-
.dark
|
|
3
|
+
.dark,
|
|
4
|
+
:root.dark {
|
|
4
5
|
--ring-line-color: #475159;
|
|
5
6
|
--ring-borders-color: #406380;
|
|
6
7
|
--ring-icon-color: #80929d;
|
|
@@ -64,4 +65,6 @@
|
|
|
64
65
|
--ring-code-string-color: #6a8759;
|
|
65
66
|
--ring-code-addition-color: #447152;
|
|
66
67
|
--ring-code-deletion-color: #656e76;
|
|
68
|
+
|
|
69
|
+
color-scheme: dark;
|
|
67
70
|
}
|
|
@@ -154,6 +154,7 @@ export default class List<T = unknown> extends Component<ListProps<T>, ListState
|
|
|
154
154
|
private _cache;
|
|
155
155
|
private _hasActivatableItems;
|
|
156
156
|
hasActivatableItems(): any;
|
|
157
|
+
activateFirst: () => void;
|
|
157
158
|
selectHandler: (arg: number) => (event: Event | SyntheticEvent, tryKeepOpen?: boolean) => void;
|
|
158
159
|
checkboxHandler: (arg: number) => (event: SyntheticEvent) => void;
|
|
159
160
|
upHandler: (e: KeyboardEvent) => void;
|
package/components/list/list.js
CHANGED
|
@@ -144,16 +144,8 @@ export default class List extends Component {
|
|
|
144
144
|
componentDidMount() {
|
|
145
145
|
document.addEventListener('mousemove', this.onDocumentMouseMove);
|
|
146
146
|
document.addEventListener('keydown', this.onDocumentKeyDown, true);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const firstActivatableIndex = data.findIndex(isActivatable);
|
|
150
|
-
if (firstActivatableIndex >= 0) {
|
|
151
|
-
this.setState({
|
|
152
|
-
activeIndex: firstActivatableIndex,
|
|
153
|
-
activeItem: data[firstActivatableIndex],
|
|
154
|
-
needScrollToActive: true
|
|
155
|
-
});
|
|
156
|
-
}
|
|
147
|
+
if (this.props.activeIndex == null && shouldActivateFirstItem(this.props)) {
|
|
148
|
+
this.activateFirst();
|
|
157
149
|
}
|
|
158
150
|
}
|
|
159
151
|
shouldComponentUpdate(nextProps, nextState) {
|
|
@@ -165,6 +157,11 @@ export default class List extends Component {
|
|
|
165
157
|
if (this.virtualizedList && prevProps.data !== this.props.data) {
|
|
166
158
|
this.virtualizedList.recomputeRowHeights();
|
|
167
159
|
}
|
|
160
|
+
if (this.props.activeIndex == null &&
|
|
161
|
+
this.props.data !== prevProps.data &&
|
|
162
|
+
shouldActivateFirstItem(this.props)) {
|
|
163
|
+
this.activateFirst();
|
|
164
|
+
}
|
|
168
165
|
this.checkOverflow();
|
|
169
166
|
}
|
|
170
167
|
componentWillUnmount() {
|
|
@@ -231,6 +228,16 @@ export default class List extends Component {
|
|
|
231
228
|
hasActivatableItems() {
|
|
232
229
|
return this._hasActivatableItems(this.props.data);
|
|
233
230
|
}
|
|
231
|
+
activateFirst = () => {
|
|
232
|
+
const firstActivatableIndex = this.props.data.findIndex(isActivatable);
|
|
233
|
+
if (firstActivatableIndex >= 0) {
|
|
234
|
+
this.setState({
|
|
235
|
+
activeIndex: firstActivatableIndex,
|
|
236
|
+
activeItem: this.props.data[firstActivatableIndex],
|
|
237
|
+
needScrollToActive: true
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
};
|
|
234
241
|
selectHandler = memoize((index) => (event, tryKeepOpen = false) => {
|
|
235
242
|
const item = this.props.data[index];
|
|
236
243
|
if (!this.props.useMouseUp && item.onClick) {
|
|
@@ -15,12 +15,12 @@ import styles from './markdown.css';
|
|
|
15
15
|
*/
|
|
16
16
|
export default class Markdown extends PureComponent {
|
|
17
17
|
render() {
|
|
18
|
-
const { className, components, inline, children, plugins = [], ...restProps } = this.props;
|
|
18
|
+
const { className, components, inline, children, plugins = [], remarkPlugins = [], ...restProps } = this.props;
|
|
19
19
|
const classes = classNames(className, {
|
|
20
20
|
[styles.markdown]: !inline,
|
|
21
21
|
[styles.inline]: inline
|
|
22
22
|
});
|
|
23
|
-
return (<ReactMarkdown className={classes}
|
|
23
|
+
return (<ReactMarkdown className={classes} remarkPlugins={[RemarkBreaks, RemarkGFM, ...plugins, ...remarkPlugins]} components={{
|
|
24
24
|
a: Link,
|
|
25
25
|
code: Code,
|
|
26
26
|
h1: Heading,
|
|
@@ -174,6 +174,10 @@
|
|
|
174
174
|
box-shadow: button-shadow var(--ring-main-color);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
.heightS .buttonValue {
|
|
178
|
+
font-size: var(--ring-font-size);
|
|
179
|
+
}
|
|
180
|
+
|
|
177
181
|
.label {
|
|
178
182
|
position: relative;
|
|
179
183
|
|
|
@@ -230,10 +234,6 @@
|
|
|
230
234
|
color: inherit;
|
|
231
235
|
}
|
|
232
236
|
|
|
233
|
-
.heightS .avatar {
|
|
234
|
-
vertical-align: -6px;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
237
|
.heightS .icons {
|
|
238
238
|
top: -5px;
|
|
239
239
|
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
color: var(--ring-secondary-color);
|
|
33
33
|
|
|
34
|
-
font-weight:
|
|
34
|
+
font-weight: normal;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.headerCell:first-child {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.headerCell.headerCellSorted {
|
|
52
|
-
font-weight:
|
|
52
|
+
font-weight: bold;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.headerCell.headerCellSortable {
|
|
@@ -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","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","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","
|
|
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","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","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 };
|
|
@@ -24,12 +24,20 @@ angularModule.directive('rgCheckbox', function rgCheckboxDirective() {
|
|
|
24
24
|
transclude: true,
|
|
25
25
|
replace: true,
|
|
26
26
|
template: proxyAttrs("\n<label class=\"".concat(modules_3199090e.checkbox, "\">\n <input\n data-proxy-ng-disabled\n data-proxy-ng-model\n data-proxy-ng-change\n data-proxy-ng-true-value\n data-proxy-ng-false-value\n data-proxy-name\n data-proxy-title\n data-proxy-aria-label\n data-test=\"ring-checkbox\"\n type=\"checkbox\"\n class=\"").concat(modules_3199090e.input, "\"\n />\n <span class=\"").concat(modules_3199090e.cell, "\">\n <rg-icon class=\"").concat(modules_3199090e.check, "\" glyph=\"{{:: checkmarkIcon}}\" />\n </span><span class=\"").concat(modules_3199090e.label, "\" ng-transclude></span>\n</label>\n ")),
|
|
27
|
-
link: function link(scope, iElement) {
|
|
27
|
+
link: function link(scope, iElement, attrs, controller, transcludeFn) {
|
|
28
28
|
scope.checkmarkIcon = checkmarkIcon;
|
|
29
29
|
const input = iElement[0].querySelector('input[type="checkbox"]');
|
|
30
|
+
const label = iElement[0].querySelector("*[class~=\"".concat(modules_3199090e.label, "\"]"));
|
|
30
31
|
const id = CHECKBOX_ID_PREFIX + idCounter++;
|
|
31
32
|
iElement[0].setAttribute('for', id);
|
|
32
33
|
input.setAttribute('id', id);
|
|
34
|
+
transcludeFn(clone => {
|
|
35
|
+
if (clone.length) {
|
|
36
|
+
label.style.display = 'initial';
|
|
37
|
+
} else {
|
|
38
|
+
label.style.display = 'none';
|
|
39
|
+
}
|
|
40
|
+
});
|
|
33
41
|
}
|
|
34
42
|
};
|
|
35
43
|
});
|
|
@@ -10,15 +10,18 @@ import isSameYear from 'date-fns/isSameYear';
|
|
|
10
10
|
import isValid from 'date-fns/isValid';
|
|
11
11
|
import parse from 'date-fns/parse';
|
|
12
12
|
import set from 'date-fns/set';
|
|
13
|
+
import calendarIcon from '@jetbrains/icons/calendar';
|
|
14
|
+
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
13
15
|
import memoize from '../global/memoize.js';
|
|
14
16
|
import Popup from '../popup/popup.js';
|
|
15
17
|
import Dropdown from '../dropdown/dropdown.js';
|
|
18
|
+
import Icon from '../icon/icon.js';
|
|
19
|
+
import { Button } from '../button/button.js';
|
|
16
20
|
import DatePopup from './date-popup.js';
|
|
17
21
|
import { dateType } from './consts.js';
|
|
18
22
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
|
19
23
|
import formats from './formats.js';
|
|
20
24
|
import DateInput from './date-input.js';
|
|
21
|
-
import { A as Anchor } from '../_helpers/anchor.js';
|
|
22
25
|
import 'core-js/modules/es.string.replace.js';
|
|
23
26
|
import 'react-dom';
|
|
24
27
|
import '../global/get-uid.js';
|
|
@@ -35,15 +38,19 @@ import '../popup/position.js';
|
|
|
35
38
|
import '../popup/popup.consts.js';
|
|
36
39
|
import '../popup/popup.target.js';
|
|
37
40
|
import '../global/typescript-utils.js';
|
|
38
|
-
import '
|
|
39
|
-
import '
|
|
40
|
-
import 'date-fns/startOfDay';
|
|
41
|
-
import '@jetbrains/icons/calendar';
|
|
42
|
-
import '../icon/icon.js';
|
|
41
|
+
import '../_helpers/anchor.js';
|
|
42
|
+
import '@jetbrains/icons/chevron-10px';
|
|
43
43
|
import 'util-deprecate';
|
|
44
44
|
import '../icon/icon__constants.js';
|
|
45
45
|
import '../_helpers/icon.js';
|
|
46
46
|
import '../icon/icon__svg.js';
|
|
47
|
+
import 'focus-visible';
|
|
48
|
+
import '../link/clickableLink.js';
|
|
49
|
+
import '../global/controls-height.js';
|
|
50
|
+
import '../_helpers/button__classes.js';
|
|
51
|
+
import 'date-fns/isAfter';
|
|
52
|
+
import 'date-fns/isBefore';
|
|
53
|
+
import 'date-fns/startOfDay';
|
|
47
54
|
import './months.js';
|
|
48
55
|
import 'date-fns/addMonths';
|
|
49
56
|
import 'date-fns/getDay';
|
|
@@ -74,12 +81,6 @@ import 'date-fns/add';
|
|
|
74
81
|
import '../input/input.js';
|
|
75
82
|
import '@jetbrains/icons/close-12px';
|
|
76
83
|
import '../global/prop-types.js';
|
|
77
|
-
import '../button/button.js';
|
|
78
|
-
import 'focus-visible';
|
|
79
|
-
import '@jetbrains/icons/chevron-10px';
|
|
80
|
-
import '../link/clickableLink.js';
|
|
81
|
-
import '../global/controls-height.js';
|
|
82
|
-
import '../_helpers/button__classes.js';
|
|
83
84
|
import '../global/composeRefs.js';
|
|
84
85
|
import '../_helpers/input.js';
|
|
85
86
|
|
|
@@ -235,12 +236,23 @@ class DatePicker extends PureComponent {
|
|
|
235
236
|
}
|
|
236
237
|
|
|
237
238
|
render() {
|
|
238
|
-
const
|
|
239
|
+
const anchorContent = /*#__PURE__*/React.createElement("div", {
|
|
240
|
+
className: modules_0c7b7d96.anchorContent
|
|
241
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
242
|
+
glyph: calendarIcon,
|
|
243
|
+
className: modules_0c7b7d96.calendarIcon
|
|
244
|
+
}), this.getAnchorText(), /*#__PURE__*/React.createElement(Icon, {
|
|
245
|
+
glyph: chevronDownIcon,
|
|
246
|
+
className: modules_0c7b7d96.chevronDownIcon
|
|
247
|
+
}));
|
|
239
248
|
|
|
240
249
|
if (this.props.disabled) {
|
|
241
|
-
return /*#__PURE__*/React.createElement(
|
|
242
|
-
|
|
243
|
-
|
|
250
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
251
|
+
"data-test-ring-dropdown-anchor": true,
|
|
252
|
+
className: modules_0c7b7d96.anchor,
|
|
253
|
+
disabled: true,
|
|
254
|
+
text: false
|
|
255
|
+
}, anchorContent);
|
|
244
256
|
}
|
|
245
257
|
|
|
246
258
|
const {
|
|
@@ -254,7 +266,11 @@ class DatePicker extends PureComponent {
|
|
|
254
266
|
const classes = classNames(modules_0c7b7d96.datePicker, className);
|
|
255
267
|
return /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
256
268
|
className: classes,
|
|
257
|
-
anchor:
|
|
269
|
+
anchor: /*#__PURE__*/React.createElement(Button, {
|
|
270
|
+
"data-test-ring-dropdown-anchor": true,
|
|
271
|
+
className: modules_0c7b7d96.anchor,
|
|
272
|
+
text: false
|
|
273
|
+
}, anchorContent)
|
|
258
274
|
}, dropdownProps), /*#__PURE__*/React.createElement(PopupComponent, {
|
|
259
275
|
className: popupClassName,
|
|
260
276
|
popupRef: this.popupRef,
|
|
@@ -5,8 +5,6 @@ import isAfter from 'date-fns/isAfter';
|
|
|
5
5
|
import isBefore from 'date-fns/isBefore';
|
|
6
6
|
import isSameDay from 'date-fns/isSameDay';
|
|
7
7
|
import startOfDay from 'date-fns/startOfDay';
|
|
8
|
-
import calendarIcon from '@jetbrains/icons/calendar';
|
|
9
|
-
import Icon from '../icon/icon.js';
|
|
10
8
|
import memoize from '../global/memoize.js';
|
|
11
9
|
import DateInput from './date-input.js';
|
|
12
10
|
import Months from './months.js';
|
|
@@ -14,19 +12,20 @@ import Years from './years.js';
|
|
|
14
12
|
import Weekdays from './weekdays.js';
|
|
15
13
|
import { dateType, parseTime } from './consts.js';
|
|
16
14
|
import { m as modules_0c7b7d96 } from '../_helpers/date-picker.js';
|
|
17
|
-
import 'classnames';
|
|
18
|
-
import 'util-deprecate';
|
|
19
|
-
import '../icon/icon__constants.js';
|
|
20
|
-
import '../_helpers/icon.js';
|
|
21
|
-
import '../icon/icon__svg.js';
|
|
22
|
-
import 'core-js/modules/es.string.replace.js';
|
|
23
15
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
16
|
+
import 'core-js/modules/es.string.replace.js';
|
|
17
|
+
import 'classnames';
|
|
24
18
|
import '../input/input.js';
|
|
25
19
|
import '@jetbrains/icons/close-12px';
|
|
26
20
|
import '../global/prop-types.js';
|
|
27
21
|
import '../button/button.js';
|
|
28
22
|
import 'focus-visible';
|
|
29
23
|
import '@jetbrains/icons/chevron-10px';
|
|
24
|
+
import '../icon/icon.js';
|
|
25
|
+
import 'util-deprecate';
|
|
26
|
+
import '../icon/icon__constants.js';
|
|
27
|
+
import '../_helpers/icon.js';
|
|
28
|
+
import '../icon/icon__svg.js';
|
|
30
29
|
import '../link/clickableLink.js';
|
|
31
30
|
import '../global/controls-height.js';
|
|
32
31
|
import '../_helpers/button__classes.js';
|
|
@@ -418,10 +417,7 @@ class DatePopup extends Component {
|
|
|
418
417
|
ref: this.componentRef
|
|
419
418
|
}, /*#__PURE__*/React.createElement("div", {
|
|
420
419
|
className: modules_0c7b7d96.filterWrapper
|
|
421
|
-
},
|
|
422
|
-
glyph: calendarIcon,
|
|
423
|
-
className: modules_0c7b7d96.filterIcon
|
|
424
|
-
}), names.map(name => {
|
|
420
|
+
}, names.map(name => {
|
|
425
421
|
let onClear;
|
|
426
422
|
|
|
427
423
|
if (clearable && name !== 'from' && !this.isInTimeMode()) {
|
package/dist/list/list.d.ts
CHANGED
|
@@ -154,6 +154,7 @@ export default class List<T = unknown> extends Component<ListProps<T>, ListState
|
|
|
154
154
|
private _cache;
|
|
155
155
|
private _hasActivatableItems;
|
|
156
156
|
hasActivatableItems(): any;
|
|
157
|
+
activateFirst: () => void;
|
|
157
158
|
selectHandler: (arg: number) => (event: Event | SyntheticEvent, tryKeepOpen?: boolean) => void;
|
|
158
159
|
checkboxHandler: (arg: number) => (event: SyntheticEvent) => void;
|
|
159
160
|
upHandler: (e: KeyboardEvent) => void;
|
package/dist/list/list.js
CHANGED
|
@@ -168,6 +168,18 @@ class List extends Component {
|
|
|
168
168
|
|
|
169
169
|
_defineProperty(this, "_hasActivatableItems", memoizeOne(items => items.some(isActivatable)));
|
|
170
170
|
|
|
171
|
+
_defineProperty(this, "activateFirst", () => {
|
|
172
|
+
const firstActivatableIndex = this.props.data.findIndex(isActivatable);
|
|
173
|
+
|
|
174
|
+
if (firstActivatableIndex >= 0) {
|
|
175
|
+
this.setState({
|
|
176
|
+
activeIndex: firstActivatableIndex,
|
|
177
|
+
activeItem: this.props.data[firstActivatableIndex],
|
|
178
|
+
needScrollToActive: true
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
171
183
|
_defineProperty(this, "selectHandler", memoize(index => function (event) {
|
|
172
184
|
let tryKeepOpen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
173
185
|
const item = _this.props.data[index];
|
|
@@ -534,21 +546,9 @@ class List extends Component {
|
|
|
534
546
|
componentDidMount() {
|
|
535
547
|
document.addEventListener('mousemove', this.onDocumentMouseMove);
|
|
536
548
|
document.addEventListener('keydown', this.onDocumentKeyDown, true);
|
|
537
|
-
const {
|
|
538
|
-
data,
|
|
539
|
-
activeIndex
|
|
540
|
-
} = this.props;
|
|
541
|
-
|
|
542
|
-
if (activeIndex == null && shouldActivateFirstItem(this.props)) {
|
|
543
|
-
const firstActivatableIndex = data.findIndex(isActivatable);
|
|
544
549
|
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
activeIndex: firstActivatableIndex,
|
|
548
|
-
activeItem: data[firstActivatableIndex],
|
|
549
|
-
needScrollToActive: true
|
|
550
|
-
});
|
|
551
|
-
}
|
|
550
|
+
if (this.props.activeIndex == null && shouldActivateFirstItem(this.props)) {
|
|
551
|
+
this.activateFirst();
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
|
|
@@ -561,6 +561,10 @@ class List extends Component {
|
|
|
561
561
|
this.virtualizedList.recomputeRowHeights();
|
|
562
562
|
}
|
|
563
563
|
|
|
564
|
+
if (this.props.activeIndex == null && this.props.data !== prevProps.data && shouldActivateFirstItem(this.props)) {
|
|
565
|
+
this.activateFirst();
|
|
566
|
+
}
|
|
567
|
+
|
|
564
568
|
this.checkOverflow();
|
|
565
569
|
}
|
|
566
570
|
|
|
@@ -37,6 +37,7 @@ class Markdown extends PureComponent {
|
|
|
37
37
|
inline,
|
|
38
38
|
children,
|
|
39
39
|
plugins = [],
|
|
40
|
+
remarkPlugins = [],
|
|
40
41
|
...restProps
|
|
41
42
|
} = this.props;
|
|
42
43
|
const classes = classNames(className, {
|
|
@@ -45,7 +46,7 @@ class Markdown extends PureComponent {
|
|
|
45
46
|
});
|
|
46
47
|
return /*#__PURE__*/React.createElement(ReactMarkdown, _extends({
|
|
47
48
|
className: classes,
|
|
48
|
-
|
|
49
|
+
remarkPlugins: [RemarkBreaks, RemarkGFM, ...plugins, ...remarkPlugins],
|
|
49
50
|
components: {
|
|
50
51
|
a: MarkdownLink,
|
|
51
52
|
code: MarkdownCode,
|
package/dist/select/select.js
CHANGED
|
@@ -80,7 +80,7 @@ import '../caret/caret.js';
|
|
|
80
80
|
import '../text/text.js';
|
|
81
81
|
import '../_helpers/select__filter.js';
|
|
82
82
|
|
|
83
|
-
var modules_9d0de074 = {"unit":"8px","button-shadow":"inset 0 0 0 1px","select":"select_rui_11de","value":"value_rui_11de ellipsis_rui_8bff font_rui_8bff","icons":"icons_rui_11de","toolbar":"toolbar_rui_11de","button":"button_rui_11de","buttonSpaced":"buttonSpaced_rui_11de","inputMode":"inputMode_rui_11de","selectedIcon":"selectedIcon_rui_11de resetButton_rui_8bff","clearIcon":"clearIcon_rui_11de","sizeS":"sizeS_rui_11de","sizeM":"sizeM_rui_11de","sizeL":"sizeL_rui_11de","sizeFULL":"sizeFULL_rui_11de","sizeAUTO":"sizeAUTO_rui_11de","buttonMode":"buttonMode_rui_11de","open":"open_rui_11de","buttonContainer":"buttonContainer_rui_11de","buttonValue":"buttonValue_rui_11de ellipsis_rui_8bff","buttonValueOpen":"buttonValueOpen_rui_11de","label":"label_rui_11de","disabled":"disabled_rui_11de","avatar":"avatar_rui_11de","popup":"popup_rui_11de","chevron":"chevron_rui_11de","chevronIcon":"chevronIcon_rui_11de"
|
|
83
|
+
var modules_9d0de074 = {"unit":"8px","button-shadow":"inset 0 0 0 1px","select":"select_rui_11de","value":"value_rui_11de ellipsis_rui_8bff font_rui_8bff","icons":"icons_rui_11de","toolbar":"toolbar_rui_11de","button":"button_rui_11de","buttonSpaced":"buttonSpaced_rui_11de","inputMode":"inputMode_rui_11de","selectedIcon":"selectedIcon_rui_11de resetButton_rui_8bff","clearIcon":"clearIcon_rui_11de","sizeS":"sizeS_rui_11de","sizeM":"sizeM_rui_11de","sizeL":"sizeL_rui_11de","sizeFULL":"sizeFULL_rui_11de","sizeAUTO":"sizeAUTO_rui_11de","buttonMode":"buttonMode_rui_11de","open":"open_rui_11de","buttonContainer":"buttonContainer_rui_11de","buttonValue":"buttonValue_rui_11de ellipsis_rui_8bff","buttonValueOpen":"buttonValueOpen_rui_11de","heightS":"heightS_rui_11de","label":"label_rui_11de","disabled":"disabled_rui_11de","avatar":"avatar_rui_11de","popup":"popup_rui_11de","chevron":"chevron_rui_11de","chevronIcon":"chevronIcon_rui_11de"};
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* @name Select
|