@jetbrains/ring-ui 5.0.14 → 5.0.17
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/dialog/dialog.d.ts +2 -0
- package/components/dialog/dialog.js +3 -2
- package/components/form/form.examples.js +5 -5
- package/components/input/input-legacy.css +75 -44
- package/components/input-size/input-size.css +26 -4
- package/components/input-size/input-size.examples.js +5 -5
- package/components/panel/panel.css +1 -1
- package/components/save-field-ng/save-field-ng.examples.js +4 -4
- package/components/table/row.d.ts +1 -0
- package/components/table/row.js +6 -6
- package/components/table/smart-table.d.ts +1 -0
- package/components/table/table.d.ts +1 -0
- package/components/table/table.js +2 -2
- package/dist/dialog/dialog.d.ts +2 -0
- package/dist/dialog/dialog.js +4 -1
- package/dist/popup/position.js +1 -1
- package/dist/style.css +1 -1
- package/dist/table/row.d.ts +1 -0
- package/dist/table/row.js +8 -4
- package/dist/table/smart-table.d.ts +1 -0
- package/dist/table/table.d.ts +1 -0
- package/dist/table/table.js +2 -0
- package/package.json +20 -19
|
@@ -10,6 +10,7 @@ export interface DialogProps extends Partial<TabTrapProps> {
|
|
|
10
10
|
onCloseAttempt: (event: React.MouseEvent<HTMLElement> | KeyboardEvent) => void;
|
|
11
11
|
showCloseButton: boolean;
|
|
12
12
|
closeButtonInside: boolean;
|
|
13
|
+
closeButtonTitle?: string;
|
|
13
14
|
trapFocus: boolean;
|
|
14
15
|
contentClassName?: string | null | undefined;
|
|
15
16
|
portalTarget?: Element | null | undefined;
|
|
@@ -28,6 +29,7 @@ export default class Dialog extends PureComponent<DialogProps> {
|
|
|
28
29
|
show: PropTypes.Validator<boolean>;
|
|
29
30
|
showCloseButton: PropTypes.Requireable<boolean>;
|
|
30
31
|
closeButtonInside: PropTypes.Requireable<boolean>;
|
|
32
|
+
closeButtonTitle: PropTypes.Requireable<string>;
|
|
31
33
|
onOverlayClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
34
|
onEscPress: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
35
|
onCloseClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -28,6 +28,7 @@ export default class Dialog extends PureComponent {
|
|
|
28
28
|
show: PropTypes.bool.isRequired,
|
|
29
29
|
showCloseButton: PropTypes.bool,
|
|
30
30
|
closeButtonInside: PropTypes.bool,
|
|
31
|
+
closeButtonTitle: PropTypes.string,
|
|
31
32
|
onOverlayClick: PropTypes.func,
|
|
32
33
|
onEscPress: PropTypes.func,
|
|
33
34
|
onCloseClick: PropTypes.func,
|
|
@@ -99,7 +100,7 @@ export default class Dialog extends PureComponent {
|
|
|
99
100
|
this.dialog = tabTrap && tabTrap.node;
|
|
100
101
|
};
|
|
101
102
|
render() {
|
|
102
|
-
const { show, showCloseButton, onOverlayClick, onCloseAttempt, onEscPress, onCloseClick, children, className, contentClassName, trapFocus, 'data-test': dataTest, closeButtonInside, portalTarget, label, ...restProps } = this.props;
|
|
103
|
+
const { show, showCloseButton, onOverlayClick, onCloseAttempt, onEscPress, onCloseClick, children, className, contentClassName, trapFocus, 'data-test': dataTest, closeButtonInside, portalTarget, label, closeButtonTitle, ...restProps } = this.props;
|
|
103
104
|
const classes = classNames(styles.container, className);
|
|
104
105
|
const shortcutsMap = this.getShortcutsMap();
|
|
105
106
|
return show && createPortal(<PopupTarget id={this.uid} className={styles.popupTarget}>
|
|
@@ -115,7 +116,7 @@ export default class Dialog extends PureComponent {
|
|
|
115
116
|
(<Button icon={closeIcon} data-test="ring-dialog-close-button" className={classNames(styles.closeButton, {
|
|
116
117
|
[styles.closeButtonOutside]: !closeButtonInside,
|
|
117
118
|
[styles.closeButtonInside]: closeButtonInside
|
|
118
|
-
})} iconClassName={styles.closeIcon} onClick={this.onCloseClick} aria-label=
|
|
119
|
+
})} iconClassName={styles.closeIcon} onClick={this.onCloseClick} title={closeButtonTitle} aria-label={closeButtonTitle || 'close dialog'}/>)}
|
|
119
120
|
</AdaptiveIsland>
|
|
120
121
|
</div>
|
|
121
122
|
{target}
|
|
@@ -36,7 +36,7 @@ export const basic = () => {
|
|
|
36
36
|
<div class="ring-form__group">
|
|
37
37
|
<label for="ring-form-2" class="ring-form__label">Medium Input</label>
|
|
38
38
|
<div class="ring-form__control">
|
|
39
|
-
<input class="ring-input ring-input-
|
|
39
|
+
<input class="ring-input ring-input-size_m" id="ring-form-2"
|
|
40
40
|
type="text">
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
@@ -44,7 +44,7 @@ export const basic = () => {
|
|
|
44
44
|
<div class="ring-form__group">
|
|
45
45
|
<label for="ring-form-3" class="ring-form__label">Medium Input & Error</label>
|
|
46
46
|
<div class="ring-form__control">
|
|
47
|
-
<input class="ring-input ring-input_error ring-input-
|
|
47
|
+
<input class="ring-input ring-input_error ring-input-size_m"
|
|
48
48
|
id="ring-form-3" type="text">
|
|
49
49
|
<div class="ring-error-bubble active">Error bubble</div>
|
|
50
50
|
</div>
|
|
@@ -75,7 +75,7 @@ export const basic = () => {
|
|
|
75
75
|
<div class="ring-form__group">
|
|
76
76
|
<label for="ring-form-7" class="ring-form__label">Textarea</label>
|
|
77
77
|
<div class="ring-form__control">
|
|
78
|
-
<textarea class="ring-input ring-input-
|
|
78
|
+
<textarea class="ring-input ring-input-size_m"
|
|
79
79
|
id="ring-form-7"></textarea>
|
|
80
80
|
</div>
|
|
81
81
|
</div>
|
|
@@ -101,7 +101,7 @@ export const basic = () => {
|
|
|
101
101
|
<label for="ring-form-11" class="ring-form__label">Input in
|
|
102
102
|
a small container</label>
|
|
103
103
|
<div class="ring-form__control ring-form__control_small">
|
|
104
|
-
<input class="ring-input ring-input-
|
|
104
|
+
<input class="ring-input ring-input-size_m" id="ring-form-11"
|
|
105
105
|
type="text">
|
|
106
106
|
</div>
|
|
107
107
|
</div>
|
|
@@ -110,7 +110,7 @@ export const basic = () => {
|
|
|
110
110
|
<label for="ring-form-12" class="ring-form__label">Textarea in
|
|
111
111
|
a small container</label>
|
|
112
112
|
<div class="ring-form__control ring-form__control_small">
|
|
113
|
-
<textarea class="ring-input ring-input-
|
|
113
|
+
<textarea class="ring-input ring-input-size_m"
|
|
114
114
|
id="ring-form-12"></textarea>
|
|
115
115
|
</div>
|
|
116
116
|
</div>
|
|
@@ -16,46 +16,84 @@ Input
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
:global(.ring-input) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
padding-
|
|
24
|
-
padding-bottom: 3px;
|
|
25
|
-
padding-left: calc(unit / 2);
|
|
19
|
+
/* .heightS */
|
|
20
|
+
--ring-input-padding-block: 1px;
|
|
21
|
+
--ring-input-padding-inline: unit;
|
|
22
|
+
--ring-input-padding-start: var(--ring-input-padding-inline);
|
|
23
|
+
--ring-input-padding-end: var(--ring-input-padding-inline);
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
border: 1px solid var(--ring-borders-color);
|
|
30
|
-
border-radius: 0;
|
|
31
|
-
background-color: var(--ring-content-background-color);
|
|
25
|
+
/* stylelint-disable order/properties-order */
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
box-sizing: border-box;
|
|
34
28
|
|
|
29
|
+
font: inherit;
|
|
35
30
|
font-size: var(--ring-font-size);
|
|
31
|
+
line-height: var(--ring-line-height);
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
appearance: none;
|
|
39
|
-
}
|
|
33
|
+
width: 100%;
|
|
40
34
|
|
|
41
|
-
:
|
|
42
|
-
:
|
|
43
|
-
:
|
|
44
|
-
:
|
|
45
|
-
|
|
46
|
-
outline: 0;
|
|
47
|
-
}
|
|
35
|
+
margin: 0;
|
|
36
|
+
padding-top: var(--ring-input-padding-block);
|
|
37
|
+
padding-right: var(--ring-input-padding-end);
|
|
38
|
+
padding-bottom: var(--ring-input-padding-block);
|
|
39
|
+
padding-left: var(--ring-input-padding-start);
|
|
48
40
|
|
|
49
|
-
:
|
|
50
|
-
border-color: var(--ring-success-color);
|
|
51
|
-
}
|
|
41
|
+
transition: border-color var(--ring-ease);
|
|
52
42
|
|
|
53
|
-
:
|
|
54
|
-
border
|
|
43
|
+
color: var(--ring-text-color);
|
|
44
|
+
border: 1px solid var(--ring-borders-color);
|
|
45
|
+
border-radius: var(--ring-border-radius);
|
|
46
|
+
outline: none;
|
|
47
|
+
background: transparent;
|
|
48
|
+
|
|
49
|
+
caret-color: var(--ring-main-color);
|
|
50
|
+
|
|
51
|
+
/* stylelint-enable order/properties-order */
|
|
52
|
+
|
|
53
|
+
@nest [dir=rtl] & {
|
|
54
|
+
padding-right: var(--ring-input-padding-start);
|
|
55
|
+
padding-left: var(--ring-input-padding-end);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:hover {
|
|
59
|
+
transition: none;
|
|
60
|
+
|
|
61
|
+
border-color: var(--ring-border-hover-color);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@nest .error & {
|
|
65
|
+
border-color: var(--ring-icon-error-color);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:focus {
|
|
69
|
+
transition: none;
|
|
70
|
+
|
|
71
|
+
border-color: var(--ring-main-color);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&[disabled] {
|
|
75
|
+
color: var(--ring-disabled-color);
|
|
76
|
+
border-color: var(--ring-border-disabled-color);
|
|
77
|
+
background-color: var(--ring-disabled-background-color);
|
|
78
|
+
|
|
79
|
+
-webkit-text-fill-color: var(--ring-disabled-color); /* Required for Safari, see RG-2063 for details */
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
Kill yellow/blue webkit autocomplete
|
|
84
|
+
https://css-tricks.com/snippets/css/change-autocomplete-styles-webkit-browsers/
|
|
85
|
+
*/
|
|
86
|
+
&:-webkit-autofill {
|
|
87
|
+
&,
|
|
88
|
+
&:hover,
|
|
89
|
+
&:focus {
|
|
90
|
+
transition: background-color 50000s ease-in-out 0s;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
55
93
|
}
|
|
56
94
|
|
|
57
|
-
:global(.ring-
|
|
58
|
-
|
|
95
|
+
:global(.ring-input_error) {
|
|
96
|
+
border-color: var(--ring-icon-error-color);
|
|
59
97
|
}
|
|
60
98
|
|
|
61
99
|
:global(.ring-input_filter-popup) {
|
|
@@ -63,32 +101,25 @@ Input
|
|
|
63
101
|
min-width: 200px;
|
|
64
102
|
}
|
|
65
103
|
|
|
66
|
-
:global(.ring-input_material) {
|
|
67
|
-
padding-right: 0;
|
|
68
|
-
padding-left: 0;
|
|
69
|
-
|
|
70
|
-
border-top: 0;
|
|
71
|
-
border-right: 0;
|
|
72
|
-
border-left: 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
104
|
:global(.ring-input.ring-input:disabled),
|
|
76
105
|
:global(.ring-input.ring-input[disabled]),
|
|
77
106
|
:global(.ring-input.ring-input_disabled) {
|
|
78
107
|
color: var(--ring-disabled-color);
|
|
79
108
|
border-color: var(--ring-border-disabled-color);
|
|
80
|
-
background-color: var(--ring-
|
|
109
|
+
background-color: var(--ring-disabled-background-color);
|
|
110
|
+
|
|
111
|
+
-webkit-text-fill-color: var(--ring-disabled-color); /* Required for Safari, see RG-2063 for details */
|
|
81
112
|
}
|
|
82
113
|
|
|
83
114
|
:global(textarea.ring-input) {
|
|
84
|
-
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
|
|
85
117
|
min-height: calc(8 * unit);
|
|
86
118
|
|
|
87
|
-
resize:
|
|
88
|
-
vertical-align: top;
|
|
119
|
+
resize: none;
|
|
89
120
|
}
|
|
90
121
|
|
|
91
122
|
/* https://stackoverflow.com/questions/7144843/extra-space-under-textarea-differs-along-browsers */
|
|
92
|
-
:global(
|
|
123
|
+
:global(.ring-input::placeholder) {
|
|
93
124
|
color: var(--ring-disabled-color);
|
|
94
125
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
@value unit from "../global/global.css";
|
|
4
4
|
|
|
5
5
|
:root {
|
|
6
|
-
--ring-input-xs:
|
|
7
|
-
--ring-input-s:
|
|
8
|
-
--ring-input-m:
|
|
9
|
-
--ring-input-l:
|
|
6
|
+
--ring-input-xs: calc(unit * 12);
|
|
7
|
+
--ring-input-s: calc(unit * 12);
|
|
8
|
+
--ring-input-m: calc(unit * 30);
|
|
9
|
+
--ring-input-l: calc(unit * 50);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -39,6 +39,16 @@
|
|
|
39
39
|
|
|
40
40
|
/* M */
|
|
41
41
|
|
|
42
|
+
:global(.ring-input-size_m.ring-input-size_m) {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
|
|
45
|
+
width: var(--ring-input-m);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:global(.ring-input-size_m.ring-input-size_m ~ .ring-error-bubble) {
|
|
49
|
+
left: calc(var(--ring-input-m) + 2px);
|
|
50
|
+
}
|
|
51
|
+
|
|
42
52
|
:global(.ring-input-size_md.ring-input-size_md) {
|
|
43
53
|
display: inline-block;
|
|
44
54
|
|
|
@@ -60,3 +70,15 @@
|
|
|
60
70
|
:global(.ring-input-size_l.ring-input-size_l ~ .ring-error-bubble) {
|
|
61
71
|
left: calc(var(--ring-input-l) + 2px);
|
|
62
72
|
}
|
|
73
|
+
|
|
74
|
+
:global(.ring-input-height_s.ring-input-height_s) {
|
|
75
|
+
--ring-input-padding-block: 1px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:global(.ring-input-height_m.ring-input-height_m) {
|
|
79
|
+
--ring-input-padding-block: 3px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:global(.ring-input-height_l.ring-input-height_l) {
|
|
83
|
+
--ring-input-padding-block: 5px;
|
|
84
|
+
}
|
|
@@ -46,7 +46,7 @@ export const basic = () => {
|
|
|
46
46
|
</div>
|
|
47
47
|
<div class="ring-error-bubble-wrapper">
|
|
48
48
|
<rg-query-assist
|
|
49
|
-
class="ring-input-
|
|
49
|
+
class="ring-input-size_m"
|
|
50
50
|
x-data-source="exampleCtrl.dataSource"
|
|
51
51
|
glass="true"
|
|
52
52
|
placeholder="'Medium'">
|
|
@@ -89,7 +89,7 @@ export const basic = () => {
|
|
|
89
89
|
<div class="ring-error-bubble active">Short Select</div>
|
|
90
90
|
</div>
|
|
91
91
|
<div class="ring-error-bubble-wrapper">
|
|
92
|
-
<rg-select class="ring-input-
|
|
92
|
+
<rg-select class="ring-input-size_m"
|
|
93
93
|
ng-model="exampleCtrl.selected"
|
|
94
94
|
options="item in exampleCtrl.options"
|
|
95
95
|
label="Select item"></rg-select>
|
|
@@ -129,7 +129,7 @@ export const basic = () => {
|
|
|
129
129
|
<div class="ring-error-bubble active">Short Select</div>
|
|
130
130
|
</div>
|
|
131
131
|
<div class="ring-error-bubble-wrapper">
|
|
132
|
-
<rg-select class="ring-input-
|
|
132
|
+
<rg-select class="ring-input-size_m"
|
|
133
133
|
type="input"
|
|
134
134
|
ng-model="exampleCtrl.selected"
|
|
135
135
|
options="item in exampleCtrl.options"
|
|
@@ -164,7 +164,7 @@ export const basic = () => {
|
|
|
164
164
|
<label for="short-input" class="ring-error-bubble active">Short Input</label>
|
|
165
165
|
</div>
|
|
166
166
|
<div class="ring-error-bubble-wrapper">
|
|
167
|
-
<input id="medium-input" type="number" class="ring-input ring-input-
|
|
167
|
+
<input id="medium-input" type="number" class="ring-input ring-input-size_m">
|
|
168
168
|
<label for="medium-input" class="ring-error-bubble active">Medium Input</label>
|
|
169
169
|
</div>
|
|
170
170
|
<div class="ring-error-bubble-wrapper">
|
|
@@ -188,7 +188,7 @@ export const basic = () => {
|
|
|
188
188
|
<label for="short-textarea" class="ring-error-bubble active">Short Textarea</label>
|
|
189
189
|
</div>
|
|
190
190
|
<div class="ring-error-bubble-wrapper">
|
|
191
|
-
<textarea id="medium-textarea" class="ring-input ring-input-
|
|
191
|
+
<textarea id="medium-textarea" class="ring-input ring-input-size_m"></textarea>
|
|
192
192
|
<label for="medium-textarea" class="ring-error-bubble active">Medium Textarea</label>
|
|
193
193
|
</div>
|
|
194
194
|
<div class="ring-error-bubble-wrapper">
|
|
@@ -87,7 +87,7 @@ export const basic = ({onSave}) => {
|
|
|
87
87
|
on-save="save()">
|
|
88
88
|
<input type="text"
|
|
89
89
|
id="input"
|
|
90
|
-
class="ring-input ring-input-
|
|
90
|
+
class="ring-input ring-input-size_m"
|
|
91
91
|
ng-required="true"
|
|
92
92
|
ng-pattern="/^[a-zA-Z][a-zA-Z0-9-_\\.]*[@][a-zA-Z0-9-_\\.]+$/"
|
|
93
93
|
ng-model="data.email">
|
|
@@ -106,7 +106,7 @@ export const basic = ({onSave}) => {
|
|
|
106
106
|
on-save="save()">
|
|
107
107
|
<input type="text"
|
|
108
108
|
id="email"
|
|
109
|
-
class="ring-input ring-input-
|
|
109
|
+
class="ring-input ring-input-size_m"
|
|
110
110
|
ng-required="true"
|
|
111
111
|
ng-pattern="/^[a-zA-Z][a-zA-Z0-9-_\\.]*[@][a-zA-Z0-9-_\\.]+$/"
|
|
112
112
|
ng-model="data.emailWorkingValue">
|
|
@@ -144,7 +144,7 @@ export const basic = ({onSave}) => {
|
|
|
144
144
|
<textarea type="text"
|
|
145
145
|
id="list-mode"
|
|
146
146
|
name="myMultilineArea"
|
|
147
|
-
class="ring-input ring-input-
|
|
147
|
+
class="ring-input ring-input-size_m"
|
|
148
148
|
ng-model="data.longTextList"></textarea>
|
|
149
149
|
</rg-save-field>
|
|
150
150
|
<div class="ring-form__control__description">data.longTextList =
|
|
@@ -180,7 +180,7 @@ export const basic = ({onSave}) => {
|
|
|
180
180
|
on-save="invalidSave(value)">
|
|
181
181
|
<input type="text"
|
|
182
182
|
id="rejected"
|
|
183
|
-
class="ring-input ring-input-
|
|
183
|
+
class="ring-input ring-input-size_m"
|
|
184
184
|
ng-model="data.someText">
|
|
185
185
|
</rg-save-field>
|
|
186
186
|
</div>
|
|
@@ -9,6 +9,7 @@ export interface RowProps<T extends SelectionItem> extends Omit<HTMLAttributes<H
|
|
|
9
9
|
showFocus: boolean;
|
|
10
10
|
draggable: boolean;
|
|
11
11
|
alwaysShowDragHandle: boolean;
|
|
12
|
+
dragHandleTitle?: string;
|
|
12
13
|
selected: boolean;
|
|
13
14
|
onHover: (item: T, e: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
14
15
|
onSelect: (item: T, selected: boolean) => void;
|
package/components/table/row.js
CHANGED
|
@@ -12,14 +12,15 @@ import getUID from '../global/get-uid';
|
|
|
12
12
|
import composeRefs from '../global/composeRefs';
|
|
13
13
|
import Cell from './cell';
|
|
14
14
|
import style from './table.css';
|
|
15
|
-
const DragHandle = ({ alwaysShowDragHandle }) => {
|
|
15
|
+
const DragHandle = ({ alwaysShowDragHandle, dragHandleTitle = 'Drag to reorder' }) => {
|
|
16
16
|
const classes = classNames(style.dragHandle, {
|
|
17
17
|
[style.visibleDragHandle]: alwaysShowDragHandle
|
|
18
18
|
});
|
|
19
|
-
return (<Button data-movable-handle title=
|
|
19
|
+
return (<Button data-movable-handle title={dragHandleTitle} className={classes} icon={dragIcon}/>);
|
|
20
20
|
};
|
|
21
21
|
DragHandle.propTypes = {
|
|
22
|
-
alwaysShowDragHandle: PropTypes.bool
|
|
22
|
+
alwaysShowDragHandle: PropTypes.bool,
|
|
23
|
+
dragHandleTitle: PropTypes.string
|
|
23
24
|
};
|
|
24
25
|
export default class Row extends PureComponent {
|
|
25
26
|
static defaultProps = {
|
|
@@ -72,7 +73,7 @@ export default class Row extends PureComponent {
|
|
|
72
73
|
this.row = el;
|
|
73
74
|
};
|
|
74
75
|
render() {
|
|
75
|
-
const { item, columns, selectable, selected, showFocus, draggable, alwaysShowDragHandle, level, collapsible, parentCollapsible, collapsed, onCollapse, onExpand, showDisabledSelection, onSelect, checkboxTooltip, innerRef, focused, autofocus, onFocusReset, onFocusRestore, onHover, className, 'data-test': dataTest, ...restProps } = this.props;
|
|
76
|
+
const { item, columns, selectable, selected, showFocus, draggable, alwaysShowDragHandle, dragHandleTitle, level, collapsible, parentCollapsible, collapsed, onCollapse, onExpand, showDisabledSelection, onSelect, checkboxTooltip, innerRef, focused, autofocus, onFocusReset, onFocusRestore, onHover, className, 'data-test': dataTest, ...restProps } = this.props;
|
|
76
77
|
const classes = classNames(className, {
|
|
77
78
|
[style.row]: true,
|
|
78
79
|
[style.rowFocused]: showFocus,
|
|
@@ -90,8 +91,7 @@ export default class Row extends PureComponent {
|
|
|
90
91
|
paddingLeft: `${gap}px`
|
|
91
92
|
};
|
|
92
93
|
const metaColumn = (<div className={metaColumnClasses} style={metaColumnStyle}>
|
|
93
|
-
{draggable &&
|
|
94
|
-
<DragHandle alwaysShowDragHandle={alwaysShowDragHandle}/>}
|
|
94
|
+
{draggable && (<DragHandle alwaysShowDragHandle={alwaysShowDragHandle} dragHandleTitle={dragHandleTitle}/>)}
|
|
95
95
|
|
|
96
96
|
{selectable &&
|
|
97
97
|
(<Tooltip title={checkboxTooltip}>
|
|
@@ -26,6 +26,7 @@ declare class SmartTable<T extends SelectionItem> extends PureComponent<SmartTab
|
|
|
26
26
|
sortKey?: React.Validator<string | null | undefined> | undefined;
|
|
27
27
|
sortOrder?: React.Validator<boolean | null | undefined> | undefined;
|
|
28
28
|
alwaysShowDragHandle?: React.Validator<boolean | null | undefined> | undefined;
|
|
29
|
+
dragHandleTitle?: React.Validator<string | null | undefined> | undefined;
|
|
29
30
|
onReorder?: React.Validator<((params: import("./table").ReorderParams<SelectionItem>) => void) | null | undefined> | undefined;
|
|
30
31
|
getItemKey?: React.Validator<((item: SelectionItem) => string | number) | null | undefined> | undefined;
|
|
31
32
|
stickyHeader?: React.Validator<boolean | null | undefined> | undefined;
|
|
@@ -25,6 +25,7 @@ export interface TableProps<T extends SelectionItem> extends FocusSensorAddProps
|
|
|
25
25
|
sortOrder: boolean;
|
|
26
26
|
draggable: boolean;
|
|
27
27
|
alwaysShowDragHandle: boolean;
|
|
28
|
+
dragHandleTitle?: string;
|
|
28
29
|
stickyHeader: boolean;
|
|
29
30
|
getItemLevel: (item: T) => number;
|
|
30
31
|
getItemClassName: (item: T) => string | null | undefined;
|
|
@@ -106,7 +106,7 @@ export class Table extends PureComponent {
|
|
|
106
106
|
window.scrollTo(scrollX, scrollY);
|
|
107
107
|
};
|
|
108
108
|
render() {
|
|
109
|
-
const { data, selection, columns, caption, getItemKey, selectable, focused, isItemSelectable, getItemLevel, getItemClassName, getItemDataTest, draggable, alwaysShowDragHandle, loading, onSort, sortKey, sortOrder, loaderClassName, stickyHeader, stickyHeaderOffset, isItemCollapsible, isParentCollapsible, isItemCollapsed, onItemCollapse, onItemExpand, isDisabledSelectionVisible, getCheckboxTooltip, onItemDoubleClick, onItemClick, renderEmpty } = this.props;
|
|
109
|
+
const { data, selection, columns, caption, getItemKey, selectable, focused, isItemSelectable, getItemLevel, getItemClassName, getItemDataTest, draggable, alwaysShowDragHandle, dragHandleTitle, loading, onSort, sortKey, sortOrder, loaderClassName, stickyHeader, stickyHeaderOffset, isItemCollapsible, isParentCollapsible, isItemCollapsed, onItemCollapse, onItemExpand, isDisabledSelectionVisible, getCheckboxTooltip, onItemDoubleClick, onItemClick, renderEmpty } = this.props;
|
|
110
110
|
// NOTE: Do not construct new object per render because it causes all rows rerendering
|
|
111
111
|
const headerProps = {
|
|
112
112
|
caption, selectable, draggable,
|
|
@@ -150,7 +150,7 @@ export class Table extends PureComponent {
|
|
|
150
150
|
return null;
|
|
151
151
|
}
|
|
152
152
|
const { ref, ...restProps } = props;
|
|
153
|
-
const row = (<Row innerRef={ref} key={getItemKey(value)} level={getItemLevel(value)} item={value} showFocus={selection.isFocused(value)} autofocus={selection.isFocused(value)} focused={selection.isFocused(value)} selectable={selectable && isItemSelectable(value)} selected={selectable && selection.isSelected(value)} onFocus={this.onRowFocus} onSelect={this.onRowSelect} onDoubleClick={onItemDoubleClick} onClick={onItemClick} collapsible={isItemCollapsible(value)} parentCollapsible={isParentCollapsible(value)} collapsed={isItemCollapsed(value)} onCollapse={onItemCollapse} onExpand={onItemExpand} showDisabledSelection={isDisabledSelectionVisible(value)} checkboxTooltip={getCheckboxTooltip(value)} className={classNames(getItemClassName(value), { [style.draggingRow]: isDragged })} draggable={draggable} alwaysShowDragHandle={alwaysShowDragHandle} columns={columns} data-test={getItemDataTest(value)} {...restProps}/>);
|
|
153
|
+
const row = (<Row innerRef={ref} key={getItemKey(value)} level={getItemLevel(value)} item={value} showFocus={selection.isFocused(value)} autofocus={selection.isFocused(value)} focused={selection.isFocused(value)} selectable={selectable && isItemSelectable(value)} selected={selectable && selection.isSelected(value)} onFocus={this.onRowFocus} onSelect={this.onRowSelect} onDoubleClick={onItemDoubleClick} onClick={onItemClick} collapsible={isItemCollapsible(value)} parentCollapsible={isParentCollapsible(value)} collapsed={isItemCollapsed(value)} onCollapse={onItemCollapse} onExpand={onItemExpand} showDisabledSelection={isDisabledSelectionVisible(value)} checkboxTooltip={getCheckboxTooltip(value)} className={classNames(getItemClassName(value), { [style.draggingRow]: isDragged })} draggable={draggable} alwaysShowDragHandle={alwaysShowDragHandle} dragHandleTitle={dragHandleTitle} columns={columns} data-test={getItemDataTest(value)} {...restProps}/>);
|
|
154
154
|
return isDragged
|
|
155
155
|
? (<table style={{ ...props.style, borderSpacing: 0 }}>
|
|
156
156
|
<tbody>{row}</tbody>
|
package/dist/dialog/dialog.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface DialogProps extends Partial<TabTrapProps> {
|
|
|
10
10
|
onCloseAttempt: (event: React.MouseEvent<HTMLElement> | KeyboardEvent) => void;
|
|
11
11
|
showCloseButton: boolean;
|
|
12
12
|
closeButtonInside: boolean;
|
|
13
|
+
closeButtonTitle?: string;
|
|
13
14
|
trapFocus: boolean;
|
|
14
15
|
contentClassName?: string | null | undefined;
|
|
15
16
|
portalTarget?: Element | null | undefined;
|
|
@@ -28,6 +29,7 @@ export default class Dialog extends PureComponent<DialogProps> {
|
|
|
28
29
|
show: PropTypes.Validator<boolean>;
|
|
29
30
|
showCloseButton: PropTypes.Requireable<boolean>;
|
|
30
31
|
closeButtonInside: PropTypes.Requireable<boolean>;
|
|
32
|
+
closeButtonTitle: PropTypes.Requireable<string>;
|
|
31
33
|
onOverlayClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
34
|
onEscPress: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
35
|
onCloseClick: PropTypes.Requireable<(...args: any[]) => any>;
|
package/dist/dialog/dialog.js
CHANGED
|
@@ -125,6 +125,7 @@ class Dialog extends PureComponent {
|
|
|
125
125
|
closeButtonInside,
|
|
126
126
|
portalTarget,
|
|
127
127
|
label,
|
|
128
|
+
closeButtonTitle,
|
|
128
129
|
...restProps
|
|
129
130
|
} = this.props;
|
|
130
131
|
const classes = classNames(modules_5e9b8c03.container, className);
|
|
@@ -162,7 +163,8 @@ class Dialog extends PureComponent {
|
|
|
162
163
|
}),
|
|
163
164
|
iconClassName: modules_5e9b8c03.closeIcon,
|
|
164
165
|
onClick: this.onCloseClick,
|
|
165
|
-
|
|
166
|
+
title: closeButtonTitle,
|
|
167
|
+
"aria-label": closeButtonTitle || 'close dialog'
|
|
166
168
|
}))), target)), portalTarget instanceof HTMLElement ? portalTarget : document.body);
|
|
167
169
|
}
|
|
168
170
|
|
|
@@ -176,6 +178,7 @@ _defineProperty(Dialog, "propTypes", {
|
|
|
176
178
|
show: PropTypes.bool.isRequired,
|
|
177
179
|
showCloseButton: PropTypes.bool,
|
|
178
180
|
closeButtonInside: PropTypes.bool,
|
|
181
|
+
closeButtonTitle: PropTypes.string,
|
|
179
182
|
onOverlayClick: PropTypes.func,
|
|
180
183
|
onEscPress: PropTypes.func,
|
|
181
184
|
onCloseClick: PropTypes.func,
|
package/dist/popup/position.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getRect, isMounted, getDocumentScrollTop, getDocumentScrollLeft, getWindowHeight } from '../global/dom.js';
|
|
2
|
-
import {
|
|
2
|
+
import { MaxHeight, Dimension, MinWidth, Directions } from './popup.consts.js';
|
|
3
3
|
export { Dimension, Directions, MaxHeight, MinWidth } from './popup.consts.js';
|
|
4
4
|
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
5
5
|
import 'core-js/modules/web.dom-collections.iterator.js';
|