@oat-sa/tao-core-ui 1.60.2 → 1.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (783) hide show
  1. package/LICENSE +339 -339
  2. package/README.md +23 -18
  3. package/dist/actionbar.js +393 -410
  4. package/dist/adder.js +143 -156
  5. package/dist/animable/absorbable/absorbable.js +208 -211
  6. package/dist/animable/absorbable/css/absorb.css +7 -8
  7. package/dist/animable/absorbable/css/absorb.css.map +1 -1
  8. package/dist/animable/pulsable/css/pulse.css +7 -7
  9. package/dist/animable/pulsable/css/pulse.css.map +1 -1
  10. package/dist/animable/pulsable/pulsable.js +174 -174
  11. package/dist/areaBroker.js +59 -72
  12. package/dist/autocomplete/css/autocomplete.css +7 -8
  13. package/dist/autocomplete/css/autocomplete.css.map +1 -1
  14. package/dist/autocomplete.js +494 -604
  15. package/dist/autoscroll.js +23 -25
  16. package/dist/badge/badge.js +201 -199
  17. package/dist/badge/css/badge.css +7 -8
  18. package/dist/badge/css/badge.css.map +1 -1
  19. package/dist/breadcrumbs/css/breadcrumbs.css +7 -7
  20. package/dist/breadcrumbs/css/breadcrumbs.css.map +1 -1
  21. package/dist/breadcrumbs.js +286 -285
  22. package/dist/btngrouper.js +83 -95
  23. package/dist/bulkActionPopup/css/bulkActionPopup.css +7 -7
  24. package/dist/bulkActionPopup/css/bulkActionPopup.css.map +1 -1
  25. package/dist/bulkActionPopup.js +503 -503
  26. package/dist/button.js +300 -293
  27. package/dist/calculator/css/calculator.css +10 -10
  28. package/dist/calculator/css/calculator.css.map +1 -1
  29. package/dist/calculator.js +59 -72
  30. package/dist/cascadingComboBox.js +257 -256
  31. package/dist/ckeditor/ckConfigurator.js +130 -154
  32. package/dist/ckeditor/dtdHandler.js +305 -345
  33. package/dist/class/css/selector.css +7 -7
  34. package/dist/class/css/selector.css.map +1 -1
  35. package/dist/class/selector.js +437 -470
  36. package/dist/component/alignable.js +97 -121
  37. package/dist/component/containable.js +53 -58
  38. package/dist/component/css/components.css +7 -7
  39. package/dist/component/css/components.css.map +1 -1
  40. package/dist/component/css/windowComponent.css +7 -7
  41. package/dist/component/css/windowComponent.css.map +1 -1
  42. package/dist/component/draggable.js +34 -36
  43. package/dist/component/placeable.js +84 -102
  44. package/dist/component/resizable.js +79 -89
  45. package/dist/component/stackable.js +21 -27
  46. package/dist/component/windowed.js +284 -297
  47. package/dist/component.js +439 -467
  48. package/dist/container.js +79 -98
  49. package/dist/contextualPopup/css/contextualPopup.css +7 -7
  50. package/dist/contextualPopup/css/contextualPopup.css.map +1 -1
  51. package/dist/contextualPopup.js +417 -436
  52. package/dist/dashboard/css/dashboard.css +7 -7
  53. package/dist/dashboard/css/dashboard.css.map +1 -1
  54. package/dist/dashboard.js +302 -305
  55. package/dist/datalist/css/datalist.css +7 -7
  56. package/dist/datalist/css/datalist.css.map +1 -1
  57. package/dist/datalist.js +783 -791
  58. package/dist/datatable/css/datatable.css +11 -7
  59. package/dist/datatable/css/datatable.css.map +1 -1
  60. package/dist/datatable/filterStrategy/filterStrategy.js +28 -30
  61. package/dist/datatable/filterStrategy/multiple.js +26 -45
  62. package/dist/datatable/filterStrategy/single.js +28 -40
  63. package/dist/datatable.js +1591 -1616
  64. package/dist/dateRange/css/dateRange.css +7 -7
  65. package/dist/dateRange/css/dateRange.css.map +1 -1
  66. package/dist/dateRange/dateRange.js +398 -412
  67. package/dist/datetime/css/picker.css +7 -7
  68. package/dist/datetime/css/picker.css.map +1 -1
  69. package/dist/datetime/picker.js +670 -703
  70. package/dist/deleter.js +383 -398
  71. package/dist/destination/css/selector.css +7 -7
  72. package/dist/destination/css/selector.css.map +1 -1
  73. package/dist/destination/selector.js +295 -293
  74. package/dist/dialog/alert.js +30 -32
  75. package/dist/dialog/confirm.js +29 -32
  76. package/dist/dialog/confirmDelete.js +223 -221
  77. package/dist/dialog.js +651 -695
  78. package/dist/disabler.js +108 -119
  79. package/dist/documentViewer/css/documentViewer.css +7 -7
  80. package/dist/documentViewer/css/documentViewer.css.map +1 -1
  81. package/dist/documentViewer/providers/pdfViewer/fallback/viewer.js +172 -169
  82. package/dist/documentViewer/providers/pdfViewer/pdfjs/areaBroker.js +32 -29
  83. package/dist/documentViewer/providers/pdfViewer/pdfjs/findBar.js +523 -564
  84. package/dist/documentViewer/providers/pdfViewer/pdfjs/pageView.js +376 -393
  85. package/dist/documentViewer/providers/pdfViewer/pdfjs/pagesManager.js +53 -68
  86. package/dist/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +517 -567
  87. package/dist/documentViewer/providers/pdfViewer/pdfjs/textManager.js +73 -96
  88. package/dist/documentViewer/providers/pdfViewer/pdfjs/viewer.js +381 -392
  89. package/dist/documentViewer/providers/pdfViewer/pdfjs/wrapper.js +125 -152
  90. package/dist/documentViewer/providers/pdfViewer.js +189 -191
  91. package/dist/documentViewer/viewerFactory.js +76 -81
  92. package/dist/documentViewer.js +303 -311
  93. package/dist/dropdown/css/dropdown.css +7 -7
  94. package/dist/dropdown/css/dropdown.css.map +1 -1
  95. package/dist/dropdown.js +392 -412
  96. package/dist/durationer.js +77 -85
  97. package/dist/dynamicComponent/css/dynamicComponent.css +7 -7
  98. package/dist/dynamicComponent/css/dynamicComponent.css.map +1 -1
  99. package/dist/dynamicComponent.js +595 -630
  100. package/dist/feedback.js +365 -375
  101. package/dist/figure/FigureStateActive.js +246 -296
  102. package/dist/filesender.js +44 -54
  103. package/dist/filter.js +244 -240
  104. package/dist/form/css/dropdownForm.css +7 -7
  105. package/dist/form/css/dropdownForm.css.map +1 -1
  106. package/dist/form/css/form.css +7 -7
  107. package/dist/form/css/form.css.map +1 -1
  108. package/dist/form/dropdownForm.js +357 -362
  109. package/dist/form/form.js +703 -984
  110. package/dist/form/simpleForm.js +74 -77
  111. package/dist/form/validator/css/validator.css +7 -7
  112. package/dist/form/validator/css/validator.css.map +1 -1
  113. package/dist/form/validator/renderer.js +235 -241
  114. package/dist/form/validator/validator.js +181 -267
  115. package/dist/form/widget/css/widget.css +7 -7
  116. package/dist/form/widget/css/widget.css.map +1 -1
  117. package/dist/form/widget/definitions.js +27 -28
  118. package/dist/form/widget/loader.js +16 -16
  119. package/dist/form/widget/providers/checkBox.js +257 -264
  120. package/dist/form/widget/providers/comboBox.js +194 -193
  121. package/dist/form/widget/providers/default.js +44 -50
  122. package/dist/form/widget/providers/hidden.js +179 -176
  123. package/dist/form/widget/providers/hiddenBox.js +262 -272
  124. package/dist/form/widget/providers/radioBox.js +222 -223
  125. package/dist/form/widget/providers/textArea.js +197 -193
  126. package/dist/form/widget/providers/textBox.js +36 -37
  127. package/dist/form/widget/widget.js +480 -508
  128. package/dist/form.js +12 -17
  129. package/dist/formValidator/formValidator.js +74 -91
  130. package/dist/formValidator/highlighters/highlighter.js +43 -51
  131. package/dist/formValidator/highlighters/message.js +31 -32
  132. package/dist/formValidator/highlighters/tooltip.js +33 -35
  133. package/dist/generis/form/css/form.css +7 -7
  134. package/dist/generis/form/css/form.css.map +1 -1
  135. package/dist/generis/form/form.js +323 -331
  136. package/dist/generis/validator/css/validator.css +7 -7
  137. package/dist/generis/validator/css/validator.css.map +1 -1
  138. package/dist/generis/validator/validator.js +215 -216
  139. package/dist/generis/widget/checkBox/checkBox.js +227 -225
  140. package/dist/generis/widget/comboBox/comboBox.js +189 -183
  141. package/dist/generis/widget/css/widget.css +7 -7
  142. package/dist/generis/widget/css/widget.css.map +1 -1
  143. package/dist/generis/widget/hiddenBox/hiddenBox.js +231 -232
  144. package/dist/generis/widget/loader.js +21 -23
  145. package/dist/generis/widget/textBox/textBox.js +178 -172
  146. package/dist/generis/widget/widget.js +255 -266
  147. package/dist/groupedComboBox.js +231 -226
  148. package/dist/groupvalidator.js +30 -34
  149. package/dist/hider.js +43 -50
  150. package/dist/highlighter.js +946 -1057
  151. package/dist/image/ImgStateActive/extractLabel.js +20 -21
  152. package/dist/image/ImgStateActive/helper.js +21 -25
  153. package/dist/image/ImgStateActive/initHelper.js +133 -162
  154. package/dist/image/ImgStateActive/initMediaEditor.js +72 -92
  155. package/dist/image/ImgStateActive/mediaSizer.js +48 -58
  156. package/dist/image/ImgStateActive.js +185 -215
  157. package/dist/incrementer.js +91 -110
  158. package/dist/inplacer.js +108 -132
  159. package/dist/interactUtils.js +56 -67
  160. package/dist/itemButtonList/css/item-button-list.css +23 -24
  161. package/dist/itemButtonList/css/item-button-list.css.map +1 -1
  162. package/dist/itemButtonList.js +444 -469
  163. package/dist/keyNavigation/navigableDomElement.js +124 -158
  164. package/dist/keyNavigation/navigator.js +235 -312
  165. package/dist/listbox/css/listbox.css +7 -7
  166. package/dist/listbox/css/listbox.css.map +1 -1
  167. package/dist/listbox.js +463 -476
  168. package/dist/liststyler.js +75 -76
  169. package/dist/loadingButton/css/button.css +7 -7
  170. package/dist/loadingButton/css/button.css.map +1 -1
  171. package/dist/loadingButton/loadingButton.js +219 -218
  172. package/dist/lock.js +484 -509
  173. package/dist/login/login.js +471 -486
  174. package/dist/maths/calculator/basicCalculator.js +247 -242
  175. package/dist/maths/calculator/calculatorComponent.js +34 -36
  176. package/dist/maths/calculator/core/areaBroker.js +30 -28
  177. package/dist/maths/calculator/core/board.js +805 -872
  178. package/dist/maths/calculator/core/expression.js +500 -518
  179. package/dist/maths/calculator/core/labels.js +240 -235
  180. package/dist/maths/calculator/core/plugin.js +20 -20
  181. package/dist/maths/calculator/core/terms.js +27 -27
  182. package/dist/maths/calculator/core/tokenizer.js +119 -132
  183. package/dist/maths/calculator/core/tokens.js +157 -168
  184. package/dist/maths/calculator/css/calculator.css +7 -7
  185. package/dist/maths/calculator/css/calculator.css.map +1 -1
  186. package/dist/maths/calculator/defaultCalculator.js +24 -27
  187. package/dist/maths/calculator/plugins/core/degrad.js +22 -30
  188. package/dist/maths/calculator/plugins/core/history.js +55 -67
  189. package/dist/maths/calculator/plugins/core/remind.js +22 -25
  190. package/dist/maths/calculator/plugins/core/stepNavigation.js +33 -49
  191. package/dist/maths/calculator/plugins/keyboard/templateKeyboard/templateKeyboard.js +255 -258
  192. package/dist/maths/calculator/plugins/modifiers/pow10.js +47 -52
  193. package/dist/maths/calculator/plugins/modifiers/sign.js +103 -130
  194. package/dist/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +288 -293
  195. package/dist/maths/calculator/pluginsLoader.js +22 -22
  196. package/dist/maths/calculator/scientificCalculator.js +339 -334
  197. package/dist/mediaEditor/mediaEditorComponent.js +244 -249
  198. package/dist/mediaEditor/plugins/mediaAlignment/helper.js +28 -33
  199. package/dist/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js +228 -236
  200. package/dist/mediaEditor/plugins/mediaAlignment/style.css +7 -7
  201. package/dist/mediaEditor/plugins/mediaDimension/helper.js +81 -106
  202. package/dist/mediaEditor/plugins/mediaDimension/mediaDimensionComponent.js +597 -635
  203. package/dist/mediaEditor/plugins/mediaDimension/style.css +141 -141
  204. package/dist/mediaplayer/css/player.css +7 -7
  205. package/dist/mediaplayer/css/player.css.map +1 -1
  206. package/dist/mediaplayer/players/html5.js +646 -706
  207. package/dist/mediaplayer/players/youtube.js +393 -438
  208. package/dist/mediaplayer/players.js +19 -19
  209. package/dist/mediaplayer/support.js +66 -79
  210. package/dist/mediaplayer/utils/reminder.js +117 -128
  211. package/dist/mediaplayer/utils/timeObserver.js +106 -109
  212. package/dist/mediaplayer/youtubeManager.js +142 -170
  213. package/dist/mediaplayer.js +1484 -1774
  214. package/dist/mediasizer.js +633 -676
  215. package/dist/modal.js +137 -153
  216. package/dist/movableComponent.js +37 -37
  217. package/dist/pageSizeSelector.js +231 -224
  218. package/dist/pageStatus.js +43 -46
  219. package/dist/pagination/css/pagination.css +7 -7
  220. package/dist/pagination/css/pagination.css.map +1 -1
  221. package/dist/pagination/paginationStrategy.js +24 -25
  222. package/dist/pagination/providers/pages.js +281 -291
  223. package/dist/pagination/providers/simple.js +202 -196
  224. package/dist/pagination.js +49 -72
  225. package/dist/previewer.js +113 -138
  226. package/dist/progressbar.js +70 -80
  227. package/dist/propertySelector/css/propertySelector.css +74 -0
  228. package/dist/propertySelector/css/propertySelector.css.map +1 -0
  229. package/dist/propertySelector/propertySelector.js +489 -0
  230. package/dist/report.js +356 -359
  231. package/dist/resource/css/selector.css +7 -7
  232. package/dist/resource/css/selector.css.map +1 -1
  233. package/dist/resource/filters.js +275 -289
  234. package/dist/resource/list.js +1589 -1371
  235. package/dist/resource/selectable.js +101 -136
  236. package/dist/resource/selector.js +855 -914
  237. package/dist/resource/tree.js +1796 -1612
  238. package/dist/resourcemgr/css/resourcemgr.css +7 -7
  239. package/dist/resourcemgr/css/resourcemgr.css.map +1 -1
  240. package/dist/resourcemgr/fileBrowser.js +540 -587
  241. package/dist/resourcemgr/filePreview.js +16 -25
  242. package/dist/resourcemgr/fileSelector.js +520 -547
  243. package/dist/resourcemgr/util/updatePermissions.js +10 -18
  244. package/dist/resourcemgr.js +325 -332
  245. package/dist/scroller.js +29 -33
  246. package/dist/searchModal/advancedSearch.js +949 -833
  247. package/dist/searchModal/css/advancedSearch.css +7 -14
  248. package/dist/searchModal/css/advancedSearch.css.map +1 -1
  249. package/dist/searchModal/css/searchModal.css +28 -8
  250. package/dist/searchModal/css/searchModal.css.map +1 -1
  251. package/dist/searchModal.js +616 -335
  252. package/dist/selecter.js +21 -28
  253. package/dist/stacker.js +52 -60
  254. package/dist/switch/css/switch.css +7 -7
  255. package/dist/switch/css/switch.css.map +1 -1
  256. package/dist/switch/switch.js +305 -311
  257. package/dist/tableModel.js +39 -49
  258. package/dist/tabs/css/tabs.css +12 -12
  259. package/dist/tabs/css/tabs.css.map +1 -1
  260. package/dist/tabs.js +588 -639
  261. package/dist/taskQueue/css/taskQueue.css +7 -7
  262. package/dist/taskQueue/css/taskQueue.css.map +1 -1
  263. package/dist/taskQueue/status.js +317 -322
  264. package/dist/taskQueue/table.js +383 -394
  265. package/dist/taskQueue/taskQueue.js +19 -19
  266. package/dist/taskQueue/taskQueueModel.js +459 -538
  267. package/dist/taskQueue.js +49 -67
  268. package/dist/taskQueueButton/css/taskable.css +7 -7
  269. package/dist/taskQueueButton/css/taskable.css.map +1 -1
  270. package/dist/taskQueueButton/css/treeButton.css +7 -7
  271. package/dist/taskQueueButton/css/treeButton.css.map +1 -1
  272. package/dist/taskQueueButton/standardButton.js +45 -43
  273. package/dist/taskQueueButton/taskable.js +267 -272
  274. package/dist/taskQueueButton/treeButton.js +200 -198
  275. package/dist/themeLoader.js +109 -129
  276. package/dist/themes.js +86 -100
  277. package/dist/toggler.js +76 -88
  278. package/dist/tooltip.js +296 -311
  279. package/dist/tooltipster.js +17 -17
  280. package/dist/transformer.js +140 -169
  281. package/dist/tristateCheckboxGroup/css/tristateCheckboxGroup.css +7 -7
  282. package/dist/tristateCheckboxGroup/css/tristateCheckboxGroup.css.map +1 -1
  283. package/dist/tristateCheckboxGroup.js +319 -325
  284. package/dist/uploader.js +691 -724
  285. package/dist/validator/Report.js +1 -2
  286. package/dist/validator/Validator.js +6 -25
  287. package/dist/validator/validators.js +66 -80
  288. package/dist/validator.js +218 -254
  289. package/dist/waitForMedia.js +45 -51
  290. package/dist/waitingDialog/css/waitingDialog.css +7 -7
  291. package/dist/waitingDialog/css/waitingDialog.css.map +1 -1
  292. package/dist/waitingDialog/waitingDialog.js +59 -77
  293. package/package.json +109 -107
  294. package/scss/basic.scss +16 -16
  295. package/scss/ckeditor/skins/tao/scss/inc/_ck-icons.scss +59 -59
  296. package/scss/ckeditor/skins/tao/scss/inc/_tao.scss +59 -59
  297. package/scss/font/tao/tao.svg +234 -234
  298. package/scss/inc/_base.scss +495 -495
  299. package/scss/inc/_bootstrap.scss +6 -6
  300. package/scss/inc/_buttons.scss +114 -114
  301. package/scss/inc/_colors.scss +93 -88
  302. package/scss/inc/_feedback.scss +150 -150
  303. package/scss/inc/_flex-grid.scss +15 -15
  304. package/scss/inc/_fonts.scss +4 -4
  305. package/scss/inc/_forms.scss +832 -832
  306. package/scss/inc/_functions.scss +283 -283
  307. package/scss/inc/_jquery.nouislider.scss +254 -254
  308. package/scss/inc/_normalize.scss +528 -528
  309. package/scss/inc/_report.scss +67 -67
  310. package/scss/inc/_secondary-properties.scss +89 -89
  311. package/scss/inc/_select2.scss +634 -634
  312. package/scss/inc/_toolbars.scss +155 -155
  313. package/scss/inc/_tooltip.scss +312 -312
  314. package/scss/inc/_variables.scss +21 -21
  315. package/scss/inc/base/_highlight.scss +5 -5
  316. package/scss/inc/base/_list-style.scss +58 -58
  317. package/scss/inc/base/_svg.scss +3 -3
  318. package/scss/inc/base/_table.scss +62 -62
  319. package/scss/inc/fonts/_source-sans-pro.scss +29 -29
  320. package/scss/inc/fonts/_tao-icon-classes.scss +226 -226
  321. package/scss/inc/fonts/_tao-icon-def.scss +12 -12
  322. package/scss/inc/fonts/_tao-icon-vars.scss +240 -240
  323. package/src/actionbar/tpl/main.tpl +8 -8
  324. package/src/actionbar.js +251 -251
  325. package/src/adder.js +250 -250
  326. package/src/animable/absorbable/absorbable.js +134 -134
  327. package/src/animable/absorbable/css/absorb.css +7 -8
  328. package/src/animable/absorbable/css/absorb.css.map +1 -1
  329. package/src/animable/absorbable/scss/absorb.scss +37 -37
  330. package/src/animable/pulsable/css/pulse.css +7 -7
  331. package/src/animable/pulsable/css/pulse.css.map +1 -1
  332. package/src/animable/pulsable/pulsable.js +90 -90
  333. package/src/animable/pulsable/scss/pulse.scss +22 -22
  334. package/src/areaBroker.js +160 -160
  335. package/src/autocomplete/css/autocomplete.css +7 -8
  336. package/src/autocomplete/css/autocomplete.css.map +1 -1
  337. package/src/autocomplete/scss/autocomplete.scss +37 -37
  338. package/src/autocomplete.js +1029 -1029
  339. package/src/autoscroll.js +57 -57
  340. package/src/badge/badge.js +119 -119
  341. package/src/badge/css/badge.css +7 -8
  342. package/src/badge/css/badge.css.map +1 -1
  343. package/src/badge/scss/badge.scss +92 -92
  344. package/src/badge/tpl/badge.tpl +4 -4
  345. package/src/breadcrumbs/css/breadcrumbs.css +7 -7
  346. package/src/breadcrumbs/css/breadcrumbs.css.map +1 -1
  347. package/src/breadcrumbs/scss/breadcrumbs.scss +52 -52
  348. package/src/breadcrumbs/tpl/breadcrumbs.tpl +20 -20
  349. package/src/breadcrumbs.js +99 -99
  350. package/src/btngrouper.js +213 -213
  351. package/src/bulkActionPopup/css/bulkActionPopup.css +7 -7
  352. package/src/bulkActionPopup/css/bulkActionPopup.css.map +1 -1
  353. package/src/bulkActionPopup/scss/bulkActionPopup.scss +63 -63
  354. package/src/bulkActionPopup/tpl/layout.tpl +76 -76
  355. package/src/bulkActionPopup/tpl/select.tpl +8 -8
  356. package/src/bulkActionPopup.js +274 -274
  357. package/src/button/tpl/button.tpl +4 -4
  358. package/src/button.js +135 -135
  359. package/src/calculator/css/calculator.css +10 -10
  360. package/src/calculator/css/calculator.css.map +1 -1
  361. package/src/calculator/scss/calculator.scss +139 -139
  362. package/src/calculator.js +188 -188
  363. package/src/cascadingComboBox.js +126 -126
  364. package/src/ckeditor/ckConfigurator.js +736 -736
  365. package/src/ckeditor/dtdHandler.js +1030 -1030
  366. package/src/class/css/selector.css +7 -7
  367. package/src/class/css/selector.css.map +1 -1
  368. package/src/class/scss/selector.scss +101 -101
  369. package/src/class/selector.js +329 -329
  370. package/src/class/tpl/listItem.tpl +9 -9
  371. package/src/class/tpl/selector.tpl +10 -10
  372. package/src/component/alignable.js +274 -274
  373. package/src/component/containable.js +122 -122
  374. package/src/component/css/components.css +7 -7
  375. package/src/component/css/components.css.map +1 -1
  376. package/src/component/css/windowComponent.css +7 -7
  377. package/src/component/css/windowComponent.css.map +1 -1
  378. package/src/component/draggable.js +104 -104
  379. package/src/component/placeable.js +233 -233
  380. package/src/component/resizable.js +195 -195
  381. package/src/component/scss/components.scss +507 -507
  382. package/src/component/scss/windowComponent.scss +62 -62
  383. package/src/component/stackable.js +67 -67
  384. package/src/component/tpl/window.tpl +7 -7
  385. package/src/component/windowed.js +206 -206
  386. package/src/component.js +401 -401
  387. package/src/container.js +200 -200
  388. package/src/contextualPopup/css/contextualPopup.css +7 -7
  389. package/src/contextualPopup/css/contextualPopup.css.map +1 -1
  390. package/src/contextualPopup/scss/contextualPopup.scss +78 -78
  391. package/src/contextualPopup/tpl/popup.tpl +10 -10
  392. package/src/contextualPopup.js +297 -297
  393. package/src/css/basic.css +103 -106
  394. package/src/css/basic.css.map +1 -1
  395. package/src/dashboard/css/dashboard.css +7 -7
  396. package/src/dashboard/css/dashboard.css.map +1 -1
  397. package/src/dashboard/scss/dashboard.scss +93 -93
  398. package/src/dashboard/tpl/dashboard.tpl +16 -16
  399. package/src/dashboard/tpl/dashboardMetricsList.tpl +15 -15
  400. package/src/dashboard.js +184 -184
  401. package/src/datalist/css/datalist.css +7 -7
  402. package/src/datalist/css/datalist.css.map +1 -1
  403. package/src/datalist/scss/datalist.scss +116 -116
  404. package/src/datalist/tpl/list.tpl +24 -24
  405. package/src/datalist/tpl/main.tpl +44 -44
  406. package/src/datalist.js +500 -500
  407. package/src/datatable/css/datatable.css +11 -7
  408. package/src/datatable/css/datatable.css.map +1 -1
  409. package/src/datatable/filterStrategy/filterStrategy.js +70 -70
  410. package/src/datatable/filterStrategy/multiple.js +126 -126
  411. package/src/datatable/filterStrategy/single.js +108 -108
  412. package/src/datatable/scss/datatable.scss +149 -146
  413. package/src/datatable/tpl/button.tpl +6 -6
  414. package/src/datatable/tpl/layout.tpl +158 -158
  415. package/src/datatable.js +1056 -1056
  416. package/src/dateRange/css/dateRange.css +7 -7
  417. package/src/dateRange/css/dateRange.css.map +1 -1
  418. package/src/dateRange/dateRange.js +341 -341
  419. package/src/dateRange/scss/dateRange.scss +7 -7
  420. package/src/dateRange/tpl/select.tpl +18 -18
  421. package/src/datetime/css/picker.css +7 -7
  422. package/src/datetime/css/picker.css.map +1 -1
  423. package/src/datetime/picker.js +576 -576
  424. package/src/datetime/scss/picker.scss +192 -192
  425. package/src/datetime/tpl/picker.tpl +18 -18
  426. package/src/deleter/undo.tpl +6 -6
  427. package/src/deleter.js +296 -296
  428. package/src/destination/css/selector.css +7 -7
  429. package/src/destination/css/selector.css.map +1 -1
  430. package/src/destination/scss/selector.scss +36 -36
  431. package/src/destination/selector.js +195 -195
  432. package/src/destination/tpl/selector.tpl +13 -13
  433. package/src/dialog/alert.js +70 -70
  434. package/src/dialog/confirm.js +85 -85
  435. package/src/dialog/confirmDelete.js +95 -95
  436. package/src/dialog/tpl/body.tpl +24 -24
  437. package/src/dialog/tpl/buttons.tpl +6 -6
  438. package/src/dialog/tpl/checkbox.tpl +5 -5
  439. package/src/dialog.js +517 -517
  440. package/src/disabler.js +230 -230
  441. package/src/documentViewer/css/documentViewer.css +7 -7
  442. package/src/documentViewer/css/documentViewer.css.map +1 -1
  443. package/src/documentViewer/providers/pdfViewer/fallback/viewer.js +69 -69
  444. package/src/documentViewer/providers/pdfViewer/pdfjs/areaBroker.js +41 -41
  445. package/src/documentViewer/providers/pdfViewer/pdfjs/findBar.js +475 -475
  446. package/src/documentViewer/providers/pdfViewer/pdfjs/findBar.tpl +20 -20
  447. package/src/documentViewer/providers/pdfViewer/pdfjs/match.tpl +1 -1
  448. package/src/documentViewer/providers/pdfViewer/pdfjs/page.tpl +4 -4
  449. package/src/documentViewer/providers/pdfViewer/pdfjs/pageView.js +318 -318
  450. package/src/documentViewer/providers/pdfViewer/pdfjs/pagesManager.js +167 -167
  451. package/src/documentViewer/providers/pdfViewer/pdfjs/searchEngine.js +451 -451
  452. package/src/documentViewer/providers/pdfViewer/pdfjs/textManager.js +252 -252
  453. package/src/documentViewer/providers/pdfViewer/pdfjs/viewer.js +299 -299
  454. package/src/documentViewer/providers/pdfViewer/pdfjs/viewer.tpl +16 -16
  455. package/src/documentViewer/providers/pdfViewer/pdfjs/wrapper.js +351 -351
  456. package/src/documentViewer/providers/pdfViewer.js +93 -93
  457. package/src/documentViewer/scss/documentViewer.scss +184 -184
  458. package/src/documentViewer/viewerFactory.js +191 -191
  459. package/src/documentViewer.js +238 -238
  460. package/src/dropdown/css/dropdown.css +7 -7
  461. package/src/dropdown/css/dropdown.css.map +1 -1
  462. package/src/dropdown/scss/dropdown.scss +99 -99
  463. package/src/dropdown/tpl/dropdown.tpl +8 -8
  464. package/src/dropdown/tpl/list-item.tpl +4 -4
  465. package/src/dropdown.js +255 -255
  466. package/src/durationer.js +222 -222
  467. package/src/dynamicComponent/css/dynamicComponent.css +7 -7
  468. package/src/dynamicComponent/css/dynamicComponent.css.map +1 -1
  469. package/src/dynamicComponent/scss/dynamicComponent.scss +98 -98
  470. package/src/dynamicComponent/tpl/layout.tpl +17 -17
  471. package/src/dynamicComponent.js +554 -554
  472. package/src/feedback/feedback.tpl +7 -7
  473. package/src/feedback.js +295 -295
  474. package/src/figure/FigureStateActive.js +174 -174
  475. package/src/filesender.js +114 -114
  476. package/src/filter/template.tpl +5 -5
  477. package/src/filter.js +135 -135
  478. package/src/form/css/dropdownForm.css +7 -7
  479. package/src/form/css/dropdownForm.css.map +1 -1
  480. package/src/form/css/form.css +7 -7
  481. package/src/form/css/form.css.map +1 -1
  482. package/src/form/dropdownForm.js +281 -281
  483. package/src/form/form.js +688 -688
  484. package/src/form/scss/dropdownForm.scss +60 -60
  485. package/src/form/scss/form.scss +25 -25
  486. package/src/form/simpleForm.js +125 -125
  487. package/src/form/tpl/dropdownForm.tpl +4 -4
  488. package/src/form/tpl/form.tpl +7 -7
  489. package/src/form/validator/css/validator.css +7 -7
  490. package/src/form/validator/css/validator.css.map +1 -1
  491. package/src/form/validator/renderer.js +118 -118
  492. package/src/form/validator/scss/validator.scss +14 -14
  493. package/src/form/validator/tpl/message.tpl +1 -1
  494. package/src/form/validator/tpl/validator.tpl +1 -1
  495. package/src/form/validator/validator.js +220 -220
  496. package/src/form/widget/css/widget.css +7 -7
  497. package/src/form/widget/css/widget.css.map +1 -1
  498. package/src/form/widget/definitions.js +51 -51
  499. package/src/form/widget/loader.js +40 -40
  500. package/src/form/widget/providers/checkBox.js +138 -138
  501. package/src/form/widget/providers/comboBox.js +63 -63
  502. package/src/form/widget/providers/default.js +90 -90
  503. package/src/form/widget/providers/hidden.js +62 -62
  504. package/src/form/widget/providers/hiddenBox.js +152 -152
  505. package/src/form/widget/providers/radioBox.js +99 -99
  506. package/src/form/widget/providers/textArea.js +52 -52
  507. package/src/form/widget/providers/textBox.js +48 -48
  508. package/src/form/widget/scss/widget.scss +55 -55
  509. package/src/form/widget/tpl/checkBox.tpl +25 -25
  510. package/src/form/widget/tpl/comboBox.tpl +13 -13
  511. package/src/form/widget/tpl/hidden.tpl +1 -1
  512. package/src/form/widget/tpl/hiddenBox.tpl +17 -17
  513. package/src/form/widget/tpl/label.tpl +6 -6
  514. package/src/form/widget/tpl/radioBox.tpl +25 -25
  515. package/src/form/widget/tpl/textArea.tpl +8 -8
  516. package/src/form/widget/tpl/widget.tpl +8 -8
  517. package/src/form/widget/widget.js +372 -372
  518. package/src/form.js +53 -53
  519. package/src/formValidator/formValidator.js +253 -253
  520. package/src/formValidator/highlighters/highlighter.js +102 -102
  521. package/src/formValidator/highlighters/message.js +70 -70
  522. package/src/formValidator/highlighters/tooltip.js +78 -78
  523. package/src/generis/form/css/form.css +7 -7
  524. package/src/generis/form/css/form.css.map +1 -1
  525. package/src/generis/form/form.js +239 -239
  526. package/src/generis/form/readme.md +70 -70
  527. package/src/generis/form/scss/form.scss +23 -23
  528. package/src/generis/form/tpl/form.tpl +16 -16
  529. package/src/generis/validator/css/validator.css +7 -7
  530. package/src/generis/validator/css/validator.css.map +1 -1
  531. package/src/generis/validator/readme.md +46 -46
  532. package/src/generis/validator/scss/validator.scss +13 -13
  533. package/src/generis/validator/validator.js +128 -128
  534. package/src/generis/widget/checkBox/checkBox.js +112 -112
  535. package/src/generis/widget/checkBox/checkBox.tpl +18 -18
  536. package/src/generis/widget/comboBox/comboBox.js +67 -67
  537. package/src/generis/widget/comboBox/comboBox.tpl +12 -12
  538. package/src/generis/widget/css/widget.css +7 -7
  539. package/src/generis/widget/css/widget.css.map +1 -1
  540. package/src/generis/widget/hiddenBox/hiddenBox.js +132 -132
  541. package/src/generis/widget/hiddenBox/hiddenBox.tpl +16 -16
  542. package/src/generis/widget/loader.js +49 -49
  543. package/src/generis/widget/readme.md +59 -59
  544. package/src/generis/widget/scss/widget.scss +61 -61
  545. package/src/generis/widget/textBox/textBox.js +65 -65
  546. package/src/generis/widget/textBox/textBox.tpl +7 -7
  547. package/src/generis/widget/widget.js +164 -164
  548. package/src/generis/widget/widget.tpl +5 -5
  549. package/src/groupedComboBox.js +99 -99
  550. package/src/groupvalidator.js +84 -84
  551. package/src/hider.js +88 -88
  552. package/src/highlighter.js +1166 -1166
  553. package/src/image/ImgStateActive/extractLabel.js +29 -29
  554. package/src/image/ImgStateActive/helper.js +36 -36
  555. package/src/image/ImgStateActive/initHelper.js +137 -137
  556. package/src/image/ImgStateActive/initMediaEditor.js +92 -92
  557. package/src/image/ImgStateActive/mediaSizer.js +63 -63
  558. package/src/image/ImgStateActive.js +115 -115
  559. package/src/incrementer.js +319 -319
  560. package/src/inplacer.js +316 -316
  561. package/src/interactUtils.js +140 -140
  562. package/src/itemButtonList/css/item-button-list.css +23 -24
  563. package/src/itemButtonList/css/item-button-list.css.map +1 -1
  564. package/src/itemButtonList/scss/item-button-list.scss +236 -236
  565. package/src/itemButtonList/tpl/itemButtonList.tpl +21 -21
  566. package/src/itemButtonList.js +274 -274
  567. package/src/keyNavigation/navigableDomElement.js +282 -282
  568. package/src/keyNavigation/navigator.js +543 -543
  569. package/src/listbox/css/listbox.css +7 -7
  570. package/src/listbox/css/listbox.css.map +1 -1
  571. package/src/listbox/scss/listbox.scss +116 -116
  572. package/src/listbox/tpl/list.tpl +14 -14
  573. package/src/listbox/tpl/main.tpl +9 -9
  574. package/src/listbox.js +251 -251
  575. package/src/liststyler.js +155 -155
  576. package/src/loadingButton/css/button.css +7 -7
  577. package/src/loadingButton/css/button.css.map +1 -1
  578. package/src/loadingButton/loadingButton.js +110 -110
  579. package/src/loadingButton/scss/button.scss +41 -41
  580. package/src/loadingButton/tpl/button.tpl +5 -5
  581. package/src/lock/lock.tpl +16 -16
  582. package/src/lock.js +395 -395
  583. package/src/login/login.js +322 -322
  584. package/src/login/tpl/login.tpl +29 -29
  585. package/src/login/tpl/passwordReveal.tpl +7 -7
  586. package/src/maths/calculator/basicCalculator.js +55 -55
  587. package/src/maths/calculator/calculatorComponent.js +128 -128
  588. package/src/maths/calculator/core/areaBroker.js +38 -38
  589. package/src/maths/calculator/core/board.js +841 -841
  590. package/src/maths/calculator/core/expression.js +430 -430
  591. package/src/maths/calculator/core/labels.js +116 -116
  592. package/src/maths/calculator/core/plugin.js +40 -40
  593. package/src/maths/calculator/core/terms.js +459 -459
  594. package/src/maths/calculator/core/tokenizer.js +245 -245
  595. package/src/maths/calculator/core/tokens.js +178 -178
  596. package/src/maths/calculator/core/tpl/board.tpl +4 -4
  597. package/src/maths/calculator/css/calculator.css +7 -7
  598. package/src/maths/calculator/css/calculator.css.map +1 -1
  599. package/src/maths/calculator/defaultCalculator.js +66 -66
  600. package/src/maths/calculator/plugins/core/degrad.js +90 -90
  601. package/src/maths/calculator/plugins/core/history.js +166 -166
  602. package/src/maths/calculator/plugins/core/remind.js +96 -96
  603. package/src/maths/calculator/plugins/core/stepNavigation.js +175 -175
  604. package/src/maths/calculator/plugins/keyboard/templateKeyboard/defaultTemplate.tpl +36 -36
  605. package/src/maths/calculator/plugins/keyboard/templateKeyboard/templateKeyboard.js +91 -91
  606. package/src/maths/calculator/plugins/modifiers/pow10.js +143 -143
  607. package/src/maths/calculator/plugins/modifiers/sign.js +339 -339
  608. package/src/maths/calculator/plugins/screen/simpleScreen/defaultTemplate.tpl +3 -3
  609. package/src/maths/calculator/plugins/screen/simpleScreen/history.tpl +3 -3
  610. package/src/maths/calculator/plugins/screen/simpleScreen/simpleScreen.js +191 -191
  611. package/src/maths/calculator/pluginsLoader.js +46 -46
  612. package/src/maths/calculator/scientificCalculator.js +74 -74
  613. package/src/maths/calculator/scss/calculator.scss +396 -396
  614. package/src/maths/calculator/tpl/basicKeyboard.tpl +37 -37
  615. package/src/maths/calculator/tpl/basicScreen.tpl +2 -2
  616. package/src/maths/calculator/tpl/scientificKeyboard.tpl +61 -61
  617. package/src/maths/calculator/tpl/scientificScreen.tpl +3 -3
  618. package/src/mediaEditor/mediaEditorComponent.js +141 -141
  619. package/src/mediaEditor/plugins/mediaAlignment/helper.js +62 -62
  620. package/src/mediaEditor/plugins/mediaAlignment/mediaAlignmentComponent.js +99 -99
  621. package/src/mediaEditor/plugins/mediaAlignment/style.css +7 -7
  622. package/src/mediaEditor/plugins/mediaAlignment/tpl/mediaAlignment.tpl +25 -25
  623. package/src/mediaEditor/plugins/mediaDimension/helper.js +189 -189
  624. package/src/mediaEditor/plugins/mediaDimension/mediaDimensionComponent.js +561 -561
  625. package/src/mediaEditor/plugins/mediaDimension/style.css +141 -141
  626. package/src/mediaEditor/plugins/mediaDimension/tpl/mediaDimension.tpl +55 -55
  627. package/src/mediaEditor/tpl/editor.tpl +4 -4
  628. package/src/mediaplayer/css/player.css +7 -7
  629. package/src/mediaplayer/css/player.css.map +1 -1
  630. package/src/mediaplayer/players/html5.js +564 -564
  631. package/src/mediaplayer/players/youtube.js +323 -323
  632. package/src/mediaplayer/players.js +29 -29
  633. package/src/mediaplayer/readme.md +305 -305
  634. package/src/mediaplayer/scss/player.scss +569 -569
  635. package/src/mediaplayer/support.js +126 -126
  636. package/src/mediaplayer/tpl/audio.tpl +6 -6
  637. package/src/mediaplayer/tpl/player.tpl +37 -37
  638. package/src/mediaplayer/tpl/source.tpl +1 -1
  639. package/src/mediaplayer/tpl/video.tpl +6 -6
  640. package/src/mediaplayer/tpl/youtube.tpl +1 -1
  641. package/src/mediaplayer/utils/reminder.js +184 -184
  642. package/src/mediaplayer/utils/timeObserver.js +143 -143
  643. package/src/mediaplayer/youtubeManager.js +161 -161
  644. package/src/mediaplayer.js +1606 -1606
  645. package/src/mediasizer/mediasizer.tpl +55 -55
  646. package/src/mediasizer.js +635 -635
  647. package/src/modal.js +365 -365
  648. package/src/movableComponent.js +78 -78
  649. package/src/pageSizeSelector/tpl/pageSizeSelector.tpl +9 -9
  650. package/src/pageSizeSelector.js +107 -107
  651. package/src/pageStatus.js +147 -147
  652. package/src/pagination/css/pagination.css +7 -7
  653. package/src/pagination/css/pagination.css.map +1 -1
  654. package/src/pagination/paginationStrategy.js +53 -53
  655. package/src/pagination/providers/pages.js +161 -161
  656. package/src/pagination/providers/simple.js +74 -74
  657. package/src/pagination/providers/tpl/pages/page.tpl +1 -1
  658. package/src/pagination/providers/tpl/pages.tpl +8 -8
  659. package/src/pagination/providers/tpl/simple.tpl +7 -7
  660. package/src/pagination/scss/pagination.scss +111 -111
  661. package/src/pagination.js +237 -237
  662. package/src/previewer.js +300 -300
  663. package/src/progressbar.js +165 -165
  664. package/src/propertySelector/css/propertySelector.css +74 -0
  665. package/src/propertySelector/css/propertySelector.css.map +1 -0
  666. package/src/propertySelector/propertySelector.js +286 -0
  667. package/src/propertySelector/scss/propertySelector.scss +66 -0
  668. package/src/propertySelector/tpl/highlighted-text.tpl +1 -0
  669. package/src/propertySelector/tpl/property-description.tpl +13 -0
  670. package/src/propertySelector/tpl/property-selector.tpl +7 -0
  671. package/src/report/feedback.tpl +11 -11
  672. package/src/report/layout.tpl +10 -10
  673. package/src/report.js +184 -184
  674. package/src/resource/css/selector.css +7 -7
  675. package/src/resource/css/selector.css.map +1 -1
  676. package/src/resource/filters.js +208 -208
  677. package/src/resource/list.js +200 -200
  678. package/src/resource/scss/_filters.scss +26 -26
  679. package/src/resource/scss/_resource-list.scss +107 -107
  680. package/src/resource/scss/_resource-tree.scss +205 -205
  681. package/src/resource/scss/selector.scss +187 -187
  682. package/src/resource/selectable.js +322 -322
  683. package/src/resource/selector.js +871 -871
  684. package/src/resource/tpl/filters.tpl +2 -2
  685. package/src/resource/tpl/list.tpl +7 -7
  686. package/src/resource/tpl/listNode.tpl +4 -4
  687. package/src/resource/tpl/selector.tpl +46 -46
  688. package/src/resource/tpl/tree.tpl +4 -4
  689. package/src/resource/tpl/treeNode.tpl +30 -30
  690. package/src/resource/tree.js +400 -400
  691. package/src/resourcemgr/css/resourcemgr.css +7 -7
  692. package/src/resourcemgr/css/resourcemgr.css.map +1 -1
  693. package/src/resourcemgr/fileBrowser.js +381 -381
  694. package/src/resourcemgr/filePreview.js +73 -73
  695. package/src/resourcemgr/fileSelector.js +348 -348
  696. package/src/resourcemgr/scss/resourcemgr.scss +254 -254
  697. package/src/resourcemgr/tpl/fileSelect.tpl +39 -39
  698. package/src/resourcemgr/tpl/folder.tpl +11 -11
  699. package/src/resourcemgr/tpl/layout.tpl +84 -84
  700. package/src/resourcemgr/tpl/rootFolder.tpl +13 -13
  701. package/src/resourcemgr/util/updatePermissions.js +53 -53
  702. package/src/resourcemgr.js +216 -216
  703. package/src/scroller.js +94 -94
  704. package/src/scss/basic.scss +16 -16
  705. package/src/searchModal/advancedSearch.js +638 -601
  706. package/src/searchModal/css/advancedSearch.css +7 -14
  707. package/src/searchModal/css/advancedSearch.css.map +1 -1
  708. package/src/searchModal/css/searchModal.css +28 -8
  709. package/src/searchModal/css/searchModal.css.map +1 -1
  710. package/src/searchModal/scss/advancedSearch.scss +171 -177
  711. package/src/searchModal/scss/searchModal.scss +393 -375
  712. package/src/searchModal/tpl/advanced-search.tpl +9 -9
  713. package/src/searchModal/tpl/criteria-alias.tpl +1 -0
  714. package/src/searchModal/tpl/criteria-class-label.tpl +1 -0
  715. package/src/searchModal/tpl/criteria-label.tpl +1 -0
  716. package/src/searchModal/tpl/highlighted-text.tpl +1 -0
  717. package/src/searchModal/tpl/info-message.tpl +3 -3
  718. package/src/searchModal/tpl/invalid-criteria-warning.tpl +10 -10
  719. package/src/searchModal/tpl/layout.tpl +27 -25
  720. package/src/searchModal/tpl/list-checkbox-criterion.tpl +17 -12
  721. package/src/searchModal/tpl/list-select-criterion.tpl +12 -6
  722. package/src/searchModal/tpl/property-select-button.tpl +1 -0
  723. package/src/searchModal/tpl/results-container.tpl +1 -0
  724. package/src/searchModal/tpl/text-criterion.tpl +11 -6
  725. package/src/searchModal.js +761 -496
  726. package/src/selecter.js +43 -43
  727. package/src/stacker.js +133 -133
  728. package/src/switch/css/switch.css +7 -7
  729. package/src/switch/css/switch.css.map +1 -1
  730. package/src/switch/scss/switch.scss +83 -83
  731. package/src/switch/switch.js +195 -195
  732. package/src/switch/tpl/switch.tpl +7 -7
  733. package/src/tableModel.js +112 -112
  734. package/src/tabs/css/tabs.css +12 -12
  735. package/src/tabs/css/tabs.css.map +1 -1
  736. package/src/tabs/scss/tabs.scss +50 -50
  737. package/src/tabs/tpl/panel.tpl +3 -3
  738. package/src/tabs/tpl/tabs.tpl +10 -10
  739. package/src/tabs.js +528 -528
  740. package/src/taskQueue/css/taskQueue.css +7 -7
  741. package/src/taskQueue/css/taskQueue.css.map +1 -1
  742. package/src/taskQueue/scss/taskQueue.scss +47 -47
  743. package/src/taskQueue/status.js +228 -228
  744. package/src/taskQueue/table.js +350 -350
  745. package/src/taskQueue/taskQueue.js +33 -33
  746. package/src/taskQueue/taskQueueModel.js +548 -548
  747. package/src/taskQueue/tpl/statusMessage.tpl +7 -7
  748. package/src/taskQueue.js +218 -218
  749. package/src/taskQueueButton/css/taskable.css +7 -7
  750. package/src/taskQueueButton/css/taskable.css.map +1 -1
  751. package/src/taskQueueButton/css/treeButton.css +7 -7
  752. package/src/taskQueueButton/css/treeButton.css.map +1 -1
  753. package/src/taskQueueButton/scss/taskable.scss +4 -4
  754. package/src/taskQueueButton/scss/treeButton.scss +34 -34
  755. package/src/taskQueueButton/standardButton.js +108 -108
  756. package/src/taskQueueButton/taskable.js +202 -202
  757. package/src/taskQueueButton/tpl/report.tpl +5 -5
  758. package/src/taskQueueButton/tpl/treeButton.tpl +6 -6
  759. package/src/taskQueueButton/treeButton.js +109 -109
  760. package/src/themeLoader.js +252 -252
  761. package/src/themes.js +162 -162
  762. package/src/toggler.js +200 -200
  763. package/src/tooltip/default.tpl +3 -3
  764. package/src/tooltip.js +160 -160
  765. package/src/tooltipster.js +25 -25
  766. package/src/transformer.js +327 -327
  767. package/src/tristateCheckboxGroup/css/tristateCheckboxGroup.css +7 -7
  768. package/src/tristateCheckboxGroup/css/tristateCheckboxGroup.css.map +1 -1
  769. package/src/tristateCheckboxGroup/scss/tristateCheckboxGroup.scss +15 -15
  770. package/src/tristateCheckboxGroup/tpl/li.tpl +6 -6
  771. package/src/tristateCheckboxGroup.js +207 -207
  772. package/src/uploader/fileEntry.tpl +6 -6
  773. package/src/uploader/uploader.tpl +32 -32
  774. package/src/uploader.js +594 -594
  775. package/src/validator/Report.js +10 -10
  776. package/src/validator/Validator.js +108 -108
  777. package/src/validator/validators.js +220 -220
  778. package/src/validator.js +264 -264
  779. package/src/waitForMedia.js +82 -82
  780. package/src/waitingDialog/css/waitingDialog.css +7 -7
  781. package/src/waitingDialog/css/waitingDialog.css.map +1 -1
  782. package/src/waitingDialog/scss/waitingDialog.scss +34 -34
  783. package/src/waitingDialog/waitingDialog.js +240 -240
