react-ui-basics 0.0.175 → 0.0.176
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/Animated.js.map +1 -1
- package/AutocompleteSelect.js.map +1 -1
- package/Button.js.map +1 -1
- package/Checkbox.js.map +1 -1
- package/CircleProgress.js.map +1 -1
- package/CommonFields.js.map +1 -1
- package/DNDContainer.js.map +1 -1
- package/DNDDraggable.js.map +1 -1
- package/DNDDroppable.js.map +1 -1
- package/Dialog.js.map +1 -1
- package/DropFileInput.js.map +1 -1
- package/DroppableHorizontalList.js.map +1 -1
- package/DroppableList.js.map +1 -1
- package/Dropzone.js.map +1 -1
- package/FilteredList.js.map +1 -1
- package/FloatingActionButton.js.map +1 -1
- package/FormUploadProgress.js.map +1 -1
- package/ImageGallery.js.map +1 -1
- package/MaterialIcon.js.map +1 -1
- package/Modal.js.map +1 -1
- package/ModalMenu.js.map +1 -1
- package/ReactConstants.js.map +1 -1
- package/ReactCreateElement.js.map +1 -1
- package/ReadyListener.js.map +1 -1
- package/Scrollable.js.map +1 -1
- package/ScrollableTable.js.map +1 -1
- package/Size.js.map +1 -1
- package/Snackbar.js.map +1 -1
- package/SpinningProgress.js.map +1 -1
- package/Switch.js.map +1 -1
- package/Table.js.map +1 -1
- package/TextField.js.map +1 -1
- package/Tools.d.ts +2 -2
- package/Tools.js.map +1 -1
- package/bundle.css +596 -596
- package/package.json +1 -1
- package/router/HistoryTools.js.map +1 -1
- package/router/Link.js.map +1 -1
- package/router/NavLink.js.map +1 -1
- package/router/Route.js.map +1 -1
- package/router/index.js.map +1 -1
- package/src/Animated.css +7 -0
- package/src/Animated.js +219 -0
- package/src/Animated.scss +8 -0
- package/src/AutocompleteSelect.css +256 -0
- package/src/AutocompleteSelect.js +473 -0
- package/src/AutocompleteSelect.scss +322 -0
- package/src/Button.css +138 -0
- package/src/Button.js +104 -0
- package/src/Button.scss +177 -0
- package/src/Checkbox.css +56 -0
- package/src/Checkbox.js +52 -0
- package/src/Checkbox.scss +87 -0
- package/src/CircleProgress.css +11 -0
- package/src/CircleProgress.js +38 -0
- package/src/CircleProgress.scss +13 -0
- package/src/CommonFields.js +21 -0
- package/src/DNDContainer.css +26 -0
- package/src/DNDContainer.js +263 -0
- package/src/DNDContainer.scss +33 -0
- package/src/DNDDraggable.js +55 -0
- package/src/DNDDroppable.js +58 -0
- package/src/Dialog.css +36 -0
- package/src/Dialog.js +160 -0
- package/src/Dialog.scss +42 -0
- package/src/DropFileInput.css +24 -0
- package/src/DropFileInput.js +45 -0
- package/src/DropFileInput.scss +28 -0
- package/src/DroppableHorizontalList.js +190 -0
- package/src/DroppableList.css +14 -0
- package/src/DroppableList.js +201 -0
- package/src/DroppableList.scss +27 -0
- package/src/Dropzone.css +54 -0
- package/src/Dropzone.js +140 -0
- package/src/Dropzone.scss +66 -0
- package/src/FilteredList.css +68 -0
- package/src/FilteredList.js +196 -0
- package/src/FilteredList.scss +86 -0
- package/src/FloatingActionButton.css +20 -0
- package/src/FloatingActionButton.js +35 -0
- package/src/FloatingActionButton.scss +25 -0
- package/src/FormUploadProgress.css +61 -0
- package/src/FormUploadProgress.js +87 -0
- package/src/FormUploadProgress.scss +78 -0
- package/src/ImageGallery.css +196 -0
- package/src/ImageGallery.js +935 -0
- package/src/ImageGallery.scss +256 -0
- package/src/MaterialIcon.js +1837 -0
- package/src/Modal.css +61 -0
- package/src/Modal.js +160 -0
- package/src/Modal.scss +73 -0
- package/src/ModalMenu.css +30 -0
- package/src/ModalMenu.js +59 -0
- package/src/ModalMenu.scss +36 -0
- package/src/ReactConstants.ts +42 -0
- package/src/ReactCreateElement.js +5 -0
- package/src/ReadyListener.js +53 -0
- package/src/ResizeObserver.ts +50 -0
- package/src/Scrollable.css +80 -0
- package/src/Scrollable.js +388 -0
- package/src/Scrollable.scss +100 -0
- package/src/ScrollableTable.css +6 -0
- package/src/ScrollableTable.scss +12 -0
- package/src/ScrollableTable.tsx +39 -0
- package/src/Size.js +56 -0
- package/src/Snackbar.css +40 -0
- package/src/Snackbar.js +71 -0
- package/src/Snackbar.scss +47 -0
- package/src/SpinningProgress.css +49 -0
- package/src/SpinningProgress.js +19 -0
- package/src/SpinningProgress.scss +57 -0
- package/src/Switch.css +69 -0
- package/src/Switch.js +54 -0
- package/src/Switch.scss +73 -0
- package/src/Table.css +94 -0
- package/src/Table.scss +121 -0
- package/src/Table.tsx +360 -0
- package/src/TextField.css +122 -0
- package/src/TextField.js +162 -0
- package/src/TextField.scss +160 -0
- package/src/Tools.test.js +105 -0
- package/src/Tools.ts +231 -0
- package/src/global.css +1 -0
- package/src/global.scss +6 -0
- package/src/index.js +78 -0
- package/src/router/HistoryTools.js +32 -0
- package/src/router/Link.js +27 -0
- package/src/router/NavLink.js +25 -0
- package/src/router/README.md +55 -0
- package/src/router/Route.js +209 -0
- package/src/router/Route.test.js +139 -0
- package/src/router/index.js +14 -0
- package/src/store/ProxyTools.js +91 -0
- package/src/store/ProxyTools.test.js +97 -0
- package/src/store/Store.ts +91 -0
- package/store/ProxyTools.js.map +1 -1
- package/store/Store.js.map +1 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
@import "./global.scss";
|
|
2
|
+
|
|
3
|
+
.AutocompleteSelect {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
flex-flow: column;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
position: relative;
|
|
8
|
+
min-width: 250px;
|
|
9
|
+
min-height: 36px;
|
|
10
|
+
user-select: none;
|
|
11
|
+
|
|
12
|
+
@keyframes clockwise {
|
|
13
|
+
0% {
|
|
14
|
+
-webkit-transform: rotate(-90deg);
|
|
15
|
+
}
|
|
16
|
+
100% {
|
|
17
|
+
-webkit-transform: translateX(0px);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@keyframes anticlockwise {
|
|
22
|
+
0% {
|
|
23
|
+
-webkit-transform: rotate(90deg);
|
|
24
|
+
}
|
|
25
|
+
100% {
|
|
26
|
+
-webkit-transform: translateX(0px);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
> .input {
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.multi > .input {
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.Scrollable {
|
|
38
|
+
padding-right: 0;
|
|
39
|
+
min-width: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.inline-multiple {
|
|
43
|
+
> .label {
|
|
44
|
+
top: -12px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
> .selected {
|
|
48
|
+
flex-flow: row wrap;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.multiple-mini-inline {
|
|
53
|
+
height: 42px;
|
|
54
|
+
|
|
55
|
+
> .label {
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
width: 100%;
|
|
58
|
+
margin-left: -10px;
|
|
59
|
+
padding: 10px;
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
top: 0;
|
|
62
|
+
|
|
63
|
+
&.active {
|
|
64
|
+
padding: 0 10px;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
> .selected {
|
|
69
|
+
width: 250px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
> .input {
|
|
73
|
+
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: 38px;
|
|
76
|
+
z-index: 2;
|
|
77
|
+
background-color: white;
|
|
78
|
+
min-width: 130%;
|
|
79
|
+
|
|
80
|
+
.TextField {
|
|
81
|
+
padding-left: 10px;
|
|
82
|
+
padding-right: 10px;
|
|
83
|
+
width: 100%;
|
|
84
|
+
box-sizing: border-box;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&.hidden {
|
|
88
|
+
opacity: 0;
|
|
89
|
+
visibility: hidden;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.FilteredList {
|
|
94
|
+
.child {
|
|
95
|
+
&:first-child {
|
|
96
|
+
margin-top: 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.TextField {
|
|
103
|
+
margin-top: 8px;
|
|
104
|
+
|
|
105
|
+
input {
|
|
106
|
+
font-size: $fontSizeInput;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
> .label {
|
|
111
|
+
position: absolute;
|
|
112
|
+
transition: all 0.2s ease;
|
|
113
|
+
font-family: $font;
|
|
114
|
+
font-size: $fontSizeInput;
|
|
115
|
+
color: rgba(0, 0, 0, .5);
|
|
116
|
+
z-index: 1;
|
|
117
|
+
cursor: text;
|
|
118
|
+
user-select: none;
|
|
119
|
+
left: 4px;
|
|
120
|
+
top: 12px;
|
|
121
|
+
|
|
122
|
+
&.active {
|
|
123
|
+
font-size: 10px;
|
|
124
|
+
top: 2px;
|
|
125
|
+
|
|
126
|
+
.arrow {
|
|
127
|
+
border-width: 4px 4px 0 4px;
|
|
128
|
+
margin-bottom: 1px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.arrow {
|
|
133
|
+
width: 0;
|
|
134
|
+
height: 0;
|
|
135
|
+
border-style: solid;
|
|
136
|
+
border-width: 5px 5px 0 5px;
|
|
137
|
+
border-color: rgba(0, 0, 0, .5) transparent transparent transparent;
|
|
138
|
+
display: inline-block;
|
|
139
|
+
margin-left: 5px;
|
|
140
|
+
margin-bottom: 2px;
|
|
141
|
+
transition: all 0.2s ease;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
> .selected {
|
|
146
|
+
margin-top: 8px;
|
|
147
|
+
display: flex;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
|
|
150
|
+
> .reset {
|
|
151
|
+
min-width: 36px;
|
|
152
|
+
max-width: 36px;
|
|
153
|
+
|
|
154
|
+
position: absolute;
|
|
155
|
+
right: 0;
|
|
156
|
+
top: 0;
|
|
157
|
+
background-color: white;
|
|
158
|
+
|
|
159
|
+
.material-icons {
|
|
160
|
+
margin: 0;
|
|
161
|
+
color: #BFBFBF;
|
|
162
|
+
font-size: 20px;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&.nolabel {
|
|
167
|
+
margin-top: 0px;
|
|
168
|
+
border-bottom: 1px solid #e5e3e3;
|
|
169
|
+
|
|
170
|
+
.DummyChild {
|
|
171
|
+
display: inline-flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
flex-grow: 1;
|
|
174
|
+
font-size: 16px;
|
|
175
|
+
margin: 0px 10px;;
|
|
176
|
+
margin-bottom: 5px;
|
|
177
|
+
height: 19px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.arrow {
|
|
181
|
+
width: 0;
|
|
182
|
+
height: 0;
|
|
183
|
+
border-style: solid;
|
|
184
|
+
border-width: 5px 5px 0 5px;
|
|
185
|
+
border-color: rgba(0, 0, 0, .5) transparent transparent transparent;
|
|
186
|
+
display: inline-block;
|
|
187
|
+
transition: all 0.2s ease;
|
|
188
|
+
margin: 0px 17px 3px 5px;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&.inline {
|
|
193
|
+
font-size: $fontSizeInput;
|
|
194
|
+
font-family: $font;
|
|
195
|
+
color: $colorInput;
|
|
196
|
+
text-overflow: ellipsis;
|
|
197
|
+
white-space: nowrap;
|
|
198
|
+
overflow: hidden;
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&.clickable {
|
|
204
|
+
overflow: hidden;
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
|
|
207
|
+
padding: 10px;
|
|
208
|
+
margin-left: -10px;
|
|
209
|
+
margin-right: -10px;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&.inlineSelected {
|
|
214
|
+
flex-flow: row wrap;
|
|
215
|
+
justify-content: flex-start;
|
|
216
|
+
|
|
217
|
+
&.hasSelected {
|
|
218
|
+
padding-top: 7px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
> .label {
|
|
222
|
+
width: 100%;
|
|
223
|
+
height: 100%;
|
|
224
|
+
|
|
225
|
+
&.active {
|
|
226
|
+
z-index: 0;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
.input {
|
|
232
|
+
width: unset;
|
|
233
|
+
flex-basis: 50px;
|
|
234
|
+
flex-grow: 1;
|
|
235
|
+
|
|
236
|
+
&::after {
|
|
237
|
+
content: attr(data-value);
|
|
238
|
+
visibility: hidden;
|
|
239
|
+
white-space: pre;
|
|
240
|
+
font: inherit;
|
|
241
|
+
min-width: 2px;
|
|
242
|
+
border: 0;
|
|
243
|
+
margin: 0;
|
|
244
|
+
outline: 0;
|
|
245
|
+
float: left;
|
|
246
|
+
display: inline-block;
|
|
247
|
+
margin-top: -24px;
|
|
248
|
+
font-size: 14px;
|
|
249
|
+
padding: 2px;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
> .value:nth-child(2) {
|
|
254
|
+
margin-top: 7px;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
.selected.full {
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&.inlineSelected > .value, > .selected > .value {
|
|
263
|
+
cursor: pointer;
|
|
264
|
+
margin: 5px 10px 5px 0px;
|
|
265
|
+
display: inline-flex;
|
|
266
|
+
flex-flow: row wrap;
|
|
267
|
+
height: 30px;
|
|
268
|
+
align-items: center;
|
|
269
|
+
|
|
270
|
+
background-color: #f0f0f0;
|
|
271
|
+
border-radius: 30px;
|
|
272
|
+
position: relative;
|
|
273
|
+
|
|
274
|
+
font-family: $font;
|
|
275
|
+
font-size: $fontSizeInput;
|
|
276
|
+
color: $colorInput;
|
|
277
|
+
|
|
278
|
+
.DummyChild {
|
|
279
|
+
padding-left: 35px;
|
|
280
|
+
padding-right: 10px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.button {
|
|
284
|
+
cursor: pointer;
|
|
285
|
+
min-width: 30px;
|
|
286
|
+
width: 30px;
|
|
287
|
+
height: 30px;
|
|
288
|
+
opacity: 0;
|
|
289
|
+
position: absolute;
|
|
290
|
+
top: 0px;
|
|
291
|
+
left: 0px;
|
|
292
|
+
transition: opacity 0.2s cubic-bezier(.4, 0, .2, 1);
|
|
293
|
+
background-color: deepskyblue;
|
|
294
|
+
color: white;
|
|
295
|
+
border-radius: 30px;
|
|
296
|
+
|
|
297
|
+
display: flex;
|
|
298
|
+
flex-flow: row;
|
|
299
|
+
justify-content: center;
|
|
300
|
+
align-items: center;
|
|
301
|
+
|
|
302
|
+
animation: anticlockwise 0.15s linear;
|
|
303
|
+
|
|
304
|
+
.material-icons {
|
|
305
|
+
font-size: 22px;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
&:hover {
|
|
310
|
+
.button {
|
|
311
|
+
width: 30px;
|
|
312
|
+
height: 30px;
|
|
313
|
+
opacity: 1;
|
|
314
|
+
|
|
315
|
+
animation: clockwise 0.15s linear;
|
|
316
|
+
overflow: hidden;
|
|
317
|
+
position: absolute;
|
|
318
|
+
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
package/src/Button.css
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
.Button {
|
|
2
|
+
position: relative;
|
|
3
|
+
min-width: 64px;
|
|
4
|
+
min-height: 36px;
|
|
5
|
+
height: 24px;
|
|
6
|
+
margin: 0px;
|
|
7
|
+
padding: 0px 16px;
|
|
8
|
+
border: none;
|
|
9
|
+
outline: none;
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
letter-spacing: 1.25px;
|
|
13
|
+
background: #dfdfdf;
|
|
14
|
+
text-transform: uppercase;
|
|
15
|
+
font-family: Roboto, sans-serif;
|
|
16
|
+
-webkit-tap-highlight-color: transparent;
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
align-items: center;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
user-select: none;
|
|
23
|
+
border-radius: 3px;
|
|
24
|
+
transition: all 0.2s ease;
|
|
25
|
+
}
|
|
26
|
+
.Button.flat {
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
.Button.flat:hover {
|
|
30
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
31
|
+
}
|
|
32
|
+
.Button.green {
|
|
33
|
+
background-color: #43a047;
|
|
34
|
+
color: white;
|
|
35
|
+
}
|
|
36
|
+
.Button.green:hover {
|
|
37
|
+
background-color: #3b8e3f;
|
|
38
|
+
}
|
|
39
|
+
.Button.blue {
|
|
40
|
+
background-color: #039be5;
|
|
41
|
+
color: white;
|
|
42
|
+
}
|
|
43
|
+
.Button.blue:hover {
|
|
44
|
+
background-color: #038acc;
|
|
45
|
+
}
|
|
46
|
+
.Button.red {
|
|
47
|
+
background-color: #e53935;
|
|
48
|
+
color: white;
|
|
49
|
+
}
|
|
50
|
+
.Button.red:hover {
|
|
51
|
+
background-color: #e2231e;
|
|
52
|
+
}
|
|
53
|
+
.Button.black {
|
|
54
|
+
background-color: #1e252d;
|
|
55
|
+
color: white;
|
|
56
|
+
}
|
|
57
|
+
.Button.black:hover {
|
|
58
|
+
background-color: #14181e;
|
|
59
|
+
}
|
|
60
|
+
.Button.gray {
|
|
61
|
+
background: #D9D9D9;
|
|
62
|
+
color: #999999;
|
|
63
|
+
}
|
|
64
|
+
.Button.gray:hover {
|
|
65
|
+
background-color: #cccccc;
|
|
66
|
+
}
|
|
67
|
+
.Button.small {
|
|
68
|
+
padding: 0px 8px;
|
|
69
|
+
min-height: 16px;
|
|
70
|
+
min-width: 16px;
|
|
71
|
+
}
|
|
72
|
+
.Button > .material-icons {
|
|
73
|
+
margin-right: 10px;
|
|
74
|
+
}
|
|
75
|
+
.Button.round {
|
|
76
|
+
padding: 0px;
|
|
77
|
+
min-width: 36px;
|
|
78
|
+
border-radius: 50%;
|
|
79
|
+
}
|
|
80
|
+
.Button.round > .material-icons {
|
|
81
|
+
margin: 0px;
|
|
82
|
+
}
|
|
83
|
+
.Button .ripple {
|
|
84
|
+
position: absolute;
|
|
85
|
+
background: rgba(0, 0, 0, 0.1);
|
|
86
|
+
border-radius: 100%;
|
|
87
|
+
transform: scale(0);
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
transition: opacity 0.2s ease-out;
|
|
90
|
+
}
|
|
91
|
+
.Button .ripple.show {
|
|
92
|
+
animation: ripple 0.35s ease-out;
|
|
93
|
+
}
|
|
94
|
+
.Button:active .ripple.showed {
|
|
95
|
+
opacity: 1;
|
|
96
|
+
}
|
|
97
|
+
.Button:focus .ripple.focused {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
transition: opacity 0.2s ease-out, transform 0.2s ease-out;
|
|
100
|
+
transform: scale(1);
|
|
101
|
+
animation: resize 1.25s ease-out infinite;
|
|
102
|
+
animation-delay: 0.2s;
|
|
103
|
+
animation-direction: alternate;
|
|
104
|
+
}
|
|
105
|
+
.Button .ripple.showed {
|
|
106
|
+
transform: scale(2);
|
|
107
|
+
opacity: 0;
|
|
108
|
+
}
|
|
109
|
+
@keyframes ripple {
|
|
110
|
+
to {
|
|
111
|
+
transform: scale(2);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
@keyframes resize {
|
|
115
|
+
to {
|
|
116
|
+
transform: scale(0.9);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
.Button.raised {
|
|
120
|
+
transition: color 0.2s ease-out, background-color 0.2s ease-out, box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
121
|
+
}
|
|
122
|
+
.Button.raised:hover {
|
|
123
|
+
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.25);
|
|
124
|
+
}
|
|
125
|
+
.Button.raised:active {
|
|
126
|
+
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.35);
|
|
127
|
+
}
|
|
128
|
+
.Button.disabled {
|
|
129
|
+
box-shadow: none;
|
|
130
|
+
background: #D9D9D9;
|
|
131
|
+
color: #999999;
|
|
132
|
+
}
|
|
133
|
+
.Button.disabled:hover {
|
|
134
|
+
background-color: #cccccc;
|
|
135
|
+
}
|
|
136
|
+
.Button::-moz-focus-inner {
|
|
137
|
+
border: 0;
|
|
138
|
+
}
|
package/src/Button.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import ReactConstants from "./../ReactConstants";
|
|
2
|
+
import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./../CommonFields";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import {toConsumableArray as __toConsumableArray} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
5
|
+
import {extends as __extends} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
6
|
+
import {inherits as __inherits} from "./../_virtual/_rollupPluginBabelHelpers";
|
|
7
|
+
import './Button.css';
|
|
8
|
+
import ReactCreateElement from './ReactCreateElement';
|
|
9
|
+
import './Button.css'
|
|
10
|
+
import {classNames, DOCUMENT, addEventListener, createRef, orNoop} from "./Tools";
|
|
11
|
+
import PropTypes from "prop-types";
|
|
12
|
+
import {PureComponent, render, stateGS, props} from "./ReactConstants";
|
|
13
|
+
|
|
14
|
+
class Button extends PureComponent {
|
|
15
|
+
constructor(properties) {
|
|
16
|
+
super(properties);
|
|
17
|
+
|
|
18
|
+
const that = this;
|
|
19
|
+
const el = createRef();
|
|
20
|
+
const ripple = createRef();
|
|
21
|
+
|
|
22
|
+
const rippleClassName = stateGS(that);
|
|
23
|
+
|
|
24
|
+
const onMouseDown = (e) => {
|
|
25
|
+
if (!props(that).withRipple) return;
|
|
26
|
+
|
|
27
|
+
const rect = el().getBoundingClientRect();
|
|
28
|
+
const rippleElement = ripple();
|
|
29
|
+
const style = __style(rippleElement);
|
|
30
|
+
const body = DOCUMENT.body;
|
|
31
|
+
|
|
32
|
+
style.height = style.width = Math.max(__width(rect), __height(rect)) + 'px';
|
|
33
|
+
style.top = (__pageY(e) - __top(rect) - rippleElement.offsetHeight / 2 - __scrollTop(body)) + 'px';
|
|
34
|
+
style.left = (__pageX(e) - __left(rect) - rippleElement.offsetWidth / 2 - __scrollLeft(body)) + 'px';
|
|
35
|
+
|
|
36
|
+
rippleClassName('show');
|
|
37
|
+
|
|
38
|
+
addEventListener(rippleElement, 'animationend', () => {
|
|
39
|
+
rippleClassName('showed');
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const onFocus = e => {
|
|
44
|
+
orNoop(props(that).onFocus)(e)
|
|
45
|
+
if (rippleClassName() === 'show')
|
|
46
|
+
return
|
|
47
|
+
|
|
48
|
+
const rect = el().getBoundingClientRect();
|
|
49
|
+
const style = __style(ripple());
|
|
50
|
+
|
|
51
|
+
let size = Math.max(__width(rect), __height(rect)) * 0.8
|
|
52
|
+
style.height = style.width = size + 'px';
|
|
53
|
+
style.top = (__height(rect) / 2 - size / 2) + 'px';
|
|
54
|
+
style.left = (__width(rect) / 2 - size / 2) + 'px';
|
|
55
|
+
|
|
56
|
+
rippleClassName('focused');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
that[ReactConstants[3]] = () => {
|
|
60
|
+
const {children, type, className, onClick, flat, raised = !flat, round, style, disabled} = props(that);
|
|
61
|
+
return (
|
|
62
|
+
<button className={classNames('Button',
|
|
63
|
+
className,
|
|
64
|
+
disabled && 'disabled',
|
|
65
|
+
raised && 'raised',
|
|
66
|
+
flat && 'flat',
|
|
67
|
+
round && 'round')
|
|
68
|
+
}
|
|
69
|
+
onFocus={onFocus}
|
|
70
|
+
disabled={disabled}
|
|
71
|
+
style={style}
|
|
72
|
+
type={type}
|
|
73
|
+
onClick={onClick}
|
|
74
|
+
onMouseDown={onMouseDown}
|
|
75
|
+
ref={el}>
|
|
76
|
+
{children}
|
|
77
|
+
<span className={classNames(`ripple`, rippleClassName())} ref={ripple}/>
|
|
78
|
+
</button>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
85
|
+
Button.propTypes = {
|
|
86
|
+
flat: PropTypes.bool,
|
|
87
|
+
raised: PropTypes.bool,
|
|
88
|
+
round: PropTypes.bool,
|
|
89
|
+
disabled: PropTypes.bool,
|
|
90
|
+
withRipple: PropTypes.bool,
|
|
91
|
+
type: PropTypes.oneOf(['button', 'submit', 'reset']),
|
|
92
|
+
[ReactConstants[5]]: PropTypes.string,
|
|
93
|
+
[ReactConstants[6]]: PropTypes.func,
|
|
94
|
+
onFocus: PropTypes.func,
|
|
95
|
+
style: PropTypes.object,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
Button.defaultProps = {
|
|
100
|
+
type: 'button',
|
|
101
|
+
withRipple: true,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export default Button;
|