material-sass 4.0.0.beta2 → 4.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +3 -3
  4. data/Rakefile +11 -9
  5. data/assets/javascripts/material.js +3278 -825
  6. data/assets/javascripts/material.min.js +17 -1
  7. data/assets/javascripts/material/{initializers/picker.js → addons/pickadate.js} +5 -23
  8. data/assets/javascripts/material/components/expansion-panel.js +9 -18
  9. data/assets/javascripts/material/components/floating-label.js +21 -24
  10. data/assets/javascripts/material/components/{navdrawer.js → nav-drawer.js} +51 -55
  11. data/assets/javascripts/material/components/selection-control-focus.js +15 -21
  12. data/assets/javascripts/material/components/tab-switch.js +13 -20
  13. data/assets/javascripts/material/components/util.js +31 -41
  14. data/assets/stylesheets/material/_functions.scss +1 -1
  15. data/assets/stylesheets/material/_print.scss +13 -2
  16. data/assets/stylesheets/material/_utilities.scss +0 -1
  17. data/assets/stylesheets/material/_variables.scss +0 -1
  18. data/assets/stylesheets/material/base/_base.scss +1 -16
  19. data/assets/stylesheets/material/bootstrap/_close.scss +4 -0
  20. data/assets/stylesheets/material/bootstrap/_code.scss +6 -0
  21. data/assets/stylesheets/material/bootstrap/_custom-form.scss +26 -28
  22. data/assets/stylesheets/material/bootstrap/_form.scss +7 -36
  23. data/assets/stylesheets/material/bootstrap/_pagination.scss +7 -2
  24. data/assets/stylesheets/material/bootstrap/_popover.scss +18 -14
  25. data/assets/stylesheets/material/material.scss +0 -1
  26. data/assets/stylesheets/material/material/_button-flat.scss +8 -8
  27. data/assets/stylesheets/material/material/_button-group.scss +26 -63
  28. data/assets/stylesheets/material/material/_button.scss +18 -18
  29. data/assets/stylesheets/material/material/_dialog.scss +6 -6
  30. data/assets/stylesheets/material/material/_expansion-panel.scss +4 -4
  31. data/assets/stylesheets/material/material/_menu.scss +2 -2
  32. data/assets/stylesheets/material/material/_picker.scss +3 -3
  33. data/assets/stylesheets/material/material/_progress.scss +2 -1
  34. data/assets/stylesheets/material/material/_selection-control.scss +88 -67
  35. data/assets/stylesheets/material/material/_text-field-input-group.scss +49 -82
  36. data/assets/stylesheets/material/material/_text-field.scss +36 -6
  37. data/assets/stylesheets/material/material/_toolbar.scss +4 -0
  38. data/assets/stylesheets/material/material/_tooltip.scss +1 -1
  39. data/assets/stylesheets/material/mixins/_breakpoint.scss +1 -1
  40. data/assets/stylesheets/material/mixins/_form.scss +79 -17
  41. data/assets/stylesheets/material/mixins/_grid-framework.scss +9 -3
  42. data/assets/stylesheets/material/mixins/_grid.scss +3 -1
  43. data/assets/stylesheets/material/mixins/_hover.scss +14 -55
  44. data/assets/stylesheets/material/mixins/_material-icons.scss +2 -4
  45. data/assets/stylesheets/material/mixins/_text-alignment.scss +2 -2
  46. data/assets/stylesheets/material/mixins/_text-hide.scss +1 -1
  47. data/assets/stylesheets/material/utilities/_border.scss +20 -0
  48. data/assets/stylesheets/material/variables/_palette.scss +2 -0
  49. data/assets/stylesheets/material/variables/_variable-bootstrap.scss +17 -0
  50. data/assets/stylesheets/material/variables/_variable-material.scss +2 -6
  51. data/lib/material-sass/version.rb +1 -1
  52. metadata +4 -12
  53. data/assets/javascripts/material/addons/picker.date.js +0 -234
  54. data/assets/javascripts/material/addons/picker.js +0 -172
  55. data/assets/javascripts/material/addons/textarea-autosize.js +0 -23
  56. data/assets/javascripts/material/addons/waves.js +0 -127
  57. data/assets/javascripts/material/initializers/textarea-autosize.js +0 -10
  58. data/assets/javascripts/material/initializers/waves.js +0 -13
  59. data/assets/stylesheets/material/material/_text-field-textarea.scss +0 -15
  60. data/assets/stylesheets/material/utilities/_waves.scss +0 -41