@@ -1,936 +1,1052 @@
1
- define(['jquery', 'lodash', 'handlebars', 'i18n', 'lib/dompurify/purify', 'css!ui/searchModal/css/advancedSearch.css', 'ui/component', 'ui/modal', 'ui/datatable', 'select2', 'util/url', 'core/dataProvider/request'], function ($$1, _, Handlebars, __, DOMPurify, advancedSearch_css, component, modal, datatable, select2, urlUtil, request) { 'use strict';
2
-
3
- $$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
4
- _ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
5
- Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
6
- __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
7
- DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
8
- component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
9
- urlUtil = urlUtil && Object.prototype.hasOwnProperty.call(urlUtil, 'default') ? urlUtil['default'] : urlUtil;
10
- request = request && Object.prototype.hasOwnProperty.call(request, 'default') ? request['default'] : request;
11
-
12
- function _typeof(obj) {
13
- "@babel/helpers - typeof";
14
-
15
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
16
- return typeof obj;
17
- } : function (obj) {
18
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
19
- }, _typeof(obj);
20
- }
21
-
22
- function _toConsumableArray(arr) {
23
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
24
- }
25
-
26
- function _arrayWithoutHoles(arr) {
27
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
28
- }
29
-
30
- function _iterableToArray(iter) {
31
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
32
- }
33
-
34
- function _unsupportedIterableToArray(o, minLen) {
35
- if (!o) return;
36
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
37
- var n = Object.prototype.toString.call(o).slice(8, -1);
38
- if (n === "Object" && o.constructor) n = o.constructor.name;
39
- if (n === "Map" || n === "Set") return Array.from(o);
40
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
41
- }
42
-
43
- function _arrayLikeToArray(arr, len) {
44
- if (len == null || len > arr.length) len = arr.length;
45
-
46
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
47
-
48
- return arr2;
49
- }
50
-
51
- function _nonIterableSpread() {
52
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
53
- }
54
-
55
- function Helpers0 (hb) {
56
- //register a i18n helper
57
- hb.registerHelper('__', function (key) {
58
- return __(key);
59
- });
60
- /**
61
- * Register dompurify helper
62
- *
63
- * https://github.com/cure53/DOMPurify
64
- * with config SAFE_FOR_TEMPLATES: true
65
- * to make output safe for template systems
1
+ define(['jquery', 'lodash', 'handlebars', 'i18n', 'lib/dompurify/purify', 'css!ui/searchModal/css/advancedSearch.css', 'ui/component', 'ui/modal', 'ui/datatable', 'select2', 'core/dataProvider/request'], function ($$1, _, Handlebars, __, DOMPurify, advancedSearch_css, component, modal, datatable, select2, request) { 'use strict';
2
+
3
+ $$1 = $$1 && Object.prototype.hasOwnProperty.call($$1, 'default') ? $$1['default'] : $$1;
4
+ _ = _ && Object.prototype.hasOwnProperty.call(_, 'default') ? _['default'] : _;
5
+ Handlebars = Handlebars && Object.prototype.hasOwnProperty.call(Handlebars, 'default') ? Handlebars['default'] : Handlebars;
6
+ __ = __ && Object.prototype.hasOwnProperty.call(__, 'default') ? __['default'] : __;
7
+ DOMPurify = DOMPurify && Object.prototype.hasOwnProperty.call(DOMPurify, 'default') ? DOMPurify['default'] : DOMPurify;
8
+ component = component && Object.prototype.hasOwnProperty.call(component, 'default') ? component['default'] : component;
9
+ request = request && Object.prototype.hasOwnProperty.call(request, 'default') ? request['default'] : request;
10
+
11
+ /**
12
+ * This program is free software; you can redistribute it and/or
13
+ * modify it under the terms of the GNU General Public License
14
+ * as published by the Free Software Foundation; under version 2
15
+ * of the License (non-upgradable).
16
+ *
17
+ * This program is distributed in the hope that it will be useful,
18
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ * GNU General Public License for more details.
21
+ *
22
+ * You should have received a copy of the GNU General Public License
23
+ * along with this program; if not, write to the Free Software
24
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
+ *
26
+ * Copyright (c) 2013-2019 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
27
+ *
28
+ *
66
29
  */
30
+ function Helpers0 (hb) {
31
+ //register a i18n helper
32
+ hb.registerHelper('__', function (key) {
33
+ return __(key);
34
+ });
67
35
 
68
- hb.registerHelper('dompurify', function (context) {
69
- return DOMPurify.sanitize(context);
70
- });
71
- /**
72
- * Register join helper
73
- *
74
- * Example :
75
- * var values = {a:v1, b:v2, c:v3};
76
- * Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
77
- * Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
78
- */
79
-
80
- hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
81
- var fragments = [];
82
- keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
83
- fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
84
- wrapper = typeof wrapper === 'string' ? wrapper : '"';
85
-
86
- _.forIn(arr, function (value, key) {
87
- var fragment = '';
36
+ /**
37
+ * Register dompurify helper
38
+ *
39
+ * https://github.com/cure53/DOMPurify
40
+ * with config SAFE_FOR_TEMPLATES: true
41
+ * to make output safe for template systems
42
+ */
43
+ hb.registerHelper('dompurify', function (context) {
44
+ return DOMPurify.sanitize(context);
45
+ });
88
46
 
89
- if (value !== null || value !== undefined) {
90
- if (typeof value === 'boolean') {
91
- value = value ? 'true' : 'false';
92
- } else if (_typeof(value) === 'object') {
93
- value = _.values(value).join(' ');
47
+ /**
48
+ * Register join helper
49
+ *
50
+ * Example :
51
+ * var values = {a:v1, b:v2, c:v3};
52
+ * Using {{{join attributes '=' ' ' '"'}}} will return : a="v1" b="v2" c="v3"
53
+ * Using {{{join values null ' or ' '*'}}} will return : *v1* or *v2* or *v3*
54
+ */
55
+ hb.registerHelper('join', function (arr, keyValueGlue, fragmentGlue, wrapper) {
56
+ var fragments = [];
57
+ keyValueGlue = typeof keyValueGlue === 'string' ? keyValueGlue : undefined;
58
+ fragmentGlue = typeof fragmentGlue === 'string' ? fragmentGlue : ' ';
59
+ wrapper = typeof wrapper === 'string' ? wrapper : '"';
60
+ _.forIn(arr, function (value, key) {
61
+ var fragment = '';
62
+ if (value !== null || value !== undefined) {
63
+ if (typeof value === 'boolean') {
64
+ value = value ? 'true' : 'false';
65
+ } else if (typeof value === 'object') {
66
+ value = _.values(value).join(' ');
67
+ }
68
+ } else {
69
+ value = '';
94
70
  }
71
+ if (keyValueGlue !== undefined) {
72
+ fragment += key + keyValueGlue;
73
+ }
74
+ fragment += wrapper + value + wrapper;
75
+ fragments.push(fragment);
76
+ });
77
+ return fragments.join(fragmentGlue);
78
+ });
79
+
80
+ //register a classic "for loop" helper
81
+ //it also adds a local variable "i" as the index in each iteration loop
82
+ hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
83
+ var ret = '';
84
+ startIndex = parseInt(startIndex);
85
+ stopIndex = parseInt(stopIndex);
86
+ increment = parseInt(increment);
87
+ for (var i = startIndex; i < stopIndex; i += increment) {
88
+ ret += options.fn(_.extend({}, this, {
89
+ i: i
90
+ }));
91
+ }
92
+ return ret;
93
+ });
94
+ hb.registerHelper('equal', function (var1, var2, options) {
95
+ if (var1 == var2) {
96
+ return options.fn(this);
95
97
  } else {
96
- value = '';
98
+ return options.inverse(this);
97
99
  }
100
+ });
98
101
 
99
- if (keyValueGlue !== undefined) {
100
- fragment += key + keyValueGlue;
101
- }
102
+ // register a "get property" helper
103
+ // it gets the named property from the provided context
104
+ hb.registerHelper('property', function (name, context) {
105
+ return context[name] || '';
106
+ });
102
107
 
103
- fragment += wrapper + value + wrapper;
104
- fragments.push(fragment);
108
+ // register an 'includes' helper
109
+ // it checks if value is in array
110
+ hb.registerHelper('includes', function (haystack, needle, options) {
111
+ if (_.contains(haystack, needle)) {
112
+ return options.fn(this);
113
+ }
105
114
  });
115
+ }
106
116
 
107
- return fragments.join(fragmentGlue);
108
- }); //register a classic "for loop" helper
109
- //it also adds a local variable "i" as the index in each iteration loop
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 = "", helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
110
125
 
111
- hb.registerHelper('for', function (startIndex, stopIndex, increment, options) {
112
- var ret = '';
113
- startIndex = parseInt(startIndex);
114
- stopIndex = parseInt(stopIndex);
115
- increment = parseInt(increment);
116
126
 
117
- for (var i = startIndex; i < stopIndex; i += increment) {
118
- ret += options.fn(_.extend({}, this, {
119
- i: i
120
- }));
121
- }
127
+ buffer += "<div class=\"advanced-search-container\">\n <div class=\"advanced-criteria-container\"></div>\n <div class=\"add-criteria-container\">\n <a class=\"toggle-modal-button\"><span class=\"icon-add\"></span>"
128
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "add criteria", options) : helperMissing.call(depth0, "__", "add criteria", options)))
129
+ + "</a>\n <select name=\"criteria-select\">\n <option></option>\n </select>\n </div>\n</div>\n";
130
+ return buffer;
131
+ });
132
+ function advancedSearchTpl(data, options, asString) {
133
+ var html = Template(data, options);
134
+ return (asString || true) ? html : $(html);
135
+ }
122
136
 
