@oat-sa/tao-core-ui 1.58.1 → 1.58.2

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 (233) hide show
  1. package/dist/actionbar.js +386 -395
  2. package/dist/adder.js +21 -19
  3. package/dist/animable/absorbable/absorbable.js +204 -213
  4. package/dist/animable/absorbable/css/absorb.css +1 -0
  5. package/dist/animable/absorbable/css/absorb.css.map +1 -1
  6. package/dist/animable/pulsable/pulsable.js +168 -177
  7. package/dist/autocomplete/css/autocomplete.css +1 -0
  8. package/dist/autocomplete/css/autocomplete.css.map +1 -1
  9. package/dist/autocomplete.js +68 -66
  10. package/dist/badge/badge.js +188 -197
  11. package/dist/badge/css/badge.css +1 -0
  12. package/dist/badge/css/badge.css.map +1 -1
  13. package/dist/breadcrumbs.js +275 -284
  14. package/dist/btngrouper.js +5 -5
  15. package/dist/bulkActionPopup.js +490 -495
  16. package/dist/button.js +283 -291
  17. package/dist/cascadingComboBox.js +249 -258
  18. package/dist/ckeditor/ckConfigurator.js +26 -19
  19. package/dist/ckeditor/dtdHandler.js +11 -9
  20. package/dist/class/selector.js +441 -450
  21. package/dist/component/resizable.js +1 -1
  22. package/dist/component/windowed.js +285 -294
  23. package/dist/component.js +419 -428
  24. package/dist/contextualPopup.js +417 -426
  25. package/dist/dashboard.js +300 -309
  26. package/dist/datalist.js +753 -762
  27. package/dist/datatable/filterStrategy/multiple.js +1 -1
  28. package/dist/datatable/filterStrategy/single.js +1 -1
  29. package/dist/datatable.js +1527 -1550
  30. package/dist/dateRange/dateRange.js +393 -402
  31. package/dist/datetime/picker.js +665 -672
  32. package/dist/deleter.js +368 -377
  33. package/dist/destination/selector.js +286 -295
  34. package/dist/dialog/alert.js +3 -3
  35. package/dist/dialog/confirm.js +1 -1
  36. package/dist/dialog/confirmDelete.js +216 -225
  37. package/dist/dialog.js +650 -654
  38. package/dist/disabler.js +8 -8
  39. package/dist/documentViewer/providers/pdfViewer/fallback/viewer.js +166 -175
  40. package/dist/documentViewer/providers/pdfViewer/pdfjs/findBar.js +518 -527
  41. package/dist/documentViewer/providers/pdfViewer/pdfjs/pageView.js +380 -389
  42. package/dist/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +539 -548
  43. package/dist/documentViewer/providers/pdfViewer/pdfjs/viewer.js +369 -378
  44. package/dist/documentViewer/providers/pdfViewer.js +184 -193
  45. package/dist/documentViewer.js +292 -301
  46. package/dist/dropdown.js +383 -392
  47. package/dist/durationer.js +5 -5
  48. package/dist/dynamicComponent.js +597 -598
  49. package/dist/feedback.js +356 -362
  50. package/dist/figure/FigureStateActive.js +117 -108
  51. package/dist/filesender.js +2 -2
  52. package/dist/filter.js +230 -239
  53. package/dist/form/dropdownForm.js +355 -357
  54. package/dist/form/form.js +919 -690
  55. package/dist/form/simpleForm.js +1 -1
  56. package/dist/form/validator/renderer.js +233 -235
  57. package/dist/form/validator/validator.js +257 -189
  58. package/dist/form/widget/definitions.js +1 -1
  59. package/dist/form/widget/providers/checkBox.js +254 -259
  60. package/dist/form/widget/providers/comboBox.js +187 -192
  61. package/dist/form/widget/providers/default.js +8 -9
  62. package/dist/form/widget/providers/hidden.js +170 -179
  63. package/dist/form/widget/providers/hiddenBox.js +262 -267
  64. package/dist/form/widget/providers/radioBox.js +216 -225
  65. package/dist/form/widget/providers/textArea.js +187 -196
  66. package/dist/form/widget/providers/textBox.js +2 -3
  67. package/dist/form/widget/widget.js +473 -475
  68. package/dist/formValidator/formValidator.js +1 -1
  69. package/dist/formValidator/highlighters/message.js +1 -1
  70. package/dist/generis/form/form.js +314 -323
  71. package/dist/generis/validator/validator.js +209 -218
  72. package/dist/generis/widget/checkBox/checkBox.js +218 -227
  73. package/dist/generis/widget/comboBox/comboBox.js +179 -188
  74. package/dist/generis/widget/hiddenBox/hiddenBox.js +220 -229
  75. package/dist/generis/widget/textBox/textBox.js +169 -178
  76. package/dist/generis/widget/widget.js +246 -255
  77. package/dist/groupedComboBox.js +222 -231
  78. package/dist/groupvalidator.js +2 -2
  79. package/dist/highlighter.js +967 -958
  80. package/dist/image/ImgStateActive/helper.js +7 -5
  81. package/dist/image/ImgStateActive/initHelper.js +49 -43
  82. package/dist/image/ImgStateActive/initMediaEditor.js +24 -20
  83. package/dist/image/ImgStateActive/mediaSizer.js +14 -12
  84. package/dist/image/ImgStateActive.js +72 -70
  85. package/dist/incrementer.js +6 -6
  86. package/dist/inplacer.js +6 -6
  87. package/dist/itemButtonList/css/item-button-list.css +1 -0
  88. package/dist/itemButtonList/css/item-button-list.css.map +1 -1
  89. package/dist/itemButtonList.js +439 -435
  90. package/dist/keyNavigation/navigableDomElement.js +51 -38
  91. package/dist/keyNavigation/navigator.js +85 -70
  92. package/dist/listbox.js +460 -469
  93. package/dist/liststyler.js +8 -8
  94. package/dist/loadingButton/loadingButton.js +209 -218
  95. package/dist/lock.js +476 -485
  96. package/dist/login/login.js +475 -484
  97. package/dist/maths/calculator/basicCalculator.js +235 -244
  98. package/dist/maths/calculator/calculatorComponent.js +3 -3
  99. package/dist/maths/calculator/core/board.js +772 -781
  100. package/dist/maths/calculator/core/expression.js +476 -485
  101. package/dist/maths/calculator/core/labels.js +228 -237
  102. package/dist/maths/calculator/core/tokenizer.js +1 -1
  103. package/dist/maths/calculator/core/tokens.js +163 -170
  104. package/dist/maths/calculator/plugins/keyboard/templateKeyboard/templateKeyboard.js +244 -253
  105. package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +279 -288
  106. package/dist/maths/calculator/scientificCalculator.js +327 -336
  107. package/dist/mediaEditor/mediaEditorComponent.js +238 -245
  108. package/dist/mediaEditor/plugins/mediaAlignment/helper.js +7 -7
  109. package/dist/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js +229 -235
  110. package/dist/mediaEditor/plugins/mediaDimension/mediaDimensionComponent.js +580 -589
  111. package/dist/mediaplayer/players/html5.js +666 -675
  112. package/dist/mediaplayer/players/youtube.js +419 -424
  113. package/dist/mediaplayer/support.js +11 -10
  114. package/dist/mediaplayer/utils/reminder.js +14 -13
  115. package/dist/mediaplayer/utils/timeObserver.js +10 -11
  116. package/dist/mediaplayer/youtubeManager.js +164 -145
  117. package/dist/mediaplayer.js +1565 -1520
  118. package/dist/mediasizer.js +669 -678
  119. package/dist/modal.js +10 -17
  120. package/dist/pageSizeSelector.js +219 -228
  121. package/dist/pagination/providers/pages.js +280 -289
  122. package/dist/pagination/providers/simple.js +192 -201
  123. package/dist/previewer.js +30 -30
  124. package/dist/progressbar.js +4 -4
  125. package/dist/report.js +347 -356
  126. package/dist/resource/filters.js +271 -280
  127. package/dist/resource/list.js +1264 -1273
  128. package/dist/resource/selector.js +865 -874
  129. package/dist/resource/tree.js +1483 -1492
  130. package/dist/resourcemgr/fileBrowser.js +564 -569
  131. package/dist/resourcemgr/filePreview.js +16 -16
  132. package/dist/resourcemgr/fileSelector.js +515 -524
  133. package/dist/resourcemgr/util/updatePermissions.js +2 -2
  134. package/dist/resourcemgr.js +306 -315
  135. package/dist/searchModal/advancedSearch.js +796 -767
  136. package/dist/searchModal.js +114 -91
  137. package/dist/switch/switch.js +298 -307
  138. package/dist/tabs.js +598 -575
  139. package/dist/taskQueue/status.js +312 -321
  140. package/dist/taskQueue/table.js +375 -384
  141. package/dist/taskQueue/taskQueueModel.js +488 -472
  142. package/dist/taskQueueButton/taskable.js +264 -273
  143. package/dist/taskQueueButton/treeButton.js +189 -198
  144. package/dist/themeLoader.js +24 -23
  145. package/dist/themes.js +1 -1
  146. package/dist/toggler.js +3 -3
  147. package/dist/tooltip.js +295 -304
  148. package/dist/transformer.js +2 -2
  149. package/dist/tristateCheckboxGroup.js +311 -320
  150. package/dist/uploader.js +687 -696
  151. package/dist/validator/Report.js +1 -1
  152. package/dist/validator/Validator.js +3 -3
  153. package/dist/validator/validators.js +9 -9
  154. package/dist/validator.js +240 -230
  155. package/dist/waitForMedia.js +1 -1
  156. package/package.json +3 -3
  157. package/src/animable/absorbable/css/absorb.css +1 -0
  158. package/src/animable/absorbable/css/absorb.css.map +1 -1
  159. package/src/autocomplete/css/autocomplete.css +1 -0
  160. package/src/autocomplete/css/autocomplete.css.map +1 -1
  161. package/src/badge/css/badge.css +1 -0
  162. package/src/badge/css/badge.css.map +1 -1
  163. package/src/ckeditor/ckConfigurator.js +4 -0
  164. package/src/itemButtonList/css/item-button-list.css +1 -0
  165. package/src/itemButtonList/css/item-button-list.css.map +1 -1
  166. package/src/.DS_Store +0 -0
  167. package/src/css/basic.css +0 -7826
  168. package/src/css/basic.css.map +0 -1
  169. package/src/css/ckeditor/skins/tao/css/dialog.css +0 -950
  170. package/src/css/ckeditor/skins/tao/css/dialog.css.map +0 -1
  171. package/src/css/ckeditor/skins/tao/css/editor.css +0 -1850
  172. package/src/css/ckeditor/skins/tao/css/editor.css.map +0 -1
  173. package/src/scss/.DS_Store +0 -0
  174. package/src/scss/basic.scss +0 -16
  175. package/src/scss/ckeditor/skins/tao/scss/dialog.scss +0 -763
  176. package/src/scss/ckeditor/skins/tao/scss/editor.scss +0 -111
  177. package/src/scss/ckeditor/skins/tao/scss/inc/_ck-icons.scss +0 -59
  178. package/src/scss/ckeditor/skins/tao/scss/inc/_colorpanel.scss +0 -118
  179. package/src/scss/ckeditor/skins/tao/scss/inc/_elementspath.scss +0 -69
  180. package/src/scss/ckeditor/skins/tao/scss/inc/_mainui.scss +0 -194
  181. package/src/scss/ckeditor/skins/tao/scss/inc/_menu.scss +0 -181
  182. package/src/scss/ckeditor/skins/tao/scss/inc/_panel.scss +0 -200
  183. package/src/scss/ckeditor/skins/tao/scss/inc/_presets.scss +0 -32
  184. package/src/scss/ckeditor/skins/tao/scss/inc/_reset.scss +0 -101
  185. package/src/scss/ckeditor/skins/tao/scss/inc/_richcombo.scss +0 -213
  186. package/src/scss/ckeditor/skins/tao/scss/inc/_tao.scss +0 -59
  187. package/src/scss/ckeditor/skins/tao/scss/inc/_toolbar.scss +0 -301
  188. package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
  189. package/src/scss/font/source-sans-pro/source-sans-pro-italic.eot.b64 +0 -1
  190. package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
  191. package/src/scss/font/source-sans-pro/source-sans-pro-italic.woff.b64 +0 -1
  192. package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
  193. package/src/scss/font/source-sans-pro/source-sans-pro-regular.eot.b64 +0 -1
  194. package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
  195. package/src/scss/font/source-sans-pro/source-sans-pro-regular.woff.b64 +0 -1
  196. package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot +0 -0
  197. package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.eot.b64 +0 -1
  198. package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff +0 -0
  199. package/src/scss/font/source-sans-pro/source-sans-pro-semibold-italic.woff.b64 +0 -1
  200. package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
  201. package/src/scss/font/source-sans-pro/source-sans-pro-semibold.eot.b64 +0 -1
  202. package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
  203. package/src/scss/font/source-sans-pro/source-sans-pro-semibold.woff.b64 +0 -1
  204. package/src/scss/font/tao/tao.eot +0 -0
  205. package/src/scss/font/tao/tao.svg +0 -235
  206. package/src/scss/font/tao/tao.ttf +0 -0
  207. package/src/scss/font/tao/tao.woff +0 -0
  208. package/src/scss/inc/_base.scss +0 -496
  209. package/src/scss/inc/_bootstrap.scss +0 -6
  210. package/src/scss/inc/_buttons.scss +0 -114
  211. package/src/scss/inc/_colors.scss +0 -88
  212. package/src/scss/inc/_feedback.scss +0 -150
  213. package/src/scss/inc/_flex-grid.scss +0 -15
  214. package/src/scss/inc/_fonts.scss +0 -4
  215. package/src/scss/inc/_forms.scss +0 -827
  216. package/src/scss/inc/_functions.scss +0 -283
  217. package/src/scss/inc/_grid.scss +0 -66
  218. package/src/scss/inc/_jquery.nouislider.scss +0 -254
  219. package/src/scss/inc/_normalize.scss +0 -528
  220. package/src/scss/inc/_report.scss +0 -68
  221. package/src/scss/inc/_secondary-properties.scss +0 -89
  222. package/src/scss/inc/_select2.scss +0 -634
  223. package/src/scss/inc/_toolbars.scss +0 -155
  224. package/src/scss/inc/_tooltip.scss +0 -312
  225. package/src/scss/inc/_variables.scss +0 -21
  226. package/src/scss/inc/base/_highlight.scss +0 -5
  227. package/src/scss/inc/base/_list-style.scss +0 -59
  228. package/src/scss/inc/base/_svg.scss +0 -3
  229. package/src/scss/inc/base/_table.scss +0 -63
  230. package/src/scss/inc/fonts/_source-sans-pro.scss +0 -29
  231. package/src/scss/inc/fonts/_tao-icon-classes.scss +0 -226
  232. package/src/scss/inc/fonts/_tao-icon-def.scss +0 -12
  233. package/src/scss/inc/fonts/_tao-icon-vars.scss +0 -240
package/dist/datatable.js CHANGED
@@ -1,1788 +1,1765 @@
1
1
  define(['jquery', 'lodash', 'i18n', 'core/pluginifier', 'handlebars', 'lib/dompurify/purify', 'ui/datatable/filterStrategy/filterStrategy', 'ui/pagination', 'layout/loading-bar', 'core/logger', 'util/httpErrorParser', 'ui/pageSizeSelector', 'css!ui/datatable/css/datatable.css'], function ($$1, _, __, Pluginifier, Handlebars, DOMPurify, filterStrategyFactory, paginationComponent, loadingBar, loggerFactory, httpErrorParser, pageSizeSelector, datatable_css) { 'use strict';
2
2
 
3
- $$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
4
- _ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
5
- __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
6
- Pluginifier = Pluginifier && Object.prototype.hasOwnProperty.call(Pluginifier, 'default') ? Pluginifier['default'] : Pluginifier;
7
- Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
8
- DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
9
- filterStrategyFactory = filterStrategyFactory && Object.prototype.hasOwnProperty.call(filterStrategyFactory, 'default') ? filterStrategyFactory['default'] : filterStrategyFactory;
10
- paginationComponent = paginationComponent && Object.prototype.hasOwnProperty.call(paginationComponent, 'default') ? paginationComponent['default'] : paginationComponent;
11
- loadingBar = loadingBar && Object.prototype.hasOwnProperty.call(loadingBar, 'default') ? loadingBar['default'] : loadingBar;
12
- loggerFactory = loggerFactory && Object.prototype.hasOwnProperty.call(loggerFactory, 'default') ? loggerFactory['default'] : loggerFactory;
13
- httpErrorParser = httpErrorParser && Object.prototype.hasOwnProperty.call(httpErrorParser, 'default') ? httpErrorParser['default'] : httpErrorParser;
14
- pageSizeSelector = pageSizeSelector && Object.prototype.hasOwnProperty.call(pageSizeSelector, 'default') ? pageSizeSelector['default'] : pageSizeSelector;
15
-
3
+ $$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
4
+ _ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
5
+ __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
6
+ Pluginifier = Pluginifier && Object.prototype.hasOwnProperty.call(Pluginifier, 'default') ? Pluginifier['default'] : Pluginifier;
7
+ Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
8
+ DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
9
+ filterStrategyFactory = filterStrategyFactory && Object.prototype.hasOwnProperty.call(filterStrategyFactory, 'default') ? filterStrategyFactory['default'] : filterStrategyFactory;
10
+ paginationComponent = paginationComponent && Object.prototype.hasOwnProperty.call(paginationComponent, 'default') ? paginationComponent['default'] : paginationComponent;
11
+ loadingBar = loadingBar && Object.prototype.hasOwnProperty.call(loadingBar, 'default') ? loadingBar['default'] : loadingBar;
12
+ loggerFactory = loggerFactory && Object.prototype.hasOwnProperty.call(loggerFactory, 'default') ? loggerFactory['default'] : loggerFactory;
13
+ httpErrorParser = httpErrorParser && Object.prototype.hasOwnProperty.call(httpErrorParser, 'default') ? httpErrorParser['default'] : httpErrorParser;
14
+ pageSizeSelector = pageSizeSelector && Object.prototype.hasOwnProperty.call(pageSizeSelector, 'default') ? pageSizeSelector['default'] : pageSizeSelector;
15
+
16
+ function _typeof(obj) {
17
+ "@babel/helpers - typeof";
18
+
19
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
20
+ return typeof obj;
21
+ } : function (obj) {
22
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
23
+ }, _typeof(obj);
24
+ }
25
+
26
+ function Helpers0 (hb) {
27
+ //register a i18n helper
28
+ hb.registerHelper('__', function (key) {
29
+ return __(key);
30
+ });
16
31
  /**
17
- * This program is free software; you can redistribute it and/or
18
- * modify it under the terms of the GNU General Public License
19
- * as published by the Free Software Foundation; under version 2
20
- * of the License (non-upgradable).
21
- *
22
- * This program is distributed in the hope that it will be useful,
23
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
- * GNU General Public License for more details.
26
- *
27
- * You should have received a copy of the GNU General Public License
28
- * along with this program; if not, write to the Free Software
29
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30
- *
31
- * Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
32
- *
32
+ * Register dompurify helper
33
33
  *
34
+ * https://github.com/cure53/DOMPurify
35
+ * with config SAFE_FOR_TEMPLATES: true
36
+ * to make output safe for template systems
34
37
  */
35
- function Helpers0 (hb) {
36
- //register a i18n helper
37
- hb.registerHelper('__', function (key) {
38
- return __(key);
39
- });
40
- /**
41
- * Register dompurify helper
42
- *
43
- * https://github.com/cure53/DOMPurify
44
- * with config SAFE_FOR_TEMPLATES: true
45
- * to make output safe for template systems
46
- */
47
38
 
48
- hb.registerHelper('dompurify', function (context) {
49
- return DOMPurify.sanitize(context);
50
- });
51
- /**
52
- * Register join helper
53
- *
54
- * Example :
55
- * var values = {a:v1, b:v2, c:v3};
56
- * Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
57
- * Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
58
- */
59
-
60
- hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
61
- var fragments = [];
62
- keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
63
- fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
64
- wrapper = typeof wrapper === 'string' ? wrapper : '"';
39
+ hb.registerHelper('dompurify', function (context) {
40
+ return DOMPurify.sanitize(context);
41
+ });
42
+ /**
43
+ * Register join helper
44
+ *
45
+ * Example :
46
+ * var values = {a:v1, b:v2, c:v3};
47
+ * Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
48
+ * Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
49
+ */
65
50
 
66
- _.forIn(arr, function (value, key) {
67
- var fragment = '';
51
+ hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
52
+ var fragments = [];
53
+ keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
54
+ fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
55
+ wrapper = typeof wrapper === 'string' ? wrapper : '"';
68
56
 
69
- if (value !== null || value !== undefined) {
70
- if (typeof value === 'boolean') {
71
- value = value ? 'true' : 'false';
72
- } else if (typeof value === 'object') {
73
- value = _.values(value).join(' ');
74
- }
75
- } else {
76
- value = '';
77
- }
57
+ _.forIn(arr, function (value, key) {
58
+ var fragment = '';
78
59
 
79
- if (keyValueGlue !== undefined) {
80
- fragment += key + keyValueGlue;
60
+ if (value !== null || value !== undefined) {
61
+ if (typeof value === 'boolean') {
62
+ value = value ? 'true' : 'false';
63
+ } else if (_typeof(value) === 'object') {
64
+ value = _.values(value).join(' ');
81
65
  }
66
+ } else {
67
+ value = '';
68
+ }
82
69
 
83
- fragment += wrapper + value + wrapper;
84
- fragments.push(fragment);
85
- });
86
-
87
- return fragments.join(fragmentGlue);
88
- }); //register a classic "for loop" helper
89
- //it also adds a local variable "i" as the index in each iteration loop
90
-
91
- hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
92
- var ret = '';
93
- startIndex = parseInt(startIndex);
94
- stopIndex = parseInt(stopIndex);
95
- increment = parseInt(increment);
96
-
97
- for (var i = startIndex; i < stopIndex; i += increment) {
98
- ret += options.fn(_.extend({}, this, {
99
- i: i
100
- }));
70
+ if (keyValueGlue !== undefined) {
71
+ fragment += key + keyValueGlue;
101
72
  }
102
73
 
103
- return ret;
74
+ fragment += wrapper + value + wrapper;
75
+ fragments.push(fragment);
104
76
  });
105
- hb.registerHelper('equal', function (var1, var2, options) {
106
- if (var1 == var2) {
107
- return options.fn(this);
108
- } else {
109
- return options.inverse(this);
110
- }
111
- }); // register a "get property" helper
112
- // it gets the named property from the provided context
113
77
 
114
- hb.registerHelper('property', function (name, context) {
115
- return context[name] || '';
116
- }); // register an 'includes' helper
117
- // it checks if value is in array
78
+ return fragments.join(fragmentGlue);
79
+ }); //register a classic "for loop" helper
80
+ //it also adds a local variable "i" as the index in each iteration loop
118
81
 
119
- hb.registerHelper('includes', function (haystack, needle, options) {
120
- if (_.contains(haystack, needle)) {
121
- return options.fn(this);
122
- }
123
- });
124
- }
82
+ hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
83
+ var ret = '';
84
+ startIndex = parseInt(startIndex);
85
+ stopIndex = parseInt(stopIndex);
86
+ increment = parseInt(increment);
125
87
 
