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/buttons.js DELETED
@@ -1,354 +0,0 @@
1
- (function($, anim) {
2
- 'use strict';
3
-
4
- let _defaults = {
5
- direction: 'top',
6
- hoverEnabled: true,
7
- toolbarEnabled: false
8
- };
9
-
10
- $.fn.reverse = [].reverse;
11
-
12
- /**
13
- * @class
14
- *
15
- */
16
- class FloatingActionButton extends Component {
17
- /**
18
- * Construct FloatingActionButton instance
19
- * @constructor
20
- * @param {Element} el
21
- * @param {Object} options
22
- */
23
- constructor(el, options) {
24
- super(FloatingActionButton, el, options);
25
-
26
- this.el.M_FloatingActionButton = this;
27
-
28
- /**
29
- * Options for the fab
30
- * @member FloatingActionButton#options
31
- * @prop {Boolean} [direction] - Direction fab menu opens
32
- * @prop {Boolean} [hoverEnabled=true] - Enable hover vs click
33
- * @prop {Boolean} [toolbarEnabled=false] - Enable toolbar transition
34
- */
35
- this.options = $.extend({}, FloatingActionButton.defaults, options);
36
-
37
- this.isOpen = false;
38
- this.$anchor = this.$el.children('a').first();
39
- this.$menu = this.$el.children('ul').first();
40
- this.$floatingBtns = this.$el.find('ul .btn-floating');
41
- this.$floatingBtnsReverse = this.$el.find('ul .btn-floating').reverse();
42
- this.offsetY = 0;
43
- this.offsetX = 0;
44
-
45
- this.$el.addClass(`direction-${this.options.direction}`);
46
- if (this.options.direction === 'top') {
47
- this.offsetY = 40;
48
- } else if (this.options.direction === 'right') {
49
- this.offsetX = -40;
50
- } else if (this.options.direction === 'bottom') {
51
- this.offsetY = -40;
52
- } else {
53
- this.offsetX = 40;
54
- }
55
- this._setupEventHandlers();
56
- }
57
-
58
- static get defaults() {
59
- return _defaults;
60
- }
61
-
62
- static init(els, options) {
63
- return super.init(this, els, options);
64
- }
65
-
66
- /**
67
- * Get Instance
68
- */
69
- static getInstance(el) {
70
- let domElem = !!el.jquery ? el[0] : el;
71
- return domElem.M_FloatingActionButton;
72
- }
73
-
74
- /**
75
- * Teardown component
76
- */
77
- destroy() {
78
- this._removeEventHandlers();
79
- this.el.M_FloatingActionButton = undefined;
80
- }
81
-
82
- /**
83
- * Setup Event Handlers
84
- */
85
- _setupEventHandlers() {
86
- this._handleFABClickBound = this._handleFABClick.bind(this);
87
- this._handleOpenBound = this.open.bind(this);
88
- this._handleCloseBound = this.close.bind(this);
89
-
90
- if (this.options.hoverEnabled && !this.options.toolbarEnabled) {
91
- this.el.addEventListener('mouseenter', this._handleOpenBound);
92
- this.el.addEventListener('mouseleave', this._handleCloseBound);
93
- } else {
94
- this.el.addEventListener('click', this._handleFABClickBound);
95
- }
96
- }
97
-
98
- /**
99
- * Remove Event Handlers
100
- */
101
- _removeEventHandlers() {
102
- if (this.options.hoverEnabled && !this.options.toolbarEnabled) {
103
- this.el.removeEventListener('mouseenter', this._handleOpenBound);
104
- this.el.removeEventListener('mouseleave', this._handleCloseBound);
105
- } else {
106
- this.el.removeEventListener('click', this._handleFABClickBound);
107
- }
108
- }
109
-
110
- /**
111
- * Handle FAB Click
112
- */
113
- _handleFABClick() {
114
- if (this.isOpen) {
115
- this.close();
116
- } else {
117
- this.open();
118
- }
119
- }
120
-
121
- /**
122
- * Handle Document Click
123
- * @param {Event} e
124
- */
125
- _handleDocumentClick(e) {
126
- if (!$(e.target).closest(this.$menu).length) {
127
- this.close();
128
- }
129
- }
130
-
131
- /**
132
- * Open FAB
133
- */
134
- open() {
135
- if (this.isOpen) {
136
- return;
137
- }
138
-
139
- if (this.options.toolbarEnabled) {
140
- this._animateInToolbar();
141
- } else {
142
- this._animateInFAB();
143
- }
144
- this.isOpen = true;
145
- }
146
-
147
- /**
148
- * Close FAB
149
- */
150
- close() {
151
- if (!this.isOpen) {
152
- return;
153
- }
154
-
155
- if (this.options.toolbarEnabled) {
156
- window.removeEventListener('scroll', this._handleCloseBound, true);
157
- document.body.removeEventListener('click', this._handleDocumentClickBound, true);
158
- this._animateOutToolbar();
159
- } else {
160
- this._animateOutFAB();
161
- }
162
- this.isOpen = false;
163
- }
164
-
165
- /**
166
- * Classic FAB Menu open
167
- */
168
- _animateInFAB() {
169
- this.$el.addClass('active');
170
-
171
- let time = 0;
172
- this.$floatingBtnsReverse.each((el) => {
173
- anim({
174
- targets: el,
175
- opacity: 1,
176
- scale: [0.4, 1],
177
- translateY: [this.offsetY, 0],
178
- translateX: [this.offsetX, 0],
179
- duration: 275,
180
- delay: time,
181
- easing: 'easeInOutQuad'
182
- });
183
- time += 40;
184
- });
185
- }
186
-
187
- /**
188
- * Classic FAB Menu close
189
- */
190
- _animateOutFAB() {
191
- this.$floatingBtnsReverse.each((el) => {
192
- anim.remove(el);
193
- anim({
194
- targets: el,
195
- opacity: 0,
196
- scale: 0.4,
197
- translateY: this.offsetY,
198
- translateX: this.offsetX,
199
- duration: 175,
200
- easing: 'easeOutQuad',
201
- complete: () => {
202
- this.$el.removeClass('active');
203
- }
204
- });
205
- });
206
- }
207
-
208
- /**
209
- * Toolbar transition Menu open
210
- */
211
- _animateInToolbar() {
212
- let scaleFactor;
213
- let windowWidth = window.innerWidth;
214
- let windowHeight = window.innerHeight;
215
- let btnRect = this.el.getBoundingClientRect();
216
- let backdrop = $('<div class="fab-backdrop"></div>');
217
- let fabColor = this.$anchor.css('background-color');
218
- this.$anchor.append(backdrop);
219
-
220
- this.offsetX = btnRect.left - windowWidth / 2 + btnRect.width / 2;
221
- this.offsetY = windowHeight - btnRect.bottom;
222
- scaleFactor = windowWidth / backdrop[0].clientWidth;
223
- this.btnBottom = btnRect.bottom;
224
- this.btnLeft = btnRect.left;
225
- this.btnWidth = btnRect.width;
226
-
227
- // Set initial state
228
- this.$el.addClass('active');
229
- this.$el.css({
230
- 'text-align': 'center',
231
- width: '100%',
232
- bottom: 0,
233
- left: 0,
234
- transform: 'translateX(' + this.offsetX + 'px)',
235
- transition: 'none'
236
- });
237
- this.$anchor.css({
238
- transform: 'translateY(' + -this.offsetY + 'px)',
239
- transition: 'none'
240
- });
241
- backdrop.css({
242
- 'background-color': fabColor
243
- });
244
-
245
- setTimeout(() => {
246
- this.$el.css({
247
- transform: '',
248
- transition:
249
- 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s'
250
- });
251
- this.$anchor.css({
252
- overflow: 'visible',
253
- transform: '',
254
- transition: 'transform .2s'
255
- });
256
-
257
- setTimeout(() => {
258
- this.$el.css({
259
- overflow: 'hidden',
260
- 'background-color': fabColor
261
- });
262
- backdrop.css({
263
- transform: 'scale(' + scaleFactor + ')',
264
- transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
265
- });
266
- this.$menu
267
- .children('li')
268
- .children('a')
269
- .css({
270
- opacity: 1
271
- });
272
-
273
- // Scroll to close.
274
- this._handleDocumentClickBound = this._handleDocumentClick.bind(this);
275
- window.addEventListener('scroll', this._handleCloseBound, true);
276
- document.body.addEventListener('click', this._handleDocumentClickBound, true);
277
- }, 100);
278
- }, 0);
279
- }
280
-
281
- /**
282
- * Toolbar transition Menu close
283
- */
284
- _animateOutToolbar() {
285
- let windowWidth = window.innerWidth;
286
- let windowHeight = window.innerHeight;
287
- let backdrop = this.$el.find('.fab-backdrop');
288
- let fabColor = this.$anchor.css('background-color');
289
-
290
- this.offsetX = this.btnLeft - windowWidth / 2 + this.btnWidth / 2;
291
- this.offsetY = windowHeight - this.btnBottom;
292
-
293
- // Hide backdrop
294
- this.$el.removeClass('active');
295
- this.$el.css({
296
- 'background-color': 'transparent',
297
- transition: 'none'
298
- });
299
- this.$anchor.css({
300
- transition: 'none'
301
- });
302
- backdrop.css({
303
- transform: 'scale(0)',
304
- 'background-color': fabColor
305
- });
306
- this.$menu
307
- .children('li')
308
- .children('a')
309
- .css({
310
- opacity: ''
311
- });
312
-
313
- setTimeout(() => {
314
- backdrop.remove();
315
-
316
- // Set initial state.
317
- this.$el.css({
318
- 'text-align': '',
319
- width: '',
320
- bottom: '',
321
- left: '',
322
- overflow: '',
323
- 'background-color': '',
324
- transform: 'translate3d(' + -this.offsetX + 'px,0,0)'
325
- });
326
- this.$anchor.css({
327
- overflow: '',
328
- transform: 'translate3d(0,' + this.offsetY + 'px,0)'
329
- });
330
-
331
- setTimeout(() => {
332
- this.$el.css({
333
- transform: 'translate3d(0,0,0)',
334
- transition: 'transform .2s'
335
- });
336
- this.$anchor.css({
337
- transform: 'translate3d(0,0,0)',
338
- transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
339
- });
340
- }, 20);
341
- }, 200);
342
- }
343
- }
344
-
345
- M.FloatingActionButton = FloatingActionButton;
346
-
347
- if (M.jQueryLoaded) {
348
- M.initializeJqueryWrapper(
349
- FloatingActionButton,
350
- 'floatingActionButton',
351
- 'M_FloatingActionButton'
352
- );
353
- }
354
- })(cash, M.anime);
package/js/cards.js DELETED
@@ -1,40 +0,0 @@
1
- (function($, anim) {
2
- $(document).on('click', '.card', function(e) {
3
- if ($(this).children('.card-reveal').length) {
4
- var $card = $(e.target).closest('.card');
5
- if ($card.data('initialOverflow') === undefined) {
6
- $card.data(
7
- 'initialOverflow',
8
- $card.css('overflow') === undefined ? '' : $card.css('overflow')
9
- );
10
- }
11
- let $cardReveal = $(this).find('.card-reveal');
12
- if (
13
- $(e.target).is($('.card-reveal .card-title')) ||
14
- $(e.target).is($('.card-reveal .card-title i'))
15
- ) {
16
- // Make Reveal animate down and display none
17
- anim({
18
- targets: $cardReveal[0],
19
- translateY: 0,
20
- duration: 225,
21
- easing: 'easeInOutQuad',
22
- complete: function(anim) {
23
- let el = anim.animatables[0].target;
24
- $(el).css({ display: 'none' });
25
- $card.css('overflow', $card.data('initialOverflow'));
26
- }
27
- });
28
- } else if ($(e.target).is($('.card .activator')) || $(e.target).is($('.card .activator i'))) {
29
- $card.css('overflow', 'hidden');
30
- $cardReveal.css({ display: 'block' });
31
- anim({
32
- targets: $cardReveal[0],
33
- translateY: '-100%',
34
- duration: 300,
35
- easing: 'easeInOutQuad'
36
- });
37
- }
38
- }
39
- });
40
- })(cash, M.anime);