123
- return ret;
124
- });
125
- hb.registerHelper('equal', function (var1, var2, options) {
126
- if (var1 == var2) {
127
- return options.fn(this);
128
- } else {
129
- return options.inverse(this);
137
+ if (!Helpers0.__initialized) {
138
+ Helpers0(Handlebars);
139
+ Helpers0.__initialized = true;
140
+ }
141
+ var Template$1 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
142
+ this.compilerInfo = [4,'>= 1.0.0'];
143
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
144
+ var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing;
145
+
146
+ function program1(depth0,data) {
147
+
148
+ var buffer = "", stack1;
149
+ buffer += "\n ";
150
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.alias), {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
151
+ if(stack1 || stack1 === 0) { buffer += stack1; }
152
+ buffer += "\n ";
153
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1['class'])),stack1 == null || stack1 === false ? stack1 : stack1.label), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
154
+ if(stack1 || stack1 === 0) { buffer += stack1; }
155
+ buffer += "\n ";
156
+ return buffer;
157
+ }
158
+ function program2(depth0,data) {
159
+
160
+ var buffer = "", stack1;
161
+ buffer += "<span class=\"criteria-alias\">("
162
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.alias)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
163
+ + ")</span>";
164
+ return buffer;
130
165
  }
131
- }); // register a "get property" helper
132
- // it gets the named property from the provided context
133
-
134
- hb.registerHelper('property', function (name, context) {
135
- return context[name] || '';
136
- }); // register an 'includes' helper
137
- // it checks if value is in array
138
166
 
