@jetbrains/ring-ui 7.0.0-beta.8 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.config.js +20 -14
- package/components/alert/alert.css +7 -7
- package/components/alert/alert.d.ts +2 -2
- package/components/alert/alert.js +10 -12
- package/components/alert/container.js +1 -1
- package/components/alert-service/alert-service.js +4 -2
- package/components/analytics/analytics__custom-plugin.js +1 -1
- package/components/auth/auth.js +1 -1
- package/components/auth/auth__core.js +36 -36
- package/components/auth/background-flow.js +2 -2
- package/components/auth/down-notification.js +3 -1
- package/components/auth/iframe-flow.js +4 -2
- package/components/auth/request-builder.js +5 -5
- package/components/auth/storage.js +10 -9
- package/components/auth/token-validator.js +8 -15
- package/components/auth-dialog/auth-dialog.js +8 -8
- package/components/auth-dialog-service/auth-dialog-service.js +4 -4
- package/components/avatar/avatar.js +9 -7
- package/components/avatar/fallback-avatar.js +15 -12
- package/components/button/button.css +36 -25
- package/components/button/button.js +9 -9
- package/components/button/button__classes.d.ts +1 -1
- package/components/button/button__classes.js +3 -4
- package/components/button-group/button-group.css +25 -13
- package/components/button-group/caption.js +1 -1
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/button-toolbar/button-toolbar.js +2 -2
- package/components/caret/caret.js +8 -8
- package/components/checkbox/checkbox.css +8 -5
- package/components/checkbox/checkbox.js +1 -1
- package/components/clipboard/clipboard-fallback.js +2 -6
- package/components/clipboard/clipboard.js +5 -5
- package/components/code/code.d.ts +1 -1
- package/components/code/code.js +2 -2
- package/components/code/highlight.css +3 -1
- package/components/collapse/collapse-content.d.ts +1 -2
- package/components/collapse/collapse-content.js +25 -14
- package/components/collapse/collapse-context.js +1 -1
- package/components/collapse/collapse-control.js +5 -3
- package/components/collapse/collapse.css +21 -20
- package/components/collapse/collapse.js +2 -2
- package/components/confirm/confirm.d.ts +2 -2
- package/components/confirm/confirm.js +2 -2
- package/components/confirm-service/confirm-service.d.ts +1 -1
- package/components/confirm-service/confirm-service.js +6 -6
- package/components/content-layout/content-layout.css +6 -5
- package/components/content-layout/content-layout.js +7 -6
- package/components/content-layout/sidebar.js +5 -5
- package/components/contenteditable/contenteditable.d.ts +1 -1
- package/components/contenteditable/contenteditable.js +3 -4
- package/components/control-label/control-label.js +5 -3
- package/components/data-list/data-list.css +3 -3
- package/components/data-list/data-list.d.ts +2 -2
- package/components/data-list/data-list.js +6 -7
- package/components/data-list/data-list.mock.js +57 -47
- package/components/data-list/item.js +14 -16
- package/components/data-list/selection.js +5 -7
- package/components/data-list/title.js +5 -6
- package/components/date-picker/consts.js +2 -2
- package/components/date-picker/date-input.js +4 -4
- package/components/date-picker/date-picker.css +23 -18
- package/components/date-picker/date-picker.d.ts +2 -1
- package/components/date-picker/date-picker.js +13 -19
- package/components/date-picker/date-popup.js +30 -36
- package/components/date-picker/day.js +6 -9
- package/components/date-picker/formats.js +647 -1
- package/components/date-picker/month-names.js +6 -8
- package/components/date-picker/month-slider.js +2 -2
- package/components/date-picker/month.js +1 -3
- package/components/date-picker/months.js +2 -6
- package/components/date-picker/weekdays.js +2 -3
- package/components/date-picker/years.js +3 -3
- package/components/dialog/dialog.d.ts +1 -0
- package/components/dialog/dialog.js +20 -13
- package/components/dialog/dialog__body-scroll-preventer.js +1 -1
- package/components/dropdown/dropdown.css +2 -4
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +5 -5
- package/components/dropdown-menu/dropdown-menu.js +5 -5
- package/components/editable-heading/editable-heading.css +5 -2
- package/components/editable-heading/editable-heading.js +21 -19
- package/components/error-bubble/error-bubble.js +1 -1
- package/components/error-message/error-message.js +2 -4
- package/components/footer/footer.js +11 -15
- package/components/form/form.stories.js +45 -63
- package/components/global/create-stateful-context.js +2 -4
- package/components/global/data-tests.js +5 -6
- package/components/global/dom.js +8 -11
- package/components/global/focus-sensor-hoc.js +5 -6
- package/components/global/fuzzy-highlight.js +1 -1
- package/components/global/get-event-key.js +2 -2
- package/components/global/global.css +0 -3
- package/components/global/linear-function.js +1 -1
- package/components/global/normalize-indent.js +2 -6
- package/components/global/react-dom-renderer.js +2 -3
- package/components/global/theme.d.ts +4 -2
- package/components/global/theme.js +14 -12
- package/components/global/url.js +8 -8
- package/components/global/variables.css +1 -8
- package/components/global/variables_dark.css +0 -1
- package/components/grid/col.js +6 -6
- package/components/grid/grid.css +174 -173
- package/components/grid/grid.js +1 -1
- package/components/grid/row.js +13 -6
- package/components/group/group.js +1 -1
- package/components/header/header-icon.js +2 -2
- package/components/header/header.css +19 -15
- package/components/header/header.js +3 -5
- package/components/header/links.js +1 -1
- package/components/header/logo.js +1 -1
- package/components/header/profile.d.ts +2 -2
- package/components/header/profile.js +9 -9
- package/components/header/services-link.js +1 -1
- package/components/header/services.js +4 -5
- package/components/header/smart-profile.js +4 -3
- package/components/header/smart-services.js +9 -5
- package/components/header/tray.js +1 -1
- package/components/heading/heading.css +0 -1
- package/components/heading/heading.js +2 -2
- package/components/http/http.d.ts +3 -3
- package/components/http/http.js +25 -29
- package/components/http/http.mock.js +9 -6
- package/components/hub-source/hub-source.js +5 -7
- package/components/hub-source/hub-source__user.js +1 -1
- package/components/hub-source/hub-source__users-groups.js +6 -7
- package/components/i18n/README.md +3 -4
- package/components/i18n/i18n-context.js +2 -4
- package/components/icon/icon.css +1 -1
- package/components/icon/icon.js +7 -9
- package/components/icon/icon__svg.js +6 -6
- package/components/input/input.css +1 -1
- package/components/input/input.js +11 -14
- package/components/input-size/input-size.stories.js +42 -22
- package/components/island/adaptive-island-hoc.js +1 -1
- package/components/island/content.js +4 -6
- package/components/island/header.js +8 -10
- package/components/island/island.css +5 -5
- package/components/island/island.js +1 -1
- package/components/link/clickableLink.js +3 -1
- package/components/link/link.js +5 -3
- package/components/list/consts.js +1 -1
- package/components/list/list.d.ts +1 -1
- package/components/list/list.js +35 -57
- package/components/list/list__custom.js +3 -5
- package/components/list/list__hint.js +3 -1
- package/components/list/list__item.js +11 -9
- package/components/list/list__link.js +1 -1
- package/components/list/list__separator.js +2 -2
- package/components/list/list__title.js +7 -3
- package/components/list/list__users-groups-source.js +6 -8
- package/components/loader/loader.js +1 -1
- package/components/loader/loader__core.js +5 -5
- package/components/loader-inline/loader-inline.css +0 -3
- package/components/loader-inline/loader-inline.js +5 -7
- package/components/loader-screen/loader-screen.js +1 -1
- package/components/login-dialog/login-dialog.js +4 -4
- package/components/login-dialog/service.js +5 -5
- package/components/markdown/markdown.css +6 -6
- package/components/markdown/markdown.d.ts +2 -2
- package/components/markdown/markdown.js +4 -6
- package/components/message/message.css +2 -1
- package/components/message/message.js +30 -21
- package/components/old-browsers-message/old-browsers-message.js +2 -2
- package/components/old-browsers-message/white-list.js +2 -3
- package/components/pager/pager.js +28 -29
- package/components/permissions/permissions.js +8 -13
- package/components/permissions/permissions__cache.js +6 -7
- package/components/popup/popup.consts.js +8 -2
- package/components/popup/popup.js +27 -33
- package/components/popup/popup.target.js +4 -4
- package/components/popup/position.js +21 -28
- package/components/popup-menu/popup-menu.js +1 -1
- package/components/progress-bar/progress-bar.css +10 -8
- package/components/progress-bar/progress-bar.d.ts +2 -2
- package/components/progress-bar/progress-bar.js +2 -2
- package/components/query-assist/query-assist.css +0 -3
- package/components/query-assist/query-assist.js +73 -84
- package/components/query-assist/query-assist__suggestions.js +10 -9
- package/components/radio/radio.css +6 -2
- package/components/radio/radio.js +1 -3
- package/components/scrollable-section/scrollable-section.css +5 -6
- package/components/scrollable-section/scrollable-section.js +1 -1
- package/components/select/select.css +5 -7
- package/components/select/select.d.ts +1 -1
- package/components/select/select.js +96 -110
- package/components/select/select__filter.js +1 -1
- package/components/select/select__popup.js +40 -51
- package/components/shortcuts/core.js +8 -6
- package/components/shortcuts/shortcut-title.js +6 -6
- package/components/shortcuts/shortcuts.js +1 -1
- package/components/sidebar/sidebar.css +3 -1
- package/components/slider/slider.css +14 -14
- package/components/slider/slider.js +7 -7
- package/components/tab-trap/tab-trap.js +7 -9
- package/components/table/cell.js +3 -1
- package/components/table/disable-hover-hoc.js +2 -2
- package/components/table/header-cell.js +5 -3
- package/components/table/header.d.ts +2 -10
- package/components/table/header.js +10 -12
- package/components/table/multitable.js +5 -3
- package/components/table/row.d.ts +0 -1
- package/components/table/row.js +20 -27
- package/components/table/selection-adapter.js +1 -1
- package/components/table/selection-shortcuts-hoc.js +2 -2
- package/components/table/selection.d.ts +2 -3
- package/components/table/selection.js +4 -5
- package/components/table/simple-table.js +4 -4
- package/components/table/smart-table.js +5 -5
- package/components/table/table.css +8 -9
- package/components/table/table.d.ts +0 -1
- package/components/table/table.js +22 -23
- package/components/table/table.stories.json +45 -16
- package/components/tabs/collapsible-more.d.ts +1 -1
- package/components/tabs/collapsible-more.js +13 -16
- package/components/tabs/collapsible-tab.js +2 -2
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +13 -22
- package/components/tabs/dumb-tabs.js +6 -9
- package/components/tabs/smart-tabs.js +4 -4
- package/components/tabs/tab-link.js +1 -3
- package/components/tabs/tabs.css +7 -9
- package/components/tag/tag.css +7 -7
- package/components/tag/tag.d.ts +1 -1
- package/components/tag/tag.js +9 -12
- package/components/tags-input/tags-input.js +15 -19
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/tags-list.js +6 -5
- package/components/text/text.js +5 -3
- package/components/toggle/toggle.css +12 -10
- package/components/toggle/toggle.d.ts +2 -2
- package/components/toggle/toggle.js +4 -3
- package/components/tooltip/tooltip.d.ts +4 -1
- package/components/tooltip/tooltip.js +19 -10
- package/components/user-agreement/service.js +15 -13
- package/components/user-agreement/user-agreement.js +3 -5
- package/components/user-card/card.js +10 -9
- package/components/user-card/smart-user-card-tooltip.js +5 -7
- package/components/user-card/tooltip.js +4 -4
- package/components/user-card/user-card.css +4 -0
- package/jslint-xml.js +20 -19
- package/package.json +66 -58
- package/postcss.config.js +3 -4
- package/typings.d.ts +2 -4
- package/webpack.config.js +20 -25
- package/components/badge/badge.css +0 -42
- package/components/badge/badge.d.ts +0 -14
- package/components/badge/badge.js +0 -29
- package/components/island-legacy/content-legacy.d.ts +0 -5
- package/components/island-legacy/content-legacy.js +0 -12
- package/components/island-legacy/header-legacy.d.ts +0 -5
- package/components/island-legacy/header-legacy.js +0 -14
- package/components/island-legacy/island-legacy.css +0 -98
- package/components/island-legacy/island-legacy.d.ts +0 -7
- package/components/island-legacy/island-legacy.js +0 -14
- package/components/table-legacy/table-legacy.css +0 -346
- package/components/table-legacy/table-legacy__toolbar.css +0 -25
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import Link from '../link/link';
|
|
2
|
-
import
|
|
2
|
+
import Tag from '../tag/tag';
|
|
3
3
|
const items = [
|
|
4
4
|
{
|
|
5
5
|
id: 1,
|
|
6
|
-
title: <span
|
|
6
|
+
title: (<span>
|
|
7
|
+
<strong>Assigner</strong> in 60 projects
|
|
8
|
+
</span>),
|
|
7
9
|
collapsible: true,
|
|
8
10
|
selectable: true,
|
|
9
11
|
items: [
|
|
@@ -16,35 +18,37 @@ const items = [
|
|
|
16
18
|
{
|
|
17
19
|
id: 111,
|
|
18
20
|
selectable: true,
|
|
19
|
-
title: <Link href="#">TeamCity</Link
|
|
21
|
+
title: <Link href="#">TeamCity</Link>,
|
|
20
22
|
},
|
|
21
23
|
{
|
|
22
24
|
id: 112,
|
|
23
25
|
selectable: true,
|
|
24
|
-
title: <Link href="#">YouTrack</Link
|
|
26
|
+
title: <Link href="#">YouTrack</Link>,
|
|
25
27
|
},
|
|
26
28
|
{
|
|
27
29
|
id: 113,
|
|
28
30
|
selectable: true,
|
|
29
|
-
title: <Link href="#">Sandbox</Link
|
|
31
|
+
title: <Link href="#">Sandbox</Link>,
|
|
30
32
|
},
|
|
31
33
|
{
|
|
32
34
|
id: 114,
|
|
33
35
|
selectable: true,
|
|
34
|
-
title: <Link href="#">Exception Analyzer</Link
|
|
36
|
+
title: <Link href="#">Exception Analyzer</Link>,
|
|
35
37
|
},
|
|
36
38
|
{
|
|
37
39
|
id: 115,
|
|
38
40
|
selectable: true,
|
|
39
|
-
title: <Link href="#">MPS</Link
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
]
|
|
41
|
+
title: <Link href="#">MPS</Link>,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
],
|
|
44
46
|
},
|
|
45
47
|
{
|
|
46
48
|
id: 2,
|
|
47
|
-
title: <span
|
|
49
|
+
title: (<span>
|
|
50
|
+
<strong>Code Reviewer</strong> in 5 projects
|
|
51
|
+
</span>),
|
|
48
52
|
selectable: true,
|
|
49
53
|
collapsible: true,
|
|
50
54
|
items: [
|
|
@@ -54,8 +58,8 @@ const items = [
|
|
|
54
58
|
title: (<span>
|
|
55
59
|
<Link href="#">JetProfile</Link>
|
|
56
60
|
<span> </span>
|
|
57
|
-
<
|
|
58
|
-
</span>)
|
|
61
|
+
<Tag>duplicate</Tag>
|
|
62
|
+
</span>),
|
|
59
63
|
},
|
|
60
64
|
{
|
|
61
65
|
id: 22,
|
|
@@ -65,29 +69,29 @@ const items = [
|
|
|
65
69
|
{
|
|
66
70
|
id: 221,
|
|
67
71
|
collapsible: true,
|
|
68
|
-
title: <Link href="#">TeamCity</Link
|
|
72
|
+
title: <Link href="#">TeamCity</Link>,
|
|
69
73
|
},
|
|
70
74
|
{
|
|
71
75
|
id: 222,
|
|
72
76
|
collapsible: true,
|
|
73
|
-
title: <Link href="#">YouTrack</Link
|
|
77
|
+
title: <Link href="#">YouTrack</Link>,
|
|
74
78
|
},
|
|
75
79
|
{
|
|
76
80
|
id: 223,
|
|
77
81
|
collapsible: true,
|
|
78
|
-
title: <Link href="#">Sandbox</Link
|
|
82
|
+
title: <Link href="#">Sandbox</Link>,
|
|
79
83
|
},
|
|
80
84
|
{
|
|
81
85
|
id: 224,
|
|
82
86
|
collapsible: true,
|
|
83
|
-
title: <Link href="#">Exception Analyzer</Link
|
|
87
|
+
title: <Link href="#">Exception Analyzer</Link>,
|
|
84
88
|
},
|
|
85
89
|
{
|
|
86
90
|
id: 225,
|
|
87
91
|
collapsible: true,
|
|
88
|
-
title: <Link href="#">MPS</Link
|
|
89
|
-
}
|
|
90
|
-
]
|
|
92
|
+
title: <Link href="#">MPS</Link>,
|
|
93
|
+
},
|
|
94
|
+
],
|
|
91
95
|
},
|
|
92
96
|
{
|
|
93
97
|
id: 23,
|
|
@@ -95,13 +99,15 @@ const items = [
|
|
|
95
99
|
title: (<span>
|
|
96
100
|
<Link href="#">CustomJDK</Link>
|
|
97
101
|
<span>: as a member of ide-developers</span>
|
|
98
|
-
</span>)
|
|
99
|
-
}
|
|
100
|
-
]
|
|
102
|
+
</span>),
|
|
103
|
+
},
|
|
104
|
+
],
|
|
101
105
|
},
|
|
102
106
|
{
|
|
103
107
|
id: 3,
|
|
104
|
-
title: <span
|
|
108
|
+
title: (<span>
|
|
109
|
+
<strong>Code Viewer</strong> in 5 projects
|
|
110
|
+
</span>),
|
|
105
111
|
selectable: true,
|
|
106
112
|
collapsible: true,
|
|
107
113
|
items: [
|
|
@@ -111,7 +117,7 @@ const items = [
|
|
|
111
117
|
title: (<span>
|
|
112
118
|
<Link href="#">ide-frontend</Link>
|
|
113
119
|
<span>: as a member of ide-developers</span>
|
|
114
|
-
</span>)
|
|
120
|
+
</span>),
|
|
115
121
|
},
|
|
116
122
|
{
|
|
117
123
|
id: 32,
|
|
@@ -119,13 +125,15 @@ const items = [
|
|
|
119
125
|
title: (<span>
|
|
120
126
|
<Link href="#">ide-frontend</Link>
|
|
121
127
|
<span>: as a member of ide-frontend Code Viewers</span>
|
|
122
|
-
</span>)
|
|
123
|
-
}
|
|
124
|
-
]
|
|
128
|
+
</span>),
|
|
129
|
+
},
|
|
130
|
+
],
|
|
125
131
|
},
|
|
126
132
|
{
|
|
127
133
|
id: 4,
|
|
128
|
-
title: <span
|
|
134
|
+
title: (<span>
|
|
135
|
+
<strong>Commenter</strong> in 12 projects
|
|
136
|
+
</span>),
|
|
129
137
|
collapsible: true,
|
|
130
138
|
items: [
|
|
131
139
|
{
|
|
@@ -134,7 +142,7 @@ const items = [
|
|
|
134
142
|
title: (<span>
|
|
135
143
|
<Link href="#">Intellij IDEA</Link>
|
|
136
144
|
<span>: as a member of Registered Users</span>
|
|
137
|
-
</span>)
|
|
145
|
+
</span>),
|
|
138
146
|
},
|
|
139
147
|
{
|
|
140
148
|
id: 42,
|
|
@@ -142,9 +150,9 @@ const items = [
|
|
|
142
150
|
title: (<span>
|
|
143
151
|
<Link href="#">YouTrack Backlog</Link>
|
|
144
152
|
<span>: as a member of jetbrains-team</span>
|
|
145
|
-
</span>)
|
|
146
|
-
}
|
|
147
|
-
]
|
|
153
|
+
</span>),
|
|
154
|
+
},
|
|
155
|
+
],
|
|
148
156
|
},
|
|
149
157
|
{
|
|
150
158
|
id: 5,
|
|
@@ -152,16 +160,16 @@ const items = [
|
|
|
152
160
|
title: (<span>
|
|
153
161
|
<strong>Developer</strong>
|
|
154
162
|
<span> in 57 projects </span>
|
|
155
|
-
<
|
|
163
|
+
<Tag>team role</Tag>
|
|
156
164
|
</span>),
|
|
157
165
|
items: [
|
|
158
166
|
{
|
|
159
167
|
id: 51,
|
|
160
168
|
selectable: true,
|
|
161
169
|
collapsible: true,
|
|
162
|
-
title: <Link href="#">Wasabi</Link
|
|
163
|
-
}
|
|
164
|
-
]
|
|
170
|
+
title: <Link href="#">Wasabi</Link>,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
165
173
|
},
|
|
166
174
|
{
|
|
167
175
|
id: 6,
|
|
@@ -171,14 +179,16 @@ const items = [
|
|
|
171
179
|
<span> in project </span>
|
|
172
180
|
<Link href="#">Hackathon 2016</Link>
|
|
173
181
|
<span>: as a member of jetbrains-team</span>
|
|
174
|
-
</span>)
|
|
182
|
+
</span>),
|
|
175
183
|
},
|
|
176
184
|
{
|
|
177
185
|
id: 7,
|
|
178
|
-
title: <span
|
|
186
|
+
title: (<span>
|
|
187
|
+
<strong>Git Hosting Checkout</strong> in 7 projects
|
|
188
|
+
</span>),
|
|
179
189
|
selectable: true,
|
|
180
|
-
collapsible: true
|
|
181
|
-
}
|
|
190
|
+
collapsible: true,
|
|
191
|
+
},
|
|
182
192
|
];
|
|
183
193
|
export const moreItems = [
|
|
184
194
|
{
|
|
@@ -188,8 +198,8 @@ export const moreItems = [
|
|
|
188
198
|
title: (<span>
|
|
189
199
|
<Link href="#">More item 1</Link>
|
|
190
200
|
<span> </span>
|
|
191
|
-
<
|
|
192
|
-
</span>)
|
|
201
|
+
<Tag>duplicate</Tag>
|
|
202
|
+
</span>),
|
|
193
203
|
},
|
|
194
204
|
{
|
|
195
205
|
id: 92,
|
|
@@ -198,8 +208,8 @@ export const moreItems = [
|
|
|
198
208
|
title: (<span>
|
|
199
209
|
<Link href="#">More item 2</Link>
|
|
200
210
|
<span> </span>
|
|
201
|
-
<
|
|
202
|
-
</span>)
|
|
203
|
-
}
|
|
211
|
+
<Tag>duplicate</Tag>
|
|
212
|
+
</span>),
|
|
213
|
+
},
|
|
204
214
|
];
|
|
205
215
|
export default items;
|
|
@@ -22,7 +22,7 @@ export default class Item extends PureComponent {
|
|
|
22
22
|
level: 0,
|
|
23
23
|
parentShift: 0,
|
|
24
24
|
showMoreLessButton: moreLessButtonStates.UNUSED,
|
|
25
|
-
onItemMoreLess: () => { }
|
|
25
|
+
onItemMoreLess: () => { },
|
|
26
26
|
};
|
|
27
27
|
onShowMore = () => {
|
|
28
28
|
const { onItemMoreLess, item } = this.props;
|
|
@@ -46,19 +46,21 @@ export default class Item extends PureComponent {
|
|
|
46
46
|
return (<Item key={item.key || item.id} item={model} title={item.title} items={item.items} level={level + 1} parentShift={parentShift} itemFormatter={itemFormatter} collapsible={item.collapsible} collapsed={item.collapsed} onCollapse={item.onCollapse} onExpand={item.onExpand} showFocus={selection.isFocused(model)} onFocus={onFocus} selection={selection} selectable={item.selectable} selected={selection.isSelected(model)} onSelect={onSelect}/>);
|
|
47
47
|
};
|
|
48
48
|
render() {
|
|
49
|
-
const { title, items, showMoreLessButton, level, parentShift, showFocus, selectable, selected, collapsible, collapsed, onCollapse, onExpand } = this.props;
|
|
49
|
+
const { title, items, showMoreLessButton, level, parentShift, showFocus, selectable, selected, collapsible, collapsed, onCollapse, onExpand, } = this.props;
|
|
50
50
|
let moreLessButton;
|
|
51
|
-
if (showMoreLessButton === moreLessButtonStates.MORE ||
|
|
52
|
-
showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
|
51
|
+
if (showMoreLessButton === moreLessButtonStates.MORE || showMoreLessButton === moreLessButtonStates.MORE_LOADING) {
|
|
53
52
|
moreLessButton = (<Text info>
|
|
54
|
-
<Link inherit pseudo onClick={this.onShowMore}>
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
<Link inherit pseudo onClick={this.onShowMore}>
|
|
54
|
+
{'Show more'}
|
|
55
|
+
</Link>
|
|
56
|
+
{showMoreLessButton === moreLessButtonStates.MORE_LOADING && (<LoaderInline className={styles.showMoreLoader}/>)}
|
|
57
57
|
</Text>);
|
|
58
58
|
}
|
|
59
59
|
else if (showMoreLessButton === moreLessButtonStates.LESS) {
|
|
60
60
|
moreLessButton = (<Text info>
|
|
61
|
-
<Link inherit pseudo onClick={this.onShowLess}>
|
|
61
|
+
<Link inherit pseudo onClick={this.onShowLess}>
|
|
62
|
+
{'Show less'}
|
|
63
|
+
</Link>
|
|
62
64
|
</Text>);
|
|
63
65
|
}
|
|
64
66
|
let collapserExpander = null;
|
|
@@ -75,15 +77,11 @@ export default class Item extends PureComponent {
|
|
|
75
77
|
return (<li>
|
|
76
78
|
<Title title={title} focused={showFocus} showFocus={showFocus} selectable={selectable} selected={selected} collapserExpander={collapserExpander} onFocus={this.onFocus} onSelect={this.onSelect} offset={offset}/>
|
|
77
79
|
|
|
78
|
-
{!itemIsEmpty
|
|
79
|
-
|
|
80
|
-
{items.map(model => this.renderItem(model, parentShift))}
|
|
80
|
+
{!itemIsEmpty ? (<ul className={styles.itemContent}>
|
|
81
|
+
{items.map(model => this.renderItem(model, parentShift))}
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
: null}
|
|
85
|
-
</ul>)
|
|
86
|
-
: null}
|
|
83
|
+
{showMoreLessButton !== moreLessButtonStates.UNUSED ? (<li className={styles.showMore}>{moreLessButton}</li>) : null}
|
|
84
|
+
</ul>) : null}
|
|
87
85
|
</li>);
|
|
88
86
|
}
|
|
89
87
|
}
|
|
@@ -29,18 +29,16 @@ export default class Selection extends TableSelection {
|
|
|
29
29
|
return result;
|
|
30
30
|
}
|
|
31
31
|
_selectDescendants(item, selected) {
|
|
32
|
-
this._getDescendants(this._getChildren(item)).
|
|
33
|
-
forEach(it => selected.add(it));
|
|
32
|
+
this._getDescendants(this._getChildren(item)).forEach(it => selected.add(it));
|
|
34
33
|
}
|
|
35
34
|
_deselectDescendants(item, selected) {
|
|
36
|
-
this._getDescendants(this._getChildren(item)).
|
|
37
|
-
forEach(it => selected.delete(it));
|
|
35
|
+
this._getDescendants(this._getChildren(item)).forEach(it => selected.delete(it));
|
|
38
36
|
}
|
|
39
37
|
_selectAncestors(item, selected) {
|
|
40
38
|
this._getAncestors(item).forEach(ancestor => {
|
|
41
|
-
const groupIsSelected = this._getChildren(ancestor)
|
|
42
|
-
filter(it => this._isItemSelectable(it))
|
|
43
|
-
every(it => selected.has(it));
|
|
39
|
+
const groupIsSelected = this._getChildren(ancestor)
|
|
40
|
+
.filter(it => this._isItemSelectable(it))
|
|
41
|
+
.every(it => selected.has(it));
|
|
44
42
|
if (groupIsSelected) {
|
|
45
43
|
selected.add(ancestor);
|
|
46
44
|
}
|
|
@@ -8,7 +8,7 @@ class Title extends PureComponent {
|
|
|
8
8
|
static defaultProps = {
|
|
9
9
|
selectable: false,
|
|
10
10
|
selected: false,
|
|
11
|
-
showFocus: false
|
|
11
|
+
showFocus: false,
|
|
12
12
|
};
|
|
13
13
|
id = getUID('data-list-title');
|
|
14
14
|
onCheckboxFocus = () => {
|
|
@@ -28,14 +28,13 @@ class Title extends PureComponent {
|
|
|
28
28
|
const classes = classNames(className, {
|
|
29
29
|
[styles.title]: true,
|
|
30
30
|
[styles.titleFocused]: showFocus,
|
|
31
|
-
[styles.titleSelected]: selected
|
|
31
|
+
[styles.titleSelected]: selected,
|
|
32
32
|
});
|
|
33
33
|
return (<div id={this.id} className={classes} style={{ paddingLeft: offset }} ref={innerRef}>
|
|
34
34
|
<div className={styles.boxes}>
|
|
35
|
-
{selectable &&
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</div>)}
|
|
35
|
+
{selectable && (<div className={styles.checkboxBox}>
|
|
36
|
+
<Checkbox aria-labelledby={this.id} className={showFocus ? 'ring-checkbox_focus' : ''} checked={selected} onFocus={this.onCheckboxFocus} onChange={this.onCheckboxChange} tabIndex={-1}/>
|
|
37
|
+
</div>)}
|
|
39
38
|
|
|
40
39
|
{collapserExpander}
|
|
41
40
|
</div>
|
|
@@ -5,7 +5,7 @@ const units = {
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
6
6
|
cellSize: unit * 3,
|
|
7
7
|
calHeight: unit * 36,
|
|
8
|
-
yearHeight: unit * 4
|
|
8
|
+
yearHeight: unit * 4,
|
|
9
9
|
/* eslint-enable */
|
|
10
10
|
};
|
|
11
11
|
export default units;
|
|
@@ -19,7 +19,7 @@ export const weekdays = {
|
|
|
19
19
|
TH: 4,
|
|
20
20
|
FR: 5,
|
|
21
21
|
SA: 6,
|
|
22
|
-
SU: 0
|
|
22
|
+
SU: 0,
|
|
23
23
|
};
|
|
24
24
|
export const MIDDLE_DAY = 15;
|
|
25
25
|
const durationToMillis = (duration) => +add(0, duration);
|
|
@@ -46,7 +46,7 @@ export default class DateInput extends React.PureComponent {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
render() {
|
|
49
|
-
const { active, divider, text, time, name, hoverDate, date, displayFormat, translations, onActivate, onClear, fromPlaceholder, toPlaceholder, timePlaceholder, locale } = this.props;
|
|
49
|
+
const { active, divider, text, time, name, hoverDate, date, displayFormat, translations, onActivate, onClear, fromPlaceholder, toPlaceholder, timePlaceholder, locale, } = this.props;
|
|
50
50
|
const { translate } = this.context;
|
|
51
51
|
let displayText = '';
|
|
52
52
|
if (active && hoverDate) {
|
|
@@ -70,9 +70,9 @@ export default class DateInput extends React.PureComponent {
|
|
|
70
70
|
case 'time':
|
|
71
71
|
return timePlaceholder || (translations?.addTime ?? translate('addTime'));
|
|
72
72
|
default:
|
|
73
|
-
return (translations?.selectName ?? translate('selectName'))
|
|
74
|
-
replace('%name%', name)
|
|
75
|
-
replace('{{name}}', name);
|
|
73
|
+
return (translations?.selectName ?? translate('selectName'))
|
|
74
|
+
.replace('%name%', name)
|
|
75
|
+
.replace('{{name}}', name);
|
|
76
76
|
}
|
|
77
77
|
})();
|
|
78
78
|
const classes = classNames(styles.filter, styles[`${name}Input`], divider && styles[`${name}InputWithDivider`], 'ring-js-shortcuts');
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
@import "../global/variables.css";
|
|
2
2
|
@import "../global/global.css";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
@
|
|
6
|
-
@value calWidth: calc(var(--ring-unit) * 37);
|
|
7
|
-
@value yearHeight: calc(var(--ring-unit) * 4);
|
|
8
|
-
@value yearWidth: calc(var(--ring-unit) * 6);
|
|
4
|
+
/* ensure styles order */
|
|
5
|
+
@import "../input/input.css";
|
|
9
6
|
|
|
10
7
|
:root {
|
|
11
8
|
/* stylelint-disable-next-line color-no-hex */
|
|
@@ -85,6 +82,12 @@
|
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
.datePopup {
|
|
85
|
+
--ring-date-picker-cell-size: calc(var(--ring-unit) * 3);
|
|
86
|
+
--ring-date-picker-cal-height: calc(var(--ring-unit) * 36);
|
|
87
|
+
--ring-date-picker-cal-width: calc(var(--ring-unit) * 37);
|
|
88
|
+
--ring-date-picker-year-height: calc(var(--ring-unit) * 4);
|
|
89
|
+
--ring-date-picker-year-width: calc(var(--ring-unit) * 6);
|
|
90
|
+
|
|
88
91
|
width: min-content;
|
|
89
92
|
|
|
90
93
|
user-select: none;
|
|
@@ -198,7 +201,7 @@
|
|
|
198
201
|
.weekday.weekday {
|
|
199
202
|
display: inline-block;
|
|
200
203
|
|
|
201
|
-
width:
|
|
204
|
+
width: var(--ring-date-picker-cell-size);
|
|
202
205
|
|
|
203
206
|
text-align: center;
|
|
204
207
|
text-transform: capitalize;
|
|
@@ -213,8 +216,8 @@
|
|
|
213
216
|
|
|
214
217
|
overflow: hidden;
|
|
215
218
|
|
|
216
|
-
width:
|
|
217
|
-
height:
|
|
219
|
+
width: var(--ring-date-picker-cal-width);
|
|
220
|
+
height: var(--ring-date-picker-cal-height);
|
|
218
221
|
|
|
219
222
|
box-shadow: 0 -1px var(--ring-line-color);
|
|
220
223
|
}
|
|
@@ -222,7 +225,7 @@
|
|
|
222
225
|
.months.months {
|
|
223
226
|
position: absolute;
|
|
224
227
|
top: 0;
|
|
225
|
-
right:
|
|
228
|
+
right: var(--ring-date-picker-year-width);
|
|
226
229
|
bottom: 0;
|
|
227
230
|
left: 0;
|
|
228
231
|
}
|
|
@@ -243,9 +246,9 @@
|
|
|
243
246
|
.month.month > * {
|
|
244
247
|
flex-shrink: 0;
|
|
245
248
|
|
|
246
|
-
height:
|
|
249
|
+
height: var(--ring-date-picker-cell-size);
|
|
247
250
|
|
|
248
|
-
line-height:
|
|
251
|
+
line-height: var(--ring-date-picker-cell-size);
|
|
249
252
|
}
|
|
250
253
|
|
|
251
254
|
.monthTitle {
|
|
@@ -275,12 +278,14 @@
|
|
|
275
278
|
.day.day {
|
|
276
279
|
position: relative;
|
|
277
280
|
|
|
278
|
-
flex-basis:
|
|
281
|
+
flex-basis: var(--ring-date-picker-cell-size);
|
|
279
282
|
|
|
280
283
|
margin: 0;
|
|
281
284
|
|
|
282
285
|
cursor: pointer;
|
|
283
|
-
transition:
|
|
286
|
+
transition:
|
|
287
|
+
background-color var(--ring-ease),
|
|
288
|
+
color var(--ring-ease);
|
|
284
289
|
text-align: center;
|
|
285
290
|
|
|
286
291
|
&::before,
|
|
@@ -511,12 +516,12 @@
|
|
|
511
516
|
|
|
512
517
|
width: 100%;
|
|
513
518
|
|
|
514
|
-
height:
|
|
519
|
+
height: var(--ring-date-picker-cell-size);
|
|
515
520
|
padding-left: calc(var(--ring-unit) * 1.5);
|
|
516
521
|
|
|
517
522
|
text-transform: capitalize;
|
|
518
523
|
|
|
519
|
-
line-height:
|
|
524
|
+
line-height: var(--ring-date-picker-cell-size);
|
|
520
525
|
}
|
|
521
526
|
|
|
522
527
|
.monthSlider {
|
|
@@ -563,7 +568,7 @@
|
|
|
563
568
|
top: 0;
|
|
564
569
|
right: 0;
|
|
565
570
|
|
|
566
|
-
width:
|
|
571
|
+
width: var(--ring-date-picker-year-width);
|
|
567
572
|
|
|
568
573
|
background-color: var(--ring-content-background-color);
|
|
569
574
|
box-shadow: -1px 0 var(--ring-line-color);
|
|
@@ -581,13 +586,13 @@
|
|
|
581
586
|
|
|
582
587
|
width: 100%;
|
|
583
588
|
|
|
584
|
-
height:
|
|
589
|
+
height: var(--ring-date-picker-year-height);
|
|
585
590
|
|
|
586
591
|
text-align: center;
|
|
587
592
|
|
|
588
593
|
color: var(--ring-secondary-color);
|
|
589
594
|
|
|
590
|
-
line-height:
|
|
595
|
+
line-height: var(--ring-date-picker-year-height);
|
|
591
596
|
}
|
|
592
597
|
|
|
593
598
|
.currentYear.currentYear {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PureComponent } from 'react';
|
|
1
|
+
import { PureComponent, ButtonHTMLAttributes } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { Locale } from 'date-fns';
|
|
4
4
|
import Popup from '../popup/popup';
|
|
@@ -28,6 +28,7 @@ export type DatePickerProps = Omit<DatePopupProps, 'translations' | 'parseDateIn
|
|
|
28
28
|
disabled?: boolean | null | undefined;
|
|
29
29
|
parseDateInput: (input: string | null | undefined) => Date | null;
|
|
30
30
|
size?: Size;
|
|
31
|
+
buttonAttributes?: Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label'>;
|
|
31
32
|
};
|
|
32
33
|
/**
|
|
33
34
|
* @name Date Picker
|
|
@@ -25,7 +25,7 @@ const PopupComponent = ({ hidden = false, className, popupRef, onClear, datePopu
|
|
|
25
25
|
Popup.PopupProps.Directions.BOTTOM_RIGHT,
|
|
26
26
|
Popup.PopupProps.Directions.BOTTOM_LEFT,
|
|
27
27
|
Popup.PopupProps.Directions.TOP_LEFT,
|
|
28
|
-
Popup.PopupProps.Directions.TOP_RIGHT
|
|
28
|
+
Popup.PopupProps.Directions.TOP_RIGHT,
|
|
29
29
|
]} {...restProps} trapFocus>
|
|
30
30
|
<DatePopup onClear={onClear} {...datePopupProps} onComplete={onComplete}/>
|
|
31
31
|
</Popup>);
|
|
@@ -66,14 +66,12 @@ export default class DatePicker extends PureComponent {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return null;
|
|
69
|
-
}
|
|
69
|
+
},
|
|
70
70
|
};
|
|
71
71
|
static contextType = I18nContext;
|
|
72
72
|
handleChange = (change) => {
|
|
73
73
|
const { onChange, withTime, applyTimeInput } = this.props;
|
|
74
|
-
const adjustedChange = withTime && !(change instanceof Date) && change?.date != null
|
|
75
|
-
? applyTimeInput(change.date, change.time)
|
|
76
|
-
: change;
|
|
74
|
+
const adjustedChange = withTime && !(change instanceof Date) && change?.date != null ? applyTimeInput(change.date, change.time) : change;
|
|
77
75
|
onChange(adjustedChange);
|
|
78
76
|
};
|
|
79
77
|
clear = () => {
|
|
@@ -109,23 +107,21 @@ export default class DatePicker extends PureComponent {
|
|
|
109
107
|
return null;
|
|
110
108
|
}
|
|
111
109
|
getAnchorText = () => {
|
|
112
|
-
const { range, datePlaceholder, dateTimePlaceholder, rangePlaceholder, withTime, displayFormat, displayMonthFormat, displayDayFormat, translations, locale } = this.props;
|
|
110
|
+
const { range, datePlaceholder, dateTimePlaceholder, rangePlaceholder, withTime, displayFormat, displayMonthFormat, displayDayFormat, translations, locale, } = this.props;
|
|
113
111
|
const { translate } = this.context;
|
|
114
112
|
const date = this.parse(this.props.date);
|
|
115
113
|
const from = this.parse(this.props.from);
|
|
116
114
|
const to = this.parse(this.props.to);
|
|
117
115
|
const time = this.formatTime();
|
|
118
116
|
if (!range && !withTime) {
|
|
119
|
-
return date
|
|
120
|
-
? displayFormat(date, locale)
|
|
121
|
-
: (datePlaceholder ?? translations?.setDate ?? translate('setDate'));
|
|
117
|
+
return date ? displayFormat(date, locale) : (datePlaceholder ?? translations?.setDate ?? translate('setDate'));
|
|
122
118
|
}
|
|
123
119
|
else if (!range && withTime) {
|
|
124
120
|
if (!date && !time) {
|
|
125
121
|
return dateTimePlaceholder ?? translations?.setDateTime ?? translate('setDateTime');
|
|
126
122
|
}
|
|
127
123
|
else {
|
|
128
|
-
return `${date && displayFormat(date, locale) || '—'}, ${time || '—'}`;
|
|
124
|
+
return `${(date && displayFormat(date, locale)) || '—'}, ${time || '—'}`;
|
|
129
125
|
}
|
|
130
126
|
}
|
|
131
127
|
else if (from && to) {
|
|
@@ -160,21 +156,19 @@ export default class DatePicker extends PureComponent {
|
|
|
160
156
|
</div>);
|
|
161
157
|
const { className, popupClassName, clear, inline, dropdownProps, translations, ...datePopupProps } = this.props;
|
|
162
158
|
const classes = classNames(styles.datePicker, className, styles[`size${this.props.size}`], {
|
|
163
|
-
[styles.inline]: inline
|
|
159
|
+
[styles.inline]: inline,
|
|
164
160
|
});
|
|
165
|
-
return (<Dropdown className={classes} disabled={this.props.disabled} data-test="ring-date-picker" anchor={inline
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
{anchorContent}
|
|
171
|
-
</Button>)} {...dropdownProps}>
|
|
161
|
+
return (<Dropdown className={classes} disabled={this.props.disabled} data-test="ring-date-picker" anchor={inline ? (<Link data-test-ring-dropdown-anchor className={styles.anchor} disabled={this.props.disabled ?? false} pseudo>
|
|
162
|
+
{this.getAnchorText()}
|
|
163
|
+
</Link>) : (<Button data-test-ring-dropdown-anchor className={styles.anchor} text={false} disabled={this.props.disabled ?? false} {...this.props.buttonAttributes}>
|
|
164
|
+
{anchorContent}
|
|
165
|
+
</Button>)} {...dropdownProps}>
|
|
172
166
|
<PopupComponent className={popupClassName} popupRef={this.popupRef} onClear={clear ? this.clear : null} datePopupProps={{
|
|
173
167
|
...datePopupProps,
|
|
174
168
|
translations,
|
|
175
169
|
onChange: this.handleChange,
|
|
176
170
|
parseDateInput: this.parse,
|
|
177
|
-
time: this.formatTime()
|
|
171
|
+
time: this.formatTime(),
|
|
178
172
|
}} onComplete={this.closePopup}/>
|
|
179
173
|
</Dropdown>);
|
|
180
174
|
}
|