bootstrap-table-rails 1.12.2 → 1.13.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -12
  3. data/lib/bootstrap-table-rails/version.rb +1 -1
  4. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table-locale-all.js +2534 -1841
  5. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.css +202 -283
  6. data/vendor/assets/javascripts/bootstrap-table/bootstrap-table.js +3114 -2555
  7. data/vendor/assets/javascripts/bootstrap-table/extensions/accent-neutralise/bootstrap-table-accent-neutralise.js +247 -152
  8. data/vendor/assets/javascripts/bootstrap-table/extensions/addrbar/bootstrap-table-addrbar.js +271 -0
  9. data/vendor/assets/javascripts/bootstrap-table/extensions/auto-refresh/bootstrap-table-auto-refresh.js +77 -68
  10. data/vendor/assets/javascripts/bootstrap-table/extensions/cookie/bootstrap-table-cookie.js +452 -315
  11. data/vendor/assets/javascripts/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.js +105 -86
  12. data/vendor/assets/javascripts/bootstrap-table/extensions/defer-url/bootstrap-table-defer-url.js +44 -27
  13. data/vendor/assets/javascripts/bootstrap-table/extensions/editable/bootstrap-table-editable.js +229 -115
  14. data/vendor/assets/javascripts/bootstrap-table/extensions/export/bootstrap-table-export.js +319 -162
  15. data/vendor/assets/javascripts/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.js +733 -566
  16. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.js +175 -167
  17. data/vendor/assets/javascripts/bootstrap-table/extensions/group-by/bootstrap-table-group-by.js +227 -213
  18. data/vendor/assets/javascripts/bootstrap-table/extensions/i18n-enhance/bootstrap-table-i18n-enhance.js +44 -29
  19. data/vendor/assets/javascripts/bootstrap-table/extensions/key-events/bootstrap-table-key-events.js +92 -70
  20. data/vendor/assets/javascripts/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js +134 -118
  21. data/vendor/assets/javascripts/bootstrap-table/extensions/multi-column-toggle/bootstrap-table-multi-toggle.js +92 -75
  22. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-search/bootstrap-table-multiple-search.js +72 -58
  23. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-selection-row/bootstrap-table-multiple-selection-row.js +129 -113
  24. data/vendor/assets/javascripts/bootstrap-table/extensions/multiple-sort/bootstrap-table-multiple-sort.js +362 -349
  25. data/vendor/assets/javascripts/bootstrap-table/extensions/natural-sorting/bootstrap-table-natural-sorting.js +66 -50
  26. data/vendor/assets/javascripts/bootstrap-table/extensions/{page-jumpto/bootstrap-table-jumpto.css → page-jump-to/bootstrap-table-page-jump-to.css} +0 -0
  27. data/vendor/assets/javascripts/bootstrap-table/extensions/page-jump-to/bootstrap-table-page-jump-to.js +58 -0
  28. data/vendor/assets/javascripts/bootstrap-table/extensions/pipeline/bootstrap-table-pipeline.js +341 -0
  29. data/vendor/assets/javascripts/bootstrap-table/extensions/print/bootstrap-table-print.js +122 -126
  30. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.js +183 -167
  31. data/vendor/assets/javascripts/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.js +124 -110
  32. data/vendor/assets/javascripts/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js +66 -55
  33. data/vendor/assets/javascripts/bootstrap-table/extensions/select2-filter/bootstrap-table-select2-filter.js +281 -272
  34. data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.css +13 -13
  35. data/vendor/assets/javascripts/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.js +182 -106
  36. data/vendor/assets/javascripts/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js +324 -162
  37. data/vendor/assets/javascripts/bootstrap-table/extensions/tree-column/bootstrap-table-tree-column.js +127 -115
  38. data/vendor/assets/javascripts/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.js +106 -96
  39. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-af-ZA.js +48 -35
  40. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ar-SA.js +49 -35
  41. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ca-ES.js +52 -39
  42. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-cs-CZ.js +52 -39
  43. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-da-DK.js +60 -32
  44. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-de-DE.js +61 -48
  45. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-el-GR.js +36 -23
  46. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-en-US.js +57 -44
  47. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-AR.js +39 -26
  48. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CL.js +54 -41
  49. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-CR.js +48 -35
  50. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-ES.js +103 -38
  51. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-MX.js +59 -46
  52. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-NI.js +48 -35
  53. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-es-SP.js +49 -36
  54. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-et-EE.js +51 -38
  55. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-eu-EU.js +51 -38
  56. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fa-IR.js +51 -38
  57. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fi-FI.js +62 -0
  58. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-BE.js +36 -23
  59. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-fr-FR.js +103 -90
  60. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-he-IL.js +51 -38
  61. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hr-HR.js +52 -39
  62. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-hu-HU.js +51 -38
  63. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-id-ID.js +57 -44
  64. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-it-IT.js +59 -47
  65. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ja-JP.js +51 -38
  66. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ka-GE.js +49 -36
  67. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ko-KR.js +45 -32
  68. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ms-MY.js +51 -38
  69. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nb-NO.js +45 -32
  70. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-nl-NL.js +60 -47
  71. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pl-PL.js +45 -32
  72. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-BR.js +49 -36
  73. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-pt-PT.js +51 -38
  74. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ro-RO.js +51 -38
  75. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ru-RU.js +82 -68
  76. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sk-SK.js +57 -44
  77. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-sv-SE.js +45 -32
  78. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-th-TH.js +45 -32
  79. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-tr-TR.js +49 -36
  80. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uk-UA.js +82 -69
  81. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-ur-PK.js +45 -32
  82. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-uz-Latn-UZ.js +57 -44
  83. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-vi-VN.js +36 -23
  84. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-CN.js +54 -41
  85. data/vendor/assets/javascripts/bootstrap-table/locale/bootstrap-table-zh-TW.js +48 -35
  86. metadata +6 -8
  87. data/vendor/assets/javascripts/bootstrap-table/extensions/angular/bootstrap-table-angular.js +0 -107
  88. data/vendor/assets/javascripts/bootstrap-table/extensions/click-edit-row/bootstrap-table-click-edit-row.css +0 -21
  89. data/vendor/assets/javascripts/bootstrap-table/extensions/click-edit-row/bootstrap-table-click-edit-row.js +0 -142
  90. data/vendor/assets/javascripts/bootstrap-table/extensions/filter/bootstrap-table-filter.js +0 -67
  91. data/vendor/assets/javascripts/bootstrap-table/extensions/flat-json/bootstrap-table-flat-json.js +0 -62
  92. data/vendor/assets/javascripts/bootstrap-table/extensions/page-jumpto/bootstrap-table-jumpto.js +0 -50