139
- hb.registerHelper('includes', function (haystack, needle, options) {
140
- if (_.contains(haystack, needle)) {
141
- return options.fn(this);
167
+ function program4(depth0,data) {
168
+
169
+ var buffer = "", stack1;
170
+ buffer += "<span class=\"class-path\">/ "
171
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1['class'])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
172
+ + "</span>";
173
+ return buffer;
142
174
  }
143
- });
144
- }
145
-
146
- if (!Helpers0.__initialized) {
147
- Helpers0(Handlebars);
148
- Helpers0.__initialized = true;
149
- }
150
- var Template = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
151
- this.compilerInfo = [4,'>= 1.0.0'];
152
- helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
153
- var buffer = "", helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
154
-
155
-
156
- buffer += "<div class=\"advanced-search-container\">\r\n <div class=\"advanced-criteria-container\"></div>\r\n <div class=\"add-criteria-container\">\r\n <a><span class=\"icon-add\"></span>"
157
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "add criteria", options) : helperMissing.call(depth0, "__", "add criteria", options)))
158
- + "</a>\r\n <select name=\"criteria-select\">\r\n <option></option>\r\n </select>\r\n </div>\r\n</div>\r\n";
159
- return buffer;
160
- });
161
- function advancedSearchTpl(data, options, asString) {
162
- var html = Template(data, options);
163
- return (asString || true) ? html : $(html);
164
- }
165
-
166
- if (!Helpers0.__initialized) {
167
- Helpers0(Handlebars);
168
- Helpers0.__initialized = true;
169
- }
170
- var Template$1 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
171
- this.compilerInfo = [4,'>= 1.0.0'];
172
- helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
173
- var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
174
-
175
- function program1(depth0,data) {
176
-
177
- var buffer = "", stack1;
178
- buffer += " <span class=\"class-path\">/"
179
- + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1['class'])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
180
- + "</span>";
181
- return buffer;
182
- }
183
175
 