@@ -243,6 +243,7 @@ $navdrawer-width: 17.5rem !default;
243
243
  // Picker
244
244
  // Based on https://material.google.com/components/pickers.html#pickers-date-pickers
245
245
 
246
+ $picker-border-radius: $border-radius !default;
246
247
  $picker-cell-size: 2.5rem !default;
247
248
  $picker-content-bg: $dialog-content-bg !default;
248
249
  $picker-day-bg-selected: map-get(theme-color(primary), color) !default;
@@ -425,6 +426,7 @@ $toolbar-dark-element-bg: $white-divider !default;
425
426
  // Based on https://material.google.com/components/tooltips.html#tooltips-tooltips-desktop
426
427
 
427
428
  $tooltip-bg: $material-color-grey-700 !default;
429
+ $tooltip-border-radius: $border-radius !default;
428
430
  $tooltip-color: $white-primary !default;
429
431
  $tooltip-font-size: 0.875rem !default;
430
432
  $tooltip-font-size-desktop: 0.625rem !default;
@@ -440,9 +442,3 @@ $tooltip-padding-y: (($tooltip-height - $tooltip-font-size * $tooltip-li
440
442
  $tooltip-padding-y-desktop: (($tooltip-height-desktop - $tooltip-font-size-desktop * $tooltip-line-height) / 2) !default;
441
443
  $tooltip-scale: 0.87 !default;
442
444
  $tooltip-zindex: $elevation-24dp !default;
443
-
444
- // Waves
445
-
446
- $waves-bg: $black-divider !default;
447
- $waves-bg-light: $white-divider !default;
448
- $waves-size: 4rem !default;
@@ -1,5 +1,5 @@
1
1
  module Material
2
2
  module Sass
3
- VERSION = '4.0.0.beta2'
3
+ VERSION = '4.0.0.beta3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material-sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.beta2
4
+ version: 4.0.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mkhairi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-09 00:00:00.000000000 Z
11
+ date: 2018-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -81,19 +81,13 @@ files:
81
81
  - assets/javascripts/material-sprockets.js
82
82
  - assets/javascripts/material.js
83
83
  - assets/javascripts/material.min.js
84
- - assets/javascripts/material/addons/picker.date.js
85
- - assets/javascripts/material/addons/picker.js
86
- - assets/javascripts/material/addons/textarea-autosize.js
87
- - assets/javascripts/material/addons/waves.js
84
+ - assets/javascripts/material/addons/pickadate.js
88
85
  - assets/javascripts/material/components/expansion-panel.js
89
86
  - assets/javascripts/material/components/floating-label.js
90
- - assets/javascripts/material/components/navdrawer.js
87
+ - assets/javascripts/material/components/nav-drawer.js
91
88
  - assets/javascripts/material/components/selection-control-focus.js
92
89
  - assets/javascripts/material/components/tab-switch.js
93
90
  - assets/javascripts/material/components/util.js
94
- - assets/javascripts/material/initializers/picker.js
95
- - assets/javascripts/material/initializers/textarea-autosize.js
96
- - assets/javascripts/material/initializers/waves.js
97
91
  - assets/stylesheets/material.min.css
98
92
  - assets/stylesheets/material.scss
99
93
  - assets/stylesheets/material/_colours.scss
@@ -142,7 +136,6 @@ files:
142
136
  - assets/stylesheets/material/material/_text-field-box.scss
143
137
  - assets/stylesheets/material/material/_text-field-floating-label.scss
144
138
  - assets/stylesheets/material/material/_text-field-input-group.scss
145
- - assets/stylesheets/material/material/_text-field-textarea.scss
146
139
  - assets/stylesheets/material/material/_text-field.scss
147
140
  - assets/stylesheets/material/material/_toolbar.scss
148
141
  - assets/stylesheets/material/material/_tooltip.scss
@@ -183,7 +176,6 @@ files:
183
176
  - assets/stylesheets/material/utilities/_spacing.scss
184
177
  - assets/stylesheets/material/utilities/_text.scss
185
178
  - assets/stylesheets/material/utilities/_visibility.scss
186
- - assets/stylesheets/material/utilities/_waves.scss
187
179
  - assets/stylesheets/material/variables/_elevation-shadow.scss
188
180
  - assets/stylesheets/material/variables/_grid.scss
189
181
  - assets/stylesheets/material/variables/_palette.scss
@@ -1,234 +0,0 @@
1
- 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; };
2
-
3
- /*
4
- * Date picker for pickadate.js v3.5.6
5
- * http://amsul.github.io/pickadate.js/date.htm
6
- */
7
-
8
- !function (a) {
9
- "function" == typeof define && define.amd ? define(["picker", "jquery"], a) : "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ? module.exports = a(require("./picker.js"), require("jquery")) : a(Picker, jQuery);
10
- }(function (a, b) {
11
- function c(a, b) {
12
- var c = this,
13
- d = a.$node[0],
14
- e = d.value,
15
- f = a.$node.data("value"),
16
- g = f || e,
17
- h = f ? b.formatSubmit : b.format,
18
- i = function i() {
19
- return d.currentStyle ? "rtl" == d.currentStyle.direction : "rtl" == getComputedStyle(a.$root[0]).direction;
20
- };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) {
21
- return a[0] === !0 ? a.shift() : -1;
22
- }(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 _() {
23
- return i() ? -1 : 1;
24
- }, 37: function _() {
25
- return i() ? 1 : -1;
26
- }, go: function go(a) {
27
- var b = c.item.highlight,
28
- d = new Date(b.year, b.month, b.date + a);c.set("highlight", d, { interval: a }), this.render();
29
- } }, a.on("render", function () {
30
- a.$root.find("." + b.klass.selectMonth).on("change", function () {
31
- 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"));
32
- }), a.$root.find("." + b.klass.selectYear).on("change", function () {
33
- 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"));
34
- });
35
- }, 1).on("open", function () {
36
- var d = "";c.disabled(c.get("now")) && (d = ":not(." + b.klass.buttonToday + ")"), a.$root.find("button" + d + ", select").attr("disabled", !1);
37
- }, 1).on("close", function () {
38
- a.$root.find("button, select").attr("disabled", !0);
39
- }, 1);
40
- }var d = 7,
41
- e = 6,
42
- f = a._;c.prototype.set = function (a, b, c) {
43
- var d = this,
44
- 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) {
45
- return b = d[e](a, b, c);
46
- }).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);
47
- }, c.prototype.get = function (a) {
48
- return this.item[a];
49
- }, c.prototype.create = function (a, c, d) {
50
- var e,
51
- 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() };
52
- }, c.prototype.createRange = function (a, c) {
53
- var d = this,
54
- e = function e(a) {
55
- return a === !0 || b.isArray(a) || f.isDate(a) ? d.create(a) : a;
56
- };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) };
57
- }, c.prototype.withinRange = function (a, b) {
58
- return a = this.createRange(a.from, a.to), b.pick >= a.from.pick && b.pick <= a.to.pick;
59
- }, c.prototype.overlapRanges = function (a, b) {
60
- 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);
61
- }, c.prototype.now = function (a, b, c) {
62
- return b = new Date(), c && c.rel && b.setDate(b.getDate() + c.rel), this.normalize(b, c);
63
- }, c.prototype.navigate = function (a, c, d) {
64
- var e,
65
- f,
66
- g,
67
- h,
68
- i = b.isArray(c),
69
- j = b.isPlainObject(c),
70
- k = this.item.view;if (i || j) {
71
- 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;) {
72
- h -= 1;
73
- }c = [f, g, h];
74
- }return c;
75
- }, c.prototype.normalize = function (a) {
76
- return a.setHours(0, 0, 0, 0), a;
77
- }, c.prototype.measure = function (a, b) {
78
- 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;
79
- }, c.prototype.viewset = function (a, b) {
80
- return this.create([b.year, b.month, 1]);
81
- }, c.prototype.validate = function (a, c, d) {
82
- var e,
83
- g,
84
- h,
85
- i,
86
- j = this,
87
- k = c,
88
- l = d && d.interval ? d.interval : 1,
89
- m = -1 === j.item.enable,
90
- n = j.item.min,
91
- o = j.item.max,
92
- p = m && j.item.disable.filter(function (a) {
93
- if (b.isArray(a)) {
94
- var d = j.create(a).pick;d < c.pick ? e = !0 : d > c.pick && (g = !0);
95
- }return f.isInteger(a);
96
- }).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);) {
97
- c = j.create([c.year, c.month, c.date + l]);
98
- }return c;
99
- }, c.prototype.disabled = function (a) {
100
- var c = this,
101
- d = c.item.disable.filter(function (d) {
102
- 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;
103
- });return d = d.length && !d.filter(function (a) {
104
- return b.isArray(a) && "inverted" == a[3] || b.isPlainObject(a) && a.inverted;
105
- }).length, -1 === c.item.enable ? !d : d || a.pick < c.item.min.pick || a.pick > c.item.max.pick;
106
- }, c.prototype.parse = function (a, b, c) {
107
- var d = this,
108
- e = {};return b && "string" == typeof b ? (c && c.format || (c = c || {}, c.format = d.settings.format), d.formats.toArray(c.format).map(function (a) {
109
- var c = d.formats[a],
110
- g = c ? f.trigger(c, d, [b, e]) : a.replace(/^!/, "").length;c && (e[a] = b.substr(0, g)), b = b.substr(g);
111
- }), [e.yyyy || e.yy, +(e.mm || e.m) - 1, e.dd || e.d]) : b;
112
- }, c.prototype.formats = function () {
113
- function a(a, b, c) {
114
- var d = a.match(/[^\x00-\x7F]+|\w+/)[0];return c.mm || c.m || (c.m = b.indexOf(d) + 1), d.length;
115
- }function b(a) {
116
- return a.match(/\w+/)[0].length;
117
- }return { d: function d(a, b) {
118
- return a ? f.digits(a) : b.date;
119
- }, dd: function dd(a, b) {
120
- return a ? 2 : f.lead(b.date);
121
- }, ddd: function ddd(a, c) {
122
- return a ? b(a) : this.settings.weekdaysShort[c.day];
123
- }, dddd: function dddd(a, c) {
124
- return a ? b(a) : this.settings.weekdaysFull[c.day];
125
- }, m: function m(a, b) {
126
- return a ? f.digits(a) : b.month + 1;
127
- }, mm: function mm(a, b) {
128
- return a ? 2 : f.lead(b.month + 1);
129
- }, mmm: function mmm(b, c) {
130
- var d = this.settings.monthsShort;return b ? a(b, d, c) : d[c.month];
131
- }, mmmm: function mmmm(b, c) {
132
- var d = this.settings.monthsFull;return b ? a(b, d, c) : d[c.month];
133
- }, yy: function yy(a, b) {
134
- return a ? 2 : ("" + b.year).slice(2);
135
- }, yyyy: function yyyy(a, b) {
136
- return a ? 4 : b.year;
137
- }, toArray: function toArray(a) {
138
- return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);
139
- }, toString: function toString(a, b) {
140
- var c = this;return c.formats.toArray(a).map(function (a) {
141
- return f.trigger(c.formats[a], c, [0, b]) || a.replace(/^!/, "");
142
- }).join("");
143
- } };
144
- }(), c.prototype.isDateExact = function (a, c) {
145
- 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;
146
- }, c.prototype.isDateOverlap = function (a, c) {
147
- var d = this,
148
- 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;
149
- }, c.prototype.flipEnable = function (a) {
150
- var b = this.item;b.enable = a || (-1 == b.enable ? 1 : -1);
151
- }, c.prototype.deactivate = function (a, c) {
152
- var d = this,
153
- 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) {
154
- for (var c, g = 0; g < e.length; g += 1) {
155
- if (d.isDateExact(a, e[g])) {
156
- c = !0;break;
157
- }
158
- }c || (f.isInteger(a) || f.isDate(a) || b.isArray(a) || b.isPlainObject(a) && a.from && a.to) && e.push(a);
159
- }), e;
160
- }, c.prototype.activate = function (a, c) {
161
- var d = this,
162
- e = d.item.disable,
163
- g = e.length;return "flip" == c ? d.flipEnable() : c === !0 ? (d.flipEnable(1), e = []) : c === !1 ? (d.flipEnable(-1), e = []) : c.map(function (a) {
164
- var c, h, i, j;for (i = 0; g > i; i += 1) {
165
- if (h = e[i], d.isDateExact(h, a)) {
166
- c = e[i] = null, j = !0;break;
167
- }if (d.isDateOverlap(h, a)) {
168
- 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;
169
- }
170
- }if (c) for (i = 0; g > i; i += 1) {
171
- if (d.isDateExact(e[i], a)) {
172
- e[i] = null;break;
173
- }
174
- }if (j) for (i = 0; g > i; i += 1) {
175
- if (d.isDateOverlap(e[i], a)) {
176
- e[i] = null;break;
177
- }
178
- }c && e.push(c);
179
- }), e.filter(function (a) {
180
- return null != a;
181
- });
182
- }, c.prototype.nodes = function (a) {
183
- var b = this,
184
- c = b.settings,
185
- g = b.item,
186
- h = g.now,
187
- i = g.select,
188
- j = g.highlight,
189
- k = g.view,
190
- l = g.disable,
191
- m = g.min,
192
- n = g.max,
193
- o = function (a, b) {
194
- 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 item(d) {
195
- return [a[d], c.klass.weekdays, 'scope=col title="' + b[d] + '"'];
196
- } })));
197
- }((c.showWeekdaysFull ? c.weekdaysFull : c.weekdaysShort).slice(0), c.weekdaysFull.slice(0)),
198
- p = function p(a) {
199
- 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) + '"');
200
- },
201
- q = function q() {
202
- 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 item(a) {
203
- 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" : "")];
204
- } }), 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);
205
- },
206
- r = function r() {
207
- var d = k.year,
208
- e = c.selectYears === !0 ? 5 : ~~(c.selectYears / 2);if (e) {
209
- var g = m.year,
210
- h = n.year,
211
- i = d - e,
212
- j = d + e;if (g > i && (j += g - i, i = g), j > h) {
213
- var l = i - g,
214
- o = j - h;i -= l > o ? o : l, j = h;
215
- }return f.node("select", f.group({ min: i, max: j, i: 1, node: "option", item: function item(a) {
216
- return [a, 0, "value=" + a + (d == a ? " selected" : "")];
217
- } }), c.klass.selectYear, (a ? "" : "disabled") + " " + f.ariaAttr({ controls: b.$node[0].id + "_table" }) + ' title="' + c.labelYearSelect + '"');
218
- }return f.node("div", d, c.klass.year);
219
- };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 item(a) {
220
- 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 max() {
221
- return this.min + d - 1;
222
- }, i: 1, node: "td", item: function item(a) {
223
- a = b.create([k.year, k.month, a + (c.firstDay ? 1 : 0)]);var d = i && i.pick == a.pick,
224
- e = j && j.pick == a.pick,
225
- g = l && b.disabled(a) || a.pick < m.pick || a.pick > n.pick,
226
- o = f.trigger(b.formats.toString, b, [c.format, a]);return [f.node("div", a.date, function (b) {
227
- 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(" ");
228
- }([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" })];
229
- } })];
230
- } })), 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);
231
- }, c.defaults = function (a) {
232
- 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" } };
233
- }(a.klasses().picker + "__"), a.extend("pickadate", c);
234
- });
@@ -1,172 +0,0 @@
1
- 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; };
2
-
3
- /*
4
- * pickadate.js v3.5.6, 2015/04/20
5
- * By Amsul, http://amsul.ca
6
- * Hosted on http://amsul.github.io/pickadate.js
7
- * Licensed under MIT
8
- */
9
-
10
- !function (a) {
11
- "function" == typeof define && define.amd ? define("picker", ["jquery"], a) : "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ? module.exports = a(require("jquery")) : this.Picker = a(jQuery);
12
- }(function (a) {
13
- function b(f, g, i, m) {
14
- function n() {
15
- 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"');
16
- }function o() {
17
- 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) {
18
- a.preventDefault(), B.open();
19
- }).on("keydown." + w.id, u), e(f, { haspopup: !0, expanded: !1, readonly: !1, owns: f.id + "_root" });
20
- }function p() {
21
- e(B.$root[0], "hidden", !0);
22
- }function q() {
23
- B.$holder.on({ keydown: u, "focus.toOpen": t, blur: function blur() {
24
- z.removeClass(y.target);
25
- }, focusin: function focusin(a) {
26
- B.$root.removeClass(y.focused), a.stopPropagation();
27
- }, "mousedown click": function mousedownClick(b) {
28
- 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()));
29
- } }).on("click", "[data-pick], [data-nav], [data-clear], [data-close]", function () {
30
- var b = a(this),
31
- c = b.data(),
32
- d = b.hasClass(y.navDisabled) || b.hasClass(y.disabled),
33
- 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);
34
- });
35
- }function r() {
36
- 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 () {
37
- B._hidden.value = f.value ? B.get("select", x.formatSubmit) : "";
38
- });
39
- }function s() {
40
- v && l ? B.$holder.find("." + y.frame).one("transitionend", function () {
41
- B.$holder[0].focus();
42
- }) : B.$holder[0].focus();
43
- }function t(a) {
44
- a.stopPropagation(), z.addClass(y.target), B.$root.addClass(y.focused), B.open();
45
- }function u(a) {
46
- var b = a.keyCode,
47
- 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()));
48
- }if (!f) return b;var v = !1,
49
- w = { id: f.id || "P" + Math.abs(~~(Math.random() * new Date())) },
50
- x = i ? a.extend(!0, {}, i.defaults, m) : m || {},
51
- y = a.extend({}, b.klasses(), x.klass),
52
- z = a(f),
53
- A = function A() {
54
- return this.start();
55
- },
56
- B = A.prototype = { constructor: A, $node: z, start: function start() {
57
- 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"));
58
- }, render: function render(b) {
59
- 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");
60
- }, stop: function stop() {
61
- return w.start ? (B.close(), B._hidden && B._hidden.parentNode.removeChild(B._hidden), B.$root.remove(), z.removeClass(y.input).removeData(g), setTimeout(function () {
62
- z.off("." + w.id);
63
- }, 0), f.type = w.type, f.readOnly = !1, B.trigger("stop"), w.methods = {}, w.start = !1, B) : B;
64
- }, open: function open(c) {
65
- return w.open ? B : (z.addClass(y.active), e(f, "expanded", !0), setTimeout(function () {
66
- B.$root.addClass(y.opened), e(B.$root[0], "hidden", !1);
67
- }, 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) {
68
- var b = a.target;b != f && b != document && 3 != a.which && B.close(b === B.$holder[0]);
69
- }).on("keydown." + w.id, function (c) {
70
- var d = c.keyCode,
71
- e = B.component.key[d],
72
- 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)));
73
- })), B.trigger("open"));
74
- }, close: function close(a) {
75
- return a && (x.editable ? f.focus() : (B.$holder.off("focus.toOpen").focus(), setTimeout(function () {
76
- B.$holder.on("focus.toOpen", t);
77
- }, 0))), z.removeClass(y.active), e(f, "expanded", !1), setTimeout(function () {
78
- B.$root.removeClass(y.opened + " " + y.focused), e(B.$root[0], "hidden", !0);
79
- }, 0), w.open ? (w.open = !1, v && k.css("overflow", "").css("padding-right", "-=" + d()), j.off("." + w.id), B.trigger("close")) : B;
80
- }, clear: function clear(a) {
81
- return B.set("clear", null, a);
82
- }, set: function set(b, c, d) {
83
- var e,
84
- f,
85
- g = a.isPlainObject(b),
86
- h = g ? b : {};if (d = g && a.isPlainObject(c) ? c : d || {}, b) {
87
- g || (h[b] = c);for (e in h) {
88
- 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");
89
- }B.render();
90
- }return d.muted ? B : B.trigger("set", h);
91
- }, get: function get(a, c) {
92
- if (a = a || "value", null != w[a]) return w[a];if ("valueSubmit" == a) {
93
- if (B._hidden) return B._hidden.value;a = "value";
94
- }if ("value" == a) return f.value;if (a in B.component.item) {
95
- if ("string" == typeof c) {
96
- var d = B.component.get(a);return d ? b._.trigger(B.component.formats.toString, B.component, [c, d]) : "";
97
- }return B.component.get(a);
98
- }
99
- }, on: function on(b, c, d) {
100
- var e,
101
- f,
102
- g = a.isPlainObject(b),
103
- h = g ? b : {};if (b) {
104
- g || (h[b] = c);for (e in h) {
105
- f = h[e], d && (e = "_" + e), w.methods[e] = w.methods[e] || [], w.methods[e].push(f);
106
- }
107
- }return B;
108
- }, off: function off() {
109
- var a,
110
- b,
111
- c = arguments;for (a = 0, namesCount = c.length; a < namesCount; a += 1) {
112
- b = c[a], b in w.methods && delete w.methods[b];
113
- }return B;
114
- }, trigger: function trigger(a, c) {
115
- var d = function d(a) {
116
- var d = w.methods[a];d && d.map(function (a) {
117
- b._.trigger(a, B, [c]);
118
- });
119
- };return d("_" + a), d(a), B;
120
- } };return new A();
121
- }function c(a) {
122
- var b,
123
- c = "position";return a.currentStyle ? b = a.currentStyle[c] : window.getComputedStyle && (b = getComputedStyle(a)[c]), "fixed" == b;
124
- }function d() {
125
- if (k.height() <= i.height()) return 0;var b = a('<div style="visibility:hidden;width:100px" />').appendTo("body"),
126
- c = b[0].offsetWidth;b.css("overflow", "scroll");var d = a('<div style="width:100%" />').appendTo(b),
127
- e = d[0].offsetWidth;return b.remove(), c - e;
128
- }function e(b, c, d) {
129
- if (a.isPlainObject(c)) for (var e in c) {
130
- f(b, e, c[e]);
131
- } else f(b, c, d);
132
- }function f(a, b, c) {
133
- a.setAttribute(("role" == b ? "" : "aria-") + b, c);
134
- }function g(b, c) {
135
- a.isPlainObject(b) || (b = { attribute: c }), c = "";for (var d in b) {
136
- var e = ("role" == d ? "" : "aria-") + d,
137
- f = b[d];c += null == f ? "" : e + '="' + b[d] + '"';
138
- }return c;
139
- }function h() {
140
- try {
141
- return document.activeElement;
142
- } catch (a) {}
143
- }var i = a(window),
144
- j = a(document),
145
- k = a(document.documentElement),
146
- l = null != document.documentElement.style.transition;return b.klasses = function (a) {
147
- 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" };
148
- }, b._ = { group: function group(a) {
149
- for (var c, d = "", e = b._.trigger(a.min, a); e <= b._.trigger(a.max, a, [e]); e += a.i) {
150
- c = b._.trigger(a.item, a, [e]), d += b._.node(a.node, c[0], c[1], c[2]);
151
- }return d;
152
- }, node: function node(b, c, d, e) {
153
- return c ? (c = a.isArray(c) ? c.join("") : c, d = d ? ' class="' + d + '"' : "", e = e ? " " + e : "", "<" + b + d + e + ">" + c + "</" + b + ">") : "";
154
- }, lead: function lead(a) {
155
- return (10 > a ? "0" : "") + a;
156
- }, trigger: function trigger(a, b, c) {
157
- return "function" == typeof a ? a.apply(b, c || []) : a;
158
- }, digits: function digits(a) {
159
- return (/\d/.test(a[1]) ? 2 : 1
160
- );
161
- }, isDate: function isDate(a) {
162
- return {}.toString.call(a).indexOf("Date") > -1 && this.isInteger(a.getDate());
163
- }, isInteger: function isInteger(a) {
164
- return {}.toString.call(a).indexOf("Number") > -1 && a % 1 === 0;
165
- }, ariaAttr: g }, b.extend = function (c, d) {
166
- a.fn[c] = function (e, f) {
167
- var g = this.data(c);return "picker" == e ? g : g && "string" == typeof e ? b._.trigger(g[e], g, [f]) : this.each(function () {
168
- var f = a(this);f.data(c) || new b(this, c, d, e);
169
- });
170
- }, a.fn[c].defaults = d.defaults;
171
- }, b;
172
- });