material-sass 4.0.0.alpha6 → 4.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +36 -8
- data/Rakefile +16 -3
- data/app/assets/javascripts/material-sprockets.js +6 -1
- data/app/assets/javascripts/material.js +654 -417
- data/app/assets/javascripts/material.min.js +1 -0
- data/app/assets/javascripts/material/addons/picker.date.js +234 -0
- data/app/assets/javascripts/material/addons/picker.js +172 -0
- data/app/assets/javascripts/material/addons/textarea-autosize.js +20 -2
- data/app/assets/javascripts/material/addons/waves.js +127 -0
- data/app/assets/javascripts/material/components/floating-label.js +92 -0
- data/app/assets/javascripts/material/components/navdrawer.js +353 -0
- data/app/assets/javascripts/material/components/selection-control-focus.js +47 -0
- data/app/assets/javascripts/material/components/tab-switch.js +148 -0
- data/app/assets/javascripts/material/components/util.js +133 -0
- data/app/assets/javascripts/material/initializers/picker.js +171 -0
- data/app/assets/javascripts/material/initializers/textarea-autosize.js +10 -0
- data/app/assets/javascripts/material/initializers/waves.js +13 -0
- data/app/assets/stylesheets/material/_colours.scss +324 -0
- data/app/assets/stylesheets/material/_functions.scss +65 -0
- data/app/assets/stylesheets/material/_mixins.scss +23 -23
- data/app/assets/stylesheets/material/_print.scss +102 -0
- data/app/assets/stylesheets/material/_utilities.scss +21 -17
- data/app/assets/stylesheets/material/_variables.scss +13 -42
- data/app/assets/stylesheets/material/base/_base.scss +420 -5
- data/app/assets/stylesheets/material/base/_grid.scss +34 -33
- data/app/assets/stylesheets/material/base/_typography.scss +165 -174
- data/app/assets/stylesheets/material/bootstrap/_alert.scss +32 -39
- data/app/assets/stylesheets/material/bootstrap/_badge.scss +34 -0
- data/app/assets/stylesheets/material/bootstrap/_breadcrumb.scss +18 -18
- data/app/assets/stylesheets/material/bootstrap/_carousel.scss +127 -142
- data/app/assets/stylesheets/material/bootstrap/_close.scss +18 -19
- data/app/assets/stylesheets/material/bootstrap/_code.scss +10 -7
- data/app/assets/stylesheets/material/bootstrap/_custom-form.scss +50 -56
- data/app/assets/stylesheets/material/bootstrap/_form.scss +159 -129
- data/app/assets/stylesheets/material/bootstrap/_image.scss +19 -16
- data/app/assets/stylesheets/material/bootstrap/_jumbotron.scss +10 -7
- data/app/assets/stylesheets/material/bootstrap/_nav.scss +71 -69
- data/app/assets/stylesheets/material/bootstrap/_pagination.scss +34 -26
- data/app/assets/stylesheets/material/bootstrap/_popover.scss +26 -59
- data/app/assets/stylesheets/material/bootstrap/_responsive-embed.scss +4 -4
- data/app/assets/stylesheets/material/bootstrap/_transition.scss +10 -8
- data/app/assets/stylesheets/material/material.scss +75 -62
- data/app/assets/stylesheets/material/material/_button-flat.scss +26 -39
- data/app/assets/stylesheets/material/material/_button-float.scss +10 -14
- data/app/assets/stylesheets/material/material/_button-group.scss +268 -0
- data/app/assets/stylesheets/material/material/_button.scss +133 -189
- data/app/assets/stylesheets/material/material/_card.scss +300 -248
- data/app/assets/stylesheets/material/material/_chip.scss +65 -64
- data/app/assets/stylesheets/material/material/_data-table.scss +135 -45
- data/app/assets/stylesheets/material/material/_dialog.scss +141 -110
- data/app/assets/stylesheets/material/material/_expansion-panel.scss +86 -119
- data/app/assets/stylesheets/material/material/_menu.scss +308 -228
- data/app/assets/stylesheets/material/material/_navdrawer.scss +239 -234
- data/app/assets/stylesheets/material/material/_picker.scss +157 -155
- data/app/assets/stylesheets/material/material/_progress-circular.scss +80 -80
- data/app/assets/stylesheets/material/material/_progress.scss +180 -115
- data/app/assets/stylesheets/material/material/_selection-control.scss +132 -139
- data/app/assets/stylesheets/material/material/_stepper.scss +94 -93
- data/app/assets/stylesheets/material/material/_tab.scss +74 -93
- data/app/assets/stylesheets/material/material/_text-field-floating-label.scss +29 -20
- data/app/assets/stylesheets/material/material/_text-field-input-group.scss +94 -24
- data/app/assets/stylesheets/material/material/_text-field-textarea.scss +13 -26
- data/app/assets/stylesheets/material/material/_text-field.scss +127 -118
- data/app/assets/stylesheets/material/material/_toolbar.scss +308 -313
- data/app/assets/stylesheets/material/material/_tooltip.scss +23 -62
- data/app/assets/stylesheets/material/mixins/_background-variant.scss +6 -6
- data/app/assets/stylesheets/material/mixins/_border-radius.scss +17 -17
- data/app/assets/stylesheets/material/mixins/_breakpoint.scss +32 -2
- data/app/assets/stylesheets/material/mixins/_clearfix.scss +1 -1
- data/app/assets/stylesheets/material/mixins/_form.scss +62 -25
- data/app/assets/stylesheets/material/mixins/_grid-framework.scss +8 -16
- data/app/assets/stylesheets/material/mixins/_grid.scss +40 -64
- data/app/assets/stylesheets/material/mixins/_material-icons.scss +36 -0
- data/app/assets/stylesheets/material/mixins/_nav-divider.scss +1 -1
- data/app/assets/stylesheets/material/mixins/_reset-text.scss +2 -21
- data/app/assets/stylesheets/material/mixins/_screenreader.scss +14 -12
- data/app/assets/stylesheets/material/mixins/_text-alignment.scss +23 -0
- data/app/assets/stylesheets/material/mixins/_text-emphasis.scss +6 -6
- data/app/assets/stylesheets/material/mixins/_transition.scss +42 -10
- data/app/assets/stylesheets/material/utilities/_background.scss +18 -18
- data/app/assets/stylesheets/material/utilities/_border.scss +88 -41
- data/app/assets/stylesheets/material/utilities/_display.scss +63 -30
- data/app/assets/stylesheets/material/utilities/_flex.scss +139 -134
- data/app/assets/stylesheets/material/utilities/_material-icons.scss +3 -5
- data/app/assets/stylesheets/material/utilities/_position.scss +19 -22
- data/app/assets/stylesheets/material/utilities/_sizing.scss +11 -12
- data/app/assets/stylesheets/material/utilities/_spacing.scss +51 -56
- data/app/assets/stylesheets/material/utilities/_text.scss +80 -75
- data/app/assets/stylesheets/material/utilities/_visibility.scss +5 -46
- data/app/assets/stylesheets/material/utilities/_waves.scss +11 -18
- data/app/assets/stylesheets/material/variables/_elevation-shadow.scss +89 -82
- data/app/assets/stylesheets/material/variables/_grid.scss +29 -26
- data/app/assets/stylesheets/material/variables/_palette.scss +45 -0
- data/app/assets/stylesheets/material/variables/_spacer.scss +34 -88
- data/app/assets/stylesheets/material/variables/_transition.scss +29 -0
- data/app/assets/stylesheets/material/variables/_typography.scss +88 -74
- data/app/assets/stylesheets/material/variables/_variable-bootstrap.scss +196 -133
- data/app/assets/stylesheets/material/variables/_variable-material.scss +481 -429
- data/lib/material-sass/version.rb +1 -1
- data/material-sass.gemspec +3 -3
- metadata +26 -21
- data/app/assets/javascripts/material/addons-materialise/pickadate.js +0 -139
- data/app/assets/javascripts/material/addons-materialise/textarea-autosize.js +0 -11
- data/app/assets/javascripts/material/addons-materialise/wave.js +0 -15
- data/app/assets/javascripts/material/addons/pickadate.js +0 -7
- data/app/assets/javascripts/material/addons/wave.js +0 -5
- data/app/assets/javascripts/material/src/floating-label.js +0 -91
- data/app/assets/javascripts/material/src/navdrawer.js +0 -352
- data/app/assets/javascripts/material/src/tab-switch.js +0 -133
- data/app/assets/javascripts/material/src/util.js +0 -138
- data/app/assets/stylesheets/material/base/_normalize.scss +0 -253
- data/app/assets/stylesheets/material/base/_reboot.scss +0 -239
- data/app/assets/stylesheets/material/bootstrap/_button-group.scss +0 -134
- data/app/assets/stylesheets/material/mixins/_tab-focus.scss +0 -5
- data/app/assets/stylesheets/material/mixins/_transform.scss +0 -9
- data/app/assets/stylesheets/material/variables/_animation.scss +0 -22
- data/app/assets/stylesheets/material/variables/_colour.scss +0 -389
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61c44b7409742cf924a6feb886149430c7b52c2f
|
4
|
+
data.tar.gz: 9ba84b87234c61fdc147ba388c7f26ef5b5fb72d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e76230785b16a2e96f3156316659e35bd19b8e9b4538fd42bf33a20fda76f42d6d1e2c7a3970c32d8dfb1773f1b87b0e8ec42c10b444b80d020b27f9b12ec8e4
|
7
|
+
data.tar.gz: fc7dfb3f3abe74d205fa5cd4d221bbbec4fd3f4edde723a20acbeddf1bf8abee540c0c2de96ca0a700555f76032fa7e8c00eb8a61f9864df4bf7c0a1ee834370
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,19 +1,30 @@
|
|
1
|
-
# Material-sass
|
1
|
+
# Material-sass [![Gem Version](https://badge.fury.io/rb/material-sass.svg)](http://badge.fury.io/rb/material-sass)
|
2
|
+
|
3
|
+
`material-sass` is a rubygems version of Material Design for Bootstrap 4
|
4
|
+
|
5
|
+
Offical repo [github.com/Daemonite/material](https://github.com/Daemonite/material)
|
6
|
+
|
7
|
+
Documentation [daemonite.github.io/material](http://daemonite.github.io/material)
|
8
|
+
|
9
|
+
|
10
|
+
## Dependencies
|
11
|
+
|
12
|
+
**Rails 5.1+**
|
13
|
+
The Rails JavaScript helpers has been rewritten in a new gem called rails-ujs and they use vanilla JavaScript, so jQuery is not a dependency of Rails anymore.
|
14
|
+
Since bootstrap relies on it, install it with ```bin/yarn add jquery``` or via ```gem 'jquery-rails'``` and add ```//= require jquery``` to ```application.js```.
|
15
|
+
|
16
|
+
**NOTE:** Ensure that the `sass-rails` gem is presented in your Gemfile.
|
2
17
|
|
3
|
-
[![Join the chat at https://gitter.im/mkhairi/material-sass](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mkhairi/material-sass?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
18
|
|
5
|
-
`material-sass` is a Sass rubygems version of Material, a HTML5 UI design based on Google Material. Offical repo [github.com/Daemonite/material](https://github.com/Daemonite/material)
|
6
19
|
|
7
20
|
## Installation
|
8
21
|
|
9
22
|
Add this line to your application's Gemfile:
|
10
23
|
|
11
24
|
```ruby
|
25
|
+
gem 'bootstrap'
|
12
26
|
gem 'material-sass'
|
13
27
|
```
|
14
|
-
|
15
|
-
**NOTE:** Ensure that the `sass-rails` gem is presented in your Gemfile.
|
16
|
-
|
17
28
|
And then run the bundler and restart your server to make the files available through the pipeline:
|
18
29
|
|
19
30
|
```console
|
@@ -48,13 +59,30 @@ Require Material javascripts in `app/assets/javascripts/application.js`:
|
|
48
59
|
|
49
60
|
```js
|
50
61
|
//= require jquery
|
51
|
-
//= require
|
62
|
+
//= require bootstrap
|
63
|
+
//= require material
|
52
64
|
```
|
53
65
|
|
66
|
+
### c. Icons
|
67
|
+
|
68
|
+
Include this line in the <head>portion of your HTML code
|
69
|
+
|
70
|
+
``` <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> ```
|
71
|
+
|
72
|
+
or import this line in your application.scss
|
73
|
+
|
74
|
+
``` @import "https://fonts.googleapis.com/icon?family=Material+Icons"; ```
|
75
|
+
|
76
|
+
or install this gem for offline icons
|
77
|
+
|
78
|
+
``` gem 'material_icons' ```
|
79
|
+
|
80
|
+
see [docs](https://github.com/Angelmmiguel/material_icons)
|
54
81
|
|
55
82
|
## Contributing
|
83
|
+
note: Any changes or Pull Request regarding material assets should be made in official [material](https://github.com/Daemonite/material) repo.
|
56
84
|
|
57
|
-
1. Fork it ( https://github.com/
|
85
|
+
1. Fork it ( https://github.com/mkhairi/material-sass/fork )
|
58
86
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
59
87
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
60
88
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
@@ -9,13 +9,26 @@ namespace :javascripts do
|
|
9
9
|
rm_rf "app/assets/javascripts/material"
|
10
10
|
end
|
11
11
|
|
12
|
-
desc "Copy #{source_dir}/assets/js/"
|
12
|
+
desc "Copy #{source_dir}/assets/js/src"
|
13
13
|
task :copy do
|
14
|
-
src_dir = "#{source_dir}/assets/js/."
|
14
|
+
src_dir = "#{source_dir}/dist/assets/js/src/."
|
15
|
+
tgt_dir = "app/assets/javascripts/material/components"
|
16
|
+
mkdir_p tgt_dir
|
17
|
+
cp_r src_dir, tgt_dir
|
18
|
+
cp "#{source_dir}/js/material.js", "app/assets/javascripts/material.js"
|
19
|
+
cp "#{source_dir}/js/material.min.js", "app/assets/javascripts/material.min.js"
|
20
|
+
|
21
|
+
|
22
|
+
src_dir = "#{source_dir}/dist/assets/js/addons"
|
15
23
|
tgt_dir = "app/assets/javascripts/material/"
|
16
24
|
mkdir_p tgt_dir
|
17
25
|
cp_r src_dir, tgt_dir
|
18
|
-
|
26
|
+
|
27
|
+
src_dir = "#{source_dir}/dist/assets/js/addons-materialise/."
|
28
|
+
tgt_dir = "app/assets/javascripts/material/initializers"
|
29
|
+
mkdir_p tgt_dir
|
30
|
+
cp_r src_dir, tgt_dir
|
31
|
+
|
19
32
|
end
|
20
33
|
|
21
34
|
|
@@ -1 +1,6 @@
|
|
1
|
-
//= require_tree ./material
|
1
|
+
//= require_tree ./material/components
|
2
|
+
//= require ./material/addons/picker
|
3
|
+
//= require ./material/addons/picker.date
|
4
|
+
//= require ./material/addons/textarea-autosize
|
5
|
+
//= require ./material/addons/waves
|
6
|
+
//= require_tree ./material/initializers
|
@@ -1,88 +1,281 @@
|
|
1
1
|
/*!
|
2
|
-
* Material
|
2
|
+
* Material v4.0.0-beta (http://daemonite.github.io/material/)
|
3
|
+
* Copyright 2017 Daemon Pty Ltd
|
4
|
+
* Licensed under MIT (https://github.com/Daemonite/material/blob/master/LICENSE)
|
3
5
|
*/
|
6
|
+
|
4
7
|
if (typeof jQuery === 'undefined') {
|
5
8
|
throw new Error('Material\'s JavaScript requires jQuery')
|
6
9
|
}
|
7
10
|
|
8
11
|
+function ($) {
|
9
12
|
var version = $.fn.jquery.split(' ')[0].split('.')
|
10
|
-
if (
|
11
|
-
throw new Error('Material\'s JavaScript requires at least jQuery
|
13
|
+
if (version[0] < 3 || version[0] >= 4) {
|
14
|
+
throw new Error('Material\'s JavaScript requires at least jQuery v3.0.0 but less than v4.0.0')
|
12
15
|
}
|
13
16
|
}(jQuery);
|
14
17
|
|
18
|
+
!function(a){this.Picker=a(jQuery)}(function(a){function b(f,g,i,m){function n(){return b._.node("div",b._.node("div",b._.node("div",b._.node("div",B.component.nodes(w.open),y.box),y.wrap),y.frame),y.holder,'tabindex="-1"')}function o(){z.data(g,B).addClass(y.input).val(z.data("value")?B.get("select",x.format):f.value),x.editable||z.on("focus."+w.id+" click."+w.id,function(a){a.preventDefault(),B.open()}).on("keydown."+w.id,u),e(f,{haspopup:!0,expanded:!1,readonly:!1,owns:f.id+"_root"})}function p(){e(B.$root[0],"hidden",!0)}function q(){B.$holder.on({keydown:u,"focus.toOpen":t,blur:function(){z.removeClass(y.target)},focusin:function(a){B.$root.removeClass(y.focused),a.stopPropagation()},"mousedown click":function(b){var c=b.target;c!=B.$holder[0]&&(b.stopPropagation(),"mousedown"!=b.type||a(c).is("input, select, textarea, button, option")||(b.preventDefault(),B.$holder[0].focus()))}}).on("click","[data-pick], [data-nav], [data-clear], [data-close]",function(){var b=a(this),c=b.data(),d=b.hasClass(y.navDisabled)||b.hasClass(y.disabled),e=h();e=e&&(e.type||e.href),(d||e&&!a.contains(B.$root[0],e))&&B.$holder[0].focus(),!d&&c.nav?B.set("highlight",B.component.item.highlight,{nav:c.nav}):!d&&"pick"in c?(B.set("select",c.pick),x.closeOnSelect&&B.close(!0)):c.clear?(B.clear(),x.closeOnClear&&B.close(!0)):c.close&&B.close(!0)})}function r(){var b;x.hiddenName===!0?(b=f.name,f.name=""):(b=["string"==typeof x.hiddenPrefix?x.hiddenPrefix:"","string"==typeof x.hiddenSuffix?x.hiddenSuffix:"_submit"],b=b[0]+f.name+b[1]),B._hidden=a('<input type=hidden name="'+b+'"'+(z.data("value")||f.value?' value="'+B.get("select",x.formatSubmit)+'"':"")+">")[0],z.on("change."+w.id,function(){B._hidden.value=f.value?B.get("select",x.formatSubmit):""})}function s(){v&&l?B.$holder.find("."+y.frame).one("transitionend",function(){B.$holder[0].focus()}):B.$holder[0].focus()}function t(a){a.stopPropagation(),z.addClass(y.target),B.$root.addClass(y.focused),B.open()}function u(a){var b=a.keyCode,c=/^(8|46)$/.test(b);return 27==b?(B.close(!0),!1):void((32==b||c||!w.open&&B.component.key[b])&&(a.preventDefault(),a.stopPropagation(),c?B.clear().close():B.open()))}if(!f)return b;var v=!1,w={id:f.id||"P"+Math.abs(~~(Math.random()*new Date))},x=i?a.extend(!0,{},i.defaults,m):m||{},y=a.extend({},b.klasses(),x.klass),z=a(f),A=function(){return this.start()},B=A.prototype={constructor:A,$node:z,start:function(){return w&&w.start?B:(w.methods={},w.start=!0,w.open=!1,w.type=f.type,f.autofocus=f==h(),f.readOnly=!x.editable,f.id=f.id||w.id,"text"!=f.type&&(f.type="text"),B.component=new i(B,x),B.$root=a('<div class="'+y.picker+'" id="'+f.id+'_root" />'),p(),B.$holder=a(n()).appendTo(B.$root),q(),x.formatSubmit&&r(),o(),x.containerHidden?a(x.containerHidden).append(B._hidden):z.after(B._hidden),x.container?a(x.container).append(B.$root):z.after(B.$root),B.on({start:B.component.onStart,render:B.component.onRender,stop:B.component.onStop,open:B.component.onOpen,close:B.component.onClose,set:B.component.onSet}).on({start:x.onStart,render:x.onRender,stop:x.onStop,open:x.onOpen,close:x.onClose,set:x.onSet}),v=c(B.$holder[0]),f.autofocus&&B.open(),B.trigger("start").trigger("render"))},render:function(b){return b?(B.$holder=a(n()),q(),B.$root.html(B.$holder)):B.$root.find("."+y.box).html(B.component.nodes(w.open)),B.trigger("render")},stop:function(){return w.start?(B.close(),B._hidden&&B._hidden.parentNode.removeChild(B._hidden),B.$root.remove(),z.removeClass(y.input).removeData(g),setTimeout(function(){z.off("."+w.id)},0),f.type=w.type,f.readOnly=!1,B.trigger("stop"),w.methods={},w.start=!1,B):B},open:function(c){return w.open?B:(z.addClass(y.active),e(f,"expanded",!0),setTimeout(function(){B.$root.addClass(y.opened),e(B.$root[0],"hidden",!1)},0),c!==!1&&(w.open=!0,v&&k.css("overflow","hidden").css("padding-right","+="+d()),s(),j.on("click."+w.id+" focusin."+w.id,function(a){var b=a.target;b!=f&&b!=document&&3!=a.which&&B.close(b===B.$holder[0])}).on("keydown."+w.id,function(c){var d=c.keyCode,e=B.component.key[d],f=c.target;27==d?B.close(!0):f!=B.$holder[0]||!e&&13!=d?a.contains(B.$root[0],f)&&13==d&&(c.preventDefault(),f.click()):(c.preventDefault(),e?b._.trigger(B.component.key.go,B,[b._.trigger(e)]):B.$root.find("."+y.highlighted).hasClass(y.disabled)||(B.set("select",B.component.item.highlight),x.closeOnSelect&&B.close(!0)))})),B.trigger("open"))},close:function(a){return a&&(x.editable?f.focus():(B.$holder.off("focus.toOpen").focus(),setTimeout(function(){B.$holder.on("focus.toOpen",t)},0))),z.removeClass(y.active),e(f,"expanded",!1),setTimeout(function(){B.$root.removeClass(y.opened+" "+y.focused),e(B.$root[0],"hidden",!0)},0),w.open?(w.open=!1,v&&k.css("overflow","").css("padding-right","-="+d()),j.off("."+w.id),B.trigger("close")):B},clear:function(a){return B.set("clear",null,a)},set:function(b,c,d){var e,f,g=a.isPlainObject(b),h=g?b:{};if(d=g&&a.isPlainObject(c)?c:d||{},b){g||(h[b]=c);for(e in h)f=h[e],e in B.component.item&&(void 0===f&&(f=null),B.component.set(e,f,d)),("select"==e||"clear"==e)&&z.val("clear"==e?"":B.get(e,x.format)).trigger("change");B.render()}return d.muted?B:B.trigger("set",h)},get:function(a,c){if(a=a||"value",null!=w[a])return w[a];if("valueSubmit"==a){if(B._hidden)return B._hidden.value;a="value"}if("value"==a)return f.value;if(a in B.component.item){if("string"==typeof c){var d=B.component.get(a);return d?b._.trigger(B.component.formats.toString,B.component,[c,d]):""}return B.component.get(a)}},on:function(b,c,d){var e,f,g=a.isPlainObject(b),h=g?b:{};if(b){g||(h[b]=c);for(e in h)f=h[e],d&&(e="_"+e),w.methods[e]=w.methods[e]||[],w.methods[e].push(f)}return B},off:function(){var a,b,c=arguments;for(a=0,namesCount=c.length;a<namesCount;a+=1)b=c[a],b in w.methods&&delete w.methods[b];return B},trigger:function(a,c){var d=function(a){var d=w.methods[a];d&&d.map(function(a){b._.trigger(a,B,[c])})};return d("_"+a),d(a),B}};return new A}function c(a){var b,c="position";return a.currentStyle?b=a.currentStyle[c]:window.getComputedStyle&&(b=getComputedStyle(a)[c]),"fixed"==b}function d(){if(k.height()<=i.height())return 0;var b=a('<div style="visibility:hidden;width:100px" />').appendTo("body"),c=b[0].offsetWidth;b.css("overflow","scroll");var d=a('<div style="width:100%" />').appendTo(b),e=d[0].offsetWidth;return b.remove(),c-e}function e(b,c,d){if(a.isPlainObject(c))for(var e in c)f(b,e,c[e]);else f(b,c,d)}function f(a,b,c){a.setAttribute(("role"==b?"":"aria-")+b,c)}function g(b,c){a.isPlainObject(b)||(b={attribute:c}),c="";for(var d in b){var e=("role"==d?"":"aria-")+d,f=b[d];c+=null==f?"":e+'="'+b[d]+'"'}return c}function h(){try{return document.activeElement}catch(a){}}var i=a(window),j=a(document),k=a(document.documentElement),l=null!=document.documentElement.style.transition;return b.klasses=function(a){return a=a||"picker",{picker:a,opened:a+"--opened",focused:a+"--focused",input:a+"__input",active:a+"__input--active",target:a+"__input--target",holder:a+"__holder",frame:a+"__frame",wrap:a+"__wrap",box:a+"__box"}},b._={group:function(a){for(var c,d="",e=b._.trigger(a.min,a);e<=b._.trigger(a.max,a,[e]);e+=a.i)c=b._.trigger(a.item,a,[e]),d+=b._.node(a.node,c[0],c[1],c[2]);return d},node:function(b,c,d,e){return c?(c=a.isArray(c)?c.join(""):c,d=d?' class="'+d+'"':"",e=e?" "+e:"","<"+b+d+e+">"+c+"</"+b+">"):""},lead:function(a){return(10>a?"0":"")+a},trigger:function(a,b,c){return"function"==typeof a?a.apply(b,c||[]):a},digits:function(a){return/\d/.test(a[1])?2:1},isDate:function(a){return{}.toString.call(a).indexOf("Date")>-1&&this.isInteger(a.getDate())},isInteger:function(a){return{}.toString.call(a).indexOf("Number")>-1&&a%1===0},ariaAttr:g},b.extend=function(c,d){a.fn[c]=function(e,f){var g=this.data(c);return"picker"==e?g:g&&"string"==typeof e?b._.trigger(g[e],g,[f]):this.each(function(){var f=a(this);f.data(c)||new b(this,c,d,e)})},a.fn[c].defaults=d.defaults},b});
|
19
|
+
!function(a){a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0],e=d.value,f=a.$node.data("value"),g=f||e,h=f?b.formatSubmit:b.format,i=function(){return d.currentStyle?"rtl"==d.currentStyle.direction:"rtl"==getComputedStyle(a.$root[0]).direction};c.settings=b,c.$node=a.$node,c.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse navigate create validate",view:"parse create validate viewset",disable:"deactivate",enable:"activate"},c.item={},c.item.clear=null,c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now"),g?c.set("select",g,{format:h,defaultValue:!0}):c.set("select",null).set("highlight",c.item.now),c.key={40:7,38:-7,39:function(){return i()?-1:1},37:function(){return i()?1:-1},go:function(a){var b=c.item.highlight,d=new Date(b.year,b.month,b.date+a);c.set("highlight",d,{interval:a}),this.render()}},a.on("render",function(){a.$root.find("."+b.klass.selectMonth).on("change",function(){var c=this.value;c&&(a.set("highlight",[a.get("view").year,c,a.get("highlight").date]),a.$root.find("."+b.klass.selectMonth).trigger("focus"))}),a.$root.find("."+b.klass.selectYear).on("change",function(){var c=this.value;c&&(a.set("highlight",[c,a.get("view").month,a.get("highlight").date]),a.$root.find("."+b.klass.selectYear).trigger("focus"))})},1).on("open",function(){var d="";c.disabled(c.get("now"))&&(d=":not(."+b.klass.buttonToday+")"),a.$root.find("button"+d+", select").attr("disabled",!1)},1).on("close",function(){a.$root.find("button, select").attr("disabled",!0)},1)}var d=7,e=6,f=a._;c.prototype.set=function(a,b,c){var d=this,e=d.item;return null===b?("clear"==a&&(a="select"),e[a]=b,d):(e["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",e.select,c):"highlight"==a?d.set("view",e.highlight,c):a.match(/^(flip|min|max|disable|enable)$/)&&(e.select&&d.disabled(e.select)&&d.set("select",e.select,c),e.highlight&&d.disabled(e.highlight)&&d.set("highlight",e.highlight,c)),d)},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(a,c,d){var e,g=this;return c=void 0===c?a:c,c==-(1/0)||c==1/0?e=c:b.isPlainObject(c)&&f.isInteger(c.pick)?c=c.obj:b.isArray(c)?(c=new Date(c[0],c[1],c[2]),c=f.isDate(c)?c:g.create().obj):c=f.isInteger(c)||f.isDate(c)?g.normalize(new Date(c),d):g.now(a,c,d),{year:e||c.getFullYear(),month:e||c.getMonth(),date:e||c.getDate(),day:e||c.getDay(),obj:e||c,pick:e||c.getTime()}},c.prototype.createRange=function(a,c){var d=this,e=function(a){return a===!0||b.isArray(a)||f.isDate(a)?d.create(a):a};return f.isInteger(a)||(a=e(a)),f.isInteger(c)||(c=e(c)),f.isInteger(a)&&b.isPlainObject(c)?a=[c.year,c.month,c.date+a]:f.isInteger(c)&&b.isPlainObject(a)&&(c=[a.year,a.month,a.date+c]),{from:e(a),to:e(c)}},c.prototype.withinRange=function(a,b){return a=this.createRange(a.from,a.to),b.pick>=a.from.pick&&b.pick<=a.to.pick},c.prototype.overlapRanges=function(a,b){var c=this;return a=c.createRange(a.from,a.to),b=c.createRange(b.from,b.to),c.withinRange(a,b.from)||c.withinRange(a,b.to)||c.withinRange(b,a.from)||c.withinRange(b,a.to)},c.prototype.now=function(a,b,c){return b=new Date,c&&c.rel&&b.setDate(b.getDate()+c.rel),this.normalize(b,c)},c.prototype.navigate=function(a,c,d){var e,f,g,h,i=b.isArray(c),j=b.isPlainObject(c),k=this.item.view;if(i||j){for(j?(f=c.year,g=c.month,h=c.date):(f=+c[0],g=+c[1],h=+c[2]),d&&d.nav&&k&&k.month!==g&&(f=k.year,g=k.month),e=new Date(f,g+(d&&d.nav?d.nav:0),1),f=e.getFullYear(),g=e.getMonth();new Date(f,g,h).getMonth()!==g;)h-=1;c=[f,g,h]}return c},c.prototype.normalize=function(a){return a.setHours(0,0,0,0),a},c.prototype.measure=function(a,b){var c=this;return b?"string"==typeof b?b=c.parse(a,b):f.isInteger(b)&&(b=c.now(a,b,{rel:b})):b="min"==a?-(1/0):1/0,b},c.prototype.viewset=function(a,b){return this.create([b.year,b.month,1])},c.prototype.validate=function(a,c,d){var e,g,h,i,j=this,k=c,l=d&&d.interval?d.interval:1,m=-1===j.item.enable,n=j.item.min,o=j.item.max,p=m&&j.item.disable.filter(function(a){if(b.isArray(a)){var d=j.create(a).pick;d<c.pick?e=!0:d>c.pick&&(g=!0)}return f.isInteger(a)}).length;if((!d||!d.nav&&!d.defaultValue)&&(!m&&j.disabled(c)||m&&j.disabled(c)&&(p||e||g)||!m&&(c.pick<=n.pick||c.pick>=o.pick)))for(m&&!p&&(!g&&l>0||!e&&0>l)&&(l*=-1);j.disabled(c)&&(Math.abs(l)>1&&(c.month<k.month||c.month>k.month)&&(c=k,l=l>0?1:-1),c.pick<=n.pick?(h=!0,l=1,c=j.create([n.year,n.month,n.date+(c.pick===n.pick?0:-1)])):c.pick>=o.pick&&(i=!0,l=-1,c=j.create([o.year,o.month,o.date+(c.pick===o.pick?0:1)])),!h||!i);)c=j.create([c.year,c.month,c.date+l]);return c},c.prototype.disabled=function(a){var c=this,d=c.item.disable.filter(function(d){return f.isInteger(d)?a.day===(c.settings.firstDay?d:d-1)%7:b.isArray(d)||f.isDate(d)?a.pick===c.create(d).pick:b.isPlainObject(d)?c.withinRange(d,a):void 0});return d=d.length&&!d.filter(function(a){return b.isArray(a)&&"inverted"==a[3]||b.isPlainObject(a)&&a.inverted}).length,-1===c.item.enable?!d:d||a.pick<c.item.min.pick||a.pick>c.item.max.pick},c.prototype.parse=function(a,b,c){var d=this,e={};return b&&"string"==typeof b?(c&&c.format||(c=c||{},c.format=d.settings.format),d.formats.toArray(c.format).map(function(a){var c=d.formats[a],g=c?f.trigger(c,d,[b,e]):a.replace(/^!/,"").length;c&&(e[a]=b.substr(0,g)),b=b.substr(g)}),[e.yyyy||e.yy,+(e.mm||e.m)-1,e.dd||e.d]):b},c.prototype.formats=function(){function a(a,b,c){var d=a.match(/[^\x00-\x7F]+|\w+/)[0];return c.mm||c.m||(c.m=b.indexOf(d)+1),d.length}function b(a){return a.match(/\w+/)[0].length}return{d:function(a,b){return a?f.digits(a):b.date},dd:function(a,b){return a?2:f.lead(b.date)},ddd:function(a,c){return a?b(a):this.settings.weekdaysShort[c.day]},dddd:function(a,c){return a?b(a):this.settings.weekdaysFull[c.day]},m:function(a,b){return a?f.digits(a):b.month+1},mm:function(a,b){return a?2:f.lead(b.month+1)},mmm:function(b,c){var d=this.settings.monthsShort;return b?a(b,d,c):d[c.month]},mmmm:function(b,c){var d=this.settings.monthsFull;return b?a(b,d,c):d[c.month]},yy:function(a,b){return a?2:(""+b.year).slice(2)},yyyy:function(a,b){return a?4:b.year},toArray:function(a){return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(a,b){var c=this;return c.formats.toArray(a).map(function(a){return f.trigger(c.formats[a],c,[0,b])||a.replace(/^!/,"")}).join("")}}}(),c.prototype.isDateExact=function(a,c){var d=this;return f.isInteger(a)&&f.isInteger(c)||"boolean"==typeof a&&"boolean"==typeof c?a===c:(f.isDate(a)||b.isArray(a))&&(f.isDate(c)||b.isArray(c))?d.create(a).pick===d.create(c).pick:b.isPlainObject(a)&&b.isPlainObject(c)?d.isDateExact(a.from,c.from)&&d.isDateExact(a.to,c.to):!1},c.prototype.isDateOverlap=function(a,c){var d=this,e=d.settings.firstDay?1:0;return f.isInteger(a)&&(f.isDate(c)||b.isArray(c))?(a=a%7+e,a===d.create(c).day+1):f.isInteger(c)&&(f.isDate(a)||b.isArray(a))?(c=c%7+e,c===d.create(a).day+1):b.isPlainObject(a)&&b.isPlainObject(c)?d.overlapRanges(a,c):!1},c.prototype.flipEnable=function(a){var b=this.item;b.enable=a||(-1==b.enable?1:-1)},c.prototype.deactivate=function(a,c){var d=this,e=d.item.disable.slice(0);return"flip"==c?d.flipEnable():c===!1?(d.flipEnable(1),e=[]):c===!0?(d.flipEnable(-1),e=[]):c.map(function(a){for(var c,g=0;g<e.length;g+=1)if(d.isDateExact(a,e[g])){c=!0;break}c||(f.isInteger(a)||f.isDate(a)||b.isArray(a)||b.isPlainObject(a)&&a.from&&a.to)&&e.push(a)}),e},c.prototype.activate=function(a,c){var d=this,e=d.item.disable,g=e.length;return"flip"==c?d.flipEnable():c===!0?(d.flipEnable(1),e=[]):c===!1?(d.flipEnable(-1),e=[]):c.map(function(a){var c,h,i,j;for(i=0;g>i;i+=1){if(h=e[i],d.isDateExact(h,a)){c=e[i]=null,j=!0;break}if(d.isDateOverlap(h,a)){b.isPlainObject(a)?(a.inverted=!0,c=a):b.isArray(a)?(c=a,c[3]||c.push("inverted")):f.isDate(a)&&(c=[a.getFullYear(),a.getMonth(),a.getDate(),"inverted"]);break}}if(c)for(i=0;g>i;i+=1)if(d.isDateExact(e[i],a)){e[i]=null;break}if(j)for(i=0;g>i;i+=1)if(d.isDateOverlap(e[i],a)){e[i]=null;break}c&&e.push(c)}),e.filter(function(a){return null!=a})},c.prototype.nodes=function(a){var b=this,c=b.settings,g=b.item,h=g.now,i=g.select,j=g.highlight,k=g.view,l=g.disable,m=g.min,n=g.max,o=function(a,b){return c.firstDay&&(a.push(a.shift()),b.push(b.shift())),f.node("thead",f.node("tr",f.group({min:0,max:d-1,i:1,node:"th",item:function(d){return[a[d],c.klass.weekdays,'scope=col title="'+b[d]+'"']}})))}((c.showWeekdaysFull?c.weekdaysFull:c.weekdaysShort).slice(0),c.weekdaysFull.slice(0)),p=function(a){return f.node("div"," ",c.klass["nav"+(a?"Next":"Prev")]+(a&&k.year>=n.year&&k.month>=n.month||!a&&k.year<=m.year&&k.month<=m.month?" "+c.klass.navDisabled:""),"data-nav="+(a||-1)+" "+f.ariaAttr({role:"button",controls:b.$node[0].id+"_table"})+' title="'+(a?c.labelMonthNext:c.labelMonthPrev)+'"')},q=function(){var d=c.showMonthsShort?c.monthsShort:c.monthsFull;return c.selectMonths?f.node("select",f.group({min:0,max:11,i:1,node:"option",item:function(a){return[d[a],0,"value="+a+(k.month==a?" selected":"")+(k.year==m.year&&a<m.month||k.year==n.year&&a>n.month?" disabled":"")]}}),c.klass.selectMonth,(a?"":"disabled")+" "+f.ariaAttr({controls:b.$node[0].id+"_table"})+' title="'+c.labelMonthSelect+'"'):f.node("div",d[k.month],c.klass.month)},r=function(){var d=k.year,e=c.selectYears===!0?5:~~(c.selectYears/2);if(e){var g=m.year,h=n.year,i=d-e,j=d+e;if(g>i&&(j+=g-i,i=g),j>h){var l=i-g,o=j-h;i-=l>o?o:l,j=h}return f.node("select",f.group({min:i,max:j,i:1,node:"option",item:function(a){return[a,0,"value="+a+(d==a?" selected":"")]}}),c.klass.selectYear,(a?"":"disabled")+" "+f.ariaAttr({controls:b.$node[0].id+"_table"})+' title="'+c.labelYearSelect+'"')}return f.node("div",d,c.klass.year)};return f.node("div",(c.selectYears?r()+q():q()+r())+p()+p(1),c.klass.header)+f.node("table",o+f.node("tbody",f.group({min:0,max:e-1,i:1,node:"tr",item:function(a){var e=c.firstDay&&0===b.create([k.year,k.month,1]).day?-7:0;return[f.group({min:d*a-k.day+e+1,max:function(){return this.min+d-1},i:1,node:"td",item:function(a){a=b.create([k.year,k.month,a+(c.firstDay?1:0)]);var d=i&&i.pick==a.pick,e=j&&j.pick==a.pick,g=l&&b.disabled(a)||a.pick<m.pick||a.pick>n.pick,o=f.trigger(b.formats.toString,b,[c.format,a]);return[f.node("div",a.date,function(b){return b.push(k.month==a.month?c.klass.infocus:c.klass.outfocus),h.pick==a.pick&&b.push(c.klass.now),d&&b.push(c.klass.selected),e&&b.push(c.klass.highlighted),g&&b.push(c.klass.disabled),b.join(" ")}([c.klass.day]),"data-pick="+a.pick+" "+f.ariaAttr({role:"gridcell",label:o,selected:d&&b.$node.val()===o?!0:null,activedescendant:e?!0:null,disabled:g?!0:null})),"",f.ariaAttr({role:"presentation"})]}})]}})),c.klass.table,'id="'+b.$node[0].id+'_table" '+f.ariaAttr({role:"grid",controls:b.$node[0].id,readonly:!0}))+f.node("div",f.node("button",c.today,c.klass.buttonToday,"type=button data-pick="+h.pick+(a&&!b.disabled(h)?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id}))+f.node("button",c.clear,c.klass.buttonClear,"type=button data-clear=1"+(a?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id}))+f.node("button",c.close,c.klass.buttonClose,"type=button data-close=true "+(a?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id})),c.klass.footer)},c.defaults=function(a){return{labelMonthNext:"Next month",labelMonthPrev:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",close:"Close",closeOnSelect:!0,closeOnClear:!0,format:"d mmmm, yyyy",klass:{table:a+"table",header:a+"header",navPrev:a+"nav--prev",navNext:a+"nav--next",navDisabled:a+"nav--disabled",month:a+"month",year:a+"year",selectMonth:a+"select--month",selectYear:a+"select--year",weekdays:a+"weekday",day:a+"day",disabled:a+"day--disabled",selected:a+"day--selected",highlighted:a+"day--highlighted",now:a+"day--today",infocus:a+"day--infocus",outfocus:a+"day--outfocus",footer:a+"footer",buttonClear:a+"button--clear",buttonToday:a+"button--today",buttonClose:a+"button--close"}}}(a.klasses().picker+"__"),a.extend("pickadate",c)});
|
20
|
+
!function(a,b,c,d){function h(b,c){this.element=b,this.$element=a(b),this.init()}var e="textareaAutoSize",f="plugin_"+e,g=function(a){return a.replace(/\s/g,"").length>0};h.prototype={init:function(){var c=parseInt(this.$element.css("paddingBottom"))+parseInt(this.$element.css("paddingTop"))+parseInt(this.$element.css("borderTopWidth"))+parseInt(this.$element.css("borderBottomWidth"))||0;g(this.element.value)&&this.$element.height(this.element.scrollHeight-c),this.$element.on("input keyup",function(d){var e=a(b),f=e.scrollTop();a(this).height(0).height(this.scrollHeight-c),e.scrollTop(f)})}},a.fn[e]=function(b){return this.each(function(){a.data(this,f)||a.data(this,f,new h(this,b))}),this}}(jQuery,window,document);
|
21
|
+
|
22
|
+
!function(a,b){"use strict";"function"==typeof define&&define.amd?define([],function(){return b.apply(a)}):"object"==typeof exports?module.exports=b.call(a):a.Waves=b.call(a)}("object"==typeof global?global:this,function(){"use strict";function e(a){return null!==a&&a===a.window}function f(a){return e(a)?a:9===a.nodeType&&a.defaultView}function g(a){var b=typeof a;return"function"===b||"object"===b&&!!a}function h(a){return g(a)&&a.nodeType>0}function i(a){var d=c.call(a);return"[object String]"===d?b(a):g(a)&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(d)&&a.hasOwnProperty("length")?a:h(a)?[a]:[]}function j(a){var b,c,d={top:0,left:0},e=a&&a.ownerDocument;return b=e.documentElement,"undefined"!=typeof a.getBoundingClientRect&&(d=a.getBoundingClientRect()),c=f(e),{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}}function k(a){var b="";for(var c in a)a.hasOwnProperty(c)&&(b+=c+":"+a[c]+";");return b}function n(a,b,c,d){if(c){d.classList.remove("waves-wrapping"),c.classList.remove("waves-rippling");var e=c.getAttribute("data-x"),f=c.getAttribute("data-y"),g=c.getAttribute("data-scale"),h=c.getAttribute("data-translate"),i=Date.now()-Number(c.getAttribute("data-hold")),j=350-i;0>j&&(j=0),"mousemove"===a.type&&(j=150);var m="mousemove"===a.type?2500:l.duration;setTimeout(function(){var a={top:f+"px",left:e+"px",opacity:"0","-webkit-transition-duration":m+"ms","-moz-transition-duration":m+"ms","-o-transition-duration":m+"ms","transition-duration":m+"ms","-webkit-transform":g+" "+h,"-moz-transform":g+" "+h,"-ms-transform":g+" "+h,"-o-transform":g+" "+h,transform:g+" "+h};c.setAttribute("style",k(a)),setTimeout(function(){try{d.removeChild(c),b.removeChild(d)}catch(a){return!1}},m)},j)}}function p(a){if(o.allowEvent(a)===!1)return null;for(var b=null,c=a.target||a.srcElement;null!==c.parentElement;){if(c.classList.contains("waves-effect")&&!(c instanceof SVGElement)){b=c;break}c=c.parentElement}return b}function q(a){var b=p(a);if(null!==b){if(b.disabled||b.getAttribute("disabled")||b.classList.contains("disabled"))return;if(o.registerEvent(a),"touchstart"===a.type&&l.delay){var c=!1,e=setTimeout(function(){e=null,l.show(a,b)},l.delay),f=function(d){e&&(clearTimeout(e),e=null,l.show(a,b)),c||(c=!0,l.hide(d,b))},g=function(a){e&&(clearTimeout(e),e=null),f(a)};b.addEventListener("touchmove",g,!1),b.addEventListener("touchend",f,!1),b.addEventListener("touchcancel",f,!1)}else l.show(a,b),d&&(b.addEventListener("touchend",l.hide,!1),b.addEventListener("touchcancel",l.hide,!1)),b.addEventListener("mouseup",l.hide,!1),b.addEventListener("mouseleave",l.hide,!1)}}var a=a||{},b=document.querySelectorAll.bind(document),c=Object.prototype.toString,d="ontouchstart"in window,l={duration:750,delay:200,show:function(a,b,c){if(2===a.button)return!1;b=b||this;var d=document.createElement("div");d.className="waves-wrap waves-wrapping",b.appendChild(d);var e=document.createElement("div");e.className="waves-ripple waves-rippling",d.appendChild(e);var f=j(b),g=0,h=0;"touches"in a&&a.touches.length?(g=a.touches[0].pageY-f.top,h=a.touches[0].pageX-f.left):(g=a.pageY-f.top,h=a.pageX-f.left),h=h>=0?h:0,g=g>=0?g:0;var i="scale("+b.clientWidth/100*3+")",m="translate(0,0)";c&&(m="translate("+c.x+"px, "+c.y+"px)"),e.setAttribute("data-hold",Date.now()),e.setAttribute("data-x",h),e.setAttribute("data-y",g),e.setAttribute("data-scale",i),e.setAttribute("data-translate",m);var n={top:g+"px",left:h+"px"};e.classList.add("waves-notransition"),e.setAttribute("style",k(n)),e.classList.remove("waves-notransition"),n["-webkit-transform"]=i+" "+m,n["-moz-transform"]=i+" "+m,n["-ms-transform"]=i+" "+m,n["-o-transform"]=i+" "+m,n.transform=i+" "+m,n.opacity="1";var o="mousemove"===a.type?2500:l.duration;n["-webkit-transition-duration"]=o+"ms",n["-moz-transition-duration"]=o+"ms",n["-o-transition-duration"]=o+"ms",n["transition-duration"]=o+"ms",e.setAttribute("style",k(n))},hide:function(a,b){b=b||this;for(var c=b.getElementsByClassName("waves-wrapping"),d=b.getElementsByClassName("waves-rippling"),e=0,f=d.length;f>e;e++)n(a,b,d[e],c[e])}},m={input:function(a){var b=a.parentNode;if("i"!==b.tagName.toLowerCase()||!b.classList.contains("waves-effect")){var c=document.createElement("i");c.className=a.className+" waves-input-wrapper",a.className="waves-button-input",b.replaceChild(c,a),c.appendChild(a);var d=window.getComputedStyle(a,null),e=d.color,f=d.backgroundColor;c.setAttribute("style","color:"+e+";background:"+f),a.setAttribute("style","background-color:rgba(0,0,0,0);")}},img:function(a){var b=a.parentNode;if("i"!==b.tagName.toLowerCase()||!b.classList.contains("waves-effect")){var c=document.createElement("i");b.replaceChild(c,a),c.appendChild(a)}}},o={touches:0,allowEvent:function(a){var b=!0;return/^(mousedown|mousemove)$/.test(a.type)&&o.touches&&(b=!1),b},registerEvent:function(a){var b=a.type;"touchstart"===b?o.touches+=1:/^(touchend|touchcancel)$/.test(b)&&setTimeout(function(){o.touches&&(o.touches-=1)},500)}};return a.init=function(a){var b=document.body;a=a||{},"duration"in a&&(l.duration=a.duration),"delay"in a&&(l.delay=a.delay),d&&(b.addEventListener("touchstart",q,!1),b.addEventListener("touchcancel",o.registerEvent,!1),b.addEventListener("touchend",o.registerEvent,!1)),b.addEventListener("mousedown",q,!1)},a.attach=function(a,b){a=i(a),"[object Array]"===c.call(b)&&(b=b.join(" ")),b=b?" "+b:"";for(var d,e,f=0,g=a.length;g>f;f++)d=a[f],e=d.tagName.toLowerCase(),-1!==["input","img"].indexOf(e)&&(m[e](d),d=d.parentElement),-1===d.className.indexOf("waves-effect")&&(d.className+=" waves-effect"+b)},a.ripple=function(a,b){a=i(a);var c=a.length;if(b=b||{},b.wait=b.wait||0,b.position=b.position||null,c)for(var d,e,f,g={},h=0,k={type:"mousedown",button:1},m=function(a,b){return function(){l.hide(a,b)}};c>h;h++)if(d=a[h],e=b.position||{x:d.clientWidth/2,y:d.clientHeight/2},f=j(d),g.x=f.left+e.x,g.y=f.top+e.y,k.pageX=g.x,k.pageY=g.y,l.show(k,d),b.wait>=0&&null!==b.wait){var n={type:"mouseup",button:1};setTimeout(m(n,d),b.wait)}},a.calm=function(a){a=i(a);for(var b={type:"mouseup",button:1},c=0,d=a.length;d>c;c++)l.hide(b,a[c])},a.displayEffect=function(b){console.error("Waves.displayEffect() has been deprecated and will be removed in future version. Please use Waves.init() to initialize Waves effect"),a.init(b)},a});
|
23
|
+
|
15
24
|
+function ($) {
|
16
|
-
'use strict';
|
17
25
|
|
18
|
-
|
26
|
+
'use strict'
|
27
|
+
|
28
|
+
var Datepicker = function (element, options) {
|
29
|
+
this._element = element
|
30
|
+
this._options = options
|
31
|
+
}
|
32
|
+
|
33
|
+
if (typeof $.fn.pickadate === 'undefined') {
|
34
|
+
throw new Error('Material\'s JavaScript requires pickadate.js')
|
35
|
+
}
|
36
|
+
|
37
|
+
Datepicker.DEFAULTS = {
|
38
|
+
cancel : 'Cancel',
|
39
|
+
closeOnCancel : true,
|
40
|
+
closeOnSelect : false,
|
41
|
+
container : 'body',
|
42
|
+
disable : [],
|
43
|
+
firstDay : 0,
|
44
|
+
format : 'd/m/yyyy',
|
45
|
+
formatSubmit : '',
|
46
|
+
klass : {
|
47
|
+
// button
|
48
|
+
buttonClear : 'btn btn-outline-primary picker-button-clear',
|
49
|
+
buttonClose : 'btn btn-outline-primary picker-button-close',
|
50
|
+
buttonToday : 'btn btn-outline-primary picker-button-today',
|
51
|
+
|
52
|
+
// day
|
53
|
+
day : 'picker-day',
|
54
|
+
disabled : 'picker-day-disabled',
|
55
|
+
highlighted : 'picker-day-highlighted',
|
56
|
+
infocus : 'picker-day-infocus',
|
57
|
+
now : 'picker-day-today',
|
58
|
+
outfocus : 'picker-day-outfocus',
|
59
|
+
selected : 'picker-day-selected',
|
60
|
+
weekdays : 'picker-weekday',
|
61
|
+
|
62
|
+
// element
|
63
|
+
box : 'picker-box',
|
64
|
+
footer : 'picker-footer',
|
65
|
+
frame : 'picker-frame',
|
66
|
+
header : 'picker-header',
|
67
|
+
holder : 'picker-holder',
|
68
|
+
table : 'picker-table',
|
69
|
+
wrap : 'picker-wrap',
|
70
|
+
|
71
|
+
// input element
|
72
|
+
active : 'picker-input-active',
|
73
|
+
input : 'picker-input',
|
74
|
+
|
75
|
+
// month and year nav
|
76
|
+
month : 'picker-month',
|
77
|
+
navDisabled : 'picker-nav-disabled',
|
78
|
+
navNext : 'material-icons picker-nav-next',
|
79
|
+
navPrev : 'material-icons picker-nav-prev',
|
80
|
+
selectMonth : 'picker-select-month',
|
81
|
+
selectYear : 'picker-select-year',
|
82
|
+
year : 'picker-year',
|
83
|
+
|
84
|
+
// root picker
|
85
|
+
focused : 'picker-focused',
|
86
|
+
opened : 'picker-opened',
|
87
|
+
picker : 'picker'
|
88
|
+
},
|
89
|
+
max : false,
|
90
|
+
min : false,
|
91
|
+
monthsFull : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
92
|
+
monthsShort : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
93
|
+
ok : 'OK',
|
94
|
+
onClose : false,
|
95
|
+
onOpen : false,
|
96
|
+
onRender : false,
|
97
|
+
onSet : false,
|
98
|
+
onStart : false,
|
99
|
+
onStop : false,
|
100
|
+
selectMonths : false,
|
101
|
+
selectYears : false,
|
102
|
+
today : '',
|
103
|
+
weekdaysFull : ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
104
|
+
weekdaysShort : ['S', 'M', 'T', 'W', 'T', 'F', 'S']
|
105
|
+
}
|
106
|
+
|
107
|
+
Datepicker.prototype.display = function (datepickerApi, datepickerRoot, datepickerValue) {
|
108
|
+
$('.picker-date-display', datepickerRoot).remove()
|
109
|
+
|
110
|
+
$('.picker-wrap', datepickerRoot).prepend('<div class="picker-date-display">' +
|
111
|
+
'<div class="picker-date-display-top">' +
|
112
|
+
'<span class="picker-year-display">' + datepickerApi.get(datepickerValue, 'yyyy') + '</span>' +
|
113
|
+
'</div>' +
|
114
|
+
'<div class="picker-date-display-bottom">' +
|
115
|
+
'<span class="picker-weekday-display">' + datepickerApi.get(datepickerValue, 'dddd') + '</span>' +
|
116
|
+
'<span class="picker-day-display">' + datepickerApi.get(datepickerValue, 'd') + '</span>' +
|
117
|
+
'<span class="picker-month-display">' + datepickerApi.get(datepickerValue, 'mmm') + '</span>' +
|
118
|
+
'</div>' +
|
119
|
+
'</div>')
|
120
|
+
}
|
121
|
+
|
122
|
+
Datepicker.prototype.show = function () {
|
123
|
+
var that = this
|
124
|
+
|
125
|
+
$(this._element).pickadate({
|
126
|
+
clear : that._options.cancel,
|
127
|
+
close : that._options.ok,
|
128
|
+
closeOnClear : that._options.closeOnCancel,
|
129
|
+
closeOnSelect : that._options.closeOnSelect,
|
130
|
+
container : that._options.container,
|
131
|
+
disable : that._options.disable,
|
132
|
+
firstDay : that._options.firstDay,
|
133
|
+
format : that._options.format,
|
134
|
+
formatSubmit : that._options.formatSubmit,
|
135
|
+
klass : that._options.klass,
|
136
|
+
max : that._options.max,
|
137
|
+
min : that._options.min,
|
138
|
+
monthsFull : that._options.monthsFull,
|
139
|
+
monthsShort : that._options.monthsShort,
|
140
|
+
onClose : that._options.onClose,
|
141
|
+
onOpen : that._options.onOpen,
|
142
|
+
onRender : that._options.onRender,
|
143
|
+
onSet : that._options.onSet,
|
144
|
+
onStart : that._options.onStart,
|
145
|
+
onStop : that._options.onStop,
|
146
|
+
selectMonths : that._options.selectMonths,
|
147
|
+
selectYears : that._options.selectYears,
|
148
|
+
today : that._options.today,
|
149
|
+
weekdaysFull : that._options.weekdaysFull,
|
150
|
+
weekdaysShort : that._options.weekdaysShort
|
151
|
+
})
|
152
|
+
|
153
|
+
var datepickerApi = $(this._element).pickadate('picker'),
|
154
|
+
datepickerNode = datepickerApi.$node,
|
155
|
+
datepickerRoot = datepickerApi.$root
|
156
|
+
|
157
|
+
datepickerApi.on({
|
158
|
+
close: function () {
|
159
|
+
$(document.activeElement).blur()
|
160
|
+
},
|
161
|
+
open: function () {
|
162
|
+
if (!$('.picker__date-display', datepickerRoot).length) {
|
163
|
+
that.display(datepickerApi, datepickerRoot, 'highlight')
|
164
|
+
}
|
165
|
+
},
|
166
|
+
set: function () {
|
167
|
+
if (datepickerApi.get('select') !== null) {
|
168
|
+
that.display(datepickerApi, datepickerRoot, 'select')
|
169
|
+
}
|
170
|
+
}
|
171
|
+
})
|
172
|
+
}
|
173
|
+
|
174
|
+
function Plugin (option) {
|
175
|
+
return this.each(function () {
|
176
|
+
var data = $(this).data('bs.pickdate')
|
177
|
+
var options = $.extend({}, Datepicker.DEFAULTS, $(this).data(), typeof option == 'object' && option)
|
178
|
+
|
179
|
+
if (!data) {
|
180
|
+
$(this).data('bs.pickdate', (data = new Datepicker(this, options)))
|
181
|
+
}
|
182
|
+
|
183
|
+
data.show()
|
184
|
+
})
|
185
|
+
}
|
186
|
+
|
187
|
+
var old = $.fn.pickdate
|
188
|
+
|
189
|
+
$.fn.pickdate = Plugin
|
190
|
+
$.fn.pickdate.Constructor = Datepicker
|
191
|
+
|
192
|
+
$.fn.pickdate.noConflict = function () {
|
193
|
+
$.fn.pickdate = old
|
194
|
+
return this
|
195
|
+
}
|
196
|
+
|
197
|
+
}(jQuery)
|
198
|
+
|
199
|
+
$(function () {
|
200
|
+
if ($('.textarea-autosize').length && (typeof $.fn.textareaAutoSize !== 'undefined')) {
|
201
|
+
$('.textarea-autosize').textareaAutoSize()
|
202
|
+
}
|
203
|
+
})
|
204
|
+
|
205
|
+
$(function () {
|
206
|
+
if ($('.waves-attach').length && (typeof Waves !== 'undefined')) {
|
207
|
+
Waves.attach('.waves-attach')
|
208
|
+
Waves.init({
|
209
|
+
duration: 300
|
210
|
+
})
|
211
|
+
}
|
212
|
+
})
|
213
|
+
|
214
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
19
215
|
|
20
216
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
21
217
|
|
22
218
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
23
219
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
var
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
220
|
+
+function () {
|
221
|
+
/*
|
222
|
+
* floating label:
|
223
|
+
* when a user engages with the text input field,
|
224
|
+
* the floating inline labels move to float above the field
|
225
|
+
*/
|
226
|
+
|
227
|
+
var FloatingLabel = function ($) {
|
228
|
+
|
229
|
+
// constants >>>
|
230
|
+
var DATA_KEY = 'md.floatinglabel';
|
231
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
232
|
+
var NAME = 'floatinglabel';
|
233
|
+
var NO_CONFLICT = $.fn[NAME];
|
234
|
+
|
235
|
+
var ClassName = {
|
236
|
+
IS_FOCUSED: 'is-focused',
|
237
|
+
HAS_VALUE: 'has-value'
|
238
|
+
};
|
239
|
+
|
240
|
+
var Event = {
|
241
|
+
CHANGE: 'change' + EVENT_KEY,
|
242
|
+
FOCUSIN: 'focusin' + EVENT_KEY,
|
243
|
+
FOCUSOUT: 'focusout' + EVENT_KEY
|
244
|
+
};
|
245
|
+
|
246
|
+
var Selector = {
|
247
|
+
DATA_PARENT: '.floating-label',
|
248
|
+
DATA_TOGGLE: '.floating-label .form-control'
|
249
|
+
};
|
250
|
+
// <<< constants
|
251
|
+
|
252
|
+
var FloatingLabel = function () {
|
253
|
+
function FloatingLabel(element) {
|
254
|
+
_classCallCheck(this, FloatingLabel);
|
255
|
+
|
256
|
+
this._element = element;
|
257
|
+
}
|
60
258
|
|
61
|
-
|
62
|
-
key: 'change',
|
63
|
-
value: function change(relatedTarget) {
|
259
|
+
FloatingLabel.prototype.change = function change(relatedTarget) {
|
64
260
|
if ($(this._element).val() || $(this._element).is('select') && $('option:first-child', $(this._element)).html().replace(' ', '') !== '') {
|
65
261
|
$(relatedTarget).addClass(ClassName.HAS_VALUE);
|
66
262
|
} else {
|
67
263
|
$(relatedTarget).removeClass(ClassName.HAS_VALUE);
|
68
264
|
}
|
69
|
-
}
|
70
|
-
|
71
|
-
|
72
|
-
value: function focusin(relatedTarget) {
|
265
|
+
};
|
266
|
+
|
267
|
+
FloatingLabel.prototype.focusin = function focusin(relatedTarget) {
|
73
268
|
$(relatedTarget).addClass(ClassName.IS_FOCUSED);
|
74
|
-
}
|
75
|
-
|
76
|
-
|
77
|
-
value: function focusout(relatedTarget) {
|
269
|
+
};
|
270
|
+
|
271
|
+
FloatingLabel.prototype.focusout = function focusout(relatedTarget) {
|
78
272
|
$(relatedTarget).removeClass(ClassName.IS_FOCUSED);
|
79
|
-
}
|
80
|
-
|
81
|
-
|
82
|
-
value: function _jQueryInterface(event) {
|
273
|
+
};
|
274
|
+
|
275
|
+
FloatingLabel._jQueryInterface = function _jQueryInterface(event) {
|
83
276
|
return this.each(function () {
|
84
|
-
var data = $(this).data(DATA_KEY);
|
85
277
|
var _event = event ? event : 'change';
|
278
|
+
var data = $(this).data(DATA_KEY);
|
86
279
|
|
87
280
|
if (!data) {
|
88
281
|
data = new FloatingLabel(this);
|
@@ -97,96 +290,94 @@ var FloatingLabel = function ($) {
|
|
97
290
|
data[_event]($(this).closest(Selector.DATA_PARENT));
|
98
291
|
}
|
99
292
|
});
|
100
|
-
}
|
101
|
-
|
293
|
+
};
|
294
|
+
|
295
|
+
return FloatingLabel;
|
296
|
+
}();
|
297
|
+
|
298
|
+
$(document).on(Event.CHANGE + ' ' + Event.FOCUSIN + ' ' + Event.FOCUSOUT, Selector.DATA_TOGGLE, function (event) {
|
299
|
+
FloatingLabel._jQueryInterface.call($(this), event.type);
|
300
|
+
});
|
301
|
+
|
302
|
+
$.fn[NAME] = FloatingLabel._jQueryInterface;
|
303
|
+
$.fn[NAME].Constructor = FloatingLabel;
|
304
|
+
$.fn[NAME].noConflict = function () {
|
305
|
+
$.fn[NAME] = NO_CONFLICT;
|
306
|
+
return FloatingLabel._jQueryInterface;
|
307
|
+
};
|
102
308
|
|
103
309
|
return FloatingLabel;
|
104
|
-
}();
|
310
|
+
}(jQuery);
|
311
|
+
|
312
|
+
/*
|
313
|
+
* navigation drawer
|
314
|
+
* based on bootstrap's (v4.0.0-beta) modal.js
|
315
|
+
*/
|
316
|
+
|
317
|
+
var NavDrawer = function ($) {
|
318
|
+
|
319
|
+
// constants >>>
|
320
|
+
var DATA_API_KEY = '.data-api';
|
321
|
+
var DATA_KEY = 'md.navdrawer';
|
322
|
+
var ESCAPE_KEYCODE = 27;
|
323
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
324
|
+
var NAME = 'navdrawer';
|
325
|
+
var NO_CONFLICT = $.fn[NAME];
|
326
|
+
var TRANSITION_DURATION = 292.5;
|
327
|
+
var TRANSITION_DURATION_BACKDROP = 487.5;
|
328
|
+
|
329
|
+
var ClassName = {
|
330
|
+
BACKDROP: 'navdrawer-backdrop',
|
331
|
+
OPEN: 'navdrawer-open',
|
332
|
+
SHOW: 'show'
|
333
|
+
};
|
105
334
|
|
106
|
-
|
107
|
-
|
335
|
+
var Default = {
|
336
|
+
breakpoint: 1280,
|
337
|
+
keyboard: true,
|
338
|
+
show: true,
|
339
|
+
type: 'default'
|
340
|
+
};
|
108
341
|
|
109
|
-
|
110
|
-
|
342
|
+
var DefaultType = {
|
343
|
+
keyboard: 'boolean',
|
344
|
+
show: 'boolean',
|
345
|
+
type: 'string'
|
346
|
+
};
|
111
347
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
348
|
+
var Event = {
|
349
|
+
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
|
350
|
+
CLICK_DISMISS: 'click.dismiss' + EVENT_KEY,
|
351
|
+
FOCUSIN: 'focusin' + EVENT_KEY,
|
352
|
+
HIDDEN: 'hidden' + EVENT_KEY,
|
353
|
+
HIDE: 'hide' + EVENT_KEY,
|
354
|
+
KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY,
|
355
|
+
MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY,
|
356
|
+
MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY,
|
357
|
+
SHOW: 'show' + EVENT_KEY,
|
358
|
+
SHOWN: 'shown' + EVENT_KEY
|
359
|
+
};
|
118
360
|
|
119
|
-
|
120
|
-
|
361
|
+
var Selector = {
|
362
|
+
CONTENT: '.navdrawer-content',
|
363
|
+
DATA_DISMISS: '[data-dismiss="navdrawer"]',
|
364
|
+
DATA_TOGGLE: '[data-toggle="navdrawer"]'
|
365
|
+
};
|
366
|
+
// <<< constants
|
121
367
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
var TRANSITION_DURATION = 375;
|
134
|
-
var TRANSITION_DURATION_BACKDROP = 225;
|
135
|
-
|
136
|
-
var ClassName = {
|
137
|
-
BACKDROP: 'navdrawer-backdrop',
|
138
|
-
OPEN: 'navdrawer-open',
|
139
|
-
SHOW: 'show'
|
140
|
-
};
|
141
|
-
|
142
|
-
var Default = {
|
143
|
-
breakpoint: 1280,
|
144
|
-
keyboard: true,
|
145
|
-
show: true,
|
146
|
-
type: 'default'
|
147
|
-
};
|
148
|
-
|
149
|
-
var DefaultType = {
|
150
|
-
keyboard: 'boolean',
|
151
|
-
show: 'boolean',
|
152
|
-
type: 'string'
|
153
|
-
};
|
154
|
-
|
155
|
-
var Event = {
|
156
|
-
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
|
157
|
-
CLICK_DISMISS: 'click.dismiss' + EVENT_KEY,
|
158
|
-
FOCUSIN: 'focusin' + EVENT_KEY,
|
159
|
-
HIDDEN: 'hidden' + EVENT_KEY,
|
160
|
-
HIDE: 'hide' + EVENT_KEY,
|
161
|
-
KEYDOWN_DISMISS: 'keydown.dismiss' + EVENT_KEY,
|
162
|
-
MOUSEDOWN_DISMISS: 'mousedown.dismiss' + EVENT_KEY,
|
163
|
-
MOUSEUP_DISMISS: 'mouseup.dismiss' + EVENT_KEY,
|
164
|
-
SHOW: 'show' + EVENT_KEY,
|
165
|
-
SHOWN: 'shown' + EVENT_KEY
|
166
|
-
};
|
167
|
-
|
168
|
-
var Selector = {
|
169
|
-
CONTENT: '.navdrawer-content',
|
170
|
-
DATA_DISMISS: '[data-dismiss="navdrawer"]',
|
171
|
-
DATA_TOGGLE: '[data-toggle="navdrawer"]'
|
172
|
-
};
|
173
|
-
// <<< constants
|
174
|
-
|
175
|
-
var NavDrawer = function () {
|
176
|
-
function NavDrawer(element, config) {
|
177
|
-
_classCallCheck(this, NavDrawer);
|
178
|
-
|
179
|
-
this._backdrop = null;
|
180
|
-
this._config = this._getConfig(config);
|
181
|
-
this._content = $(element).find(Selector.CONTENT)[0];
|
182
|
-
this._element = element;
|
183
|
-
this._ignoreBackdropClick = false;
|
184
|
-
this._isShown = false;
|
185
|
-
}
|
368
|
+
var NavDrawer = function () {
|
369
|
+
function NavDrawer(element, config) {
|
370
|
+
_classCallCheck(this, NavDrawer);
|
371
|
+
|
372
|
+
this._backdrop = null;
|
373
|
+
this._config = this._getConfig(config);
|
374
|
+
this._content = $(element).find(Selector.CONTENT)[0];
|
375
|
+
this._element = element;
|
376
|
+
this._ignoreBackdropClick = false;
|
377
|
+
this._isShown = false;
|
378
|
+
}
|
186
379
|
|
187
|
-
|
188
|
-
key: 'hide',
|
189
|
-
value: function hide(event) {
|
380
|
+
NavDrawer.prototype.hide = function hide(event) {
|
190
381
|
if (event) {
|
191
382
|
event.preventDefault();
|
192
383
|
}
|
@@ -207,15 +398,10 @@ var NavDrawer = function ($) {
|
|
207
398
|
|
208
399
|
$(this._element).off(Event.CLICK_DISMISS).removeClass(ClassName.SHOW);
|
209
400
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
}
|
215
|
-
}
|
216
|
-
}, {
|
217
|
-
key: 'show',
|
218
|
-
value: function show(relatedTarget) {
|
401
|
+
this._hideNavdrawer(hideClassName);
|
402
|
+
};
|
403
|
+
|
404
|
+
NavDrawer.prototype.show = function show(relatedTarget) {
|
219
405
|
var _this = this;
|
220
406
|
|
221
407
|
var showEvent = $.Event(Event.SHOW, {
|
@@ -242,16 +428,15 @@ var NavDrawer = function ($) {
|
|
242
428
|
});
|
243
429
|
});
|
244
430
|
|
245
|
-
this._showBackdrop(
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
431
|
+
this._showBackdrop();
|
432
|
+
this._showElement(relatedTarget);
|
433
|
+
};
|
434
|
+
|
435
|
+
NavDrawer.prototype.toggle = function toggle(relatedTarget) {
|
250
436
|
return this._isShown ? this.hide() : this.show(relatedTarget);
|
251
|
-
}
|
252
|
-
|
253
|
-
|
254
|
-
value: function _enforceFocus() {
|
437
|
+
};
|
438
|
+
|
439
|
+
NavDrawer.prototype._enforceFocus = function _enforceFocus() {
|
255
440
|
var _this2 = this;
|
256
441
|
|
257
442
|
$(document).off(Event.FOCUSIN).on(Event.FOCUSIN, function (event) {
|
@@ -261,52 +446,49 @@ var NavDrawer = function ($) {
|
|
261
446
|
}
|
262
447
|
}
|
263
448
|
});
|
264
|
-
}
|
265
|
-
|
266
|
-
|
267
|
-
value: function _getConfig(config) {
|
449
|
+
};
|
450
|
+
|
451
|
+
NavDrawer.prototype._getConfig = function _getConfig(config) {
|
268
452
|
config = $.extend({}, Default, config);
|
269
453
|
Util.typeCheckConfig(NAME, config, DefaultType);
|
270
454
|
return config;
|
271
|
-
}
|
272
|
-
}, {
|
273
|
-
key: '_hideNavdrawer',
|
274
|
-
value: function _hideNavdrawer(className) {
|
275
|
-
var _this3 = this;
|
455
|
+
};
|
276
456
|
|
277
|
-
|
457
|
+
NavDrawer.prototype._hideNavdrawer = function _hideNavdrawer(className) {
|
458
|
+
var _this3 = this;
|
278
459
|
|
279
460
|
this._showBackdrop(function () {
|
280
461
|
$(document.body).removeClass(className);
|
462
|
+
|
463
|
+
_this3._element.setAttribute('aria-hidden', 'true');
|
464
|
+
_this3._element.style.display = 'none';
|
465
|
+
|
281
466
|
$(_this3._element).trigger(Event.HIDDEN);
|
282
467
|
});
|
283
|
-
}
|
284
|
-
|
285
|
-
|
286
|
-
value: function _removeBackdrop() {
|
468
|
+
};
|
469
|
+
|
470
|
+
NavDrawer.prototype._removeBackdrop = function _removeBackdrop() {
|
287
471
|
if (this._backdrop) {
|
288
472
|
$(this._backdrop).remove();
|
289
473
|
this._backdrop = null;
|
290
474
|
}
|
291
|
-
}
|
292
|
-
|
293
|
-
|
294
|
-
value: function _setEscapeEvent() {
|
475
|
+
};
|
476
|
+
|
477
|
+
NavDrawer.prototype._setEscapeEvent = function _setEscapeEvent() {
|
295
478
|
var _this4 = this;
|
296
479
|
|
297
480
|
if (this._isShown && this._config.keyboard) {
|
298
481
|
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
|
299
|
-
if (event.which ===
|
482
|
+
if (event.which === ESCAPE_KEYCODE) {
|
300
483
|
_this4.hide();
|
301
484
|
}
|
302
485
|
});
|
303
486
|
} else if (!this._isShown) {
|
304
487
|
$(this._element).off(Event.KEYDOWN_DISMISS);
|
305
488
|
}
|
306
|
-
}
|
307
|
-
|
308
|
-
|
309
|
-
value: function _showBackdrop(callback) {
|
489
|
+
};
|
490
|
+
|
491
|
+
NavDrawer.prototype._showBackdrop = function _showBackdrop(callback) {
|
310
492
|
var _this5 = this;
|
311
493
|
|
312
494
|
var supportsTransition = Util.supportsTransitionEnd();
|
@@ -364,10 +546,9 @@ var NavDrawer = function ($) {
|
|
364
546
|
} else if (callback) {
|
365
547
|
callback();
|
366
548
|
}
|
367
|
-
}
|
368
|
-
|
369
|
-
|
370
|
-
value: function _showElement(relatedTarget) {
|
549
|
+
};
|
550
|
+
|
551
|
+
NavDrawer.prototype._showElement = function _showElement(relatedTarget) {
|
371
552
|
var _this6 = this;
|
372
553
|
|
373
554
|
var supportsTransition = Util.supportsTransitionEnd();
|
@@ -376,6 +557,7 @@ var NavDrawer = function ($) {
|
|
376
557
|
document.body.appendChild(this._element);
|
377
558
|
}
|
378
559
|
|
560
|
+
this._element.removeAttribute('aria-hidden');
|
379
561
|
this._element.style.display = 'block';
|
380
562
|
|
381
563
|
if (supportsTransition) {
|
@@ -399,14 +581,14 @@ var NavDrawer = function ($) {
|
|
399
581
|
} else {
|
400
582
|
transitionComplete();
|
401
583
|
}
|
402
|
-
}
|
403
|
-
|
404
|
-
|
405
|
-
value: function _jQueryInterface(config, relatedTarget) {
|
584
|
+
};
|
585
|
+
|
586
|
+
NavDrawer._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
|
406
587
|
return this.each(function () {
|
407
|
-
var data = $(this).data(DATA_KEY);
|
408
588
|
var _config = $.extend({}, NavDrawer.Default, $(this).data(), (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config);
|
409
589
|
|
590
|
+
var data = $(this).data(DATA_KEY);
|
591
|
+
|
410
592
|
if (!data) {
|
411
593
|
data = new NavDrawer(this, _config);
|
412
594
|
$(this).data(DATA_KEY, data);
|
@@ -422,132 +604,176 @@ var NavDrawer = function ($) {
|
|
422
604
|
data.show(relatedTarget);
|
423
605
|
}
|
424
606
|
});
|
425
|
-
}
|
426
|
-
}, {
|
427
|
-
key: 'Default',
|
428
|
-
get: function get() {
|
429
|
-
return Default;
|
430
|
-
}
|
431
|
-
}]);
|
607
|
+
};
|
432
608
|
|
433
|
-
|
434
|
-
|
609
|
+
_createClass(NavDrawer, null, [{
|
610
|
+
key: 'Default',
|
611
|
+
get: function get() {
|
612
|
+
return Default;
|
613
|
+
}
|
614
|
+
}]);
|
435
615
|
|
436
|
-
|
437
|
-
|
616
|
+
return NavDrawer;
|
617
|
+
}();
|
438
618
|
|
439
|
-
|
440
|
-
|
619
|
+
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
|
620
|
+
var _this7 = this;
|
441
621
|
|
442
|
-
|
443
|
-
target =
|
444
|
-
}
|
622
|
+
var selector = Util.getSelectorFromElement(this);
|
623
|
+
var target = void 0;
|
445
624
|
|
446
|
-
|
625
|
+
if (selector) {
|
626
|
+
target = $(selector)[0];
|
627
|
+
}
|
447
628
|
|
448
|
-
|
449
|
-
event.preventDefault();
|
450
|
-
}
|
629
|
+
var config = $(target).data(DATA_KEY) ? 'toggle' : $.extend({}, $(target).data(), $(this).data());
|
451
630
|
|
452
|
-
|
453
|
-
|
454
|
-
return;
|
631
|
+
if (this.tagName === 'A') {
|
632
|
+
event.preventDefault();
|
455
633
|
}
|
456
634
|
|
457
|
-
$target.one(Event.
|
458
|
-
if (
|
459
|
-
|
635
|
+
var $target = $(target).one(Event.SHOW, function (showEvent) {
|
636
|
+
if (showEvent.isDefaultPrevented()) {
|
637
|
+
return;
|
460
638
|
}
|
639
|
+
|
640
|
+
$target.one(Event.HIDDEN, function () {
|
641
|
+
if ($(_this7).is(':visible')) {
|
642
|
+
_this7.focus();
|
643
|
+
}
|
644
|
+
});
|
461
645
|
});
|
646
|
+
|
647
|
+
NavDrawer._jQueryInterface.call($(target), config, this);
|
462
648
|
});
|
463
649
|
|
464
|
-
NavDrawer._jQueryInterface
|
465
|
-
|
650
|
+
$.fn[NAME] = NavDrawer._jQueryInterface;
|
651
|
+
$.fn[NAME].Constructor = NavDrawer;
|
652
|
+
$.fn[NAME].noConflict = function () {
|
653
|
+
$.fn[NAME] = NO_CONFLICT;
|
654
|
+
return NavDrawer._jQueryInterface;
|
655
|
+
};
|
466
656
|
|
467
|
-
|
468
|
-
|
469
|
-
$.fn[NAME].noConflict = function () {
|
470
|
-
$.fn[NAME] = NO_CONFLICT;
|
471
|
-
return NavDrawer._jQueryInterface;
|
472
|
-
};
|
657
|
+
return NavDrawer;
|
658
|
+
}(jQuery);
|
473
659
|
|
474
|
-
|
475
|
-
|
660
|
+
/*
|
661
|
+
* selection control focus:
|
662
|
+
* chrome persists the focus style on checkboxes/radio buttons
|
663
|
+
* after clicking with the mouse
|
664
|
+
*/
|
476
665
|
|
477
|
-
|
478
|
-
* tab indicator animation
|
479
|
-
* requires bootstrap's (v4.0.0-alpha.6) tab.js
|
480
|
-
*/
|
481
|
-
var TabSwitch = function ($) {
|
482
|
-
// constants >>>
|
483
|
-
var DATA_KEY = 'md.tabswitch';
|
484
|
-
var NAME = 'tabswitch';
|
485
|
-
var NO_CONFLICT = $.fn[NAME];
|
486
|
-
var TRANSITION_DURATION = 300;
|
487
|
-
|
488
|
-
var ClassName = {
|
489
|
-
ANIMATE: 'animate',
|
490
|
-
INDICATOR: 'nav-tabs-indicator',
|
491
|
-
MATERIAL: 'nav-tabs-material',
|
492
|
-
SCROLLABLE: 'nav-tabs-scrollable',
|
493
|
-
SHOW: 'show'
|
494
|
-
};
|
495
|
-
|
496
|
-
var Event = {
|
497
|
-
SHOW_BS_TAB: 'show.bs.tab'
|
498
|
-
};
|
499
|
-
|
500
|
-
var Selector = {
|
501
|
-
DATA_TOGGLE: '.nav-tabs [data-toggle="tab"]',
|
502
|
-
NAV: '.nav-tabs',
|
503
|
-
NAV_ITEM: '.nav-item'
|
504
|
-
};
|
505
|
-
// <<< constants
|
506
|
-
|
507
|
-
var TabSwitch = function () {
|
508
|
-
function TabSwitch(nav) {
|
509
|
-
_classCallCheck(this, TabSwitch);
|
510
|
-
|
511
|
-
if (typeof $.fn.tab === 'undefined') {
|
512
|
-
throw new Error('Material\'s JavaScript requires Bootstrap\'s tab.js');
|
513
|
-
};
|
666
|
+
var ControlFocus = function ($) {
|
514
667
|
|
515
|
-
|
516
|
-
|
517
|
-
|
668
|
+
// constants >>>
|
669
|
+
var DATA_KEY = 'md.controlfocus';
|
670
|
+
var EVENT_KEY = '.' + DATA_KEY;
|
518
671
|
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
var _this8 = this;
|
672
|
+
var ClassName = {
|
673
|
+
FOCUS: 'focus'
|
674
|
+
};
|
523
675
|
|
524
|
-
|
676
|
+
var LastInteraction = {
|
677
|
+
IS_MOUSEDOWN: false
|
678
|
+
};
|
525
679
|
|
526
|
-
|
527
|
-
|
680
|
+
var Event = {
|
681
|
+
BLUR: 'blur' + EVENT_KEY,
|
682
|
+
FOCUS: 'focus' + EVENT_KEY,
|
683
|
+
MOUSEDOWN: 'mousedown' + EVENT_KEY,
|
684
|
+
MOUSEUP: 'mouseup' + EVENT_KEY
|
685
|
+
};
|
686
|
+
|
687
|
+
var Selector = {
|
688
|
+
CONTROL: '.custom-control',
|
689
|
+
INPUT: '.custom-control-input'
|
690
|
+
};
|
691
|
+
// <<< constants
|
692
|
+
|
693
|
+
$(document).on('' + Event.BLUR, Selector.INPUT, function (event) {
|
694
|
+
$(event.target).removeClass(ClassName.FOCUS);
|
695
|
+
}).on('' + Event.FOCUS, Selector.INPUT, function (event) {
|
696
|
+
if (LastInteraction.IS_MOUSEDOWN === false) {
|
697
|
+
$(event.target).addClass(ClassName.FOCUS);
|
698
|
+
}
|
699
|
+
}).on('' + Event.MOUSEDOWN, Selector.CONTROL, function () {
|
700
|
+
LastInteraction.IS_MOUSEDOWN = true;
|
701
|
+
}).on('' + Event.MOUSEUP, Selector.CONTROL, function () {
|
702
|
+
setTimeout(function () {
|
703
|
+
LastInteraction.IS_MOUSEDOWN = false;
|
704
|
+
}, 1);
|
705
|
+
});
|
706
|
+
}(jQuery);
|
707
|
+
|
708
|
+
/*
|
709
|
+
* tab indicator animation
|
710
|
+
* requires bootstrap's (v4.0.0-beta) tab.js
|
711
|
+
*/
|
712
|
+
|
713
|
+
var TabSwitch = function ($) {
|
714
|
+
|
715
|
+
// constants >>>
|
716
|
+
var DATA_KEY = 'md.tabswitch';
|
717
|
+
var NAME = 'tabswitch';
|
718
|
+
var NO_CONFLICT = $.fn[NAME];
|
719
|
+
var TRANSITION_DURATION = 390;
|
720
|
+
|
721
|
+
var ClassName = {
|
722
|
+
ANIMATE: 'animate',
|
723
|
+
DROPDOWN_ITEM: 'dropdown-item',
|
724
|
+
INDICATOR: 'nav-tabs-indicator',
|
725
|
+
MATERIAL: 'nav-tabs-material',
|
726
|
+
SCROLLABLE: 'nav-tabs-scrollable',
|
727
|
+
SHOW: 'show'
|
728
|
+
};
|
729
|
+
|
730
|
+
var Event = {
|
731
|
+
SHOW_BS_TAB: 'show.bs.tab'
|
732
|
+
};
|
733
|
+
|
734
|
+
var Selector = {
|
735
|
+
DATA_TOGGLE: '.nav-tabs [data-toggle="tab"]',
|
736
|
+
DROPDOWN: '.dropdown',
|
737
|
+
NAV: '.nav-tabs'
|
738
|
+
};
|
739
|
+
// <<< constants
|
740
|
+
|
741
|
+
var TabSwitch = function () {
|
742
|
+
function TabSwitch(nav) {
|
743
|
+
_classCallCheck(this, TabSwitch);
|
744
|
+
|
745
|
+
if (typeof $.fn.tab === 'undefined') {
|
746
|
+
throw new Error('Material\'s JavaScript requires Bootstrap\'s tab.js');
|
528
747
|
}
|
529
748
|
|
530
|
-
|
531
|
-
|
749
|
+
this._nav = nav;
|
750
|
+
this._navindicator = null;
|
751
|
+
}
|
752
|
+
|
753
|
+
TabSwitch.prototype.switch = function _switch(element, relatedTarget) {
|
754
|
+
var _this8 = this;
|
755
|
+
|
532
756
|
var navLeft = $(this._nav).offset().left;
|
533
757
|
var navScrollLeft = $(this._nav).scrollLeft();
|
534
758
|
var navWidth = $(this._nav).outerWidth();
|
759
|
+
var supportsTransition = Util.supportsTransitionEnd();
|
535
760
|
|
536
|
-
if (
|
537
|
-
|
538
|
-
|
761
|
+
if (!this._navindicator) {
|
762
|
+
this._createIndicator(navLeft, navScrollLeft, navWidth, relatedTarget);
|
763
|
+
}
|
539
764
|
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
});
|
765
|
+
if ($(element).hasClass(ClassName.DROPDOWN_ITEM)) {
|
766
|
+
element = $(element).closest(Selector.DROPDOWN);
|
767
|
+
}
|
544
768
|
|
545
|
-
|
546
|
-
|
769
|
+
var elLeft = $(element).offset().left;
|
770
|
+
var elWidth = $(element).outerWidth();
|
547
771
|
|
548
|
-
|
549
|
-
|
550
|
-
|
772
|
+
$(this._navindicator).addClass(ClassName.SHOW);
|
773
|
+
Util.reflow(this._navindicator);
|
774
|
+
|
775
|
+
if (supportsTransition) {
|
776
|
+
$(this._nav).addClass(ClassName.ANIMATE);
|
551
777
|
}
|
552
778
|
|
553
779
|
$(this._navindicator).css({
|
@@ -566,19 +792,31 @@ var TabSwitch = function ($) {
|
|
566
792
|
}
|
567
793
|
|
568
794
|
$(this._navindicator).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
|
569
|
-
}
|
570
|
-
|
571
|
-
|
572
|
-
value: function _createIndicator() {
|
795
|
+
};
|
796
|
+
|
797
|
+
TabSwitch.prototype._createIndicator = function _createIndicator(navLeft, navScrollLeft, navWidth, relatedTarget) {
|
573
798
|
this._navindicator = document.createElement('div');
|
574
799
|
|
575
800
|
$(this._navindicator).addClass(ClassName.INDICATOR).appendTo(this._nav);
|
576
801
|
|
802
|
+
if (relatedTarget !== undefined) {
|
803
|
+
if ($(relatedTarget).hasClass(ClassName.DROPDOWN_ITEM)) {
|
804
|
+
relatedTarget = $(relatedTarget).closest(Selector.DROPDOWN);
|
805
|
+
}
|
806
|
+
|
807
|
+
var relatedLeft = $(relatedTarget).offset().left;
|
808
|
+
var relatedWidth = $(relatedTarget).outerWidth();
|
809
|
+
|
810
|
+
$(this._navindicator).css({
|
811
|
+
left: relatedLeft + navScrollLeft - navLeft,
|
812
|
+
right: navWidth - (relatedLeft + navScrollLeft - navLeft + relatedWidth)
|
813
|
+
});
|
814
|
+
}
|
815
|
+
|
577
816
|
$(this._nav).addClass(ClassName.MATERIAL);
|
578
|
-
}
|
579
|
-
|
580
|
-
|
581
|
-
value: function _jQueryInterface(relatedTarget) {
|
817
|
+
};
|
818
|
+
|
819
|
+
TabSwitch._jQueryInterface = function _jQueryInterface(relatedTarget) {
|
582
820
|
return this.each(function () {
|
583
821
|
var nav = $(this).closest(Selector.NAV)[0];
|
584
822
|
|
@@ -595,157 +833,156 @@ var TabSwitch = function ($) {
|
|
595
833
|
|
596
834
|
data.switch(this, relatedTarget);
|
597
835
|
});
|
598
|
-
}
|
599
|
-
}]);
|
836
|
+
};
|
600
837
|
|
601
|
-
|
602
|
-
|
838
|
+
return TabSwitch;
|
839
|
+
}();
|
603
840
|
|
604
|
-
|
605
|
-
|
606
|
-
|
841
|
+
$(document).on(Event.SHOW_BS_TAB, Selector.DATA_TOGGLE, function (event) {
|
842
|
+
TabSwitch._jQueryInterface.call($(event.target), event.relatedTarget);
|
843
|
+
});
|
607
844
|
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
845
|
+
$.fn[NAME] = TabSwitch._jQueryInterface;
|
846
|
+
$.fn[NAME].Constructor = TabSwitch;
|
847
|
+
$.fn[NAME].noConflict = function () {
|
848
|
+
$.fn[NAME] = NO_CONFLICT;
|
849
|
+
return TabSwitch._jQueryInterface;
|
850
|
+
};
|
614
851
|
|
615
|
-
|
616
|
-
}(jQuery);
|
852
|
+
return TabSwitch;
|
853
|
+
}(jQuery);
|
617
854
|
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
var Util = function ($) {
|
623
|
-
var transition = false;
|
624
|
-
|
625
|
-
var TransitionEndEvent = {
|
626
|
-
WebkitTransition: 'webkitTransitionEnd',
|
627
|
-
MozTransition: 'transitionend',
|
628
|
-
OTransition: 'oTransitionEnd otransitionend',
|
629
|
-
transition: 'transitionend'
|
630
|
-
};
|
631
|
-
|
632
|
-
function getSpecialTransitionEndEvent() {
|
633
|
-
return {
|
634
|
-
bindType: transition.end,
|
635
|
-
delegateType: transition.end,
|
636
|
-
handle: function handle(event) {
|
637
|
-
if ($(event.target).is(this)) {
|
638
|
-
return event.handleObj.handler.apply(this, arguments);
|
639
|
-
}
|
640
|
-
return undefined;
|
641
|
-
}
|
642
|
-
};
|
643
|
-
}
|
855
|
+
/*
|
856
|
+
* global util js
|
857
|
+
* based on bootstrap's (v4.0.0-beta) util.js
|
858
|
+
*/
|
644
859
|
|
645
|
-
function
|
646
|
-
return (obj[0] || obj).nodeType;
|
647
|
-
}
|
860
|
+
var Util = function ($) {
|
648
861
|
|
649
|
-
|
650
|
-
transition =
|
862
|
+
var MAX_UID = 1000000;
|
863
|
+
var transition = false;
|
651
864
|
|
652
|
-
|
865
|
+
var TransitionEndEvent = {
|
866
|
+
WebkitTransition: 'webkitTransitionEnd',
|
867
|
+
MozTransition: 'transitionend',
|
868
|
+
OTransition: 'oTransitionEnd otransitionend',
|
869
|
+
transition: 'transitionend'
|
870
|
+
};
|
653
871
|
|
654
|
-
|
655
|
-
|
872
|
+
function getSpecialTransitionEndEvent() {
|
873
|
+
return {
|
874
|
+
bindType: transition.end,
|
875
|
+
delegateType: transition.end,
|
876
|
+
handle: function handle(event) {
|
877
|
+
if ($(event.target).is(this)) {
|
878
|
+
// eslint-disable-next-line prefer-rest-params
|
879
|
+
return event.handleObj.handler.apply(this, arguments);
|
880
|
+
}
|
881
|
+
return undefined;
|
882
|
+
}
|
883
|
+
};
|
656
884
|
}
|
657
|
-
}
|
658
885
|
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
function transitionEndEmulator(duration) {
|
664
|
-
var _this9 = this;
|
886
|
+
function isElement(obj) {
|
887
|
+
return (obj[0] || obj).nodeType;
|
888
|
+
}
|
665
889
|
|
666
|
-
|
890
|
+
function setTransitionEndSupport() {
|
891
|
+
transition = transitionEndTest();
|
667
892
|
|
668
|
-
|
669
|
-
called = true;
|
670
|
-
});
|
893
|
+
$.fn.emulateTransitionEnd = transitionEndEmulator;
|
671
894
|
|
672
|
-
|
673
|
-
|
674
|
-
Util.triggerTransitionEnd(_this9);
|
895
|
+
if (Util.supportsTransitionEnd()) {
|
896
|
+
$.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
|
675
897
|
}
|
676
|
-
}
|
677
|
-
|
678
|
-
return this;
|
679
|
-
}
|
898
|
+
}
|
680
899
|
|
681
|
-
|
682
|
-
|
683
|
-
return false;
|
900
|
+
function toType(obj) {
|
901
|
+
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
|
684
902
|
}
|
685
903
|
|
686
|
-
|
904
|
+
function transitionEndEmulator(duration) {
|
905
|
+
var _this9 = this;
|
687
906
|
|
688
|
-
|
689
|
-
if (el.style[name] !== undefined) {
|
690
|
-
return { end: TransitionEndEvent[name] };
|
691
|
-
}
|
692
|
-
};
|
907
|
+
var called = false;
|
693
908
|
|
694
|
-
|
695
|
-
|
909
|
+
$(this).one(Util.TRANSITION_END, function () {
|
910
|
+
called = true;
|
911
|
+
});
|
696
912
|
|
697
|
-
|
698
|
-
|
913
|
+
setTimeout(function () {
|
914
|
+
if (!called) {
|
915
|
+
Util.triggerTransitionEnd(_this9);
|
916
|
+
}
|
917
|
+
}, duration);
|
699
918
|
|
700
|
-
|
701
|
-
|
919
|
+
return this;
|
920
|
+
}
|
702
921
|
|
703
|
-
|
704
|
-
|
705
|
-
|
922
|
+
function transitionEndTest() {
|
923
|
+
if (window.QUnit) {
|
924
|
+
return false;
|
706
925
|
}
|
707
926
|
|
708
|
-
|
709
|
-
},
|
710
|
-
getUID: function getUID(prefix) {
|
711
|
-
do {
|
712
|
-
prefix += ~ ~(Math.random() * 1000000);
|
713
|
-
} while (document.getElementById(prefix));
|
714
|
-
return prefix;
|
715
|
-
},
|
716
|
-
reflow: function reflow(element) {
|
717
|
-
new Function('md', 'return md')(element.offsetHeight);
|
718
|
-
},
|
719
|
-
supportsTransitionEnd: function supportsTransitionEnd() {
|
720
|
-
return Boolean(transition);
|
721
|
-
},
|
722
|
-
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
723
|
-
$(element).trigger(transition.end);
|
724
|
-
},
|
725
|
-
typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
|
726
|
-
for (var property in configTypes) {
|
727
|
-
if (configTypes.hasOwnProperty(property)) {
|
728
|
-
var expectedTypes = configTypes[property];
|
729
|
-
var value = config[property];
|
730
|
-
var valueType = void 0;
|
731
|
-
|
732
|
-
if (value && isElement(value)) {
|
733
|
-
valueType = 'element';
|
734
|
-
} else {
|
735
|
-
valueType = toType(value);
|
736
|
-
}
|
927
|
+
var el = document.createElement('material');
|
737
928
|
|
738
|
-
|
739
|
-
|
740
|
-
|
929
|
+
for (var name in TransitionEndEvent) {
|
930
|
+
if (el.style[name] !== undefined) {
|
931
|
+
return {
|
932
|
+
end: TransitionEndEvent[name]
|
933
|
+
};
|
741
934
|
}
|
742
|
-
}
|
935
|
+
}
|
936
|
+
|
937
|
+
return false;
|
743
938
|
}
|
744
|
-
};
|
745
939
|
|
746
|
-
|
940
|
+
var Util = {
|
941
|
+
TRANSITION_END: 'mdTransitionEnd',
|
747
942
|
|
748
|
-
|
749
|
-
|
943
|
+
getSelectorFromElement: function getSelectorFromElement(element) {
|
944
|
+
var selector = element.getAttribute('data-target');
|
945
|
+
|
946
|
+
if (!selector) {
|
947
|
+
selector = element.getAttribute('href') || '';
|
948
|
+
selector = /^#[a-z]/i.test(selector) ? selector : null;
|
949
|
+
}
|
950
|
+
|
951
|
+
return selector;
|
952
|
+
},
|
953
|
+
getUID: function getUID(prefix) {
|
954
|
+
do {
|
955
|
+
// eslint-disable-next-line no-bitwise
|
956
|
+
prefix += ~~(Math.random() * MAX_UID);
|
957
|
+
} while (document.getElementById(prefix));
|
958
|
+
return prefix;
|
959
|
+
},
|
960
|
+
reflow: function reflow(element) {
|
961
|
+
new Function('md', 'return md')(element.offsetHeight);
|
962
|
+
},
|
963
|
+
supportsTransitionEnd: function supportsTransitionEnd() {
|
964
|
+
return Boolean(transition);
|
965
|
+
},
|
966
|
+
triggerTransitionEnd: function triggerTransitionEnd(element) {
|
967
|
+
$(element).trigger(transition.end);
|
968
|
+
},
|
969
|
+
typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
|
970
|
+
for (var property in configTypes) {
|
971
|
+
if (configTypes.hasOwnProperty(property)) {
|
972
|
+
var expectedTypes = configTypes[property];
|
973
|
+
var value = config[property];
|
974
|
+
var valueType = value && isElement(value) ? 'element' : toType(value);
|
975
|
+
|
976
|
+
if (!new RegExp(expectedTypes).test(valueType)) {
|
977
|
+
throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".'));
|
978
|
+
}
|
979
|
+
}
|
980
|
+
}
|
981
|
+
}
|
982
|
+
};
|
983
|
+
|
984
|
+
setTransitionEndSupport();
|
750
985
|
|
751
|
-
|
986
|
+
return Util;
|
987
|
+
}(jQuery);
|
988
|
+
}();
|