184
- buffer += "<div class=\"filter-container "
185
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
186
- + "-filter\" data-criteria=\""
187
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
188
- + "\" data-type=\""
189
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.type)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
190
- + "\">\r\n <button class=\"icon-result-nok\" aria-label=\""
191
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Remove criteria", options) : helperMissing.call(depth0, "__", "Remove criteria", options)))
192
- + "\"></button>\r\n <label>\r\n <span class=\"filter-label-text\">"
193
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
194
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.isDuplicated), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
195
- if(stack1 || stack1 === 0) { buffer += stack1; }
196
- buffer += "</span>\r\n <input type=\"text\">\r\n </label>\r\n</div>";
197
- return buffer;
198
- });
199
- function textCriterionTpl(data, options, asString) {
200
- var html = Template$1(data, options);
201
- return (asString || true) ? html : $(html);
202
- }
203
-
204
- if (!Helpers0.__initialized) {
205
- Helpers0(Handlebars);
206
- Helpers0.__initialized = true;
207
- }
208
- var Template$2 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
209
- this.compilerInfo = [4,'>= 1.0.0'];
210
- helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
211
- var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
212
-
213
- function program1(depth0,data) {
214
-
215
- var buffer = "";
216
- buffer += "\r\n <li>"
217
- + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
218
- + "</li>\r\n ";
219
- return buffer;
176
+ buffer += "<div class=\"filter-container "
177
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
178
+ + "-filter\" data-criteria=\""
179
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
180
+ + "\" data-type=\""
181
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.type)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
182
+ + "\">\n <button class=\"icon-result-nok\" aria-label=\""
183
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Remove criteria", options) : helperMissing.call(depth0, "__", "Remove criteria", options)))
184
+ + "\"></button>\n <label>\n <span class=\"filter-label-text\">"
185
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
186
+ + "\n ";
187
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.isDuplicated), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
188
+ if(stack1 || stack1 === 0) { buffer += stack1; }
189
+ buffer += "\n </span>\n <input type=\"text\">\n </label>\n</div>";
190
+ return buffer;
191
+ });
192
+ function textCriterionTpl(data, options, asString) {
193
+ var html = Template$1(data, options);
194
+ return (asString || true) ? html : $(html);
220
195
  }
221
196
 
222
- buffer += "<div class=\"filter-container invalid-criteria-warning-container\">\r\n<span class=\"select2-search-choice-close\"></span>\r\n <p>\r\n "
223
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The following criteria are not applicable to the selected class and have been removed from the search", options) : helperMissing.call(depth0, "__", "The following criteria are not applicable to the selected class and have been removed from the search", options)))
224
- + ":\r\n </p>\r\n <ul>\r\n ";
225
- stack1 = helpers.each.call(depth0, (depth0 && depth0.invalidCriteria), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
226
- if(stack1 || stack1 === 0) { buffer += stack1; }
227
- buffer += "\r\n </ul>\r\n</div>";
228
- return buffer;
229
- });
230
- function invalidCriteriaWarningTpl(data, options, asString) {
231
- var html = Template$2(data, options);
232
- return (asString || true) ? html : $(html);
233
- }
234
-
235
- if (!Helpers0.__initialized) {
236
- Helpers0(Handlebars);
237
- Helpers0.__initialized = true;
238
- }
239
- var Template$3 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
240
- this.compilerInfo = [4,'>= 1.0.0'];
241
- helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
242
- var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
243
-
244
- function program1(depth0,data) {
245
-
246
- var buffer = "", stack1;
247
- buffer += " <span class=\"class-path\">/"
248
- + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1['class'])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
249
- + "</span>";
250
- return buffer;
197
+ if (!Helpers0.__initialized) {
198
+ Helpers0(Handlebars);
199
+ Helpers0.__initialized = true;
251
200
  }
201
+ var Template$2 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
202
+ this.compilerInfo = [4,'>= 1.0.0'];
203
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
204
+ var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
205
+
206
+ function program1(depth0,data) {
207
+
208
+ var buffer = "";
209
+ buffer += "\n <li>"
210
+ + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
211
+ + "</li>\n ";
212
+ return buffer;
213
+ }
252
214
 
253
- function program3(depth0,data) {
254
-
255
- var buffer = "", stack1;
256
- buffer += "\r\n <div>\r\n <input type=\"checkbox\" value=\""
257
- + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
258
- + "\" id=\""
259
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
260
- + "-"
261
- + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
262
- + "\">\r\n <label class=\"filter-label-text\" for=\""
263
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
264
- + "-"
265
- + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
266
- + "\">"
267
- + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
268
- + "</label>\r\n </div>\r\n ";
269
- return buffer;
215
+ buffer += "<div class=\"filter-container invalid-criteria-warning-container\">\n<span class=\"select2-search-choice-close\"></span>\n <p>\n "
216
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "The following criteria are not applicable to the selected class and have been removed from the search", options) : helperMissing.call(depth0, "__", "The following criteria are not applicable to the selected class and have been removed from the search", options)))
217
+ + ":\n </p>\n <ul>\n ";
218
+ stack1 = helpers.each.call(depth0, (depth0 && depth0.invalidCriteria), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
219
+ if(stack1 || stack1 === 0) { buffer += stack1; }
220
+ buffer += "\n </ul>\n</div>";
221
+ return buffer;
222
+ });
223
+ function invalidCriteriaWarningTpl(data, options, asString) {
224
+ var html = Template$2(data, options);
225
+ return (asString || true) ? html : $(html);
270
226
  }
271
227
 
272
- buffer += "<div class=\"filter-container "
273
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
274
- + "-filter\" data-criteria=\""
275
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
276
- + "\"\r\n data-type=\""
277
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.type)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
278
- + "\">\r\n <button class=\"icon-result-nok\" aria-label=\""
279
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, " Remove criteria", options) : helperMissing.call(depth0, "__", " Remove criteria", options)))
280
- + "\"></button>\r\n <fieldset class=\"filter-bool-group\">\r\n <legend>"
281
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
282
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.isDuplicated), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
283
- if(stack1 || stack1 === 0) { buffer += stack1; }
284
- buffer += "</legend>\r\n ";
285
- stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.values), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
286
- if(stack1 || stack1 === 0) { buffer += stack1; }
287
- buffer += "\r\n </fieldset>\r\n</div>";
288
- return buffer;
289
- });
290
- function listCheckboxCriterionTpl(data, options, asString) {
291
- var html = Template$3(data, options);
292
- return (asString || true) ? html : $(html);
293
- }
294
-
295
- if (!Helpers0.__initialized) {
296
- Helpers0(Handlebars);
297
- Helpers0.__initialized = true;
298
- }
299
- var Template$4 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
300
- this.compilerInfo = [4,'>= 1.0.0'];
301
- helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
302
- var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
303
-
304
- function program1(depth0,data) {
305
-
306
- var buffer = "", stack1;
307
- buffer += " <span class=\"class-path\">/"
308
- + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1['class'])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
309
- + "</span>";
310
- return buffer;
228
+ if (!Helpers0.__initialized) {
229
+ Helpers0(Handlebars);
230
+ Helpers0.__initialized = true;
311
231
  }
232
+ var Template$3 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
233
+ this.compilerInfo = [4,'>= 1.0.0'];
234
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
235
+ var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing;
236
+
237
+ function program1(depth0,data) {
238
+
239
+ var buffer = "", stack1;
240
+ buffer += "\n ";
241
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.alias), {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
242
+ if(stack1 || stack1 === 0) { buffer += stack1; }
243
+ buffer += "\n ";
244
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1['class'])),stack1 == null || stack1 === false ? stack1 : stack1.label), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
245
+ if(stack1 || stack1 === 0) { buffer += stack1; }
246
+ buffer += "\n ";
247
+ return buffer;
248
+ }
249
+ function program2(depth0,data) {
250
+
251
+ var buffer = "", stack1;
252
+ buffer += "<span class=\"criteria-alias\">("
253
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.alias)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
254
+ + ")</span>";
255
+ return buffer;
256
+ }
312
257
 
313
- buffer += "<div class=\"filter-container "
314
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
315
- + "-filter\" data-criteria=\""
316
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
317
- + "\" data-type=\""
318
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.type)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
319
- + "\">\r\n <button class=\"icon-result-nok\" aria-label=\""
320
- + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Remove criteria", options) : helperMissing.call(depth0, "__", "Remove criteria", options)))
321
- + "\"></button> <label>\r\n <span class=\"filter-label-text\">"
322
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
323
- stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.isDuplicated), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
324
- if(stack1 || stack1 === 0) { buffer += stack1; }
325
- buffer += "</span>\r\n <input type='text' name=\""
326
- + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
327
- + "-select\">\r\n </label>\r\n</div>\r\n";
328
- return buffer;
329
- });
330
- function listSelectCriterionTpl(data, options, asString) {
331
- var html = Template$4(data, options);
332
- return (asString || true) ? html : $(html);
333
- }
334
-
335
- /**
336
- * Creates advanced search component
337
- *
338
- * @param {object} config
339
- * @param {object} config.renderTo - DOM element where component will be rendered to
340
- * @param {string} config.advancedCriteria - advanced criteria to be set on component creation
341
- * @param {string} config.rootClassUri - rootClassUri to check for whitelist sections
342
- * @returns {advancedSearch}
343
- */
344
-
345
- function advancedSearchFactory(config) {
346
- // Private properties to be easily accessible by instance methods
347
- var $container = null;
348
- var $addCriteria = null;
349
- var $addCriteriaInput = null;
350
- var $criteriaSelect = null;
351
- var $advancedCriteriaContainer = null;
352
- var criteriaState = null;
353
- var criteriaMapping = {};
354
- var criteriaTypes = {
355
- text: 'text',
356
- list: 'list'
357
- };
358
- var isAdvancedSearchStatusEnabled;
359
- var isCriteriaListUpdated = false; // Creates new component
360
-
361
- var instance = component({
362
- /**
363
- * Request metadata (criteria) for the given uri
364
- * @param {string} classUri - url to make the reques to
365
- * @returns {Promise} - Request promise
366
- */
367
- updateCriteria: function updateCriteria(route) {
368
- if (!isAdvancedSearchStatusEnabled) {
369
- return Promise.resolve();
370
- }
371
-
372
- var $criteriaIcon = $$1('.add-criteria-container a span').eq(0);
373
- $criteriaIcon.toggleClass('icon-add').toggleClass('icon-loop');
374
- return request(route).then(function (response) {
375
- criteriaMapping = response.criteriaMapping || {};
376
- var classTree = response.classDefinition ? response.classDefinition : response;
377
- var criteria = formatCriteria(classTree);
378
-
379
- _updateCriteria(criteria);
380
-
381
- isCriteriaListUpdated = true;
382
- $criteriaIcon.toggleClass('icon-add').toggleClass('icon-loop');
383
- }).catch(function (e) {
384
- return instance.trigger('error', e);
385
- });
386
- },
387
-
388
- /**
389
- * Access to component state
390
- * @returns {Object} - criteria state
391
- */
392
- getState: function getState() {
393
- return criteriaState;
394
- },
258
+ function program4(depth0,data) {
259
+
260
+ var buffer = "", stack1;
261
+ buffer += "<span class=\"class-path\">/ "
262
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1['class'])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
263
+ + "</span>";
264
+ return buffer;
265
+ }
395
266
 
396
- /**
397
- * Removes every rendered criterion, updates criteria state accordingly
398
- * and removes classes applied to scrollable list of criteria
399
- */
400
- clear: function clear() {
401
- $advancedCriteriaContainer.removeClass(['scrollable', 'scroll-separator-top', 'scroll-separator-bottom']);
402
- $advancedCriteriaContainer.empty();
267
+ function program6(depth0,data) {
268
+
269
+ var buffer = "", stack1;
270
+ buffer += "\n <div>\n <input type=\"checkbox\" value=\""
271
+ + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
272
+ + "\" id=\""
273
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
274
+ + "-"
275
+ + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
276
+ + "\">\n <label class=\"filter-label-text\" for=\""
277
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
278
+ + "-"
279
+ + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
280
+ + "\">"
281
+ + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0))
282
+ + "</label>\n </div>\n ";
283
+ return buffer;
284
+ }
403
285
 
404
- _.forEach(criteriaState, function (criterion) {
405
- criterion.rendered = false;
406
- criterion.value = null;
407
- });
408
- },
286
+ buffer += "<div class=\"filter-container "
287
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
288
+ + "-filter\" data-criteria=\""
289
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
290
+ + "\"\n data-type=\""
291
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.type)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
292
+ + "\">\n <button class=\"icon-result-nok\" aria-label=\""
293
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, " Remove criteria", options) : helperMissing.call(depth0, "__", " Remove criteria", options)))
294
+ + "\"></button>\n <fieldset class=\"filter-bool-group\">\n <legend>"
295
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
296
+ + "\n ";
297
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.isDuplicated), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
298
+ if(stack1 || stack1 === 0) { buffer += stack1; }
299
+ buffer += "\n </legend>\n ";
300
+ stack1 = helpers.each.call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.values), {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data});
301
+ if(stack1 || stack1 === 0) { buffer += stack1; }
302
+ buffer += "\n </fieldset>\n</div>";
303
+ return buffer;
304
+ });
305
+ function listCheckboxCriterionTpl(data, options, asString) {
306
+ var html = Template$3(data, options);
307
+ return (asString || true) ? html : $(html);
308
+ }
409
309
 
410
- /**
411
- * Builds substring of search query with the advanced criteria conditions
412
- */
413
- getAdvancedCriteriaQuery: function getAdvancedCriteriaQuery(hasSearchInput) {
414
- var advancedSearchCriteria = _.filter(criteriaState, function (criterion) {
415
- return criterion.rendered === true;
416
- });
310
+ if (!Helpers0.__initialized) {
311
+ Helpers0(Handlebars);
312
+ Helpers0.__initialized = true;
313
+ }
314
+ var Template$4 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
315
+ this.compilerInfo = [4,'>= 1.0.0'];
316
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
317
+ var buffer = "", stack1, helper, options, functionType="function", escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing;
318
+
319
+ function program1(depth0,data) {
320
+
321
+ var buffer = "", stack1;
322
+ buffer += "\n ";
323
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.alias), {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
324
+ if(stack1 || stack1 === 0) { buffer += stack1; }
325
+ buffer += "\n ";
326
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1['class'])),stack1 == null || stack1 === false ? stack1 : stack1.label), {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data});
327
+ if(stack1 || stack1 === 0) { buffer += stack1; }
328
+ buffer += "\n ";
329
+ return buffer;
330
+ }
331
+ function program2(depth0,data) {
332
+
333
+ var buffer = "", stack1;
334
+ buffer += "<span class=\"criteria-alias\">("
335
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.alias)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
336
+ + ")</span>";
337
+ return buffer;
338
+ }
417
339
 
418
- var query = '';
419
- advancedSearchCriteria.forEach(function (renderedCriterion) {
420
- var queryParam = renderedCriterion.propertyUri;
340
+ function program4(depth0,data) {
341
+
342
+ var buffer = "", stack1;
343
+ buffer += "<span class=\"class-path\">/ "
344
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1['class'])),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
345
+ + "</span>";
346
+ return buffer;
347
+ }
421
348
 
