@materializecss/materialize 1.2.1 → 2.0.0-alpha

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.
Files changed (91) hide show
  1. package/Gruntfile.js +68 -313
  2. package/README.md +3 -3
  3. package/dist/css/materialize.css +1019 -1824
  4. package/dist/css/materialize.min.css +3 -9
  5. package/dist/js/materialize.js +8416 -12190
  6. package/dist/js/materialize.min.js +4 -3
  7. package/dist/js/materialize.min.js.map +1 -0
  8. package/package.json +13 -9
  9. package/sass/components/_badges.scss +12 -2
  10. package/sass/components/_buttons.scss +16 -11
  11. package/sass/components/_cards.scss +14 -9
  12. package/sass/components/_carousel.scss +5 -2
  13. package/sass/components/_chips.scss +3 -3
  14. package/sass/components/_collapsible.scss +22 -8
  15. package/sass/components/_collection.scss +14 -6
  16. package/sass/components/_datepicker.scss +30 -11
  17. package/sass/components/_dropdown.scss +6 -4
  18. package/sass/components/_global.scss +132 -111
  19. package/sass/components/_grid.scss +119 -98
  20. package/sass/components/_modal.scss +3 -3
  21. package/sass/components/_navbar.scss +31 -17
  22. package/sass/components/_normalize.scss +26 -124
  23. package/sass/components/_sidenav.scss +21 -20
  24. package/sass/components/_slider.scss +36 -7
  25. package/sass/components/_table_of_contents.scss +12 -12
  26. package/sass/components/_tabs.scss +47 -16
  27. package/sass/components/_tapTarget.scss +6 -6
  28. package/sass/components/_timepicker.scss +54 -46
  29. package/sass/components/_toast.scss +3 -3
  30. package/sass/components/_tooltip.scss +4 -5
  31. package/sass/components/_typography.scss +1 -1
  32. package/sass/components/_variables.scss +185 -120
  33. package/sass/components/forms/_checkboxes.scss +9 -9
  34. package/sass/components/forms/_file-input.scss +9 -7
  35. package/sass/components/forms/_input-fields.scss +173 -234
  36. package/sass/components/forms/_radio-buttons.scss +1 -1
  37. package/sass/components/forms/_range.scss +11 -11
  38. package/sass/components/forms/_select.scss +29 -19
  39. package/sass/components/forms/_switches.scss +22 -18
  40. package/sass/materialize.scss +1 -1
  41. package/src/autocomplete.ts +459 -0
  42. package/src/bounding.ts +6 -0
  43. package/{js/buttons.js → src/buttons.ts} +103 -162
  44. package/src/cards.ts +54 -0
  45. package/{js/carousel.js → src/carousel.ts} +137 -262
  46. package/src/characterCounter.ts +88 -0
  47. package/src/chips.ts +350 -0
  48. package/src/collapsible.ts +184 -0
  49. package/{js/component.js → src/component.ts} +6 -19
  50. package/{js/datepicker.js → src/datepicker.ts} +213 -299
  51. package/{js/dropdown.js → src/dropdown.ts} +140 -254
  52. package/src/edges.ts +6 -0
  53. package/src/forms.ts +120 -0
  54. package/src/global.ts +385 -0
  55. package/src/materialbox.ts +348 -0
  56. package/src/modal.ts +256 -0
  57. package/{js/parallax.js → src/parallax.ts} +47 -60
  58. package/{js/pushpin.js → src/pushpin.ts} +19 -47
  59. package/{js/range.js → src/range.ts} +58 -139
  60. package/{js/scrollspy.js → src/scrollspy.ts} +81 -153
  61. package/src/select.ts +448 -0
  62. package/{js/sidenav.js → src/sidenav.ts} +96 -202
  63. package/src/slider.ts +415 -0
  64. package/src/tabs.ts +290 -0
  65. package/src/tapTarget.ts +240 -0
  66. package/{js/timepicker.js → src/timepicker.ts} +268 -272
  67. package/{js/toasts.js → src/toasts.ts} +75 -134
  68. package/{js/tooltip.js → src/tooltip.ts} +59 -96
  69. package/src/waves.ts +70 -0
  70. package/extras/noUiSlider/nouislider.css +0 -404
  71. package/extras/noUiSlider/nouislider.js +0 -2147
  72. package/extras/noUiSlider/nouislider.min.js +0 -1
  73. package/js/anime.min.js +0 -34
  74. package/js/autocomplete.js +0 -479
  75. package/js/cards.js +0 -40
  76. package/js/cash.js +0 -960
  77. package/js/characterCounter.js +0 -136
  78. package/js/chips.js +0 -486
  79. package/js/collapsible.js +0 -275
  80. package/js/forms.js +0 -285
  81. package/js/global.js +0 -428
  82. package/js/materialbox.js +0 -453
  83. package/js/modal.js +0 -382
  84. package/js/select.js +0 -391
  85. package/js/slider.js +0 -359
  86. package/js/tabs.js +0 -402
  87. package/js/tapTarget.js +0 -315
  88. package/js/waves.js +0 -615
  89. package/sass/_style.scss +0 -929
  90. package/sass/components/_waves.scss +0 -187
  91. package/sass/ghpages-materialize.scss +0 -7
