kmaterialize 2.0.0 → 2.3.3-1.0.1

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 (156) 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/colors.module.css +74 -0
  118. package/sass/materialize.scss +51 -0
  119. package/sass/mixins.module.scss +168 -0
  120. package/sass/pulse.css +35 -0
  121. package/sass/theme.module.css +140 -0
  122. package/sass/tokens.module.css +272 -0
  123. package/sass/transitions.css +10 -0
  124. package/sass/typography.module.css +150 -0
  125. package/extras/noUiSlider/nouislider.css +0 -406
  126. package/extras/noUiSlider/nouislider.js +0 -2147
  127. package/extras/noUiSlider/nouislider.min.js +0 -1
  128. package/js/anime.min.js +0 -34
  129. package/js/autocomplete.js +0 -448
  130. package/js/buttons.js +0 -354
  131. package/js/cards.js +0 -40
  132. package/js/carousel.js +0 -717
  133. package/js/cash.js +0 -960
  134. package/js/characterCounter.js +0 -136
  135. package/js/chips.js +0 -481
  136. package/js/collapsible.js +0 -275
  137. package/js/component.js +0 -44
  138. package/js/datepicker.js +0 -975
  139. package/js/dropdown.js +0 -635
  140. package/js/forms.js +0 -275
  141. package/js/global.js +0 -444
  142. package/js/materialbox.js +0 -453
  143. package/js/modal.js +0 -382
  144. package/js/parallax.js +0 -138
  145. package/js/pushpin.js +0 -148
  146. package/js/range.js +0 -263
  147. package/js/scrollspy.js +0 -295
  148. package/js/select.js +0 -450
  149. package/js/sidenav.js +0 -580
  150. package/js/slider.js +0 -359
  151. package/js/tabs.js +0 -402
  152. package/js/tapTarget.js +0 -314
  153. package/js/timepicker.js +0 -647
  154. package/js/toasts.js +0 -310
  155. package/js/tooltip.js +0 -303
  156. package/js/waves.js +0 -335
