kmaterialize 2.0.0 → 2.3.3-1.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.
Files changed (150) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +55 -91
  3. package/components/appbar/_navbar.old.scss +223 -0
  4. package/components/appbar/appbar.css +235 -0
  5. package/components/appbar/appbar.mjs +54 -0
  6. package/components/appbar/appbar.test.mjs +9 -0
  7. package/components/atomic/atomic.mjs +19 -0
  8. package/components/atomic/component.mjs +67 -0
  9. package/components/badge/_badges.scss +75 -0
  10. package/components/badge/badge.mjs +11 -0
  11. package/components/breadcrumb/_breadcrumb.scss +27 -0
  12. package/components/button/_buttons.scss +352 -0
  13. package/components/button/button.mjs +11 -0
  14. package/components/button/buttons.stories.ts +150 -0
  15. package/components/button/buttons.ts +282 -0
  16. package/components/button/examples.iso.js +18 -0
  17. package/components/button/fabSpec.js +65 -0
  18. package/components/button/test-button.mjs +16 -0
  19. package/components/card/_cards.scss +229 -0
  20. package/components/card/card.mjs +10 -0
  21. package/components/card/cards.ts +185 -0
  22. package/components/card/cardsSpec.js +269 -0
  23. package/components/carousel/_carousel.scss +93 -0
  24. package/components/carousel/_slider.scss +119 -0
  25. package/components/carousel/carousel.ts +693 -0
  26. package/components/carousel/carouselSpec.js +61 -0
  27. package/components/carousel/slider.ts +431 -0
  28. package/components/carousel/sliderSpec.js +99 -0
  29. package/components/checkbox/_checkboxes.scss +281 -0
  30. package/components/checkbox/checkbox.mdx +24 -0
  31. package/components/checkbox/checkbox.stories.ts +120 -0
  32. package/components/chip/chip.mjs +37 -0
  33. package/components/chip/chip.test.mjs +10 -0
  34. package/components/chip/chips.css +126 -0
  35. package/components/chip/chips.mdx +33 -0
  36. package/components/chip/chips.ts +440 -0
  37. package/components/chip/chipsSpec.js +165 -0
  38. package/components/chip/readme.md +323 -0
  39. package/components/collapsible/_collapsible.scss +82 -0
  40. package/components/collapsible/collapsible.ts +230 -0
  41. package/components/collapsible/collapsibleSpec.js +240 -0
  42. package/components/datepicker/_datepicker.scss +268 -0
  43. package/components/datepicker/datepicker.ts +1450 -0
  44. package/components/datepicker/datepickerSpec.js +162 -0
  45. package/components/dialog/_materialbox.scss +42 -0
  46. package/components/dialog/_modal.scss +79 -0
  47. package/components/dialog/materialbox.ts +446 -0
  48. package/components/dialog/materialboxSpec.js +37 -0
  49. package/components/dialog/modal.ts +111 -0
  50. package/components/dialog/modalSpec.js +83 -0
  51. package/components/dialog/readme.md +5 -0
  52. package/components/divider/readme.md +15 -0
  53. package/components/dropdown/_dropdown.scss +83 -0
  54. package/components/dropdown/dropdown.ts +653 -0
  55. package/components/dropdown/dropdownSpec.js +108 -0
  56. package/components/list/_collection.scss +114 -0
  57. package/components/list/_list.scss +6 -0
  58. package/components/list/list.mjs +58 -0
  59. package/components/list/list.test.mjs +16 -0
  60. package/components/loading/loading.mjs +26 -0
  61. package/components/loading/loading.test.mjs +10 -0
  62. package/components/navigation-bar/_old +582 -0
  63. package/components/navigation-bar/navigation-bar.mdx +20 -0
  64. package/components/navigation-bar/navigation-bar.stories.ts +39 -0
  65. package/components/navigation-drawer/_sidenav.scss +247 -0
  66. package/components/navigation-drawer/sidenav.ts +546 -0
  67. package/components/navigation-drawer/sidenavSpec.js +124 -0
  68. package/components/pagination/_pagination.scss +47 -0
  69. package/components/progress/_preloader.scss +416 -0
  70. package/components/radio-button/_radio-buttons.scss +112 -0
  71. package/components/radio-button/radio-buttons.mdx +28 -0
  72. package/components/radio-button/radio-buttons.stories.ts +51 -0
  73. package/components/search/autocomplete.ts +620 -0
  74. package/components/search/autocompleteSpec.js +321 -0
  75. package/components/slider/_range.scss +157 -0
  76. package/components/slider/range.ts +216 -0
  77. package/components/snackbar/_toast.scss +68 -0
  78. package/components/snackbar/toastSpec.js +132 -0
  79. package/components/snackbar/toasts.ts +312 -0
  80. package/components/switch/_switches.scss +121 -0
  81. package/components/tabs/_tabs.scss +171 -0
  82. package/components/tabs/tabs.mjs +31 -0
  83. package/components/tabs/tabs.ts +358 -0
  84. package/components/tabs/tabsSpec.js +180 -0
  85. package/components/textfield/_file-input.scss +41 -0
  86. package/components/textfield/_input-fields.scss +368 -0
  87. package/components/textfield/_select.scss +104 -0
  88. package/components/textfield/formfields.css +311 -0
  89. package/components/textfield/forms.ts +182 -0
  90. package/components/textfield/formsSpec.js +142 -0
  91. package/components/textfield/select.ts +472 -0
  92. package/components/textfield/selectSpec.js +390 -0
  93. package/components/textfield/textfield.mjs +29 -0
  94. package/components/textfield/textfield.test.mjs +10 -0
  95. package/components/timepicker/_timepicker.scss +362 -0
  96. package/components/timepicker/timepicker.ts +905 -0
  97. package/components/tooltip/_tooltip.scss +40 -0
  98. package/components/tooltip/tooltip.ts +380 -0
  99. package/components/tooltip/tooltipSpec.js +145 -0
  100. package/dist/css/materialize.colors.min.css +6 -0
  101. package/dist/css/materialize.css +7578 -6326
  102. package/dist/css/materialize.min.css +6 -13
  103. package/dist/css/materialize.min.css.map +1 -0
  104. package/dist/js/materialize.cjs.js +8410 -0
  105. package/dist/js/materialize.d.ts +2625 -0
  106. package/dist/js/materialize.js +8415 -12374
  107. package/dist/js/materialize.min.js +6 -6
  108. package/dist/js/materialize.mjs +8382 -0
  109. package/package.json +82 -47
  110. package/sass/_colors.scss +417 -0
  111. package/sass/_global.scss +490 -0
  112. package/sass/_grid.scss +172 -0
  113. package/sass/_table_of_contents.scss +28 -0
  114. package/sass/_tapTarget.scss +102 -0
  115. package/sass/_typography.scss +58 -0
  116. package/sass/_variables.scss +56 -0
  117. package/sass/materialize.scss +51 -0
  118. package/sass/mixins.module.scss +168 -0
  119. package/extras/noUiSlider/nouislider.css +0 -406
  120. package/extras/noUiSlider/nouislider.js +0 -2147
  121. package/extras/noUiSlider/nouislider.min.js +0 -1
  122. package/js/anime.min.js +0 -34
  123. package/js/autocomplete.js +0 -448
  124. package/js/buttons.js +0 -354
  125. package/js/cards.js +0 -40
  126. package/js/carousel.js +0 -717
  127. package/js/cash.js +0 -960
  128. package/js/characterCounter.js +0 -136
  129. package/js/chips.js +0 -481
  130. package/js/collapsible.js +0 -275
  131. package/js/component.js +0 -44
  132. package/js/datepicker.js +0 -975
  133. package/js/dropdown.js +0 -635
  134. package/js/forms.js +0 -275
  135. package/js/global.js +0 -444
  136. package/js/materialbox.js +0 -453
  137. package/js/modal.js +0 -382
  138. package/js/parallax.js +0 -138
  139. package/js/pushpin.js +0 -148
  140. package/js/range.js +0 -263
  141. package/js/scrollspy.js +0 -295
  142. package/js/select.js +0 -450
  143. package/js/sidenav.js +0 -580
  144. package/js/slider.js +0 -359
  145. package/js/tabs.js +0 -402
  146. package/js/tapTarget.js +0 -314
  147. package/js/timepicker.js +0 -647
  148. package/js/toasts.js +0 -310
  149. package/js/tooltip.js +0 -303
  150. package/js/waves.js +0 -335
