@jetbrains/ring-ui 5.0.0-beta.3 → 5.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -1
- package/babel.config.js +1 -12
- package/components/alert/alert.css +3 -14
- package/components/alert/alert.d.ts +3 -0
- package/components/alert/alert.js +8 -7
- package/components/alert/container.css +0 -2
- package/components/alert-service/alert-service.examples.css +5 -3
- package/components/auth/auth__core.d.ts +3 -1
- package/components/auth/auth__core.js +42 -15
- package/components/auth/down-notification.css +1 -1
- package/components/auth-dialog/auth-dialog.d.ts +11 -0
- package/components/auth-dialog/auth-dialog.js +33 -2
- package/components/autofocus-ng/autofocus-ng.js +1 -1
- package/components/autofocus-ng/autofocus-ng.test.js +1 -1
- package/components/button/button.css +93 -204
- package/components/button/button.d.ts +7 -8
- package/components/button/button.js +6 -8
- package/components/button/button__classes.d.ts +1 -1
- package/components/button/button__classes.js +4 -7
- package/components/button-group/button-group.css +136 -19
- package/components/button-group/button-group.d.ts +4 -1
- package/components/button-group/button-group.js +3 -3
- package/components/button-group-ng/button-group-ng.css +1 -0
- package/components/button-group-ng/button-group-ng.examples.js +1 -1
- package/components/button-ng/button-ng.examples.js +6 -7
- package/components/button-ng/button-ng.js +6 -25
- package/components/button-set/button-set.css +1 -0
- package/components/button-toolbar/button-toolbar.css +2 -0
- package/components/checkbox/checkbox.css +10 -4
- package/components/date-picker/date-input.js +2 -1
- package/components/date-picker/date-picker.css +2 -1
- package/components/dialog/dialog.css +10 -3
- package/components/dialog-ng/dialog-ng__template.js +1 -0
- package/components/error-bubble/error-bubble-legacy.css +1 -1
- package/components/error-bubble/error-bubble.css +1 -1
- package/components/global/controls-height.d.ts +7 -0
- package/components/global/controls-height.js +8 -0
- package/components/global/theme.d.ts +7 -20
- package/components/global/theme.js +26 -32
- package/components/global/variables.css +30 -25
- package/components/global/variables.d.ts +10 -8
- package/components/global/variables_dark.css +68 -0
- package/components/header/header.css +19 -10
- package/components/header/header.d.ts +7 -69
- package/components/header/header.js +10 -9
- package/components/header/services.css +3 -3
- package/components/header/services.d.ts +5 -0
- package/components/header/services.js +8 -2
- package/components/header/tray-icon.d.ts +18 -575
- package/components/heading/heading.css +4 -1
- package/components/icon/icon.css +1 -1
- package/components/input/input.css +81 -151
- package/components/input/input.d.ts +13 -17
- package/components/input/input.js +28 -32
- package/components/input-ng/input-ng.examples.js +1 -1
- package/components/input-ng/input-ng.js +45 -49
- package/components/island/adaptive-island-hoc.d.ts +2 -2
- package/components/island/adaptive-island-hoc.js +2 -2
- package/components/island/content.js +2 -7
- package/components/island/header.js +7 -4
- package/components/island/island.css +8 -5
- package/components/island/island.d.ts +2 -2
- package/components/island-legacy/island-legacy.css +1 -1
- package/components/list/list.d.ts +1 -1
- package/components/loader-inline/loader-inline.css +14 -0
- package/components/loader-inline/loader-inline.d.ts +4 -41
- package/components/loader-inline/loader-inline.js +3 -11
- package/components/loader-inline-ng/loader-inline-ng.js +1 -17
- package/components/loader-inline-ng/loader-inline-ng.test.js +0 -11
- package/components/markdown/code.d.ts +6 -13
- package/components/markdown/code.js +2 -2
- package/components/markdown/heading.d.ts +5 -9
- package/components/markdown/heading.js +2 -2
- package/components/markdown/link.d.ts +4 -8
- package/components/markdown/link.js +1 -1
- package/components/markdown/markdown.d.ts +2 -3
- package/components/markdown/markdown.js +14 -11
- package/components/message/message.css +7 -3
- package/components/message/message.d.ts +3 -0
- package/components/message/message.js +16 -9
- package/components/pager/pager.js +2 -8
- package/components/popup/popup.css +1 -1
- package/components/popup/popup.target.d.ts +1 -0
- package/components/progress-bar/progress-bar.css +8 -12
- package/components/progress-bar/progress-bar.d.ts +0 -4
- package/components/progress-bar/progress-bar.js +1 -6
- package/components/progress-bar-ng/progress-bar-ng.examples.js +3 -2
- package/components/query-assist/query-assist.css +48 -64
- package/components/query-assist/query-assist.d.ts +0 -5
- package/components/query-assist/query-assist.js +4 -10
- package/components/radio/radio.css +10 -4
- package/components/select/select.css +19 -37
- package/components/select/select.d.ts +4 -6
- package/components/select/select.js +17 -30
- package/components/select/select__filter.js +2 -1
- package/components/select/select__popup.js +1 -2
- package/components/select-ng/select-ng.examples.js +1 -0
- package/components/select-ng/select-ng.js +3 -1
- package/components/select-ng/select-ng.test.js +1 -1
- package/components/select-ng/select-ng__lazy.js +1 -2
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.css +1 -1
- package/components/shortcuts-hint-ng/shortcuts-hint-ng.examples.js +1 -1
- package/components/tabs/collapsible-tab.js +2 -2
- package/components/tabs/dumb-tabs.d.ts +4 -107
- package/components/tabs/dumb-tabs.js +5 -9
- package/components/tabs/tab.d.ts +2 -0
- package/components/tabs/tabs.css +8 -28
- package/components/tabs-ng/tabs-ng.examples.js +11 -3
- package/components/tabs-ng/tabs-ng.js +1 -4
- package/components/tabs-ng/tabs-ng__template.js +1 -1
- package/components/tag/tag.css +31 -8
- package/components/tag/tag.d.ts +1 -0
- package/components/tag/tag.js +1 -0
- package/components/tags-input/tags-input.css +10 -4
- package/components/toggle/toggle.css +61 -35
- package/components/toggle/toggle.d.ts +9 -89
- package/components/toggle/toggle.js +7 -7
- package/components/tooltip/tooltip.css +7 -0
- package/components/tooltip/tooltip.d.ts +1 -0
- package/components/tooltip/tooltip.js +3 -2
- package/components/user-agreement/service.d.ts +2 -2
- package/components/user-agreement/user-agreement.js +1 -1
- package/dist/_helpers/anchor.js +3 -3
- package/dist/_helpers/badge.js +1 -1
- package/dist/_helpers/button-group.js +1 -1
- package/dist/_helpers/button-set.js +1 -1
- package/dist/_helpers/button-toolbar.js +1 -1
- package/dist/_helpers/button__classes.js +5 -8
- package/dist/_helpers/card.js +1 -1
- package/dist/_helpers/checkbox.js +1 -1
- package/dist/_helpers/date-picker.js +1 -1
- package/dist/_helpers/dialog__body-scroll-preventer.js +1 -1
- package/dist/_helpers/error-message.js +1 -1
- package/dist/_helpers/footer.js +1 -1
- package/dist/_helpers/grid.js +1 -1
- package/dist/_helpers/group.js +1 -1
- package/dist/_helpers/header.js +1 -1
- package/dist/_helpers/icon.js +1 -1
- package/dist/_helpers/input.js +1 -1
- package/dist/_helpers/island.js +1 -1
- package/dist/_helpers/link.js +1 -1
- package/dist/_helpers/list.js +1 -1
- package/dist/_helpers/loader-inline.js +3 -0
- package/dist/_helpers/loader-screen.js +1 -1
- package/dist/_helpers/panel.js +1 -1
- package/dist/_helpers/query-assist__suggestions.js +1 -1
- package/dist/_helpers/radio.js +1 -1
- package/dist/_helpers/select__filter.js +5 -3
- package/dist/_helpers/services-link.js +1 -1
- package/dist/_helpers/sidebar.js +1 -1
- package/dist/_helpers/table.js +1 -1
- package/dist/_helpers/tabs.js +1 -1
- package/dist/_helpers/theme.js +50 -0
- package/dist/_helpers/title.js +1 -1
- package/dist/alert/alert.d.ts +3 -0
- package/dist/alert/alert.js +21 -19
- package/dist/alert/container.js +1 -1
- package/dist/alert-service/alert-service.js +9 -7
- package/dist/auth/auth.js +9 -9
- package/dist/auth/auth__core.d.ts +3 -1
- package/dist/auth/auth__core.js +58 -26
- package/dist/auth/down-notification.js +8 -8
- package/dist/auth/iframe-flow.js +1 -1
- package/dist/auth/landing.js +9 -9
- package/dist/auth/storage.js +9 -7
- package/dist/auth-dialog/auth-dialog.d.ts +11 -0
- package/dist/auth-dialog/auth-dialog.js +52 -7
- package/dist/auth-dialog-service/auth-dialog-service.js +1 -1
- package/dist/auth-ng/auth-ng.js +9 -9
- package/dist/autofocus-ng/autofocus-ng.js +1 -1
- package/dist/avatar/avatar.js +1 -1
- package/dist/avatar-editor-ng/avatar-editor-ng.js +9 -7
- package/dist/breadcrumb-ng/breadcrumb-ng.js +1 -1
- package/dist/button/button.d.ts +7 -8
- package/dist/button/button.js +6 -8
- package/dist/button/button__classes.d.ts +1 -1
- package/dist/button/button__classes.js +0 -3
- package/dist/button-group/button-group.d.ts +4 -1
- package/dist/button-group/button-group.js +5 -3
- package/dist/button-group-ng/button-group-ng.js +1 -1
- package/dist/button-ng/button-ng.js +6 -31
- package/dist/code/code.js +1 -1
- package/dist/confirm/confirm.js +5 -5
- package/dist/confirm-ng/confirm-ng.js +1 -1
- package/dist/confirm-service/confirm-service.js +1 -1
- package/dist/data-list/data-list.js +2 -7
- package/dist/data-list/item.js +8 -13
- package/dist/data-list-ng/data-list-ng.js +2 -7
- package/dist/date-picker/date-input.js +4 -3
- package/dist/date-picker/date-picker.js +1 -1
- package/dist/date-picker/date-popup.js +1 -1
- package/dist/dialog/dialog.js +3 -3
- package/dist/dialog-ng/dialog-ng.js +3 -3
- package/dist/dialog-ng/dialog-ng__template.js +1 -0
- package/dist/docked-panel-ng/docked-panel-ng.js +1 -1
- package/dist/dropdown/anchor.js +1 -1
- package/dist/dropdown/dropdown.js +1 -1
- package/dist/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/error-bubble/error-bubble.js +1 -1
- package/dist/global/controls-height.d.ts +7 -0
- package/dist/global/controls-height.js +13 -0
- package/dist/global/theme.d.ts +7 -20
- package/dist/global/theme.js +7 -62
- package/dist/global/variables.d.ts +10 -8
- package/dist/header/header.d.ts +7 -69
- package/dist/header/header.js +13 -17
- package/dist/header/profile.js +3 -3
- package/dist/header/services.d.ts +5 -0
- package/dist/header/services.js +11 -3
- package/dist/header/smart-profile.js +10 -14
- package/dist/header/smart-services.js +9 -13
- package/dist/header/tray-icon.d.ts +18 -575
- package/dist/header/tray-icon.js +4 -4
- package/dist/heading/heading.js +1 -1
- package/dist/input/input.d.ts +13 -17
- package/dist/input/input.js +32 -41
- package/dist/input-ng/input-ng.js +46 -49
- package/dist/island/adaptive-island-hoc.d.ts +2 -2
- package/dist/island/adaptive-island-hoc.js +4 -2
- package/dist/island/content.js +2 -9
- package/dist/island/header.js +7 -4
- package/dist/island/island.d.ts +2 -2
- package/dist/list/list.d.ts +1 -1
- package/dist/loader/loader__core.js +1 -1
- package/dist/loader-inline/loader-inline.d.ts +4 -41
- package/dist/loader-inline/loader-inline.js +3 -21
- package/dist/loader-inline-ng/loader-inline-ng.js +2 -30
- package/dist/login-dialog/login-dialog.js +2 -2
- package/dist/login-dialog/service.js +1 -1
- package/dist/markdown/code.d.ts +6 -13
- package/dist/markdown/code.js +3 -3
- package/dist/markdown/heading.d.ts +5 -9
- package/dist/markdown/heading.js +2 -2
- package/dist/markdown/link.d.ts +4 -8
- package/dist/markdown/link.js +1 -1
- package/dist/markdown/markdown.d.ts +2 -3
- package/dist/markdown/markdown.js +16 -16
- package/dist/message/message.d.ts +3 -0
- package/dist/message/message.js +18 -10
- package/dist/pager/pager.js +8 -12
- package/dist/pager-ng/pager-ng.js +3 -7
- package/dist/permissions-ng/permissions-ng.js +9 -9
- package/dist/popup/popup.js +1 -1
- package/dist/popup/popup.target.d.ts +1 -0
- package/dist/progress-bar/progress-bar.d.ts +0 -4
- package/dist/progress-bar/progress-bar.js +1 -7
- package/dist/progress-bar-ng/progress-bar-ng.js +0 -1
- package/dist/promised-click-ng/promised-click-ng.js +2 -2
- package/dist/query-assist/query-assist.d.ts +0 -5
- package/dist/query-assist/query-assist.js +10 -26
- package/dist/query-assist-ng/query-assist-ng.js +2 -7
- package/dist/save-field-ng/save-field-ng.js +2 -9
- package/dist/select/select.d.ts +4 -6
- package/dist/select/select.js +35 -58
- package/dist/select/select__filter.js +1 -1
- package/dist/select/select__popup.js +7 -13
- package/dist/select-ng/select-ng.js +5 -9
- package/dist/select-ng/select-ng__lazy.js +7 -11
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +2 -2
- package/dist/sidebar-ng/sidebar-ng.js +2 -2
- package/dist/storage/storage.js +9 -7
- package/dist/storage/storage__local.js +9 -7
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +1 -1
- package/dist/table/row-with-focus-sensor.js +1 -1
- package/dist/table/row.js +5 -5
- package/dist/table/smart-table.js +1 -1
- package/dist/table/table.js +1 -1
- package/dist/table-legacy-ng/table-legacy-ng.js +3 -7
- package/dist/table-legacy-ng/table-legacy-ng__pager.js +3 -7
- package/dist/table-ng/smart-table-ng.js +1 -1
- package/dist/table-ng/table-ng.js +1 -1
- package/dist/tabs/collapsible-more.js +1 -1
- package/dist/tabs/collapsible-tab.js +3 -2
- package/dist/tabs/collapsible-tabs.js +1 -1
- package/dist/tabs/dumb-tabs.d.ts +4 -107
- package/dist/tabs/dumb-tabs.js +6 -12
- package/dist/tabs/smart-tabs.js +3 -3
- package/dist/tabs/tab.d.ts +2 -0
- package/dist/tabs/tabs.js +1 -1
- package/dist/tabs-ng/tabs-ng.js +1 -6
- package/dist/tabs-ng/tabs-ng__template.js +1 -1
- package/dist/tag/tag.d.ts +1 -0
- package/dist/tag/tag.js +5 -4
- package/dist/tags-input/tags-input.js +5 -9
- package/dist/tags-input-ng/tags-input-ng.js +4 -8
- package/dist/tags-list/tags-list.js +1 -1
- package/dist/text/text.js +1 -1
- package/dist/toggle/toggle.d.ts +9 -89
- package/dist/toggle/toggle.js +7 -8
- package/dist/toggle-ng/toggle-ng.js +2 -3
- package/dist/tooltip/tooltip.d.ts +1 -0
- package/dist/tooltip/tooltip.js +6 -3
- package/dist/user-agreement/service.d.ts +2 -2
- package/dist/user-agreement/service.js +9 -13
- package/dist/user-agreement/user-agreement.js +8 -10
- package/dist/user-card/smart-user-card-tooltip.js +6 -11
- package/dist/user-card/tooltip.js +1 -1
- package/dist/user-card/user-card.js +2 -7
- package/dist/user-card-ng/user-card-ng.js +4 -9
- package/package.json +5 -5
- package/webpack.config.js +0 -11
- package/components/global/conic-gradient.d.ts +0 -796
- package/components/global/conic-gradient.js +0 -21
- package/components/global/radial-gradient-mask.d.ts +0 -9
- package/components/global/radial-gradient-mask.js +0 -39
- package/components/global/supports-css.d.ts +0 -2
- package/components/global/supports-css.js +0 -14
- package/components/global/variables_dark.d.ts +0 -3
- package/components/global/variables_dark.js +0 -53
- package/components/loader-inline/inject-styles.d.ts +0 -2
- package/components/loader-inline/inject-styles.js +0 -17
- package/dist/_helpers/inject-styles.js +0 -22
- package/dist/global/conic-gradient.d.ts +0 -796
- package/dist/global/conic-gradient.js +0 -35
- package/dist/global/radial-gradient-mask.d.ts +0 -9
- package/dist/global/radial-gradient-mask.js +0 -49
- package/dist/global/supports-css.d.ts +0 -2
- package/dist/global/supports-css.js +0 -20
- package/dist/global/variables_dark.d.ts +0 -3
- package/dist/global/variables_dark.js +0 -57
- package/dist/loader-inline/inject-styles.d.ts +0 -2
- package/dist/loader-inline/inject-styles.js +0 -11
|
@@ -74,11 +74,12 @@
|
|
|
74
74
|
opacity: 0;
|
|
75
75
|
|
|
76
76
|
&[disabled] + .circle {
|
|
77
|
-
border-color: var(--ring-
|
|
77
|
+
border-color: var(--ring-border-unselected-disabled-color);
|
|
78
|
+
background-color: var(--ring-disabled-background-color);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
&:checked + .circle {
|
|
81
|
-
border-color: var(--ring-
|
|
82
|
+
border-color: var(--ring-main-color);
|
|
82
83
|
|
|
83
84
|
/* stylelint-disable-next-line selector-max-specificity */
|
|
84
85
|
&::after {
|
|
@@ -101,8 +102,13 @@
|
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
/* stylelint-disable-next-line selector-max-specificity */
|
|
104
|
-
&[disabled]:checked + .circle
|
|
105
|
-
|
|
105
|
+
&[disabled]:checked + .circle {
|
|
106
|
+
border-color: var(--ring-border-disabled-color);
|
|
107
|
+
|
|
108
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
109
|
+
&::after {
|
|
110
|
+
background-color: var(--ring-border-disabled-color);
|
|
111
|
+
}
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
&[disabled] ~ .label {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@import "../global/variables.css";
|
|
2
2
|
|
|
3
3
|
@value unit from "../global/global.css";
|
|
4
|
+
@value button-shadow from "../button/button.css";
|
|
4
5
|
|
|
5
6
|
.select {
|
|
6
7
|
position: relative;
|
|
@@ -39,8 +40,8 @@
|
|
|
39
40
|
|
|
40
41
|
.icons {
|
|
41
42
|
position: absolute;
|
|
42
|
-
top: -
|
|
43
|
-
right:
|
|
43
|
+
top: -3px;
|
|
44
|
+
right: calc(unit * 1.5);
|
|
44
45
|
|
|
45
46
|
transition: color var(--ring-ease);
|
|
46
47
|
|
|
@@ -55,15 +56,8 @@
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
@nest .inputMode & {
|
|
58
|
-
top: 12px;
|
|
59
|
-
|
|
60
59
|
font-size: var(--ring-font-size);
|
|
61
60
|
}
|
|
62
|
-
|
|
63
|
-
@nest .buttonMode & {
|
|
64
|
-
top: -4px;
|
|
65
|
-
right: unit;
|
|
66
|
-
}
|
|
67
61
|
}
|
|
68
62
|
|
|
69
63
|
.selectedIcon {
|
|
@@ -87,10 +81,6 @@
|
|
|
87
81
|
vertical-align: -1px;
|
|
88
82
|
}
|
|
89
83
|
|
|
90
|
-
.clearIcon.clearIcon > span > span {
|
|
91
|
-
color: var(--ring-icon-secondary-color);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
84
|
.sizeS {
|
|
95
85
|
width: calc(unit * 12);
|
|
96
86
|
}
|
|
@@ -111,8 +101,7 @@
|
|
|
111
101
|
max-width: 100%;
|
|
112
102
|
}
|
|
113
103
|
|
|
114
|
-
.buttonMode
|
|
115
|
-
.materialMode {
|
|
104
|
+
.buttonMode {
|
|
116
105
|
position: relative;
|
|
117
106
|
|
|
118
107
|
cursor: pointer;
|
|
@@ -168,14 +157,18 @@
|
|
|
168
157
|
display: block;
|
|
169
158
|
|
|
170
159
|
width: 100%;
|
|
160
|
+
padding-left: unit;
|
|
171
161
|
|
|
172
162
|
text-align: left;
|
|
173
163
|
vertical-align: calc(0 - unit);
|
|
174
164
|
}
|
|
175
165
|
|
|
176
|
-
.
|
|
177
|
-
|
|
178
|
-
|
|
166
|
+
.buttonValue:global(.focus-visible) {
|
|
167
|
+
box-shadow: button-shadow var(--ring-main-color);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.buttonValueOpen.buttonValueOpen {
|
|
171
|
+
box-shadow: button-shadow var(--ring-main-color);
|
|
179
172
|
}
|
|
180
173
|
|
|
181
174
|
.label {
|
|
@@ -186,6 +179,7 @@
|
|
|
186
179
|
|
|
187
180
|
.select:hover .value,
|
|
188
181
|
.select:hover .icons,
|
|
182
|
+
:global(.focus-visible) + .icons,
|
|
189
183
|
.value:focus,
|
|
190
184
|
.value:focus + .icons,
|
|
191
185
|
.open,
|
|
@@ -207,23 +201,6 @@
|
|
|
207
201
|
}
|
|
208
202
|
}
|
|
209
203
|
|
|
210
|
-
.selectedLabel {
|
|
211
|
-
position: absolute;
|
|
212
|
-
top: calc(unit * -1.5);
|
|
213
|
-
left: 0;
|
|
214
|
-
|
|
215
|
-
overflow: hidden;
|
|
216
|
-
|
|
217
|
-
max-width: 100%;
|
|
218
|
-
|
|
219
|
-
text-overflow: ellipsis;
|
|
220
|
-
|
|
221
|
-
color: var(--ring-secondary-color);
|
|
222
|
-
|
|
223
|
-
font-size: var(--ring-font-size-smaller);
|
|
224
|
-
line-height: var(--ring-line-height-lowest);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
204
|
.avatar {
|
|
228
205
|
margin-right: 4px;
|
|
229
206
|
|
|
@@ -236,9 +213,10 @@
|
|
|
236
213
|
}
|
|
237
214
|
|
|
238
215
|
.chevron.chevron {
|
|
239
|
-
padding: 0;
|
|
216
|
+
padding: 0 3px;
|
|
240
217
|
|
|
241
218
|
transition: none;
|
|
219
|
+
vertical-align: -1px;
|
|
242
220
|
|
|
243
221
|
color: inherit;
|
|
244
222
|
}
|
|
@@ -249,6 +227,10 @@
|
|
|
249
227
|
color: inherit;
|
|
250
228
|
}
|
|
251
229
|
|
|
252
|
-
.avatar {
|
|
230
|
+
.heightS .avatar {
|
|
253
231
|
vertical-align: -6px;
|
|
254
232
|
}
|
|
233
|
+
|
|
234
|
+
.heightS .icons {
|
|
235
|
+
top: -5px;
|
|
236
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { ButtonHTMLAttributes, Component, CSSProperties, HTMLAttributes, ReactNode, RefCallback, SyntheticEvent } from 'react';
|
|
2
2
|
import { SelectHandlerParams } from '../list/list';
|
|
3
3
|
import { Size } from '../input/input';
|
|
4
|
-
import Theme from '../global/theme';
|
|
5
4
|
import { ListDataItem } from '../list/consts';
|
|
6
5
|
import { Directions } from '../popup/popup.consts';
|
|
6
|
+
import { ControlsHeight } from '../global/controls-height';
|
|
7
7
|
import SelectPopup, { Filter, FilterFn, Multiple, Tags } from './select__popup';
|
|
8
8
|
/**
|
|
9
9
|
* @name Select
|
|
@@ -17,7 +17,6 @@ declare enum Type {
|
|
|
17
17
|
INPUT = "INPUT",
|
|
18
18
|
CUSTOM = "CUSTOM",
|
|
19
19
|
INLINE = "INLINE",
|
|
20
|
-
MATERIAL = "MATERIAL",
|
|
21
20
|
INPUT_WITHOUT_CONTROLS = "INPUT_WITHOUT_CONTROLS"
|
|
22
21
|
}
|
|
23
22
|
declare type SelectItemData<T> = T & {
|
|
@@ -78,6 +77,7 @@ export interface BaseSelectProps<T = unknown> {
|
|
|
78
77
|
onDone: () => void;
|
|
79
78
|
onReset: () => void;
|
|
80
79
|
dir: 'ltr' | 'rtl';
|
|
80
|
+
height?: ControlsHeight | undefined;
|
|
81
81
|
targetElement?: HTMLElement | null | undefined;
|
|
82
82
|
className?: string | null | undefined;
|
|
83
83
|
buttonClassName?: string | null | undefined;
|
|
@@ -93,7 +93,6 @@ export interface BaseSelectProps<T = unknown> {
|
|
|
93
93
|
hint?: ReactNode;
|
|
94
94
|
add?: Add | null | undefined;
|
|
95
95
|
compact?: boolean | null | undefined;
|
|
96
|
-
theme?: string | null | undefined;
|
|
97
96
|
customAnchor?: ((props: CustomAnchorProps) => ReactNode) | null | undefined;
|
|
98
97
|
disableMoveOverflow?: boolean | null | undefined;
|
|
99
98
|
disableScrollToActive?: boolean | null | undefined;
|
|
@@ -188,9 +187,9 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
188
187
|
static getDerivedStateFromProps<T = unknown>(nextProps: SelectProps<T>, prevState: SelectState<T>): Partial<SelectState<T>>;
|
|
189
188
|
state: SelectState<T>;
|
|
190
189
|
componentDidUpdate(prevProps: SelectProps<T>, prevState: SelectState<T>): void;
|
|
190
|
+
static contextType: React.Context<ControlsHeight>;
|
|
191
191
|
static Type: typeof Type;
|
|
192
192
|
static Size: typeof Size;
|
|
193
|
-
static Theme: typeof Theme;
|
|
194
193
|
id: string;
|
|
195
194
|
shortcutsScope: string;
|
|
196
195
|
listId: string;
|
|
@@ -221,6 +220,7 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
221
220
|
filterValue(setValue: string): void;
|
|
222
221
|
isInputMode(): boolean;
|
|
223
222
|
_clickHandler: () => void;
|
|
223
|
+
_openPopupIfClosed: () => void;
|
|
224
224
|
_filterChangeHandler: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
225
225
|
private _setFilter;
|
|
226
226
|
private _rebuildMultipleMap;
|
|
@@ -235,8 +235,6 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
235
235
|
_getSelectedString(): string | null;
|
|
236
236
|
private _getIcons;
|
|
237
237
|
private _getAvatar;
|
|
238
|
-
button?: HTMLElement | null;
|
|
239
|
-
buttonRef: (el: HTMLElement | null) => void;
|
|
240
238
|
filter?: HTMLInputElement | null;
|
|
241
239
|
filterRef: (el: HTMLInputElement | null) => void;
|
|
242
240
|
getShortcutsMap(): {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Component, Fragment } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import chevronDownIcon from '@jetbrains/icons/chevron-
|
|
4
|
+
import chevronDownIcon from '@jetbrains/icons/chevron-down';
|
|
5
5
|
import closeIcon from '@jetbrains/icons/close';
|
|
6
6
|
import deepEqual from 'deep-equal';
|
|
7
7
|
import { Anchor } from '../dropdown/dropdown';
|
|
@@ -15,9 +15,9 @@ import dataTests from '../global/data-tests';
|
|
|
15
15
|
import getUID from '../global/get-uid';
|
|
16
16
|
import rerenderHOC from '../global/rerender-hoc';
|
|
17
17
|
import fuzzyHighlight from '../global/fuzzy-highlight';
|
|
18
|
-
import Theme from '../global/theme';
|
|
19
18
|
import memoize from '../global/memoize';
|
|
20
19
|
import { isArray } from '../global/typescript-utils';
|
|
20
|
+
import { ControlsHeightContext } from '../global/controls-height';
|
|
21
21
|
import SelectPopup from './select__popup';
|
|
22
22
|
import styles from './select.css';
|
|
23
23
|
/**
|
|
@@ -33,12 +33,12 @@ var Type;
|
|
|
33
33
|
Type["INPUT"] = "INPUT";
|
|
34
34
|
Type["CUSTOM"] = "CUSTOM";
|
|
35
35
|
Type["INLINE"] = "INLINE";
|
|
36
|
-
Type["MATERIAL"] = "MATERIAL";
|
|
37
36
|
Type["INPUT_WITHOUT_CONTROLS"] = "INPUT_WITHOUT_CONTROLS";
|
|
38
37
|
})(Type || (Type = {}));
|
|
38
|
+
const ICONS_OFFSET = 12;
|
|
39
39
|
const ICON_WIDTH = 20;
|
|
40
40
|
const getStyle = memoize((iconsLength) => ({
|
|
41
|
-
paddingRight: iconsLength * ICON_WIDTH
|
|
41
|
+
paddingRight: ICONS_OFFSET + iconsLength * ICON_WIDTH
|
|
42
42
|
}));
|
|
43
43
|
const isInputMode = (type) => type === Type.INPUT || type === Type.INPUT_WITHOUT_CONTROLS;
|
|
44
44
|
function getLowerCaseLabel(item) {
|
|
@@ -183,7 +183,7 @@ export default class Select extends Component {
|
|
|
183
183
|
disabled: false,
|
|
184
184
|
loadingMessage: 'Loading...',
|
|
185
185
|
notFoundMessage: 'No options found',
|
|
186
|
-
type: Type.
|
|
186
|
+
type: Type.BUTTON,
|
|
187
187
|
size: Size.M,
|
|
188
188
|
targetElement: null,
|
|
189
189
|
hideSelected: false,
|
|
@@ -290,9 +290,9 @@ export default class Select extends Component {
|
|
|
290
290
|
onChange(selected);
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
+
static contextType = ControlsHeightContext;
|
|
293
294
|
static Type = Type;
|
|
294
295
|
static Size = Size;
|
|
295
|
-
static Theme = Theme;
|
|
296
296
|
id = getUID('select-');
|
|
297
297
|
shortcutsScope = this.id;
|
|
298
298
|
listId = `${this.id}:list`;
|
|
@@ -508,6 +508,13 @@ export default class Select extends Component {
|
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
};
|
|
511
|
+
_openPopupIfClosed = () => {
|
|
512
|
+
if (this.props.disabled || this.state.showPopup) {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
this.props.onBeforeOpen();
|
|
516
|
+
this._showPopup();
|
|
517
|
+
};
|
|
511
518
|
_filterChangeHandler = (e) => {
|
|
512
519
|
this._setFilter(e.currentTarget.value, e);
|
|
513
520
|
};
|
|
@@ -738,10 +745,6 @@ export default class Select extends Component {
|
|
|
738
745
|
return !Array.isArray(this.state.selected) &&
|
|
739
746
|
(this.state.selected?.avatar || this.state.selected?.showGeneratedAvatar) && (<Avatar className={styles.avatar} url={this.state.selected.avatar} username={this.state.selected.username} size={AvatarSize.Size20}/>);
|
|
740
747
|
}
|
|
741
|
-
button;
|
|
742
|
-
buttonRef = (el) => {
|
|
743
|
-
this.button = el;
|
|
744
|
-
};
|
|
745
748
|
filter;
|
|
746
749
|
filterRef = (el) => {
|
|
747
750
|
this.filter = el;
|
|
@@ -762,7 +765,7 @@ export default class Select extends Component {
|
|
|
762
765
|
renderSelect(activeItemId) {
|
|
763
766
|
const dataTest = this.props['data-test'];
|
|
764
767
|
const { shortcutsEnabled } = this.state;
|
|
765
|
-
const classes = classNames(styles.select, 'ring-js-shortcuts', this.props.className, {
|
|
768
|
+
const classes = classNames(styles.select, 'ring-js-shortcuts', this.props.className, styles[`height${this.props.height || this.context}`], {
|
|
766
769
|
[styles[`size${this.props.size}`]]: this.props.type !== Type.INLINE,
|
|
767
770
|
[styles.disabled]: this.props.disabled
|
|
768
771
|
});
|
|
@@ -779,20 +782,19 @@ export default class Select extends Component {
|
|
|
779
782
|
case Type.INPUT_WITHOUT_CONTROLS:
|
|
780
783
|
case Type.INPUT: return (<div ref={this.nodeRef} className={classNames(classes, styles.inputMode)} data-test={dataTests('ring-select', dataTest)}>
|
|
781
784
|
{shortcutsEnabled && (<Shortcuts map={this.getShortcutsMap()} scope={this.shortcutsScope}/>)}
|
|
782
|
-
<Input {...ariaProps} autoComplete="off" id={this.props.id} onClick={this._clickHandler} inputRef={this.filterRef} disabled={this.props.disabled} value={this.state.filterValue} borderless={this.props.type === Type.INPUT_WITHOUT_CONTROLS} style={style} size={Size.FULL} onChange={this._filterChangeHandler} onFocus={this._focusHandler} onBlur={this._blurHandler} label={this.props.type === Type.INPUT ? this._getLabel() : null} placeholder={this.props.inputPlaceholder} onKeyDown={this.props.onKeyDown} data-test="ring-select__focus" enableShortcuts={shortcutsEnabled
|
|
785
|
+
<Input {...ariaProps} height={this.props.height} autoComplete="off" id={this.props.id} onClick={this._clickHandler} inputRef={this.filterRef} disabled={this.props.disabled} value={this.state.filterValue} borderless={this.props.type === Type.INPUT_WITHOUT_CONTROLS} style={style} size={Size.FULL} onChange={this._filterChangeHandler} onFocus={this._focusHandler} onBlur={this._blurHandler} label={this.props.type === Type.INPUT ? this._getLabel() : null} placeholder={this.props.inputPlaceholder} onKeyDown={this.props.onKeyDown} data-test="ring-select__focus" enableShortcuts={shortcutsEnabled
|
|
783
786
|
? Object.keys({
|
|
784
787
|
...this.getShortcutsMap(),
|
|
785
788
|
...this._popup?.list?.shortcutsMap
|
|
786
789
|
})
|
|
787
|
-
: undefined}/>
|
|
788
|
-
{this.props.type === Type.INPUT && iconsNode}
|
|
790
|
+
: undefined} afterInput={this.props.type === Type.INPUT && iconsNode}/>
|
|
789
791
|
{this._renderPopup()}
|
|
790
792
|
</div>);
|
|
791
793
|
case Type.BUTTON:
|
|
792
794
|
return (<div ref={this.nodeRef} className={classNames(classes, styles.buttonMode)} data-test={dataTests('ring-select', dataTest)}>
|
|
793
795
|
{shortcutsEnabled && (<Shortcuts map={this.getShortcutsMap()} scope={this.shortcutsScope}/>)}
|
|
794
796
|
<div className={styles.buttonContainer}>
|
|
795
|
-
<Button {...ariaProps} id={this.props.id} onClick={this._clickHandler} className={classNames(this.props.buttonClassName, styles.buttonValue, {
|
|
797
|
+
<Button {...ariaProps} height={this.props.height} id={this.props.id} onClick={this._clickHandler} className={classNames(this.props.buttonClassName, styles.buttonValue, {
|
|
796
798
|
[styles.buttonValueOpen]: this.state.showPopup
|
|
797
799
|
})} disabled={this.props.disabled} style={style} data-test="ring-select__button ring-select__focus">
|
|
798
800
|
{this._getAvatar()}
|
|
@@ -801,20 +803,6 @@ export default class Select extends Component {
|
|
|
801
803
|
{iconsNode}
|
|
802
804
|
</div>
|
|
803
805
|
{this._renderPopup()}
|
|
804
|
-
</div>);
|
|
805
|
-
case Type.MATERIAL:
|
|
806
|
-
return (<div ref={this.nodeRef} className={classNames(classes, styles.materialMode)} data-test={dataTests('ring-select', dataTest)}>
|
|
807
|
-
{shortcutsEnabled && (<Shortcuts map={this.getShortcutsMap()} scope={this.shortcutsScope}/>)}
|
|
808
|
-
{!this._selectionIsEmpty() && this.props.selectedLabel && (<span className={styles.selectedLabel}>{this.props.selectedLabel}</span>)}
|
|
809
|
-
<button {...ariaProps} id={this.props.id} onClick={this._clickHandler} type="button" disabled={this.props.disabled} className={classNames(this.props.buttonClassName, styles.value, {
|
|
810
|
-
[styles.open]: this.state.showPopup,
|
|
811
|
-
[styles.label]: this._selectionIsEmpty()
|
|
812
|
-
})} aria-label={this._getLabel()} style={style} data-test="ring-select__focus" ref={this.buttonRef}>
|
|
813
|
-
{this._getAvatar()}
|
|
814
|
-
{this._selectionIsEmpty() ? this._getLabel() : this._getSelectedString()}
|
|
815
|
-
</button>
|
|
816
|
-
{iconsNode}
|
|
817
|
-
{this._renderPopup()}
|
|
818
806
|
</div>);
|
|
819
807
|
case Type.INLINE:
|
|
820
808
|
return (<div className={classes} ref={this.nodeRef} data-test={dataTests('ring-select', dataTest)}>
|
|
@@ -912,7 +900,6 @@ Select.propTypes = {
|
|
|
912
900
|
hideArrow: PropTypes.bool,
|
|
913
901
|
compact: PropTypes.bool,
|
|
914
902
|
size: PropTypes.oneOf(Object.values(Size)),
|
|
915
|
-
theme: PropTypes.string,
|
|
916
903
|
customAnchor: PropTypes.func,
|
|
917
904
|
disableMoveOverflow: PropTypes.bool,
|
|
918
905
|
disableScrollToActive: PropTypes.bool,
|
|
@@ -4,6 +4,7 @@ import classNames from 'classnames';
|
|
|
4
4
|
import Input from '../input/input';
|
|
5
5
|
import sniffr from '../global/sniffer';
|
|
6
6
|
import { ActiveItemContext } from '../list/list';
|
|
7
|
+
import { ControlsHeight } from '../global/controls-height';
|
|
7
8
|
import styles from './select-popup.css';
|
|
8
9
|
function noop() { }
|
|
9
10
|
export default class SelectFilter extends Component {
|
|
@@ -34,7 +35,7 @@ export default class SelectFilter extends Component {
|
|
|
34
35
|
const { className, listId, ...restProps } = this.props;
|
|
35
36
|
const classes = classNames(styles.filter, className);
|
|
36
37
|
return (<ActiveItemContext.ValueContext.Consumer>
|
|
37
|
-
{activeItemId => (<Input {...restProps} aria-owns={listId} aria-activedescendant={activeItemId} autoComplete="off" autoFocus borderless inputRef={this.inputRef} className={classes}/>)}
|
|
38
|
+
{activeItemId => (<Input {...restProps} aria-owns={listId} aria-activedescendant={activeItemId} autoComplete="off" autoFocus borderless height={ControlsHeight.L} inputRef={this.inputRef} className={classes}/>)}
|
|
38
39
|
</ActiveItemContext.ValueContext.Consumer>);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -24,7 +24,6 @@ import Text from '../text/text';
|
|
|
24
24
|
import { DEFAULT_DIRECTIONS } from '../popup/popup.consts';
|
|
25
25
|
import SelectFilter from './select__filter';
|
|
26
26
|
import styles from './select-popup.css';
|
|
27
|
-
const INPUT_MARGIN_COMPENSATION = -14;
|
|
28
27
|
const FILTER_HEIGHT = 35;
|
|
29
28
|
const TOOLBAR_HEIGHT = 49;
|
|
30
29
|
function noop() { }
|
|
@@ -321,7 +320,7 @@ export default class SelectPopup extends PureComponent {
|
|
|
321
320
|
const list = this.getList(this.props.ringPopupTarget || ringPopupTarget);
|
|
322
321
|
const bottomLine = this.getBottomLine();
|
|
323
322
|
const hasContent = filterWithTags || selectAll || list || bottomLine || toolbar;
|
|
324
|
-
return (<Popup trapFocus={false} ref={this.popupRef} hidden={hidden || !hasContent} attached={isInputMode} className={classes} dontCloseOnAnchorClick anchorElement={anchorElement} minWidth={minWidth} onCloseAttempt={onCloseAttempt} directions={directions} top={top
|
|
323
|
+
return (<Popup trapFocus={false} ref={this.popupRef} hidden={hidden || !hasContent} attached={isInputMode} className={classes} dontCloseOnAnchorClick anchorElement={anchorElement} minWidth={minWidth} onCloseAttempt={onCloseAttempt} directions={directions} top={top} left={left} onMouseDown={this.mouseDownHandler} target={this.props.ringPopupTarget} autoCorrectTopOverflow={false} style={style}>
|
|
325
324
|
<div dir={dir}>
|
|
326
325
|
{!hidden && filter &&
|
|
327
326
|
(<Shortcuts map={this.shortcutsMap} scope={this.shortcutsScope}/>)}
|
|
@@ -175,6 +175,7 @@ export const asModelLazy = () => {
|
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
asModelLazy.storyName = 'as model lazy';
|
|
178
|
+
asModelLazy.parameters = {storyshots: false};
|
|
178
179
|
|
|
179
180
|
export const withPromise = () => {
|
|
180
181
|
angular.module(APP_NAME, [SelectNG]).controller('testCtrl', function ctrl($timeout, $q) {
|
|
@@ -7,6 +7,8 @@ import getEventKey from '../global/get-event-key';
|
|
|
7
7
|
import Select, {RerenderableSelect} from '../select/select';
|
|
8
8
|
import MessageBundle from '../message-bundle-ng/message-bundle-ng';
|
|
9
9
|
|
|
10
|
+
import {ControlsHeight} from '../global/controls-height';
|
|
11
|
+
|
|
10
12
|
import SelectNgOptions from './select-ng__options';
|
|
11
13
|
import SelectLazy from './select-ng__lazy';
|
|
12
14
|
|
|
@@ -23,7 +25,6 @@ angularModule.directive('rgSelect', function rgSelectDirective() {
|
|
|
23
25
|
const types = {
|
|
24
26
|
input: Select.Type.INPUT,
|
|
25
27
|
button: Select.Type.BUTTON,
|
|
26
|
-
material: Select.Type.MATERIAL,
|
|
27
28
|
dropdown: Select.Type.CUSTOM,
|
|
28
29
|
suggest: Select.Type.INPUT
|
|
29
30
|
};
|
|
@@ -417,6 +418,7 @@ angularModule.directive('rgSelect', function rgSelectDirective() {
|
|
|
417
418
|
notFoundMessage: ctrl.notFoundMessage || RingMessageBundle.select_options_not_found(),
|
|
418
419
|
targetElement: getType() === 'dropdown' ? element : null,
|
|
419
420
|
size: getSelectSize(),
|
|
421
|
+
height: ControlsHeight.S,
|
|
420
422
|
onBeforeOpen: () => {
|
|
421
423
|
resetMemorizedOptions();
|
|
422
424
|
ctrl.loadOptionsToSelect(ctrl.query);
|
|
@@ -131,7 +131,7 @@ describe('Select Ng', () => {
|
|
|
131
131
|
|
|
132
132
|
it('Should use default type "Button" if type is not passed', () => {
|
|
133
133
|
compileTemplate('<rg-select options="item.name for item in items track by item.id" ng-model="selectedItem"></rg-select>');
|
|
134
|
-
ctrl.selectInstance.props.type.should.equal(Select.Type.
|
|
134
|
+
ctrl.selectInstance.props.type.should.equal(Select.Type.BUTTON);
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
it('Should support type "input"', () => {
|
|
@@ -59,11 +59,10 @@ class SelectLazy {
|
|
|
59
59
|
this.detachEvents();
|
|
60
60
|
if (this.type === 'dropdown') {
|
|
61
61
|
this.ctrl.selectInstance = render(this.reactSelect, this.container);
|
|
62
|
-
// In "dropdown" mode we don't click select itself, so need to force click handler
|
|
63
|
-
this.ctrl.selectInstance._clickHandler();
|
|
64
62
|
} else {
|
|
65
63
|
this.ctrl.selectInstance = hydrate(this.reactSelect, this.container);
|
|
66
64
|
}
|
|
65
|
+
this.ctrl.selectInstance._openPopupIfClosed();
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
|
|
@@ -9,7 +9,7 @@ const TabTitle = React.memo(function TabTitle({ selected, child, handleSelect =
|
|
|
9
9
|
if (child == null || typeof child !== 'object' || child.type === CustomItem) {
|
|
10
10
|
return child;
|
|
11
11
|
}
|
|
12
|
-
const { title, disabled, href, className, activeClassName, collapsedClassName, collapsedActiveClassName } = child.props;
|
|
12
|
+
const { title, titleProps, disabled, href, className, activeClassName, collapsedClassName, collapsedActiveClassName } = child.props;
|
|
13
13
|
const titleClasses = classNames(styles.title, className, {
|
|
14
14
|
[styles.selected]: selected,
|
|
15
15
|
[styles.collapsed]: collapsed,
|
|
@@ -17,7 +17,7 @@ const TabTitle = React.memo(function TabTitle({ selected, child, handleSelect =
|
|
|
17
17
|
[collapsedClassName ?? '']: collapsed,
|
|
18
18
|
[collapsedActiveClassName ?? '']: collapsed && selected
|
|
19
19
|
});
|
|
20
|
-
return (<TabLink title={title} isSelected={selected} active href={href} innerClassName={titleClasses} className={titleClasses} disabled={disabled} onPlainLeftClick={handleSelect} tabIndex={tabIndex} collapsed={collapsed}/>);
|
|
20
|
+
return (<TabLink title={title} isSelected={selected} active href={href} innerClassName={titleClasses} className={titleClasses} disabled={disabled} onPlainLeftClick={handleSelect} tabIndex={tabIndex} collapsed={collapsed} {...titleProps}/>);
|
|
21
21
|
});
|
|
22
22
|
TabTitle.propTypes = {
|
|
23
23
|
child: PropTypes.element,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PureComponent, ReactElement } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import Theme, { ThemeProps } from '../global/theme';
|
|
4
3
|
import { CollapsibleTabsProps } from './collapsible-tabs';
|
|
5
4
|
import { CustomItem } from './custom-item';
|
|
6
5
|
import { TabProps } from './tab';
|
|
7
6
|
export { CustomItem };
|
|
8
7
|
declare type Children = readonly Children[] | ReactElement<TabProps> | null | boolean;
|
|
9
|
-
export interface TabsProps extends
|
|
8
|
+
export interface TabsProps extends Omit<CollapsibleTabsProps, 'onSelect' | 'children'> {
|
|
10
9
|
children: Children;
|
|
11
10
|
onSelect: (key: string) => void;
|
|
12
11
|
className?: string | null | undefined;
|
|
@@ -15,7 +14,6 @@ export interface TabsProps extends ThemeProps, Omit<CollapsibleTabsProps, 'onSel
|
|
|
15
14
|
}
|
|
16
15
|
declare class Tabs extends PureComponent<TabsProps> {
|
|
17
16
|
static propTypes: {
|
|
18
|
-
theme: PropTypes.Requireable<string>;
|
|
19
17
|
selected: PropTypes.Requireable<string>;
|
|
20
18
|
className: PropTypes.Requireable<string>;
|
|
21
19
|
href: PropTypes.Requireable<string>;
|
|
@@ -27,110 +25,9 @@ declare class Tabs extends PureComponent<TabsProps> {
|
|
|
27
25
|
static defaultProps: {
|
|
28
26
|
onSelect(): void;
|
|
29
27
|
};
|
|
30
|
-
static Theme: typeof Theme;
|
|
31
28
|
handleSelect: (arg: string) => () => void;
|
|
32
29
|
getTabTitle: (child: ReactElement<TabProps>, i: number) => JSX.Element;
|
|
33
30
|
render(): JSX.Element;
|
|
34
31
|
}
|
|
35
|
-
declare
|
|
36
|
-
|
|
37
|
-
selected: PropTypes.Requireable<string>;
|
|
38
|
-
className: PropTypes.Requireable<string>;
|
|
39
|
-
href: PropTypes.Requireable<string>;
|
|
40
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
41
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
42
|
-
'data-test': PropTypes.Requireable<string>;
|
|
43
|
-
autoCollapse: PropTypes.Requireable<boolean>;
|
|
44
|
-
}>, "href"> & Pick<TabsProps, "moreClassName" | "moreActiveClassName" | "morePopupClassName" | "morePopupItemClassName" | "morePopupBeforeEnd" | "initialVisibleItems">, "className" | "href" | "children" | "theme" | "data-test" | "selected" | "moreClassName" | "moreActiveClassName" | "morePopupClassName" | "morePopupItemClassName" | "morePopupBeforeEnd" | "initialVisibleItems" | "autoCollapse"> & Partial<Pick<Pick<TabsProps, keyof TabsProps> & Pick<PropTypes.InferProps<{
|
|
45
|
-
theme: PropTypes.Requireable<string>;
|
|
46
|
-
selected: PropTypes.Requireable<string>;
|
|
47
|
-
className: PropTypes.Requireable<string>;
|
|
48
|
-
href: PropTypes.Requireable<string>;
|
|
49
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
50
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
51
|
-
'data-test': PropTypes.Requireable<string>;
|
|
52
|
-
autoCollapse: PropTypes.Requireable<boolean>;
|
|
53
|
-
}>, "href"> & Pick<TabsProps, "moreClassName" | "moreActiveClassName" | "morePopupClassName" | "morePopupItemClassName" | "morePopupBeforeEnd" | "initialVisibleItems">, "onSelect">> & Partial<Pick<{
|
|
54
|
-
onSelect(): void;
|
|
55
|
-
}, never>>) | (Pick<Pick<TabsProps, keyof TabsProps> & Pick<PropTypes.InferProps<React.WeakValidationMap<TabsProps> & {
|
|
56
|
-
theme: PropTypes.Requireable<string>;
|
|
57
|
-
selected: PropTypes.Requireable<string>;
|
|
58
|
-
className: PropTypes.Requireable<string>;
|
|
59
|
-
href: PropTypes.Requireable<string>;
|
|
60
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
61
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
62
|
-
'data-test': PropTypes.Requireable<string>;
|
|
63
|
-
autoCollapse: PropTypes.Requireable<boolean>;
|
|
64
|
-
}>, "href"> & Pick<TabsProps, never>, "href"> & Partial<Pick<Pick<TabsProps, keyof TabsProps> & Pick<PropTypes.InferProps<React.WeakValidationMap<TabsProps> & {
|
|
65
|
-
theme: PropTypes.Requireable<string>;
|
|
66
|
-
selected: PropTypes.Requireable<string>;
|
|
67
|
-
className: PropTypes.Requireable<string>;
|
|
68
|
-
href: PropTypes.Requireable<string>;
|
|
69
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
70
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
71
|
-
'data-test': PropTypes.Requireable<string>;
|
|
72
|
-
autoCollapse: PropTypes.Requireable<boolean>;
|
|
73
|
-
}>, "href"> & Pick<TabsProps, never>, keyof TabsProps>> & Partial<Pick<Partial<TabsProps> & {
|
|
74
|
-
onSelect(): void;
|
|
75
|
-
}, never>>), "theme"> & import("../global/theme").ThemeOuterProps & React.RefAttributes<Tabs>> & {
|
|
76
|
-
readonly type: React.ForwardRefExoticComponent<Omit<(Pick<Pick<TabsProps, keyof TabsProps> & Pick<PropTypes.InferProps<{
|
|
77
|
-
theme: PropTypes.Requireable<string>;
|
|
78
|
-
selected: PropTypes.Requireable<string>;
|
|
79
|
-
className: PropTypes.Requireable<string>;
|
|
80
|
-
href: PropTypes.Requireable<string>;
|
|
81
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
82
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
83
|
-
'data-test': PropTypes.Requireable<string>;
|
|
84
|
-
autoCollapse: PropTypes.Requireable<boolean>;
|
|
85
|
-
}>, "href"> & Pick<TabsProps, "moreClassName" | "moreActiveClassName" | "morePopupClassName" | "morePopupItemClassName" | "morePopupBeforeEnd" | "initialVisibleItems">, "className" | "href" | "children" | "theme" | "data-test" | "selected" | "moreClassName" | "moreActiveClassName" | "morePopupClassName" | "morePopupItemClassName" | "morePopupBeforeEnd" | "initialVisibleItems" | "autoCollapse"> & Partial<Pick<Pick<TabsProps, keyof TabsProps> & Pick<PropTypes.InferProps<{
|
|
86
|
-
theme: PropTypes.Requireable<string>;
|
|
87
|
-
selected: PropTypes.Requireable<string>;
|
|
88
|
-
className: PropTypes.Requireable<string>;
|
|
89
|
-
href: PropTypes.Requireable<string>;
|
|
90
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
91
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
92
|
-
'data-test': PropTypes.Requireable<string>;
|
|
93
|
-
autoCollapse: PropTypes.Requireable<boolean>;
|
|
94
|
-
}>, "href"> & Pick<TabsProps, "moreClassName" | "moreActiveClassName" | "morePopupClassName" | "morePopupItemClassName" | "morePopupBeforeEnd" | "initialVisibleItems">, "onSelect">> & Partial<Pick<{
|
|
95
|
-
onSelect(): void;
|
|
96
|
-
}, never>>) | (Pick<Pick<TabsProps, keyof TabsProps> & Pick<PropTypes.InferProps<React.WeakValidationMap<TabsProps> & {
|
|
97
|
-
theme: PropTypes.Requireable<string>;
|
|
98
|
-
selected: PropTypes.Requireable<string>;
|
|
99
|
-
className: PropTypes.Requireable<string>;
|
|
100
|
-
href: PropTypes.Requireable<string>;
|
|
101
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
102
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
103
|
-
'data-test': PropTypes.Requireable<string>;
|
|
104
|
-
autoCollapse: PropTypes.Requireable<boolean>;
|
|
105
|
-
}>, "href"> & Pick<TabsProps, never>, "href"> & Partial<Pick<Pick<TabsProps, keyof TabsProps> & Pick<PropTypes.InferProps<React.WeakValidationMap<TabsProps> & {
|
|
106
|
-
theme: PropTypes.Requireable<string>;
|
|
107
|
-
selected: PropTypes.Requireable<string>;
|
|
108
|
-
className: PropTypes.Requireable<string>;
|
|
109
|
-
href: PropTypes.Requireable<string>;
|
|
110
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
111
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
112
|
-
'data-test': PropTypes.Requireable<string>;
|
|
113
|
-
autoCollapse: PropTypes.Requireable<boolean>;
|
|
114
|
-
}>, "href"> & Pick<TabsProps, never>, keyof TabsProps>> & Partial<Pick<Partial<TabsProps> & {
|
|
115
|
-
onSelect(): void;
|
|
116
|
-
}, never>>), "theme"> & import("../global/theme").ThemeOuterProps & React.RefAttributes<Tabs>>;
|
|
117
|
-
} & {
|
|
118
|
-
prototype: Tabs;
|
|
119
|
-
propTypes: {
|
|
120
|
-
theme: PropTypes.Requireable<string>;
|
|
121
|
-
selected: PropTypes.Requireable<string>;
|
|
122
|
-
className: PropTypes.Requireable<string>;
|
|
123
|
-
href: PropTypes.Requireable<string>;
|
|
124
|
-
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
125
|
-
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
126
|
-
'data-test': PropTypes.Requireable<string>;
|
|
127
|
-
autoCollapse: PropTypes.Requireable<boolean>;
|
|
128
|
-
};
|
|
129
|
-
defaultProps: {
|
|
130
|
-
onSelect(): void;
|
|
131
|
-
};
|
|
132
|
-
Theme: typeof Theme;
|
|
133
|
-
contextType?: React.Context<any> | undefined;
|
|
134
|
-
};
|
|
135
|
-
export declare type TabsAttrs = ComponentPropsWithRef<typeof ThemedTabs>;
|
|
136
|
-
export default ThemedTabs;
|
|
32
|
+
export declare type TabsAttrs = JSX.LibraryManagedAttributes<typeof Tabs, TabsProps>;
|
|
33
|
+
export default Tabs;
|