422
- if ((hasSearchInput || query.trim().length !== 0) && renderedCriterion.value) {
423
- query += ' AND ';
424
- }
349
+ buffer += "<div class=\"filter-container "
350
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
351
+ + "-filter\" data-criteria=\""
352
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
353
+ + "\" data-type=\""
354
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.type)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
355
+ + "\">\n <button class=\"icon-result-nok\" aria-label=\""
356
+ + escapeExpression((helper = helpers.__ || (depth0 && depth0.__),options={hash:{},data:data},helper ? helper.call(depth0, "Remove criteria", options) : helperMissing.call(depth0, "__", "Remove criteria", options)))
357
+ + "\"></button>\n <label>\n <span class=\"filter-label-text\">"
358
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.label)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
359
+ + "\n ";
360
+ stack1 = helpers['if'].call(depth0, ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.isDuplicated), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
361
+ if(stack1 || stack1 === 0) { buffer += stack1; }
362
+ buffer += "\n </span>\n <input type='text' name=\""
363
+ + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0.criterion)),stack1 == null || stack1 === false ? stack1 : stack1.id)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
364
+ + "-select\">\n </label>\n</div>\n";
365
+ return buffer;
366
+ });
367
+ function listSelectCriterionTpl(data, options, asString) {
368
+ var html = Template$4(data, options);
369
+ return (asString || true) ? html : $(html);
370
+ }
425
371
 
426
- if (renderedCriterion.type === criteriaTypes.text) {
427
- if (renderedCriterion.value && renderedCriterion.value.trim() !== '') {
428
- query += "".concat(queryParam, ":").concat(renderedCriterion.value.trim());
429
- }
430
- } else if (renderedCriterion.type === criteriaTypes.list) {
431
- if (renderedCriterion.value && renderedCriterion.value.length > 0) {
432
- /* Temp replaced OR with AND. See ADF-7 for details */
433
- query += "".concat(queryParam, ":").concat(renderedCriterion.value.join(' AND '));
434
- }
435
- }
436
- });
437
- return query;
438
- }
439
- }).setTemplate(advancedSearchTpl).on('render', function () {
440
- initUiSelectors();
441
- initAddCriteriaSelector().then(function () {
442
- initCriteriaState();
443
- instance.trigger('ready');
444
- }).catch(function (e) {
445
- return instance.trigger('error', e);
372
+ if (!Helpers0.__initialized) {
373
+ Helpers0(Handlebars);
374
+ Helpers0.__initialized = true;
375
+ }
376
+ var Template$5 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
377
+ this.compilerInfo = [4,'>= 1.0.0'];
378
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
379
+ var buffer = "", stack1, helper, functionType="function", escapeExpression=this.escapeExpression;
380
+
381
+
382
+ buffer += "<b>";
383
+ if (helper = helpers.text) { stack1 = helper.call(depth0, {hash:{},data:data}); }
384
+ else { helper = (depth0 && depth0.text); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
385
+ buffer += escapeExpression(stack1)
386
+ + "</b>";
387
+ return buffer;
446
388
  });
447
- });
448
- /**
449
- * Inits template selectors and scroll animation
450
- */
389
+ function highlightedTextTpl(data, options, asString) {
390
+ var html = Template$5(data, options);
391
+ return (asString || true) ? html : $(html);
392
+ }
451
393
 
452
- function initUiSelectors() {
453
- $container = instance.getElement();
454
- $addCriteria = $$1('.add-criteria-container', $container);
455
- $addCriteria.addClass('disabled');
456
- $addCriteriaInput = $$1('.add-criteria-container a', $container);
457
- $criteriaSelect = $$1('.add-criteria-container select', $container);
458
- $advancedCriteriaContainer = $$1('.advanced-criteria-container', $container);
459
- $advancedCriteriaContainer.on('scroll', _.throttle(animateScroll, 100));
394
+ if (!Helpers0.__initialized) {
395
+ Helpers0(Handlebars);
396
+ Helpers0.__initialized = true;
460
397
  }
461
- /**
462
- * Lookup for characters in text to highlight
463
- * @param {String} text - text to lookup
464
- * @param {String} highlight - character(s) to be highlighted
465
- * @param {regExp|String} match - match to be applied in the text
466
- * @returns {String} - highlighted text
467
- */
398
+ var Template$6 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
399
+ this.compilerInfo = [4,'>= 1.0.0'];
400
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
401
+ var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing;
468
402
 
469
403
 
470
- function highlightCharacter(text, highlight, match) {
471
- return text.replace(match, "<b>".concat(highlight, "</b>"));
404
+ buffer += "<span class=\"class-path\"> / ";
405
+ stack1 = (helper = helpers.dompurify || (depth0 && depth0.dompurify),options={hash:{},data:data},helper ? helper.call(depth0, (depth0 && depth0.text), options) : helperMissing.call(depth0, "dompurify", (depth0 && depth0.text), options));
406
+ if(stack1 || stack1 === 0) { buffer += stack1; }
407
+ buffer += "</span>";
408
+ return buffer;
409
+ });
410
+ function classLabelTpl(data, options, asString) {
411
+ var html = Template$6(data, options);
412
+ return (asString || true) ? html : $(html);
472
413
  }
473
- /**
474
- * Inits select2 on criteria select and its UX logic
475
- */
476
414
 
415
+ if (!Helpers0.__initialized) {
416
+ Helpers0(Handlebars);
417
+ Helpers0.__initialized = true;
418
+ }
419
+ var Template$7 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
420
+ this.compilerInfo = [4,'>= 1.0.0'];
421
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
422
+ var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing;
477
423
 
478
- function initAddCriteriaSelector() {
479
- var route = urlUtil.route('status', 'AdvancedSearch', 'tao');
480
- return request(route).then(function (response) {
481
- if (!response.enabled || response.whitelist && response.whitelist.includes(config.rootClassUri)) {
482
- isAdvancedSearchStatusEnabled = false;
483
- return;
484
- }
485
-
486
- isAdvancedSearchStatusEnabled = true;
487
- $addCriteria.removeClass('disabled');
488
- $criteriaSelect.select2({
489
- containerCssClass: 'criteria-select2',
490
- dropdownCssClass: 'criteria-dropdown-select2',
491
- sortResults: function sortResults(results) {
492
- return _.sortBy(results, ['text']);
493
- },
494
- escapeMarkup: function escapeMarkup(markup) {
495
- return markup;
496
- },
497
- formatResult: function formatResult(result, container, query) {
498
- var label = result.element[0].getAttribute('label');
499
- var sublabel = result.element[0].getAttribute('sublabel');
500
- var match = new RegExp(query.term, 'ig');
501
- var template = highlightCharacter(label, query.term, match); // Add sublabel
502
-
503
- if (sublabel && sublabel.length) {
504
- template = template + "<span class=\"class-path\"> / ".concat(highlightCharacter(sublabel, query.term, match), "</span>");
505
- }
506
424
 
507
- return template;
508
- }
509
- }); // open dropdown when user clicks on add criteria input
425
+ buffer += "<span class=\"criteria-alias\"> (";
426
+ stack1 = (helper = helpers.dompurify || (depth0 && depth0.dompurify),options={hash:{},data:data},helper ? helper.call(depth0, (depth0 && depth0.text), options) : helperMissing.call(depth0, "dompurify", (depth0 && depth0.text), options));
427
+ if(stack1 || stack1 === 0) { buffer += stack1; }
428
+ buffer += ")</span>";
429
+ return buffer;
430
+ });
431
+ function aliasTpl(data, options, asString) {
432
+ var html = Template$7(data, options);
433
+ return (asString || true) ? html : $(html);
434
+ }
510
435
 
511
- $addCriteriaInput.on('click', function () {
512
- if (isCriteriaListUpdated) {
513
- $criteriaSelect.select2('open'); // if dropdown is opened above addCriteria input, top property is slightly decreased to avoid overlapping with addCriteria icon
436
+ if (!Helpers0.__initialized) {
437
+ Helpers0(Handlebars);
438
+ Helpers0.__initialized = true;
439
+ }
440
+ var Template$8 = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
441
+ this.compilerInfo = [4,'>= 1.0.0'];
442
+ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
443
+ var buffer = "", stack1, helper, options, helperMissing=helpers.helperMissing;
514
444
 
515
- if ($$1('.criteria-dropdown-select2').hasClass('select2-drop-above')) {
516
- $$1('.criteria-dropdown-select2').css('top', $$1('.criteria-dropdown-select2').css('top').split('px')[0] - 10 + 'px');
517
- }
518
- }
519
- }); // when a criterion is selected add it to criteria container, remove it from dropdown options and reset select
520
445
 
521
- $criteriaSelect.on('change', function () {
522
- var criterionToAdd = $criteriaSelect.children('option:selected').val();
523
- addNewCriterion(criterionToAdd);
524
- $criteriaSelect.children('option:selected').remove();
525
- $criteriaSelect.select2('val', '');
526
- });
527
- }).catch(function (e) {
528
- return instance.trigger('error', e);
446
+ buffer += "<span class=\"criteria-label\">";
447
+ stack1 = (helper = helpers.dompurify || (depth0 && depth0.dompurify),options={hash:{},data:data},helper ? helper.call(depth0, (depth0 && depth0.text), options) : helperMissing.call(depth0, "dompurify", (depth0 && depth0.text), options));
448
+ if(stack1 || stack1 === 0) { buffer += stack1; }
449
+ buffer += "</span>";
450
+ return buffer;
529
451
  });
452
+ function labelTpl(data, options, asString) {
453
+ var html = Template$8(data, options);
454
+ return (asString || true) ? html : $(html);
530
455
  }
531
- /**
532
- * inits criteriaState loading it from the store (if present) or empty object.
533
- * If there is a stored criteriaState, those criteria that were rendered
534
- * but with null value are updated to not being rendered
456
+
457
+ /**
458
+ * This program is free software; you can redistribute it and/or
459
+ * modify it under the terms of the GNU General Public License
460
+ * as published by the Free Software Foundation; under version 2
461
+ * of the License (non-upgradable).
462
+ *
463
+ * This program is distributed in the hope that it will be useful,
464
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
465
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
466
+ * GNU General Public License for more details.
467
+ *
468
+ * You should have received a copy of the GNU General Public License
469
+ * along with this program; if not, write to the Free Software
470
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
471
+ *
472
+ * Copyright (c) 2021 (original work) Open Assessment Technologies SA ;
535
473
  */
536
474
 
475
+ /**
476
+ * Sort an array by a particular property.
477
+ * @param {Array} iter - The array to sort.
478
+ * @param {string} prop - The name of the sorting property.
479
+ * @returns {Array} - Returns a sorted copy of the array.
480
+ * @private
481
+ */
482
+ function sortBy(iter, prop) {
483
+ return Array.from(iter).sort((a, b) => {
484
+ const textA = a && a[prop] || '';
485
+ const textB = b && b[prop] || '';
486
+ return textA.localeCompare(textB);
487
+ });
488
+ }
537
489
 