package/js/slider.js DELETED
@@ -1,359 +0,0 @@
1
- (function($, anim) {
2
- 'use strict';
3
-
4
- let _defaults = {
5
- indicators: true,
6
- height: 400,
7
- duration: 500,
8
- interval: 6000
9
- };
10
-
11
- /**
12
- * @class
13
- *
14
- */
15
- class Slider extends Component {
16
- /**
17
- * Construct Slider instance and set up overlay
18
- * @constructor
19
- * @param {Element} el
20
- * @param {Object} options
21
- */
22
- constructor(el, options) {
23
- super(Slider, el, options);
24
-
25
- this.el.M_Slider = this;
26
-
27
- /**
28
- * Options for the modal
29
- * @member Slider#options
30
- * @prop {Boolean} [indicators=true] - Show indicators
31
- * @prop {Number} [height=400] - height of slider
32
- * @prop {Number} [duration=500] - Length in ms of slide transition
33
- * @prop {Number} [interval=6000] - Length in ms of slide interval
34
- */
35
- this.options = $.extend({}, Slider.defaults, options);
36
-
37
- // setup
38
- this.$slider = this.$el.find('.slides');
39
- this.$slides = this.$slider.children('li');
40
- this.activeIndex = this.$slides
41
- .filter(function(item) {
42
- return $(item).hasClass('active');
43
- })
44
- .first()
45
- .index();
46
- if (this.activeIndex != -1) {
47
- this.$active = this.$slides.eq(this.activeIndex);
48
- }
49
-
50
- this._setSliderHeight();
51
-
52
- // Set initial positions of captions
53
- this.$slides.find('.caption').each((el) => {
54
- this._animateCaptionIn(el, 0);
55
- });
56
-
57
- // Move img src into background-image
58
- this.$slides.find('img').each((el) => {
59
- let placeholderBase64 =
60
- 'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
61
- if ($(el).attr('src') !== placeholderBase64) {
62
- $(el).css('background-image', 'url("' + $(el).attr('src') + '")');
63
- $(el).attr('src', placeholderBase64);
64
- }
65
- });
66
-
67
- this._setupIndicators();
68
-
69
- // Show active slide
70
- if (this.$active) {
71
- this.$active.css('display', 'block');
72
- } else {
73
- this.$slides.first().addClass('active');
74
- anim({
75
- targets: this.$slides.first()[0],
76
- opacity: 1,
77
- duration: this.options.duration,
78
- easing: 'easeOutQuad'
79
- });
80
-
81
- this.activeIndex = 0;
82
- this.$active = this.$slides.eq(this.activeIndex);
83
-
84
- // Update indicators
85
- if (this.options.indicators) {
86
- this.$indicators.eq(this.activeIndex).addClass('active');
87
- }
88
- }
89
-
90
- // Adjust height to current slide
91
- this.$active.find('img').each((el) => {
92
- anim({
93
- targets: this.$active.find('.caption')[0],
94
- opacity: 1,
95
- translateX: 0,
96
- translateY: 0,
97
- duration: this.options.duration,
98
- easing: 'easeOutQuad'
99
- });
100
- });
101
-
102
- this._setupEventHandlers();
103
-
104
- // auto scroll
105
- this.start();
106
- }
107
-
108
- static get defaults() {
109
- return _defaults;
110
- }
111
-
112
- static init(els, options) {
113
- return super.init(this, els, options);
114
- }
115
-
116
- /**
117
- * Get Instance
118
- */
119
- static getInstance(el) {
120
- let domElem = !!el.jquery ? el[0] : el;
121
- return domElem.M_Slider;
122
- }
123
-
124
- /**
125
- * Teardown component
126
- */
127
- destroy() {
128
- this.pause();
129
- this._removeIndicators();
130
- this._removeEventHandlers();
131
- this.el.M_Slider = undefined;
132
- }
133
-
134
- /**
135
- * Setup Event Handlers
136
- */
137
- _setupEventHandlers() {
138
- this._handleIntervalBound = this._handleInterval.bind(this);
139
- this._handleIndicatorClickBound = this._handleIndicatorClick.bind(this);
140
-
141
- if (this.options.indicators) {
142
- this.$indicators.each((el) => {
143
- el.addEventListener('click', this._handleIndicatorClickBound);
144
- });
145
- }
146
- }
147
-
148
- /**
149
- * Remove Event Handlers
150
- */
151
- _removeEventHandlers() {
152
- if (this.options.indicators) {
153
- this.$indicators.each((el) => {
154
- el.removeEventListener('click', this._handleIndicatorClickBound);
155
- });
156
- }
157
- }
158
-
159
- /**
160
- * Handle indicator click
161
- * @param {Event} e
162
- */
163
- _handleIndicatorClick(e) {
164
- let currIndex = $(e.target).index();
165
- this.set(currIndex);
166
- }
167
-
168
- /**
169
- * Handle Interval
170
- */
171
- _handleInterval() {
172
- let newActiveIndex = this.$slider.find('.active').index();
173
- if (this.$slides.length === newActiveIndex + 1) newActiveIndex = 0;
174
- // loop to start
175
- else newActiveIndex += 1;
176
-
177
- this.set(newActiveIndex);
178
- }
179
-
180
- /**
181
- * Animate in caption
182
- * @param {Element} caption
183
- * @param {Number} duration
184
- */
185
- _animateCaptionIn(caption, duration) {
186
- let animOptions = {
187
- targets: caption,
188
- opacity: 0,
189
- duration: duration,
190
- easing: 'easeOutQuad'
191
- };
192
-
193
- if ($(caption).hasClass('center-align')) {
194
- animOptions.translateY = -100;
195
- } else if ($(caption).hasClass('right-align')) {
196
- animOptions.translateX = 100;
197
- } else if ($(caption).hasClass('left-align')) {
198
- animOptions.translateX = -100;
199
- }
200
-
201
- anim(animOptions);
202
- }
203
-
204
- /**
205
- * Set height of slider
206
- */
207
- _setSliderHeight() {
208
- // If fullscreen, do nothing
209
- if (!this.$el.hasClass('fullscreen')) {
210
- if (this.options.indicators) {
211
- // Add height if indicators are present
212
- this.$el.css('height', this.options.height + 40 + 'px');
213
- } else {
214
- this.$el.css('height', this.options.height + 'px');
215
- }
216
- this.$slider.css('height', this.options.height + 'px');
217
- }
218
- }
219
-
220
- /**
221
- * Setup indicators
222
- */
223
- _setupIndicators() {
224
- if (this.options.indicators) {
225
- this.$indicators = $('<ul class="indicators"></ul>');
226
- this.$slides.each((el, index) => {
227
- let $indicator = $('<li class="indicator-item"></li>');
228
- this.$indicators.append($indicator[0]);
229
- });
230
- this.$el.append(this.$indicators[0]);
231
- this.$indicators = this.$indicators.children('li.indicator-item');
232
- }
233
- }
234
-
235
- /**
236
- * Remove indicators
237
- */
238
- _removeIndicators() {
239
- this.$el.find('ul.indicators').remove();
240
- }
241
-
242
- /**
243
- * Cycle to nth item
244
- * @param {Number} index
245
- */
246
- set(index) {
247
- // Wrap around indices.
248
- if (index >= this.$slides.length) index = 0;
249
- else if (index < 0) index = this.$slides.length - 1;
250
-
251
- // Only do if index changes
252
- if (this.activeIndex != index) {
253
- this.$active = this.$slides.eq(this.activeIndex);
254
- let $caption = this.$active.find('.caption');
255
- this.$active.removeClass('active');
256
-
257
- anim({
258
- targets: this.$active[0],
259
- opacity: 0,
260
- duration: this.options.duration,
261
- easing: 'easeOutQuad',
262
- complete: () => {
263
- this.$slides.not('.active').each((el) => {
264
- anim({
265
- targets: el,
266
- opacity: 0,
267
- translateX: 0,
268
- translateY: 0,
269
- duration: 0,
270
- easing: 'easeOutQuad'
271
- });
272
- });
273
- }
274
- });
275
-
276
- this._animateCaptionIn($caption[0], this.options.duration);
277
-
278
- // Update indicators
279
- if (this.options.indicators) {
280
- this.$indicators.eq(this.activeIndex).removeClass('active');
281
- this.$indicators.eq(index).addClass('active');
282
- }
283
-
284
- anim({
285
- targets: this.$slides.eq(index)[0],
286
- opacity: 1,
287
- duration: this.options.duration,
288
- easing: 'easeOutQuad'
289
- });
290
-
291
- anim({
292
- targets: this.$slides.eq(index).find('.caption')[0],
293
- opacity: 1,
294
- translateX: 0,
295
- translateY: 0,
296
- duration: this.options.duration,
297
- delay: this.options.duration,
298
- easing: 'easeOutQuad'
299
- });
300
-
301
- this.$slides.eq(index).addClass('active');
302
- this.activeIndex = index;
303
-
304
- // Reset interval
305
- this.start();
306
- }
307
- }
308
-
309
- /**
310
- * Pause slider interval
311
- */
312
- pause() {
313
- clearInterval(this.interval);
314
- }
315
-
316
- /**
317
- * Start slider interval
318
- */
319
- start() {
320
- clearInterval(this.interval);
321
- this.interval = setInterval(
322
- this._handleIntervalBound,
323
- this.options.duration + this.options.interval
324
- );
325
- }
326
-
327
- /**
328
- * Move to next slide
329
- */
330
- next() {
331
- let newIndex = this.activeIndex + 1;
332
-
333
- // Wrap around indices.
334
- if (newIndex >= this.$slides.length) newIndex = 0;
335
- else if (newIndex < 0) newIndex = this.$slides.length - 1;
336
-
337
- this.set(newIndex);
338
- }
339
-
340
- /**
341
- * Move to previous slide
342
- */
343
- prev() {
344
- let newIndex = this.activeIndex - 1;
345
-
346
- // Wrap around indices.
347
- if (newIndex >= this.$slides.length) newIndex = 0;
348
- else if (newIndex < 0) newIndex = this.$slides.length - 1;
349
-
350
- this.set(newIndex);
351
- }
352
- }
353
-
354
- M.Slider = Slider;
355
-
356
- if (M.jQueryLoaded) {
357
- M.initializeJqueryWrapper(Slider, 'slider', 'M_Slider');
358
- }
359
- })(cash, M.anime);