126
- if (!Helpers0.__initialized) {
127
- Helpers0(Handlebars);
128
- Helpers0.__initialized = true;
129
- }
130
- var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
131
- this.compilerInfo = [4,'>= 1.0.0'];
132
- helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
133
- var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing;
134
-
135
- function program1(depth0,data) {
136
-
137
- var buffer = "", stack1;
138
- buffer += "\n <aside class=\"filter\" data-column=\""
139
- + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.filter)),stack1 == null || stack1 === false ? stack1 : stack1.columns)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
140
- + "\">\n <input type=\"text\" value=\"\" name=\"filter\" placeholder=\""
141
- + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.filter)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
142
- + "\">\n <button class=\"icon-find\" type=\"button\"></button>\n </aside>\n ";
143
- return buffer;
88
+ for (var i = startIndex; i < stopIndex; i += increment) {
89
+ ret += options.fn(_.extend({}, this, {
90
+ i: i
91
+ }));
144
92
  }
145
93
 
146
- function program3(depth0,data,depth1) {
147
-
148
- var buffer = "", stack1, helper;
149
- buffer += "\n <h2>\n <span class=\"empty-list hidden\">";
150
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.empty), {hash:{},inverse:self.programWithDepth(6, program6, data, depth1),fn:self.program(4, program4, data),data:data});
151
- if(stack1 || stack1 === 0) { buffer += stack1; }
152
- buffer += "</span>\n <span class=\"available-list hidden\">\n <span class=\"text\">";
153
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.available), {hash:{},inverse:self.programWithDepth(10, program10, data, depth1),fn:self.program(8, program8, data),data:data});
154
- if(stack1 || stack1 === 0) { buffer += stack1; }
155
- buffer += "</span>:\n <span class=\"count\">";
156
- if (helper = helpers.count) { stack1 = helper.call(depth0, {hash:{},data:data}); }
157
- else { helper = (depth0 && depth0.count); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
158
- buffer += escapeExpression(stack1)
159
- + "</span>\n </span>\n <span class=\"loading\">";
160
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.loading), {hash:{},inverse:self.programWithDepth(14, program14, data, depth1),fn:self.program(12, program12, data),data:data});
161
- if(stack1 || stack1 === 0) { buffer += stack1; }
162
- buffer += "...</span>\n </h2>\n ";
163
- return buffer;
164
- }
165
- function program4(depth0,data) {
166
-
167
- var stack1, helper;
168
- if (helper = helpers.empty) { stack1 = helper.call(depth0, {hash:{},data:data}); }
169
- else { helper = (depth0 && depth0.empty); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
170
- return escapeExpression(stack1);
94
+ return ret;
95
+ });
96
+ hb.registerHelper('equal', function (var1, var2, options) {
97
+ if (var1 == var2) {
98
+ return options.fn(this);
99
+ } else {
100
+ return options.inverse(this);
171
101
  }
102
+ }); // register a "get property" helper
103
+ // it gets the named property from the provided context
172
104
 
173
- function program6(depth0,data,depth2) {
174
-
175
- var stack1;
176
- return escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth2 && depth2.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.empty)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
177
- }
105
+ hb.registerHelper('property', function (name, context) {
106
+ return context[name] || '';
107
+ }); // register an 'includes' helper
108
+ // it checks if value is in array
178
109
 
179
- function program8(depth0,data) {
180
-
181
- var stack1, helper;
182
- if (helper = helpers.available) { stack1 = helper.call(depth0, {hash:{},data:data}); }
183
- else { helper = (depth0 && depth0.available); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
184
- return escapeExpression(stack1);
110
+ hb.registerHelper('includes', function (haystack, needle, options) {
111
+ if (_.contains(haystack, needle)) {
112
+ return options.fn(this);
185
113
  }
114
+ });
115
+ }
116
+
117
+ if (!Helpers0.__initialized) {
118
+ Helpers0(Handlebars);
119
+ Helpers0.__initialized = true;
120
+ }
121
+ var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
122
+ this.compilerInfo = [4,'>= 1.0.0'];
123
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
124
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing;
125
+
126
+ function program1(depth0,data) {
127
+
128
+ var buffer = "", stack1;
129
+ buffer += "\n <aside class=\"filter\" data-column=\""
130
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.filter)),stack1 == null || stack1 === false ? stack1 : stack1.columns)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
131
+ + "\">\n <input type=\"text\" value=\"\" name=\"filter\" placeholder=\""
132
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.filter)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
133
+ + "\">\n <button class=\"icon-find\" type=\"button\"></button>\n </aside>\n ";
134
+ return buffer;
135
+ }
186
136
 
187
- function program10(depth0,data,depth2) {
188
-
189
- var stack1;
190
- return escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth2 && depth2.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.available)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
191
- }
137
+ function program3(depth0,data,depth1) {
138
+
139
+ var buffer = "", stack1, helper;
140
+ buffer += "\n <h2>\n <span class=\"empty-list hidden\">";
141
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.empty), {hash:{},inverse:self.programWithDepth(6, program6, data, depth1),fn:self.program(4, program4, data),data:data});
142
+ if(stack1 || stack1 === 0) { buffer += stack1; }
143
+ buffer += "</span>\n <span class=\"available-list hidden\">\n <span class=\"text\">";
144
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.available), {hash:{},inverse:self.programWithDepth(10, program10, data, depth1),fn:self.program(8, program8, data),data:data});
145
+ if(stack1 || stack1 === 0) { buffer += stack1; }
146
+ buffer += "</span>:\n <span class=\"count\">";
147
+ if (helper = helpers.count) { stack1 = helper.call(depth0, {hash:{},data:data}); }
148
+ else { helper = (depth0 && depth0.count); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
149
+ buffer += escapeExpression(stack1)
150
+ + "</span>\n </span>\n <span class=\"loading\">";
151
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.loading), {hash:{},inverse:self.programWithDepth(14, program14, data, depth1),fn:self.program(12, program12, data),data:data});
152
+ if(stack1 || stack1 === 0) { buffer += stack1; }
153
+ buffer += "...</span>\n </h2>\n ";
154
+ return buffer;
155
+ }
156
+ function program4(depth0,data) {
157
+
158
+ var stack1, helper;
159
+ if (helper = helpers.empty) { stack1 = helper.call(depth0, {hash:{},data:data}); }
160
+ else { helper = (depth0 && depth0.empty); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
161
+ return escapeExpression(stack1);
162
+ }
192
163
 
193
- function program12(depth0,data) {
194
-
195
- var stack1, helper;
196
- if (helper = helpers.loading) { stack1 = helper.call(depth0, {hash:{},data:data}); }
197
- else { helper = (depth0 && depth0.loading); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
198
- return escapeExpression(stack1);
199
- }
164
+ function program6(depth0,data,depth2) {
165
+
166
+ var stack1;
167
+ return escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth2 && depth2.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.empty)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
168
+ }
200
169
 
201
- function program14(depth0,data,depth2) {
202
-
203
- var stack1;
204
- return escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth2 && depth2.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.loading)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
205
- }
170
+ function program8(depth0,data) {
171
+
172
+ var stack1, helper;
173
+ if (helper = helpers.available) { stack1 = helper.call(depth0, {hash:{},data:data}); }
174
+ else { helper = (depth0 && depth0.available); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
175
+ return escapeExpression(stack1);
176
+ }
206
177
 
207
- function program16(depth0,data) {
208
-
209
-
210
- return "\n <div class=\"toolbox-container\"></div>\n ";
211
- }
178
+ function program10(depth0,data,depth2) {
179
+
180
+ var stack1;
181
+ return escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth2 && depth2.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.available)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
182
+ }
212
183
 
213
- function program18(depth0,data) {
214
-
215
- var buffer = "", stack1;
216
- buffer += "\n <aside class=\"action-bar clearfix\">\n ";
217
- stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.tools), {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
218
- if(stack1 || stack1 === 0) { buffer += stack1; }
219
- buffer += "\n </aside>\n ";
220
- return buffer;
221
- }
222
- function program19(depth0,data) {
223
-
224
- var buffer = "", stack1;
225
- buffer += "\n <button class=\"btn-info small tool-";
226
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.program(22, program22, data),fn:self.program(20, program20, data),data:data});
227
- if(stack1 || stack1 === 0) { buffer += stack1; }
228
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.massAction), {hash:{},inverse:self.noop,fn:self.program(24, program24, data),data:data});
229
- if(stack1 || stack1 === 0) { buffer += stack1; }
230
- buffer += "\"\n ";
231
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.title), {hash:{},inverse:self.noop,fn:self.program(26, program26, data),data:data});
232
- if(stack1 || stack1 === 0) { buffer += stack1; }
233
- buffer += ">\n <span class=\"icon-";
234
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.icon), {hash:{},inverse:self.program(30, program30, data),fn:self.program(28, program28, data),data:data});
235
- if(stack1 || stack1 === 0) { buffer += stack1; }
236
- buffer += "\"></span>\n ";
237
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.label), {hash:{},inverse:self.program(35, program35, data),fn:self.program(33, program33, data),data:data});
238
- if(stack1 || stack1 === 0) { buffer += stack1; }
239
- buffer += "\n </button>\n ";
240
- return buffer;
241
- }
242
- function program20(depth0,data) {
243
-
244
- var stack1, helper;
245
- if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
246
- else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
247
- return escapeExpression(stack1);
248
- }
184
+ function program12(depth0,data) {
185
+
186
+ var stack1, helper;
187
+ if (helper = helpers.loading) { stack1 = helper.call(depth0, {hash:{},data:data}); }
188
+ else { helper = (depth0 && depth0.loading); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
189
+ return escapeExpression(stack1);
190
+ }
249
191
 
250
- function program22(depth0,data) {
251
-
252
- var stack1;
253
- return escapeExpression(((stack1 = (data == null || data === false ? data : data.index)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
254
- }
192
+ function program14(depth0,data,depth2) {
193
+
194
+ var stack1;
195
+ return escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth2 && depth2.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.loading)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
196
+ }
255
197
 
256
- function program24(depth0,data) {
257
-
258
-
259
- return " invisible";
260
- }
198
+ function program16(depth0,data) {
199
+
200
+
201
+ return "\n <div class=\"toolbox-container\"></div>\n ";
202
+ }
261
203
 
262
- function program26(depth0,data) {
263
-
264
- var buffer = "", stack1, helper;
265
- buffer += " title=\"";
266
- if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }
267
- else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
268
- buffer += escapeExpression(stack1)
269
- + "\"";
270
- return buffer;
271
- }
204
+ function program18(depth0,data) {
205
+
206
+ var buffer = "", stack1;
207
+ buffer += "\n <aside class=\"action-bar clearfix\">\n ";
208
+ stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.tools), {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data});
209
+ if(stack1 || stack1 === 0) { buffer += stack1; }
210
+ buffer += "\n </aside>\n ";
211
+ return buffer;
212
+ }
213
+ function program19(depth0,data) {
214
+
215
+ var buffer = "", stack1;
216
+ buffer += "\n <button class=\"btn-info small tool-";
217
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.program(22, program22, data),fn:self.program(20, program20, data),data:data});
218
+ if(stack1 || stack1 === 0) { buffer += stack1; }
219
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.massAction), {hash:{},inverse:self.noop,fn:self.program(24, program24, data),data:data});
220
+ if(stack1 || stack1 === 0) { buffer += stack1; }
221
+ buffer += "\"\n ";
222
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.title), {hash:{},inverse:self.noop,fn:self.program(26, program26, data),data:data});
223
+ if(stack1 || stack1 === 0) { buffer += stack1; }
224
+ buffer += ">\n <span class=\"icon-";
225
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.icon), {hash:{},inverse:self.program(30, program30, data),fn:self.program(28, program28, data),data:data});
226
+ if(stack1 || stack1 === 0) { buffer += stack1; }
227
+ buffer += "\"></span>\n ";
228
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.label), {hash:{},inverse:self.program(35, program35, data),fn:self.program(33, program33, data),data:data});
229
+ if(stack1 || stack1 === 0) { buffer += stack1; }
230
+ buffer += "\n </button>\n ";
231
+ return buffer;
232
+ }
233
+ function program20(depth0,data) {
234
+
235
+ var stack1, helper;
236
+ if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
237
+ else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
238
+ return escapeExpression(stack1);
239
+ }
272
240
 
273
- function program28(depth0,data) {
274
-
275
- var stack1, helper;
276
- if (helper = helpers.icon) { stack1 = helper.call(depth0, {hash:{},data:data}); }
277
- else { helper = (depth0 && depth0.icon); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
278
- return escapeExpression(stack1);
279
- }
241
+ function program22(depth0,data) {
242
+
243
+ var stack1;
244
+ return escapeExpression(((stack1 = (data == null || data === false ? data : data.index)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
245
+ }
280
246
 
281
- function program30(depth0,data) {
282
-
283
- var stack1;
284
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.program(31, program31, data),fn:self.program(20, program20, data),data:data});
285
- if(stack1 || stack1 === 0) { return stack1; }
286
- else { return ''; }
287
- }
288
- function program31(depth0,data) {
289
-
290
- var stack1;
291
- return escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
292
- }
247
+ function program24(depth0,data) {
248
+
249
+
250
+ return " invisible";
251
+ }
293
252
 
294
- function program33(depth0,data) {
295
-
296
- var stack1, helper;
297
- if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
298
- else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
299
- return escapeExpression(stack1);
300
- }
253
+ function program26(depth0,data) {
254
+
255
+ var buffer = "", stack1, helper;
256
+ buffer += " title=\"";
257
+ if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }
258
+ else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
259
+ buffer += escapeExpression(stack1)
260
+ + "\"";
261
+ return buffer;
262
+ }
301
263
 
302
- function program35(depth0,data) {
303
-
304
- var stack1;
305
- stack1 = helpers.unless.call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.noop,fn:self.program(31, program31, data),data:data});
306
- if(stack1 || stack1 === 0) { return stack1; }
307
- else { return ''; }
308
- }
264
+ function program28(depth0,data) {
265
+
266
+ var stack1, helper;
267
+ if (helper = helpers.icon) { stack1 = helper.call(depth0, {hash:{},data:data}); }
268
+ else { helper = (depth0 && depth0.icon); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
269
+ return escapeExpression(stack1);
270
+ }
309
271
 
310
- function program37(depth0,data) {
311
-
312
-
313
- return "\n <col/>\n ";
314
- }
272
+ function program30(depth0,data) {
273
+
274
+ var stack1;
275
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.program(31, program31, data),fn:self.program(20, program20, data),data:data});
276
+ if(stack1 || stack1 === 0) { return stack1; }
277
+ else { return ''; }
278
+ }
279
+ function program31(depth0,data) {
280
+
281
+ var stack1;
282
+ return escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
283
+ }
315
284
 
316
- function program39(depth0,data) {
317
-
318
-
319
- return "\n </col>\n ";
320
- }
285
+ function program33(depth0,data) {
286
+
287
+ var stack1, helper;
288
+ if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
289
+ else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
290
+ return escapeExpression(stack1);
291
+ }
321
292
 
322
- function program41(depth0,data) {
323
-
324
-
325
- return "\n <th class=\"checkboxes\"><input type=\"checkbox\" name=\"checkall\" value=\"1\" /></th>\n ";
326
- }
293
+ function program35(depth0,data) {
294
+
295
+ var stack1;
296
+ stack1 = helpers.unless.call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.noop,fn:self.program(31, program31, data),data:data});
297
+ if(stack1 || stack1 === 0) { return stack1; }
298
+ else { return ''; }
299
+ }
327
300
 