@@ -1,102 +1,121 @@
1
- /**
2
- * @author Homer Glascock <HopGlascock@gmail.com>
3
- * @version: v1.0.0
4
- */
5
-
6
- !function ($) {
7
- "use strict";
8
-
9
- var calculateObjectValue = $.fn.bootstrapTable.utils.calculateObjectValue,
10
- sprintf = $.fn.bootstrapTable.utils.sprintf;
11
-
12
- var copytext = function (text) {
13
- var textField = document.createElement('textarea');
14
- $(textField).html(text);
15
- document.body.appendChild(textField);
16
- textField.select();
17
-
18
- try {
19
- document.execCommand('copy');
20
- }
21
- catch (e) {
22
- console.log("Oops, unable to copy");
23
- }
24
- $(textField).remove();
25
- };
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define([], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory();
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory();
11
+ global.bootstrapTableCopyRows = mod.exports;
12
+ }
13
+ })(this, function () {
14
+ 'use strict';
15
+
16
+ /**
17
+ * @author Homer Glascock <HopGlascock@gmail.com>
18
+ * @version: v1.0.0
19
+ */
20
+
21
+ !function ($) {
22
+ "use strict";
23
+
24
+ var calculateObjectValue = $.fn.bootstrapTable.utils.calculateObjectValue,
25
+ sprintf = $.fn.bootstrapTable.utils.sprintf;
26
+
27
+ var copytext = function copytext(text) {
28
+ var textField = document.createElement('textarea');
29
+ $(textField).html(text);
30
+ document.body.appendChild(textField);
31
+ textField.select();
32
+
33
+ try {
34
+ document.execCommand('copy');
35
+ } catch (e) {
36
+ console.log("Oops, unable to copy");
37
+ }
38
+ $(textField).remove();
39
+ };
26
40
 
27
- $.extend($.fn.bootstrapTable.defaults, {
28
- copyBtn: false,
29
- copyWHiddenBtn: false,
30
- copyDelemeter: ", "
31
- });
41
+ $.extend($.fn.bootstrapTable.defaults, {
42
+ copyBtn: false,
43
+ copyWHiddenBtn: false,
44
+ copyDelemeter: ", "
45
+ });
32
46
 
33
- $.fn.bootstrapTable.methods.push('copyColumnsToClipboard', 'copyColumnsToClipboardWithHidden');
47
+ $.fn.bootstrapTable.methods.push('copyColumnsToClipboard', 'copyColumnsToClipboardWithHidden');
34
48
 
35
- var BootstrapTable = $.fn.bootstrapTable.Constructor,
36
- _initToolbar = BootstrapTable.prototype.initToolbar;
49
+ var BootstrapTable = $.fn.bootstrapTable.Constructor,
50
+ _initToolbar = BootstrapTable.prototype.initToolbar;
37
51
 
38
- BootstrapTable.prototype.initToolbar = function () {
52
+ BootstrapTable.prototype.initToolbar = function () {
39
53
 
40
- _initToolbar.apply(this, Array.prototype.slice.apply(arguments));
54
+ _initToolbar.apply(this, Array.prototype.slice.apply(arguments));
41
55
 
42
- var that = this,
43
- $btnGroup = this.$toolbar.find('>.btn-group');
56
+ var that = this,
57
+ $btnGroup = this.$toolbar.find('>.btn-group');
44
58
 
45
- if (this.options.clickToSelect || this.options.singleSelect) {
59
+ if (this.options.clickToSelect || this.options.singleSelect) {
46
60
 
47
- if (this.options.copyBtn) {
48
- var copybtn = "<button class='btn btn-default' id='copyBtn'><span class='glyphicon glyphicon-copy icon-pencil'></span></button>";
49
- $btnGroup.append(copybtn);
50
- $btnGroup.find('#copyBtn').click(function () { that.copyColumnsToClipboard(); });
51
- }
61
+ if (this.options.copyBtn) {
62
+ var copybtn = "<button class='btn btn-default' id='copyBtn'><span class='glyphicon glyphicon-copy icon-pencil'></span></button>";
63
+ $btnGroup.append(copybtn);
64
+ $btnGroup.find('#copyBtn').click(function () {
65
+ that.copyColumnsToClipboard();
66
+ });
67
+ }
52
68
 
53
- if (this.options.copyWHiddenBtn) {
54
- var copyhiddenbtn = "<button class='btn btn-default' id='copyWHiddenBtn'><span class='badge'><span class='glyphicon glyphicon-copy icon-pencil'></span></span></button>";
55
- $btnGroup.append(copyhiddenbtn);
56
- $btnGroup.find('#copyWHiddenBtn').click(function () { that.copyColumnsToClipboardWithHidden(); });
69
+ if (this.options.copyWHiddenBtn) {
70
+ var copyhiddenbtn = "<button class='btn btn-default' id='copyWHiddenBtn'><span class='badge'><span class='glyphicon glyphicon-copy icon-pencil'></span></span></button>";
71
+ $btnGroup.append(copyhiddenbtn);
72
+ $btnGroup.find('#copyWHiddenBtn').click(function () {
73
+ that.copyColumnsToClipboardWithHidden();
74
+ });
75
+ }
57
76
  }
58
- }
59
- };
60
-
61
- BootstrapTable.prototype.copyColumnsToClipboard = function () {
62
- var that = this,
63
- ret = "",
64
- delimet = this.options.copyDelemeter;
65
-
66
- $.each(that.getSelections(), function (index, row) {
67
- $.each(that.options.columns[0], function (indy, column) {
68
- if (column.field !== "state" && column.field !== "RowNumber" && column.visible) {
69
- if (row[column.field] !== null) {
70
- ret += calculateObjectValue(column, that.header.formatters[indy], [row[column.field], row, index], row[column.field]);
77
+ };
78
+
79
+ BootstrapTable.prototype.copyColumnsToClipboard = function () {
80
+ var that = this,
81
+ ret = "",
82
+ delimet = this.options.copyDelemeter;
83
+
84
+ $.each(that.getSelections(), function (index, row) {
85
+ $.each(that.options.columns[0], function (indy, column) {
86
+ if (column.field !== "state" && column.field !== "RowNumber" && column.visible) {
87
+ if (row[column.field] !== null) {
88
+ ret += calculateObjectValue(column, that.header.formatters[indy], [row[column.field], row, index], row[column.field]);
89
+ }
90
+ ret += delimet;
71
91
  }
72
- ret += delimet;
73
- }
74
- });
75
-
76
- ret += "\r\n";
77
- });
92
+ });
78
93
 
79
- copytext(ret);
80
- };
81
-
82
- BootstrapTable.prototype.copyColumnsToClipboardWithHidden = function () {
83
- var that = this,
84
- ret = "",
85
- delimet = this.options.copyDelemeter;
94
+ ret += "\r\n";
95
+ });
86
96
 
87
- $.each(that.getSelections(), function (index, row) {
88
- $.each(that.options.columns[0], function (indy, column) {
89
- if (column.field != "state" && column.field !== "RowNumber") {
90
- if (row[column.field] !== null) {
91
- ret += calculateObjectValue(column, that.header.formatters[indy], [row[column.field], row, index], row[column.field]);
97
+ copytext(ret);
98
+ };
99
+
100
+ BootstrapTable.prototype.copyColumnsToClipboardWithHidden = function () {
101
+ var that = this,
102
+ ret = "",
103
+ delimet = this.options.copyDelemeter;
104
+
105
+ $.each(that.getSelections(), function (index, row) {
106
+ $.each(that.options.columns[0], function (indy, column) {
107
+ if (column.field != "state" && column.field !== "RowNumber") {
108
+ if (row[column.field] !== null) {
109
+ ret += calculateObjectValue(column, that.header.formatters[indy], [row[column.field], row, index], row[column.field]);
110
+ }
111
+ ret += delimet;
92
112
  }
93
- ret += delimet;
94
- }
95
- });
113
+ });
96
114
 
97
- ret += "\r\n";
98
- });
115
+ ret += "\r\n";
116
+ });
99
117
 
100
- copytext(ret);
101
- };
102
- }(jQuery);
118
+ copytext(ret);
119
+ };
120
+ }(jQuery);
121
+ });
@@ -1,32 +1,49 @@
1
- /**
2
- * When using server-side processing, the default mode of operation for
3
- * bootstrap-table is to simply throw away any data that currently exists in the
4
- * table and make a request to the server to get the first page of data to
5
- * display. This is fine for an empty table, but if you already have the first
6
- * page of data displayed in the plain HTML, it is a waste of resources. As
7
- * such, you can use data-defer-url instead of data-url to allow you to instruct
8
- * bootstrap-table to not make that initial request, rather it will use the data
9
- * already on the page.
10
- *
11
- * @author: Ruben Suarez
12
- * @webSite: http://rubensa.eu.org
13
- * @version: v1.0.0
14
- */
15
-
16
- (function($) {
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define([], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory();
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory();
11
+ global.bootstrapTableDeferUrl = mod.exports;
12
+ }
13
+ })(this, function () {
17
14
  'use strict';
18
15
 
19
- $.extend($.fn.bootstrapTable.defaults, {
20
- deferUrl : undefined
21
- });
16
+ /**
17
+ * When using server-side processing, the default mode of operation for
18
+ * bootstrap-table is to simply throw away any data that currently exists in the
19
+ * table and make a request to the server to get the first page of data to
20
+ * display. This is fine for an empty table, but if you already have the first
21
+ * page of data displayed in the plain HTML, it is a waste of resources. As
22
+ * such, you can use data-defer-url instead of data-url to allow you to instruct
23
+ * bootstrap-table to not make that initial request, rather it will use the data
24
+ * already on the page.
25
+ *
26
+ * @author: Ruben Suarez
27
+ * @webSite: http://rubensa.eu.org
28
+ * @version: v1.0.0
29
+ */
22
30
 
23
- var BootstrapTable = $.fn.bootstrapTable.Constructor, _init = BootstrapTable.prototype.init;
31
+ (function ($) {
32
+ 'use strict';
24
33
 
25
- BootstrapTable.prototype.init = function() {
26
- _init.apply(this, Array.prototype.slice.apply(arguments));
34
+ $.extend($.fn.bootstrapTable.defaults, {
35
+ deferUrl: undefined
36
+ });
27
37
 
28
- if (this.options.deferUrl) {
29
- this.options.url = this.options.deferUrl;
30
- }
31
- }
32
- })(jQuery);
38
+ var BootstrapTable = $.fn.bootstrapTable.Constructor,
39
+ _init = BootstrapTable.prototype.init;
40
+
41
+ BootstrapTable.prototype.init = function () {
42
+ _init.apply(this, Array.prototype.slice.apply(arguments));
43
+
44
+ if (this.options.deferUrl) {
45
+ this.options.url = this.options.deferUrl;
46
+ }
47
+ };
48
+ })(jQuery);
49
+ });
@@ -1,146 +1,260 @@
1
- /**
2
- * @author zhixin wen <wenzhixin2010@gmail.com>
3
- * extensions: https://github.com/vitalets/x-editable
4
- */
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define([], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory();
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory();
11
+ global.bootstrapTableEditable = mod.exports;
12
+ }
13
+ })(this, function () {
14
+ 'use strict';
15
+
16
+ function _classCallCheck(instance, Constructor) {
17
+ if (!(instance instanceof Constructor)) {
18
+ throw new TypeError("Cannot call a class as a function");
19
+ }
20
+ }
21
+
22
+ var _createClass = function () {
23
+ function defineProperties(target, props) {
24
+ for (var i = 0; i < props.length; i++) {
25
+ var descriptor = props[i];
26
+ descriptor.enumerable = descriptor.enumerable || false;
27
+ descriptor.configurable = true;
28
+ if ("value" in descriptor) descriptor.writable = true;
29
+ Object.defineProperty(target, descriptor.key, descriptor);
30
+ }
31
+ }
32
+
33
+ return function (Constructor, protoProps, staticProps) {
34
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
35
+ if (staticProps) defineProperties(Constructor, staticProps);
36
+ return Constructor;
37
+ };
38
+ }();
39
+
40
+ function _possibleConstructorReturn(self, call) {
41
+ if (!self) {
42
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
43
+ }
44
+
45
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
46
+ }
47
+
48
+ var _get = function get(object, property, receiver) {
49
+ if (object === null) object = Function.prototype;
50
+ var desc = Object.getOwnPropertyDescriptor(object, property);
51
+
52
+ if (desc === undefined) {
53
+ var parent = Object.getPrototypeOf(object);
54
+
55
+ if (parent === null) {
56
+ return undefined;
57
+ } else {
58
+ return get(parent, property, receiver);
59
+ }
60
+ } else if ("value" in desc) {
61
+ return desc.value;
62
+ } else {
63
+ var getter = desc.get;
5
64
 
6
- (function($) {
65
+ if (getter === undefined) {
66
+ return undefined;
67
+ }
7
68
 
8
- 'use strict';
69
+ return getter.call(receiver);
70
+ }
71
+ };
72
+
73
+ function _inherits(subClass, superClass) {
74
+ if (typeof superClass !== "function" && superClass !== null) {
75
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
76
+ }
77
+
78
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
79
+ constructor: {
80
+ value: subClass,
81
+ enumerable: false,
82
+ writable: true,
83
+ configurable: true
84
+ }
85
+ });
86
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
87
+ }
88
+
89
+ /**
90
+ * @author zhixin wen <wenzhixin2010@gmail.com>
91
+ * extensions: https://github.com/vitalets/x-editable
92
+ */
93
+
94
+ (function ($) {
95
+ var Utils = $.fn.bootstrapTable.utils;
9
96
 
10
97
  $.extend($.fn.bootstrapTable.defaults, {
11
- editable: true,
12
- onEditableInit: function() {
13
- return false;
14
- },
15
- onEditableSave: function(field, row, oldValue, $el) {
16
- return false;
17
- },
18
- onEditableShown: function(field, row, $el, editable) {
19
- return false;
20
- },
21
- onEditableHidden: function(field, row, $el, reason) {
22
- return false;
23
- }
98
+ editable: true,
99
+ onEditableInit: function onEditableInit() {
100
+ return false;
101
+ },
102
+ onEditableSave: function onEditableSave(field, row, oldValue, $el) {
103
+ return false;
104
+ },
105
+ onEditableShown: function onEditableShown(field, row, $el, editable) {
106
+ return false;
107
+ },
108
+ onEditableHidden: function onEditableHidden(field, row, $el, reason) {
109
+ return false;
110
+ }
24
111
  });
25
112
 
26
113
  $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
27
- 'editable-init.bs.table': 'onEditableInit',
28
- 'editable-save.bs.table': 'onEditableSave',
29
- 'editable-shown.bs.table': 'onEditableShown',
30
- 'editable-hidden.bs.table': 'onEditableHidden'
114
+ 'editable-init.bs.table': 'onEditableInit',
115
+ 'editable-save.bs.table': 'onEditableSave',
116
+ 'editable-shown.bs.table': 'onEditableShown',
117
+ 'editable-hidden.bs.table': 'onEditableHidden'
31
118
  });
32
119
 
33
- var BootstrapTable = $.fn.bootstrapTable.Constructor,
34
- _initTable = BootstrapTable.prototype.initTable,
35
- _initBody = BootstrapTable.prototype.initBody;
120
+ $.BootstrapTable = function (_$$BootstrapTable) {
121
+ _inherits(_class, _$$BootstrapTable);
122
+
123
+ function _class() {
124
+ _classCallCheck(this, _class);
125
+
126
+ return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
127
+ }
36
128
 
37
- BootstrapTable.prototype.initTable = function() {
38
- var that = this;
39
- _initTable.apply(this, Array.prototype.slice.apply(arguments));
129
+ _createClass(_class, [{
130
+ key: 'initTable',
131
+ value: function initTable() {
132
+ var _this2 = this;
40
133
 
41
- if (!this.options.editable) {
134
+ _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'initTable', this).call(this);
135
+
136
+ if (!this.options.editable) {
42
137
  return;
43
- }
138
+ }
44
139
 
45
- $.each(this.columns, function(i, column) {
140
+ $.each(this.columns, function (i, column) {
46
141
  if (!column.editable) {
47
- return;
142
+ return;
48
143
  }
49
144
 
50
- var editableOptions = {},
51
- editableDataMarkup = [],
52
- editableDataPrefix = 'editable-';
53
-
54
- var processDataOptions = function(key, value) {
55
- // Replace camel case with dashes.
56
- var dashKey = key.replace(/([A-Z])/g, function($1) {
57
- return "-" + $1.toLowerCase();
58
- });
59
- if (dashKey.slice(0, editableDataPrefix.length) == editableDataPrefix) {
60
- var dataKey = dashKey.replace(editableDataPrefix, 'data-');
61
- editableOptions[dataKey] = value;
62
- }
145
+ var editableOptions = {};
146
+ var editableDataMarkup = [];
147
+ var editableDataPrefix = 'editable-';
148
+ var processDataOptions = function processDataOptions(key, value) {
149
+ // Replace camel case with dashes.
150
+ var dashKey = key.replace(/([A-Z])/g, function ($1) {
151
+ return '-' + $1.toLowerCase();
152
+ });
153
+ if (dashKey.indexOf(editableDataPrefix) === 0) {
154
+ editableOptions[dashKey.replace(editableDataPrefix, 'data-')] = value;
155
+ }
63
156
  };
64
157
 
65
- $.each(that.options, processDataOptions);
158
+ $.each(_this2.options, processDataOptions);
66
159
 
67
- column.formatter = column.formatter || function(value, row, index) {
68
- return value;
160
+ column.formatter = column.formatter || function (value) {
161
+ return value;
69
162
  };
70
163
  column._formatter = column._formatter ? column._formatter : column.formatter;
71
- column.formatter = function(value, row, index) {
72
- var result = column._formatter ? column._formatter(value, row, index) : value;
73
-
74
- $.each(column, processDataOptions);
75
-
76
- $.each(editableOptions, function(key, value) {
77
- editableDataMarkup.push(' ' + key + '="' + value + '"');
78
- });
79
-
80
- var _dont_edit_formatter = false;
81
- if (column.editable.hasOwnProperty('noeditFormatter')) {
82
- _dont_edit_formatter = column.editable.noeditFormatter(value, row, index);
83
- }
84
-
85
- if (_dont_edit_formatter === false) {
86
- return ['<a href="javascript:void(0)"',
87
- ' data-name="' + column.field + '"',
88
- ' data-pk="' + row[that.options.idField] + '"',
89
- ' data-value="' + result + '"',
90
- editableDataMarkup.join(''),
91
- '>' + '</a>'
92
- ].join('');
93
- } else {
94
- return _dont_edit_formatter;
95
- }
164
+ column.formatter = function (value, row, index) {
165
+ var result = Utils.calculateObjectValue(column, column._formatter, [value, row, index], value);
96
166
 
167
+ $.each(column, processDataOptions);
168
+
169
+ $.each(editableOptions, function (key, value) {
170
+ editableDataMarkup.push(' ' + key + '="' + value + '"');
171
+ });
172
+
173
+ var _dont_edit_formatter = false;
174
+ if (column.editable.hasOwnProperty('noeditFormatter')) {
175
+ _dont_edit_formatter = column.editable.noeditFormatter(value, row, index);
176
+ }
177
+
178
+ if (_dont_edit_formatter === false) {
179
+ return '<a href="javascript:void(0)"\n data-name="' + column.field + '"\n data-pk="' + row[_this2.options.idField] + '"\n data-value="' + result + '"\n ' + editableDataMarkup.join('') + '></a>';
180
+ }
181
+ return _dont_edit_formatter;
97
182
  };
98
- });
99
- };
183
+ });
184
+ }
185
+ }, {
186
+ key: 'initBody',
187
+ value: function initBody(fixedScroll) {
188
+ var _this3 = this;
100
189
 
101
- BootstrapTable.prototype.initBody = function() {
102
- var that = this;
103
- _initBody.apply(this, Array.prototype.slice.apply(arguments));
190
+ _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'initBody', this).call(this, fixedScroll);
104
191
 
105
- if (!this.options.editable) {
192
+ if (!this.options.editable) {
106
193
  return;
107
- }
194
+ }
108
195
 
109
- $.each(this.columns, function(i, column) {
196
+ $.each(this.columns, function (i, column) {
110
197
  if (!column.editable) {
111
- return;
198
+ return;
112
199
  }
113
200
 
114
- that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
115
- .off('save').on('save', function(e, params) {
116
- var data = that.getData(),
117
- index = $(this).parents('tr[data-index]').data('index'),
118
- row = data[index],
119
- oldValue = row[column.field];
120
-
121
- $(this).data('value', params.submitValue);
122
- row[column.field] = params.submitValue;
123
- that.trigger('editable-save', column.field, row, oldValue, $(this));
124
- that.resetFooter();
125
- });
126
- that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
127
- .off('shown').on('shown', function(e, editable) {
128
- var data = that.getData(),
129
- index = $(this).parents('tr[data-index]').data('index'),
130
- row = data[index];
131
-
132
- that.trigger('editable-shown', column.field, row, $(this), editable);
133
- });
134
- that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
135
- .off('hidden').on('hidden', function(e, reason) {
136
- var data = that.getData(),
137
- index = $(this).parents('tr[data-index]').data('index'),
138
- row = data[index];
139
-
140
- that.trigger('editable-hidden', column.field, row, $(this), reason);
141
- });
142
- });
143
- this.trigger('editable-init');
144
- };
201
+ var data = _this3.getData();
202
+ var $field = _this3.$body.find('a[data-name="' + column.field + '"]');
203
+
204
+ $field.each(function (i, element) {
205
+ var $element = $(element);
206
+ var $tr = $element.closest('tr');
207
+ var index = $tr.data('index');
208
+ var row = data[index];
209
+
210
+ var editableOpts = Utils.calculateObjectValue(column, column.editable, [index, row, $element], {});
211
+
212
+ $element.editable(editableOpts);
213
+ });
214
+
215
+ $field.off('save').on('save', function (_ref, _ref2) {
216
+ var currentTarget = _ref.currentTarget;
217
+ var submitValue = _ref2.submitValue;
218
+
219
+ var $this = $(currentTarget);
220
+ var data = _this3.getData();
221
+ var index = $this.parents('tr[data-index]').data('index');
222
+ var row = data[index];
223
+ var oldValue = row[column.field];
224
+
225
+ $this.data('value', submitValue);
226
+ row[column.field] = submitValue;
227
+ _this3.trigger('editable-save', column.field, row, oldValue, $this);
228
+ _this3.resetFooter();
229
+ });
230
+
231
+ $field.off('shown').on('shown', function (_ref3, editable) {
232
+ var currentTarget = _ref3.currentTarget;
233
+
234
+ var $this = $(currentTarget);
235
+ var data = _this3.getData();
236
+ var index = $this.parents('tr[data-index]').data('index');
237
+ var row = data[index];
238
+
239
+ _this3.trigger('editable-shown', column.field, row, $this, editable);
240
+ });
241
+
242
+ $field.off('hidden').on('hidden', function (_ref4, reason) {
243
+ var currentTarget = _ref4.currentTarget;
244
+
245
+ var $this = $(currentTarget);
246
+ var data = _this3.getData();
247
+ var index = $this.parents('tr[data-index]').data('index');
248
+ var row = data[index];
249
+
250
+ _this3.trigger('editable-hidden', column.field, row, $this, reason);
251
+ });
252
+ });
253
+ this.trigger('editable-init');
254
+ }
255
+ }]);
145
256
 
146
- })(jQuery);
257
+ return _class;
258
+ }($.BootstrapTable);
259
+ })(jQuery);
260
+ });