538
- function initCriteriaState() {
539
- if (instance.config.advancedCriteria) {
540
- _.forEach(instance.config.advancedCriteria, function (criterion) {
541
- if (criterion.rendered === true && criterion.value === null) {
542
- criterion.rendered = false;
490
+ /**
491
+ * Creates advanced search component
492
+ *
493
+ * @param {object} config
494
+ * @param {object} config.renderTo - DOM element where component will be rendered to
495
+ * @param {string} config.advancedCriteria - advanced criteria to be set on component creation
496
+ * @param {bool} config.hideCriteria - if the criteria must be hidden
497
+ * @param {string} config.rootClassUri - rootClassUri to check for whitelist sections
498
+ * @param {string} config.statusUrl - the URL to the status API (usually '/tao/AdvancedSearch/status')
499
+ * @returns {advancedSearch}
500
+ */
501
+ function advancedSearchFactory(config) {
502
+ // Private properties to be easily accessible by instance methods
503
+ let $container = null;
504
+ let $addCriteria = null;
505
+ let $addCriteriaInput = null;
506
+ let $criteriaSelect = null;
507
+ let $advancedCriteriaContainer = null;
508
+ let criteriaState = null;
509
+ let criteriaMapping = {};
510
+ const criteriaTypes = {
511
+ text: 'text',
512
+ list: 'list'
513
+ };
514
+ let isAdvancedSearchStatusEnabled;
515
+ let isCriteriaListUpdated = false;
516
+
517
+ // Creates new component
518
+ const instance = component({
519
+ /**
520
+ * Tells if the advanced search is enabled.
521
+ * @returns {boolean}
522
+ */
523
+ isEnabled() {
524
+ return !!isAdvancedSearchStatusEnabled;
525
+ },
526
+ /**
527
+ * Request metadata (criteria) for the given uri
528
+ * @param {string} classUri - url to make the reques to
529
+ * @returns {Promise} - Request promise
530
+ */
531
+ updateCriteria(route) {
532
+ if (!isAdvancedSearchStatusEnabled) {
533
+ return Promise.resolve();
543
534
  }
544
- });
535
+ const $criteriaIcon = $$1('.add-criteria-container a span').eq(0);
536
+ $criteriaIcon.toggleClass('icon-add').toggleClass('icon-loop');
537
+ return request(route).then(response => {
538
+ criteriaMapping = response.criteriaMapping || {};
539
+ const classTree = response.classDefinition ? response.classDefinition : response;
540
+ const criteria = formatCriteria(classTree);
541
+ updateCriteria(criteria);
542
+ isCriteriaListUpdated = true;
543
+ $criteriaIcon.toggleClass('icon-add').toggleClass('icon-loop');
544
+ }).catch(e => instance.trigger('error', e));
545
+ },
546
+ /**
547
+ * Access to component state
548
+ * @returns {Object} - criteria state
549
+ */
550
+ getState() {
551
+ return criteriaState;
552
+ },
553
+ /**
554
+ * Removes every rendered criterion, updates criteria state accordingly
555
+ * and removes classes applied to scrollable list of criteria
556
+ */
557
+ clear() {
558
+ $advancedCriteriaContainer.removeClass(['scrollable', 'scroll-separator-top', 'scroll-separator-bottom']);
559
+ $advancedCriteriaContainer.empty();
560
+ _.forEach(criteriaState, criterion => {
561
+ criterion.rendered = false;
562
+ criterion.value = null;
563
+ });
564
+ },
565
+ /**
566
+ * Builds substring of search query with the advanced criteria conditions
567
+ */
568
+ getAdvancedCriteriaQuery(hasSearchInput) {
569
+ const advancedSearchCriteria = _.filter(criteriaState, criterion => criterion.rendered === true);
570
+ let query = '';
571
+ advancedSearchCriteria.forEach(renderedCriterion => {
572
+ const queryParam = renderedCriterion.propertyUri;
573
+ if ((hasSearchInput || query.trim().length !== 0) && renderedCriterion.value) {
574
+ query += ' AND ';
575
+ }
576
+ if (renderedCriterion.type === criteriaTypes.text) {
577
+ if (renderedCriterion.value && renderedCriterion.value.trim() !== '') {
578
+ query += `${queryParam}:${renderedCriterion.value.trim()}`;
579
+ }
580
+ } else if (renderedCriterion.type === criteriaTypes.list) {
581
+ if (renderedCriterion.value && renderedCriterion.value.length > 0) {
582
+ /* Temp replaced OR with AND. See ADF-7 for details */
583
+ query += `${queryParam}:${renderedCriterion.value.join(' AND ')}`;
584
+ }
585
+ }
586
+ });
587
+ return query;
588
+ }
589
+ }).setTemplate(advancedSearchTpl).on('render', () => {
590
+ initUiSelectors();
591
+ initAddCriteriaSelector().then(() => {
592
+ initCriteriaState();
593
+ instance.trigger('ready');
594
+ }).catch(e => instance.trigger('error', e));
595
+ });
596
+
597
+ /**
598
+ * Inits template selectors and scroll animation
599
+ */
600
+ function initUiSelectors() {
601
+ $container = instance.getElement();
602
+ $addCriteria = $$1('.add-criteria-container', $container);
603
+ $addCriteria.addClass('disabled');
604
+ $addCriteriaInput = $$1('.add-criteria-container a', $container);
605
+ $criteriaSelect = $$1('.add-criteria-container select', $container);
606
+ $advancedCriteriaContainer = $$1('.advanced-criteria-container', $container);
607
+ $advancedCriteriaContainer.on('scroll', _.throttle(animateScroll, 100));
545
608
  }
546
609
 
547
- criteriaState = instance.config.advancedCriteria || {};
548
- }
549
- /**
550
- * Styles scrolling on $advancedCriteriaContainer
551
- */
610
+ /**
611
+ * Lookup for characters in text to highlight
612
+ * @param {String} text - text to lookup
613
+ * @param {String} searchString - match to be applied in the text
614
+ * @returns {String} - highlighted text
615
+ */
616
+ function highlightCharacter(text, searchString) {
617
+ if (!searchString) {
618
+ return text;
619
+ }
620
+ const reg = new RegExp(searchString, 'gi');
621
+ return text.replace(reg, str => highlightedTextTpl({
622
+ text: str
623
+ }));
624
+ }
552
625
 
626
+ /**
627
+ * Inits select2 on criteria select and its UX logic
628
+ */
629
+ function initAddCriteriaSelector() {
630
+ return request(instance.config.statusUrl).then(function (response) {
631
+ if (config.hideCriteria || !response.enabled || response.whitelist && response.whitelist.includes(config.rootClassUri)) {
632
+ isAdvancedSearchStatusEnabled = false;
633
+ return;
634
+ }
635
+ isAdvancedSearchStatusEnabled = true;
636
+ $addCriteria.removeClass('disabled');
637
+ $criteriaSelect.select2({
638
+ containerCssClass: 'criteria-select2',
639
+ dropdownCssClass: 'criteria-dropdown-select2',
640
+ sortResults: results => sortBy(results, 'text'),
641
+ escapeMarkup: function (markup) {
642
+ return markup;
643
+ },
644
+ formatResult: function formatResult(result, container, query) {
645
+ const label = result.element[0].getAttribute('label');
646
+ const alias = result.element[0].getAttribute('alias');
647
+ const classLabel = result.element[0].getAttribute('class-label');
648
+ let html = labelTpl({
649
+ text: highlightCharacter(label, query.term)
650
+ });
651
+ if (alias) {
652
+ html += aliasTpl({
653
+ text: alias
654
+ });
655
+ }
656
+ if (classLabel) {
657
+ html += classLabelTpl({
658
+ text: classLabel
659
+ });
660
+ }
661
+ return html;
662
+ }
663
+ });
553
664
 
554
- function animateScroll() {
555
- var scrollPercentage = $advancedCriteriaContainer.get(0).scrollTop / ($advancedCriteriaContainer.get(0).scrollHeight - $advancedCriteriaContainer.get(0).clientHeight);
665
+ // open dropdown when user clicks on add criteria input
666
+ $addCriteriaInput.on('click', () => {
667
+ if (isCriteriaListUpdated) {
668
+ $criteriaSelect.select2('open');
669
+ // if dropdown is opened above addCriteria input, top property is slightly decreased to avoid overlapping with addCriteria icon
670
+ if ($$1('.criteria-dropdown-select2').hasClass('select2-drop-above')) {
671
+ $$1('.criteria-dropdown-select2').css('top', $$1('.criteria-dropdown-select2').css('top').split('px')[0] - 10 + 'px');
672
+ }
673
+ }
674
+ });
556
675
 
557
- if (scrollPercentage > 0.1) {
558
- $advancedCriteriaContainer.addClass('scroll-separator-top');
559
- } else {
560
- $advancedCriteriaContainer.removeClass('scroll-separator-top');
676
+ // when a criterion is selected add it to criteria container, remove it from dropdown options and reset select
677
+ $criteriaSelect.on('change', () => {
678
+ const criterionToAdd = $criteriaSelect.children('option:selected').val();
679
+ addNewCriterion(criterionToAdd);
680
+ $criteriaSelect.children('option:selected').remove();
681
+ $criteriaSelect.select2('val', '');
682
+ });
683
+ }).catch(function (e) {
684
+ return instance.trigger('error', e);
685
+ });
561
686
  }
562
687
 
563
- if (scrollPercentage < 0.9) {
564
- $advancedCriteriaContainer.addClass('scroll-separator-bottom');
565
- } else {
566
- $advancedCriteriaContainer.removeClass('scroll-separator-bottom');
688
+ /**
689
+ * inits criteriaState loading it from the store (if present) or empty object.
690
+ * If there is a stored criteriaState, those criteria that were rendered
691
+ * but with null value are updated to not being rendered
692
+ */
693
+ function initCriteriaState() {
694
+ if (instance.config.advancedCriteria) {
695
+ _.forEach(instance.config.advancedCriteria, criterion => {
696
+ if (criterion.rendered === true && criterion.value === null) {
697
+ criterion.rendered = false;
698
+ }
699
+ });
700
+ }
701
+ criteriaState = instance.config.advancedCriteria || {};
567
702
  }
568
- }
569
- /**
570
- * Renders new criterion to criteria container so it can be used on advanced search filtering
571
- * @param {string} criterionToAdd - new criterion to be added
572
- */
573
703
 
704
+ /**
705
+ * Styles scrolling on $advancedCriteriaContainer
706
+ */
707
+ function animateScroll() {
708
+ const scrollPercentage = $advancedCriteriaContainer.get(0).scrollTop / ($advancedCriteriaContainer.get(0).scrollHeight - $advancedCriteriaContainer.get(0).clientHeight);
709
+ if (scrollPercentage > 0.1) {
710
+ $advancedCriteriaContainer.addClass('scroll-separator-top');
711
+ } else {
712
+ $advancedCriteriaContainer.removeClass('scroll-separator-top');
713
+ }
714
+ if (scrollPercentage < 0.9) {
715
+ $advancedCriteriaContainer.addClass('scroll-separator-bottom');
716
+ } else {
717
+ $advancedCriteriaContainer.removeClass('scroll-separator-bottom');
718
+ }
719
+ }
574
720
 
575
- function addNewCriterion(criterionToAdd) {
576
- // remove deprecated warning message
577
- $$1('.invalid-criteria-warning-container').remove(); // render new criterion
721
+ /**
722
+ * Renders new criterion to criteria container so it can be used on advanced search filtering
723
+ * @param {string} criterionToAdd - new criterion to be added
724
+ */
725
+ function addNewCriterion(criterionToAdd) {
726
+ // remove deprecated warning message
727
+ $$1('.invalid-criteria-warning-container').remove();
578
728
 
579
- var criterion = criteriaState[criterionToAdd];
580
- var $criterionContainer = renderCriterion(criterion); // set logic to remove criterion
729
+ // render new criterion
730
+ const criterion = criteriaState[criterionToAdd];
731
+ const $criterionContainer = renderCriterion(criterion);
581
732
 
582
- $$1('.icon-result-nok', $criterionContainer).on('click', {
583
- criterion: criterion
584
- }, removeCriterion); // set initial value and manage value changes
733
+ // set logic to remove criterion
734
+ $$1('.icon-result-nok', $criterionContainer).on('click', {
735
+ criterion
736
+ }, removeCriterion);
585
737
 
586
- bindCriterionValue(criterion, $criterionContainer); // update styles if scroll is enabled
738
+ // set initial value and manage value changes
739
+ bindCriterionValue(criterion, $criterionContainer);
587
740
 
588
- if ($advancedCriteriaContainer.get(0).scrollHeight > $advancedCriteriaContainer.outerHeight()) {
589
- $advancedCriteriaContainer.addClass('scrollable');
741
+ // update styles if scroll is enabled
742
+ if ($advancedCriteriaContainer.get(0).scrollHeight > $advancedCriteriaContainer.outerHeight()) {
743
+ $advancedCriteriaContainer.addClass('scrollable');
744
+ }
745
+ criterion.rendered = true;
590
746
  }
591
747
 
592
- criterion.rendered = true;
593
- }
594
- /**
595
- * Renders the new criterion selecting the appropiate handlebars template and prepending to advanced criteria container.
596
- * If criterion is of type list with a uri endpoint to request the options, select2 is also init
597
- * @param {object} criterion - criterion to render
598
- * @returns - the rendered container
599
- */
600
-
601
-
602
- function renderCriterion(criterion) {
603
- var templateToUse = null;
604
-
605
- if (criterion.type === criteriaTypes.text) {
606
- templateToUse = textCriterionTpl;
607
- } else if (criterion.type === criteriaTypes.list && criterion.uri) {
608
- templateToUse = listSelectCriterionTpl;
609
- } else {
610
- templateToUse = listCheckboxCriterionTpl;
748
+ /**
749
+ * Renders the new criterion selecting the appropiate handlebars template and prepending to advanced criteria container.
750
+ * If criterion is of type list with a uri endpoint to request the options, select2 is also init
751
+ * @param {object} criterion - criterion to render
752
+ * @returns - the rendered container
753
+ */
754
+ function renderCriterion(criterion) {
755
+ let templateToUse = null;
756
+ if (criterion.type === criteriaTypes.text) {
757
+ templateToUse = textCriterionTpl;
758
+ } else if (criterion.type === criteriaTypes.list && criterion.uri) {
759
+ templateToUse = listSelectCriterionTpl;
760
+ } else {
761
+ templateToUse = listCheckboxCriterionTpl;
762
+ }
763
+ $advancedCriteriaContainer.append(templateToUse({
764
+ criterion
765
+ }));
766
+ const $criterionContainer = $$1(`.${criterion.id}-filter`, $container);
767
+ const valueMapping = criteriaMapping[criterion.type];
768
+
769
+ /**
770
+ * On criterion of type list with a uri endpoint to retrieve options, template includes a select
771
+ * that is managed with select2, so we init it here
772
+ */
773
+ if (criterion.type === criteriaTypes.list && criterion.uri) {
774
+ $$1(`input[name=${criterion.id}-select]`, $criterionContainer).select2({
775
+ multiple: true,
776
+ ajax: {
777
+ url: criterion.uri,
778
+ dataType: 'json',
779
+ data: function (term) {
780
+ return {
781
+ subject: term
782
+ };
783
+ },
784
+ results: response => ({
785
+ results: response.data.map(option => ({
786
+ id: valueMapping === 'uri' ? option.uri : option.label,
787
+ text: option.label
788
+ }))
789
+ })
790
+ },
791
+ initSelection: function (element, callback) {
792
+ const data = [];
793
+ $$1(element.val().split(',')).each(function () {
794
+ data.push({
795
+ id: this,
796
+ text: this
797
+ });
798
+ });
799
+ callback(data);
800
+ }
801
+ });
802
+ }
803
+ return $criterionContainer;
611
804
  }
612
805
 
613
- $advancedCriteriaContainer.append(templateToUse({
614
- criterion: criterion
615
- }));
616
- var $criterionContainer = $$1(".".concat(criterion.id, "-filter"), $container);
617
- var valueMapping = criteriaMapping[criterion.type];
618
- /**
619
- * On criterion of type list with a uri endpoint to retrieve options, template includes a select
620
- * that is managed with select2, so we init it here
806
+ /**
807
+ * Fetches initial criterion label from api in case the value mapping is uri
808
+ * @param {object} criterion - criterion to be managed
621
809
  */
810
+ function getInitialCriterionLabel(criterion) {
811
+ const valueMapping = criteriaMapping[criterion.type];
812
+ if (valueMapping !== 'uri' || !criterion.value) {
813
+ return Promise.resolve({
814
+ id: criterion.value,
815
+ text: criterion.value
816
+ });
817
+ }
818
+ return $$1.ajax({
819
+ type: 'GET',
820
+ url: criterion.uri,
821
+ dataType: 'json'
822
+ }).then(_ref => {
823
+ let {
824
+ data
825
+ } = _ref;
826
+ if (Array.isArray(criterion.value)) {
827
+ return criterion.value.map(v => ({
828
+ id: v,
829
+ text: (data.find(d => d.uri === v) || {}).label
830
+ }));
831
+ }
832
+ let c = data.find(d => d.uri === criterion.value) || {};
833
+ return {
834
+ text: c.label,
835
+ id: criterion.value
836
+ };
837
+ });
838
+ }
622
839
 
623
- if (criterion.type === criteriaTypes.list && criterion.uri) {
624
- $$1("input[name=".concat(criterion.id, "-select]"), $criterionContainer).select2({
625
- multiple: true,
626
- ajax: {
627
- url: criterion.uri,
628
- dataType: 'json',
629
- data: function data(term) {
630
- return {
631
- subject: term
632
- };
633
- },
634
- results: function results(response) {
635
- return {
636
- results: response.data.map(function (option) {
637
- return {
638
- id: valueMapping === 'uri' ? option.uri : option.label,
639
- text: option.label
640
- };
641
- })
642
- };
840
+ /**
841
+ * Sets initial value for rendered criterion and sets binding between view and state
842
+ * @param {object} criterion - criterion to be managed
843
+ * @param {object} $criterionContainer - rendered criterion
844
+ */
845
+ function bindCriterionValue(criterion, $criterionContainer) {
846
+ getInitialCriterionLabel(criterion).then(initialCriterion => {
847
+ if (criterion.type === criteriaTypes.text) {
848
+ // set initial value
849
+ $$1('input', $criterionContainer).val(criterion.value);
850
+ // set event to bind input value to critariaState
851
+ $$1('input', $criterionContainer).on('change', function () {
852
+ criterion.value = $$1(this).val() || null;
853
+ });
854
+ } else if (criterion.type === criteriaTypes.list && criterion.uri) {
855
+ // set initial value
856
+ if (criterion.value) {
857
+ $$1(`input[name=${criterion.id}-select]`, $criterionContainer).select2('data', initialCriterion);
643
858
  }
644
- },
645
- initSelection: function initSelection(element, callback) {
646
- var data = [];
647
- $$1(element.val().split(',')).each(function () {
648
- data.push({
649
- id: this,
650
- text: this
859
+ // set event to bind input value to critariaState
860
+ $$1(`input[name=${criterion.id}-select]`, $criterionContainer).on('change', event => {
861
+ criterion.value = event.val;
862
+ });
863
+ } else {
864
+ // set initial value
865
+ if (criterion.value) {
866
+ criterion.value.forEach(selectedValue => {
867
+ $$1(`input[value=${selectedValue}]`, $criterionContainer).prop('checked', true);
651
868
  });
869
+ }
870
+ // set event to bind input value to critariaState
871
+ $$1('input[type="checkbox"]', $criterionContainer).on('change', function () {
872
+ criterion.value = $$1(this).closest('.filter-container').find('input[type=checkbox]:checked').get().map(element => element.value);
652
873
  });
653
- callback(data);
654
874
  }
655
875
  });
656
876
  }
657
877
 
658
- return $criterionContainer;
659
- }
660
- /**
661
- * Fetches initial criterion label from api in case the value mapping is uri
662
- * @param {object} criterion - criterion to be managed
663
- */
664
-
878
+ /**
879
+ * Removes a criterion from advanced criteria container when user clicks on the criterion close icon.
880
+ * It also adds the option element to criteria select so removed criterion can be rendered again
881
+ * @param {object} event - click event triggered on closing icon
882
+ */
883
+ function removeCriterion(event) {
884
+ const criterion = event.data.criterion;
885
+ const newOption = createCriteriaOption(criterion);
886
+ const criterionKey = getCriterionStateId(criterion);
887
+
888
+ // remove criterion and append new criterion to select options
889
+ $$1(this).parent().remove();
890
+ $criteriaSelect.append(newOption);
891
+
892
+ // reset criterion values on criteriaState
893
+ criteriaState[criterionKey].rendered = false;
894
+ criteriaState[criterionKey].value = null;
895
+
896
+ // check if advanced criteria container is no longer scrollable
897
+ if ($advancedCriteriaContainer.get(0).scrollHeight <= $advancedCriteriaContainer.outerHeight()) {
898
+ $advancedCriteriaContainer.removeClass('scrollable');
899
+ }
900
+ }
665
901
 
666
- function getInitialCriterionLabel(criterion) {
667
- var valueMapping = criteriaMapping[criterion.type];
902
+ /**
903
+ * Parses received criteria from BE to the data structure required for criteria selector. To do so,
904
+ * appends every criterion into criteria array and then returns a duplicate-free version of it
905
+ * considering label property as uniqueness criterion
906
+ * @param {Array} classes - array of classes with the metadata (aka criteria) for each one of them
907
+ * @returns {Array} - criteria array
908
+ */
909
+ function formatCriteria(classTree) {
910
+ let criteria = [];
911
+ _.forEach(classTree, classInstance => {
912
+ criteria.push(...classInstance.metadata);
913
+ });
668
914
 
669
- if (valueMapping !== 'uri' || !criterion.value) {
670
- return Promise.resolve({
671
- id: criterion.value,
672
- text: criterion.value
915
+ // extends each criterion with an id that can be use as a valid css class
916
+ _.forEach(criteria, criterion => {
917
+ criterion.label = getCriterionLabel(criterion);
918
+ criterion.id = criterion.propertyUri.replace(/^[^a-zA-Z]*|[^a-zA-Z0-9]*/g, '');
673
919
  });
920
+ return criteria;
674
921
  }
675
922
 
676
- return $$1.ajax({
677
- type: 'GET',
678
- url: criterion.uri,
679
- dataType: 'json'
680
- }).then(function (_ref) {
681
- var data = _ref.data;
682
-
683
- if (Array.isArray(criterion.value)) {
684
- return criterion.value.map(function (v) {
685
- return {
686
- id: v,
687
- text: (data.find(function (d) {
688
- return d.uri === v;
689
- }) || {}).label
690
- };
691
- });
692
- }
693
-
694
- var c = data.find(function (d) {
695
- return d.uri === criterion.value;
696
- }) || {};
697
- return {
698
- text: c.label,
699
- id: criterion.value
700
- };
701
- });
702
- }
703
- /**
704
- * Sets initial value for rendered criterion and sets binding between view and state
705
- * @param {object} criterion - criterion to be managed
706
- * @param {object} $criterionContainer - rendered criterion
707
- */
708
-
709
-
710
- function bindCriterionValue(criterion, $criterionContainer) {
711
- getInitialCriterionLabel(criterion).then(function (initialCriterion) {
712
- if (criterion.type === criteriaTypes.text) {
713
- // set initial value
714
- $$1('input', $criterionContainer).val(criterion.value); // set event to bind input value to critariaState
715
-
716
- $$1('input', $criterionContainer).on('change', function () {
717
- criterion.value = $$1(this).val() || null;
718
- });
719
- } else if (criterion.type === criteriaTypes.list && criterion.uri) {
720
- // set initial value
721
- if (criterion.value) {
722
- $$1("input[name=".concat(criterion.id, "-select]"), $criterionContainer).select2('data', initialCriterion);
723
- } // set event to bind input value to critariaState
724
-
923
+ /**
924
+ * Manages the new set of available criteria. To do so, removes warning container and every
925
+ * selectable criterion. Then removes from criteriaState and view every deprecated criterion,
926
+ * updates criteriaState with the new available criteria set, and renders new warning
927
+ * message if required
928
+ * @param {array} criteria - array of class properties
929
+ */
930
+ function updateCriteria(criteria) {
931
+ $$1('.invalid-criteria-warning-container').remove();
932
+ $criteriaSelect.find('option:not(:first-child)').remove();
933
+ const invalidCriteria = deleteDeprecatedCriteria(criteria);
934
+ extendCriteria(criteria);
935
+ renderWarningMessage(invalidCriteria);
936
+ }
725
937
 
726
- $$1("input[name=".concat(criterion.id, "-select]"), $criterionContainer).on('change', function (event) {
727
- criterion.value = event.val;
938
+ /**
939
+ * If there is any invalid criterion, renders an explanatory warning message
940
+ * @param {array} invalidCriteria - array of string containing the label of every invalid criterion (those that were rendered but are no longer available)
941
+ */
942
+ function renderWarningMessage(invalidCriteria) {
943
+ if (invalidCriteria.length > 0) {
944
+ const invalidCriteriaWarning = invalidCriteriaWarningTpl({
945
+ invalidCriteria
728
946
  });
729
- } else {
730
- // set initial value
731
- if (criterion.value) {
732
- criterion.value.forEach(function (selectedValue) {
733
- $$1("input[value=".concat(selectedValue, "]"), $criterionContainer).prop('checked', true);
734
- });
735
- } // set event to bind input value to critariaState
736
-
737
-
738
- $$1('input[type="checkbox"]', $criterionContainer).on('change', function () {
739
- criterion.value = $$1(this).closest('.filter-container').find('input[type=checkbox]:checked').get().map(function (element) {
740
- return element.value;
741
- });
947
+ $advancedCriteriaContainer.prepend(invalidCriteriaWarning);
948
+ $$1('.invalid-criteria-warning-container .select2-search-choice-close', $advancedCriteriaContainer).on('click', function () {
949
+ $$1(this).parent().remove();
742
950
  });
743
951
  }
744
- });
745
- }
746
- /**
747
- * Removes a criterion from advanced criteria container when user clicks on the criterion close icon.
748
- * It also adds the option element to criteria select so removed criterion can be rendered again
749
- * @param {object} event - click event triggered on closing icon
750
- */
751
-
752
-
753
- function removeCriterion(event) {
754
- var criterion = event.data.criterion;
755
- var newOption = createCriteriaOption(criterion);
756
- var criterionKey = getCriterionStateId(criterion); // remove criterion and append new criterion to select options
757
-
758
- $$1(this).parent().remove();
759
- $criteriaSelect.append(newOption); // reset criterion values on criteriaState
760
-
761
- criteriaState[criterionKey].rendered = false;
762
- criteriaState[criterionKey].value = null; // check if advanced criteria container is no longer scrollable
763
-
764
- if ($advancedCriteriaContainer.get(0).scrollHeight <= $advancedCriteriaContainer.outerHeight()) {
765
- $advancedCriteriaContainer.removeClass('scrollable');
766
952
  }
767
- }
768
- /**
769
- * Parses received criteria from BE to the data structure required for criteria selector. To do so,
770
- * appends every criterion into criteria array and then returns a duplicate-free version of it
771
- * considering label property as uniqueness criterion
772
- * @param {Array} classes - array of classes with the metadata (aka criteria) for each one of them
773
- * @returns {Array} - criteria array
774
- */
775
-
776
-
777
- function formatCriteria(classTree) {
778
- var criteria = [];
779
-
780
- _.forEach(classTree, function (classInstance) {
781
- criteria.push.apply(criteria, _toConsumableArray(classInstance.metadata));
782
- }); // extends each criterion with an id that can be use as a valid css class
783
-
784
-
785
- _.forEach(criteria, function (criterion) {
786
- criterion.label = getCriterionLabel(criterion);
787
- criterion.id = criterion.propertyUri.replace(/^[^a-zA-Z]*|[^a-zA-Z0-9]*/g, '');
788
- });
789
-
790
- return criteria;
791
- }
792
- /**
793
- * Manages the new set of available criteria. To do so, removes warning container and every
794
- * selectable criterion. Then removes from criteriaState and view every deprecated criterion,
795
- * updates criteriaState with the new available criteria set, and renders new warning
796
- * message if required
797
- * @param {array} criteria - array of class properties
798
- */
799
-
800
953
 
801
- function _updateCriteria(criteria) {
802
- $$1('.invalid-criteria-warning-container').remove();
803
- $criteriaSelect.find('option:not(:first-child)').remove();
804
- var invalidCriteria = deleteDeprecatedCriteria(criteria);
805
- extendCriteria(criteria);
806
- renderWarningMessage(invalidCriteria);
807
- }
808
- /**
809
- * If there is any invalid criterion, renders an explanatory warning message
810
- * @param {array} invalidCriteria - array of string containing the label of every invalid criterion (those that were rendered but are no longer available)
811
- */
812
-
813
-
814
- function renderWarningMessage(invalidCriteria) {
815
- if (invalidCriteria.length > 0) {
816
- var invalidCriteriaWarning = invalidCriteriaWarningTpl({
817
- invalidCriteria: invalidCriteria
818
- });
819
- $advancedCriteriaContainer.prepend(invalidCriteriaWarning);
820
- $$1('.invalid-criteria-warning-container .select2-search-choice-close', $advancedCriteriaContainer).on('click', function () {
821
- $$1(this).parent().remove();
954
+ /**
955
+ * Loops through current criteriaState so every criterion that is no longer available in the new
956
+ * available criteria set is removed from criteriaState and from view, in case it had been
957
+ * rendered. In that case it is also pushed into invalidCriteria array to be latter
958
+ * included in the warning message
959
+ * @param {array} criteria - array containing new set of criteria for current class
960
+ * @returns {array} - array of strings with each deprecated criterion that was being displayed
961
+ */
962
+ function deleteDeprecatedCriteria(criteria) {
963
+ const invalidCriteria = [];
964
+ _.forEach(criteriaState, oldCriterion => {
965
+ const deprecatedCriterion = !criteria.find(newCriterion => newCriterion.label === oldCriterion.label);
966
+ const oldCriterionKey = getCriterionStateId(oldCriterion);
967
+ if (deprecatedCriterion) {
968
+ if (criteriaState[oldCriterionKey].rendered) {
969
+ $advancedCriteriaContainer.find(`.${oldCriterion.id}-filter`).remove();
970
+ invalidCriteria.push(oldCriterion.label);
971
+ }
972
+ delete criteriaState[oldCriterionKey];
973
+ }
822
974
  });
975
+ return invalidCriteria;
823
976
  }
824
- }
825
- /**
826
- * Loops through current criteriaState so every criterion that is no longer available in the new
827
- * available criteria set is removed from criteriaState and from view, in case it had been
828
- * rendered. In that case it is also pushed into invalidCriteria array to be latter
829
- * included in the warning message
830
- * @param {array} criteria - array containing new set of criteria for current class
831
- * @returns {array} - array of strings with each deprecated criterion that was being displayed
832
- */
833
-
834
-
835
- function deleteDeprecatedCriteria(criteria) {
836
- var invalidCriteria = [];
837
977
 
838
- _.forEach(criteriaState, function (oldCriterion) {
839
- var deprecatedCriterion = !criteria.find(function (newCriterion) {
840
- return newCriterion.label === oldCriterion.label;
841
- });
842
- var oldCriterionKey = getCriterionStateId(oldCriterion);
843
-
844
- if (deprecatedCriterion) {
845
- if (criteriaState[oldCriterionKey].rendered) {
846
- $advancedCriteriaContainer.find(".".concat(oldCriterion.id, "-filter")).remove();
847
- invalidCriteria.push(oldCriterion.label);
978
+ /**
979
+ * Loops through new criteria set and checks if each new criterion was already present or not on criteriaState
980
+ * and updates view and selectable criteria list accordingly
981
+ * @param {array} criteria - array containing new set of criteria for current class
982
+ */
983
+ function extendCriteria(criteria) {
984
+ criteria.forEach(criterion => {
985
+ let createOption = true;
986
+ const criteriaStateId = getCriterionStateId(criterion);
987
+
988
+ // if new criterion was already on criteriaState and had to be rendered, we avoid creating an option for it and render it if it was not
989
+ if (criteriaState[criteriaStateId] && criteriaState[criteriaStateId].rendered === true) {
990
+ createOption = false;
991
+ if ($advancedCriteriaContainer.find(`.${criterion.id}-filter`).length === 0) {
992
+ addNewCriterion(criteriaStateId);
993
+ }
994
+ } else {
995
+ // if new criterion was not on criteriaState we add it
996
+ criteriaState[criteriaStateId] = criterion;
997
+ criteriaState[criteriaStateId].rendered = false;
998
+ criteriaState[criteriaStateId].value = null;
848
999
  }
849
1000
 
850
- delete criteriaState[oldCriterionKey];
851
- }
852
- });
853
-
854
- return invalidCriteria;
855
- }
856
- /**
857
- * Loops through new criteria set and checks if each new criterion was already present or not on criteriaState
858
- * and updates view and selectable criteria list accordingly
859
- * @param {array} criteria - array containing new set of criteria for current class
860
- */
861
-
862
-
863
- function extendCriteria(criteria) {
864
- criteria.forEach(function (criterion) {
865
- var createOption = true;
866
- var criteriaStateId = getCriterionStateId(criterion); // if new criterion was already on criteriaState and had to be rendered, we avoid creating an option for it and render it if it was not
867
-
868
- if (criteriaState[criteriaStateId] && criteriaState[criteriaStateId].rendered === true) {
869
- createOption = false;
870
-
871
- if ($advancedCriteriaContainer.find(".".concat(criterion.id, "-filter")).length === 0) {
872
- addNewCriterion(criteriaStateId);
1001
+ // create new option element to criteria select
1002
+ if (createOption) {
1003
+ $criteriaSelect.append(createCriteriaOption(criterion));
873
1004
  }
874
- } else {
875
- // if new criterion was not on criteriaState we add it
876
- criteriaState[criteriaStateId] = criterion;
877
- criteriaState[criteriaStateId].rendered = false;
878
- criteriaState[criteriaStateId].value = null;
879
- } // create new option element to criteria select
880
-
1005
+ });
1006
+ }
881
1007
 
882
- if (createOption) {
883
- $criteriaSelect.append(createCriteriaOption(criterion));
1008
+ /**
1009
+ * Creates a new option element
1010
+ * with attributes to use in select2 markup
1011
+ * @param {Object} criterion
1012
+ * @returns {HTMLOptionElement} Single option criteria
1013
+ */
1014
+ function createCriteriaOption(criterion) {
1015
+ const label = criterion.label;
1016
+ let classLabel = '';
1017
+ let alias = '';
1018
+ let option;
1019
+ if (criterion.isDuplicated) {
1020
+ classLabel = criterion.class.label || '';
1021
+ alias = criterion.alias || '';
884
1022
  }
885
- });
886
- }
887
- /**
888
- * Creates a new option element
889
- * with attributes to use in select2 markup
890
- * @param {Object} criterion
891
- * @returns {HTMLOptionElement} Single option criteria
892
- */
893
-
894
-
895
- function createCriteriaOption(criterion) {
896
- var label = criterion.label;
897
- var sublabel = '';
898
- var option;
899
- var optionText = label;
900
-
901
- if (criterion.isDuplicated) {
902
- sublabel = criterion.class.label;
903
- optionText = "".concat(label, " (").concat(criterion.alias, ") /");
1023
+ option = new Option(label, getCriterionStateId(criterion), false, false);
1024
+ option.setAttribute('label', label);
1025
+ option.setAttribute('alias', alias);
1026
+ option.setAttribute('class-label', classLabel);
1027
+ return option;
904
1028
  }
905
1029
 
906
- option = new Option(label, getCriterionStateId(criterion), false, false);
907
- option.setAttribute('label', optionText);
908
- option.setAttribute('sublabel', sublabel);
909
- return option;
910
- }
911
- /**
912
- * @param {Object} criterion
913
- * @returns String
914
- */
1030
+ /**
1031
+ * @param {Object} criterion
1032
+ * @returns String
1033
+ */
1034
+ function getCriterionStateId(criterion) {
1035
+ return criterion.propertyUri;
1036
+ }
915
1037
 
1038
+ /**
1039
+ * @param {Object} criterion
1040
+ * @returns String
1041
+ */
1042
+ function getCriterionLabel(criterion) {
1043
+ return criterion.label;
1044
+ }
916
1045
 
917
- function getCriterionStateId(criterion) {
918
- return criterion.propertyUri;
1046
+ // return initialized instance of searchModal
1047
+ return instance.init(config);
919
1048
  }
920
- /**
921
- * @param {Object} criterion
922
- * @returns String
923
- */
924
-
925
-
926
- function getCriterionLabel(criterion) {
927
- return criterion.label;
928
- } // return initialized instance of searchModal
929
-
930
-
931
- return instance.init(config);
932
- }
933
1049
 
934
- return advancedSearchFactory;
1050
+ return advancedSearchFactory;
935
1051
 
936
1052
  });