328
- function program43(depth0,data) {
329
-
330
- var buffer = "", stack1, helper;
331
- buffer += "\n <th";
332
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.type), {hash:{},inverse:self.noop,fn:self.program(44, program44, data),data:data});
333
- if(stack1 || stack1 === 0) { buffer += stack1; }
334
- buffer += ">\n <div\n ";
335
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.sortable), {hash:{},inverse:self.noop,fn:self.program(46, program46, data),data:data});
336
- if(stack1 || stack1 === 0) { buffer += stack1; }
337
- buffer += ">";
338
- if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
339
- else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
340
- buffer += escapeExpression(stack1)
341
- + "</div>\n ";
342
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.filterable), {hash:{},inverse:self.noop,fn:self.program(49, program49, data),data:data});
343
- if(stack1 || stack1 === 0) { buffer += stack1; }
344
- buffer += "\n </th>\n ";
345
- return buffer;
346
- }
347
- function program44(depth0,data) {
348
-
349
-
350
- return " class=\"actions\"";
351
- }
301
+ function program37(depth0,data) {
302
+
303
+
304
+ return "\n <col/>\n ";
305
+ }
352
306
 
353
- function program46(depth0,data) {
354
-
355
- var buffer = "", stack1, helper;
356
- buffer += "\n class=\"sortable\"\n data-sort-by=\"";
357
- if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
358
- else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
359
- buffer += escapeExpression(stack1)
360
- + "\"\n ";
361
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.sorttype), {hash:{},inverse:self.noop,fn:self.program(47, program47, data),data:data});
362
- if(stack1 || stack1 === 0) { buffer += stack1; }
363
- buffer += "\n tabindex=\"0\"\n ";
364
- return buffer;
365
- }
366
- function program47(depth0,data) {
367
-
368
- var buffer = "", stack1, helper;
369
- buffer += "data-sort-type=\"";
370
- if (helper = helpers.sorttype) { stack1 = helper.call(depth0, {hash:{},data:data}); }
371
- else { helper = (depth0 && depth0.sorttype); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
372
- buffer += escapeExpression(stack1)
373
- + "\"";
374
- return buffer;
375
- }
307
+ function program39(depth0,data) {
308
+
309
+
310
+ return "\n </col>\n ";
311
+ }
376
312
 
377
- function program49(depth0,data) {
378
-
379
- var buffer = "", stack1, helper;
380
- buffer += "\n <aside data-column=\"";
381
- if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
382
- else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
383
- buffer += escapeExpression(stack1)
384
- + "\" class=\"filter column\n ";
385
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.customFilter), {hash:{},inverse:self.program(52, program52, data),fn:self.program(50, program50, data),data:data});
386
- if(stack1 || stack1 === 0) { buffer += stack1; }
387
- buffer += "\n </aside>\n ";
388
- return buffer;
389
- }
390
- function program50(depth0,data) {
391
-
392
- var buffer = "", stack1;
393
- buffer += " customInput\" >\n ";
394
- stack1 = ((stack1 = ((stack1 = (depth0 && depth0.customFilter)),stack1 == null || stack1 === false ? stack1 : stack1.template)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1);
395
- if(stack1 || stack1 === 0) { buffer += stack1; }
396
- buffer += "\n ";
397
- return buffer;
398
- }
313
+ function program41(depth0,data) {
314
+
315
+
316
+ return "\n <th class=\"checkboxes\"><input type=\"checkbox\" name=\"checkall\" value=\"1\" /></th>\n ";
317
+ }
399
318
 
400
- function program52(depth0,data) {
401
-
402
- var buffer = "", stack1, helper;
403
- buffer += " \">\n <input type=\"text\" value=\"\" name=\"filter[";
404
- if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
405
- else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
406
- buffer += escapeExpression(stack1)
407
- + "]\" placeholder=\""
408
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.filterable)),stack1 == null || stack1 === false ? stack1 : stack1.placeholder)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
409
- + "\">\n <button class=\"icon-find\" type=\"button\"></button>\n ";
410
- return buffer;
411
- }
319
+ function program43(depth0,data) {
320
+
321
+ var buffer = "", stack1, helper;
322
+ buffer += "\n <th";
323
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.type), {hash:{},inverse:self.noop,fn:self.program(44, program44, data),data:data});
324
+ if(stack1 || stack1 === 0) { buffer += stack1; }
325
+ buffer += ">\n <div\n ";
326
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.sortable), {hash:{},inverse:self.noop,fn:self.program(46, program46, data),data:data});
327
+ if(stack1 || stack1 === 0) { buffer += stack1; }
328
+ buffer += ">";
329
+ if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
330
+ else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
331
+ buffer += escapeExpression(stack1)
332
+ + "</div>\n ";
333
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.filterable), {hash:{},inverse:self.noop,fn:self.program(49, program49, data),data:data});
334
+ if(stack1 || stack1 === 0) { buffer += stack1; }
335
+ buffer += "\n </th>\n ";
336
+ return buffer;
337
+ }
338
+ function program44(depth0,data) {
339
+
340
+
341
+ return " class=\"actions\"";
342
+ }
412
343
 