package/src/waves.ts ADDED
@@ -0,0 +1,70 @@
1
+ type RGBColor = {
2
+ r: number,
3
+ g: number,
4
+ b: number,
5
+ }
6
+
7
+ type Position = {
8
+ x: number,
9
+ y: number,
10
+ }
11
+
12
+ export class Waves {
13
+
14
+ private static _offset(el) {
15
+ const box = el.getBoundingClientRect();
16
+ const docElem = document.documentElement;
17
+ return {
18
+ top: box.top + window.pageYOffset - docElem.clientTop,
19
+ left: box.left + window.pageXOffset - docElem.clientLeft
20
+ };
21
+ }
22
+
23
+ // https://phoenix-dx.com/css-techniques-for-material-ripple-effect/
24
+
25
+ public static renderWaveEffect(targetElement: HTMLElement, position: Position|null = null, color: RGBColor|null = null): void {
26
+ const isCentered = position === null;
27
+ const duration = 500;
28
+ let animationFrame, animationStart;
29
+ const animationStep = function(timestamp) {
30
+ if (!animationStart) {
31
+ animationStart = timestamp;
32
+ }
33
+ const frame = timestamp - animationStart;
34
+ if (frame < duration) {
35
+ const easing = (frame/duration) * (2 - (frame/duration));
36
+ const circle = isCentered ? 'circle at 50% 50%' : `circle at ${position.x}px ${position.y}px`;
37
+ const waveColor = `rgba(${color?.r || 0}, ${color?.g || 0}, ${color?.b || 0}, ${ 0.3 * (1-easing) })`;
38
+ const stop = 90 * easing + "%";
39
+ targetElement.style.backgroundImage = "radial-gradient("+circle+", "+waveColor+" "+stop+", transparent "+stop+")";
40
+ animationFrame = window.requestAnimationFrame(animationStep);
41
+ }
42
+ else {
43
+ targetElement.style.backgroundImage = 'none';
44
+ window.cancelAnimationFrame(animationFrame);
45
+ }
46
+ };
47
+ animationFrame = window.requestAnimationFrame(animationStep);
48
+ }
49
+
50
+ static Init() {
51
+ document.addEventListener("DOMContentLoaded", () => {
52
+ document.body.addEventListener('click', e => {
53
+ const trigger = <HTMLElement>e.target;
54
+ const el = <HTMLElement>trigger.closest('.waves-effect');
55
+ if (el && el.contains(trigger)) {
56
+ const isCircular = el.classList.contains('waves-circle');
57
+ const x = e.pageX - Waves._offset(el).left;
58
+ const y = e.pageY - Waves._offset(el).top;
59
+
60
+ let color = null;
61
+ if (el.classList.contains('waves-light'))
62
+ color = {r:255, g:255, b:255};
63
+
64
+ Waves.renderWaveEffect(el, isCircular ? null : {x, y}, color);
65
+ }
66
+ });
67
+ });
68
+
69
+ }
70
+ }
@@ -1,404 +0,0 @@
1
- /*!
2
- * Materialize 1.0.0 (https://materializecss.github.io/materialize)
3
- * Copyright 2014-2015 Materialize
4
- * MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE)
5
- */
6
-
7
- /*! nouislider - 9.1.0 - 2016-12-10 16:00:32 */
8
-
9
- /* Functional styling;
10
- * These styles are required for noUiSlider to function.
11
- * You don't need to change these rules to apply your design.
12
- */
13
- .noUi-target,
14
- .noUi-target * {
15
- -webkit-touch-callout: none;
16
- -webkit-tap-highlight-color: rgba(0,0,0,0);
17
- -webkit-user-select: none;
18
- -ms-touch-action: none;
19
- touch-action: none;
20
- -ms-user-select: none;
21
- -moz-user-select: none;
22
- user-select: none;
23
- -moz-box-sizing: border-box;
24
- box-sizing: border-box;
25
- }
26
- .noUi-target {
27
- position: relative;
28
- direction: ltr;
29
- }
30
- .noUi-base {
31
- width: 100%;
32
- height: 100%;
33
- position: relative;
34
- z-index: 1; /* Fix 401 */
35
- }
36
- .noUi-connect {
37
- position: absolute;
38
- right: 0;
39
- top: 0;
40
- left: 0;
41
- bottom: 0;
42
- }
43
- .noUi-origin {
44
- position: absolute;
45
- height: 0;
46
- width: 0;
47
- }
48
- .noUi-handle {
49
- position: relative;
50
- z-index: 1;
51
- }
52
- .noUi-state-tap .noUi-connect,
53
- .noUi-state-tap .noUi-origin {
54
- -webkit-transition: top 0.25s, right 0.25s, bottom 0.25s, left 0.25s;
55
- transition: top 0.25s, right 0.25s, bottom 0.25s, left 0.25s;
56
- }
57
- .noUi-state-drag * {
58
- cursor: inherit !important;
59
- }
60
-
61
- .noUi-handle-touch-area{
62
- position: relative;
63
- width: 44px;
64
- height: 44px;
65
- left: -15px;
66
- top: -15px;
67
- }
68
-
69
- /* Painting and performance;
70
- * Browsers can paint handles in their own layer.
71
- */
72
- .noUi-base,
73
- .noUi-handle {
74
- -webkit-transform: translate3d(0,0,0);
75
- transform: translate3d(0,0,0);
76
- }
77
-
78
- /* Slider size and handle placement;
79
- */
80
- .noUi-horizontal {
81
- height: 18px;
82
- }
83
- .noUi-horizontal .noUi-handle {
84
- width: 34px;
85
- height: 28px;
86
- left: -17px;
87
- top: -6px;
88
- }
89
- .noUi-vertical {
90
- width: 18px;
91
- }
92
- .noUi-vertical .noUi-handle {
93
- width: 28px;
94
- height: 34px;
95
- left: -6px;
96
- top: -17px;
97
- }
98
-
99
- /* Styling;
100
- */
101
- .noUi-target {
102
- background: #cdcdcd;
103
- border-radius: 4px;
104
- border: 1px solid transparent;
105
- }
106
- .noUi-connect {
107
- background: #26A69A;
108
- -webkit-transition: background 450ms;
109
- transition: background 450ms;
110
- }
111
-
112
- /* Handles and cursors;
113
- */
114
- .noUi-draggable {
115
- cursor: ew-resize;
116
- }
117
- .noUi-vertical .noUi-draggable {
118
- cursor: ns-resize;
119
- }
120
- .noUi-handle {
121
- border: 1px solid #D9D9D9;
122
- border-radius: 3px;
123
- background: #FFF;
124
- cursor: default;
125
- box-shadow: inset 0 0 1px #FFF,
126
- inset 0 1px 7px #EBEBEB,
127
- 0 3px 6px -3px #BBB;
128
- }
129
- .noUi-active {
130
- box-shadow: inset 0 0 1px #FFF,
131
- inset 0 1px 7px #DDD,
132
- 0 3px 6px -3px #BBB;
133
- }
134
-
135
- /* Handle stripes
136
- */
137
- .noUi-handle:before,
138
- .noUi-handle:after {
139
- content: "";
140
- display: block;
141
- position: absolute;
142
- height: 14px;
143
- width: 1px;
144
- background: #E8E7E6;
145
- left: 14px;
146
- top: 6px;
147
- }
148
- .noUi-handle:after {
149
- left: 17px;
150
- }
151
- .noUi-vertical .noUi-handle:before,
152
- .noUi-vertical .noUi-handle:after {
153
- width: 14px;
154
- height: 1px;
155
- left: 6px;
156
- top: 14px;
157
- }
158
- .noUi-vertical .noUi-handle:after {
159
- top: 17px;
160
- }
161
-
162
- /* Disabled state;
163
- */
164
- [disabled] .noUi-connect {
165
- background: #B8B8B8;
166
- }
167
- [disabled].noUi-target,
168
- [disabled].noUi-handle,
169
- [disabled] .noUi-handle {
170
- cursor: not-allowed;
171
- }
172
-
173
-
174
- /* Base;
175
- *
176
- */
177
- .noUi-pips,
178
- .noUi-pips * {
179
- -moz-box-sizing: border-box;
180
- box-sizing: border-box;
181
- }
182
- .noUi-pips {
183
- position: absolute;
184
- color: #999;
185
- }
186
-
187
- /* Values;
188
- *
189
- */
190
- .noUi-value {
191
- position: absolute;
192
- text-align: center;
193
- }
194
- .noUi-value-sub {
195
- color: #ccc;
196
- font-size: 10px;
197
- }
198
-
199
- /* Markings;
200
- *
201
- */
202
- .noUi-marker {
203
- position: absolute;
204
- background: #CCC;
205
- }
206
- .noUi-marker-sub {
207
- background: #AAA;
208
- }
209
- .noUi-marker-large {
210
- background: #AAA;
211
- }
212
-
213
- /* Horizontal layout;
214
- *
215
- */
216
- .noUi-pips-horizontal {
217
- padding: 10px 0;
218
- height: 80px;
219
- top: 100%;
220
- left: 0;
221
- width: 100%;
222
- }
223
- .noUi-value-horizontal {
224
- -webkit-transform: translate3d(-50%,50%,0);
225
- transform: translate3d(-50%,50%,0);
226
- }
227
-
228
- .noUi-marker-horizontal.noUi-marker {
229
- margin-left: -1px;
230
- width: 2px;
231
- height: 5px;
232
- }
233
- .noUi-marker-horizontal.noUi-marker-sub {
234
- height: 10px;
235
- }
236
- .noUi-marker-horizontal.noUi-marker-large {
237
- height: 15px;
238
- }
239
-
240
- /* Vertical layout;
241
- *
242
- */
243
- .noUi-pips-vertical {
244
- padding: 0 10px;
245
- height: 100%;
246
- top: 0;
247
- left: 100%;
248
- }
249
- .noUi-value-vertical {
250
- -webkit-transform: translate3d(0,50%,0);
251
- transform: translate3d(0,50%,0);
252
- padding-left: 25px;
253
- }
254
-
255
- .noUi-marker-vertical.noUi-marker {
256
- width: 5px;
257
- height: 2px;
258
- margin-top: -1px;
259
- }
260
- .noUi-marker-vertical.noUi-marker-sub {
261
- width: 10px;
262
- }
263
- .noUi-marker-vertical.noUi-marker-large {
264
- width: 15px;
265
- }
266
-
267
- .noUi-tooltip {
268
- display: block;
269
- position: absolute;
270
- border: 1px solid transparent;
271
- border-radius: 3px;
272
- background: #fff;
273
- color: #000;
274
- padding: 5px;
275
- text-align: center;
276
- }
277
- .noUi-horizontal .noUi-tooltip {
278
- -webkit-transform: translate(-50%, 0);
279
- transform: translate(-50%, 0);
280
- left: 50%;
281
- bottom: 120%;
282
- }
283
- .noUi-vertical .noUi-tooltip {
284
- -webkit-transform: translate(0, -50%);
285
- transform: translate(0, -50%);
286
- top: 50%;
287
- right: 120%;
288
- }
289
-
290
- /* Materialize Styles */
291
- .noUi-target {
292
- border: 0;
293
- border-radius: 0;
294
- }
295
- .noUi-horizontal {
296
- height: 3px;
297
- }
298
-
299
- .noUi-vertical {
300
- height: 100%;
301
- width: 3px;
302
- }
303
-
304
- .noUi-horizontal .noUi-handle,
305
- .noUi-vertical .noUi-handle {
306
- width: 15px;
307
- height: 15px;
308
- border-radius: 50%;
309
- box-shadow: none;
310
- background-color: #26A69A;
311
- border: none;
312
- left: -5px;
313
- top: -6px;
314
- transition: width .2s cubic-bezier(0.215, 0.610, 0.355, 1.000),
315
- height .2s cubic-bezier(0.215, 0.610, 0.355, 1.000),
316
- left .2s cubic-bezier(0.215, 0.610, 0.355, 1.000),
317
- top .2s cubic-bezier(0.215, 0.610, 0.355, 1.000);
318
- }
319
- .noUi-handle:before {
320
- content: none;
321
- }
322
- .noUi-handle:after {
323
- content: none;
324
- }
325
-
326
- .noUi-target .noUi-active.noUi-handle {
327
- width: 3px;
328
- height: 3px;
329
- left: 0;
330
- top: 0;
331
- }
332
-
333
- .noUi-target.noUi-horizontal .noUi-tooltip {
334
- position: absolute;
335
- height: 30px;
336
- width: 30px;
337
- top: -17px;
338
- left: -2px;
339
- background-color: #26A69A;
340
- border-radius: 50%;
341
- transition: border-radius .25s cubic-bezier(0.215, 0.610, 0.355, 1.000),
342
- transform .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);
343
- transform: scale(.5) rotate(-45deg);
344
- transform-origin: 50% 100%;
345
- }
346
- .noUi-target.noUi-horizontal .noUi-active .noUi-tooltip {
347
- border-radius: 15px 15px 15px 0;
348
- transform: rotate(-45deg) translate(23px, -25px);
349
- }
350
-
351
- .noUi-tooltip span {
352
- width: 100%;
353
- text-align: center;
354
- color: #fff;
355
- font-size: 12px;
356
- opacity: 0;
357
- position: absolute;
358
- top: 6px;
359
- left: -1px;
360
- transition: opacity .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);
361
- }
362
-
363
- .noUi-horizontal .noUi-tooltip span {
364
- transform: rotate(45deg);
365
- }
366
-
367
- .noUi-vertical .noUi-tooltip span {
368
- transform: rotate(135deg);
369
- }
370
-
371
- .noUi-target.noUi-vertical .noUi-tooltip {
372
- position: absolute;
373
- height: 30px;
374
- width: 30px;
375
- top: -17px;
376
- left: -2px;
377
- background-color: #26A69A;
378
- border-radius: 50%;
379
- transition: border-radius .25s cubic-bezier(0.215, 0.610, 0.355, 1.000),
380
- transform .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);
381
- transform: scale(.5) rotate(-45deg);
382
- transform-origin: 50% 100%;
383
- }
384
- .noUi-target.noUi-vertical .noUi-active .noUi-tooltip {
385
- border-radius: 15px 15px 15px 0;
386
- transform: rotate(-135deg) translate(35px, -10px);
387
- }
388
- .noUi-vertical .noUi-tooltip span {
389
- width: 100%;
390
- text-align: center;
391
- color: #fff;
392
- font-size: 12px;
393
- transform: rotate(135deg);
394
- opacity: 0;
395
- position: absolute;
396
- top: 7px;
397
- left: -1px;
398
- transition: opacity .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);
399
- }
400
-
401
- .noUi-horizontal .noUi-active .noUi-tooltip span,
402
- .noUi-vertical .noUi-active .noUi-tooltip span {
403
- opacity: 1;
404
- }