@materializecss/materialize 1.1.0 → 1.2.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.
- package/Gruntfile.js +712 -708
- package/LICENSE +0 -0
- package/README.md +1 -7
- package/dist/css/materialize.css +8671 -8627
- package/dist/css/materialize.min.css +3 -3
- package/dist/js/materialize.js +11706 -11559
- package/dist/js/materialize.min.js +2 -2
- package/extras/noUiSlider/nouislider.css +2 -4
- package/extras/noUiSlider/nouislider.js +0 -0
- package/extras/noUiSlider/nouislider.min.js +0 -0
- package/js/anime.min.js +0 -0
- package/js/autocomplete.js +0 -0
- package/js/buttons.js +0 -0
- package/js/cards.js +0 -0
- package/js/carousel.js +0 -0
- package/js/cash.js +0 -0
- package/js/characterCounter.js +0 -0
- package/js/chips.js +0 -0
- package/js/collapsible.js +0 -0
- package/js/component.js +0 -0
- package/js/datepicker.js +0 -0
- package/js/dropdown.js +0 -0
- package/js/forms.js +22 -12
- package/js/global.js +11 -7
- package/js/materialbox.js +0 -0
- package/js/modal.js +0 -0
- package/js/parallax.js +0 -0
- package/js/pushpin.js +0 -0
- package/js/range.js +0 -0
- package/js/scrollspy.js +0 -0
- package/js/select.js +90 -9
- package/js/sidenav.js +0 -0
- package/js/slider.js +0 -0
- package/js/tabs.js +0 -0
- package/js/tapTarget.js +0 -0
- package/js/timepicker.js +82 -18
- package/js/toasts.js +3 -0
- package/js/tooltip.js +0 -0
- package/js/waves.js +0 -0
- package/package.json +8 -6
- package/sass/_style.scss +0 -0
- package/sass/components/_badges.scss +0 -0
- package/sass/components/_buttons.scss +0 -0
- package/sass/components/_cards.scss +0 -0
- package/sass/components/_carousel.scss +0 -0
- package/sass/components/_chips.scss +0 -0
- package/sass/components/_collapsible.scss +0 -0
- package/sass/components/_collection.scss +0 -0
- package/sass/components/_color-classes.scss +0 -0
- package/sass/components/_color-variables.scss +0 -0
- package/sass/components/_datepicker.scss +0 -0
- package/sass/components/_dropdown.scss +0 -0
- package/sass/components/_global.scss +4 -0
- package/sass/components/_grid.scss +0 -0
- package/sass/components/_icons-material-design.scss +0 -0
- package/sass/components/_materialbox.scss +0 -0
- package/sass/components/_modal.scss +0 -0
- package/sass/components/_navbar.scss +0 -0
- package/sass/components/_normalize.scss +0 -0
- package/sass/components/_preloader.scss +0 -0
- package/sass/components/_pulse.scss +0 -0
- package/sass/components/_sidenav.scss +0 -0
- package/sass/components/_slider.scss +0 -0
- package/sass/components/_table_of_contents.scss +0 -0
- package/sass/components/_tabs.scss +0 -0
- package/sass/components/_tapTarget.scss +0 -0
- package/sass/components/_timepicker.scss +27 -11
- package/sass/components/_toast.scss +0 -0
- package/sass/components/_tooltip.scss +0 -0
- package/sass/components/_transitions.scss +0 -0
- package/sass/components/_typography.scss +0 -0
- package/sass/components/_variables.scss +0 -0
- package/sass/components/_waves.scss +0 -0
- package/sass/components/forms/_checkboxes.scss +0 -0
- package/sass/components/forms/_file-input.scss +0 -0
- package/sass/components/forms/_forms.scss +0 -0
- package/sass/components/forms/_input-fields.scss +9 -0
- package/sass/components/forms/_radio-buttons.scss +0 -0
- package/sass/components/forms/_range.scss +0 -0
- package/sass/components/forms/_select.scss +0 -0
- package/sass/components/forms/_switches.scss +0 -0
- package/sass/ghpages-materialize.scss +0 -0
- package/sass/materialize.scss +0 -0
package/Gruntfile.js
CHANGED
|
@@ -1,708 +1,712 @@
|
|
|
1
|
-
const sass = require('sass');
|
|
2
|
-
|
|
3
|
-
module.exports = function(grunt) {
|
|
4
|
-
const concatFile = 'temp/js/materialize_concat.js.map';
|
|
5
|
-
const jsFiles = [
|
|
6
|
-
'js/cash.js',
|
|
7
|
-
'js/waves.js',
|
|
8
|
-
'js/component.js',
|
|
9
|
-
'js/global.js',
|
|
10
|
-
'js/anime.min.js',
|
|
11
|
-
'js/collapsible.js',
|
|
12
|
-
'js/dropdown.js',
|
|
13
|
-
'js/modal.js',
|
|
14
|
-
'js/materialbox.js',
|
|
15
|
-
'js/parallax.js',
|
|
16
|
-
'js/tabs.js',
|
|
17
|
-
'js/tooltip.js',
|
|
18
|
-
'js/toasts.js',
|
|
19
|
-
'js/sidenav.js',
|
|
20
|
-
'js/scrollspy.js',
|
|
21
|
-
'js/autocomplete.js',
|
|
22
|
-
'js/forms.js',
|
|
23
|
-
'js/slider.js',
|
|
24
|
-
'js/cards.js',
|
|
25
|
-
'js/chips.js',
|
|
26
|
-
'js/pushpin.js',
|
|
27
|
-
'js/buttons.js',
|
|
28
|
-
'js/datepicker.js',
|
|
29
|
-
'js/timepicker.js',
|
|
30
|
-
'js/characterCounter.js',
|
|
31
|
-
'js/carousel.js',
|
|
32
|
-
'js/tapTarget.js',
|
|
33
|
-
'js/select.js',
|
|
34
|
-
'js/range.js'
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
// configure the tasks
|
|
38
|
-
|
|
39
|
-
// Jasmine
|
|
40
|
-
jasmine: {
|
|
41
|
-
components: {
|
|
42
|
-
src: ['bin/materialize.js'],
|
|
43
|
-
options: {
|
|
44
|
-
vendor: [
|
|
45
|
-
'node_modules/jquery/dist/jquery.min.js'
|
|
46
|
-
],
|
|
47
|
-
styles: 'bin/materialize.css',
|
|
48
|
-
specs: 'tests/spec/**/*Spec.js',
|
|
49
|
-
helpers: 'tests/spec/helper.js',
|
|
50
|
-
keepRunner: true,
|
|
51
|
-
version: '3.8.0',
|
|
52
|
-
page: {
|
|
53
|
-
viewportSize: {
|
|
54
|
-
width: 1400,
|
|
55
|
-
height: 735
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
sandboxArgs: {
|
|
59
|
-
args: ['--headless', '--no-sandbox'
|
|
60
|
-
},
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
// Sass
|
|
66
|
-
sass: {
|
|
67
|
-
|
|
68
|
-
// Global options
|
|
69
|
-
options: {
|
|
70
|
-
implementation: sass
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
// Task
|
|
74
|
-
expanded: {
|
|
75
|
-
// Target options
|
|
76
|
-
options: {
|
|
77
|
-
outputStyle: 'expanded',
|
|
78
|
-
sourcemap: false
|
|
79
|
-
},
|
|
80
|
-
files: {
|
|
81
|
-
'dist/css/materialize.css': 'sass/materialize.scss'
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
min: {
|
|
86
|
-
options: {
|
|
87
|
-
outputStyle: 'compressed',
|
|
88
|
-
sourcemap: false
|
|
89
|
-
},
|
|
90
|
-
files: {
|
|
91
|
-
'dist/css/materialize.min.css': 'sass/materialize.scss'
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
// Compile ghpages css
|
|
96
|
-
gh: {
|
|
97
|
-
options: {
|
|
98
|
-
outputStyle: 'compressed',
|
|
99
|
-
sourcemap: false
|
|
100
|
-
},
|
|
101
|
-
files: {
|
|
102
|
-
'docs/css/ghpages-materialize.css': 'sass/ghpages-materialize.scss'
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
// Compile bin css
|
|
107
|
-
bin: {
|
|
108
|
-
options: {
|
|
109
|
-
outputStyle: 'expanded',
|
|
110
|
-
sourcemap: false
|
|
111
|
-
},
|
|
112
|
-
files: {
|
|
113
|
-
'bin/materialize.css': 'sass/materialize.scss'
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
// PostCss Autoprefixer
|
|
119
|
-
postcss: {
|
|
120
|
-
options: {
|
|
121
|
-
processors: [
|
|
122
|
-
require('autoprefixer')({
|
|
123
|
-
browsers: [
|
|
124
|
-
'last 2 versions',
|
|
125
|
-
'Chrome >= 30',
|
|
126
|
-
'Firefox >= 30',
|
|
127
|
-
'ie >= 10',
|
|
128
|
-
'Safari >= 8'
|
|
129
|
-
]
|
|
130
|
-
})
|
|
131
|
-
]
|
|
132
|
-
},
|
|
133
|
-
expanded: {
|
|
134
|
-
src: 'dist/css/materialize.css'
|
|
135
|
-
},
|
|
136
|
-
min: {
|
|
137
|
-
src: 'dist/css/materialize.min.css'
|
|
138
|
-
},
|
|
139
|
-
gh: {
|
|
140
|
-
src: 'docs/css/ghpages-materialize.css'
|
|
141
|
-
},
|
|
142
|
-
bin: {
|
|
143
|
-
src: 'bin/materialize.css'
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
babel: {
|
|
148
|
-
options: {
|
|
149
|
-
sourceMap: false,
|
|
150
|
-
plugins: [
|
|
151
|
-
'transform-es2015-arrow-functions',
|
|
152
|
-
'transform-es2015-block-scoping',
|
|
153
|
-
'transform-es2015-classes',
|
|
154
|
-
'transform-es2015-template-literals',
|
|
155
|
-
'transform-es2015-object-super',
|
|
156
|
-
'babel-plugin-transform-object-rest-spread'
|
|
157
|
-
]
|
|
158
|
-
},
|
|
159
|
-
bin: {
|
|
160
|
-
options: {
|
|
161
|
-
sourceMap: true
|
|
162
|
-
},
|
|
163
|
-
files: {
|
|
164
|
-
'bin/materialize.js': 'temp/js/materialize_concat.js'
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
dist: {
|
|
168
|
-
files: {
|
|
169
|
-
'dist/js/materialize.js': 'temp/js/materialize.js'
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
// Browser Sync integration
|
|
175
|
-
browserSync: {
|
|
176
|
-
bsFiles: ['bin/*', 'css/ghpages-materialize.css', '!**/node_modules/**/*'],
|
|
177
|
-
options: {
|
|
178
|
-
server: {
|
|
179
|
-
baseDir: './' // make server from root dir
|
|
180
|
-
},
|
|
181
|
-
port: 8000,
|
|
182
|
-
ui: {
|
|
183
|
-
port: 8080,
|
|
184
|
-
weinre: {
|
|
185
|
-
port: 9090
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
open: false
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
// Concat
|
|
193
|
-
concat: {
|
|
194
|
-
options: {
|
|
195
|
-
separator: ';'
|
|
196
|
-
},
|
|
197
|
-
dist: {
|
|
198
|
-
// the files to concatenate
|
|
199
|
-
src: jsFiles,
|
|
200
|
-
// the location of the resulting JS file
|
|
201
|
-
dest: 'temp/js/materialize.js'
|
|
202
|
-
},
|
|
203
|
-
temp: {
|
|
204
|
-
// the files to concatenate
|
|
205
|
-
options: {
|
|
206
|
-
sourceMap: true,
|
|
207
|
-
sourceMapStyle: 'link'
|
|
208
|
-
},
|
|
209
|
-
src: jsFiles,
|
|
210
|
-
// the location of the resulting JS file
|
|
211
|
-
dest: 'temp/js/materialize_concat.js'
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
// Uglify
|
|
216
|
-
uglify: {
|
|
217
|
-
options: {
|
|
218
|
-
// Use these options when debugging
|
|
219
|
-
// mangle: false,
|
|
220
|
-
// compress: false,
|
|
221
|
-
// beautify: true
|
|
222
|
-
},
|
|
223
|
-
dist: {
|
|
224
|
-
files: {
|
|
225
|
-
'dist/js/materialize.min.js': ['dist/js/materialize.js']
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
bin: {
|
|
229
|
-
files: {
|
|
230
|
-
'bin/materialize.min.js': ['bin/materialize.js']
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
extras: {
|
|
234
|
-
files: {
|
|
235
|
-
'extras/noUiSlider/nouislider.min.js': ['extras/noUiSlider/nouislider.js']
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
// Compress
|
|
241
|
-
compress: {
|
|
242
|
-
main: {
|
|
243
|
-
options: {
|
|
244
|
-
archive: 'bin/materialize.zip',
|
|
245
|
-
level: 6
|
|
246
|
-
},
|
|
247
|
-
files: [
|
|
248
|
-
{ expand: true, cwd: 'dist/', src: ['**/*'], dest: 'materialize/' },
|
|
249
|
-
{ expand: true, cwd: './', src: ['LICENSE', 'README.md'], dest: 'materialize/' }
|
|
250
|
-
]
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
src: {
|
|
254
|
-
options: {
|
|
255
|
-
archive: 'bin/materialize-src.zip',
|
|
256
|
-
level: 6
|
|
257
|
-
},
|
|
258
|
-
files: [
|
|
259
|
-
{ expand: true, cwd: 'sass/', src: ['materialize.scss'], dest: 'materialize-src/sass/' },
|
|
260
|
-
{ expand: true, cwd: 'sass/', src: ['components/**/*'], dest: 'materialize-src/sass/' },
|
|
261
|
-
{
|
|
262
|
-
expand: true,
|
|
263
|
-
cwd: 'js/',
|
|
264
|
-
src: [
|
|
265
|
-
'anime.min.js',
|
|
266
|
-
'cash.js',
|
|
267
|
-
'component.js',
|
|
268
|
-
'global.js',
|
|
269
|
-
'collapsible.js',
|
|
270
|
-
'dropdown.js',
|
|
271
|
-
'modal.js',
|
|
272
|
-
'materialbox.js',
|
|
273
|
-
'parallax.js',
|
|
274
|
-
'tabs.js',
|
|
275
|
-
'tooltip.js',
|
|
276
|
-
'waves.js',
|
|
277
|
-
'toasts.js',
|
|
278
|
-
'sidenav.js',
|
|
279
|
-
'scrollspy.js',
|
|
280
|
-
'autocomplete.js',
|
|
281
|
-
'forms.js',
|
|
282
|
-
'slider.js',
|
|
283
|
-
'cards.js',
|
|
284
|
-
'chips.js',
|
|
285
|
-
'pushpin.js',
|
|
286
|
-
'buttons.js',
|
|
287
|
-
'datepicker.js',
|
|
288
|
-
'timepicker.js',
|
|
289
|
-
'characterCounter.js',
|
|
290
|
-
'carousel.js',
|
|
291
|
-
'tapTarget.js',
|
|
292
|
-
'select.js',
|
|
293
|
-
'range.js'
|
|
294
|
-
],
|
|
295
|
-
dest: 'materialize-src/js/'
|
|
296
|
-
},
|
|
297
|
-
{ expand: true, cwd: 'dist/js/', src: ['**/*'], dest: 'materialize-src/js/bin/' },
|
|
298
|
-
{ expand: true, cwd: './', src: ['LICENSE', 'README.md'], dest: 'materialize-src/' }
|
|
299
|
-
]
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
-
starter_template: {
|
|
303
|
-
options: {
|
|
304
|
-
archive: 'templates/starter-template.zip',
|
|
305
|
-
level: 6
|
|
306
|
-
},
|
|
307
|
-
files: [
|
|
308
|
-
{ expand: true, cwd: 'dist/', src: ['**/*'], dest: 'starter-template/' },
|
|
309
|
-
{
|
|
310
|
-
expand: true,
|
|
311
|
-
cwd: 'templates/starter-template/',
|
|
312
|
-
src: ['index.html', 'LICENSE'],
|
|
313
|
-
dest: 'starter-template/'
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
expand: true,
|
|
317
|
-
cwd: 'templates/starter-template/css',
|
|
318
|
-
src: ['style.css'],
|
|
319
|
-
dest: 'starter-template/css'
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
expand: true,
|
|
323
|
-
cwd: 'templates/starter-template/js',
|
|
324
|
-
src: ['init.js'],
|
|
325
|
-
dest: 'starter-template/js'
|
|
326
|
-
}
|
|
327
|
-
]
|
|
328
|
-
},
|
|
329
|
-
|
|
330
|
-
parallax_template: {
|
|
331
|
-
options: {
|
|
332
|
-
archive: 'templates/parallax-template.zip',
|
|
333
|
-
level: 6
|
|
334
|
-
},
|
|
335
|
-
files: [
|
|
336
|
-
{ expand: true, cwd: 'dist/', src: ['**/*'], dest: 'parallax-template/' },
|
|
337
|
-
{
|
|
338
|
-
expand: true,
|
|
339
|
-
cwd: 'templates/parallax-template/',
|
|
340
|
-
src: ['index.html', 'LICENSE', 'background1.jpg', 'background2.jpg', 'background3.jpg'],
|
|
341
|
-
dest: 'parallax-template/'
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
expand: true,
|
|
345
|
-
cwd: 'templates/parallax-template/css',
|
|
346
|
-
src: ['style.css'],
|
|
347
|
-
dest: 'parallax-template/css'
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
expand: true,
|
|
351
|
-
cwd: 'templates/parallax-template/js',
|
|
352
|
-
src: ['init.js'],
|
|
353
|
-
dest: 'parallax-template/js'
|
|
354
|
-
}
|
|
355
|
-
]
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
|
|
359
|
-
// Clean
|
|
360
|
-
clean: {
|
|
361
|
-
temp: {
|
|
362
|
-
src: ['temp/']
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
|
-
|
|
366
|
-
// Pug
|
|
367
|
-
pug: {
|
|
368
|
-
compile: {
|
|
369
|
-
options: {
|
|
370
|
-
pretty: true,
|
|
371
|
-
data: {
|
|
372
|
-
debug: false
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
files: {
|
|
376
|
-
'docs/index.html': 'pug/index.pug',
|
|
377
|
-
'docs/icons.html': 'pug/icons.pug',
|
|
378
|
-
'docs/about.html': 'pug/about.pug',
|
|
379
|
-
'docs/sass.html': 'pug/sass.pug',
|
|
380
|
-
'docs/getting-started.html': 'pug/getting-started.pug',
|
|
381
|
-
'docs/mobile.html': 'pug/mobile.pug',
|
|
382
|
-
'docs/parallax.html': 'pug/parallax.pug',
|
|
383
|
-
'docs/parallax-demo.html': 'pug/parallax-demo.pug',
|
|
384
|
-
'docs/typography.html': 'pug/typography.pug',
|
|
385
|
-
'docs/color.html': 'pug/color.pug',
|
|
386
|
-
'docs/shadow.html': 'pug/shadow.pug',
|
|
387
|
-
'docs/grid.html': 'pug/grid.pug',
|
|
388
|
-
'docs/media-css.html': 'pug/media-css.pug',
|
|
389
|
-
'docs/table.html': 'pug/table.pug',
|
|
390
|
-
'docs/helpers.html': 'pug/helpers.pug',
|
|
391
|
-
'docs/buttons.html': 'pug/buttons.pug',
|
|
392
|
-
'docs/navbar.html': 'pug/navbar.pug',
|
|
393
|
-
'docs/cards.html': 'pug/cards.pug',
|
|
394
|
-
'docs/preloader.html': 'pug/preloader.pug',
|
|
395
|
-
'docs/collections.html': 'pug/collections.pug',
|
|
396
|
-
'docs/badges.html': 'pug/badges.pug',
|
|
397
|
-
'docs/footer.html': 'pug/footer.pug',
|
|
398
|
-
'docs/modals.html': 'pug/modals.pug',
|
|
399
|
-
'docs/dropdown.html': 'pug/dropdown.pug',
|
|
400
|
-
'docs/tabs.html': 'pug/tabs.pug',
|
|
401
|
-
'docs/toasts.html': 'pug/toasts.pug',
|
|
402
|
-
'docs/tooltips.html': 'pug/tooltips.pug',
|
|
403
|
-
'docs/sidenav.html': 'pug/sidenav.pug',
|
|
404
|
-
'docs/pushpin.html': 'pug/pushpin.pug',
|
|
405
|
-
'docs/waves.html': 'pug/waves.pug',
|
|
406
|
-
'docs/media.html': 'pug/media.pug',
|
|
407
|
-
'docs/collapsible.html': 'pug/collapsible.pug',
|
|
408
|
-
'docs/scrollspy.html': 'pug/scrollspy.pug',
|
|
409
|
-
'docs/fullscreen-slider-demo.html': 'pug/fullscreen-slider-demo.pug',
|
|
410
|
-
'docs/pagination.html': 'pug/pagination.pug',
|
|
411
|
-
'docs/breadcrumbs.html': 'pug/breadcrumbs.pug',
|
|
412
|
-
'docs/carousel.html': 'pug/carousel.pug',
|
|
413
|
-
'docs/feature-discovery.html': 'pug/feature-discovery.pug',
|
|
414
|
-
'docs/pulse.html': 'pug/pulse.pug',
|
|
415
|
-
'docs/pushpin-demo.html': 'pug/pushpin-demo.pug',
|
|
416
|
-
'docs/css-transitions.html': 'pug/css-transitions.pug',
|
|
417
|
-
'docs/404.html': 'pug/404.pug',
|
|
418
|
-
'docs/autocomplete.html': 'pug/autocomplete.pug',
|
|
419
|
-
'docs/checkboxes.html': 'pug/checkboxes.pug',
|
|
420
|
-
'docs/chips.html': 'pug/chips.pug',
|
|
421
|
-
'docs/pickers.html': 'pug/pickers.pug',
|
|
422
|
-
'docs/radio-buttons.html': 'pug/radio-buttons.pug',
|
|
423
|
-
'docs/range.html': 'pug/range.pug',
|
|
424
|
-
'docs/select.html': 'pug/select.pug',
|
|
425
|
-
'docs/switches.html': 'pug/switches.pug',
|
|
426
|
-
'docs/text-inputs.html': 'pug/text-inputs.pug',
|
|
427
|
-
'docs/floating-action-button.html': 'pug/floating-action-button.pug',
|
|
428
|
-
'docs/auto-init.html': 'pug/auto-init.pug'
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
},
|
|
432
|
-
|
|
433
|
-
// Watch Files
|
|
434
|
-
watch: {
|
|
435
|
-
pug: {
|
|
436
|
-
files: ['pug/**/*'],
|
|
437
|
-
tasks: ['pug_compile'],
|
|
438
|
-
options: {
|
|
439
|
-
interrupt: false,
|
|
440
|
-
spawn: false
|
|
441
|
-
}
|
|
442
|
-
},
|
|
443
|
-
|
|
444
|
-
js: {
|
|
445
|
-
files: ['js/**/*', '!js/init.js'],
|
|
446
|
-
tasks: ['js_compile'],
|
|
447
|
-
options: {
|
|
448
|
-
interrupt: false,
|
|
449
|
-
spawn: false
|
|
450
|
-
}
|
|
451
|
-
},
|
|
452
|
-
|
|
453
|
-
sass: {
|
|
454
|
-
files: ['sass/**/*'],
|
|
455
|
-
tasks: ['sass_compile'],
|
|
456
|
-
options: {
|
|
457
|
-
interrupt: false,
|
|
458
|
-
spawn: false
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
|
|
463
|
-
// Concurrent
|
|
464
|
-
concurrent: {
|
|
465
|
-
options: {
|
|
466
|
-
logConcurrentOutput: true,
|
|
467
|
-
limit: 10
|
|
468
|
-
},
|
|
469
|
-
monitor: {
|
|
470
|
-
tasks: [
|
|
471
|
-
'pug_compile',
|
|
472
|
-
'sass_compile',
|
|
473
|
-
'js_compile',
|
|
474
|
-
'watch:pug',
|
|
475
|
-
'watch:js',
|
|
476
|
-
'watch:sass',
|
|
477
|
-
'notify:watching',
|
|
478
|
-
'server'
|
|
479
|
-
]
|
|
480
|
-
}
|
|
481
|
-
},
|
|
482
|
-
|
|
483
|
-
// Notifications
|
|
484
|
-
notify: {
|
|
485
|
-
watching: {
|
|
486
|
-
options: {
|
|
487
|
-
enabled: true,
|
|
488
|
-
message: 'Watching Files!',
|
|
489
|
-
title: 'Materialize', // defaults to the name in package.json, or will use project directory's name
|
|
490
|
-
success: true, // whether successful grunt executions should be notified automatically
|
|
491
|
-
duration: 1 // the duration of notification in seconds, for `notify-send only
|
|
492
|
-
}
|
|
493
|
-
},
|
|
494
|
-
|
|
495
|
-
sass_compile: {
|
|
496
|
-
options: {
|
|
497
|
-
enabled: true,
|
|
498
|
-
message: 'Sass Compiled!',
|
|
499
|
-
title: 'Materialize',
|
|
500
|
-
success: true,
|
|
501
|
-
duration: 1
|
|
502
|
-
}
|
|
503
|
-
},
|
|
504
|
-
|
|
505
|
-
js_compile: {
|
|
506
|
-
options: {
|
|
507
|
-
enabled: true,
|
|
508
|
-
message: 'JS Compiled!',
|
|
509
|
-
title: 'Materialize',
|
|
510
|
-
success: true,
|
|
511
|
-
duration: 1
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
|
|
515
|
-
pug_compile: {
|
|
516
|
-
options: {
|
|
517
|
-
enabled: true,
|
|
518
|
-
message: 'Pug Compiled!',
|
|
519
|
-
title: 'Materialize',
|
|
520
|
-
success: true,
|
|
521
|
-
duration: 1
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
|
|
525
|
-
server: {
|
|
526
|
-
options: {
|
|
527
|
-
enabled: true,
|
|
528
|
-
message: 'Server Running!',
|
|
529
|
-
title: 'Materialize',
|
|
530
|
-
success: true,
|
|
531
|
-
duration: 1
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
},
|
|
535
|
-
|
|
536
|
-
// Replace text to update the version string
|
|
537
|
-
replace: {
|
|
538
|
-
version: {
|
|
539
|
-
src: ['bower.json', 'package.js', 'pug/**/*.html'],
|
|
540
|
-
overwrite: true,
|
|
541
|
-
replacements: [
|
|
542
|
-
{
|
|
543
|
-
from: grunt.option('oldver'),
|
|
544
|
-
to: grunt.option('newver')
|
|
545
|
-
}
|
|
546
|
-
]
|
|
547
|
-
},
|
|
548
|
-
package_json: {
|
|
549
|
-
src: ['package.json'],
|
|
550
|
-
overwrite: true,
|
|
551
|
-
replacements: [
|
|
552
|
-
{
|
|
553
|
-
from: '"version": "' + grunt.option('oldver'),
|
|
554
|
-
to: '"version": "' + grunt.option('newver')
|
|
555
|
-
}
|
|
556
|
-
]
|
|
557
|
-
},
|
|
558
|
-
docs: {
|
|
559
|
-
src: ['.gitignore'],
|
|
560
|
-
overwrite: true,
|
|
561
|
-
replacements: [
|
|
562
|
-
{
|
|
563
|
-
from: '/docs/*.html',
|
|
564
|
-
to: ''
|
|
565
|
-
}
|
|
566
|
-
]
|
|
567
|
-
}
|
|
568
|
-
},
|
|
569
|
-
|
|
570
|
-
// Create Version Header for files
|
|
571
|
-
usebanner: {
|
|
572
|
-
release: {
|
|
573
|
-
options: {
|
|
574
|
-
position: 'top',
|
|
575
|
-
banner:
|
|
576
|
-
'/*!\n * Materialize v' +
|
|
577
|
-
grunt.option('newver') +
|
|
578
|
-
' (https://materializecss.github.io/materialize)\n * Copyright 2014-2021 Materialize\n * MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE)\n */',
|
|
579
|
-
linebreak: true
|
|
580
|
-
},
|
|
581
|
-
files: {
|
|
582
|
-
src: ['dist/css/*.css', 'dist/js/*.js']
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
},
|
|
586
|
-
|
|
587
|
-
// Rename files
|
|
588
|
-
rename: {
|
|
589
|
-
rename_src: {
|
|
590
|
-
src: 'bin/materialize-src' + '.zip',
|
|
591
|
-
dest: 'bin/materialize-src-v' + grunt.option('newver') + '.zip',
|
|
592
|
-
options: {
|
|
593
|
-
ignore: true
|
|
594
|
-
}
|
|
595
|
-
},
|
|
596
|
-
rename_compiled: {
|
|
597
|
-
src: 'bin/materialize' + '.zip',
|
|
598
|
-
dest: 'bin/materialize-v' + grunt.option('newver') + '.zip',
|
|
599
|
-
options: {
|
|
600
|
-
ignore: true
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
},
|
|
604
|
-
|
|
605
|
-
connect: {
|
|
606
|
-
server: {
|
|
607
|
-
options: {
|
|
608
|
-
port: 9001,
|
|
609
|
-
protocol: 'http',
|
|
610
|
-
middleware: function(connect, options, middlewares) {
|
|
611
|
-
middlewares.unshift(function(req, res, next){
|
|
612
|
-
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
613
|
-
res.setHeader('Access-Control-Allow-Credentials', true);
|
|
614
|
-
res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
|
615
|
-
res.setHeader('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
|
|
616
|
-
next();
|
|
617
|
-
});
|
|
618
|
-
return middlewares;
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
},
|
|
623
|
-
|
|
624
|
-
copy: {
|
|
625
|
-
|
|
626
|
-
files: [
|
|
627
|
-
{src: 'bin/materialize.js', dest: 'docs/js/materialize.js'},
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
grunt.
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
grunt.loadNpmTasks('grunt-
|
|
643
|
-
grunt.loadNpmTasks('grunt-contrib-
|
|
644
|
-
grunt.loadNpmTasks('grunt-
|
|
645
|
-
grunt.loadNpmTasks('grunt-contrib-
|
|
646
|
-
grunt.loadNpmTasks('grunt-
|
|
647
|
-
grunt.loadNpmTasks('grunt-
|
|
648
|
-
grunt.loadNpmTasks('grunt-
|
|
649
|
-
grunt.loadNpmTasks('grunt-
|
|
650
|
-
grunt.loadNpmTasks('grunt-
|
|
651
|
-
grunt.loadNpmTasks('grunt-
|
|
652
|
-
grunt.loadNpmTasks('grunt-
|
|
653
|
-
grunt.loadNpmTasks('grunt-
|
|
654
|
-
grunt.loadNpmTasks('grunt-
|
|
655
|
-
grunt.loadNpmTasks('grunt-
|
|
656
|
-
grunt.loadNpmTasks('grunt-contrib-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
grunt.
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
'
|
|
665
|
-
'
|
|
666
|
-
'
|
|
667
|
-
'
|
|
668
|
-
'
|
|
669
|
-
'
|
|
670
|
-
'
|
|
671
|
-
'
|
|
672
|
-
'
|
|
673
|
-
'
|
|
674
|
-
'
|
|
675
|
-
'
|
|
676
|
-
'
|
|
677
|
-
'
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
grunt.registerTask('
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
'
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
grunt.registerTask('
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
1
|
+
const sass = require('sass');
|
|
2
|
+
|
|
3
|
+
module.exports = function(grunt) {
|
|
4
|
+
const concatFile = 'temp/js/materialize_concat.js.map';
|
|
5
|
+
const jsFiles = [
|
|
6
|
+
'js/cash.js',
|
|
7
|
+
'js/waves.js',
|
|
8
|
+
'js/component.js',
|
|
9
|
+
'js/global.js',
|
|
10
|
+
'js/anime.min.js',
|
|
11
|
+
'js/collapsible.js',
|
|
12
|
+
'js/dropdown.js',
|
|
13
|
+
'js/modal.js',
|
|
14
|
+
'js/materialbox.js',
|
|
15
|
+
'js/parallax.js',
|
|
16
|
+
'js/tabs.js',
|
|
17
|
+
'js/tooltip.js',
|
|
18
|
+
'js/toasts.js',
|
|
19
|
+
'js/sidenav.js',
|
|
20
|
+
'js/scrollspy.js',
|
|
21
|
+
'js/autocomplete.js',
|
|
22
|
+
'js/forms.js',
|
|
23
|
+
'js/slider.js',
|
|
24
|
+
'js/cards.js',
|
|
25
|
+
'js/chips.js',
|
|
26
|
+
'js/pushpin.js',
|
|
27
|
+
'js/buttons.js',
|
|
28
|
+
'js/datepicker.js',
|
|
29
|
+
'js/timepicker.js',
|
|
30
|
+
'js/characterCounter.js',
|
|
31
|
+
'js/carousel.js',
|
|
32
|
+
'js/tapTarget.js',
|
|
33
|
+
'js/select.js',
|
|
34
|
+
'js/range.js'
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
// configure the tasks
|
|
38
|
+
const config = {
|
|
39
|
+
// Jasmine
|
|
40
|
+
jasmine: {
|
|
41
|
+
components: {
|
|
42
|
+
src: ['bin/materialize.js'],
|
|
43
|
+
options: {
|
|
44
|
+
vendor: [
|
|
45
|
+
'node_modules/jquery/dist/jquery.min.js'
|
|
46
|
+
],
|
|
47
|
+
styles: 'bin/materialize.css',
|
|
48
|
+
specs: 'tests/spec/**/*Spec.js',
|
|
49
|
+
helpers: 'tests/spec/helper.js',
|
|
50
|
+
keepRunner: true,
|
|
51
|
+
version: '3.8.0',
|
|
52
|
+
page: {
|
|
53
|
+
viewportSize: {
|
|
54
|
+
width: 1400,
|
|
55
|
+
height: 735
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
sandboxArgs: {
|
|
59
|
+
args: ['--headless', '--no-sandbox']
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// Sass
|
|
66
|
+
sass: {
|
|
67
|
+
|
|
68
|
+
// Global options
|
|
69
|
+
options: {
|
|
70
|
+
implementation: sass
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
// Task
|
|
74
|
+
expanded: {
|
|
75
|
+
// Target options
|
|
76
|
+
options: {
|
|
77
|
+
outputStyle: 'expanded',
|
|
78
|
+
sourcemap: false
|
|
79
|
+
},
|
|
80
|
+
files: {
|
|
81
|
+
'dist/css/materialize.css': 'sass/materialize.scss'
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
min: {
|
|
86
|
+
options: {
|
|
87
|
+
outputStyle: 'compressed',
|
|
88
|
+
sourcemap: false
|
|
89
|
+
},
|
|
90
|
+
files: {
|
|
91
|
+
'dist/css/materialize.min.css': 'sass/materialize.scss'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
// Compile ghpages css
|
|
96
|
+
gh: {
|
|
97
|
+
options: {
|
|
98
|
+
outputStyle: 'compressed',
|
|
99
|
+
sourcemap: false
|
|
100
|
+
},
|
|
101
|
+
files: {
|
|
102
|
+
'docs/css/ghpages-materialize.css': 'sass/ghpages-materialize.scss'
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
// Compile bin css
|
|
107
|
+
bin: {
|
|
108
|
+
options: {
|
|
109
|
+
outputStyle: 'expanded',
|
|
110
|
+
sourcemap: false
|
|
111
|
+
},
|
|
112
|
+
files: {
|
|
113
|
+
'bin/materialize.css': 'sass/materialize.scss'
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
// PostCss Autoprefixer
|
|
119
|
+
postcss: {
|
|
120
|
+
options: {
|
|
121
|
+
processors: [
|
|
122
|
+
require('autoprefixer')({
|
|
123
|
+
browsers: [
|
|
124
|
+
'last 2 versions',
|
|
125
|
+
'Chrome >= 30',
|
|
126
|
+
'Firefox >= 30',
|
|
127
|
+
'ie >= 10',
|
|
128
|
+
'Safari >= 8'
|
|
129
|
+
]
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
expanded: {
|
|
134
|
+
src: 'dist/css/materialize.css'
|
|
135
|
+
},
|
|
136
|
+
min: {
|
|
137
|
+
src: 'dist/css/materialize.min.css'
|
|
138
|
+
},
|
|
139
|
+
gh: {
|
|
140
|
+
src: 'docs/css/ghpages-materialize.css'
|
|
141
|
+
},
|
|
142
|
+
bin: {
|
|
143
|
+
src: 'bin/materialize.css'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
babel: {
|
|
148
|
+
options: {
|
|
149
|
+
sourceMap: false,
|
|
150
|
+
plugins: [
|
|
151
|
+
'transform-es2015-arrow-functions',
|
|
152
|
+
'transform-es2015-block-scoping',
|
|
153
|
+
'transform-es2015-classes',
|
|
154
|
+
'transform-es2015-template-literals',
|
|
155
|
+
'transform-es2015-object-super',
|
|
156
|
+
'babel-plugin-transform-object-rest-spread'
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
bin: {
|
|
160
|
+
options: {
|
|
161
|
+
sourceMap: true
|
|
162
|
+
},
|
|
163
|
+
files: {
|
|
164
|
+
'bin/materialize.js': 'temp/js/materialize_concat.js'
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
dist: {
|
|
168
|
+
files: {
|
|
169
|
+
'dist/js/materialize.js': 'temp/js/materialize.js'
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
// Browser Sync integration
|
|
175
|
+
browserSync: {
|
|
176
|
+
bsFiles: ['bin/*', 'css/ghpages-materialize.css', '!**/node_modules/**/*'],
|
|
177
|
+
options: {
|
|
178
|
+
server: {
|
|
179
|
+
baseDir: './' // make server from root dir
|
|
180
|
+
},
|
|
181
|
+
port: 8000,
|
|
182
|
+
ui: {
|
|
183
|
+
port: 8080,
|
|
184
|
+
weinre: {
|
|
185
|
+
port: 9090
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
open: false
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
// Concat
|
|
193
|
+
concat: {
|
|
194
|
+
options: {
|
|
195
|
+
separator: ';'
|
|
196
|
+
},
|
|
197
|
+
dist: {
|
|
198
|
+
// the files to concatenate
|
|
199
|
+
src: jsFiles,
|
|
200
|
+
// the location of the resulting JS file
|
|
201
|
+
dest: 'temp/js/materialize.js'
|
|
202
|
+
},
|
|
203
|
+
temp: {
|
|
204
|
+
// the files to concatenate
|
|
205
|
+
options: {
|
|
206
|
+
sourceMap: true,
|
|
207
|
+
sourceMapStyle: 'link'
|
|
208
|
+
},
|
|
209
|
+
src: jsFiles,
|
|
210
|
+
// the location of the resulting JS file
|
|
211
|
+
dest: 'temp/js/materialize_concat.js'
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
// Uglify
|
|
216
|
+
uglify: {
|
|
217
|
+
options: {
|
|
218
|
+
// Use these options when debugging
|
|
219
|
+
// mangle: false,
|
|
220
|
+
// compress: false,
|
|
221
|
+
// beautify: true
|
|
222
|
+
},
|
|
223
|
+
dist: {
|
|
224
|
+
files: {
|
|
225
|
+
'dist/js/materialize.min.js': ['dist/js/materialize.js']
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
bin: {
|
|
229
|
+
files: {
|
|
230
|
+
'bin/materialize.min.js': ['bin/materialize.js']
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
extras: {
|
|
234
|
+
files: {
|
|
235
|
+
'extras/noUiSlider/nouislider.min.js': ['extras/noUiSlider/nouislider.js']
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
// Compress
|
|
241
|
+
compress: {
|
|
242
|
+
main: {
|
|
243
|
+
options: {
|
|
244
|
+
archive: 'bin/materialize.zip',
|
|
245
|
+
level: 6
|
|
246
|
+
},
|
|
247
|
+
files: [
|
|
248
|
+
{ expand: true, cwd: 'dist/', src: ['**/*'], dest: 'materialize/' },
|
|
249
|
+
{ expand: true, cwd: './', src: ['LICENSE', 'README.md'], dest: 'materialize/' }
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
src: {
|
|
254
|
+
options: {
|
|
255
|
+
archive: 'bin/materialize-src.zip',
|
|
256
|
+
level: 6
|
|
257
|
+
},
|
|
258
|
+
files: [
|
|
259
|
+
{ expand: true, cwd: 'sass/', src: ['materialize.scss'], dest: 'materialize-src/sass/' },
|
|
260
|
+
{ expand: true, cwd: 'sass/', src: ['components/**/*'], dest: 'materialize-src/sass/' },
|
|
261
|
+
{
|
|
262
|
+
expand: true,
|
|
263
|
+
cwd: 'js/',
|
|
264
|
+
src: [
|
|
265
|
+
'anime.min.js',
|
|
266
|
+
'cash.js',
|
|
267
|
+
'component.js',
|
|
268
|
+
'global.js',
|
|
269
|
+
'collapsible.js',
|
|
270
|
+
'dropdown.js',
|
|
271
|
+
'modal.js',
|
|
272
|
+
'materialbox.js',
|
|
273
|
+
'parallax.js',
|
|
274
|
+
'tabs.js',
|
|
275
|
+
'tooltip.js',
|
|
276
|
+
'waves.js',
|
|
277
|
+
'toasts.js',
|
|
278
|
+
'sidenav.js',
|
|
279
|
+
'scrollspy.js',
|
|
280
|
+
'autocomplete.js',
|
|
281
|
+
'forms.js',
|
|
282
|
+
'slider.js',
|
|
283
|
+
'cards.js',
|
|
284
|
+
'chips.js',
|
|
285
|
+
'pushpin.js',
|
|
286
|
+
'buttons.js',
|
|
287
|
+
'datepicker.js',
|
|
288
|
+
'timepicker.js',
|
|
289
|
+
'characterCounter.js',
|
|
290
|
+
'carousel.js',
|
|
291
|
+
'tapTarget.js',
|
|
292
|
+
'select.js',
|
|
293
|
+
'range.js'
|
|
294
|
+
],
|
|
295
|
+
dest: 'materialize-src/js/'
|
|
296
|
+
},
|
|
297
|
+
{ expand: true, cwd: 'dist/js/', src: ['**/*'], dest: 'materialize-src/js/bin/' },
|
|
298
|
+
{ expand: true, cwd: './', src: ['LICENSE', 'README.md'], dest: 'materialize-src/' }
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
|
|
302
|
+
starter_template: {
|
|
303
|
+
options: {
|
|
304
|
+
archive: 'templates/starter-template.zip',
|
|
305
|
+
level: 6
|
|
306
|
+
},
|
|
307
|
+
files: [
|
|
308
|
+
{ expand: true, cwd: 'dist/', src: ['**/*'], dest: 'starter-template/' },
|
|
309
|
+
{
|
|
310
|
+
expand: true,
|
|
311
|
+
cwd: 'templates/starter-template/',
|
|
312
|
+
src: ['index.html', 'LICENSE'],
|
|
313
|
+
dest: 'starter-template/'
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
expand: true,
|
|
317
|
+
cwd: 'templates/starter-template/css',
|
|
318
|
+
src: ['style.css'],
|
|
319
|
+
dest: 'starter-template/css'
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
expand: true,
|
|
323
|
+
cwd: 'templates/starter-template/js',
|
|
324
|
+
src: ['init.js'],
|
|
325
|
+
dest: 'starter-template/js'
|
|
326
|
+
}
|
|
327
|
+
]
|
|
328
|
+
},
|
|
329
|
+
|
|
330
|
+
parallax_template: {
|
|
331
|
+
options: {
|
|
332
|
+
archive: 'templates/parallax-template.zip',
|
|
333
|
+
level: 6
|
|
334
|
+
},
|
|
335
|
+
files: [
|
|
336
|
+
{ expand: true, cwd: 'dist/', src: ['**/*'], dest: 'parallax-template/' },
|
|
337
|
+
{
|
|
338
|
+
expand: true,
|
|
339
|
+
cwd: 'templates/parallax-template/',
|
|
340
|
+
src: ['index.html', 'LICENSE', 'background1.jpg', 'background2.jpg', 'background3.jpg'],
|
|
341
|
+
dest: 'parallax-template/'
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
expand: true,
|
|
345
|
+
cwd: 'templates/parallax-template/css',
|
|
346
|
+
src: ['style.css'],
|
|
347
|
+
dest: 'parallax-template/css'
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
expand: true,
|
|
351
|
+
cwd: 'templates/parallax-template/js',
|
|
352
|
+
src: ['init.js'],
|
|
353
|
+
dest: 'parallax-template/js'
|
|
354
|
+
}
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
|
|
359
|
+
// Clean
|
|
360
|
+
clean: {
|
|
361
|
+
temp: {
|
|
362
|
+
src: ['temp/']
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
|
|
366
|
+
// Pug
|
|
367
|
+
pug: {
|
|
368
|
+
compile: {
|
|
369
|
+
options: {
|
|
370
|
+
pretty: true,
|
|
371
|
+
data: {
|
|
372
|
+
debug: false
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
files: {
|
|
376
|
+
'docs/index.html': 'pug/index.pug',
|
|
377
|
+
'docs/icons.html': 'pug/icons.pug',
|
|
378
|
+
'docs/about.html': 'pug/about.pug',
|
|
379
|
+
'docs/sass.html': 'pug/sass.pug',
|
|
380
|
+
'docs/getting-started.html': 'pug/getting-started.pug',
|
|
381
|
+
'docs/mobile.html': 'pug/mobile.pug',
|
|
382
|
+
'docs/parallax.html': 'pug/parallax.pug',
|
|
383
|
+
'docs/parallax-demo.html': 'pug/parallax-demo.pug',
|
|
384
|
+
'docs/typography.html': 'pug/typography.pug',
|
|
385
|
+
'docs/color.html': 'pug/color.pug',
|
|
386
|
+
'docs/shadow.html': 'pug/shadow.pug',
|
|
387
|
+
'docs/grid.html': 'pug/grid.pug',
|
|
388
|
+
'docs/media-css.html': 'pug/media-css.pug',
|
|
389
|
+
'docs/table.html': 'pug/table.pug',
|
|
390
|
+
'docs/helpers.html': 'pug/helpers.pug',
|
|
391
|
+
'docs/buttons.html': 'pug/buttons.pug',
|
|
392
|
+
'docs/navbar.html': 'pug/navbar.pug',
|
|
393
|
+
'docs/cards.html': 'pug/cards.pug',
|
|
394
|
+
'docs/preloader.html': 'pug/preloader.pug',
|
|
395
|
+
'docs/collections.html': 'pug/collections.pug',
|
|
396
|
+
'docs/badges.html': 'pug/badges.pug',
|
|
397
|
+
'docs/footer.html': 'pug/footer.pug',
|
|
398
|
+
'docs/modals.html': 'pug/modals.pug',
|
|
399
|
+
'docs/dropdown.html': 'pug/dropdown.pug',
|
|
400
|
+
'docs/tabs.html': 'pug/tabs.pug',
|
|
401
|
+
'docs/toasts.html': 'pug/toasts.pug',
|
|
402
|
+
'docs/tooltips.html': 'pug/tooltips.pug',
|
|
403
|
+
'docs/sidenav.html': 'pug/sidenav.pug',
|
|
404
|
+
'docs/pushpin.html': 'pug/pushpin.pug',
|
|
405
|
+
'docs/waves.html': 'pug/waves.pug',
|
|
406
|
+
'docs/media.html': 'pug/media.pug',
|
|
407
|
+
'docs/collapsible.html': 'pug/collapsible.pug',
|
|
408
|
+
'docs/scrollspy.html': 'pug/scrollspy.pug',
|
|
409
|
+
'docs/fullscreen-slider-demo.html': 'pug/fullscreen-slider-demo.pug',
|
|
410
|
+
'docs/pagination.html': 'pug/pagination.pug',
|
|
411
|
+
'docs/breadcrumbs.html': 'pug/breadcrumbs.pug',
|
|
412
|
+
'docs/carousel.html': 'pug/carousel.pug',
|
|
413
|
+
'docs/feature-discovery.html': 'pug/feature-discovery.pug',
|
|
414
|
+
'docs/pulse.html': 'pug/pulse.pug',
|
|
415
|
+
'docs/pushpin-demo.html': 'pug/pushpin-demo.pug',
|
|
416
|
+
'docs/css-transitions.html': 'pug/css-transitions.pug',
|
|
417
|
+
'docs/404.html': 'pug/404.pug',
|
|
418
|
+
'docs/autocomplete.html': 'pug/autocomplete.pug',
|
|
419
|
+
'docs/checkboxes.html': 'pug/checkboxes.pug',
|
|
420
|
+
'docs/chips.html': 'pug/chips.pug',
|
|
421
|
+
'docs/pickers.html': 'pug/pickers.pug',
|
|
422
|
+
'docs/radio-buttons.html': 'pug/radio-buttons.pug',
|
|
423
|
+
'docs/range.html': 'pug/range.pug',
|
|
424
|
+
'docs/select.html': 'pug/select.pug',
|
|
425
|
+
'docs/switches.html': 'pug/switches.pug',
|
|
426
|
+
'docs/text-inputs.html': 'pug/text-inputs.pug',
|
|
427
|
+
'docs/floating-action-button.html': 'pug/floating-action-button.pug',
|
|
428
|
+
'docs/auto-init.html': 'pug/auto-init.pug'
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
|
|
433
|
+
// Watch Files
|
|
434
|
+
watch: {
|
|
435
|
+
pug: {
|
|
436
|
+
files: ['pug/**/*'],
|
|
437
|
+
tasks: ['pug_compile'],
|
|
438
|
+
options: {
|
|
439
|
+
interrupt: false,
|
|
440
|
+
spawn: false
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
|
|
444
|
+
js: {
|
|
445
|
+
files: ['js/**/*', '!js/init.js'],
|
|
446
|
+
tasks: ['js_compile'],
|
|
447
|
+
options: {
|
|
448
|
+
interrupt: false,
|
|
449
|
+
spawn: false
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
|
|
453
|
+
sass: {
|
|
454
|
+
files: ['sass/**/*'],
|
|
455
|
+
tasks: ['sass_compile'],
|
|
456
|
+
options: {
|
|
457
|
+
interrupt: false,
|
|
458
|
+
spawn: false
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
|
|
463
|
+
// Concurrent
|
|
464
|
+
concurrent: {
|
|
465
|
+
options: {
|
|
466
|
+
logConcurrentOutput: true,
|
|
467
|
+
limit: 10
|
|
468
|
+
},
|
|
469
|
+
monitor: {
|
|
470
|
+
tasks: [
|
|
471
|
+
'pug_compile',
|
|
472
|
+
'sass_compile',
|
|
473
|
+
'js_compile',
|
|
474
|
+
'watch:pug',
|
|
475
|
+
'watch:js',
|
|
476
|
+
'watch:sass',
|
|
477
|
+
'notify:watching',
|
|
478
|
+
'server'
|
|
479
|
+
]
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
|
|
483
|
+
// Notifications
|
|
484
|
+
notify: {
|
|
485
|
+
watching: {
|
|
486
|
+
options: {
|
|
487
|
+
enabled: true,
|
|
488
|
+
message: 'Watching Files!',
|
|
489
|
+
title: 'Materialize', // defaults to the name in package.json, or will use project directory's name
|
|
490
|
+
success: true, // whether successful grunt executions should be notified automatically
|
|
491
|
+
duration: 1 // the duration of notification in seconds, for `notify-send only
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
|
|
495
|
+
sass_compile: {
|
|
496
|
+
options: {
|
|
497
|
+
enabled: true,
|
|
498
|
+
message: 'Sass Compiled!',
|
|
499
|
+
title: 'Materialize',
|
|
500
|
+
success: true,
|
|
501
|
+
duration: 1
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
|
|
505
|
+
js_compile: {
|
|
506
|
+
options: {
|
|
507
|
+
enabled: true,
|
|
508
|
+
message: 'JS Compiled!',
|
|
509
|
+
title: 'Materialize',
|
|
510
|
+
success: true,
|
|
511
|
+
duration: 1
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
|
|
515
|
+
pug_compile: {
|
|
516
|
+
options: {
|
|
517
|
+
enabled: true,
|
|
518
|
+
message: 'Pug Compiled!',
|
|
519
|
+
title: 'Materialize',
|
|
520
|
+
success: true,
|
|
521
|
+
duration: 1
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
|
|
525
|
+
server: {
|
|
526
|
+
options: {
|
|
527
|
+
enabled: true,
|
|
528
|
+
message: 'Server Running!',
|
|
529
|
+
title: 'Materialize',
|
|
530
|
+
success: true,
|
|
531
|
+
duration: 1
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
|
|
536
|
+
// Replace text to update the version string
|
|
537
|
+
replace: {
|
|
538
|
+
version: {
|
|
539
|
+
src: ['bower.json', 'package.js', 'pug/**/*.html'],
|
|
540
|
+
overwrite: true,
|
|
541
|
+
replacements: [
|
|
542
|
+
{
|
|
543
|
+
from: grunt.option('oldver'),
|
|
544
|
+
to: grunt.option('newver')
|
|
545
|
+
}
|
|
546
|
+
]
|
|
547
|
+
},
|
|
548
|
+
package_json: {
|
|
549
|
+
src: ['package.json'],
|
|
550
|
+
overwrite: true,
|
|
551
|
+
replacements: [
|
|
552
|
+
{
|
|
553
|
+
from: '"version": "' + grunt.option('oldver'),
|
|
554
|
+
to: '"version": "' + grunt.option('newver')
|
|
555
|
+
}
|
|
556
|
+
]
|
|
557
|
+
},
|
|
558
|
+
docs: {
|
|
559
|
+
src: ['.gitignore'],
|
|
560
|
+
overwrite: true,
|
|
561
|
+
replacements: [
|
|
562
|
+
{
|
|
563
|
+
from: '/docs/*.html',
|
|
564
|
+
to: ''
|
|
565
|
+
}
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
|
|
570
|
+
// Create Version Header for files
|
|
571
|
+
usebanner: {
|
|
572
|
+
release: {
|
|
573
|
+
options: {
|
|
574
|
+
position: 'top',
|
|
575
|
+
banner:
|
|
576
|
+
'/*!\n * Materialize v' +
|
|
577
|
+
grunt.option('newver') +
|
|
578
|
+
' (https://materializecss.github.io/materialize)\n * Copyright 2014-2021 Materialize\n * MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE)\n */',
|
|
579
|
+
linebreak: true
|
|
580
|
+
},
|
|
581
|
+
files: {
|
|
582
|
+
src: ['dist/css/*.css', 'dist/js/*.js']
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
|
|
587
|
+
// Rename files
|
|
588
|
+
rename: {
|
|
589
|
+
rename_src: {
|
|
590
|
+
src: 'bin/materialize-src' + '.zip',
|
|
591
|
+
dest: 'bin/materialize-src-v' + grunt.option('newver') + '.zip',
|
|
592
|
+
options: {
|
|
593
|
+
ignore: true
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
rename_compiled: {
|
|
597
|
+
src: 'bin/materialize' + '.zip',
|
|
598
|
+
dest: 'bin/materialize-v' + grunt.option('newver') + '.zip',
|
|
599
|
+
options: {
|
|
600
|
+
ignore: true
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
|
|
605
|
+
connect: {
|
|
606
|
+
server: {
|
|
607
|
+
options: {
|
|
608
|
+
port: 9001,
|
|
609
|
+
protocol: 'http',
|
|
610
|
+
middleware: function(connect, options, middlewares) {
|
|
611
|
+
middlewares.unshift(function(req, res, next){
|
|
612
|
+
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
613
|
+
res.setHeader('Access-Control-Allow-Credentials', true);
|
|
614
|
+
res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
|
615
|
+
res.setHeader('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
|
|
616
|
+
next();
|
|
617
|
+
});
|
|
618
|
+
return middlewares;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
|
|
624
|
+
copy: {
|
|
625
|
+
docs_js: {
|
|
626
|
+
files: [
|
|
627
|
+
{src: 'bin/materialize.js', dest: 'docs/js/materialize.js'},
|
|
628
|
+
]
|
|
629
|
+
},
|
|
630
|
+
docs_templates: {
|
|
631
|
+
files: [
|
|
632
|
+
{src: 'templates/**', dest: 'docs/'}
|
|
633
|
+
]
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
grunt.initConfig(config);
|
|
640
|
+
|
|
641
|
+
// load the tasks
|
|
642
|
+
// grunt.loadNpmTasks('grunt-gitinfo');
|
|
643
|
+
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
644
|
+
grunt.loadNpmTasks('grunt-sass');
|
|
645
|
+
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
646
|
+
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
647
|
+
grunt.loadNpmTasks('grunt-contrib-compress');
|
|
648
|
+
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
649
|
+
grunt.loadNpmTasks('grunt-contrib-pug');
|
|
650
|
+
grunt.loadNpmTasks('grunt-concurrent');
|
|
651
|
+
grunt.loadNpmTasks('grunt-notify');
|
|
652
|
+
grunt.loadNpmTasks('grunt-text-replace');
|
|
653
|
+
grunt.loadNpmTasks('grunt-banner');
|
|
654
|
+
grunt.loadNpmTasks('grunt-rename-util');
|
|
655
|
+
grunt.loadNpmTasks('grunt-browser-sync');
|
|
656
|
+
grunt.loadNpmTasks('grunt-contrib-jasmine');
|
|
657
|
+
grunt.loadNpmTasks('grunt-postcss');
|
|
658
|
+
grunt.loadNpmTasks('grunt-babel');
|
|
659
|
+
grunt.loadNpmTasks('grunt-contrib-connect');
|
|
660
|
+
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
661
|
+
|
|
662
|
+
// define the tasks
|
|
663
|
+
grunt.registerTask('release', [
|
|
664
|
+
'sass:expanded',
|
|
665
|
+
'sass:min',
|
|
666
|
+
'postcss:expanded',
|
|
667
|
+
'postcss:min',
|
|
668
|
+
'concat:dist',
|
|
669
|
+
'babel:dist',
|
|
670
|
+
'uglify:dist',
|
|
671
|
+
'uglify:extras',
|
|
672
|
+
'usebanner:release',
|
|
673
|
+
'compress:main',
|
|
674
|
+
'compress:src',
|
|
675
|
+
'compress:starter_template',
|
|
676
|
+
'compress:parallax_template',
|
|
677
|
+
'replace:version',
|
|
678
|
+
'replace:package_json',
|
|
679
|
+
'rename:rename_src',
|
|
680
|
+
'rename:rename_compiled',
|
|
681
|
+
'clean:temp'
|
|
682
|
+
]);
|
|
683
|
+
|
|
684
|
+
grunt.task.registerTask('configureBabel', 'configures babel options', function() {
|
|
685
|
+
config.babel.bin.options.inputSourceMap = grunt.file.readJSON(concatFile);
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
grunt.registerTask('pug_compile', ['pug', 'notify:pug_compile']);
|
|
689
|
+
grunt.registerTask('js_compile', ['concat:temp', 'configureBabel', 'babel:bin', 'clean:temp', 'copy:docs_js']);
|
|
690
|
+
grunt.registerTask('sass_compile', [
|
|
691
|
+
'sass:gh',
|
|
692
|
+
'sass:bin',
|
|
693
|
+
'postcss:gh',
|
|
694
|
+
'postcss:bin',
|
|
695
|
+
'notify:sass_compile'
|
|
696
|
+
]);
|
|
697
|
+
grunt.registerTask('server', ['browserSync', 'notify:server']);
|
|
698
|
+
grunt.registerTask('monitor', ['concurrent:monitor']);
|
|
699
|
+
grunt.registerTask('test', ['js_compile', 'sass_compile', 'connect', 'jasmine']);
|
|
700
|
+
grunt.registerTask('jas_test', ['connect', 'jasmine']);
|
|
701
|
+
grunt.registerTask('test_repeat', function(){
|
|
702
|
+
const tasks = ['connect'];
|
|
703
|
+
const n = 30;
|
|
704
|
+
for (let i = 0; i < n; i++) {
|
|
705
|
+
tasks.push('jasmine');
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
grunt.task.run(tasks);
|
|
709
|
+
|
|
710
|
+
});
|
|
711
|
+
grunt.registerTask('docs', ['js_compile', 'copy:docs_js', 'copy:docs_templates', 'sass:gh', 'postcss:gh', 'pug', 'replace:docs']);
|
|
712
|
+
};
|