413
- function program54(depth0,data) {
414
-
415
- var buffer = "", stack1;
416
- buffer += "\n <th class=\"actions\">"
417
- + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.actions)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
418
- + "</th>\n ";
419
- return buffer;
420
- }
344
+ function program46(depth0,data) {
345
+
346
+ var buffer = "", stack1, helper;
347
+ buffer += "\n class=\"sortable\"\n data-sort-by=\"";
348
+ if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
349
+ else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
350
+ buffer += escapeExpression(stack1)
351
+ + "\"\n ";
352
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.sorttype), {hash:{},inverse:self.noop,fn:self.program(47, program47, data),data:data});
353
+ if(stack1 || stack1 === 0) { buffer += stack1; }
354
+ buffer += "\n tabindex=\"0\"\n ";
355
+ return buffer;
356
+ }
357
+ function program47(depth0,data) {
358
+
359
+ var buffer = "", stack1, helper;
360
+ buffer += "data-sort-type=\"";
361
+ if (helper = helpers.sorttype) { stack1 = helper.call(depth0, {hash:{},data:data}); }
362
+ else { helper = (depth0 && depth0.sorttype); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
363
+ buffer += escapeExpression(stack1)
364
+ + "\"";
365
+ return buffer;
366
+ }
421
367
 
422
- function program56(depth0,data,depth1) {
423
-
424
- var buffer = "", stack1, helper;
425
- buffer += "\n <tr data-item-identifier=\"";
426
- if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
427
- else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
428
- buffer += escapeExpression(stack1)
429
- + "\">\n ";
430
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth1 && depth1.options)),stack1 == null || stack1 === false ? stack1 : stack1.selectable), {hash:{},inverse:self.noop,fn:self.program(57, program57, data),data:data});
431
- if(stack1 || stack1 === 0) { buffer += stack1; }
432
- buffer += "\n\n ";
433
- stack1 = helpers.each.call(depth0, ((stack1 = (depth1 && depth1.options)),stack1 == null || stack1 === false ? stack1 : stack1.model), {hash:{},inverse:self.noop,fn:self.programWithDepth(59, program59, data, depth0),data:data});
434
- if(stack1 || stack1 === 0) { buffer += stack1; }
435
- buffer += "\n\n ";
436
- stack1 = helpers['with'].call(depth0, ((stack1 = (depth1 && depth1.options)),stack1 == null || stack1 === false ? stack1 : stack1.actions), {hash:{},inverse:self.noop,fn:self.programWithDepth(76, program76, data, depth0),data:data});
437
- if(stack1 || stack1 === 0) { buffer += stack1; }
438
- buffer += "\n </tr>\n ";
439
- return buffer;
440
- }
441
- function program57(depth0,data) {
442
-
443
- var buffer = "", stack1, helper;
444
- buffer += "\n <td class=\"checkboxes\"><input type=\"checkbox\" name=\"cb[";
445
- if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
446
- else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
447
- buffer += escapeExpression(stack1)
448
- + "]\" value=\"1\" /></td>\n ";
449
- return buffer;
450
- }
368
+ function program49(depth0,data) {
369
+
370
+ var buffer = "", stack1, helper;
371
+ buffer += "\n <aside data-column=\"";
372
+ if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
373
+ else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
374
+ buffer += escapeExpression(stack1)
375
+ + "\" class=\"filter column\n ";
376
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.customFilter), {hash:{},inverse:self.program(52, program52, data),fn:self.program(50, program50, data),data:data});
377
+ if(stack1 || stack1 === 0) { buffer += stack1; }
378
+ buffer += "\n </aside>\n ";
379
+ return buffer;
380
+ }
381
+ function program50(depth0,data) {
382
+
383
+ var buffer = "", stack1;
384
+ buffer += " customInput\" >\n ";
385
+ stack1 = ((stack1 = ((stack1 = (depth0 && depth0.customFilter)),stack1 == null || stack1 === false ? stack1 : stack1.template)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1);
386
+ if(stack1 || stack1 === 0) { buffer += stack1; }
387
+ buffer += "\n ";
388
+ return buffer;
389
+ }
451
390
 
452
- function program59(depth0,data,depth1) {
453
-
454
- var buffer = "", stack1;
455
- buffer += "\n ";
456
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.type), {hash:{},inverse:self.programWithDepth(74, program74, data, depth1),fn:self.programWithDepth(60, program60, data, depth0, depth1),data:data});
457
- if(stack1 || stack1 === 0) { buffer += stack1; }
458
- buffer += "\n\n ";
459
- return buffer;
460
- }
461
- function program60(depth0,data,depth1,depth2) {
462
-
463
- var buffer = "", stack1, helper;
464
- buffer += "\n <td class=\"actions ";
465
- if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
466
- else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
467
- buffer += escapeExpression(stack1)
468
- + "\">\n ";
469
- stack1 = helpers.each.call(depth0, (depth1 && depth1.actions), {hash:{},inverse:self.noop,fn:self.programWithDepth(61, program61, data, depth2),data:data});
470
- if(stack1 || stack1 === 0) { buffer += stack1; }
471
- buffer += "\n </td>\n ";
472
- return buffer;
473
- }
474
- function program61(depth0,data,depth3) {
475
-
476
- var buffer = "", stack1;
477
- buffer += "\n ";
478
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.program(71, program71, data),fn:self.programWithDepth(62, program62, data, depth3),data:data});
479
- if(stack1 || stack1 === 0) { buffer += stack1; }
480
- buffer += "\n\n ";
481
- return buffer;
482
- }
483
- function program62(depth0,data,depth4) {
484
-
485
- var buffer = "", stack1;
486
- buffer += "\n ";
487
- stack1 = helpers['with'].call(depth0, depth4, {hash:{},inverse:self.noop,fn:self.programWithDepth(63, program63, data, depth0),data:data});
488
- if(stack1 || stack1 === 0) { buffer += stack1; }
489
- buffer += "\n ";
490
- return buffer;
491
- }
492
- function program63(depth0,data,depth1) {
493
-
494
- var buffer = "", stack1;
495
- buffer += "\n ";
496
- stack1 = helpers.unless.call(depth0, (depth1 && depth1.hidden), {hash:{},inverse:self.noop,fn:self.programWithDepth(64, program64, data, depth1),data:data});
497
- if(stack1 || stack1 === 0) { buffer += stack1; }
498
- buffer += "\n ";
499
- return buffer;
500
- }
501
- function program64(depth0,data,depth2) {
502
-
503
- var buffer = "", stack1;
504
- buffer += "\n <button class=\"btn-info small "
505
- + escapeExpression(((stack1 = (depth2 && depth2.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
506
- + "\"\n ";
507
- stack1 = helpers['if'].call(depth0, (depth2 && depth2.title), {hash:{},inverse:self.noop,fn:self.programWithDepth(65, program65, data, depth2),data:data});
508
- if(stack1 || stack1 === 0) { buffer += stack1; }
509
- buffer += "\n ";
510
- stack1 = helpers['if'].call(depth0, (depth2 && depth2.disabled), {hash:{},inverse:self.noop,fn:self.program(67, program67, data),data:data});
511
- if(stack1 || stack1 === 0) { buffer += stack1; }
512
- buffer += ">\n ";
513
- stack1 = helpers['if'].call(depth0, (depth2 && depth2.icon), {hash:{},inverse:self.noop,fn:self.programWithDepth(69, program69, data, depth2),data:data});
514
- if(stack1 || stack1 === 0) { buffer += stack1; }
515
- buffer += "\n "
516
- + escapeExpression(((stack1 = (depth2 && depth2.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
517
- + "\n </button>\n ";
518
- return buffer;
519
- }
520
- function program65(depth0,data,depth3) {
521
-
522
- var buffer = "", stack1;
523
- buffer += " title=\""
524
- + escapeExpression(((stack1 = (depth3 && depth3.title)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
525
- + "\"";
526
- return buffer;
527
- }
391
+ function program52(depth0,data) {
392
+
393
+ var buffer = "", stack1, helper;
394
+ buffer += " \">\n <input type=\"text\" value=\"\" name=\"filter[";
395
+ if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
396
+ else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
397
+ buffer += escapeExpression(stack1)
398
+ + "]\" placeholder=\""
399
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.filterable)),stack1 == null || stack1 === false ? stack1 : stack1.placeholder)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
400
+ + "\">\n <button class=\"icon-find\" type=\"button\"></button>\n ";
401
+ return buffer;
402
+ }
528
403
 
529
- function program67(depth0,data) {
530
-
531
-
532
- return " disabled=\"disabled\"";
533
- }
404
+ function program54(depth0,data) {
405
+
406
+ var buffer = "", stack1;
407
+ buffer += "\n <th class=\"actions\">"
408
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.labels)),stack1 == null || stack1 === false ? stack1 : stack1.actions)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
409
+ + "</th>\n ";
410
+ return buffer;
411
+ }
534
412
 
535
- function program69(depth0,data,depth3) {
536
-
537
- var buffer = "", stack1;
538
- buffer += "<span class=\"icon-"
539
- + escapeExpression(((stack1 = (depth3 && depth3.icon)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
540
- + "\"></span>";
541
- return buffer;
542
- }
413
+ function program56(depth0,data,depth1) {
414
+
415
+ var buffer = "", stack1, helper;
416
+ buffer += "\n <tr data-item-identifier=\"";
417
+ if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
418
+ else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
419
+ buffer += escapeExpression(stack1)
420
+ + "\">\n ";
421
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth1 && depth1.options)),stack1 == null || stack1 === false ? stack1 : stack1.selectable), {hash:{},inverse:self.noop,fn:self.program(57, program57, data),data:data});
422
+ if(stack1 || stack1 === 0) { buffer += stack1; }
423
+ buffer += "\n\n ";
424
+ stack1 = helpers.each.call(depth0, ((stack1 = (depth1 && depth1.options)),stack1 == null || stack1 === false ? stack1 : stack1.model), {hash:{},inverse:self.noop,fn:self.programWithDepth(59, program59, data, depth0),data:data});
425
+ if(stack1 || stack1 === 0) { buffer += stack1; }
426
+ buffer += "\n\n ";
427
+ stack1 = helpers['with'].call(depth0, ((stack1 = (depth1 && depth1.options)),stack1 == null || stack1 === false ? stack1 : stack1.actions), {hash:{},inverse:self.noop,fn:self.programWithDepth(76, program76, data, depth0),data:data});
428
+ if(stack1 || stack1 === 0) { buffer += stack1; }
429
+ buffer += "\n </tr>\n ";
430
+ return buffer;
431
+ }
432
+ function program57(depth0,data) {
433
+
434
+ var buffer = "", stack1, helper;
435
+ buffer += "\n <td class=\"checkboxes\"><input type=\"checkbox\" name=\"cb[";
436
+ if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
437
+ else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
438
+ buffer += escapeExpression(stack1)
439
+ + "]\" value=\"1\" /></td>\n ";
440
+ return buffer;
441
+ }
543
442
 
544
- function program71(depth0,data) {
545
-
546
- var buffer = "", stack1, helper;
547
- buffer += "\n <button class=\"btn-info small "
548
- + escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
549
- + "\"\n ";
550
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.title), {hash:{},inverse:self.noop,fn:self.program(26, program26, data),data:data});
551
- if(stack1 || stack1 === 0) { buffer += stack1; }
552
- buffer += ">\n ";
553
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.icon), {hash:{},inverse:self.noop,fn:self.program(72, program72, data),data:data});
554
- if(stack1 || stack1 === 0) { buffer += stack1; }
555
- buffer += "\n ";
556
- if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
557
- else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
558
- buffer += escapeExpression(stack1)
559
- + "\n </button>\n ";
560
- return buffer;
561
- }
562
- function program72(depth0,data) {
563
-
564
- var buffer = "", stack1, helper;
565
- buffer += "<span class=\"icon-";
566
- if (helper = helpers.icon) { stack1 = helper.call(depth0, {hash:{},data:data}); }
567
- else { helper = (depth0 && depth0.icon); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
568
- buffer += escapeExpression(stack1)
569
- + "\"></span> ";
570
- return buffer;
571
- }
443
+ function program59(depth0,data,depth1) {
444
+
445
+ var buffer = "", stack1;
446
+ buffer += "\n ";
447
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.type), {hash:{},inverse:self.programWithDepth(74, program74, data, depth1),fn:self.programWithDepth(60, program60, data, depth0, depth1),data:data});
448
+ if(stack1 || stack1 === 0) { buffer += stack1; }
449
+ buffer += "\n\n ";
450
+ return buffer;
451
+ }
452
+ function program60(depth0,data,depth1,depth2) {
453
+
454
+ var buffer = "", stack1, helper;
455
+ buffer += "\n <td class=\"actions ";
456
+ if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
457
+ else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
458
+ buffer += escapeExpression(stack1)
459
+ + "\">\n ";
460
+ stack1 = helpers.each.call(depth0, (depth1 && depth1.actions), {hash:{},inverse:self.noop,fn:self.programWithDepth(61, program61, data, depth2),data:data});
461
+ if(stack1 || stack1 === 0) { buffer += stack1; }
462
+ buffer += "\n </td>\n ";
463
+ return buffer;
464
+ }
465
+ function program61(depth0,data,depth3) {
466
+
467
+ var buffer = "", stack1;
468
+ buffer += "\n ";
469
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.program(71, program71, data),fn:self.programWithDepth(62, program62, data, depth3),data:data});
470
+ if(stack1 || stack1 === 0) { buffer += stack1; }
471
+ buffer += "\n\n ";
472
+ return buffer;
473
+ }
474
+ function program62(depth0,data,depth4) {
475
+
476
+ var buffer = "", stack1;
477
+ buffer += "\n ";
478
+ stack1 = helpers['with'].call(depth0, depth4, {hash:{},inverse:self.noop,fn:self.programWithDepth(63, program63, data, depth0),data:data});
479
+ if(stack1 || stack1 === 0) { buffer += stack1; }
480
+ buffer += "\n ";
481
+ return buffer;
482
+ }
483
+ function program63(depth0,data,depth1) {
484
+
485
+ var buffer = "", stack1;
486
+ buffer += "\n ";
487
+ stack1 = helpers.unless.call(depth0, (depth1 && depth1.hidden), {hash:{},inverse:self.noop,fn:self.programWithDepth(64, program64, data, depth1),data:data});
488
+ if(stack1 || stack1 === 0) { buffer += stack1; }
489
+ buffer += "\n ";
490
+ return buffer;
491
+ }
492
+ function program64(depth0,data,depth2) {
493
+
494
+ var buffer = "", stack1;
495
+ buffer += "\n <button class=\"btn-info small "
496
+ + escapeExpression(((stack1 = (depth2 && depth2.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
497
+ + "\"\n ";
498
+ stack1 = helpers['if'].call(depth0, (depth2 && depth2.title), {hash:{},inverse:self.noop,fn:self.programWithDepth(65, program65, data, depth2),data:data});
499
+ if(stack1 || stack1 === 0) { buffer += stack1; }
500
+ buffer += "\n ";
501
+ stack1 = helpers['if'].call(depth0, (depth2 && depth2.disabled), {hash:{},inverse:self.noop,fn:self.program(67, program67, data),data:data});
502
+ if(stack1 || stack1 === 0) { buffer += stack1; }
503
+ buffer += ">\n ";
504
+ stack1 = helpers['if'].call(depth0, (depth2 && depth2.icon), {hash:{},inverse:self.noop,fn:self.programWithDepth(69, program69, data, depth2),data:data});
505
+ if(stack1 || stack1 === 0) { buffer += stack1; }
506
+ buffer += "\n "
507
+ + escapeExpression(((stack1 = (depth2 && depth2.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
508
+ + "\n </button>\n ";
509
+ return buffer;
510
+ }
511
+ function program65(depth0,data,depth3) {
512
+
513
+ var buffer = "", stack1;
514
+ buffer += " title=\""
515
+ + escapeExpression(((stack1 = (depth3 && depth3.title)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
516
+ + "\"";
517
+ return buffer;
518
+ }
572
519
 
573
- function program74(depth0,data,depth2) {
574
-
575
- var buffer = "", stack1, helper, options;
576
- buffer += "\n <td class=\"";
577
- if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
578
- else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
579
- buffer += escapeExpression(stack1)
580
- + "\">";
581
- stack1 = (helper = helpers.property || (depth0 && depth0.property),options={hash:{},data:data},helper ? helper.call(depth0, (depth0 && depth0.id), depth2, options) : helperMissing.call(depth0, "property", (depth0 && depth0.id), depth2, options));
582
- stack1 = (helper = helpers.dompurify || (depth0 && depth0.dompurify),options={hash:{},data:data},helper ? helper.call(depth0, stack1, options) : helperMissing.call(depth0, "dompurify", stack1, options));
583
- if(stack1 || stack1 === 0) { buffer += stack1; }
584
- buffer += "</td>\n ";
585
- return buffer;
586
- }
520
+ function program67(depth0,data) {
521
+
522
+
523
+ return " disabled=\"disabled\"";
524
+ }
587
525
 
588
- function program76(depth0,data,depth1) {
589
-
590
- var buffer = "", stack1;
591
- buffer += "\n <td class=\"actions\">\n ";
592
- stack1 = helpers.each.call(depth0, depth0, {hash:{},inverse:self.noop,fn:self.programWithDepth(77, program77, data, depth1),data:data});
593
- if(stack1 || stack1 === 0) { buffer += stack1; }
594
- buffer += "\n </td>\n ";
595
- return buffer;
596
- }
597
- function program77(depth0,data,depth2) {
598
-
599
- var buffer = "", stack1;
600
- buffer += "\n ";
601
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.program(82, program82, data),fn:self.programWithDepth(78, program78, data, depth2),data:data});
602
- if(stack1 || stack1 === 0) { buffer += stack1; }
603
- buffer += "\n ";
604
- return buffer;
605
- }
606
- function program78(depth0,data,depth3) {
607
-
608
- var buffer = "", stack1;
609
- buffer += "\n ";
610
- stack1 = helpers['with'].call(depth0, depth3, {hash:{},inverse:self.noop,fn:self.programWithDepth(79, program79, data, depth0),data:data});
611
- if(stack1 || stack1 === 0) { buffer += stack1; }
612
- buffer += "\n ";
613
- return buffer;
614
- }
615
- function program79(depth0,data,depth1) {
616
-
617
- var buffer = "", stack1;
618
- buffer += "\n ";
619
- stack1 = helpers.unless.call(depth0, (depth1 && depth1.hidden), {hash:{},inverse:self.noop,fn:self.programWithDepth(80, program80, data, depth1),data:data});
620
- if(stack1 || stack1 === 0) { buffer += stack1; }
621
- buffer += "\n ";
622
- return buffer;
623
- }
624
- function program80(depth0,data,depth2) {
625
-
626
- var buffer = "", stack1;
627
- buffer += "\n <button class=\"btn-info small "
628
- + escapeExpression(((stack1 = (depth2 && depth2.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
629
- + "\"\n ";
630
- stack1 = helpers['if'].call(depth0, (depth2 && depth2.title), {hash:{},inverse:self.noop,fn:self.programWithDepth(65, program65, data, depth2),data:data});
631
- if(stack1 || stack1 === 0) { buffer += stack1; }
632
- buffer += "\n ";
633
- stack1 = helpers['if'].call(depth0, (depth2 && depth2.disabled), {hash:{},inverse:self.noop,fn:self.program(67, program67, data),data:data});
634
- if(stack1 || stack1 === 0) { buffer += stack1; }
635
- buffer += ">\n ";
636
- stack1 = helpers['if'].call(depth0, (depth2 && depth2.icon), {hash:{},inverse:self.noop,fn:self.programWithDepth(69, program69, data, depth2),data:data});
637
- if(stack1 || stack1 === 0) { buffer += stack1; }
638
- buffer += "\n "
639
- + escapeExpression(((stack1 = (depth2 && depth2.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
640
- + "\n </button>\n ";
641
- return buffer;
642
- }
526
+ function program69(depth0,data,depth3) {
527
+
528
+ var buffer = "", stack1;
529
+ buffer += "<span class=\"icon-"
530
+ + escapeExpression(((stack1 = (depth3 && depth3.icon)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
531
+ + "\"></span>";
532
+ return buffer;
533
+ }
643
534
 
644
- function program82(depth0,data) {
645
-
646
- var buffer = "", stack1;
647
- buffer += "\n <button class=\"btn-info small "
648
- + escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
649
- + "\"><span class=\"icon-"
650
- + escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
651
- + "\"></span> "
652
- + escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
653
- + "</button>\n ";
654
- return buffer;
655
- }
535
+ function program71(depth0,data) {
536
+
537
+ var buffer = "", stack1, helper;
538
+ buffer += "\n <button class=\"btn-info small "
539
+ + escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
540
+ + "\"\n ";
541
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.title), {hash:{},inverse:self.noop,fn:self.program(26, program26, data),data:data});
542
+ if(stack1 || stack1 === 0) { buffer += stack1; }
543
+ buffer += ">\n ";
544
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.icon), {hash:{},inverse:self.noop,fn:self.program(72, program72, data),data:data});
545
+ if(stack1 || stack1 === 0) { buffer += stack1; }
546
+ buffer += "\n ";
547
+ if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
548
+ else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
549
+ buffer += escapeExpression(stack1)
550
+ + "\n </button>\n ";
551
+ return buffer;
552
+ }
553
+ function program72(depth0,data) {
554
+
555
+ var buffer = "", stack1, helper;
556
+ buffer += "<span class=\"icon-";
557
+ if (helper = helpers.icon) { stack1 = helper.call(depth0, {hash:{},data:data}); }
558
+ else { helper = (depth0 && depth0.icon); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
559
+ buffer += escapeExpression(stack1)
560
+ + "\"></span> ";
561
+ return buffer;
562
+ }
656
563
 
657
- function program84(depth0,data) {
658
-
659
- var buffer = "", stack1;
660
- buffer += "\n ";
661
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.emptyText), {hash:{},inverse:self.noop,fn:self.program(85, program85, data),data:data});
662
- if(stack1 || stack1 === 0) { buffer += stack1; }
663
- buffer += "\n ";
664
- return buffer;
665
- }
666
- function program85(depth0,data) {
667
-
668
- var buffer = "", stack1;
669
- buffer += "\n <div class=\"empty\">\n "
670
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.emptyText)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
671
- + "\n </div>\n ";
672
- return buffer;
673
- }
564
+ function program74(depth0,data,depth2) {
565
+
566
+ var buffer = "", stack1, helper, options;
567
+ buffer += "\n <td class=\"";
568
+ if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
569
+ else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
570
+ buffer += escapeExpression(stack1)
571
+ + "\">";
572
+ stack1 = (helper = helpers.property || (depth0 && depth0.property),options={hash:{},data:data},helper ? helper.call(depth0, (depth0 && depth0.id), depth2, options) : helperMissing.call(depth0, "property", (depth0 && depth0.id), depth2, options));
573
+ stack1 = (helper = helpers.dompurify || (depth0 && depth0.dompurify),options={hash:{},data:data},helper ? helper.call(depth0, stack1, options) : helperMissing.call(depth0, "dompurify", stack1, options));
574
+ if(stack1 || stack1 === 0) { buffer += stack1; }
575
+ buffer += "</td>\n ";
576
+ return buffer;
577
+ }
674
578
 
675
- buffer += "<div class=\"datatable-wrapper\">\n\n ";
676
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.filter), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
677
- if(stack1 || stack1 === 0) { buffer += stack1; }
678
- buffer += "\n\n <div class=\"datatable-header\">\n ";
679
- stack1 = helpers['with'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.status), {hash:{},inverse:self.noop,fn:self.programWithDepth(3, program3, data, depth0),data:data});
680
- if(stack1 || stack1 === 0) { buffer += stack1; }
681
- buffer += "\n\n ";
682
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.pageSizeSelector), {hash:{},inverse:self.noop,fn:self.program(16, program16, data),data:data});
683
- if(stack1 || stack1 === 0) { buffer += stack1; }
684
- buffer += "\n </div>\n\n ";
685
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.tools), {hash:{},inverse:self.noop,fn:self.program(18, program18, data),data:data});
686
- if(stack1 || stack1 === 0) { buffer += stack1; }
687
- buffer += "\n\n <div class=\"datatable-pagination-top\"></div>\n\n <div class=\"datatable-container\">\n <table class=\"matrix datatable\">\n <colgroup>\n ";
688
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.selectable), {hash:{},inverse:self.noop,fn:self.program(37, program37, data),data:data});
689
- if(stack1 || stack1 === 0) { buffer += stack1; }
690
- buffer += "\n ";
691
- stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.model), {hash:{},inverse:self.noop,fn:self.program(37, program37, data),data:data});
692
- if(stack1 || stack1 === 0) { buffer += stack1; }
693
- buffer += "\n ";
694
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.actions), {hash:{},inverse:self.noop,fn:self.program(39, program39, data),data:data});
695
- if(stack1 || stack1 === 0) { buffer += stack1; }
696
- buffer += "\n </colgroup>\n <thead>\n <tr>\n ";
697
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.selectable), {hash:{},inverse:self.noop,fn:self.program(41, program41, data),data:data});
698
- if(stack1 || stack1 === 0) { buffer += stack1; }
699
- buffer += "\n ";
700
- stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.model), {hash:{},inverse:self.noop,fn:self.program(43, program43, data),data:data});
701
- if(stack1 || stack1 === 0) { buffer += stack1; }
702
- buffer += "\n ";
703
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.actions), {hash:{},inverse:self.noop,fn:self.program(54, program54, data),data:data});
704
- if(stack1 || stack1 === 0) { buffer += stack1; }
705
- buffer += "\n </tr>\n </thead>\n <tbody>\n ";
706
- stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.dataset)),stack1 == null || stack1 === false ? stack1 : stack1.data), {hash:{},inverse:self.noop,fn:self.programWithDepth(56, program56, data, depth0),data:data});
707
- if(stack1 || stack1 === 0) { buffer += stack1; }
708
- buffer += "\n </tbody>\n </table>\n ";
709
- stack1 = helpers.unless.call(depth0, ((stack1 = (depth0 && depth0.dataset)),stack1 == null || stack1 === false ? stack1 : stack1.data), {hash:{},inverse:self.noop,fn:self.program(84, program84, data),data:data});
710
- if(stack1 || stack1 === 0) { buffer += stack1; }
711
- buffer += "\n </div>\n <div class=\"datatable-pagination-bottom\"></div>\n</div>\n";
712
- return buffer;
713
- });
714
- function layout(data, options, asString) {
715
- var html = Template(data, options);
716
- return (asString || true) ? html : $(html);
579
+ function program76(depth0,data,depth1) {
580
+
581
+ var buffer = "", stack1;
582
+ buffer += "\n <td class=\"actions\">\n ";
583
+ stack1 = helpers.each.call(depth0, depth0, {hash:{},inverse:self.noop,fn:self.programWithDepth(77, program77, data, depth1),data:data});
584
+ if(stack1 || stack1 === 0) { buffer += stack1; }
585
+ buffer += "\n </td>\n ";
586
+ return buffer;
587
+ }
588
+ function program77(depth0,data,depth2) {
589
+
590
+ var buffer = "", stack1;
591
+ buffer += "\n ";
592
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.id), {hash:{},inverse:self.program(82, program82, data),fn:self.programWithDepth(78, program78, data, depth2),data:data});
593
+ if(stack1 || stack1 === 0) { buffer += stack1; }
594
+ buffer += "\n ";
595
+ return buffer;
596
+ }
597
+ function program78(depth0,data,depth3) {
598
+
599
+ var buffer = "", stack1;
600
+ buffer += "\n ";
601
+ stack1 = helpers['with'].call(depth0, depth3, {hash:{},inverse:self.noop,fn:self.programWithDepth(79, program79, data, depth0),data:data});
602
+ if(stack1 || stack1 === 0) { buffer += stack1; }
603
+ buffer += "\n ";
604
+ return buffer;
605
+ }
606
+ function program79(depth0,data,depth1) {
607
+
608
+ var buffer = "", stack1;
609
+ buffer += "\n ";
610
+ stack1 = helpers.unless.call(depth0, (depth1 && depth1.hidden), {hash:{},inverse:self.noop,fn:self.programWithDepth(80, program80, data, depth1),data:data});
611
+ if(stack1 || stack1 === 0) { buffer += stack1; }
612
+ buffer += "\n ";
613
+ return buffer;
614
+ }
615
+ function program80(depth0,data,depth2) {
616
+
617
+ var buffer = "", stack1;
618
+ buffer += "\n <button class=\"btn-info small "
619
+ + escapeExpression(((stack1 = (depth2 && depth2.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
620
+ + "\"\n ";
621
+ stack1 = helpers['if'].call(depth0, (depth2 && depth2.title), {hash:{},inverse:self.noop,fn:self.programWithDepth(65, program65, data, depth2),data:data});
622
+ if(stack1 || stack1 === 0) { buffer += stack1; }
623
+ buffer += "\n ";
624
+ stack1 = helpers['if'].call(depth0, (depth2 && depth2.disabled), {hash:{},inverse:self.noop,fn:self.program(67, program67, data),data:data});
625
+ if(stack1 || stack1 === 0) { buffer += stack1; }
626
+ buffer += ">\n ";
627
+ stack1 = helpers['if'].call(depth0, (depth2 && depth2.icon), {hash:{},inverse:self.noop,fn:self.programWithDepth(69, program69, data, depth2),data:data});
628
+ if(stack1 || stack1 === 0) { buffer += stack1; }
629
+ buffer += "\n "
630
+ + escapeExpression(((stack1 = (depth2 && depth2.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
631
+ + "\n </button>\n ";
632
+ return buffer;
717
633
  }
718
634
 
719
- if (!Helpers0.__initialized) {
720
- Helpers0(Handlebars);
721
- Helpers0.__initialized = true;
635
+ function program82(depth0,data) {
636
+
637
+ var buffer = "", stack1;
638
+ buffer += "\n <button class=\"btn-info small "
639
+ + escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
640
+ + "\"><span class=\"icon-"
641
+ + escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
642
+ + "\"></span> "
643
+ + escapeExpression(((stack1 = (data == null || data === false ? data : data.key)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
644
+ + "</button>\n ";
645
+ return buffer;
722
646
  }
723
- var Template$1 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
724
- this.compilerInfo = [4,'>= 1.0.0'];
725
- helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
726
- var buffer = "", stack1, helper, functionType="function", escapeExpression=this.escapeExpression, self=this;
727
-
728
- function program1(depth0,data) {
729
-
730
- var buffer = "", stack1, helper;
731
- buffer += " title=\"";
732
- if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }
733
- else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
734
- buffer += escapeExpression(stack1)
735
- + "\"";
736
- return buffer;
737
- }
738
647
 
739
- function program3(depth0,data) {
740
-
741
-
742
- return " disabled=\"disabled\"";
743
- }
648
+ function program84(depth0,data) {
649
+
650
+ var buffer = "", stack1;
651
+ buffer += "\n ";
652
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.emptyText), {hash:{},inverse:self.noop,fn:self.program(85, program85, data),data:data});
653
+ if(stack1 || stack1 === 0) { buffer += stack1; }
654
+ buffer += "\n ";
655
+ return buffer;
656
+ }
657
+ function program85(depth0,data) {
658
+
659
+ var buffer = "", stack1;
660
+ buffer += "\n <div class=\"empty\">\n "
661
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.emptyText)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
662
+ + "\n </div>\n ";
663
+ return buffer;
664
+ }
744
665
 
745
- function program5(depth0,data) {
746
-
747
- var buffer = "", stack1, helper;
748
- buffer += "<span class=\"icon-";
749
- if (helper = helpers.icon) { stack1 = helper.call(depth0, {hash:{},data:data}); }
750
- else { helper = (depth0 && depth0.icon); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
751
- buffer += escapeExpression(stack1)
752
- + "\"></span>";
753
- return buffer;
754
- }
666
+ buffer += "<div class=\"datatable-wrapper\">\n\n ";
667
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.filter), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
668
+ if(stack1 || stack1 === 0) { buffer += stack1; }
669
+ buffer += "\n\n <div class=\"datatable-header\">\n ";
670
+ stack1 = helpers['with'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.status), {hash:{},inverse:self.noop,fn:self.programWithDepth(3, program3, data, depth0),data:data});
671
+ if(stack1 || stack1 === 0) { buffer += stack1; }
672
+ buffer += "\n\n ";
673
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.pageSizeSelector), {hash:{},inverse:self.noop,fn:self.program(16, program16, data),data:data});
674
+ if(stack1 || stack1 === 0) { buffer += stack1; }
675
+ buffer += "\n </div>\n\n ";
676
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.tools), {hash:{},inverse:self.noop,fn:self.program(18, program18, data),data:data});
677
+ if(stack1 || stack1 === 0) { buffer += stack1; }
678
+ buffer += "\n\n <div class=\"datatable-pagination-top\"></div>\n\n <div class=\"datatable-container\">\n <table class=\"matrix datatable\">\n <colgroup>\n ";
679
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.selectable), {hash:{},inverse:self.noop,fn:self.program(37, program37, data),data:data});
680
+ if(stack1 || stack1 === 0) { buffer += stack1; }
681
+ buffer += "\n ";
682
+ stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.model), {hash:{},inverse:self.noop,fn:self.program(37, program37, data),data:data});
683
+ if(stack1 || stack1 === 0) { buffer += stack1; }
684
+ buffer += "\n ";
685
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.actions), {hash:{},inverse:self.noop,fn:self.program(39, program39, data),data:data});
686
+ if(stack1 || stack1 === 0) { buffer += stack1; }
687
+ buffer += "\n </colgroup>\n <thead>\n <tr>\n ";
688
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.selectable), {hash:{},inverse:self.noop,fn:self.program(41, program41, data),data:data});
689
+ if(stack1 || stack1 === 0) { buffer += stack1; }
690
+ buffer += "\n ";
691
+ stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.model), {hash:{},inverse:self.noop,fn:self.program(43, program43, data),data:data});
692
+ if(stack1 || stack1 === 0) { buffer += stack1; }
693
+ buffer += "\n ";
694
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.actions), {hash:{},inverse:self.noop,fn:self.program(54, program54, data),data:data});
695
+ if(stack1 || stack1 === 0) { buffer += stack1; }
696
+ buffer += "\n </tr>\n </thead>\n <tbody>\n ";
697
+ stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.dataset)),stack1 == null || stack1 === false ? stack1 : stack1.data), {hash:{},inverse:self.noop,fn:self.programWithDepth(56, program56, data, depth0),data:data});
698
+ if(stack1 || stack1 === 0) { buffer += stack1; }
699
+ buffer += "\n </tbody>\n </table>\n ";
700
+ stack1 = helpers.unless.call(depth0, ((stack1 = (depth0 && depth0.dataset)),stack1 == null || stack1 === false ? stack1 : stack1.data), {hash:{},inverse:self.noop,fn:self.program(84, program84, data),data:data});
701
+ if(stack1 || stack1 === 0) { buffer += stack1; }
702
+ buffer += "\n </div>\n <div class=\"datatable-pagination-bottom\"></div>\n</div>\n";
703
+ return buffer;
704
+ });
705
+ function layout(data, options, asString) {
706
+ var html = Template(data, options);
707
+ return (asString || true) ? html : $(html);
708
+ }
709
+
710
+ if (!Helpers0.__initialized) {
711
+ Helpers0(Handlebars);
712
+ Helpers0.__initialized = true;
713
+ }
714
+ var Template$1 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
715
+ this.compilerInfo = [4,'>= 1.0.0'];
716
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
717
+ var buffer = "", stack1, helper, functionType="function", escapeExpression=this.escapeExpression, self=this;
718
+
719
+ function program1(depth0,data) {
720
+
721
+ var buffer = "", stack1, helper;
722
+ buffer += " title=\"";
723
+ if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }
724
+ else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
725
+ buffer += escapeExpression(stack1)
726
+ + "\"";
727
+ return buffer;
728
+ }
755
729
 