package/js/waves.js DELETED
@@ -1,335 +0,0 @@
1
- /*!
2
- * Waves v0.6.4
3
- * http://fian.my.id/Waves
4
- *
5
- * Copyright 2014 Alfiana E. Sibuea and other contributors
6
- * Released under the MIT license
7
- * https://github.com/fians/Waves/blob/master/LICENSE
8
- */
9
-
10
- ;(function(window) {
11
- 'use strict';
12
-
13
- var Waves = Waves || {};
14
- var $$ = document.querySelectorAll.bind(document);
15
-
16
- // Find exact position of element
17
- function isWindow(obj) {
18
- return obj !== null && obj === obj.window;
19
- }
20
-
21
- function getWindow(elem) {
22
- return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
23
- }
24
-
25
- function offset(elem) {
26
- var docElem, win,
27
- box = {top: 0, left: 0},
28
- doc = elem && elem.ownerDocument;
29
-
30
- docElem = doc.documentElement;
31
-
32
- if (typeof elem.getBoundingClientRect !== typeof undefined) {
33
- box = elem.getBoundingClientRect();
34
- }
35
- win = getWindow(doc);
36
- return {
37
- top: box.top + win.pageYOffset - docElem.clientTop,
38
- left: box.left + win.pageXOffset - docElem.clientLeft
39
- };
40
- }
41
-
42
- function convertStyle(obj) {
43
- var style = '';
44
-
45
- for (var a in obj) {
46
- if (obj.hasOwnProperty(a)) {
47
- style += (a + ':' + obj[a] + ';');
48
- }
49
- }
50
-
51
- return style;
52
- }
53
-
54
- var Effect = {
55
-
56
- // Effect delay
57
- duration: 750,
58
-
59
- show: function(e, element) {
60
-
61
- // Disable right click
62
- if (e.button === 2) {
63
- return false;
64
- }
65
-
66
- var el = element || this;
67
-
68
- // Create ripple
69
- var ripple = document.createElement('div');
70
- ripple.className = 'waves-ripple';
71
- el.appendChild(ripple);
72
-
73
- // Get click coordinate and element witdh
74
- var pos = offset(el);
75
- var relativeY = (e.pageY - pos.top);
76
- var relativeX = (e.pageX - pos.left);
77
- var scale = 'scale('+((el.clientWidth / 100) * 10)+')';
78
-
79
- // Support for touch devices
80
- if ('touches' in e) {
81
- relativeY = (e.touches[0].pageY - pos.top);
82
- relativeX = (e.touches[0].pageX - pos.left);
83
- }
84
-
85
- // Attach data to element
86
- ripple.setAttribute('data-hold', Date.now());
87
- ripple.setAttribute('data-scale', scale);
88
- ripple.setAttribute('data-x', relativeX);
89
- ripple.setAttribute('data-y', relativeY);
90
-
91
- // Set ripple position
92
- var rippleStyle = {
93
- 'top': relativeY+'px',
94
- 'left': relativeX+'px'
95
- };
96
-
97
- ripple.className = ripple.className + ' waves-notransition';
98
- ripple.setAttribute('style', convertStyle(rippleStyle));
99
- ripple.className = ripple.className.replace('waves-notransition', '');
100
-
101
- // Scale the ripple
102
- rippleStyle['-webkit-transform'] = scale;
103
- rippleStyle['-moz-transform'] = scale;
104
- rippleStyle['-ms-transform'] = scale;
105
- rippleStyle['-o-transform'] = scale;
106
- rippleStyle.transform = scale;
107
- rippleStyle.opacity = '1';
108
-
109
- rippleStyle['-webkit-transition-duration'] = Effect.duration + 'ms';
110
- rippleStyle['-moz-transition-duration'] = Effect.duration + 'ms';
111
- rippleStyle['-o-transition-duration'] = Effect.duration + 'ms';
112
- rippleStyle['transition-duration'] = Effect.duration + 'ms';
113
-
114
- rippleStyle['-webkit-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
115
- rippleStyle['-moz-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
116
- rippleStyle['-o-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
117
- rippleStyle['transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
118
-
119
- ripple.setAttribute('style', convertStyle(rippleStyle));
120
- },
121
-
122
- hide: function(e) {
123
- TouchHandler.touchup(e);
124
-
125
- var el = this;
126
- var width = el.clientWidth * 1.4;
127
-
128
- // Get first ripple
129
- var ripple = null;
130
- var ripples = el.getElementsByClassName('waves-ripple');
131
- if (ripples.length > 0) {
132
- ripple = ripples[ripples.length - 1];
133
- } else {
134
- return false;
135
- }
136
-
137
- var relativeX = ripple.getAttribute('data-x');
138
- var relativeY = ripple.getAttribute('data-y');
139
- var scale = ripple.getAttribute('data-scale');
140
-
141
- // Get delay beetween mousedown and mouse leave
142
- var diff = Date.now() - Number(ripple.getAttribute('data-hold'));
143
- var delay = 350 - diff;
144
-
145
- if (delay < 0) {
146
- delay = 0;
147
- }
148
-
149
- // Fade out ripple after delay
150
- setTimeout(function() {
151
- var style = {
152
- 'top': relativeY+'px',
153
- 'left': relativeX+'px',
154
- 'opacity': '0',
155
-
156
- // Duration
157
- '-webkit-transition-duration': Effect.duration + 'ms',
158
- '-moz-transition-duration': Effect.duration + 'ms',
159
- '-o-transition-duration': Effect.duration + 'ms',
160
- 'transition-duration': Effect.duration + 'ms',
161
- '-webkit-transform': scale,
162
- '-moz-transform': scale,
163
- '-ms-transform': scale,
164
- '-o-transform': scale,
165
- 'transform': scale,
166
- };
167
-
168
- ripple.setAttribute('style', convertStyle(style));
169
-
170
- setTimeout(function() {
171
- try {
172
- el.removeChild(ripple);
173
- } catch(e) {
174
- return false;
175
- }
176
- }, Effect.duration);
177
- }, delay);
178
- },
179
-
180
- // Little hack to make <input> can perform waves effect
181
- wrapInput: function(elements) {
182
- for (var a = 0; a < elements.length; a++) {
183
- var el = elements[a];
184
-
185
- if (el.tagName.toLowerCase() === 'input') {
186
- var parent = el.parentNode;
187
-
188
- // If input already have parent just pass through
189
- if (parent.tagName.toLowerCase() === 'i' && parent.className.indexOf('waves-effect') !== -1) {
190
- continue;
191
- }
192
-
193
- // Put element class and style to the specified parent
194
- var wrapper = document.createElement('i');
195
- wrapper.className = el.className + ' waves-input-wrapper';
196
-
197
- var elementStyle = el.getAttribute('style');
198
-
199
- if (!elementStyle) {
200
- elementStyle = '';
201
- }
202
-
203
- wrapper.setAttribute('style', elementStyle);
204
-
205
- el.className = 'waves-button-input';
206
- el.removeAttribute('style');
207
-
208
- // Put element as child
209
- parent.replaceChild(wrapper, el);
210
- wrapper.appendChild(el);
211
- }
212
- }
213
- }
214
- };
215
-
216
-
217
- /**
218
- * Disable mousedown event for 500ms during and after touch
219
- */
220
- var TouchHandler = {
221
- /* uses an integer rather than bool so there's no issues with
222
- * needing to clear timeouts if another touch event occurred
223
- * within the 500ms. Cannot mouseup between touchstart and
224
- * touchend, nor in the 500ms after touchend. */
225
- touches: 0,
226
- allowEvent: function(e) {
227
- var allow = true;
228
-
229
- if (e.type === 'touchstart') {
230
- TouchHandler.touches += 1; //push
231
- } else if (e.type === 'touchend' || e.type === 'touchcancel') {
232
- setTimeout(function() {
233
- if (TouchHandler.touches > 0) {
234
- TouchHandler.touches -= 1; //pop after 500ms
235
- }
236
- }, 500);
237
- } else if (e.type === 'mousedown' && TouchHandler.touches > 0) {
238
- allow = false;
239
- }
240
-
241
- return allow;
242
- },
243
- touchup: function(e) {
244
- TouchHandler.allowEvent(e);
245
- }
246
- };
247
-
248
-
249
- /**
250
- * Delegated click handler for .waves-effect element.
251
- * returns null when .waves-effect element not in "click tree"
252
- */
253
- function getWavesEffectElement(e) {
254
- if (TouchHandler.allowEvent(e) === false) {
255
- return null;
256
- }
257
-
258
- var element = null;
259
- var target = e.target || e.srcElement;
260
-
261
- while (target.parentNode !== null) {
262
- if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {
263
- element = target;
264
- break;
265
- }
266
- target = target.parentNode;
267
- }
268
- return element;
269
- }
270
-
271
- /**
272
- * Bubble the click and show effect if .waves-effect elem was found
273
- */
274
- function showEffect(e) {
275
- var element = getWavesEffectElement(e);
276
-
277
- if (element !== null) {
278
- Effect.show(e, element);
279
-
280
- if ('ontouchstart' in window) {
281
- element.addEventListener('touchend', Effect.hide, false);
282
- element.addEventListener('touchcancel', Effect.hide, false);
283
- }
284
-
285
- element.addEventListener('mouseup', Effect.hide, false);
286
- element.addEventListener('mouseleave', Effect.hide, false);
287
- element.addEventListener('dragend', Effect.hide, false);
288
- }
289
- }
290
-
291
- Waves.displayEffect = function(options) {
292
- options = options || {};
293
-
294
- if ('duration' in options) {
295
- Effect.duration = options.duration;
296
- }
297
-
298
- //Wrap input inside <i> tag
299
- Effect.wrapInput($$('.waves-effect'));
300
-
301
- if ('ontouchstart' in window) {
302
- document.body.addEventListener('touchstart', showEffect, false);
303
- }
304
-
305
- document.body.addEventListener('mousedown', showEffect, false);
306
- };
307
-
308
- /**
309
- * Attach Waves to an input element (or any element which doesn't
310
- * bubble mouseup/mousedown events).
311
- * Intended to be used with dynamically loaded forms/inputs, or
312
- * where the user doesn't want a delegated click handler.
313
- */
314
- Waves.attach = function(element) {
315
- //FUTURE: automatically add waves classes and allow users
316
- // to specify them with an options param? Eg. light/classic/button
317
- if (element.tagName.toLowerCase() === 'input') {
318
- Effect.wrapInput([element]);
319
- element = element.parentNode;
320
- }
321
-
322
- if ('ontouchstart' in window) {
323
- element.addEventListener('touchstart', showEffect, false);
324
- }
325
-
326
- element.addEventListener('mousedown', showEffect, false);
327
- };
328
-
329
- window.Waves = Waves;
330
-
331
- document.addEventListener('DOMContentLoaded', function() {
332
- Waves.displayEffect();
333
- }, false);
334
-
335
- })(window);