vliz-be-theme 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +50 -0
  4. data/_config.yml +4 -0
  5. data/_data/articles.yml +43 -0
  6. data/_data/bg_with_block.yml +5 -0
  7. data/_data/carrousel.yml +28 -0
  8. data/_data/carrousel_two.yml +33 -0
  9. data/_data/main_banner.yml +24 -0
  10. data/_data/simple_questions.yml +16 -0
  11. data/_includes/banner/banner.html +50 -0
  12. data/_includes/banner/main.html +35 -0
  13. data/_includes/banner/topic.html +20 -0
  14. data/_includes/block_gallery_cards/card.html +36 -0
  15. data/_includes/block_gallery_cards/first_card.html +50 -0
  16. data/_includes/block_gallery_cards/main.html +40 -0
  17. data/_includes/carrousel_block/item.html +21 -0
  18. data/_includes/carrousel_block/main.html +22 -0
  19. data/_includes/carrousel_w_waves/item.html +27 -0
  20. data/_includes/carrousel_w_waves/main.html +39 -0
  21. data/_includes/footer/main.html +312 -0
  22. data/_includes/image_bg_white_card/main.html +26 -0
  23. data/_includes/image_w_descr_curly/main.html +48 -0
  24. data/_includes/light_bg_block/item.html +12 -0
  25. data/_includes/light_bg_block/main.html +19 -0
  26. data/_includes/mobile-overlay/main.html +419 -0
  27. data/_includes/navigation/main.html +515 -0
  28. data/_includes/navigation/search-overlay.html +49 -0
  29. data/_includes/no_bg_cards/item.html +24 -0
  30. data/_includes/no_bg_cards/main.html +21 -0
  31. data/_includes/no_bg_colored_blocks/item.html +19 -0
  32. data/_includes/no_bg_colored_blocks/main.html +34 -0
  33. data/_includes/simple_color_boxes/item.html +11 -0
  34. data/_includes/simple_color_boxes/main.html +29 -0
  35. data/_layouts/default.html +150 -0
  36. data/_layouts/page.html +5 -0
  37. data/_layouts/post.html +5 -0
  38. data/assets/core/misc/Vlaanderen_verbeelding werkt.png +0 -0
  39. data/assets/core/misc/bib_publications_bg.jpg +0 -0
  40. data/assets/core/misc/calendar.svg +1 -0
  41. data/assets/core/misc/check.svg +1 -0
  42. data/assets/core/misc/close.png +0 -0
  43. data/assets/core/misc/error.svg +1 -0
  44. data/assets/core/misc/gradient.png +0 -0
  45. data/assets/core/misc/loading-small.gif +0 -0
  46. data/assets/core/misc/move.svg +1 -0
  47. data/assets/core/misc/person.svg +1 -0
  48. data/assets/core/misc/privacyshield.png +0 -0
  49. data/assets/core/misc/share-Facebook.png +0 -0
  50. data/assets/core/misc/share-Fave.png +0 -0
  51. data/assets/core/misc/share-LinkedIn.png +0 -0
  52. data/assets/core/misc/share-Mailto.png +0 -0
  53. data/assets/core/misc/share-Print.png +0 -0
  54. data/assets/core/misc/share-RSS.png +0 -0
  55. data/assets/core/misc/share-Twitter.png +0 -0
  56. data/assets/core/misc/swoosh.svg +3 -0
  57. data/assets/core/misc/swoosh_bg.svg +11 -0
  58. data/assets/core/misc/throbber-active.gif +0 -0
  59. data/assets/core/misc/throbber-inactive.png +0 -0
  60. data/assets/core/misc/tree-bottom.png +0 -0
  61. data/assets/core/misc/tree.png +0 -0
  62. data/assets/core/misc/twistie-down.svg +1 -0
  63. data/assets/core/misc/twistie-up.svg +1 -0
  64. data/assets/core/misc/warning.svg +1 -0
  65. data/assets/core/misc/west_vlaanderen_logo.png +0 -0
  66. data/assets/css/custom_style.css +5 -0
  67. data/assets/css/stylesheet_one.css +2461 -0
  68. data/assets/css/stylesheet_two.css +9753 -0
  69. data/assets/css/tablesaw-base.css +601 -0
  70. data/assets/css/tablesaw-responsive.css +189 -0
  71. data/assets/js/brands.js +3448 -0
  72. data/assets/js/fontawesome-icons.js +6 -0
  73. data/assets/js/fontawesome.js +2355 -0
  74. data/assets/js/regular.js +1354 -0
  75. data/assets/js/script_one.js +3361 -0
  76. data/assets/js/script_three.js +1160 -0
  77. data/assets/js/script_two.js +3913 -0
  78. data/assets/js/solid.js +9921 -0
  79. data/assets/js/tablesaw-init.js +18 -0
  80. data/assets/js/tablesaw.min.js +1408 -0
  81. data/assets/media/img/SquidRNA.webp +0 -0
  82. data/assets/media/img/graph_concept_art.jpg +0 -0
  83. data/assets/media/img/placeholder.png +0 -0
  84. data/assets/media/video/Homepage_website_SimonStevin.mp4 +0 -0
  85. metadata +140 -0