756
- function program7(depth0,data) {
757
-
758
- var stack1, helper;
759
- if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
760
- else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
761
- return escapeExpression(stack1);
762
- }
730
+ function program3(depth0,data) {
731
+
732
+
733
+ return " disabled=\"disabled\"";
734
+ }
735
+
736
+ function program5(depth0,data) {
737
+
738
+ var buffer = "", stack1, helper;
739
+ buffer += "<span class=\"icon-";
740
+ if (helper = helpers.icon) { stack1 = helper.call(depth0, {hash:{},data:data}); }
741
+ else { helper = (depth0 && depth0.icon); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
742
+ buffer += escapeExpression(stack1)
743
+ + "\"></span>";
744
+ return buffer;
745
+ }
763
746
 
764
- buffer += "<button class=\"btn-info small ";
765
- if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
766
- else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
767
- buffer += escapeExpression(stack1)
768
- + "\"\n ";
769
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.title), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
770
- if(stack1 || stack1 === 0) { buffer += stack1; }
771
- buffer += "\n ";
772
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.disabled), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
773
- if(stack1 || stack1 === 0) { buffer += stack1; }
774
- buffer += ">\n ";
775
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.icon), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
776
- if(stack1 || stack1 === 0) { buffer += stack1; }
777
- buffer += "\n ";
778
- stack1 = helpers['if'].call(depth0, (depth0 && depth0.label), {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});
779
- if(stack1 || stack1 === 0) { buffer += stack1; }
780
- buffer += "\n</button>\n";
781
- return buffer;
747
+ function program7(depth0,data) {
748
+
749
+ var stack1, helper;
750
+ if (helper = helpers.label) { stack1 = helper.call(depth0, {hash:{},data:data}); }
751
+ else { helper = (depth0 && depth0.label); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
752
+ return escapeExpression(stack1);
753
+ }
754
+
755
+ buffer += "<button class=\"btn-info small ";
756
+ if (helper = helpers.id) { stack1 = helper.call(depth0, {hash:{},data:data}); }
757
+ else { helper = (depth0 && depth0.id); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
758
+ buffer += escapeExpression(stack1)
759
+ + "\"\n ";
760
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.title), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
761
+ if(stack1 || stack1 === 0) { buffer += stack1; }
762
+ buffer += "\n ";
763
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.disabled), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
764
+ if(stack1 || stack1 === 0) { buffer += stack1; }
765
+ buffer += ">\n ";
766
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.icon), {hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data});
767
+ if(stack1 || stack1 === 0) { buffer += stack1; }
768
+ buffer += "\n ";
769
+ stack1 = helpers['if'].call(depth0, (depth0 && depth0.label), {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data});
770
+ if(stack1 || stack1 === 0) { buffer += stack1; }
771
+ buffer += "\n</button>\n";
772
+ return buffer;
773
+ });
774
+ function buttonTpl(data, options, asString) {
775
+ var html = Template$1(data, options);
776
+ return (asString || true) ? html : $(html);
777
+ }
778
+
779
+ var ns = 'datatable';
780
+ var dataNs = 'ui.' + ns;
781
+ var defaults = {
782
+ atomicUpdate: false,
783
+ start: 0,
784
+ rows: 25,
785
+ page: 1,
786
+ sortby: 'id',
787
+ sortorder: 'asc',
788
+ sorttype: 'string',
789
+ paginationStrategyTop: 'none',
790
+ paginationStrategyBottom: 'simple',
791
+ labels: {
792
+ filter: __('Filter'),
793
+ empty: __('Nothing to list!'),
794
+ available: __('Available'),
795
+ loading: __('Loading'),
796
+ actions: __('Actions')
797
+ },
798
+ pageSizeSelector: false
799
+ };
800
+ var logger = loggerFactory('ui/datatable');
801
+ /**
802
+ * The CSS class used to hide an element
803
+ * @type {String}
804
+ */
805
+
806
+ var hiddenCls = 'hidden';
807
+ /**
808
+ * Deactivate pagination's
809
+ * @param {Array} pagination
810
+ */
811
+
812
+ var disablePagination = function disablePagination(pagination) {
813
+ if (pagination && pagination.length) {
814
+ pagination.forEach(function (step) {
815
+ step.disable();
782
816
  });
783
- function buttonTpl(data, options, asString) {
784
- var html = Template$1(data, options);
785
- return (asString || true) ? html : $(html);
786
817
  }
818
+ };
819
+ /**
820
+ * Activate pagination's
821
+ * @param {Array} pagination
822
+ */
787
823
 
788
- /**
789
- * This program is free software; you can redistribute it and/or
790
- * modify it under the terms of the GNU General Public License
791
- * as published by the Free Software Foundation; under version 2
792
- * of the License (non-upgradable).
793
- *
794
- * This program is distributed in the hope that it will be useful,
795
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
796
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
797
- * GNU General Public License for more details.
798
- *
799
- * You should have received a copy of the GNU General Public License
800
- * along with this program; if not, write to the Free Software
801
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
802
- *
803
- * Copyright (c) 2015-2020 (original work) Open Assessment Technologies SA;
804
- */
805
- const ns = 'datatable';
806
- const dataNs = 'ui.' + ns;
807
- const defaults = {
808
- atomicUpdate: false,
809
- start: 0,
810
- rows: 25,
811
- page: 1,
812
- sortby: 'id',
813
- sortorder: 'asc',
814
- sorttype: 'string',
815
- paginationStrategyTop: 'none',
816
- paginationStrategyBottom: 'simple',
817
- labels: {
818
- filter: __('Filter'),
819
- empty: __('Nothing to list!'),
820
- available: __('Available'),
821
- loading: __('Loading'),
822
- actions: __('Actions')
823
- },
824
- pageSizeSelector: false
825
- };
826
- const logger = loggerFactory('ui/datatable');
827
- /**
828
- * The CSS class used to hide an element
829
- * @type {String}
830
- */
831
824
 
832
- const hiddenCls = 'hidden';
833
- /**
834
- * Deactivate pagination's
835
- * @param {Array} pagination
836
- */
825
+ var enablePagination = function enablePagination(pagination) {
826
+ if (pagination && pagination.length) {
827
+ pagination.forEach(function (step) {
828
+ step.enable();
829
+ });
830
+ }
831
+ };
832
+ /**
833
+ * Helper for reading actions value in context
834
+ *
835
+ * @param {String} property
836
+ * @param {Object} action
837
+ * @param {Object} context
838
+ */
839
+
840
+
841
+ var getPropertyValue = function getPropertyValue(property, action, context) {
842
+ var value = action[property];
843
+ return _.isFunction(value) ? value.apply(context) : value;
844
+ };
845
+ /**
846
+ * Update the data table status in the header
847
+ *
848
+ * @param {Object} options
849
+ * @param {jQueryElement} $container
850
+ * @param {Object} dataset
851
+ */
852
+
853
+
854
+ var updateHeaderStatus = function updateHeaderStatus(options, $container, dataset) {
855
+ if (!options.status) {
856
+ return;
857
+ }
837
858
 
838
- const disablePagination = pagination => {
839
- if (pagination && pagination.length) {
840
- pagination.forEach(step => {
841
- step.disable();
842
- });
843
- }
844
- };
845
- /**
846
- * Activate pagination's
847
- * @param {Array} pagination
848
- */
859
+ var $statusEmpty = $container.find('.empty-list');
860
+ var $statusAvailable = $container.find('.available-list');
861
+ var $statusCount = $statusAvailable.find('.count');
862
+ $container.find('.loading').addClass(hiddenCls); // when the status is enabled, the response must contain the total amount of records
849
863
 
864
+ var amount = dataset.amount || dataset.length;
850
865
 
851
- const enablePagination = pagination => {
852
- if (pagination && pagination.length) {
853
- pagination.forEach(step => {
854
- step.enable();
855
- });
856
- }
857
- };
866
+ if (amount) {
867
+ $statusCount.text(amount);
868
+ $statusAvailable.removeClass(hiddenCls);
869
+ $statusEmpty.addClass(hiddenCls);
870
+ } else {
871
+ $statusEmpty.removeClass(hiddenCls);
872
+ $statusAvailable.addClass(hiddenCls);
873
+ }
874
+ };
875
+ /**
876
+ * The dataTable component makes you able to browse items and bind specific
877
+ * actions to undertake for edition and removal of them.
878
+ *
879
+ * Parameters that will be send to backend by component:
880
+ *
881
+ * Pagination
882
+ * @param {Number} rows - count of rows, that should be returned from backend, in other words limit.
883
+ * @param {Number} page - number of page, that should be requested.
884
+ *
885
+ * Sorting
886
+ * @param {String} sortby - name of column
887
+ * @param {String} sortorder - order of sorting, can be 'asc' or 'desc' for ascending sorting and descending sorting respectively.
888
+ * @param {String} sorttype - type of sorting, can be 'string' or 'numeric' for proper sorting numeric and string values.
889
+ *
890
+ * Filtering
891
+ * @param {String} filterstrategy - filtering strategy. Default is single (see ui/datatable/filterStrategy/single.js).
892
+ * @param {String} filterquery - query string for filtering of rows.
893
+ * @param {String[]} filtercolumns[] - array of columns, in which will be implemented search during filtering process.
894
+ * For column filter it will be only one item with column name, but component has ability define list of columns for default filter (in top toolbar).
895
+ * Backend should correctly receive this list of columns and do search in accordance with this parameters.
896
+ * By default, columns are not defined, so this parameter not will be sent. If filtercolumns[] not exists, backend should search by all columns.
897
+ *
898
+ * @example of query (GET): rows=25&page=1&sortby=login&sortorder=asc&filterquery=loginame&filtercolumns[]=login
899
+ *
900
+ * @exports ui/datatable
901
+ */
902
+
903
+
904
+ var dataTable = {
858
905
  /**
859
- * Helper for reading actions value in context
860
- *
861
- * @param {String} property
862
- * @param {Object} action
863
- * @param {Object} context
906
+ * Used for generating action button action button
907
+ * @typedef Action
908
+ * @type {Object}
909
+ * @property {String} id ID is added to the button class
910
+ * @property {String} [title] Button title
911
+ * @property {Boolean} [disabled] When present, button should be disabled
912
+ * @property {String} [icon] Generate button icon
913
+ * @property {Boolean} [hidden] When present, button is hidden
914
+ * @property {Function} [action] Handler on button click
864
915
  */
865
916
 
866
-
867
- const getPropertyValue = (property, action, context) => {
868
- const value = action[property];
869
- return _.isFunction(value) ? value.apply(context) : value;
870
- };
871
917
  /**
872
- * Update the data table status in the header
918
+ * Used for generating action button from Object
919
+ * @deprecated
920
+ * @typedef {{
921
+ * [key: Action.id & Action.icon & Action.title ]: Action.action,
922
+ * }} ActionsObject
923
+ *
924
+ * @example
925
+ * {
926
+ * actions: {
927
+ * edit: editUser,
928
+ * remove: removeUser,
929
+ * }
930
+ * }
873
931
  *
874
- * @param {Object} options
875
- * @param {jQueryElement} $container
876
- * @param {Object} dataset
932
+ * ! IMPORTANT USE INSTEAD:
933
+ * {
934
+ * actions: [
935
+ * {
936
+ * id: "edit",
937
+ * title: __("Edit"),
938
+ * icon: "edit",
939
+ * action: editUser
940
+ * },
941
+ * {
942
+ * id: "edit",
943
+ * title: __("Edit"),
944
+ * icon: "edit",
945
+ * action: editUser
946
+ * }
947
+ * ]
948
+ * }
877
949
  */
878
950
 
879
-
880
- const updateHeaderStatus = (options, $container, dataset) => {
881
- if (!options.status) {
882
- return;
883
- }
884
-
885
- const $statusEmpty = $container.find('.empty-list');
886
- const $statusAvailable = $container.find('.available-list');
887
- const $statusCount = $statusAvailable.find('.count');
888
- $container.find('.loading').addClass(hiddenCls); // when the status is enabled, the response must contain the total amount of records
889
-
890
- const amount = dataset.amount || dataset.length;
891
-
892
- if (amount) {
893
- $statusCount.text(amount);
894
- $statusAvailable.removeClass(hiddenCls);
895
- $statusEmpty.addClass(hiddenCls);
896
- } else {
897
- $statusEmpty.removeClass(hiddenCls);
898
- $statusAvailable.addClass(hiddenCls);
899
- }
900
- };
901
951
  /**
902
- * The dataTable component makes you able to browse items and bind specific
903
- * actions to undertake for edition and removal of them.
952
+ * Initialize the plugin.
904
953
  *
905
- * Parameters that will be send to backend by component:
954
+ * Called the jQuery way once registered by the Pluginifier.
955
+ * @example $('selector').datatable([], {});
906
956
  *
907
- * Pagination
908
- * @param {Number} rows - count of rows, that should be returned from backend, in other words limit.
909
- * @param {Number} page - number of page, that should be requested.
910
- *
911
- * Sorting
912
- * @param {String} sortby - name of column
913
- * @param {String} sortorder - order of sorting, can be 'asc' or 'desc' for ascending sorting and descending sorting respectively.
914
- * @param {String} sorttype - type of sorting, can be 'string' or 'numeric' for proper sorting numeric and string values.
915
- *
916
- * Filtering
917
- * @param {String} filterstrategy - filtering strategy. Default is single (see ui/datatable/filterStrategy/single.js).
918
- * @param {String} filterquery - query string for filtering of rows.
919
- * @param {String[]} filtercolumns[] - array of columns, in which will be implemented search during filtering process.
920
- * For column filter it will be only one item with column name, but component has ability define list of columns for default filter (in top toolbar).
921
- * Backend should correctly receive this list of columns and do search in accordance with this parameters.
922
- * By default, columns are not defined, so this parameter not will be sent. If filtercolumns[] not exists, backend should search by all columns.
923
- *
924
- * @example of query (GET): rows=25&page=1&sortby=login&sortorder=asc&filterquery=loginame&filtercolumns[]=login
925
- *
926
- * @exports ui/datatable
957
+ * @constructor
958
+ * @param {Object} options - the plugin options.
959
+ * @param {String} options.url - the URL of the service used to retrieve the resources.
960
+ * @param {Object[]} options.model - the model definition.
961
+ * @param {ActionsObject | Action[]} options.actions - Generates action buttons
962
+ * @param {Function} options.listeners.xxx - the callback function for event xxx, parameters depends to event trigger call.
963
+ * @param {Boolean} options.selectable - enables the selection of rows using checkboxes.
964
+ * @param {Boolean} options.rowSelection - enables the selection of rows by clicking on them.
965
+ * @param {Object} options.tools - a list of tool buttons to display above the table.
966
+ * @param {Object|Boolean} options.status - allow to display a status bar.
967
+ * @param {Object|Boolean} options.filter - allow to display a filter bar.
968
+ * @param {String} options.filterStrategy - 'multiple' | 'single' -- filtered by all filters together or filtering allowed only by one field at the moment (default 'single'),
969
+ * @param {String} options.filterSelector - css selector for search of filter inputs, by defaul 'select, input'
970
+ * @param {String} options.filterTransform - transform filter value before send to server.
971
+ * @param {String[]} options.filter.columns - a list of columns that will be used for default filter. Can be overridden by column filter.
972
+ * @param {String} options.filterquery - a query string for filtering, using only in runtime.
973
+ * @param {String[]} options.filtercolumns - a list of columns, in that should be done search, using only in runtime.
974
+ * @param {String} options.paginationStrategyTop - 'none' | 'pages' | 'simple' -- 'none' by default (next/prev), 'pages' show pages and extended control for pagination
975
+ * @param {String} options.paginationStrategyBottom - 'none' | 'pages' | 'simple' -- 'simple' by default (next/prev), 'pages' show pages and extended control for pagination
976
+ * @param {Object} options.labels - list of labels in datatable interface, that can be overridden by incoming options
977
+ * @param {String} options.emptyText - text that will be shown when no data found for showing in the grid.
978
+ * @param {Boolean} options.pageSizeSelector - flag that indicates if control for changing page size should be displayed
979
+ * @param {Boolean} options.atomicUpdate - allowed to keep the datatable state to be able on "render" event, compare with new state and atomically update the table cells.
980
+ * @param {Function} options.requestInterceptor - Intercept sending AJAX request. The call of function must returns promise with provided data.
981
+ * @param {Object} [data] - inject predefined data to avoid the first query.
982
+ * @fires dataTable#create.datatable
983
+ * @returns {jQueryElement} for chaining
927
984
  */
985
+ init: function init(options, data) {
986
+ options = _.defaults(options, defaults);
987
+ return this.each(function () {
988
+ var $elt = $$1(this);
989
+ var currentOptions = $elt.data(dataNs);
928
990
 
991
+ if (options.atomicUpdate && data) {
992
+ $elt.data("".concat(dataNs, "state"), data.data);
993
+ } // implement encapsulated pages for the datatable
929
994
 
930
- const dataTable = {
931
- /**
932
- * Used for generating action button action button
933
- * @typedef Action
934
- * @type {Object}
935
- * @property {String} id ID is added to the button class
936
- * @property {String} [title] Button title
937
- * @property {Boolean} [disabled] When present, button should be disabled
938
- * @property {String} [icon] Generate button icon
939
- * @property {Boolean} [hidden] When present, button is hidden
940
- * @property {Function} [action] Handler on button click
941
- */
942
995
 
943
- /**
944
- * Used for generating action button from Object
945
- * @deprecated
946
- * @typedef {{
947
- * [key: Action.id & Action.icon & Action.title ]: Action.action,
948
- * }} ActionsObject
949
- *
950
- * @example
951
- * {
952
- * actions: {
953
- * edit: editUser,
954
- * remove: removeUser,
955
- * }
956
- * }
957
- *
958
- * ! IMPORTANT USE INSTEAD:
959
- * {
960
- * actions: [
961
- * {
962
- * id: "edit",
963
- * title: __("Edit"),
964
- * icon: "edit",
965
- * action: editUser
966
- * },
967
- * {
968
- * id: "edit",
969
- * title: __("Edit"),
970
- * icon: "edit",
971
- * action: editUser
972
- * }
973
- * ]
974
- * }
975
- */
996
+ $elt.paginations = [];
976
997
 
977
- /**
978
- * Initialize the plugin.
979
- *
980
- * Called the jQuery way once registered by the Pluginifier.
981
- * @example $('selector').datatable([], {});
982
- *
983
- * @constructor
984
- * @param {Object} options - the plugin options.
985
- * @param {String} options.url - the URL of the service used to retrieve the resources.
986
- * @param {Object[]} options.model - the model definition.
987
- * @param {ActionsObject | Action[]} options.actions - Generates action buttons
988
- * @param {Function} options.listeners.xxx - the callback function for event xxx, parameters depends to event trigger call.
989
- * @param {Boolean} options.selectable - enables the selection of rows using checkboxes.
990
- * @param {Boolean} options.rowSelection - enables the selection of rows by clicking on them.
991
- * @param {Object} options.tools - a list of tool buttons to display above the table.
992
- * @param {Object|Boolean} options.status - allow to display a status bar.
993
- * @param {Object|Boolean} options.filter - allow to display a filter bar.
994
- * @param {String} options.filterStrategy - 'multiple' | 'single' -- filtered by all filters together or filtering allowed only by one field at the moment (default 'single'),
995
- * @param {String} options.filterSelector - css selector for search of filter inputs, by defaul 'select, input'
996
- * @param {String} options.filterTransform - transform filter value before send to server.
997
- * @param {String[]} options.filter.columns - a list of columns that will be used for default filter. Can be overridden by column filter.
998
- * @param {String} options.filterquery - a query string for filtering, using only in runtime.
999
- * @param {String[]} options.filtercolumns - a list of columns, in that should be done search, using only in runtime.
1000
- * @param {String} options.paginationStrategyTop - 'none' | 'pages' | 'simple' -- 'none' by default (next/prev), 'pages' show pages and extended control for pagination
1001
- * @param {String} options.paginationStrategyBottom - 'none' | 'pages' | 'simple' -- 'simple' by default (next/prev), 'pages' show pages and extended control for pagination
1002
- * @param {Object} options.labels - list of labels in datatable interface, that can be overridden by incoming options
1003
- * @param {String} options.emptyText - text that will be shown when no data found for showing in the grid.
1004
- * @param {Boolean} options.pageSizeSelector - flag that indicates if control for changing page size should be displayed
1005
- * @param {Boolean} options.atomicUpdate - allowed to keep the datatable state to be able on "render" event, compare with new state and atomically update the table cells.
1006
- * @param {Function} options.requestInterceptor - Intercept sending AJAX request. The call of function must returns promise with provided data.
1007
- * @param {Object} [data] - inject predefined data to avoid the first query.
1008
- * @fires dataTable#create.datatable
1009
- * @returns {jQueryElement} for chaining
1010
- */
1011
- init(options, data) {
1012
- options = _.defaults(options, defaults);
1013
- return this.each(function () {
1014
- const $elt = $$1(this);
1015
- const currentOptions = $elt.data(dataNs);
1016
-
1017
- if (options.atomicUpdate && data) {
1018
- $elt.data(`${dataNs}state`, data.data);
1019
- } // implement encapsulated pages for the datatable
1020
-
1021
-
1022
- $elt.paginations = [];
1023
-
1024
- if (!currentOptions) {
1025
- //add data to the element
1026
- $elt.data(dataNs, options);
1027
- $elt.one('load.' + ns, function () {
1028
- /**
1029
- * @event dataTable#create.datatable
1030
- */
1031
- $elt.trigger('create.' + ns);
1032
- });
998
+ if (!currentOptions) {
999
+ //add data to the element
1000
+ $elt.data(dataNs, options);
1001
+ $elt.one('load.' + ns, function () {
1002
+ /**
1003
+ * @event dataTable#create.datatable
1004
+ */
1005
+ $elt.trigger('create.' + ns);
1006
+ });
1033
1007
 
1034
- if (data) {
1035
- dataTable._render($elt, data);
1036
- } else {
1037
- dataTable._query($elt);
1038
- }
1008
+ if (data) {
1009
+ dataTable._render($elt, data);
1039
1010
  } else {
1040
- // update existing options
1041
- $elt.data(dataNs, _.merge(currentOptions, options));
1042
-
1043
- dataTable._refresh($elt, data);
1011
+ dataTable._query($elt);
1044
1012
  }
1045
- });
1046
- },
1047
-
1048
- /**
1049
- * Refresh the data table using current options
1050
- *
1051
- * Called the jQuery way once registered by the Pluginifier.
1052
- * @example $('selector').datatable('refresh');
1053
- *
1054
- * @param {jQueryElement} $elt - plugin's element
1055
- * @param {Object} [data] - Data to render immediately, prevents the query to be made.
1056
- */
1057
- _refresh($elt, data) {
1058
- if (data) {
1059
- this._render($elt, data);
1060
1013
  } else {
1061
- this._query($elt);
1062
- }
1063
- },
1014
+ // update existing options
1015
+ $elt.data(dataNs, _.merge(currentOptions, options));
1064
1016
 
1065
- /**
1066
- * Query the server for data and load the table.
1067
- *
1068
- * @private
1069
- * @param {jQueryElement} $elt - plugin's element
1070
- * @param $filter
1071
- * @fires dataTable#query.datatable
1072
- */
1073
- _query($elt, $filter) {
1074
- const self = this;
1075
- let options = $elt.data(dataNs);
1076
- loadingBar.start();
1077
-
1078
- if (!$filter) {
1079
- $filter = $$1('.filter', $elt);
1017
+ dataTable._refresh($elt, data);
1080
1018
  }
1019
+ });
1020
+ },
1081
1021
 
1082
- options = _.assign({}, options, this._getFilterStrategy($elt).getQueryData($elt, $filter, options));
1022
+ /**
1023
+ * Refresh the data table using current options
1024
+ *
1025
+ * Called the jQuery way once registered by the Pluginifier.
1026
+ * @example $('selector').datatable('refresh');
1027
+ *
1028
+ * @param {jQueryElement} $elt - plugin's element
1029
+ * @param {Object} [data] - Data to render immediately, prevents the query to be made.
1030
+ */
1031
+ _refresh: function _refresh($elt, data) {
1032
+ if (data) {
1033
+ this._render($elt, data);
1034
+ } else {
1035
+ this._query($elt);
1036
+ }
1037
+ },
1083
1038
 
1084
- const parameters = _.merge({}, _.pick(options, ['rows', 'page', 'sortby', 'sortorder', 'sorttype', 'filterquery', 'filtercolumns']), options.params || {});
1039
+ /**
1040
+ * Query the server for data and load the table.
1041
+ *
1042
+ * @private
1043
+ * @param {jQueryElement} $elt - plugin's element
1044
+ * @param $filter
1045
+ * @fires dataTable#query.datatable
1046
+ */
1047
+ _query: function _query($elt, $filter) {
1048
+ var self = this;
1049
+ var options = $elt.data(dataNs);
1050
+ loadingBar.start();
1085
1051
 
1086
- const ajaxConfig = {
1087
- url: options.url,
1088
- data: parameters,
1089
- dataType: 'json',
1090
- type: options.querytype || 'GET'
1091
- }; // disable pagination to not press multiple on it
1052
+ if (!$filter) {
1053
+ $filter = $$1('.filter', $elt);
1054
+ }
1092
1055
 
1093
- disablePagination($elt.paginations);
1094
- /**
1095
- * @event dataTable#query.datatable
1096
- * @param {Object} ajaxConfig - The config object used to setup the AJAX request
1097
- */
1056
+ options = _.assign({}, options, this._getFilterStrategy($elt).getQueryData($elt, $filter, options));
1098
1057
 
1099
- $elt.trigger('query.' + ns, [ajaxConfig]); // display the loading state
1058
+ var parameters = _.merge({}, _.pick(options, ['rows', 'page', 'sortby', 'sortorder', 'sorttype', 'filterquery', 'filtercolumns']), options.params || {});
1100
1059
 
1101
- if (options.status) {
1102
- $elt.find('.loading').removeClass(hiddenCls);
1103
- }
1060
+ var ajaxConfig = {
1061
+ url: options.url,
1062
+ data: parameters,
1063
+ dataType: 'json',
1064
+ type: options.querytype || 'GET'
1065
+ }; // disable pagination to not press multiple on it
1104
1066
 
1105
- if (typeof options.requestInterceptor === 'function') {
1106
- Promise.resolve(options.requestInterceptor(parameters)).then(data => {
1107
- self._render($elt, data);
1108
- }).catch(error => {
1109
- $elt.trigger('error.' + ns, [error]);
1067
+ disablePagination($elt.paginations);
1068
+ /**
1069
+ * @event dataTable#query.datatable
1070
+ * @param {Object} ajaxConfig - The config object used to setup the AJAX request
1071
+ */
1110
1072
 
1111
- self._render($elt, {});
1112
- });
1113
- return;
1114
- }
1073
+ $elt.trigger('query.' + ns, [ajaxConfig]); // display the loading state
1115
1074
 
1116
- $$1.ajax(ajaxConfig).done(function (response) {
1117
- if ($elt && typeof $elt.data(dataNs) !== 'object') {
1118
- return $elt.trigger(`error.${ns}`, [new Error(`Unable to load data attached to the element`)]);
1119
- }
1075
+ if (options.status) {
1076
+ $elt.find('.loading').removeClass(hiddenCls);
1077
+ }
1120
1078
 
1121
- self._render($elt, response);
1122
- }).fail(function (response, option, err) {
1123
- const requestErr = httpErrorParser.parse(response, option, err);
1124
- logger.error(requestErr.message);
1125
- requestErr.code = response.status;
1126
- enablePagination(this.paginations);
1127
- $elt.trigger('error.' + ns, [requestErr]);
1079
+ if (typeof options.requestInterceptor === 'function') {
1080
+ Promise.resolve(options.requestInterceptor(parameters)).then(function (data) {
1081
+ self._render($elt, data);
1082
+ }).catch(function (error) {
1083
+ $elt.trigger('error.' + ns, [error]);
1128
1084
 
1129
1085
  self._render($elt, {});
1130
1086
  });
1131
- },
1132
-
1133
- /**
1134
- * Renders the table using the provided data set
1135
- *
1136
- * @param {jQueryElement} $elt - plugin's element
1137
- * @param {Object} dataset - the data set to render
1138
- * @private
1139
- * @fires dataTable#beforeload.datatable
1140
- * @fires dataTable#load.datatable
1141
- */
1142
- _render($elt) {
1143
- let dataset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1144
- const self = this;
1145
-
1146
- let options = _.cloneDeep($elt.data(dataNs));
1087
+ return;
1088
+ }
1147
1089
 
1148
- if (typeof options === 'undefined') {
1149
- return $elt.trigger(`error.${ns}`, [new Error(`Unable to load data attached to the element`)]);
1090
+ $$1.ajax(ajaxConfig).done(function (response) {
1091
+ if ($elt && _typeof($elt.data(dataNs)) !== 'object') {
1092
+ return $elt.trigger("error.".concat(ns), [new Error("Unable to load data attached to the element")]);
1150
1093
  }
1151
1094
 
1152
- const model = [];
1153
- let $massActionBtns = $$1();
1154
- /**
1155
- * @event dataTable#beforeload.datatable
1156
- * @param {Object} dataset - The data set object used to render the table
1157
- */
1158
-
1159
- $elt.trigger('beforeload.' + ns, [_.cloneDeep(dataset)]); // overrides column options
1095
+ self._render($elt, response);
1096
+ }).fail(function (response, option, err) {
1097
+ var requestErr = httpErrorParser.parse(response, option, err);
1098
+ logger.error(requestErr.message);
1099
+ requestErr.code = response.status;
1100
+ enablePagination(this.paginations);
1101
+ $elt.trigger('error.' + ns, [requestErr]);
1160
1102
 
1161
- _.forEach(options.model, function (field, key) {
1162
- if (!options.filter) {
1163
- field.filterable = false;
1164
- }
1103
+ self._render($elt, {});
1104
+ });
1105
+ },
1165
1106
 
1166
- if (_.isUndefined(field.order)) {
1167
- field.order = key + 1;
1168
- }
1107
+ /**
1108
+ * Renders the table using the provided data set
1109
+ *
1110
+ * @param {jQueryElement} $elt - plugin's element
1111
+ * @param {Object} dataset - the data set to render
1112
+ * @private
1113
+ * @fires dataTable#beforeload.datatable
1114
+ * @fires dataTable#load.datatable
1115
+ */
1116
+ _render: function _render($elt) {
1117
+ var dataset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1118
+ var self = this;
1169
1119
 
1170
- if (field.filterable && typeof field.filterable !== 'object') {
1171
- field.filterable = {
1172
- placeholder: __('Filter')
1173
- };
1174
- }
1120
+ var options = _.cloneDeep($elt.data(dataNs));
1175
1121
 
1176
- if (typeof field.visible === 'undefined') {
1177
- model.push(field);
1178
- } else if (typeof field.visible === 'function' && field.visible()) {
1179
- model.push(field);
1180
- } else if (field.visible === true) {
1181
- model.push(field);
1182
- }
1183
- });
1122
+ if (typeof options === 'undefined') {
1123
+ return $elt.trigger("error.".concat(ns), [new Error("Unable to load data attached to the element")]);
1124
+ }
1184
1125
 
1185
- model.sort(function (a, b) {
1186
- return a.order - b.order;
1187
- });
1126
+ var model = [];
1127
+ var $massActionBtns = $$1();
1128
+ /**
1129
+ * @event dataTable#beforeload.datatable
1130
+ * @param {Object} dataset - The data set object used to render the table
1131
+ */
1188
1132
 
1189
- if (options.sortby) {
1190
- options = this._sortOptions($elt, options.sortby, options.sortorder, options.sorttype);
1191
- } // process data by model rules
1133
+ $elt.trigger('beforeload.' + ns, [_.cloneDeep(dataset)]); // overrides column options
1192
1134
 
1135
+ _.forEach(options.model, function (field, key) {
1136
+ if (!options.filter) {
1137
+ field.filterable = false;
1138
+ }
1193
1139
 
1194
- if (_.some(model, 'transform')) {
1195
- const transforms = _.where(model, 'transform');
1140
+ if (_.isUndefined(field.order)) {
1141
+ field.order = key + 1;
1142
+ }
1196
1143
 
1197
- _.forEach(dataset.data, (row, index) => {
1198
- _.forEach(transforms, field => {
1199
- if (_.isFunction(field.transform)) {
1200
- row[field.id] = field.transform(row[field.id], row, field, index, dataset.data);
1201
- }
1202
- });
1203
- });
1144
+ if (field.filterable && _typeof(field.filterable) !== 'object') {
1145
+ field.filterable = {
1146
+ placeholder: __('Filter')
1147
+ };
1204
1148
  }
1205
1149
 
1206
- options.model = model;
1150
+ if (typeof field.visible === 'undefined') {
1151
+ model.push(field);
1152
+ } else if (typeof field.visible === 'function' && field.visible()) {
1153
+ model.push(field);
1154
+ } else if (field.visible === true) {
1155
+ model.push(field);
1156
+ }
1157
+ });
1207
1158
 
1208
- if (options.atomicUpdate) {
1209
- const skipForceUpdate = this._shallowUpdate($elt, dataset, options);
1159
+ model.sort(function (a, b) {
1160
+ return a.order - b.order;
1161
+ });
1210
1162
 
1211
- if (skipForceUpdate) {
1212
- updateHeaderStatus(options, $elt, dataset);
1213
- loadingBar.stop();
1214
- $elt.trigger(`load.${ns}`, [dataset]);
1215
- return;
1216
- }
1217
- } // Call the rendering
1218
-
1219
-
1220
- const $rendering = $$1(layout({
1221
- options: options,
1222
- dataset: dataset
1223
- })); // the readonly property contains an associative array where keys are the ids of the items (lines)
1224
- // the value can be a boolean (true for disable buttons, false to enable)
1225
- // it can also bo an array that let you disable/enable the action you want
1226
- // readonly = {
1227
- // id1 : {'view':true, 'delete':false},
1228
- // id2 : true
1229
- //}
1230
-
1231
- _.forEach(dataset.readonly, function (values, id) {
1232
- if (values === true) {
1233
- $$1('[data-item-identifier="' + id + '"] button', $rendering).addClass('disabled');
1234
- } else if (values && typeof values === 'object') {
1235
- for (const action in values) {
1236
- if (values.hasOwnProperty(action) && values[action] === true) {
1237
- $$1(`[data-item-identifier="${id}"] button.${action}`, $rendering).addClass('disabled');
1238
- }
1239
- }
1240
- }
1241
- });
1242
- /**
1243
- * Attach handlers on the action buttons
1244
- * @param {ActionsObject | Action[]} actions
1245
- */
1163
+ if (options.sortby) {
1164
+ options = this._sortOptions($elt, options.sortby, options.sortorder, options.sorttype);
1165
+ } // process data by model rules
1246
1166
 
1247
1167
 
1248
- const attachActionListeners = actions => {
1249
- // Attach a listener to every action button created
1250
- _.forEach(actions, (action, name) => {
1251
- if (!_.isFunction(action)) {
1252
- name = action.id || name;
1168
+ if (_.some(model, 'transform')) {
1169
+ var transforms = _.where(model, 'transform');
1253
1170
 
1254
- action = action.action || function () {};
1171
+ _.forEach(dataset.data, function (row, index) {
1172
+ _.forEach(transforms, function (field) {
1173
+ if (_.isFunction(field.transform)) {
1174
+ row[field.id] = field.transform(row[field.id], row, field, index, dataset.data);
1255
1175
  }
1256
-
1257
- const css = `.${name}`;
1258
- $rendering.off('click', css).on('click', css, function (e) {
1259
- e.preventDefault();
1260
- const $btn = $$1(this);
1261
-
1262
- if (!$btn.hasClass('disabled')) {
1263
- const identifier = $btn.closest('[data-item-identifier]').data('item-identifier');
1264
- action.apply($btn, [identifier, _.first(_.where(dataset.data, {
1265
- id: identifier
1266
- }))]);
1267
- }
1268
- });
1269
1176
  });
1270
- };
1271
-
1272
- if (options.actions) {
1273
- attachActionListeners(options.actions);
1274
- } // Attach listeners to model.type = action
1177
+ });
1178
+ }
1275
1179
 
1180
+ options.model = model;
1276
1181
 
1277
- if (_.some(options.model, 'type')) {
1278
- const types = _.where(options.model, 'type');
1182
+ if (options.atomicUpdate) {
1183
+ var skipForceUpdate = this._shallowUpdate($elt, dataset, options);
1279
1184
 
1280
- _.forEach(types, field => {
1281
- if (field.type === 'actions' && field.actions) {
1282
- attachActionListeners(field.actions);
1185
+ if (skipForceUpdate) {
1186
+ updateHeaderStatus(options, $elt, dataset);
1187
+ loadingBar.stop();
1188
+ $elt.trigger("load.".concat(ns), [dataset]);
1189
+ return;
1190
+ }
1191
+ } // Call the rendering
1192
+
1193
+
1194
+ var $rendering = $$1(layout({
1195
+ options: options,
1196
+ dataset: dataset
1197
+ })); // the readonly property contains an associative array where keys are the ids of the items (lines)
1198
+ // the value can be a boolean (true for disable buttons, false to enable)
1199
+ // it can also bo an array that let you disable/enable the action you want
1200
+ // readonly = {
1201
+ // id1 : {'view':true, 'delete':false},
1202
+ // id2 : true
1203
+ //}
1204
+
1205
+ _.forEach(dataset.readonly, function (values, id) {
1206
+ if (values === true) {
1207
+ $$1('[data-item-identifier="' + id + '"] button', $rendering).addClass('disabled');
1208
+ } else if (values && _typeof(values) === 'object') {
1209
+ for (var action in values) {
1210
+ if (values.hasOwnProperty(action) && values[action] === true) {
1211
+ $$1("[data-item-identifier=\"".concat(id, "\"] button.").concat(action), $rendering).addClass('disabled');
1283
1212
  }
1284
- });
1285
- } // Attach a listener to every tool button created
1286
-
1213
+ }
1214
+ }
1215
+ });
1216
+ /**
1217
+ * Attach handlers on the action buttons
1218
+ * @param {ActionsObject | Action[]} actions
1219
+ */
1287
1220
 
1288
- _.forEach(options.tools, (action, name) => {
1289
- let isMassAction = true;
1290
1221
 
1222
+ var attachActionListeners = function attachActionListeners(actions) {
1223
+ // Attach a listener to every action button created
1224
+ _.forEach(actions, function (action, name) {
1291
1225
  if (!_.isFunction(action)) {
1292
1226
  name = action.id || name;
1293
- isMassAction = action.massAction;
1294
1227
 
1295
1228
  action = action.action || function () {};
1296
1229
  }
1297
1230
 
1298
- const css = `.tool-${name}`;
1299
-
1300
- if (isMassAction) {
1301
- $massActionBtns = $massActionBtns.add($rendering.find(css));
1302
- }
1303
-
1231
+ var css = ".".concat(name);
1304
1232
  $rendering.off('click', css).on('click', css, function (e) {
1305
1233
  e.preventDefault();
1306
- const $btn = $$1(this);
1234
+ var $btn = $$1(this);
1307
1235
 
1308
1236
  if (!$btn.hasClass('disabled')) {
1309
- action.apply($btn, [self._selection($elt)]);
1237
+ var identifier = $btn.closest('[data-item-identifier]').data('item-identifier');
1238
+ action.apply($btn, [identifier, _.first(_.where(dataset.data, {
1239
+ id: identifier
1240
+ }))]);
1310
1241
  }
1311
1242
  });
1312
- }); // bind listeners to events
1313
-
1314
-
1315
- _.forEach(options.listeners, (callback, event) => {
1316
- const ev = [event, ns].join('.');
1317
- $elt.off(ev).on(ev, callback);
1318
1243
  });
1244
+ };
1319
1245
 
1320
- function renderPagination($container, mode) {
1321
- return paginationComponent({
1322
- mode: mode,
1323
- activePage: dataset.page,
1324
- totalPages: dataset.total
1325
- }).on('change', function () {
1326
- self._setPage($elt, this.getActivePage());
1327
- }).on('prev', function () {
1328
- /**
1329
- * @event dataTable#backward.dataTable
1330
- */
1331
- $elt.trigger('backward.' + ns);
1332
- }).on('next', function () {
1333
- /**
1334
- * @event dataTable#forward.dataTable
1335
- */
1336
- $elt.trigger('forward.' + ns);
1337
- }).render($container);
1338
- }
1246
+ if (options.actions) {
1247
+ attachActionListeners(options.actions);
1248
+ } // Attach listeners to model.type = action
1339
1249
 
1340
- $elt.paginations = [];
1341
1250
 
1342
- if (options.paginationStrategyTop !== 'none') {
1343
- // bind pagination component to the datatable
1344
- $elt.paginations.push(renderPagination($$1('.datatable-pagination-top', $rendering), options.paginationStrategyTop));
1345
- }
1251
+ if (_.some(options.model, 'type')) {
1252
+ var types = _.where(options.model, 'type');
1346
1253
 
1347
- if (options.paginationStrategyBottom !== 'none') {
1348
- // bind pagination component to the datatable
1349
- $elt.paginations.push(renderPagination($$1('.datatable-pagination-bottom', $rendering), options.paginationStrategyBottom));
1350
- }
1254
+ _.forEach(types, function (field) {
1255
+ if (field.type === 'actions' && field.actions) {
1256
+ attachActionListeners(field.actions);
1257
+ }
1258
+ });
1259
+ } // Attach a listener to every tool button created
1351
1260
 
1352
- disablePagination($elt.paginations); // Now $rendering takes the place of $elt...
1353
1261
 
1354
- const $rows = $rendering.find('tbody tr');
1355
- const $sortBy = $rendering.find('th [data-sort-by]');
1356
- const $sortElement = $rendering.find('[data-sort-by="' + options.sortby + '"]');
1357
- const $checkAll = $rendering.find('th.checkboxes input');
1358
- const $checkboxes = $rendering.find('td.checkboxes input');
1262
+ _.forEach(options.tools, function (action, name) {
1263
+ var isMassAction = true;
1359
1264
 
1360
- if (options.rowSelection) {
1361
- $$1('table.datatable', $rendering).addClass('hoverable');
1362
- $rendering.on('click', 'tbody td', function (e) {
1363
- // exclude from processing columns with actions
1364
- if ($$1(e.target).hasClass('checkboxes') || $$1(e.target).hasClass('actions')) {
1365
- return false;
1366
- }
1265
+ if (!_.isFunction(action)) {
1266
+ name = action.id || name;
1267
+ isMassAction = action.massAction;
1367
1268
 
1368
- const currentRow = $$1(this).parent();
1369
- $rows.removeClass('selected');
1370
- currentRow.toggleClass('selected');
1371
- $elt.trigger('selected.' + ns, _.where(dataset.data, {
1372
- id: currentRow.data('item-identifier')
1373
- }));
1374
- });
1269
+ action = action.action || function () {};
1375
1270
  }
1376
1271
 
1377
- $sortBy.on('click keyup', function (e) {
1378
- if (e.type === 'keyup' && e.keyCode !== 13) {
1379
- return;
1380
- }
1272
+ var css = ".tool-".concat(name);
1273
+
1274
+ if (isMassAction) {
1275
+ $massActionBtns = $massActionBtns.add($rendering.find(css));
1276
+ }
1381
1277
 
1278
+ $rendering.off('click', css).on('click', css, function (e) {
1382
1279
  e.preventDefault();
1383
- const column = $$1(this).data('sort-by');
1384
- const type = $$1(this).data('sort-type');
1280
+ var $btn = $$1(this);
1385
1281
 
1386
- self._sort($elt, column, undefined, type);
1387
- }); // Add the filter behavior
1282
+ if (!$btn.hasClass('disabled')) {
1283
+ action.apply($btn, [self._selection($elt)]);
1284
+ }
1285
+ });
1286
+ }); // bind listeners to events
1388
1287
 
1389
- if (options.filter) {
1390
- self._getFilterStrategy($elt).render($rendering, options);
1391
1288
 
1392
- _.forEach($$1('.filter', $rendering), function (filter) {
1393
- const $filter = $$1(filter);
1394
- const $filterBtn = $$1('button', $filter);
1395
- const $filterInput = $$1('select, input', $filter);
1289
+ _.forEach(options.listeners, function (callback, event) {
1290
+ var ev = [event, ns].join('.');
1291
+ $elt.off(ev).on(ev, callback);
1292
+ });
1396
1293
 
1397
- if ($filterInput.is('select')) {
1398
- $filterInput.on('change', function () {
1399
- self._filter($elt, $filter);
1400
- });
1401
- } else {
1402
- // clicking the button trigger the request
1403
- $filterBtn.off('click').on('click', function (e) {
1404
- e.preventDefault();
1294
+ function renderPagination($container, mode) {
1295
+ return paginationComponent({
1296
+ mode: mode,
1297
+ activePage: dataset.page,
1298
+ totalPages: dataset.total
1299
+ }).on('change', function () {
1300
+ self._setPage($elt, this.getActivePage());
1301
+ }).on('prev', function () {
1302
+ /**
1303
+ * @event dataTable#backward.dataTable
1304
+ */
1305
+ $elt.trigger('backward.' + ns);
1306
+ }).on('next', function () {
1307
+ /**
1308
+ * @event dataTable#forward.dataTable
1309
+ */
1310
+ $elt.trigger('forward.' + ns);
1311
+ }).render($container);
1312
+ }
1405
1313
 
1406
- self._filter($elt, $filter);
1407
- }); // or press ENTER
1314
+ $elt.paginations = [];
1408
1315
 
1409
- $filterInput.off('keypress').on('keypress', function (e) {
1410
- if (e.which === 13) {
1411
- e.preventDefault();
1316
+ if (options.paginationStrategyTop !== 'none') {
1317
+ // bind pagination component to the datatable
1318
+ $elt.paginations.push(renderPagination($$1('.datatable-pagination-top', $rendering), options.paginationStrategyTop));
1319
+ }
1412
1320
 
1413
- self._filter($elt, $filter);
1414
- }
1415
- });
1416
- }
1417
- });
1418
- } // check/uncheck all checkboxes
1321
+ if (options.paginationStrategyBottom !== 'none') {
1322
+ // bind pagination component to the datatable
1323
+ $elt.paginations.push(renderPagination($$1('.datatable-pagination-bottom', $rendering), options.paginationStrategyBottom));
1324
+ }
1419
1325
 
1326
+ disablePagination($elt.paginations); // Now $rendering takes the place of $elt...
1420
1327
 
1421
- $checkAll.click(function () {
1422
- if (this.checked) {
1423
- $checkAll.prop('checked', true);
1424
- $checkboxes.prop('checked', true);
1425
- } else {
1426
- $checkAll.prop('checked', false);
1427
- $checkboxes.prop('checked', false);
1428
- }
1328
+ var $rows = $rendering.find('tbody tr');
1329
+ var $sortBy = $rendering.find('th [data-sort-by]');
1330
+ var $sortElement = $rendering.find('[data-sort-by="' + options.sortby + '"]');
1331
+ var $checkAll = $rendering.find('th.checkboxes input');
1332
+ var $checkboxes = $rendering.find('td.checkboxes input');
1429
1333
 
1430
- if ($massActionBtns.length) {
1431
- $massActionBtns.toggleClass('invisible', !$checkboxes.filter(':checked').length);
1334
+ if (options.rowSelection) {
1335
+ $$1('table.datatable', $rendering).addClass('hoverable');
1336
+ $rendering.on('click', 'tbody td', function (e) {
1337
+ // exclude from processing columns with actions
1338
+ if ($$1(e.target).hasClass('checkboxes') || $$1(e.target).hasClass('actions')) {
1339
+ return false;
1432
1340
  }
1433
- /**
1434
- * @event dataTable#select.dataTable
1435
- */
1436
1341
 
1342
+ var currentRow = $$1(this).parent();
1343
+ $rows.removeClass('selected');
1344
+ currentRow.toggleClass('selected');
1345
+ $elt.trigger('selected.' + ns, _.where(dataset.data, {
1346
+ id: currentRow.data('item-identifier')
1347
+ }));
1348
+ });
1349
+ }
1350
+
1351
+ $sortBy.on('click keyup', function (e) {
1352
+ if (e.type === 'keyup' && e.keyCode !== 13) {
1353
+ return;
1354
+ }
1437
1355
 
1438
- $elt.trigger('select.' + ns);
1439
- }); // when check/uncheck a box, toggle the check/uncheck all
1356
+ e.preventDefault();
1357
+ var column = $$1(this).data('sort-by');
1358
+ var type = $$1(this).data('sort-type');
1440
1359
 
1441
- $checkboxes.click(function () {
1442
- const $checked = $checkboxes.filter(':checked');
1360
+ self._sort($elt, column, undefined, type);
1361
+ }); // Add the filter behavior
1443
1362
 
1444
- if ($checked.length === $checkboxes.length) {
1445
- $checkAll.prop('checked', true);
1363
+ if (options.filter) {
1364
+ self._getFilterStrategy($elt).render($rendering, options);
1365
+
1366
+ _.forEach($$1('.filter', $rendering), function (filter) {
1367
+ var $filter = $$1(filter);
1368
+ var $filterBtn = $$1('button', $filter);
1369
+ var $filterInput = $$1('select, input', $filter);
1370
+
1371
+ if ($filterInput.is('select')) {
1372
+ $filterInput.on('change', function () {
1373
+ self._filter($elt, $filter);
1374
+ });
1446
1375
  } else {
1447
- $checkAll.prop('checked', false);
1448
- }
1376
+ // clicking the button trigger the request
1377
+ $filterBtn.off('click').on('click', function (e) {
1378
+ e.preventDefault();
1449
1379
 
1450
- if ($massActionBtns.length) {
1451
- $massActionBtns.toggleClass('invisible', !$checkboxes.filter(':checked').length);
1452
- }
1453
- /**
1454
- * @event dataTable#select.dataTable
1455
- */
1380
+ self._filter($elt, $filter);
1381
+ }); // or press ENTER
1456
1382
 
1383
+ $filterInput.off('keypress').on('keypress', function (e) {
1384
+ if (e.which === 13) {
1385
+ e.preventDefault();
1457
1386
 
1458
- $elt.trigger('select.' + ns);
1459
- }); // Remove sorted class from all th
1387
+ self._filter($elt, $filter);
1388
+ }
1389
+ });
1390
+ }
1391
+ });
1392
+ } // check/uncheck all checkboxes
1460
1393
 
1461
- $$1('th.sorted', $rendering).removeClass('sorted'); // Add the sorted class to the sorted element and the order class
1462
1394
 
1463
- $sortElement.addClass('sorted').addClass('sorted_' + options.sortorder); // Update the status
1395
+ $checkAll.click(function () {
1396
+ if (this.checked) {
1397
+ $checkAll.prop('checked', true);
1398
+ $checkboxes.prop('checked', true);
1399
+ } else {
1400
+ $checkAll.prop('checked', false);
1401
+ $checkboxes.prop('checked', false);
1402
+ }
1464
1403
 
1465
- updateHeaderStatus(options, $rendering, dataset);
1466
- $elt.html($rendering); // if the filter is enabled and a value is present, set the focus on the input field
1404
+ if ($massActionBtns.length) {
1405
+ $massActionBtns.toggleClass('invisible', !$checkboxes.filter(':checked').length);
1406
+ }
1407
+ /**
1408
+ * @event dataTable#select.dataTable
1409
+ */
1467
1410
 
1468
- if (options.filter && options.filterquery) {
1469
- $rendering.find('[name=filter].focused').focus();
1470
- } // restore pagination's after data loaded
1471
1411
 
1412
+ $elt.trigger('select.' + ns);
1413
+ }); // when check/uncheck a box, toggle the check/uncheck all
1472
1414
 
1473
- enablePagination($elt.paginations);
1415
+ $checkboxes.click(function () {
1416
+ var $checked = $checkboxes.filter(':checked');
1474
1417
 
1475
- if (options.pageSizeSelector) {
1476
- pageSizeSelector({
1477
- renderTo: $$1('.toolbox-container', $rendering),
1478
- defaultSize: options.rows
1479
- }).on('change', function (val) {
1480
- self._setRows($elt, val);
1481
- });
1418
+ if ($checked.length === $checkboxes.length) {
1419
+ $checkAll.prop('checked', true);
1420
+ } else {
1421
+ $checkAll.prop('checked', false);
1482
1422
  }
1483
1423
 
1484
- loadingBar.stop();
1424
+ if ($massActionBtns.length) {
1425
+ $massActionBtns.toggleClass('invisible', !$checkboxes.filter(':checked').length);
1426
+ }
1485
1427
  /**
1486
- * @event dataTable#load.dataTable
1487
- * @param {Object} dataset - The data set used to render the table
1428
+ * @event dataTable#select.dataTable
1488
1429
  */
1489
1430
 
1490
- $elt.trigger('load.' + ns, [dataset]);
1491
- },
1492
1431
 
1493
- /**
1494
- * Query set new page
1495
- *
1496
- * @param $elt
1497
- * @param page
1498
- * @fires dataTable#setpage.datatable
1499
- */
1500
- _setPage($elt, page) {
1501
- const options = $elt.data(dataNs);
1432
+ $elt.trigger('select.' + ns);
1433
+ }); // Remove sorted class from all th
1502
1434
 
1503
- if (options.page !== page) {
1504
- // set new page value
1505
- options.page = page; //rebind options to the elt
1435
+ $$1('th.sorted', $rendering).removeClass('sorted'); // Add the sorted class to the sorted element and the order class
1506
1436
 
1507
- $elt.data(dataNs, options);
1508
- /**
1509
- * @event dataTable#setpage.dataTable
1510
- */
1437
+ $sortElement.addClass('sorted').addClass('sorted_' + options.sortorder); // Update the status
1511
1438
 
1512
- $elt.trigger('setpage.' + ns); // Call the query
1439
+ updateHeaderStatus(options, $rendering, dataset);
1440
+ $elt.html($rendering); // if the filter is enabled and a value is present, set the focus on the input field
1441
+
1442
+ if (options.filter && options.filterquery) {
1443
+ $rendering.find('[name=filter].focused').focus();
1444
+ } // restore pagination's after data loaded
1513
1445
 
1514
- this._query($elt);
1515
- }
1516
- },
1517
1446
 
1447
+ enablePagination($elt.paginations);
1448
+
1449
+ if (options.pageSizeSelector) {
1450
+ pageSizeSelector({
1451
+ renderTo: $$1('.toolbox-container', $rendering),
1452
+ defaultSize: options.rows
1453
+ }).on('change', function (val) {
1454
+ self._setRows($elt, val);
1455
+ });
1456
+ }
1457
+
1458
+ loadingBar.stop();
1518
1459
  /**
1519
- * Query filtered list of items
1520
- *
1521
- * @param {jQueryElement} $elt - plugin's element
1522
- * @param {jQueryElement} $filter - the filter input
1523
- * @fires dataTable#filter.datatable
1524
- * @fires dataTable#sort.datatable
1525
- * @private
1460
+ * @event dataTable#load.dataTable
1461
+ * @param {Object} dataset - The data set used to render the table
1526
1462
  */
1527
- _filter($elt, $filter) {
1528
- const options = $elt.data(dataNs);
1529
1463
 
1530
- const filtersData = this._getFilterStrategy($elt).getFiltersData($elt, $filter, options);
1464
+ $elt.trigger('load.' + ns, [dataset]);
1465
+ },
1531
1466
 
1532
- options.page = 1;
1533
- $elt.data(dataNs, _.assign(options, filtersData));
1467
+ /**
1468
+ * Query set new page
1469
+ *
1470
+ * @param $elt
1471
+ * @param page
1472
+ * @fires dataTable#setpage.datatable
1473
+ */
1474
+ _setPage: function _setPage($elt, page) {
1475
+ var options = $elt.data(dataNs);
1476
+
1477
+ if (options.page !== page) {
1478
+ // set new page value
1479
+ options.page = page; //rebind options to the elt
1480
+
1481
+ $elt.data(dataNs, options);
1534
1482
  /**
1535
- * @event dataTable#filter.datatable
1536
- * @param {Object} options - The options list
1483
+ * @event dataTable#setpage.dataTable
1537
1484
  */
1538
1485
 
1539
- $elt.trigger('filter.' + ns, [options]); // Call the query
1486
+ $elt.trigger('setpage.' + ns); // Call the query
1540
1487
 
1541
- this._query($elt, $filter);
1542
- },
1488
+ this._query($elt);
1489
+ }
1490
+ },
1543
1491
 
1544
- _getFilterStrategy($elt) {
1545
- const options = $elt.data(dataNs);
1546
- return filterStrategyFactory(options);
1547
- },
1492
+ /**
1493
+ * Query filtered list of items
1494
+ *
1495
+ * @param {jQueryElement} $elt - plugin's element
1496
+ * @param {jQueryElement} $filter - the filter input
1497
+ * @fires dataTable#filter.datatable
1498
+ * @fires dataTable#sort.datatable
1499
+ * @private
1500
+ */
1501
+ _filter: function _filter($elt, $filter) {
1502
+ var options = $elt.data(dataNs);
1503
+
1504
+ var filtersData = this._getFilterStrategy($elt).getFiltersData($elt, $filter, options);
1548
1505
 
1506
+ options.page = 1;
1507
+ $elt.data(dataNs, _.assign(options, filtersData));
1549
1508
  /**
1550
- * Query the previous page
1551
- *
1552
- * Called the jQuery way once registered by the Pluginifier.
1553
- * @example $('selector').datatable('sort', 'firstname', false);
1554
- *
1555
- * @param {jQueryElement} $elt - plugin's element
1556
- * @param {String} sortBy - the model id of the col to sort
1557
- * @param {Boolean} [asc] - sort direction true for asc of deduced
1558
- * @param {String} sortType - type of sorting, numeric or string
1559
- * @fires dataTable#sort.datatable
1509
+ * @event dataTable#filter.datatable
1510
+ * @param {Object} options - The options list
1560
1511
  */
1561
- _sort($elt, sortBy, asc, sortType) {
1562
- const options = this._sortOptions($elt, sortBy, asc, sortType);
1563
- /**
1564
- * @event dataTable#sort.datatable
1565
- * @param {String} column - The name of the column to sort
1566
- * @param {String} direction - The sort direction
1567
- * @param {String} type - The type of sorting field, string or numeric
1568
- */
1569
-
1570
1512
 
1571
- $elt.trigger('sort.' + ns, [options.sortby, options.sortorder, options.sorttype]);
1513
+ $elt.trigger('filter.' + ns, [options]); // Call the query
1572
1514
 
1573
- this._query($elt);
1574
- },
1515
+ this._query($elt, $filter);
1516
+ },
1517
+ _getFilterStrategy: function _getFilterStrategy($elt) {
1518
+ var options = $elt.data(dataNs);
1519
+ return filterStrategyFactory(options);
1520
+ },
1575
1521
 
1522
+ /**
1523
+ * Query the previous page
1524
+ *
1525
+ * Called the jQuery way once registered by the Pluginifier.
1526
+ * @example $('selector').datatable('sort', 'firstname', false);
1527
+ *
1528
+ * @param {jQueryElement} $elt - plugin's element
1529
+ * @param {String} sortBy - the model id of the col to sort
1530
+ * @param {Boolean} [asc] - sort direction true for asc of deduced
1531
+ * @param {String} sortType - type of sorting, numeric or string
1532
+ * @fires dataTable#sort.datatable
1533
+ */
1534
+ _sort: function _sort($elt, sortBy, asc, sortType) {
1535
+ var options = this._sortOptions($elt, sortBy, asc, sortType);
1576
1536
  /**
1577
- * Compared current and next number of row and identifiers order of rows.
1578
- *
1579
- * @param {dataset} currentState
1580
- * @param {dataset} nextState
1581
- * @returns {Boolean}
1537
+ * @event dataTable#sort.datatable
1538
+ * @param {String} column - The name of the column to sort
1539
+ * @param {String} direction - The sort direction
1540
+ * @param {String} type - The type of sorting field, string or numeric
1582
1541
  */
1583
- _canApplyShallowUpdate(currentState, nextState) {
1584
- const isStatesHasData = _.has(currentState, 'data') && _.has(nextState, 'data');
1585
1542
 
1586
- if (!isStatesHasData) {
1587
- return false;
1588
- }
1589
1543
 
1590
- const currentData = currentState.data;
1591
- const nextData = nextState.data;
1544
+ $elt.trigger('sort.' + ns, [options.sortby, options.sortorder, options.sorttype]);
1592
1545
 
1593
- if (currentData.length !== nextData.length) {
1594
- return false;
1595
- }
1546
+ this._query($elt);
1547
+ },
1596
1548
 
1597
- return _.isEqual(currentData.map(data => data.id), nextData.map(data => data.id));
1598
- },
1549
+ /**
1550
+ * Compared current and next number of row and identifiers order of rows.
1551
+ *
1552
+ * @param {dataset} currentState
1553
+ * @param {dataset} nextState
1554
+ * @returns {Boolean}
1555
+ */
1556
+ _canApplyShallowUpdate: function _canApplyShallowUpdate(currentState, nextState) {
1557
+ var isStatesHasData = _.has(currentState, 'data') && _.has(nextState, 'data');
1599
1558
 
1600
- /**
1601
- * Check possibility of atomic update data in datatable.
1602
- *
1603
- * @param {jQueryElement} $container Data table container element
1604
- * @param {Object} nextState Data to be set to the data table
1605
- * @param {Object} options Data table options
1606
- * @returns {Boolean} Return true when data in table can be atomically updated
1607
- */
1608
- _shallowUpdate($container, nextState, options) {
1609
- const currentState = $container.data(`${dataNs}state`); // Always update data state
1559
+ if (!isStatesHasData) {
1560
+ return false;
1561
+ }
1610
1562
 
1611
- $container.data(`${dataNs}state`, nextState);
1563
+ var currentData = currentState.data;
1564
+ var nextData = nextState.data;
1612
1565
 
1613
- if (!this._canApplyShallowUpdate(currentState, nextState)) {
1614
- return;
1615
- } // NOTE: The code above generate the table cell. With updating handlebars to the version > 2.*, please move it to the dedicated template to reuse it in layout.tpl as well
1616
-
1617
-
1618
- nextState.data.forEach((nextData, index) => {
1619
- const $row = $container.find(`tr[data-item-identifier="${nextData.id}"]`);
1620
- options.model.forEach(model => {
1621
- const cellId = model.id;
1622
-
1623
- if (model.type) {
1624
- const $actionCell = $row.find(`td.actions.${cellId}`);
1625
- $actionCell.html('');
1626
- model.actions.forEach(action => {
1627
- const id = action.id;
1628
- const hidden = getPropertyValue('hidden', action, nextData);
1629
- const title = getPropertyValue('title', action, nextData);
1630
- const disabled = getPropertyValue('disabled', action, nextData);
1631
- const icon = getPropertyValue('icon', action, nextData);
1632
- const label = getPropertyValue('label', action, nextData);
1633
- const $actionButton = $$1(buttonTpl({
1634
- id,
1635
- icon,
1636
- label,
1637
- title,
1638
- disabled
1639
- }));
1640
-
1641
- if (!hidden) {
1642
- $actionCell.append('\n').append($actionButton);
1643
- }
1644
- });
1645
- } else {
1646
- const nextContent = nextData[cellId];
1647
- $row.find(`td.${cellId}`).html(DOMPurify.sanitize(nextContent));
1648
- }
1649
- });
1650
- });
1651
- return true;
1652
- },
1566
+ if (currentData.length !== nextData.length) {
1567
+ return false;
1568
+ }
1653
1569
 
1654
- /**
1655
- * Set the sort options.
1656
- *
1657
- * @param {jQueryElement} $elt - plugin's element
1658
- * @param {String} sortBy - the model id of the col to sort
1659
- * @param {Boolean|String} [asc] - sort direction true for asc of deduced
1660
- * @param {String} sortType - sorting type, numeric or string sorting
1661
- * @returns {Object} - returns the options
1662
- * @private
1663
- */
1664
- _sortOptions($elt, sortBy, asc, sortType) {
1665
- const options = $elt.data(dataNs);
1570
+ return _.isEqual(currentData.map(function (data) {
1571
+ return data.id;
1572
+ }), nextData.map(function (data) {
1573
+ return data.id;
1574
+ }));
1575
+ },
1666
1576
 
1667
- if (typeof asc !== 'undefined') {
1668
- if ('asc' !== asc && 'desc' !== asc) {
1669
- asc = !!asc ? 'asc' : 'desc';
1577
+ /**
1578
+ * Check possibility of atomic update data in datatable.
1579
+ *
1580
+ * @param {jQueryElement} $container Data table container element
1581
+ * @param {Object} nextState Data to be set to the data table
1582
+ * @param {Object} options Data table options
1583
+ * @returns {Boolean} Return true when data in table can be atomically updated
1584
+ */
1585
+ _shallowUpdate: function _shallowUpdate($container, nextState, options) {
1586
+ var currentState = $container.data("".concat(dataNs, "state")); // Always update data state
1587
+
1588
+ $container.data("".concat(dataNs, "state"), nextState);
1589
+
1590
+ if (!this._canApplyShallowUpdate(currentState, nextState)) {
1591
+ return;
1592
+ } // NOTE: The code above generate the table cell. With updating handlebars to the version > 2.*, please move it to the dedicated template to reuse it in layout.tpl as well
1593
+
1594
+
1595
+ nextState.data.forEach(function (nextData, index) {
1596
+ var $row = $container.find("tr[data-item-identifier=\"".concat(nextData.id, "\"]"));
1597
+ options.model.forEach(function (model) {
1598
+ var cellId = model.id;
1599
+
1600
+ if (model.type) {
1601
+ var $actionCell = $row.find("td.actions.".concat(cellId));
1602
+ $actionCell.html('');
1603
+ model.actions.forEach(function (action) {
1604
+ var id = action.id;
1605
+ var hidden = getPropertyValue('hidden', action, nextData);
1606
+ var title = getPropertyValue('title', action, nextData);
1607
+ var disabled = getPropertyValue('disabled', action, nextData);
1608
+ var icon = getPropertyValue('icon', action, nextData);
1609
+ var label = getPropertyValue('label', action, nextData);
1610
+ var $actionButton = $$1(buttonTpl({
1611
+ id: id,
1612
+ icon: icon,
1613
+ label: label,
1614
+ title: title,
1615
+ disabled: disabled
1616
+ }));
1617
+
1618
+ if (!hidden) {
1619
+ $actionCell.append('\n').append($actionButton);
1620
+ }
1621
+ });
1622
+ } else {
1623
+ var nextContent = nextData[cellId];
1624
+ $row.find("td.".concat(cellId)).html(DOMPurify.sanitize(nextContent));
1670
1625
  }
1626
+ });
1627
+ });
1628
+ return true;
1629
+ },
1671
1630
 
1672
- options.sortorder = asc;
1673
- } else if (options.sortorder === 'asc' && options.sortby === sortBy) {
1674
- // If I already sort asc this element
1675
- options.sortorder = 'desc';
1676
- } else {
1677
- // If I never sort by this element or
1678
- // I sort by this element & the order was desc
1679
- options.sortorder = 'asc';
1680
- } // Change the sorting element anyway.
1631
+ /**
1632
+ * Set the sort options.
1633
+ *
1634
+ * @param {jQueryElement} $elt - plugin's element
1635
+ * @param {String} sortBy - the model id of the col to sort
1636
+ * @param {Boolean|String} [asc] - sort direction true for asc of deduced
1637
+ * @param {String} sortType - sorting type, numeric or string sorting
1638
+ * @returns {Object} - returns the options
1639
+ * @private
1640
+ */
1641
+ _sortOptions: function _sortOptions($elt, sortBy, asc, sortType) {
1642
+ var options = $elt.data(dataNs);
1681
1643
 
1644
+ if (typeof asc !== 'undefined') {
1645
+ if ('asc' !== asc && 'desc' !== asc) {
1646
+ asc = !!asc ? 'asc' : 'desc';
1647
+ }
1682
1648
 
1683
- options.sortby = sortBy; // define sorting type
1649
+ options.sortorder = asc;
1650
+ } else if (options.sortorder === 'asc' && options.sortby === sortBy) {
1651
+ // If I already sort asc this element
1652
+ options.sortorder = 'desc';
1653
+ } else {
1654
+ // If I never sort by this element or
1655
+ // I sort by this element & the order was desc
1656
+ options.sortorder = 'asc';
1657
+ } // Change the sorting element anyway.
1684
1658
 
1685
- options.sorttype = sortType; //rebind options to the elt
1686
1659
 
1687
- $elt.data(dataNs, options);
1688
- return _.cloneDeep(options);
1689
- },
1660
+ options.sortby = sortBy; // define sorting type
1690
1661
 
1691
- /**
1692
- * Gets the selected items. Returns an array of identifiers.
1693
- *
1694
- * @param {jQueryElement} $elt - plugin's element
1695
- * @returns {Array} - Returns an array of identifiers.
1696
- */
1697
- _selection($elt) {
1698
- const $selected = $elt.find('[data-item-identifier]').has('td.checkboxes input:checked');
1699
- const selection = [];
1700
- $selected.each(function () {
1701
- selection.push($$1(this).data('item-identifier'));
1702
- });
1703
- return selection;
1704
- },
1662
+ options.sorttype = sortType; //rebind options to the elt
1705
1663
 
1706
- _highlightRows($elt, rowIds) {
1707
- $elt.find('[data-item-identifier]').removeClass('highlight');
1708
- rowIds.forEach(rowId => {
1709
- this._highlightRow($elt, rowId);
1710
- });
1711
- },
1664
+ $elt.data(dataNs, options);
1665
+ return _.cloneDeep(options);
1666
+ },
1712
1667
 
1713
- /**
1714
- * Highlight the row with identifier
1715
- *
1716
- * @param $elt
1717
- * @param rowId
1718
- * @deprecated Use highlightRows instead
1719
- */
1720
- _highlightRow($elt, rowId) {
1721
- this._addRowClass($elt, rowId, 'highlight');
1722
- },
1668
+ /**
1669
+ * Gets the selected items. Returns an array of identifiers.
1670
+ *
1671
+ * @param {jQueryElement} $elt - plugin's element
1672
+ * @returns {Array} - Returns an array of identifiers.
1673
+ */
1674
+ _selection: function _selection($elt) {
1675
+ var $selected = $elt.find('[data-item-identifier]').has('td.checkboxes input:checked');
1676
+ var selection = [];
1677
+ $selected.each(function () {
1678
+ selection.push($$1(this).data('item-identifier'));
1679
+ });
1680
+ return selection;
1681
+ },
1682
+ _highlightRows: function _highlightRows($elt, rowIds) {
1683
+ var _this = this;
1684
+
1685
+ $elt.find('[data-item-identifier]').removeClass('highlight');
1686
+ rowIds.forEach(function (rowId) {
1687
+ _this._highlightRow($elt, rowId);
1688
+ });
1689
+ },
1723
1690
 
1724
- /**
1725
- * Css class add to the row with id
1726
- *
1727
- * @param $elt
1728
- * @param rowId
1729
- * @param className
1730
- * @private
1731
- */
1732
- _addRowClass($elt, rowId, className) {
1733
- const $row = $elt.find('[data-item-identifier="' + rowId + '"]');
1691
+ /**
1692
+ * Highlight the row with identifier
1693
+ *
1694
+ * @param $elt
1695
+ * @param rowId
1696
+ * @deprecated Use highlightRows instead
1697
+ */
1698
+ _highlightRow: function _highlightRow($elt, rowId) {
1699
+ this._addRowClass($elt, rowId, 'highlight');
1700
+ },
1734
1701
 
1735
- if (!$row.hasClass(className)) {
1736
- $row.addClass(className);
1737
- }
1738
- },
1702
+ /**
1703
+ * Css class add to the row with id
1704
+ *
1705
+ * @param $elt
1706
+ * @param rowId
1707
+ * @param className
1708
+ * @private
1709
+ */
1710
+ _addRowClass: function _addRowClass($elt, rowId, className) {
1711
+ var $row = $elt.find('[data-item-identifier="' + rowId + '"]');
1739
1712
 
1740
- /**
1741
- * Css class remove from the row with id
1742
- *
1743
- * @param $elt
1744
- * @param rowId
1745
- * @param className
1746
- * @private
1747
- */
1748
- _removeRowClass($elt, rowId, className) {
1749
- const $row = $elt.find('[data-item-identifier="' + rowId + '"]');
1713
+ if (!$row.hasClass(className)) {
1714
+ $row.addClass(className);
1715
+ }
1716
+ },
1750
1717
 
1751
- if ($row.hasClass(className)) {
1752
- $row.removeClass(className);
1753
- }
1754
- },
1718
+ /**
1719
+ * Css class remove from the row with id
1720
+ *
1721
+ * @param $elt
1722
+ * @param rowId
1723
+ * @param className
1724
+ * @private
1725
+ */
1726
+ _removeRowClass: function _removeRowClass($elt, rowId, className) {
1727
+ var $row = $elt.find('[data-item-identifier="' + rowId + '"]');
1755
1728
 
1756
- /**
1757
- * Update amount items per page
1758
- *
1759
- * @param $elt
1760
- * @param rows
1761
- * @fires dataTable#setpage.datatable
1762
- */
1763
- _setRows($elt, rows) {
1764
- const options = $elt.data(dataNs);
1729
+ if ($row.hasClass(className)) {
1730
+ $row.removeClass(className);
1731
+ }
1732
+ },
1733
+
1734
+ /**
1735
+ * Update amount items per page
1736
+ *
1737
+ * @param $elt
1738
+ * @param rows
1739
+ * @fires dataTable#setpage.datatable
1740
+ */
1741
+ _setRows: function _setRows($elt, rows) {
1742
+ var options = $elt.data(dataNs);
1765
1743
 
1766
- if (options.rows !== rows) {
1767
- // set new amount of items per page
1768
- options.rows = rows; // set page to the first one
1744
+ if (options.rows !== rows) {
1745
+ // set new amount of items per page
1746
+ options.rows = rows; // set page to the first one
1769
1747
 
1770
- options.page = 1; //rebind options to the elt
1748
+ options.page = 1; //rebind options to the elt
1771
1749
 
1772
- $elt.data(dataNs, options);
1773
- /**
1774
- * @event dataTable#setpage.dataTable
1775
- */
1750
+ $elt.data(dataNs, options);
1751
+ /**
1752
+ * @event dataTable#setpage.dataTable
1753
+ */
1776
1754
 
1777
- $elt.trigger('setpage.' + ns); // Call the query
1755
+ $elt.trigger('setpage.' + ns); // Call the query
1778
1756
 
1779
- this._query($elt);
1780
- }
1757
+ this._query($elt);
1781
1758
  }
1782
-
1783
- };
1784
- Pluginifier.register(ns, dataTable, {
1785
- expose: ['refresh', 'sort', 'filter', 'selection', 'render', 'highlightRow', 'highlightRows', 'addRowClass', 'removeRowClass']
1786
- });
1759
+ }
1760
+ };
1761
+ Pluginifier.register(ns, dataTable, {
1762
+ expose: ['refresh', 'sort', 'filter', 'selection', 'render', 'highlightRow', 'highlightRows', 'addRowClass', 'removeRowClass']
1763
+ });
1787
1764
 
1788
1765
  });