@@ -0,0 +1,1408 @@
1
+ !(function (t, e) {
2
+ "function" == typeof define && define.amd
3
+ ? define(["jquery"], function (a) {
4
+ return (t.Tablesaw = e(a, t));
5
+ })
6
+ : "object" == typeof exports
7
+ ? (module.exports = e(
8
+ "document" in t ? require("jquery") : require("jquery")(t),
9
+ t
10
+ ))
11
+ : (t.Tablesaw = e(jQuery, t));
12
+ })("undefined" != typeof window ? window : this, function (t, e) {
13
+ "use strict";
14
+ var a = e.document,
15
+ s = /complete|loaded/.test(a.readyState);
16
+ a.addEventListener("DOMContentLoaded", function () {
17
+ s = !0;
18
+ });
19
+ var n,
20
+ i,
21
+ o,
22
+ l,
23
+ r,
24
+ c,
25
+ h,
26
+ d,
27
+ u,
28
+ b = {
29
+ i18n: {
30
+ modeStack: "Stack",
31
+ modeSwipe: "Swipe",
32
+ modeToggle: "Toggle",
33
+ modeSwitchColumnsAbbreviated: "Cols",
34
+ modeSwitchColumns: "Columns",
35
+ columnToggleButton: "Columns",
36
+ columnToggleError: "No eligible columns.",
37
+ sort: "Sort",
38
+ swipePreviousColumn: "Previous column",
39
+ swipeNextColumn: "Next column",
40
+ },
41
+ mustard: "head" in a && (!e.blackberry || e.WebKitPoint) && !e.operamini,
42
+ $: t,
43
+ _init: function (t) {
44
+ b.$(t || a).trigger("enhance.tablesaw");
45
+ },
46
+ init: function (t) {
47
+ (s = s || /complete|loaded/.test(a.readyState))
48
+ ? b._init(t)
49
+ : "addEventListener" in a &&
50
+ a.addEventListener("DOMContentLoaded", function () {
51
+ b._init(t);
52
+ });
53
+ },
54
+ };
55
+ return (
56
+ t(a).on("enhance.tablesaw", function () {
57
+ "undefined" != typeof TablesawConfig &&
58
+ TablesawConfig.i18n &&
59
+ (b.i18n = t.extend(b.i18n, TablesawConfig.i18n || {})),
60
+ (b.i18n.modes = [
61
+ b.i18n.modeStack,
62
+ b.i18n.modeSwipe,
63
+ b.i18n.modeToggle,
64
+ ]);
65
+ }),
66
+ b.mustard && t(a.documentElement).addClass("tablesaw-enhanced"),
67
+ (function () {
68
+ var s = "tablesaw-bar",
69
+ n = {
70
+ create: "tablesawcreate",
71
+ destroy: "tablesawdestroy",
72
+ refresh: "tablesawrefresh",
73
+ resize: "tablesawresize",
74
+ },
75
+ i = {};
76
+ b.events = n;
77
+ var o = function (e) {
78
+ if (!e) throw new Error("Tablesaw requires an element.");
79
+ (this.table = e),
80
+ (this.$table = t(e)),
81
+ (this.$thead = this.$table.children().filter("thead").eq(0)),
82
+ (this.$tbody = this.$table.children().filter("tbody")),
83
+ (this.mode = this.$table.attr("data-tablesaw-mode") || "stack"),
84
+ (this.$toolbar = null),
85
+ (this.attributes = {
86
+ subrow: "data-tablesaw-subrow",
87
+ ignorerow: "data-tablesaw-ignorerow",
88
+ }),
89
+ this.init();
90
+ };
91
+ (o.prototype.init = function () {
92
+ if (!this.$thead.length)
93
+ throw new Error(
94
+ "tablesaw: a <thead> is required, but none was found."
95
+ );
96
+ if (!this.$thead.find("th").length)
97
+ throw new Error(
98
+ "tablesaw: no header cells found. Are you using <th> inside of <thead>?"
99
+ );
100
+ this.$table.attr("id") ||
101
+ this.$table.attr("id", "tablesaw-" + Math.round(1e4 * Math.random())),
102
+ this.createToolbar(),
103
+ this._initCells(),
104
+ this.$table.data("tablesaw", this),
105
+ this.$table.trigger(n.create, [this]);
106
+ }),
107
+ (o.prototype.getConfig = function (e) {
108
+ var a = t.extend(i, e || {});
109
+ return t.extend(
110
+ a,
111
+ "undefined" != typeof TablesawConfig ? TablesawConfig : {}
112
+ );
113
+ }),
114
+ (o.prototype._getPrimaryHeaderRow = function () {
115
+ return this._getHeaderRows().eq(0);
116
+ }),
117
+ (o.prototype._getHeaderRows = function () {
118
+ return this.$thead
119
+ .children()
120
+ .filter("tr")
121
+ .filter(function () {
122
+ return !t(this).is("[data-tablesaw-ignorerow]");
123
+ });
124
+ }),
125
+ (o.prototype._getRowIndex = function (t) {
126
+ return t.prevAll().length;
127
+ }),
128
+ (o.prototype._getHeaderRowIndeces = function () {
129
+ var e = this,
130
+ a = [];
131
+ return (
132
+ this._getHeaderRows().each(function () {
133
+ a.push(e._getRowIndex(t(this)));
134
+ }),
135
+ a
136
+ );
137
+ }),
138
+ (o.prototype._getPrimaryHeaderCells = function (t) {
139
+ return (t || this._getPrimaryHeaderRow()).find("th");
140
+ }),
141
+ (o.prototype._$getCells = function (e) {
142
+ var a = this;
143
+ return t(e)
144
+ .add(e.cells)
145
+ .filter(function () {
146
+ var e = t(this),
147
+ s = e.parent(),
148
+ n = e.is("[colspan]");
149
+ return !(
150
+ s.is("[" + a.attributes.subrow + "]") ||
151
+ (s.is("[" + a.attributes.ignorerow + "]") && n)
152
+ );
153
+ });
154
+ }),
155
+ (o.prototype._getVisibleColspan = function () {
156
+ var e = 0;
157
+ return (
158
+ this._getPrimaryHeaderCells().each(function () {
159
+ var a = t(this);
160
+ "none" !== a.css("display") &&
161
+ (e += parseInt(a.attr("colspan"), 10) || 1);
162
+ }),
163
+ e
164
+ );
165
+ }),
166
+ (o.prototype.getColspanForCell = function (e) {
167
+ var a = this._getVisibleColspan(),
168
+ s = 0;
169
+ return (
170
+ e.closest("tr").data("tablesaw-rowspanned") && s++,
171
+ e.siblings().each(function () {
172
+ var e = t(this),
173
+ a = parseInt(e.attr("colspan"), 10) || 1;
174
+ "none" !== e.css("display") && (s += a);
175
+ }),
176
+ a - s
177
+ );
178
+ }),
179
+ (o.prototype.isCellInColumn = function (e, a) {
180
+ return t(e)
181
+ .add(e.cells)
182
+ .filter(function () {
183
+ return this === a;
184
+ }).length;
185
+ }),
186
+ (o.prototype.updateColspanCells = function (e, a, s) {
187
+ var n = this,
188
+ i = n._getPrimaryHeaderRow();
189
+ this.$table
190
+ .find("[rowspan][data-tablesaw-priority]")
191
+ .each(function () {
192
+ var e = t(this);
193
+ if ("persist" === e.attr("data-tablesaw-priority")) {
194
+ var a = e.closest("tr"),
195
+ s = parseInt(e.attr("rowspan"), 10);
196
+ s > 1 && ((a = a.next()).data("tablesaw-rowspanned", !0), s--);
197
+ }
198
+ }),
199
+ this.$table
200
+ .find("[colspan],[data-tablesaw-maxcolspan]")
201
+ .filter(function () {
202
+ return t(this).closest("tr")[0] !== i[0];
203
+ })
204
+ .each(function () {
205
+ var i = t(this);
206
+ if (void 0 === s || n.isCellInColumn(a, this)) {
207
+ var o = n.getColspanForCell(i);
208
+ e &&
209
+ void 0 !== s &&
210
+ i[0 === o ? "addClass" : "removeClass"](e);
211
+ var l = parseInt(i.attr("data-tablesaw-maxcolspan"), 10);
212
+ l
213
+ ? o > l && (o = l)
214
+ : i.attr("data-tablesaw-maxcolspan", i.attr("colspan")),
215
+ i.attr("colspan", o);
216
+ }
217
+ });
218
+ }),
219
+ (o.prototype._findPrimaryHeadersForCell = function (t) {
220
+ for (
221
+ var e = this._getPrimaryHeaderRow(),
222
+ a = this._getRowIndex(e),
223
+ s = [],
224
+ n = 0;
225
+ n < this.headerMapping.length;
226
+ n++
227
+ )
228
+ if (n !== a)
229
+ for (var i = 0; i < this.headerMapping[n].length; i++)
230
+ this.headerMapping[n][i] === t &&
231
+ s.push(this.headerMapping[a][i]);
232
+ return s;
233
+ }),
234
+ (o.prototype.getRows = function () {
235
+ var e = this;
236
+ return this.$table.find("tr").filter(function () {
237
+ return t(this).closest("table").is(e.$table);
238
+ });
239
+ }),
240
+ (o.prototype.getBodyRows = function (e) {
241
+ return (e ? t(e) : this.$tbody).children().filter("tr");
242
+ }),
243
+ (o.prototype.getHeaderCellIndex = function (t) {
244
+ for (var e = this.headerMapping[0], a = 0; a < e.length; a++)
245
+ if (e[a] === t) return a;
246
+ return -1;
247
+ }),
248
+ (o.prototype._initCells = function () {
249
+ this.$table.find("[data-tablesaw-maxcolspan]").each(function () {
250
+ var e = t(this);
251
+ e.attr("colspan", e.attr("data-tablesaw-maxcolspan"));
252
+ });
253
+ var e = this.getRows(),
254
+ a = [];
255
+ e.each(function (t) {
256
+ a[t] = [];
257
+ }),
258
+ e.each(function (e) {
259
+ var s = 0;
260
+ t(this)
261
+ .children()
262
+ .each(function () {
263
+ for (
264
+ var t = parseInt(
265
+ this.getAttribute("data-tablesaw-maxcolspan") ||
266
+ this.getAttribute("colspan"),
267
+ 10
268
+ ),
269
+ n = parseInt(this.getAttribute("rowspan"), 10);
270
+ a[e][s];
271
+
272
+ )
273
+ s++;
274
+ if (((a[e][s] = this), t))
275
+ for (var i = 0; i < t - 1; i++) s++, (a[e][s] = this);
276
+ if (n) for (var o = 1; o < n; o++) a[e + o][s] = this;
277
+ s++;
278
+ });
279
+ });
280
+ for (var s = this._getHeaderRowIndeces(), n = 0; n < a[0].length; n++)
281
+ for (var i = 0, o = s.length; i < o; i++) {
282
+ var l,
283
+ r = a[s[i]][n],
284
+ c = s[i];
285
+ for (r.cells || (r.cells = []); c < a.length; )
286
+ r !== (l = a[c][n]) && r.cells.push(l), c++;
287
+ }
288
+ this.headerMapping = a;
289
+ }),
290
+ (o.prototype.refresh = function () {
291
+ this._initCells(), this.$table.trigger(n.refresh, [this]);
292
+ }),
293
+ (o.prototype._getToolbarAnchor = function () {
294
+ var t = this.$table.parent();
295
+ return t.is(".tablesaw-overflow") ? t : this.$table;
296
+ }),
297
+ (o.prototype._getToolbar = function (t) {
298
+ return t || (t = this._getToolbarAnchor()), t.prev().filter("." + s);
299
+ }),
300
+ (o.prototype.createToolbar = function () {
301
+ var e = this._getToolbarAnchor(),
302
+ a = this._getToolbar(e);
303
+ a.length || (a = t("<div>").addClass(s).insertBefore(e)),
304
+ (this.$toolbar = a),
305
+ this.mode && this.$toolbar.addClass("tablesaw-mode-" + this.mode);
306
+ }),
307
+ (o.prototype.destroy = function () {
308
+ this._getToolbar().each(function () {
309
+ this.className = this.className.replace(
310
+ /\btablesaw-mode\-\w*\b/gi,
311
+ ""
312
+ );
313
+ });
314
+ var s = this.$table.attr("id");
315
+ t(a).off("." + s),
316
+ t(e).off("." + s),
317
+ this.$table.trigger(n.destroy, [this]),
318
+ this.$table.removeData("tablesaw");
319
+ }),
320
+ (t.fn.tablesaw = function () {
321
+ return this.each(function () {
322
+ t(this).data("tablesaw") || new o(this);
323
+ });
324
+ });
325
+ var l = t(a);
326
+ l.on("enhance.tablesaw", function (e) {
327
+ if (b.mustard) {
328
+ var a = t(e.target);
329
+ a.parent().length && (a = a.parent()),
330
+ a
331
+ .find("table")
332
+ .filter(
333
+ "[data-tablesaw],[data-tablesaw-mode],[data-tablesaw-sortable]"
334
+ )
335
+ .tablesaw();
336
+ }
337
+ });
338
+ var r,
339
+ c,
340
+ h = !1;
341
+ l.on("scroll.tablesaw", function () {
342
+ (h = !0),
343
+ e.clearTimeout(r),
344
+ (r = e.setTimeout(function () {
345
+ h = !1;
346
+ }, 300));
347
+ }),
348
+ t(e).on("resize", function () {
349
+ h ||
350
+ (e.clearTimeout(c),
351
+ (c = e.setTimeout(function () {
352
+ l.trigger(n.resize);
353
+ }, 150)));
354
+ }),
355
+ (b.Table = o);
356
+ })(),
357
+ (n = "tablesaw-stack"),
358
+ (i = "tablesaw-cell-label"),
359
+ (o = "tablesaw-cell-content"),
360
+ (l = "tablesaw-stack"),
361
+ (r = "data-tablesaw-no-labels"),
362
+ (c = "data-tablesaw-hide-empty"),
363
+ ((h = function (e, a) {
364
+ (this.tablesaw = a),
365
+ (this.$table = t(e)),
366
+ (this.labelless = this.$table.is("[" + r + "]")),
367
+ (this.hideempty = this.$table.is("[" + c + "]")),
368
+ this.$table.data(l, this);
369
+ }).prototype.init = function () {
370
+ if ((this.$table.addClass(n), !this.labelless)) {
371
+ var e = this;
372
+ this.$table
373
+ .find("th, td")
374
+ .filter(function () {
375
+ return !t(this).closest("thead").length;
376
+ })
377
+ .filter(function () {
378
+ return !(
379
+ t(this).is("[" + r + "]") ||
380
+ t(this)
381
+ .closest("tr")
382
+ .is("[" + r + "]") ||
383
+ (e.hideempty && !t(this).html())
384
+ );
385
+ })
386
+ .each(function () {
387
+ var s = t(a.createElement("b")).addClass(i),
388
+ n = t(this);
389
+ t(e.tablesaw._findPrimaryHeadersForCell(this)).each(function (e) {
390
+ var n = t(this.cloneNode(!0)),
391
+ i = n.find(".tablesaw-sortable-btn");
392
+ n.find(".tablesaw-sortable-arrow").remove();
393
+ var o = n.find("[data-tablesaw-checkall]");
394
+ if ((o.closest("label").remove(), o.length)) s = t([]);
395
+ else {
396
+ e > 0 && s.append(a.createTextNode(", "));
397
+ for (var l, r = i.length ? i[0] : n[0]; (l = r.firstChild); )
398
+ s[0].appendChild(l);
399
+ }
400
+ }),
401
+ s.length &&
402
+ !n.find("." + o).length &&
403
+ n.wrapInner("<span class='" + o + "'></span>");
404
+ var l = n.find("." + i);
405
+ l.length
406
+ ? l.replaceWith(s)
407
+ : (n.prepend(a.createTextNode(" ")), n.prepend(s));
408
+ });
409
+ }
410
+ }),
411
+ (h.prototype.destroy = function () {
412
+ this.$table.removeClass(n),
413
+ this.$table.find("." + i).remove(),
414
+ this.$table.find("." + o).each(function () {
415
+ t(this).replaceWith(t(this.childNodes));
416
+ });
417
+ }),
418
+ t(a)
419
+ .on(b.events.create, function (t, e) {
420
+ "stack" === e.mode && new h(e.table, e).init();
421
+ })
422
+ .on(b.events.refresh, function (e, a) {
423
+ "stack" === a.mode && t(a.table).data(l).init();
424
+ })
425
+ .on(b.events.destroy, function (e, a) {
426
+ "stack" === a.mode && t(a.table).data(l).destroy();
427
+ }),
428
+ (b.Stack = h),
429
+ (d = {
430
+ _create: function () {
431
+ return t(this).each(function () {
432
+ t(this)
433
+ .trigger("beforecreate.tablesawbtn")
434
+ .tablesawbtn("_init")
435
+ .trigger("create.tablesawbtn");
436
+ });
437
+ },
438
+ _init: function () {
439
+ var e = t(this),
440
+ a = this.getElementsByTagName("select")[0];
441
+ return (
442
+ a &&
443
+ t(this)
444
+ .addClass("btn-select tablesaw-btn-select")
445
+ .tablesawbtn("_select", a),
446
+ e
447
+ );
448
+ },
449
+ _select: function (e) {
450
+ var s = function (e, s) {
451
+ var n,
452
+ i,
453
+ o = t(s).find("option"),
454
+ l = a.createElement("span"),
455
+ r = !1;
456
+ if (
457
+ (l.setAttribute("aria-hidden", "true"),
458
+ (l.innerHTML = "&#160;"),
459
+ o.each(function () {
460
+ this.selected && (l.innerHTML = this.text);
461
+ }),
462
+ (i = e.childNodes),
463
+ o.length > 0)
464
+ ) {
465
+ for (var c = 0, h = i.length; c < h; c++)
466
+ (n = i[c]) &&
467
+ "SPAN" === n.nodeName.toUpperCase() &&
468
+ (e.replaceChild(l, n), (r = !0));
469
+ r || e.insertBefore(l, e.firstChild);
470
+ }
471
+ };
472
+ s(this, e),
473
+ t(this).on("change refresh", function () {
474
+ s(this, e);
475
+ });
476
+ },
477
+ }),
478
+ (t.fn.tablesawbtn = function (e, a, s, n) {
479
+ return this.each(function () {
480
+ return e && "string" == typeof e
481
+ ? t.fn.tablesawbtn.prototype[e].call(this, a, s, n)
482
+ : t(this).data("tablesawbtnactive")
483
+ ? t(this)
484
+ : (t(this).data("tablesawbtnactive", !0),
485
+ void t.fn.tablesawbtn.prototype._create.call(this));
486
+ });
487
+ }),
488
+ t.extend(t.fn.tablesawbtn.prototype, d),
489
+ (function () {
490
+ var s = "tablesaw-coltoggle",
491
+ n = function (e) {
492
+ (this.$table = t(e)),
493
+ this.$table.length &&
494
+ ((this.tablesaw = this.$table.data("tablesaw")),
495
+ (this.attributes = {
496
+ btnTarget: "data-tablesaw-columntoggle-btn-target",
497
+ set: "data-tablesaw-columntoggle-set",
498
+ }),
499
+ (this.classes = {
500
+ columnToggleTable: "tablesaw-columntoggle",
501
+ columnBtnContain:
502
+ "tablesaw-columntoggle-btnwrap tablesaw-advance",
503
+ columnBtn: "tablesaw-columntoggle-btn tablesaw-nav-btn down",
504
+ popup: "tablesaw-columntoggle-popup",
505
+ priorityPrefix: "tablesaw-priority-",
506
+ }),
507
+ (this.set = []),
508
+ (this.$headers = this.tablesaw._getPrimaryHeaderCells()),
509
+ this.$table.data(s, this));
510
+ };
511
+ (n.prototype.initSet = function () {
512
+ var e = this.$table.attr(this.attributes.set);
513
+ if (e) {
514
+ var a = this.$table[0];
515
+ this.set = t("table[" + this.attributes.set + "='" + e + "']")
516
+ .filter(function () {
517
+ return this !== a;
518
+ })
519
+ .get();
520
+ }
521
+ }),
522
+ (n.prototype.init = function () {
523
+ if (this.$table.length) {
524
+ var n,
525
+ i,
526
+ o,
527
+ l,
528
+ r,
529
+ c,
530
+ h = this,
531
+ d = this.tablesaw.getConfig({
532
+ getColumnToggleLabelTemplate: function (t) {
533
+ return (
534
+ "<label><input type='checkbox' checked>" + t + "</label>"
535
+ );
536
+ },
537
+ });
538
+ this.$table.addClass(this.classes.columnToggleTable),
539
+ (i = (n = this.$table.attr("id")) + "-popup"),
540
+ (c = t(
541
+ "<div class='" + this.classes.columnBtnContain + "'></div>"
542
+ )),
543
+ (o = t(
544
+ "<a href='#" +
545
+ i +
546
+ "' class='btn tablesaw-btn btn-micro " +
547
+ this.classes.columnBtn +
548
+ "' data-popup-link><span>" +
549
+ b.i18n.columnToggleButton +
550
+ "</span></a>"
551
+ )),
552
+ (l = t(
553
+ "<div class='" + this.classes.popup + "' id='" + i + "'></div>"
554
+ )),
555
+ (r = t("<div class='tablesaw-btn-group'></div>")),
556
+ (this.$popup = l);
557
+ var u = !1;
558
+ this.$headers.each(function () {
559
+ var e = t(this),
560
+ a = e.attr("data-tablesaw-priority"),
561
+ s = h.tablesaw._$getCells(this);
562
+ a &&
563
+ "persist" !== a &&
564
+ (s.addClass(h.classes.priorityPrefix + a),
565
+ t(d.getColumnToggleLabelTemplate(e.text()))
566
+ .appendTo(r)
567
+ .find('input[type="checkbox"]')
568
+ .data("tablesaw-header", this),
569
+ (u = !0));
570
+ }),
571
+ u || r.append("<label>" + b.i18n.columnToggleError + "</label>"),
572
+ r.appendTo(l),
573
+ r.find('input[type="checkbox"]').on("change", function (e) {
574
+ var a;
575
+ (v(e.target), h.set.length) &&
576
+ (t(h.$popup)
577
+ .find("input[type='checkbox']")
578
+ .each(function (t) {
579
+ if (this === e.target) return (a = t), !1;
580
+ }),
581
+ t(h.set).each(function () {
582
+ var n = t(this)
583
+ .data(s)
584
+ .$popup.find("input[type='checkbox']")
585
+ .get(a);
586
+ n && ((n.checked = e.target.checked), v(n));
587
+ }));
588
+ }),
589
+ o.appendTo(c);
590
+ var f,
591
+ p = t(this.$table.attr(this.attributes.btnTarget));
592
+ c.appendTo(p.length ? p : this.tablesaw.$toolbar),
593
+ o.on("click.tablesaw", function (s) {
594
+ s.preventDefault(),
595
+ c.is(".visible")
596
+ ? m()
597
+ : (c.addClass("visible"),
598
+ o.removeClass("down").addClass("up"),
599
+ t(a).off("click." + n, m),
600
+ e.clearTimeout(f),
601
+ (f = e.setTimeout(function () {
602
+ t(a).on("click." + n, m);
603
+ }, 15)));
604
+ }),
605
+ l.appendTo(c),
606
+ (this.$menu = r);
607
+ var w,
608
+ g = this.$table.closest(".tablesaw-overflow");
609
+ if (g.css("-webkit-overflow-scrolling"))
610
+ g.on("scroll", function () {
611
+ var a = t(this);
612
+ e.clearTimeout(w),
613
+ (w = e.setTimeout(function () {
614
+ a.css("-webkit-overflow-scrolling", "auto"),
615
+ e.setTimeout(function () {
616
+ a.css("-webkit-overflow-scrolling", "touch");
617
+ }, 0);
618
+ }, 100));
619
+ });
620
+ t(e).on(b.events.resize + "." + n, function () {
621
+ h.refreshToggle();
622
+ }),
623
+ this.initSet(),
624
+ this.refreshToggle();
625
+ }
626
+ function v(t) {
627
+ var e = t.checked,
628
+ a = h.getHeaderFromCheckbox(t),
629
+ s = h.tablesaw._$getCells(a);
630
+ s[e ? "removeClass" : "addClass"]("tablesaw-toggle-cellhidden"),
631
+ s[e ? "addClass" : "removeClass"]("tablesaw-toggle-cellvisible"),
632
+ h.updateColspanCells(a, e),
633
+ h.$table.trigger("tablesawcolumns");
634
+ }
635
+ function m(e) {
636
+ (e && t(e.target).closest("." + h.classes.popup).length) ||
637
+ (t(a).off("click." + n),
638
+ o.removeClass("up").addClass("down"),
639
+ c.removeClass("visible"));
640
+ }
641
+ }),
642
+ (n.prototype.getHeaderFromCheckbox = function (e) {
643
+ return t(e).data("tablesaw-header");
644
+ }),
645
+ (n.prototype.refreshToggle = function () {
646
+ var t = this;
647
+ this.$menu.find("input").each(function () {
648
+ var e = t.getHeaderFromCheckbox(this);
649
+ this.checked =
650
+ "table-cell" === t.tablesaw._$getCells(e).eq(0).css("display");
651
+ }),
652
+ this.updateColspanCells();
653
+ }),
654
+ (n.prototype.updateColspanCells = function (t, e) {
655
+ this.tablesaw.updateColspanCells("tablesaw-toggle-cellhidden", t, e);
656
+ }),
657
+ (n.prototype.destroy = function () {
658
+ this.$table.removeClass(this.classes.columnToggleTable),
659
+ this.$table.find("th, td").each(function () {
660
+ t(this)
661
+ .removeClass("tablesaw-toggle-cellhidden")
662
+ .removeClass("tablesaw-toggle-cellvisible"),
663
+ (this.className = this.className.replace(
664
+ /\bui\-table\-priority\-\d\b/g,
665
+ ""
666
+ ));
667
+ });
668
+ }),
669
+ t(a).on(b.events.create, function (t, e) {
670
+ "columntoggle" === e.mode && new n(e.table).init();
671
+ }),
672
+ t(a).on(b.events.destroy, function (e, a) {
673
+ "columntoggle" === a.mode && t(a.table).data(s).destroy();
674
+ }),
675
+ t(a).on(b.events.refresh, function (e, a) {
676
+ "columntoggle" === a.mode && t(a.table).data(s).refreshToggle();
677
+ }),
678
+ (b.ColumnToggle = n);
679
+ })(),
680
+ (function () {
681
+ function e(e) {
682
+ var a = [];
683
+ return (
684
+ t(e.childNodes).each(function () {
685
+ var e = t(this);
686
+ e.is("input, select")
687
+ ? a.push(e.val())
688
+ : e.is(".tablesaw-cell-label") ||
689
+ a.push((e.text() || "").replace(/^\s+|\s+$/g, ""));
690
+ }),
691
+ a.join("")
692
+ );
693
+ }
694
+ var s = "tablesaw-sortable",
695
+ n = "table[data-" + s + "]",
696
+ i = "[data-" + s + "-switch]",
697
+ o = {
698
+ sortCol: "data-tablesaw-sortable-col",
699
+ defaultCol: "data-tablesaw-sortable-default-col",
700
+ numericCol: "data-tablesaw-sortable-numeric",
701
+ subRow: "data-tablesaw-subrow",
702
+ ignoreRow: "data-tablesaw-ignorerow",
703
+ },
704
+ l = {
705
+ head: s + "-head",
706
+ ascend: s + "-ascending",
707
+ descend: s + "-descending",
708
+ switcher: s + "-switch",
709
+ tableToolbar: "tablesaw-bar-section",
710
+ sortButton: s + "-btn",
711
+ },
712
+ r = {
713
+ _create: function (e) {
714
+ return t(this).each(function () {
715
+ if (t(this).data(s + "-init")) return !1;
716
+ t(this)
717
+ .data(s + "-init", !0)
718
+ .trigger("beforecreate." + s)
719
+ [s]("_init", e)
720
+ .trigger("create." + s);
721
+ });
722
+ },
723
+ _init: function () {
724
+ var a,
725
+ n,
726
+ r,
727
+ c = t(this),
728
+ h = c.data("tablesaw");
729
+ function d(e) {
730
+ t.each(e, function (e, a) {
731
+ var s = t(a);
732
+ s.removeAttr(o.defaultCol),
733
+ s.removeClass(l.ascend),
734
+ s.removeClass(l.descend);
735
+ });
736
+ }
737
+ c.addClass(s),
738
+ (a = c
739
+ .children()
740
+ .filter("thead")
741
+ .find("th[" + o.sortCol + "]")),
742
+ (r = a),
743
+ t.each(r, function (e, a) {
744
+ t(a).addClass(l.head);
745
+ }),
746
+ (function (e, a) {
747
+ t.each(e, function (e, s) {
748
+ var n = t("<button class='" + l.sortButton + "'/>");
749
+ n.on("click", { col: s }, a),
750
+ t(s)
751
+ .wrapInner(n)
752
+ .find("button")
753
+ .append("<span class='tablesaw-sortable-arrow'>");
754
+ });
755
+ })(a, function (e) {
756
+ if (!t(e.target).is("a[href]")) {
757
+ e.stopPropagation();
758
+ var i = t(e.target).closest("[" + o.sortCol + "]"),
759
+ r = e.data.col,
760
+ h = a.index(i[0]);
761
+ d(
762
+ i
763
+ .closest("thead")
764
+ .find("th")
765
+ .filter(function () {
766
+ return this !== i[0];
767
+ })
768
+ ),
769
+ i.is("." + l.descend) || !i.is("." + l.ascend)
770
+ ? (c[s]("sortBy", r, !0), (h += "_asc"))
771
+ : (c[s]("sortBy", r), (h += "_desc")),
772
+ n && n.find("select").val(h).trigger("refresh"),
773
+ e.preventDefault();
774
+ }
775
+ }),
776
+ (function (e) {
777
+ t.each(e, function (e, a) {
778
+ var s = t(a);
779
+ s.is("[" + o.defaultCol + "]") &&
780
+ (s.is("." + l.descend) || s.addClass(l.ascend));
781
+ });
782
+ })(a),
783
+ c.is(i) &&
784
+ (function (a) {
785
+ n = t("<div>").addClass(l.switcher).addClass(l.tableToolbar);
786
+ var i = ["<label>" + b.i18n.sort + ":"];
787
+ i.push('<span class="btn tablesaw-btn"><select>'),
788
+ a.each(function (a) {
789
+ var s = t(this),
790
+ n = s.is("[" + o.defaultCol + "]"),
791
+ r = s.is("." + l.descend),
792
+ c = s.is("[" + o.numericCol + "]"),
793
+ h = 0;
794
+ t(this.cells.slice(0, 5)).each(function () {
795
+ isNaN(parseInt(e(this), 10)) || h++;
796
+ });
797
+ var d = 5 === h;
798
+ c || s.attr(o.numericCol, d ? "" : "false"),
799
+ i.push(
800
+ "<option" +
801
+ (n && !r ? " selected" : "") +
802
+ ' value="' +
803
+ a +
804
+ '_asc">' +
805
+ s.text() +
806
+ " " +
807
+ (d ? "&#x2191;" : "(A-Z)") +
808
+ "</option>"
809
+ ),
810
+ i.push(
811
+ "<option" +
812
+ (n && r ? " selected" : "") +
813
+ ' value="' +
814
+ a +
815
+ '_desc">' +
816
+ s.text() +
817
+ " " +
818
+ (d ? "&#x2193;" : "(Z-A)") +
819
+ "</option>"
820
+ );
821
+ }),
822
+ i.push("</select></span></label>"),
823
+ n.html(i.join(""));
824
+ var r = h.$toolbar.children().eq(0);
825
+ r.length ? n.insertBefore(r) : n.appendTo(h.$toolbar),
826
+ n.find(".tablesaw-btn").tablesawbtn(),
827
+ n.find("select").on("change", function () {
828
+ var e = t(this).val().split("_"),
829
+ n = a.eq(e[0]);
830
+ d(n.siblings()), c[s]("sortBy", n.get(0), "asc" === e[1]);
831
+ });
832
+ })(a);
833
+ },
834
+ sortRows: function (a, s, n, i, l) {
835
+ var r,
836
+ c = (function (a, s) {
837
+ var n = [];
838
+ return (
839
+ t.each(a, function (a, i) {
840
+ for (
841
+ var l = i.parentNode, r = t(l), c = [], h = r.next();
842
+ h.is("[" + o.subRow + "]");
843
+
844
+ )
845
+ c.push(h[0]), (h = h.next());
846
+ var d = l.parentNode;
847
+ r.is("[" + o.subRow + "]") ||
848
+ (d === s &&
849
+ n.push({
850
+ element: i,
851
+ cell: e(i),
852
+ row: l,
853
+ subrows: c.length ? c : null,
854
+ ignored: r.is("[" + o.ignoreRow + "]"),
855
+ }));
856
+ }),
857
+ n
858
+ );
859
+ })(i.cells, l),
860
+ h = t(i).data("tablesaw-sort");
861
+ return (
862
+ (r =
863
+ (!(!h || "function" != typeof h) && h(n)) ||
864
+ (function (t, e) {
865
+ var a = /[^\-\+\d\.]/g;
866
+ return t
867
+ ? function (t, s) {
868
+ return t.ignored || s.ignored
869
+ ? 0
870
+ : e
871
+ ? parseFloat(t.cell.replace(a, "")) -
872
+ parseFloat(s.cell.replace(a, ""))
873
+ : t.cell.toLowerCase() > s.cell.toLowerCase()
874
+ ? 1
875
+ : -1;
876
+ }
877
+ : function (t, s) {
878
+ return t.ignored || s.ignored
879
+ ? 0
880
+ : e
881
+ ? parseFloat(s.cell.replace(a, "")) -
882
+ parseFloat(t.cell.replace(a, ""))
883
+ : t.cell.toLowerCase() < s.cell.toLowerCase()
884
+ ? 1
885
+ : -1;
886
+ };
887
+ })(
888
+ n,
889
+ t(i).is("[" + o.numericCol + "]") &&
890
+ !t(i).is("[" + o.numericCol + '="false"]')
891
+ )),
892
+ (function (t) {
893
+ var e,
894
+ a,
895
+ s = [];
896
+ for (e = 0, a = t.length; e < a; e++)
897
+ s.push(t[e].row), t[e].subrows && s.push(t[e].subrows);
898
+ return s;
899
+ })(c.sort(r))
900
+ );
901
+ },
902
+ makeColDefault: function (e, a) {
903
+ var s = t(e);
904
+ s.attr(o.defaultCol, "true"),
905
+ a
906
+ ? (s.removeClass(l.descend), s.addClass(l.ascend))
907
+ : (s.removeClass(l.ascend), s.addClass(l.descend));
908
+ },
909
+ sortBy: function (e, a) {
910
+ var n,
911
+ i = t(this),
912
+ o = i.data("tablesaw");
913
+ o.$tbody.each(function () {
914
+ var l,
915
+ r,
916
+ c,
917
+ h = t(this),
918
+ d = o.getBodyRows(this),
919
+ u = o.headerMapping[0];
920
+ for (r = 0, c = u.length; r < c; r++)
921
+ if (u[r] === e) {
922
+ n = r;
923
+ break;
924
+ }
925
+ for (
926
+ r = 0, c = (l = i[s]("sortRows", d, n, a, e, this)).length;
927
+ r < c;
928
+ r++
929
+ )
930
+ h.append(l[r]);
931
+ }),
932
+ i[s]("makeColDefault", e, a),
933
+ i.trigger("tablesaw-sorted");
934
+ },
935
+ };
936
+ (t.fn[s] = function (e) {
937
+ var a,
938
+ n = Array.prototype.slice.call(arguments, 1);
939
+ return e && "string" == typeof e
940
+ ? void 0 !== (a = t.fn[s].prototype[e].apply(this[0], n))
941
+ ? a
942
+ : t(this)
943
+ : (t(this).data(s + "-active") ||
944
+ (t(this).data(s + "-active", !0),
945
+ t.fn[s].prototype._create.call(this, e)),
946
+ t(this));
947
+ }),
948
+ t.extend(t.fn[s].prototype, r),
949
+ t(a).on(b.events.create, function (t, e) {
950
+ e.$table.is(n) && e.$table[s]();
951
+ });
952
+ })(),
953
+ (function () {
954
+ var s = {
955
+ hideBtn: "disabled",
956
+ persistWidths: "tablesaw-fix-persist",
957
+ hiddenCol: "tablesaw-swipe-cellhidden",
958
+ persistCol: "tablesaw-swipe-cellpersist",
959
+ allColumnsVisible: "tablesaw-all-cols-visible",
960
+ },
961
+ n = {
962
+ disableTouchEvents: "data-tablesaw-no-touch",
963
+ ignorerow: "data-tablesaw-ignorerow",
964
+ subrow: "data-tablesaw-subrow",
965
+ };
966
+ function i(i, o) {
967
+ var l = o.data("tablesaw"),
968
+ r = t("<div class='tablesaw-advance'></div>"),
969
+ c = t(
970
+ "<a href='#' class='btn tablesaw-nav-btn tablesaw-btn btn-micro left'>" +
971
+ b.i18n.swipePreviousColumn +
972
+ "</a>"
973
+ ).appendTo(r),
974
+ h = t(
975
+ "<a href='#' class='btn tablesaw-nav-btn tablesaw-btn btn-micro right'>" +
976
+ b.i18n.swipeNextColumn +
977
+ "</a>"
978
+ ).appendTo(r),
979
+ d = i._getPrimaryHeaderCells(),
980
+ u = d.not('[data-tablesaw-priority="persist"]'),
981
+ f = [],
982
+ p = [],
983
+ w = t(a.head || "head"),
984
+ g = o.attr("id");
985
+ if (!d.length)
986
+ throw new Error("tablesaw swipe: no header cells found.");
987
+ function v() {
988
+ o.css({ width: "1px" }),
989
+ o.find("." + s.hiddenCol).removeClass(s.hiddenCol),
990
+ (f = []),
991
+ (p = []),
992
+ d.each(function () {
993
+ var t = this.offsetWidth;
994
+ f.push(t), y(this) || p.push(t);
995
+ }),
996
+ o.css({ width: "" });
997
+ }
998
+ function m(t) {
999
+ l._$getCells(t).removeClass(s.hiddenCol);
1000
+ }
1001
+ function C(t) {
1002
+ l._$getCells(t).addClass(s.hiddenCol);
1003
+ }
1004
+ function y(e) {
1005
+ return t(e).is('[data-tablesaw-priority="persist"]');
1006
+ }
1007
+ function $() {
1008
+ o.removeClass(s.persistWidths), t("#" + g + "-persist").remove();
1009
+ }
1010
+ function T() {
1011
+ var e,
1012
+ a = [];
1013
+ return (
1014
+ u.each(function (n) {
1015
+ var i = t(this),
1016
+ o = "none" === i.css("display") || i.is("." + s.hiddenCol);
1017
+ if (o || e) {
1018
+ if (o && e) return (a[1] = n), !1;
1019
+ } else (e = !0), (a[0] = n);
1020
+ }),
1021
+ a
1022
+ );
1023
+ }
1024
+ function k() {
1025
+ var t = T();
1026
+ return [t[1] - 1, t[0] - 1];
1027
+ }
1028
+ function x(t) {
1029
+ return t[1] > -1 && t[1] < u.length;
1030
+ }
1031
+ function _() {
1032
+ if (
1033
+ !(a = o.attr("data-tablesaw-swipe-media")) ||
1034
+ ("matchMedia" in e && e.matchMedia(a).matches)
1035
+ ) {
1036
+ var a,
1037
+ n = o.parent().width(),
1038
+ i = [],
1039
+ r = 0,
1040
+ c = [],
1041
+ h = d.length;
1042
+ d.each(function (e) {
1043
+ var a = t(this).is('[data-tablesaw-priority="persist"]');
1044
+ i.push(a), (r += f[e]), c.push(r), (a || r > n) && h--;
1045
+ });
1046
+ var u = 0 === h;
1047
+ d.each(function (t) {
1048
+ c[t] > n && C(this);
1049
+ });
1050
+ var b = !0;
1051
+ d.each(function (t) {
1052
+ if (i[t])
1053
+ return (
1054
+ (e = this),
1055
+ l._$getCells(e).addClass(s.persistCol),
1056
+ void (
1057
+ b &&
1058
+ (l._$getCells(this).css("width", c[t] + "px"), (b = !1))
1059
+ )
1060
+ );
1061
+ var e;
1062
+ (c[t] <= n || u) &&
1063
+ ((u = !1),
1064
+ m(this),
1065
+ l.updateColspanCells(s.hiddenCol, this, !0));
1066
+ }),
1067
+ $(),
1068
+ o.trigger("tablesawcolumns");
1069
+ }
1070
+ }
1071
+ function M() {
1072
+ B(!0);
1073
+ }
1074
+ function S() {
1075
+ B(!1);
1076
+ }
1077
+ function B(e) {
1078
+ var a;
1079
+ if (x((a = e ? T() : k()))) {
1080
+ isNaN(a[0]) && (a[0] = e ? 0 : u.length - 1);
1081
+ var n,
1082
+ i = (function () {
1083
+ var e,
1084
+ a = "#" + g + ".tablesaw-swipe ",
1085
+ n = [],
1086
+ i = o.width(),
1087
+ l = i,
1088
+ r = [];
1089
+ if (
1090
+ (d.each(function (t) {
1091
+ var e;
1092
+ y(this) &&
1093
+ ((e = this.offsetWidth),
1094
+ (l -= e),
1095
+ e < 0.75 * i &&
1096
+ (r.push(t + "-" + e),
1097
+ n.push(
1098
+ a +
1099
+ " ." +
1100
+ s.persistCol +
1101
+ ":nth-child(" +
1102
+ (t + 1) +
1103
+ ") { width: " +
1104
+ e +
1105
+ "px; }"
1106
+ )));
1107
+ }),
1108
+ (e = r.join("_")),
1109
+ n.length)
1110
+ ) {
1111
+ o.addClass(s.persistWidths);
1112
+ var c = t("#" + g + "-persist");
1113
+ (c.length && c.data("tablesaw-hash") === e) ||
1114
+ (c.remove(),
1115
+ t("<style>" + n.join("\n") + "</style>")
1116
+ .attr("id", g + "-persist")
1117
+ .data("tablesaw-hash", e)
1118
+ .appendTo(w));
1119
+ }
1120
+ return l;
1121
+ })(),
1122
+ r = a[0],
1123
+ c = a[1],
1124
+ h = u.get(r),
1125
+ b = !1,
1126
+ f = !1;
1127
+ C(h), l.updateColspanCells(s.hiddenCol, h, !0);
1128
+ for (var v = r + (e ? 1 : -1); v >= 0 && v < p.length; ) {
1129
+ i -= p[v];
1130
+ var $ = u.eq(v);
1131
+ $.is(".tablesaw-swipe-cellhidden")
1132
+ ? i > 0 &&
1133
+ ((b = !0),
1134
+ (f = !0),
1135
+ m((n = $.get(0))),
1136
+ l.updateColspanCells(s.hiddenCol, n, !1))
1137
+ : (f = !0),
1138
+ e ? v++ : v--;
1139
+ }
1140
+ f
1141
+ ? !b && x(e ? T() : k()) && B(e)
1142
+ : (m((n = u.get(c))), l.updateColspanCells(s.hiddenCol, n, !1)),
1143
+ o.trigger("tablesawcolumns");
1144
+ }
1145
+ }
1146
+ function H(t, e) {
1147
+ return (t.touches || t.originalEvent.touches)[0][e];
1148
+ }
1149
+ o.addClass("tablesaw-swipe"),
1150
+ v(),
1151
+ r.appendTo(l.$toolbar),
1152
+ g ||
1153
+ ((g = "tableswipe-" + Math.round(1e4 * Math.random())),
1154
+ o.attr("id", g)),
1155
+ c.add(h).on("click", function (e) {
1156
+ t(e.target).closest(h).length ? M() : S(), e.preventDefault();
1157
+ }),
1158
+ o.is("[" + n.disableTouchEvents + "]") ||
1159
+ o.on("touchstart.swipetoggle", function (a) {
1160
+ var s,
1161
+ n,
1162
+ o = H(a, "pageX"),
1163
+ l = H(a, "pageY"),
1164
+ r = e.pageYOffset;
1165
+ t(e).off(b.events.resize, _),
1166
+ t(this)
1167
+ .on("touchmove.swipetoggle", function (t) {
1168
+ (s = H(t, "pageX")), (n = H(t, "pageY"));
1169
+ })
1170
+ .on("touchend.swipetoggle", function () {
1171
+ var a = i.getConfig({
1172
+ swipeHorizontalThreshold: 30,
1173
+ swipeVerticalThreshold: 30,
1174
+ }),
1175
+ c = a.swipe
1176
+ ? a.swipe.verticalThreshold
1177
+ : a.swipeVerticalThreshold,
1178
+ h = a.swipe
1179
+ ? a.swipe.horizontalThreshold
1180
+ : a.swipeHorizontalThreshold,
1181
+ d = Math.abs(e.pageYOffset - r) >= c;
1182
+ Math.abs(n - l) >= c ||
1183
+ d ||
1184
+ (s - o < -1 * h && M(), s - o > h && S()),
1185
+ e.setTimeout(function () {
1186
+ t(e).on(b.events.resize, _);
1187
+ }, 300),
1188
+ t(this).off("touchmove.swipetoggle touchend.swipetoggle");
1189
+ });
1190
+ }),
1191
+ o
1192
+ .on("tablesawcolumns.swipetoggle", function () {
1193
+ var t = x(k()),
1194
+ e = x(T());
1195
+ c[t ? "removeClass" : "addClass"](s.hideBtn),
1196
+ h[e ? "removeClass" : "addClass"](s.hideBtn),
1197
+ l.$toolbar[t || e ? "removeClass" : "addClass"](
1198
+ s.allColumnsVisible
1199
+ );
1200
+ })
1201
+ .on("tablesawnext.swipetoggle", function () {
1202
+ M();
1203
+ })
1204
+ .on("tablesawprev.swipetoggle", function () {
1205
+ S();
1206
+ })
1207
+ .on(b.events.destroy + ".swipetoggle", function () {
1208
+ var a = t(this);
1209
+ a.removeClass("tablesaw-swipe"),
1210
+ l.$toolbar.find(".tablesaw-advance").remove(),
1211
+ t(e).off(b.events.resize, _),
1212
+ a.off(".swipetoggle");
1213
+ })
1214
+ .on(b.events.refresh, function () {
1215
+ $(), v(), _();
1216
+ }),
1217
+ _(),
1218
+ t(e).on(b.events.resize, _);
1219
+ }
1220
+ t(a).on(b.events.create, function (t, e) {
1221
+ "swipe" === e.mode && i(e, e.$table);
1222
+ });
1223
+ })(),
1224
+ (function () {
1225
+ var s = {
1226
+ attr: { init: "data-tablesaw-minimap" },
1227
+ show: function (t) {
1228
+ var a = t.getAttribute(s.attr.init);
1229
+ return (
1230
+ "" === a || (!!(a && "matchMedia" in e) && e.matchMedia(a).matches)
1231
+ );
1232
+ },
1233
+ };
1234
+ t(a).on(b.events.create, function (a, n) {
1235
+ ("swipe" !== n.mode && "columntoggle" !== n.mode) ||
1236
+ !n.$table.is("[ " + s.attr.init + "]") ||
1237
+ (function (a) {
1238
+ var n = a.data("tablesaw"),
1239
+ i = t('<div class="tablesaw-advance minimap">'),
1240
+ o = t('<ul class="tablesaw-advance-dots">').appendTo(i),
1241
+ l = "tablesaw-advance-dots-hide";
1242
+ function r() {
1243
+ if (s.show(a[0])) {
1244
+ i.css("display", "block");
1245
+ var e = o.find("li").removeClass(l);
1246
+ a.find("thead th").each(function (a) {
1247
+ "none" === t(this).css("display") && e.eq(a).addClass(l);
1248
+ });
1249
+ } else i.css("display", "none");
1250
+ }
1251
+ a
1252
+ .data("tablesaw")
1253
+ ._getPrimaryHeaderCells()
1254
+ .each(function () {
1255
+ o.append("<li><i></i></li>");
1256
+ }),
1257
+ i.appendTo(n.$toolbar),
1258
+ r(),
1259
+ t(e).on(b.events.resize, r),
1260
+ a
1261
+ .on("tablesawcolumns.minimap", function () {
1262
+ r();
1263
+ })
1264
+ .on(b.events.destroy + ".minimap", function () {
1265
+ var a = t(this);
1266
+ n.$toolbar.find(".tablesaw-advance").remove(),
1267
+ t(e).off(b.events.resize, r),
1268
+ a.off(".minimap");
1269
+ });
1270
+ })(n.$table);
1271
+ }),
1272
+ (b.MiniMap = s);
1273
+ })(),
1274
+ (u = {
1275
+ selectors: { init: "table[data-tablesaw-mode-switch]" },
1276
+ attributes: { excludeMode: "data-tablesaw-mode-exclude" },
1277
+ classes: { main: "tablesaw-modeswitch", toolbar: "tablesaw-bar-section" },
1278
+ modes: ["stack", "swipe", "columntoggle"],
1279
+ init: function (e) {
1280
+ var a,
1281
+ s = t(e),
1282
+ n = s.data("tablesaw"),
1283
+ i = s.attr(u.attributes.excludeMode),
1284
+ o = n.$toolbar,
1285
+ l = t("<div>").addClass(u.classes.main + " " + u.classes.toolbar),
1286
+ r = [
1287
+ '<label><span class="abbreviated">' +
1288
+ b.i18n.modeSwitchColumnsAbbreviated +
1289
+ '</span><span class="longform">' +
1290
+ b.i18n.modeSwitchColumns +
1291
+ "</span>:",
1292
+ ],
1293
+ c = s.attr("data-tablesaw-mode");
1294
+ r.push('<span class="btn tablesaw-btn"><select>');
1295
+ for (var h = 0, d = u.modes.length; h < d; h++)
1296
+ (i && i.toLowerCase() === u.modes[h]) ||
1297
+ ((a = c === u.modes[h]),
1298
+ r.push(
1299
+ "<option" +
1300
+ (a ? " selected" : "") +
1301
+ ' value="' +
1302
+ u.modes[h] +
1303
+ '">' +
1304
+ b.i18n.modes[h] +
1305
+ "</option>"
1306
+ ));
1307
+ r.push("</select></span></label>"), l.html(r.join(""));
1308
+ var f = o.find(".tablesaw-advance").eq(0);
1309
+ f.length ? l.insertBefore(f) : l.appendTo(o),
1310
+ l.find(".tablesaw-btn").tablesawbtn(),
1311
+ l.find("select").on("change", function (a) {
1312
+ return u.onModeChange.call(e, a, t(this).val());
1313
+ });
1314
+ },
1315
+ onModeChange: function (e, a) {
1316
+ var s = t(this),
1317
+ n = s.data("tablesaw");
1318
+ n.$toolbar.find("." + u.classes.main).remove(),
1319
+ n.destroy(),
1320
+ s.attr("data-tablesaw-mode", a),
1321
+ s.tablesaw();
1322
+ },
1323
+ }),
1324
+ t(a).on(b.events.create, function (t, e) {
1325
+ e.$table.is(u.selectors.init) && u.init(e.table);
1326
+ }),
1327
+ (function () {
1328
+ var e = "tablesawCheckAll";
1329
+ function s(t) {
1330
+ (this.tablesaw = t),
1331
+ (this.$table = t.$table),
1332
+ (this.attr = "data-tablesaw-checkall"),
1333
+ (this.checkAllSelector = "[" + this.attr + "]"),
1334
+ (this.forceCheckedSelector = "[" + this.attr + "-checked]"),
1335
+ (this.forceUncheckedSelector = "[" + this.attr + "-unchecked]"),
1336
+ (this.checkboxSelector = 'input[type="checkbox"]'),
1337
+ (this.$triggers = null),
1338
+ (this.$checkboxes = null),
1339
+ this.$table.data(e) || (this.$table.data(e, this), this.init());
1340
+ }
1341
+ (s.prototype._filterCells = function (e) {
1342
+ return e
1343
+ .filter(function () {
1344
+ return !t(this)
1345
+ .closest("tr")
1346
+ .is("[data-tablesaw-subrow],[data-tablesaw-ignorerow]");
1347
+ })
1348
+ .find(this.checkboxSelector)
1349
+ .not(this.checkAllSelector);
1350
+ }),
1351
+ (s.prototype.getCheckboxesForButton = function (e) {
1352
+ return this._filterCells(t(t(e).attr(this.attr)));
1353
+ }),
1354
+ (s.prototype.getCheckboxesForCheckbox = function (e) {
1355
+ return this._filterCells(t(t(e).closest("th")[0].cells));
1356
+ }),
1357
+ (s.prototype.init = function () {
1358
+ var e = this;
1359
+ this.$table.find(this.checkAllSelector).each(function () {
1360
+ t(this).is(e.checkboxSelector)
1361
+ ? e.addCheckboxEvents(this)
1362
+ : e.addButtonEvents(this);
1363
+ });
1364
+ }),
1365
+ (s.prototype.addButtonEvents = function (a) {
1366
+ var s = this;
1367
+ t(a).on("click", function (a) {
1368
+ a.preventDefault();
1369
+ var n,
1370
+ i = s.getCheckboxesForButton(this),
1371
+ o = !0;
1372
+ i.each(function () {
1373
+ this.checked || (o = !1);
1374
+ }),
1375
+ (n =
1376
+ !!t(this).is(s.forceCheckedSelector) ||
1377
+ (!t(this).is(s.forceUncheckedSelector) && !o)),
1378
+ i.each(function () {
1379
+ (this.checked = n), t(this).trigger("change." + e);
1380
+ });
1381
+ });
1382
+ }),
1383
+ (s.prototype.addCheckboxEvents = function (a) {
1384
+ var s = this;
1385
+ t(a).on("change", function () {
1386
+ var t = this.checked;
1387
+ s.getCheckboxesForCheckbox(this).each(function () {
1388
+ this.checked = t;
1389
+ });
1390
+ });
1391
+ var n = s.getCheckboxesForCheckbox(a);
1392
+ n.on("change." + e, function () {
1393
+ var t = 0;
1394
+ n.each(function () {
1395
+ this.checked && t++;
1396
+ });
1397
+ var e = t === n.length;
1398
+ (a.checked = e), (a.indeterminate = 0 !== t && !e);
1399
+ });
1400
+ }),
1401
+ t(a).on(b.events.create, function (t, e) {
1402
+ new s(e);
1403
+ }),
1404
+ (b.CheckAll = s);
1405
+ })(),
1406
+ b
1407
+ );
1408
+ });