smart-webcomponents-react 14.2.83 → 14.3.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 (376) hide show
  1. package/alertwindow/alertwindow.d.ts +5 -5
  2. package/alertwindow/alertwindow.esm.js +10 -85
  3. package/alertwindow/alertwindow.umd.js +1134 -1209
  4. package/array/array.d.ts +5 -5
  5. package/array/array.esm.js +13 -88
  6. package/array/array.umd.js +752 -827
  7. package/barcode/barcode.d.ts +3 -3
  8. package/barcode/barcode.esm.js +6 -61
  9. package/barcode/barcode.umd.js +311 -366
  10. package/button/dropdownbutton.d.ts +2 -2
  11. package/button/multisplitbutton.d.ts +2 -2
  12. package/calendar/calendar.d.ts +2 -2
  13. package/calendar/calendar.esm.js +4 -49
  14. package/calendar/calendar.umd.js +710 -755
  15. package/card/cardview.d.ts +1 -1
  16. package/cardview/cardview.d.ts +1 -1
  17. package/cardview/cardview.esm.js +2 -37
  18. package/cardview/cardview.umd.js +515 -550
  19. package/chart/chart.d.ts +9 -9
  20. package/chart/chart.esm.js +18 -133
  21. package/chart/chart.umd.js +822 -937
  22. package/chart/ganttchart.d.ts +20 -20
  23. package/combobox/combobox.d.ts +4 -4
  24. package/combobox/combobox.esm.js +8 -73
  25. package/combobox/combobox.umd.js +1341 -1406
  26. package/datetimepicker/datetimepicker.d.ts +1 -1
  27. package/datetimepicker/datetimepicker.esm.js +2 -37
  28. package/datetimepicker/datetimepicker.umd.js +826 -861
  29. package/dialogwindow/dialogwindow.d.ts +5 -5
  30. package/dialogwindow/dialogwindow.esm.js +10 -85
  31. package/dialogwindow/dialogwindow.umd.js +1134 -1209
  32. package/dockinglayout/dockinglayout.d.ts +7 -7
  33. package/dockinglayout/dockinglayout.esm.js +14 -109
  34. package/dockinglayout/dockinglayout.umd.js +765 -860
  35. package/dropdownbutton/dropdownbutton.d.ts +2 -2
  36. package/dropdownbutton/dropdownbutton.esm.js +4 -49
  37. package/dropdownbutton/dropdownbutton.umd.js +527 -572
  38. package/dropdownlist/dropdownlist.d.ts +4 -4
  39. package/dropdownlist/dropdownlist.esm.js +8 -73
  40. package/dropdownlist/dropdownlist.umd.js +1275 -1340
  41. package/editor/editor.d.ts +11 -9
  42. package/editor/editor.esm.js +14 -109
  43. package/editor/editor.umd.js +911 -1006
  44. package/fileupload/fileupload.d.ts +2 -1
  45. package/filterbuilder/filterbuilder.d.ts +1 -1
  46. package/filterbuilder/filterbuilder.esm.js +2 -37
  47. package/filterbuilder/filterbuilder.umd.js +463 -498
  48. package/filterpanel/filterpanel.d.ts +1 -1
  49. package/filterpanel/filterpanel.esm.js +2 -37
  50. package/filterpanel/filterpanel.umd.js +354 -389
  51. package/form/form.d.ts +1 -1
  52. package/form/form.esm.js +4 -49
  53. package/form/form.umd.js +1016 -1061
  54. package/form/formgroup.d.ts +1 -1
  55. package/ganttchart/ganttchart.d.ts +20 -20
  56. package/ganttchart/ganttchart.esm.js +40 -265
  57. package/ganttchart/ganttchart.umd.js +1666 -1891
  58. package/gauge/gauge.d.ts +2 -2
  59. package/gauge/gauge.esm.js +4 -49
  60. package/gauge/gauge.umd.js +664 -709
  61. package/grid/grid.d.ts +56 -51
  62. package/grid/grid.esm.js +96 -460
  63. package/grid/grid.umd.js +2107 -2471
  64. package/index.d.ts +45 -3
  65. package/input/input.d.ts +2 -2
  66. package/input/input.esm.js +4 -49
  67. package/input/input.umd.js +505 -550
  68. package/input/numberinput.d.ts +2 -2
  69. package/input/phoneinput.d.ts +4 -4
  70. package/kanban/kanban.d.ts +6 -6
  71. package/kanban/kanban.esm.js +12 -97
  72. package/kanban/kanban.umd.js +1334 -1419
  73. package/layout/dockinglayout.d.ts +7 -7
  74. package/listbox/listbox.d.ts +5 -5
  75. package/listbox/listbox.esm.js +10 -85
  76. package/listbox/listbox.umd.js +1170 -1245
  77. package/listmenu/listmenu.d.ts +1 -1
  78. package/listmenu/listmenu.esm.js +2 -37
  79. package/listmenu/listmenu.umd.js +1005 -1040
  80. package/menu/listmenu.d.ts +1 -1
  81. package/menu/menu.d.ts +1 -1
  82. package/menu/menu.esm.js +2 -37
  83. package/menu/menu.umd.js +1025 -1060
  84. package/multilinetextbox/multilinetextbox.d.ts +1 -1
  85. package/multilinetextbox/multilinetextbox.esm.js +2 -37
  86. package/multilinetextbox/multilinetextbox.umd.js +907 -942
  87. package/multilinewindow/multilinewindow.d.ts +5 -5
  88. package/multilinewindow/multilinewindow.esm.js +10 -85
  89. package/multilinewindow/multilinewindow.umd.js +1134 -1209
  90. package/multisplitbutton/multisplitbutton.d.ts +2 -2
  91. package/multisplitbutton/multisplitbutton.esm.js +4 -49
  92. package/multisplitbutton/multisplitbutton.umd.js +941 -986
  93. package/numberinput/numberinput.d.ts +2 -2
  94. package/numberinput/numberinput.esm.js +4 -49
  95. package/numberinput/numberinput.umd.js +348 -393
  96. package/numerictextbox/numerictextbox.d.ts +1 -1
  97. package/numerictextbox/numerictextbox.esm.js +2 -37
  98. package/numerictextbox/numerictextbox.umd.js +592 -627
  99. package/package.json +1 -1
  100. package/phoneinput/phoneinput.d.ts +4 -4
  101. package/phoneinput/phoneinput.esm.js +8 -73
  102. package/phoneinput/phoneinput.umd.js +386 -451
  103. package/pivottable/pivottable.d.ts +3 -3
  104. package/pivottable/pivottable.esm.js +6 -61
  105. package/pivottable/pivottable.umd.js +762 -817
  106. package/progresswindow/progresswindow.d.ts +5 -5
  107. package/progresswindow/progresswindow.esm.js +10 -85
  108. package/progresswindow/progresswindow.umd.js +1134 -1209
  109. package/promptwindow/promptwindow.d.ts +5 -5
  110. package/promptwindow/promptwindow.esm.js +10 -85
  111. package/promptwindow/promptwindow.umd.js +1134 -1209
  112. package/qrcode/qrcode.d.ts +3 -3
  113. package/qrcode/qrcode.esm.js +6 -61
  114. package/qrcode/qrcode.umd.js +333 -388
  115. package/querybuilder/querybuilder.d.ts +6 -1
  116. package/querybuilder/querybuilder.esm.js +14 -38
  117. package/querybuilder/querybuilder.umd.js +446 -470
  118. package/rating/rating.d.ts +1 -1
  119. package/rating/rating.esm.js +2 -37
  120. package/rating/rating.umd.js +261 -296
  121. package/scheduler/scheduler.d.ts +17 -17
  122. package/scheduler/scheduler.esm.js +34 -229
  123. package/scheduler/scheduler.umd.js +1782 -1977
  124. package/slider/slider.d.ts +2 -2
  125. package/slider/slider.esm.js +4 -49
  126. package/slider/slider.umd.js +642 -687
  127. package/source/modules/smart.accordion.js +1 -1
  128. package/source/modules/smart.array.js +2 -2
  129. package/source/modules/smart.barcode.js +1 -1
  130. package/source/modules/smart.breadcrumb.js +1 -1
  131. package/source/modules/smart.button.js +1 -1
  132. package/source/modules/smart.buttongroup.js +1 -1
  133. package/source/modules/smart.calendar.js +3 -3
  134. package/source/modules/smart.card.js +1 -1
  135. package/source/modules/smart.cardview.js +4 -4
  136. package/source/modules/smart.carousel.js +1 -1
  137. package/source/modules/smart.chart.js +1 -1
  138. package/source/modules/smart.checkbox.js +1 -1
  139. package/source/modules/smart.checkinput.js +2 -2
  140. package/source/modules/smart.chip.js +1 -1
  141. package/source/modules/smart.colorinput.js +2 -2
  142. package/source/modules/smart.colorpanel.js +2 -2
  143. package/source/modules/smart.colorpicker.js +2 -2
  144. package/source/modules/smart.combobox.js +2 -2
  145. package/source/modules/smart.common.js +1 -1
  146. package/source/modules/smart.countryinput.js +2 -2
  147. package/source/modules/smart.dateinput.js +3 -3
  148. package/source/modules/smart.daterangeinput.js +4 -4
  149. package/source/modules/smart.datetimepicker.js +3 -3
  150. package/source/modules/smart.dockinglayout.js +1 -1
  151. package/source/modules/smart.dropdownbutton.js +1 -1
  152. package/source/modules/smart.dropdownlist.js +2 -2
  153. package/source/modules/smart.editor.js +5 -5
  154. package/source/modules/smart.element.js +1 -1
  155. package/source/modules/smart.fileupload.js +3 -3
  156. package/source/modules/smart.form.js +2 -2
  157. package/source/modules/smart.formulaparser.js +1 -1
  158. package/source/modules/smart.ganttchart.js +5 -5
  159. package/source/modules/smart.gauge.js +1 -1
  160. package/source/modules/smart.grid.js +14 -14
  161. package/source/modules/smart.gridpanel.js +4 -4
  162. package/source/modules/smart.input.js +2 -2
  163. package/source/modules/smart.kanban.js +5 -5
  164. package/source/modules/smart.layout.js +1 -1
  165. package/source/modules/smart.led.js +1 -1
  166. package/source/modules/smart.listbox.js +2 -2
  167. package/source/modules/smart.listmenu.js +1 -1
  168. package/source/modules/smart.map.js +1 -1
  169. package/source/modules/smart.maskedtextbox.js +2 -2
  170. package/source/modules/smart.menu.js +1 -1
  171. package/source/modules/smart.multicomboinput.js +2 -2
  172. package/source/modules/smart.multiinput.js +2 -2
  173. package/source/modules/smart.multilinetextbox.js +2 -2
  174. package/source/modules/smart.multisplitbutton.js +2 -2
  175. package/source/modules/smart.numberinput.js +2 -2
  176. package/source/modules/smart.numerictextbox.js +2 -2
  177. package/source/modules/smart.pager.js +2 -2
  178. package/source/modules/smart.passwordinput.js +2 -2
  179. package/source/modules/smart.passwordtextbox.js +2 -2
  180. package/source/modules/smart.path.js +1 -1
  181. package/source/modules/smart.phoneinput.js +2 -2
  182. package/source/modules/smart.pivottable.js +3 -3
  183. package/source/modules/smart.progressbar.js +1 -1
  184. package/source/modules/smart.qrcode.js +1 -1
  185. package/source/modules/smart.querybuilder.js +5 -5
  186. package/source/modules/smart.radiobutton.js +1 -1
  187. package/source/modules/smart.rating.js +1 -1
  188. package/source/modules/smart.router.js +1 -1
  189. package/source/modules/smart.scheduler.js +4 -4
  190. package/source/modules/smart.scrollbar.js +1 -1
  191. package/source/modules/smart.slider.js +1 -1
  192. package/source/modules/smart.sortable.js +1 -1
  193. package/source/modules/smart.splitter.js +1 -1
  194. package/source/modules/smart.switchbutton.js +1 -1
  195. package/source/modules/smart.table.js +3 -3
  196. package/source/modules/smart.tabs.js +1 -1
  197. package/source/modules/smart.tank.js +1 -1
  198. package/source/modules/smart.textarea.js +2 -2
  199. package/source/modules/smart.textbox.js +2 -2
  200. package/source/modules/smart.timeinput.js +2 -2
  201. package/source/modules/smart.timepicker.js +1 -1
  202. package/source/modules/smart.toast.js +1 -1
  203. package/source/modules/smart.tooltip.js +1 -1
  204. package/source/modules/smart.tree.js +1 -1
  205. package/source/modules/smart.validator.js +1 -1
  206. package/source/modules/smart.window.js +2 -2
  207. package/source/smart.accordion.js +1 -1
  208. package/source/smart.ajax.js +1 -1
  209. package/source/smart.array.js +1 -1
  210. package/source/smart.barcode.js +1 -1
  211. package/source/smart.bootstrap.js +1 -1
  212. package/source/smart.breadcrumb.js +1 -1
  213. package/source/smart.button.js +1 -1
  214. package/source/smart.buttongroup.js +1 -1
  215. package/source/smart.calendar.js +2 -2
  216. package/source/smart.card.js +1 -1
  217. package/source/smart.cardview.js +1 -1
  218. package/source/smart.carousel.js +1 -1
  219. package/source/smart.chart.annotations.js +1 -1
  220. package/source/smart.chart.api.js +1 -1
  221. package/source/smart.chart.core.js +1 -1
  222. package/source/smart.chart.js +1 -1
  223. package/source/smart.chart.rangeselector.js +1 -1
  224. package/source/smart.chart.waterfall.js +1 -1
  225. package/source/smart.checkbox.js +1 -1
  226. package/source/smart.checkinput.js +1 -1
  227. package/source/smart.chip.js +1 -1
  228. package/source/smart.colorinput.js +1 -1
  229. package/source/smart.colorpanel.js +1 -1
  230. package/source/smart.colorpicker.js +1 -1
  231. package/source/smart.combobox.js +1 -1
  232. package/source/smart.complex.js +1 -1
  233. package/source/smart.core.js +1 -1
  234. package/source/smart.countryinput.js +1 -1
  235. package/source/smart.data.js +1 -1
  236. package/source/smart.date.js +1 -1
  237. package/source/smart.dateformatpanel.js +1 -1
  238. package/source/smart.dateinput.js +1 -1
  239. package/source/smart.daterangeinput.js +1 -1
  240. package/source/smart.datetimepicker.js +1 -1
  241. package/source/smart.dockinglayout.js +1 -1
  242. package/source/smart.draw.js +1 -1
  243. package/source/smart.dropdownbutton.js +1 -1
  244. package/source/smart.dropdownlist.js +1 -1
  245. package/source/smart.editor.js +2 -2
  246. package/source/smart.element.js +1 -1
  247. package/source/smart.elements.js +17 -17
  248. package/source/smart.export.js +1 -1
  249. package/source/smart.fileupload.js +2 -2
  250. package/source/smart.filter.js +1 -1
  251. package/source/smart.filterbuilder.js +2 -2
  252. package/source/smart.filterpanel.js +1 -1
  253. package/source/smart.form.js +1 -1
  254. package/source/smart.format.js +1 -1
  255. package/source/smart.formulaparser.js +1 -1
  256. package/source/smart.ganttchart.js +2 -2
  257. package/source/smart.gauge.js +1 -1
  258. package/source/smart.grid.cell.js +2 -2
  259. package/source/smart.grid.chart.js +1 -1
  260. package/source/smart.grid.column.js +1 -1
  261. package/source/smart.grid.core.js +2 -2
  262. package/source/smart.grid.dialog.js +2 -2
  263. package/source/smart.grid.edit.js +2 -2
  264. package/source/smart.grid.export.js +1 -1
  265. package/source/smart.grid.filter.js +1 -1
  266. package/source/smart.grid.group.js +1 -1
  267. package/source/smart.grid.js +1 -1
  268. package/source/smart.grid.menu.js +2 -2
  269. package/source/smart.grid.pager.js +1 -1
  270. package/source/smart.grid.reorder.js +1 -1
  271. package/source/smart.grid.resize.js +2 -2
  272. package/source/smart.grid.row.js +1 -1
  273. package/source/smart.grid.select.js +2 -2
  274. package/source/smart.grid.sort.js +1 -1
  275. package/source/smart.grid.toolbar.js +2 -2
  276. package/source/smart.grid.tree.js +1 -1
  277. package/source/smart.grid.view.js +2 -2
  278. package/source/smart.gridpanel.js +1 -1
  279. package/source/smart.input.js +2 -2
  280. package/source/smart.kanban.js +2 -2
  281. package/source/smart.layout.js +1 -1
  282. package/source/smart.led.js +1 -1
  283. package/source/smart.listbox.js +2 -2
  284. package/source/smart.listmenu.js +1 -1
  285. package/source/smart.map.js +1 -1
  286. package/source/smart.maskedtextbox.js +1 -1
  287. package/source/smart.math.js +1 -1
  288. package/source/smart.menu.js +1 -1
  289. package/source/smart.multicomboinput.js +1 -1
  290. package/source/smart.multiinput.js +1 -1
  291. package/source/smart.multilinetextbox.js +1 -1
  292. package/source/smart.multisplitbutton.js +1 -1
  293. package/source/smart.numberformatpanel.js +1 -1
  294. package/source/smart.numberinput.js +1 -1
  295. package/source/smart.numeric.js +1 -1
  296. package/source/smart.numerictextbox.js +1 -1
  297. package/source/smart.pager.js +1 -1
  298. package/source/smart.passwordinput.js +1 -1
  299. package/source/smart.passwordtextbox.js +1 -1
  300. package/source/smart.path.js +1 -1
  301. package/source/smart.phoneinput.js +1 -1
  302. package/source/smart.pivottable.js +1 -1
  303. package/source/smart.powerbutton.js +1 -1
  304. package/source/smart.progressbar.js +1 -1
  305. package/source/smart.qrcode.js +1 -1
  306. package/source/smart.radiobutton.js +1 -1
  307. package/source/smart.rating.js +1 -1
  308. package/source/smart.router.js +1 -1
  309. package/source/smart.scheduler.js +1 -1
  310. package/source/smart.scrollbar.js +1 -1
  311. package/source/smart.slider.js +1 -1
  312. package/source/smart.sortable.js +1 -1
  313. package/source/smart.splitter.js +1 -1
  314. package/source/smart.switchbutton.js +1 -1
  315. package/source/smart.table.js +1 -1
  316. package/source/smart.tabs.js +1 -1
  317. package/source/smart.tank.js +1 -1
  318. package/source/smart.textarea.js +1 -1
  319. package/source/smart.textbox.js +1 -1
  320. package/source/smart.tickintervalhandler.js +1 -1
  321. package/source/smart.timeinput.js +1 -1
  322. package/source/smart.timepicker.js +1 -1
  323. package/source/smart.toast.js +1 -1
  324. package/source/smart.tooltip.js +1 -1
  325. package/source/smart.tree.js +1 -1
  326. package/source/smart.validationpanel.js +1 -1
  327. package/source/smart.validator.js +1 -1
  328. package/source/smart.window.js +1 -1
  329. package/source/styles/components/smart.grid.css +1 -1
  330. package/source/styles/default/scss/smart.grid.scss +10 -3
  331. package/source/styles/default/smart.grid.css +7 -3
  332. package/source/styles/smart.default.css +1 -1
  333. package/source/typescript/smart.editor.d.ts +4 -2
  334. package/source/typescript/smart.elements.d.ts +45 -3
  335. package/source/typescript/smart.fileupload.d.ts +2 -1
  336. package/source/typescript/smart.grid.d.ts +34 -0
  337. package/source/typescript/smart.querybuilder.d.ts +5 -0
  338. package/splitter/splitter.d.ts +3 -3
  339. package/splitter/splitter.esm.js +6 -61
  340. package/splitter/splitter.umd.js +901 -956
  341. package/table/pivottable.d.ts +3 -3
  342. package/table/table.d.ts +7 -7
  343. package/table/table.esm.js +14 -109
  344. package/table/table.umd.js +1278 -1373
  345. package/tabs/tabs.d.ts +4 -4
  346. package/tabs/tabs.esm.js +8 -73
  347. package/tabs/tabs.umd.js +875 -940
  348. package/tabs/tabswindow.d.ts +5 -5
  349. package/tabswindow/tabswindow.d.ts +5 -5
  350. package/tabswindow/tabswindow.esm.js +10 -85
  351. package/tabswindow/tabswindow.umd.js +1134 -1209
  352. package/tank/tank.d.ts +2 -2
  353. package/tank/tank.esm.js +4 -49
  354. package/tank/tank.umd.js +598 -643
  355. package/textbox/multilinetextbox.d.ts +1 -1
  356. package/textbox/numerictextbox.d.ts +1 -1
  357. package/timepicker/datetimepicker.d.ts +1 -1
  358. package/toast/toast.d.ts +1 -1
  359. package/toast/toast.esm.js +2 -37
  360. package/toast/toast.umd.js +397 -432
  361. package/tree/tree.d.ts +4 -4
  362. package/tree/tree.esm.js +8 -73
  363. package/tree/tree.umd.js +1310 -1375
  364. package/waitwindow/waitwindow.d.ts +5 -5
  365. package/waitwindow/waitwindow.esm.js +10 -85
  366. package/waitwindow/waitwindow.umd.js +1134 -1209
  367. package/window/alertwindow.d.ts +5 -5
  368. package/window/dialogwindow.d.ts +5 -5
  369. package/window/multilinewindow.d.ts +5 -5
  370. package/window/progresswindow.d.ts +5 -5
  371. package/window/promptwindow.d.ts +5 -5
  372. package/window/tabswindow.d.ts +5 -5
  373. package/window/waitwindow.d.ts +5 -5
  374. package/window/window.d.ts +5 -5
  375. package/window/window.esm.js +10 -85
  376. package/window/window.umd.js +1134 -1209
@@ -1,6 +1,6 @@
1
1
 
2
- /* Smart UI v14.2.83 (2022-09-09)
2
+ /* Smart UI v14.3.0 (2022-09-27)
3
3
  Copyright (c) 2011-2021 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
6
- Smart("smart-grid-toolbar",class extends Smart.DataView{template(){return'<div id="container" role="presentation">\n <div id="header" class="smart-data-view-header" role="toolbar">\n <div id="viewsButton" class="smart-data-view-header-button smart-data-view-views-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Views"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="customizeButton" class="smart-data-view-header-button smart-data-view-customize-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Customize cards"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="filterButton" class="smart-data-view-header-button smart-data-view-filter-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Filter"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="sortButton" class="smart-data-view-header-button smart-data-view-sort-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Sort"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="groupButton" class="smart-data-view-header-button smart-data-view-group-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Group"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="formatButton" class="smart-data-view-header-button smart-data-view-format-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Format"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="deleteButton" class="smart-data-view-header-button smart-data-view-delete-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Delete"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="downloadButton" class="smart-data-view-header-button smart-data-view-download-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Download"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="searchButton" class="smart-data-view-header-button smart-data-view-search-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Search"></div>\n <div id="headerDropDown" owner class="smart-data-view-header-drop-down smart-visibility-hidden" role="dialog">\n <div id="customize" class="smart-hidden" role="presentation"></div>\n <div id="filter" class="smart-hidden" role="presentation"></div>\n <div id="sort" class="smart-hidden" role="presentation"></div>\n <div id="group" class="smart-hidden" role="presentation"></div>\n <div id="format" class="smart-hidden" role="presentation"></div>\n <div id="search" class="smart-data-view-search-box smart-hidden" role="presentation">\n <input type="text" id="searchInput" spellcheck="false" aria-label="Search" />\n <div id="searchLabel" class="smart-data-view-search-label smart-unselectable"></div>\n <div id="searchPrev" class="smart-data-view-search-prev" role="button" aria-label="Previous"></div>\n <div id="searchNext" class="smart-data-view-search-next" role="button" aria-label="Next"></div>\n <div id="searchClose" class="smart-data-view-search-close" role="button" aria-label="Close search box"></div>\n </div>\n </div>\n </div>\n </div>'}refreshTools(){const e=this;if(e.isRendered&&e.grid&&(e.grid.offsetWidth<600?e.querySelectorAll(".smart-tool-label").forEach((e=>{e.classList.add("smart-hidden")})):e.querySelectorAll(".smart-tool-label").forEach((e=>{e.classList.remove("smart-hidden")})),e.refreshHeaderDropDownPosition(),e.grid)){const t=e.grid;if(t.dataSource&&t.dataSource.boundSource){const a=t.dataSource&&t.dataSource.virtualDataSource&&!t.dataSource.virtualDataSourceOnExpand&&t.dataSource.length>t.virtualModeCachedRowsCount&&"infinite"!==t.scrolling;if(e.dataSource&&t.dataSource&&e.dataSource.length!==t.dataSource.length||a)if(a){const a=Array.isArray(t.dataSource.boundSource)?t.dataSource.boundSource:t.dataSource.boundSource.toArray();e.dataSource=new Smart.DataAdapter({observable:!1,dataSource:[...a],dataFields:t.dataSource.dataFields})}else e.dataSource=t.dataSource;(t=>{const a=t?"add":"remove";e.$.filterButton.classList[a]("smart-disabled"),e.$.sortButton.classList[a]("smart-disabled"),e.$.groupButton.classList[a]("smart-disabled"),e.$.formatButton.classList[a]("smart-disabled"),e.$.searchButton.classList[a]("smart-disabled"),e.$.downloadButton.classList[a]("smart-disabled")})(e.dataSource&&0===e.dataSource.length),0===t.columns.length?e.$.customizeButton.classList.add("smart-disabled"):e.$.customizeButton.classList.remove("smart-disabled")}}}get hasStyleObserver(){return!1}render(){const e=this;e._appliedFiltering={filters:[],operator:"and"},e._appliedSorting={dataFields:[],dataTypes:[],orderBy:[]},e._localizeHeader(),e._getInnerElementMessages(),super.render()}openFormatPanel(){const e=this,t=e.dataSource;if(!t||0===t.length||e.disabled||"none"===e.headerPosition)return;let a;if(e._refreshColumns("format"),e.grid.closeMenu(),e._editInfo&&e._editInfo.window.close(),e._closeDownloadMenu(),e._closeViewsMenu(),e.$.headerDropDown.classList.add("format-panel"),e.$.headerDropDown.classList.remove("customize-panel","sort-panel","search-panel","filter-panel"),e.$.format.classList.remove("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.group&&e.$.group.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e._closeSearchPanel(),e._formatPartCreated)a=e.$.format.firstElementChild,a.columns=e.columns,a.dataSource=e.dataSource,a.locale=e.locale,a.messages=e._innerElementMessages.formattingPanel,a.rightToLeft=e.rightToLeft;else{a=document.createElement("smart-formatting-panel"),a.animation=e.animation,a.columns=e.columns,a.dataSource=e.dataSource,a.locale=e.locale,a.messages=e._innerElementMessages.formattingPanel,a.rightToLeft=e.rightToLeft,a.theme=e.theme,a.unfocusable=!1,a.ownerElement=e,a.dropDownAppendTo="body",e._formattingPanel=a,e.$.format.appendChild(a);const t=document.createElement("div");t.className="smart-format-panel smart-grid-panel-container-footer",t.setAttribute("role","presentation"),t.innerHTML=`<div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation"><span class="smart-grid-panel-cancel-button" role="button">${e.localize("cancel")}</span><span class="smart-grid-panel-apply-button" role="button">${e.localize("apply")}</span></div>`,e._formattingPanel.$.apply=t.querySelector(".smart-grid-panel-apply-button"),e._formattingPanel.$.cancel=t.querySelector(".smart-grid-panel-cancel-button"),e.$.format.appendChild(t),e._formatPartCreated=!0,t.applyButton=t.querySelector(".smart-grid-panel-apply-button"),t.cancelButton=t.querySelector(".smart-grid-panel-cancel-button"),t.applyButton.onclick=()=>{a.$.fireEvent("apply"),e.grid._conditionalFormattingChanged=!0,e.grid._conditionalFormatting=a.apply(),e.grid.conditionalFormatting=a.getItems(),e.grid._recycle(!1),e.grid._conditionalFormattingChanged=!1},t.cancelButton.onclick=()=>{a.$.fireEvent("cancel")},e.grid.conditionalFormatting&&(a.items=e.grid.conditionalFormatting)}a.focus(),e._openHeaderDropDown(e.$.formatButton)}_openHeaderDropDown(e){const t=this;t.$.headerDropDown.parentElement!==document.body&&(document.body.appendChild(t.$.headerDropDown),t.$.headerDropDown.addEventListener("apply",(e=>{const a=t._getDropDownType();t._applyHandler(e),t.grid.$.fireEvent("batchChange",{type:a})})),t.$.headerDropDown.addEventListener("cancel",(()=>{const e=t._getDropDownType();t.closePanel(),t.grid.$.fireEvent("batchCancel",{type:e})}))),super._openHeaderDropDown(e),t.refreshHeaderDropDownPosition(e)}refreshHeaderDropDownPosition(e){const t=this;if(!t.$.headerDropDown||t.$.headerDropDown&&!t.$.headerDropDown.classList.contains("open"))return void(t._dropDownTarget=e);e?t._dropDownTarget=e:t._dropDownTarget&&(e=t._dropDownTarget),t.$.headerDropDown.style.top=t.grid.offset(t.grid).top+t.grid.$.header.offsetHeight+"px";const a=()=>{if(e){const a=t.grid.offset(e);a.left+t.$.headerDropDown.offsetWidth<document.body.scrollLeft+document.body.offsetWidth?t.$.headerDropDown.style.left=a.left+"px":t.$.headerDropDown.style.left=document.body.scrollLeft+document.body.offsetWidth-t.$.headerDropDown.offsetWidth+"px"}else t.$.headerDropDown.style.left=t.grid.offset(t.grid).left+"px"};t.grid.offsetWidth<600&&t.$.headerDropDown.offsetWidth>t.grid.offsetWidth?(t.$.headerDropDown.style.width="90%",t.$.headerDropDown.style.left=t.grid.offset(t.grid).left+"px"):(t.$.headerDropDown.style.width="",a())}openFilterPanel(e){const t=this,a=t.dataSource;t._refreshColumns("filter");const o=this.columns.map((e=>{const t=Object.assign({},e),o=a.dataFields.find((e=>e.name===t.dataField));return o&&(t.dataType=o.dataType),t})).filter((e=>e.allowFilter));if(super.openFilterPanel(o,null),t._closeDownloadMenu(),t._closeViewsMenu(),t.grid.closeMenu(),e){const a=t.$.headerDropDown.querySelector("smart-multi-column-filter-panel");a.$.itemsContainer.appendChild(a._createItem(t.columns.find((t=>t.dataField===e.dataField)),"string"===e.dataType?"CONTAINS":"EQUAL",""));const o=a.querySelectorAll(".smart-grid-panel-item");setTimeout((()=>{o[o.length-1].querySelector(".editor").focus()}),350)}}openSortPanel(e){const t=this,a=t.dataSource;t._refreshColumns("sort");const o=t.columns.map((e=>{const o=Object.assign({},e),n=t._appliedSorting.dataFields.indexOf(o.dataField),s=a.dataFields.find((e=>e.name===o.dataField));return s&&(o.dataType=s.dataType,o.sortIndex=n,-1!==n&&(o.sortDirection=t._appliedSorting.orderBy[n])),o})).filter((e=>e.allowSort));if(e&&t._appliedSorting&&-1===t._appliedSorting.dataFields.indexOf(e.dataField)){const a=o.find((t=>t.dataField===e.dataField));a.sortDirection="ascending",a.sortIndex=t._appliedSorting.dataFields.length}super.openSortPanel(o),t._closeDownloadMenu(),t._closeViewsMenu();const n=t.grid;n.closeMenu();const s=t.$.headerDropDown.querySelector("smart-sort-panel");if(!s)return;s.grid=n,s.$.maintainSortContainer.classList.remove("smart-hidden"),n.sorting.maintainSort?s.$.maintainSortContainer.firstElementChild.setAttribute("active",""):s.$.maintainSortContainer.firstElementChild.removeAttribute("active"),s._changeApplyButtonText();const i=s.$.inputNotSorted,r=()=>{const e=s.querySelectorAll(".smart-grid-panel-item");"many"===t.grid.sorting.mode||e.length<1?i.classList.remove("smart-visibility-hidden"):e.length>=1&&i.classList.add("smart-visibility-hidden")};s.onDataSourceChange=()=>{r()},r()}openCustomizePanel(){const e=this;if(e.disabled||"none"===e.headerPosition)return;e._closeDownloadMenu(),e._closeViewsMenu(),e._refreshColumns("customize");let t=e.columns;const a=e.grid;a.closeMenu(),a.appearance.showColumnGroupsInColumnPanel&&(t=[],a.columns.forEach((e=>{if(!e.columnGroup){const a={label:e.label,dataField:e.dataField,level:0,parentDataField:null,dataType:e.dataType||"string",columnGroup:e.columnGroup||null,allowHide:void 0===e.allowHide||e.allowHide,allowSort:void 0===e.allowSort||e.allowSort,allowFilter:void 0===e.allowFilter||e.allowFilter,allowGroup:void 0===e.allowGroup||e.allowGroup,visible:void 0===e.visible||e.visible};t.push(a)}})),a._columnGroups.forEach((e=>{const a={dataField:e.name,label:e.label,level:0,disableDrag:!0,disableToggle:!1,allowHide:!0};if(t.push(a),e.columns){let o=e.columns.length,n=0,s=[],i=[];e.columns.forEach((a=>{const r={label:a.label,dataField:a.dataField,level:1,parentDataField:e.name,dataType:a.dataType||"string",columnGroup:a.columnGroup||null,allowHide:void 0===a.allowHide||a.allowHide,allowSort:void 0===a.allowSort||a.allowSort,allowFilter:void 0===a.allowFilter||a.allowFilter,allowGroup:void 0===a.allowGroup||a.allowGroup,visible:void 0===a.visible||a.visible};!1===r.allowHide&&(o--,i.push(r.dataField)),r.visible||(n++,s.push(r.dataField)),t.push(r)})),o<=0&&(a.allowHide=!1,a.disableToggle=!0),e.columns.length===n||o===n&&i.toString()!==s.toString()?a.visible=!1:a.visible=!0}})));const o=e.$.customize,n=t.map((t=>{const a={};return a.visible=t.visible,a.label=t.label,a.dataField=t.dataField,-1!==[e.coverField,e.titleField].indexOf(a.dataField)?a.disableToggle=!0:a.disableToggle=!1,void 0!==t.level&&(a.level=t.level),t.disableDrag&&(a.disableDrag=!0),t.parentDataField&&(a.parentDataField=t.parentDataField),t.allowHide||(a.disableToggle=!0),a}));let s;if(e._closeDialog(),e.$.headerDropDown.classList.add("customize-panel"),e.$.headerDropDown.classList.remove("filter-panel","sort-panel","search-panel","group-panel","format-panel"),o.classList.remove("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e.$.group.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e._closeSearchPanel(),e._customizePartCreated)s=o.querySelector("smart-column-panel"),s.locale=e.locale,s.messages=e._innerElementMessages.columnPanel,s.set("dataSource",n),s.propertyChangedHandler("dataSource",void 0,n),s.rightToLeft=e.rightToLeft;else{const t=document.createDocumentFragment(),a=document.createElement("smart-column-panel");a.rightToLeft=e.rightToLeft,a.animation=e.animation,a.dataSource=n,a.locale=e.locale,a.messages=e._innerElementMessages.columnPanel,a.theme=e.theme,t.appendChild(a),e.$.customize.appendChild(t),e._customizePartCreated=!0}e._changedVisibility=new Map,e._openHeaderDropDown(e.$.customizeButton)}_applyFilter(e,t){const a=this;a.grid.beginUpdate(),a.grid.context=a.grid,a.grid.clearFilter();for(let t=0;t<e.length;t++){const o=e[t],n=o[0],s=o[1];a.grid.columnByDataField[n].filter=s}a.grid._filterOperator=t,a.grid.endUpdate(),a.grid.refreshFilters(),a.grid.context=document}_applySort(){const e=this,t=e._appliedSorting;e.grid.beginUpdate(),e.grid.sorting.maintainSort=t.maintainSort,e.grid.context=e.grid,e.grid.clearSort();for(let a=0;a<t.dataFields.length;a++)e.grid.sortBy(t.dataFields[a],t.orderBy[a]);e.grid.endUpdate(),e.grid.context=document}_getDropDownType(){const e=this;let t=null;return e.$.headerDropDown.classList.contains("filter-panel")?t="filter":e.$.headerDropDown.classList.contains("sort-panel")?t="sort":e.$.headerDropDown.classList.contains("search-panel")?t="search":e.$.headerDropDown.classList.contains("group-panel")?t="group":e.$.headerDropDown.classList.contains("format-panel")?t="format":e.$.headerDropDown.classList.contains("customize-panel")&&(t="customize"),t}_applyHandler(e){const t=this,a=e.target,o=e.detail,n=t.$.customize;if(t.grid&&"kanban"===t.grid.view&&t.grid._kanban&&n.contains(a))return t.grid._kanban._applyHandler(e,"customize"),void t.closePanel();n.contains(a)?t._applyColumns(o.value,o.moves):t.$.filter.contains(a)?t.addFilter(o.filters,o.operator,o.value):t.$.sort.contains(a)&&t.addSort(o.sortByInfo),t.closePanel()}_documentUpHandler(e){const t=this;let a=e.originalEvent.target;const o=t.grid.$.header;if(t.shadowRoot&&a===t&&(a=e.originalEvent.composedPath()[0]),t._closeDownloadMenu(),t._closeViewsMenu(),!("none"===t.headerPosition||t.$.headerDropDown.classList.contains("smart-visibility-hidden")||t.$.headerDropDown.classList.contains("search-panel")||a!==o&&o.contains(a))){const n=a.closest("smart-scroll-viewer"),s=a.closest(".smart-drop-down");if((!n||!o.contains(n.ownerElement))&&(!s||s.ownerElement&&!o.contains(s.ownerElement))){const a=e.originalEvent.composedPath();for(let e=0;e<a.length;e++){const t=a[e];if(t&&t.classList&&t.classList.contains("smart-data-view-header-drop-down"))return;if(t&&t.classList&&t.classList.contains("smart-formatting-panel-popup"))return}if(n&&n.ownerElement){const e=n.ownerElement.parents;for(let t=0;t<e.length;t++){const a=e[t];if(a&&a.classList&&a.classList.contains("smart-data-view-header-drop-down"))return}}if(s&&s.ownerElement){const e=s.ownerElement.parents;for(let t=0;t<e.length;t++){const a=e[t];if(a&&a.classList&&a.classList.contains("smart-data-view-header-drop-down"))return}}if(t.$.headerDropDown.querySelector("[open]"))return;t.closePanel()}}}_refreshColumns(e){const t=this,a=t.grid;let o,n=new Map;if("kanban"===a.view&&a._kanban)switch(e){case"customize":return o=a._kanban._getCustomizeColumnPanelDataSource(),o=JSON.parse(JSON.stringify(o)),t._refreshCustomizeButton(),void(t.columns=o)}o=Array.isArray(a.columns)?[...a.columns]:[...a.columns.toArray()],o=o.filter((t=>!1!==t._visible&&("filter"!==e&&"sort"!==e&&"group"!==e||!1!==t.visible))),o=o.map((e=>{let t=e.allowHide;return a.grouping&&a.grouping.autoHideGroupColumn&&a.dataSource.groupBy.indexOf(e.dataField)>=0&&(t=!1),{label:e.label,dataField:e.dataField,dataType:e.dataType||"string",columnGroup:e.columnGroup||null,allowHide:void 0===e.allowHide||t,allowSort:void 0===e.allowSort||e.allowSort,allowFilter:void 0===e.allowFilter||e.allowFilter,allowGroup:void 0===e.allowGroup||e.allowGroup,visible:void 0===e.visible||e.visible,sortIndex:void 0!==e.sortIndex&&null!==e.sortIndex?e.sortIndex:-1,sortDirection:void 0!==e.sortOrder?e.sortOrder:null}})),o=JSON.parse(JSON.stringify(o)),o.forEach((e=>{let t=e.columnGroup?e.columnGroup+"."+e.label:e.label,a=1;for(;n.get(t);)t=e.columnGroup?e.columnGroup+"."+e.label+` (${a})`:e.label+` (${a})`,a++;n.set(t,e),e.label=t})),t.columns=o,t._refreshCustomizeButton()}_init(e){const t=this;if(t.grid=e,e.dataSource&&e.dataSource.boundSource){t._refreshColumns("init");const a=Array.isArray(e.dataSource.boundSource)?e.dataSource.boundSource:e.dataSource.boundSource.toArray();t.dataSource=new Smart.DataAdapter({observable:!1,dataSource:[...a],dataFields:e.dataSource.dataFields})}t.grid._openRowSettingsDialog=t._openRowSettingsDialog,t.rightToLeft=t.grid.rightToLeft,t.refreshTools(),t.$.headerDropDown.onclick=e=>{t.grid._headerClickHandler(e),e.stopPropagation(),e.preventDefault()},t.grid.removeEventListener("change",t._refreshFromSelection),t.grid.addEventListener("change",t._refreshFromSelection),e.header.onInit&&e.header.onInit(t)}_removeMenu(){const e=this;if(e.downloadMenu){const t=e.downloadMenu.querySelector("smart-menu");t&&e.downloadMenu.removeChild(t)}}_removeViewsMenu(){const e=this;if(e.viewsMenu){const t=e.viewsMenu.querySelector("smart-menu");t&&e.viewsMenu.removeChild(t)}}_createViewsMenuItems(){const e=this,t=e.grid;e._removeViewsMenu();const a=document.createElement("smart-menu"),o=document.createDocumentFragment();a.mode="vertical",a.dropDownAppendTo="body",a.classList.add("smart-grid-views-menu"),a.rightToLeft=t.rightToLeft;const n=(e,a)=>{const o=document.createElement("smart-menu-item");let n="#D50000",s="smart-icon-table-alt";switch(a){case"grid":n="#3f51b5",s="smart-icon-table-alt","grid"===t.view&&o.setAttribute("focus","");break;case"pdf":n="#f4511e";break;case"kanban":n="#C40093",s="smart-icon-kanban","kanban"===t.view&&o.setAttribute("focus","");break;case"json":n="#8e24aa"}return o.label='<span style="color: '+n+'" class="smart-grid-icon '+s+'"></span>'+e,o.value=a,o};o.appendChild(n(t.localize("viewGrid"),"grid")),o.appendChild(n(t.localize("viewKanban"),"kanban")),a.appendChild(o),e.viewsMenu.appendChild(a),a.onItemClick=t=>{e._setView(t.detail.value)}}_setView(e){const t=this,a=t.grid;if(a.view!==e){if("kanban"===e){const e=a.context;a.context=a,a.view="kanban",a.context=e,a._kanbanInitialized&&a.columnByDataField.taskStatus?(a._showKanbanView(),t._refresh()):(delete a._kanbanInitialized,a._initKanbanView())}else"grid"===e&&(a.view="grid",a._hideKanbanView(),t._refresh());a.$.fireEvent("viewChanged",{view:e}),t._refresh()}}_createMenuItems(){const e=this,t=e.grid;e._removeMenu();const a=document.createElement("smart-menu"),o=document.createDocumentFragment();a.mode="vertical",a.dropDownAppendTo="body",a.classList.add("smart-grid-download-menu"),a.rightToLeft=t.rightToLeft;const n=(e,t)=>{const a=document.createElement("smart-menu-item");let o="#D50000";switch(t){case"csv":o="#3f51b5";break;case"pdf":o="#f4511e";break;case"xlsx":o="#0b8043";break;case"json":o="#8e24aa"}const n='<span style="position: absolute; top: 0px; font-size: 10px; color: '+o+'">'+t+"</span>";return a.label='<span style="color: '+o+'" class="smart-grid-icon smart-icon-docs"></span>'+n+e,a.value=t,a};o.appendChild(n(t.localize("download")+" CSV","csv")),o.appendChild(n(t.localize("download")+" XLSX","xlsx")),o.appendChild(n(t.localize("download")+" JSON","json")),a.appendChild(o),e.downloadMenu.appendChild(a),a.onItemClick=e=>{const a=new Date;t.dataExport.fileName="data_"+a.getFullYear()+"-"+a.getMonth()+"-"+a.getDate(),t.exportData(e.detail.value)}}closePanel(){const e=this;super.closePanel(),e.grid&&e.grid.focus(),e.downloadMenu&&e.downloadMenu.classList.contains("open")?e._closeDownloadMenu():e.viewsMenu&&e.viewsMenu.classList.contains("open")&&e._closeViewsMenu()}_closeDownloadMenu(){const e=this,t=e.downloadMenu;t&&(t.parentNode&&(t.classList.remove("open"),setTimeout((()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),100)),e.$.downloadButton.classList.remove("selected"),e.$.downloadButton.removeAttribute("aria-expanded"),t.classList.remove("open"))}_openDownloadMenu(){const e=this;if(e.grid.editing.isEditing&&e.grid.cancelEdit(),e.downloadMenu&&e.downloadMenu.classList.contains("open"))return void e._closeDownloadMenu();e.$.headerDropDown.classList.remove("group-panel","customize-panel","filter-panel","sort-panel","search-panel","format-panel"),e.$.group.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e.closePanel(),e.$.downloadButton.classList.add("selected"),e.$.downloadButton.setAttribute("aria-expanded",!0),e.downloadMenu||(e.downloadMenu=document.createElement("div"),e.downloadMenu.classList.add("smart-grid-column-menu","smart-grid-download-menu"),e.downloadMenu.setAttribute("theme",e.getAttribute("theme")),e.downloadMenu.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),e.downloadMenu.classList.add("smart-animate"),e._createMenuItems(),e.downloadMenu.style.height="auto",e.isInShadowDOM?e.getRootNode().appendChild(e.downloadMenu):document.body.appendChild(e.downloadMenu);const t=e.$.downloadButton.getBoundingClientRect();let a=t.left+window.pageXOffset,o=t.bottom+window.pageYOffset;a+e.downloadMenu.offsetWidth>window.innerWidth&&(a=t.right+window.pageXOffset-e.downloadMenu.offsetWidth,a+e.downloadMenu.offsetWidth>window.innerWidth&&(a=window.innerWidth-e.downloadMenu.offsetWidth)),e.downloadMenu.style.left=a+"px",e.downloadMenu.style.top=o+"px",e.downloadMenu.classList.remove("smart-hidden"),e.downloadMenu.classList.add("open")}_closeViewsMenu(){const e=this,t=e.viewsMenu;t&&(t.parentNode&&(t.classList.remove("open"),setTimeout((()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),100)),t.classList.remove("open"),e.$.viewsButton.classList.remove("selected"),e.$.viewsButton.removeAttribute("aria-expanded"))}_openViewsMenu(){const e=this;if(e.grid.editing.isEditing&&e.grid.cancelEdit(),e.viewsMenu&&e.viewsMenu.classList.contains("open"))return void e._closeViewsMenu();e.$.headerDropDown.classList.remove("group-panel","customize-panel","filter-panel","sort-panel","search-panel","format-panel"),e.$.group.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e.closePanel(),e.$.viewsButton.classList.add("selected"),e.$.viewsButton.setAttribute("aria-expanded",!0),e.viewsMenu||(e.viewsMenu=document.createElement("div"),e.viewsMenu.classList.add("smart-grid-column-menu","smart-grid-download-menu"),e.viewsMenu.setAttribute("theme",e.getAttribute("theme")),e.viewsMenu.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),e.viewsMenu.classList.add("smart-animate"),e._createViewsMenuItems("views"),e.viewsMenu.style.height="auto",e.isInShadowDOM?e.getRootNode().appendChild(e.viewsMenu):document.body.appendChild(e.viewsMenu);const t=e.$.viewsButton.getBoundingClientRect();let a=t.left+window.pageXOffset,o=t.bottom+window.pageYOffset;a+e.viewsMenu.offsetWidth>window.innerWidth&&(a=t.right+window.pageXOffset-e.downloadMenu.offsetWidth,a+e.viewsMenu.offsetWidth>window.innerWidth&&(a=window.innerWidth-e.viewsMenu.offsetWidth)),e.viewsMenu.style.left=a+"px",e.viewsMenu.style.top=o+"px",e.viewsMenu.classList.remove("smart-hidden"),e.viewsMenu.classList.add("open")}_refresh(){const e=this,t=e.grid;e._refreshColumns("refresh");let a=!1;for(let t=0;t<e.columns.length;t++)if("number"===e.columns[t].dataType){a=!0;break}if(t.header.buttons.indexOf("sort")>=0&&t.sorting.enabled?e.$.sortButton.classList.remove("smart-hidden"):e.$.sortButton.classList.add("smart-hidden"),t.header.buttons.indexOf("filter")>=0&&t.filtering.enabled?e.$.filterButton.classList.remove("smart-hidden"):e.$.filterButton.classList.add("smart-hidden"),t.header.buttons.indexOf("group")>=0&&t.grouping.enabled&&"grid"===t.view?e.$.groupButton.classList.remove("smart-hidden"):e.$.groupButton.classList.add("smart-hidden"),t.header.buttons.indexOf("columns")>=0?e.$.customizeButton.classList.remove("smart-hidden"):e.$.customizeButton.classList.add("smart-hidden"),t.header.buttons.indexOf("search")>=0?e.$.searchButton.classList.remove("smart-hidden"):e.$.searchButton.classList.add("smart-hidden"),t.header.buttons.indexOf("format")>=0&&a?e.$.formatButton.classList.remove("smart-hidden"):e.$.formatButton.classList.add("smart-hidden"),t.header.buttons.indexOf("delete")>=0?e.$.deleteButton.classList.remove("smart-hidden"):e.$.deleteButton.classList.add("smart-hidden"),t.header.buttons.indexOf("download")>=0?e.$.downloadButton.classList.remove("smart-hidden"):e.$.downloadButton.classList.add("smart-hidden"),t.header.buttons.indexOf("views")>=0?e.$.viewsButton.classList.remove("smart-hidden"):e.$.viewsButton.classList.add("smart-hidden"),e.$.downloadButton.onpointerup=a=>{t.closeMenu(),e._openDownloadMenu(),a.stopPropagation()},e.$.viewsButton.onpointerup=a=>{t.closeMenu(),e._openViewsMenu(),a.stopPropagation()},t._sortedColumns){const a=[],o=[],n=[];for(let e=0;e<t._sortedColumns.length;e++){const s=t._sortedColumns[e];a.push(s.dataField),o.push(s.sortOrder),n.push(s.dataType)}e._appliedSorting={dataFields:a,dataTypes:n,orderBy:o},e._refreshSortButton()}if("grid"===t.view){const a={filters:[],operator:"and"},o=t.getFilteredColumns();if(o)for(let e in o){const t=o[e];for(let o=0;o<t.filters.length;o++){const n=t.filters[o];a.filters.push([e,n.condition,n.value])}}e._appliedFiltering&&(a.operator=e._appliedFiltering.operator),e._appliedFiltering=a,e._refreshFilterButton()}else e.$.sortButton.classList.add("smart-hidden"),e.$.filterButton.classList.add("smart-hidden");e._appliedGrouping?e._appliedGrouping.dataFields=t.dataSource.groupBy:e._appliedGrouping={dataFields:t.dataSource.groupBy,expandAll:!1,collapseAll:!1},e._refreshGroupButton(),e._refreshDeleteButton(),e._refreshDownloadButton(),e._refreshCustomizeButton(),e._refreshViewsButton(),e.refreshTools()}_refreshViewsButton(){const e=this;let t=e.grid.localize("viewGrid");switch(e.grid.view){case"kanban":t=e.grid.localize("viewKanban"),e.$.viewsButton.classList.add("kanban");break;case"grid":e.$.viewsButton.classList.remove("kanban"),t=e.grid.localize("viewGrid")}e.$.viewsButton.innerHTML='<div class="smart-tool-label" role="presentation">'+t+"</div>"}_refreshDownloadButton(){this.$.downloadButton.innerHTML='<div class="smart-tool-label" role="presentation">'+this.grid.localize("download")+"</div>"}_openRowSettingsDialog(e){let t=this;t.getSelectedRows||(t=t.grid);const a=t.editing.dialog.enabled,o=t.editing.mode,n=t.context;t.context=t,t.editing.dialog.enabled=!0,t.editing.mode="row",t._settingsDialogRowId=e,t.beginEdit(e),t._endToolbarEdit?(t.removeEventListener("endEdit",t._endToolbarEdit,null),t.removeEventListener("cancelEdit",t._endToolbarEdit,null)):t._endToolbarEdit=()=>{t.context=t,t.editing.dialog.enabled=a,t.editing.mode=o,t.context=n,delete t._settingsDialogRowId,delete t._dialogEdit},t.addEventListener("endEdit",t._endToolbarEdit),t.addEventListener("cancelEdit",t._endToolbarEdit)}_refreshDeleteButton(){let e=this;if(e.getSelectedRows||(e=e.grid),-1===e.header.buttons.indexOf("delete"))return;const t=e.getSelectedRows().length,a=e.querySelector("smart-grid-toolbar").$.deleteButton;0!==t?(a.classList.remove("smart-hidden"),a.firstElementChild.innerHTML=1===t?e.localize("deleteByOne"):e.localize("deleteByMultiple",{n:t}),a.classList.add("selected"),a.onclick=()=>{const t=e.getSelectedRows().map((e=>e[0]));this.grid.removeRow(t)}):a.classList.add("smart-hidden")}_refreshFromSelection(){this.querySelector("smart-grid-toolbar")._refreshDeleteButton()}openGroupPanel(e){const t=this;let a;const o=t.grid;t.$.headerDropDown.classList.add("group-panel"),t.$.headerDropDown.classList.remove("customize-panel","filter-panel","sort-panel","search-panel","format-panel"),t.$.group.classList.remove("smart-hidden"),t.$.filter.classList.add("smart-hidden"),t.$.customize.classList.add("smart-hidden"),t.$.sort.classList.add("smart-hidden"),t.$.search.classList.add("smart-hidden"),t.$.format.classList.add("smart-hidden"),t._closeDownloadMenu(),t._closeViewsMenu(),t._refreshColumns("group"),o.closeMenu();const n=t.columns.map((e=>{const a=Object.assign({},e);if(t._appliedGrouping&&t._appliedGrouping.dataFields){const e=t._appliedGrouping.dataFields.indexOf(a.dataField);a.groupIndex=e}return a})).filter((e=>e.allowGroup));e&&t._appliedGrouping&&-1===t._appliedGrouping.dataFields.indexOf(e.dataField)&&(n.find((t=>t.dataField===e.dataField)).groupIndex=t._appliedGrouping.dataFields.length),t._groupPartCreated?(a=t.$.group.firstElementChild,a.rightToLeft=t.rightToLeft,a.dataSource=n,a.locale=t.locale,a.messages=t._innerElementMessages.groupPanel):(a=document.createElement("smart-group-panel"),a.rightToLeft=t.rightToLeft,a.animation=t.animation,a.locale=t.locale,a.messages=t._innerElementMessages.groupPanel,a.theme=t.theme,a.dataSource=n,t.$.group.appendChild(a),t._groupPartCreated=!0,a.onExpandAll=()=>{if(t._appliedGrouping.expandAll)return t._appliedGrouping.expandAll=!1,void a.querySelector(".smart-group-panel-expand-button").removeAttribute("active");t._appliedGrouping.expandAll=!0,t._appliedGrouping.collapseAll=!1,a.querySelector(".smart-group-panel-expand-button").setAttribute("active",""),a.querySelector(".smart-group-panel-collapse-button").removeAttribute("active")},a.onCollapseAll=()=>{if(t._appliedGrouping.collapseAll)return t._appliedGrouping.collapseAll=!1,void a.querySelector(".smart-group-panel-collapse-button").removeAttribute("active");t._appliedGrouping.expandAll=!1,t._appliedGrouping.collapseAll=!0,a.querySelector(".smart-group-panel-collapse-button").setAttribute("active",""),a.querySelector(".smart-group-panel-expand-button").removeAttribute("active")},a.addEventListener("apply",(e=>{const a=e.detail.sortByInfo,n=t._appliedGrouping.dataFields;t._appliedGrouping.dataFields=a.dataFields;const s=o.onRowInserted;if(o.onRowInserted=null,o.beginUpdate(),o.grouping.autoHideGroupColumn&&n)for(let e=0;e<n.length;e++){const t=o.columnByDataField[n[e]];t&&(t.visible=!0)}o.clearGroups();for(let e=0;e<a.dataFields.length;e++){const t=a.dataFields[e];o.addGroup(t)}t._appliedGrouping.expandAll&&o.expandAllRows(),t._appliedGrouping.collapseAll&&o.collapseAllRows(),o.endUpdate();const i=[];for(let e=0;e<o.dataSource.groupBy.length;e++)i.push(o.dataSource.groupBy[e]);o.$.fireEvent("group",{groups:i}),o.paging.enabled&&o._refreshPagesCount(),o.onRowInserted=s}))),t._refreshGroupButton(),t._openHeaderDropDown(t.$.groupButton)}_refreshGroupButton(){const e=this,t=e._appliedGrouping.dataFields?e._appliedGrouping.dataFields.length:0;if(0===t){const t=e.localize("group");return e.$.groupButton.firstElementChild.innerHTML!==t&&(e.$.groupButton.firstElementChild.innerHTML=t),void e.$.groupButton.classList.remove("grouped")}e.$.groupButton.firstElementChild.innerHTML=1===t?e.localize("groupedByOne"):e.localize("groupedByMultiple",{n:t}),e.$.groupButton.classList.add("grouped")}openSearchPanel(){this._openSearchPanel()}_closeSearchPanel(){this._search("",!1),super._closeSearchPanel()}_openSearchPanel(){const e=this,t=e.grid;e.$.headerDropDown.classList.add("search-panel"),e.$.headerDropDown.classList.remove("customize-panel","filter-panel","sort-panel","group-panel","format-panel"),e.$.search.classList.remove("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.group.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e._openHeaderDropDown(e.$.searchButton),e._closeDownloadMenu(),e._closeViewsMenu(),t.closeMenu();const a=[],o=t.getVisibleRows();for(let e=0;e<o.length;e++)a.push(Object.assign(o[e].data));const n=new Smart.DataAdapter({id:"id",observable:!1,dataSource:a,dataFields:t.dataSource.dataFields});e._searchInfo={source:n,stringDataFields:e.dataSource.dataFields.filter((e=>"string"===e.dataType)).map((e=>e.name))},""!==e.$.searchInput.value&&e._search(e.$.searchInput.value,!1)}_search(e,t=!0){const a=this;if(!a._searchInfo)return;if(a._searchInfo.query=e,""===e)return a.$.search.classList.remove("matches","no-matches"),delete a._searchInfo.foundIdsArray,delete a._searchInfo.foundIdsObject,delete a._searchInfo.highlighted,a.grid.highlighted=null,void a.grid._recycle(!1);const o=a._searchInfo.source,n=[],s=[],i={};a._searchInfo.stringDataFields.forEach((t=>{const a=new Smart.Utilities.FilterGroup,o=a.createFilter("string",e,"CONTAINS");a.addFilter("or",o),n.push([t,a])})),o._filter(n,"or");for(let e=0;e<o.length;e++){const t=o[e];!1!==t.$.filtered&&(s.push(t.$.id),i[t.$.id]=!0)}if(a._searchInfo.foundIdsArray=s,a._searchInfo.foundIdsObject=i,a.grid.highlighted=null,s.length>0)return a.$.search.classList.remove("no-matches"),a.$.search.classList.add("matches"),a.$.searchLabel.innerHTML=a.localize("found",{nth:t?1:0,n:s.length}),a._searchInfo.highlighted=s[0],a.grid.highlighted=a._searchInfo.highlighted,a.grid.ensureVisible(a._searchInfo.highlighted),void a.grid._recycle(!1);a.$.search.classList.remove("matches"),a.$.search.classList.add("no-matches"),a.$.searchLabel.innerHTML=a.localize("found",{nth:0,n:0})}_refreshCustomizeButton(){const e=this,t=e.grid;let a=0;if("kanban"===t.view&&t._kanban)return e.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+t._kanban.localize("customize")+"</div>",e.$.customizeButton.classList.remove("hidden"),void e.$.customizeButton.classList.add("smart-hidden");for(let e=0;e<t.columns.length;e++){const o=t.columns[e];o.autoGenerated||!1!==o._visible&&(t.grouping&&t.grouping.autoHideGroupColumn&&t.dataSource.groupBy.indexOf(o.dataField)>=0||o.visible||a++)}const o=-1===t.header.buttons.indexOf("views");a>0&&o?(e.$.customizeButton.innerHTML=1===a?'<div class="smart-tool-label" role="presentation">'+t.localize("customizeOne",{n:a})+"</div>":'<div class="smart-tool-label" role="presentation">'+t.localize("customizeHidden",{n:a})+"</div>",e.$.customizeButton.classList.add("hidden")):(e.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+t.localize("customize")+"</div>",e.$.customizeButton.classList.remove("hidden"))}_applyColumns(e,t){const a=this,o=a.grid;o.beginUpdate();let n=0,s=[],i=[],r=[];const l=o.onColumnChange;o.onColumnChange=null;for(let t in e){const a=e[t],l=o.columnByDataField[a.dataField];l&&(l.visible!==a.visible&&(s.push(a),i.push(l.visible),r.push(a.visible)),l.visible=a.visible,a.visible||n++)}o.onColumnChange=l,o.onColumnChange&&o.onColumnChange(s,"visible",i,r),n>0?(a.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+o.localize("customizeHidden",{n})+"</div>",a.$.customizeButton.classList.add("hidden")):(a.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+o.localize("customize")+"</div>",a.$.customizeButton.classList.remove("hidden"));for(let e=0;e<t.length;e++){const a=t[e],n=a.oldIndex,s=a.newIndex,i=o.columns[s+1],r=o.columns[s-1],l=o.columns[n];i?l.columnGroup=i.columnGroup:r&&(l.columnGroup=r.columnGroup),o.reorderColumns(n,s,!0)}o.endUpdate()}});
6
+ Smart("smart-grid-toolbar",class extends Smart.DataView{template(){return'<div id="container" role="presentation">\n <div id="header" class="smart-data-view-header" role="toolbar">\n <div id="viewsButton" class="smart-data-view-header-button smart-data-view-views-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Views"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="customizeButton" class="smart-data-view-header-button smart-data-view-customize-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Customize cards"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="filterButton" class="smart-data-view-header-button smart-data-view-filter-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Filter"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="sortButton" class="smart-data-view-header-button smart-data-view-sort-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Sort"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="groupButton" class="smart-data-view-header-button smart-data-view-group-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Group"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="formatButton" class="smart-data-view-header-button smart-data-view-format-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Format"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="deleteButton" class="smart-data-view-header-button smart-data-view-delete-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Delete"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="downloadButton" class="smart-data-view-header-button smart-data-view-download-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Download"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="searchButton" class="smart-data-view-header-button smart-data-view-search-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Search"></div>\n <div id="headerDropDown" owner class="smart-data-view-header-drop-down smart-visibility-hidden" role="dialog">\n <div id="customize" class="smart-hidden" role="presentation"></div>\n <div id="filter" class="smart-hidden" role="presentation"></div>\n <div id="sort" class="smart-hidden" role="presentation"></div>\n <div id="group" class="smart-hidden" role="presentation"></div>\n <div id="format" class="smart-hidden" role="presentation"></div>\n <div id="search" class="smart-data-view-search-box smart-hidden" role="presentation">\n <input type="text" id="searchInput" spellcheck="false" aria-label="Search" />\n <div id="searchLabel" class="smart-data-view-search-label smart-unselectable"></div>\n <div id="searchPrev" class="smart-data-view-search-prev" role="button" aria-label="Previous"></div>\n <div id="searchNext" class="smart-data-view-search-next" role="button" aria-label="Next"></div>\n <div id="searchClose" class="smart-data-view-search-close" role="button" aria-label="Close search box"></div>\n </div>\n </div>\n </div>\n </div>'}refreshTools(){const e=this;if(e.isRendered&&e.grid&&(e.grid.offsetWidth<600?e.querySelectorAll(".smart-tool-label").forEach((e=>{e.classList.add("smart-hidden")})):e.querySelectorAll(".smart-tool-label").forEach((e=>{e.classList.remove("smart-hidden")})),e.refreshHeaderDropDownPosition(),e.grid)){const t=e.grid;if(t.dataSource&&t.dataSource.boundSource){const a=t.dataSource&&t.dataSource.virtualDataSource&&!t.dataSource.virtualDataSourceOnExpand&&t.dataSource.length>t.virtualModeCachedRowsCount&&"infinite"!==t.scrolling;if(e.dataSource&&t.dataSource&&e.dataSource.length!==t.dataSource.length||a)if(a){const a=Array.isArray(t.dataSource.boundSource)?t.dataSource.boundSource:t.dataSource.boundSource.toArray();e.dataSource=new Smart.DataAdapter({observable:!1,dataSource:[...a],dataFields:t.dataSource.dataFields})}else e.dataSource=t.dataSource;(t=>{const a=t?"add":"remove";e.$.filterButton.classList[a]("smart-disabled"),e.$.sortButton.classList[a]("smart-disabled"),e.$.groupButton.classList[a]("smart-disabled"),e.$.formatButton.classList[a]("smart-disabled"),e.$.searchButton.classList[a]("smart-disabled"),e.$.downloadButton.classList[a]("smart-disabled")})(e.dataSource&&0===e.dataSource.length),0===t.columns.length?e.$.customizeButton.classList.add("smart-disabled"):e.$.customizeButton.classList.remove("smart-disabled")}}}get hasStyleObserver(){return!1}render(){const e=this;e._appliedFiltering={filters:[],operator:"and"},e._appliedSorting={dataFields:[],dataTypes:[],orderBy:[]},e._localizeHeader(),e._getInnerElementMessages(),super.render()}openFormatPanel(){const e=this,t=e.dataSource;if(!t||0===t.length||e.disabled||"none"===e.headerPosition)return;let a;if(e._refreshColumns("format"),e.grid.closeMenu(),e._editInfo&&e._editInfo.window.close(),e._closeDownloadMenu(),e._closeViewsMenu(),e.$.headerDropDown.classList.add("format-panel"),e.$.headerDropDown.classList.remove("customize-panel","sort-panel","search-panel","filter-panel"),e.$.format.classList.remove("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.group&&e.$.group.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e._closeSearchPanel(),e._formatPartCreated)a=e.$.format.firstElementChild,a.columns=e.columns,a.dataSource=e.dataSource,a.locale=e.locale,a.messages=e._innerElementMessages.formattingPanel,a.rightToLeft=e.rightToLeft;else{a=document.createElement("smart-formatting-panel"),a.animation=e.animation,a.columns=e.columns,a.dataSource=e.dataSource,a.locale=e.locale,a.messages=e._innerElementMessages.formattingPanel,a.rightToLeft=e.rightToLeft,a.theme=e.theme,a.unfocusable=!1,a.ownerElement=e,a.dropDownAppendTo="body",e._formattingPanel=a,e.$.format.appendChild(a);const t=document.createElement("div");t.className="smart-format-panel smart-grid-panel-container-footer",t.setAttribute("role","presentation"),t.innerHTML=`<div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation"><span class="smart-grid-panel-cancel-button" role="button">${e.localize("cancel")}</span><span class="smart-grid-panel-apply-button" role="button">${e.localize("apply")}</span></div>`,e._formattingPanel.$.apply=t.querySelector(".smart-grid-panel-apply-button"),e._formattingPanel.$.cancel=t.querySelector(".smart-grid-panel-cancel-button"),e.$.format.appendChild(t),e._formatPartCreated=!0,t.applyButton=t.querySelector(".smart-grid-panel-apply-button"),t.cancelButton=t.querySelector(".smart-grid-panel-cancel-button"),t.applyButton.onclick=()=>{a.$.fireEvent("apply"),e.grid._conditionalFormattingChanged=!0,e.grid._conditionalFormatting=a.apply(),e.grid.conditionalFormatting=a.getItems(),e.grid._recycle(!1),e.grid._conditionalFormattingChanged=!1},t.cancelButton.onclick=()=>{a.$.fireEvent("cancel")},e.grid.conditionalFormatting&&(a.items=e.grid.conditionalFormatting)}a.focus(),e._openHeaderDropDown(e.$.formatButton)}_openHeaderDropDown(e){const t=this;t.$.headerDropDown.parentElement!==document.body&&(document.body.appendChild(t.$.headerDropDown),t.$.headerDropDown.addEventListener("apply",(e=>{const a=t._getDropDownType();t._applyHandler(e),t.grid.$.fireEvent("batchChange",{type:a})})),t.$.headerDropDown.addEventListener("cancel",(()=>{const e=t._getDropDownType();t.closePanel(),t.grid.$.fireEvent("batchCancel",{type:e})}))),super._openHeaderDropDown(e),t.refreshHeaderDropDownPosition(e)}refreshHeaderDropDownPosition(e){const t=this;if(!t.$.headerDropDown||t.$.headerDropDown&&!t.$.headerDropDown.classList.contains("open"))return void(t._dropDownTarget=e);e?t._dropDownTarget=e:t._dropDownTarget&&(e=t._dropDownTarget),t.$.headerDropDown.style.top=t.grid.offset(t.grid).top+t.grid.$.header.offsetHeight+"px";const a=()=>{if(e){const a=t.grid.offset(e);a.left+t.$.headerDropDown.offsetWidth<document.body.scrollLeft+document.body.offsetWidth?t.$.headerDropDown.style.left=a.left+"px":t.$.headerDropDown.style.left=document.body.scrollLeft+document.body.offsetWidth-t.$.headerDropDown.offsetWidth+"px"}else t.$.headerDropDown.style.left=t.grid.offset(t.grid).left+"px"};t.grid.offsetWidth<600&&t.$.headerDropDown.offsetWidth>t.grid.offsetWidth?(t.$.headerDropDown.style.width="90%",t.$.headerDropDown.style.left=t.grid.offset(t.grid).left+"px"):(t.$.headerDropDown.style.width="",a())}openFilterPanel(e){const t=this,a=t.dataSource;t._refreshColumns("filter");const o=this.columns.map((e=>{const t=Object.assign({},e),o=a.dataFields.find((e=>e.name===t.dataField));return o&&(t.dataType=o.dataType),t})).filter((e=>e.allowFilter));if(super.openFilterPanel(o,null),t._closeDownloadMenu(),t._closeViewsMenu(),t.grid.closeMenu(),e){const a=t.$.headerDropDown.querySelector("smart-multi-column-filter-panel");a.$.itemsContainer.appendChild(a._createItem(t.columns.find((t=>t.dataField===e.dataField)),"string"===e.dataType?"CONTAINS":"EQUAL",""));const o=a.querySelectorAll(".smart-grid-panel-item");setTimeout((()=>{o[o.length-1].querySelector(".editor").focus()}),350)}}openSortPanel(e){const t=this,a=t.dataSource;t._refreshColumns("sort");const o=t.columns.map((e=>{const o=Object.assign({},e),n=t._appliedSorting.dataFields.indexOf(o.dataField),s=a.dataFields.find((e=>e.name===o.dataField));return s&&(o.dataType=s.dataType,o.sortIndex=n,-1!==n&&(o.sortDirection=t._appliedSorting.orderBy[n])),o})).filter((e=>e.allowSort));if(e&&t._appliedSorting&&-1===t._appliedSorting.dataFields.indexOf(e.dataField)){const a=o.find((t=>t.dataField===e.dataField));a.sortDirection="ascending",a.sortIndex=t._appliedSorting.dataFields.length}super.openSortPanel(o),t._closeDownloadMenu(),t._closeViewsMenu();const n=t.grid;n.closeMenu();const s=t.$.headerDropDown.querySelector("smart-sort-panel");if(!s)return;s.grid=n,s.$.maintainSortContainer.classList.remove("smart-hidden"),n.sorting.maintainSort?s.$.maintainSortContainer.firstElementChild.setAttribute("active",""):s.$.maintainSortContainer.firstElementChild.removeAttribute("active"),s._changeApplyButtonText();const i=s.$.inputNotSorted,r=()=>{const e=s.querySelectorAll(".smart-grid-panel-item");"many"===t.grid.sorting.mode||e.length<1?i.classList.remove("smart-visibility-hidden"):e.length>=1&&i.classList.add("smart-visibility-hidden")};s.onDataSourceChange=()=>{r()},r()}openCustomizePanel(){const e=this;if(e.disabled||"none"===e.headerPosition)return;e._closeDownloadMenu(),e._closeViewsMenu(),e._refreshColumns("customize");let t=e.columns;const a=e.grid;a.closeMenu(),a.appearance.showColumnGroupsInColumnPanel&&(t=[],a.columns.forEach((e=>{if(!e.columnGroup){const a={label:e.label,dataField:e.dataField,level:0,parentDataField:null,dataType:e.dataType||"string",columnGroup:e.columnGroup||null,allowHide:void 0===e.allowHide||e.allowHide,allowSort:void 0===e.allowSort||e.allowSort,allowFilter:void 0===e.allowFilter||e.allowFilter,allowGroup:void 0===e.allowGroup||e.allowGroup,visible:void 0===e.visible||e.visible};t.push(a)}})),a._columnGroups.forEach((e=>{const a={dataField:e.name,label:e.label,level:0,disableDrag:!0,disableToggle:!1,allowHide:!0};if(t.push(a),e.columns){let o=e.columns.length,n=0,s=[],i=[];e.columns.forEach((a=>{const r={label:a.label,dataField:a.dataField,level:1,parentDataField:e.name,dataType:a.dataType||"string",columnGroup:a.columnGroup||null,allowHide:void 0===a.allowHide||a.allowHide,allowSort:void 0===a.allowSort||a.allowSort,allowFilter:void 0===a.allowFilter||a.allowFilter,allowGroup:void 0===a.allowGroup||a.allowGroup,visible:void 0===a.visible||a.visible};!1===r.allowHide&&(o--,i.push(r.dataField)),r.visible||(n++,s.push(r.dataField)),t.push(r)})),o<=0&&(a.allowHide=!1,a.disableToggle=!0),e.columns.length===n||o===n&&i.toString()!==s.toString()?a.visible=!1:a.visible=!0}})));const o=e.$.customize,n=t.map((t=>{const a={};return a.visible=t.visible,a.label=t.label,a.dataField=t.dataField,-1!==[e.coverField,e.titleField].indexOf(a.dataField)?a.disableToggle=!0:a.disableToggle=!1,void 0!==t.level&&(a.level=t.level),t.disableDrag&&(a.disableDrag=!0),t.parentDataField&&(a.parentDataField=t.parentDataField),t.allowHide||(a.disableToggle=!0),a}));let s;if(e._closeDialog(),e.$.headerDropDown.classList.add("customize-panel"),e.$.headerDropDown.classList.remove("filter-panel","sort-panel","search-panel","group-panel","format-panel"),o.classList.remove("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e.$.group.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e._closeSearchPanel(),e._customizePartCreated)s=o.querySelector("smart-column-panel"),s.locale=e.locale,s.messages=e._innerElementMessages.columnPanel,s.set("dataSource",n),s.propertyChangedHandler("dataSource",void 0,n),s.rightToLeft=e.rightToLeft;else{const t=document.createDocumentFragment(),a=document.createElement("smart-column-panel");a.rightToLeft=e.rightToLeft,a.animation=e.animation,a.dataSource=n,a.locale=e.locale,a.messages=e._innerElementMessages.columnPanel,a.theme=e.theme,t.appendChild(a),e.$.customize.appendChild(t),e._customizePartCreated=!0}e._changedVisibility=new Map,e._openHeaderDropDown(e.$.customizeButton)}_applyFilter(e,t){const a=this;a.grid.beginUpdate(),a.grid.context=a.grid,a.grid.clearFilter();for(let t=0;t<e.length;t++){const o=e[t],n=o[0],s=o[1];a.grid.columnByDataField[n].filter=s}a.grid._filterOperator=t,a.grid.endUpdate(),a.grid.refreshFilters(),a.grid.context=document}_applySort(){const e=this,t=e._appliedSorting;e.grid.beginUpdate(),e.grid.sorting.maintainSort=t.maintainSort,e.grid.context=e.grid,e.grid.clearSort();for(let a=0;a<t.dataFields.length;a++)e.grid.sortBy(t.dataFields[a],t.orderBy[a]);e.grid.endUpdate(),e.grid.context=document}_getDropDownType(){const e=this;let t=null;return e.$.headerDropDown.classList.contains("filter-panel")?t="filter":e.$.headerDropDown.classList.contains("sort-panel")?t="sort":e.$.headerDropDown.classList.contains("search-panel")?t="search":e.$.headerDropDown.classList.contains("group-panel")?t="group":e.$.headerDropDown.classList.contains("format-panel")?t="format":e.$.headerDropDown.classList.contains("customize-panel")&&(t="customize"),t}_applyHandler(e){const t=this,a=e.target,o=e.detail,n=t.$.customize;if(t.grid&&"kanban"===t.grid.view&&t.grid._kanban&&n.contains(a))return t.grid._kanban._applyHandler(e,"customize"),void t.closePanel();n.contains(a)?t._applyColumns(o.value,o.moves):t.$.filter.contains(a)?t.addFilter(o.filters,o.operator,o.value):t.$.sort.contains(a)&&t.addSort(o.sortByInfo),t.closePanel()}_documentUpHandler(e){const t=this;let a=e.originalEvent.target;const o=t.grid.$.header;if(t.shadowRoot&&a===t&&(a=e.originalEvent.composedPath()[0]),t._closeDownloadMenu(),t._closeViewsMenu(),!("none"===t.headerPosition||t.$.headerDropDown.classList.contains("smart-visibility-hidden")||t.$.headerDropDown.classList.contains("search-panel")||a!==o&&o.contains(a))){const n=a.closest("smart-scroll-viewer"),s=a.closest(".smart-drop-down");if((!n||!o.contains(n.ownerElement))&&(!s||s.ownerElement&&!o.contains(s.ownerElement))){const a=e.originalEvent.composedPath();for(let e=0;e<a.length;e++){const t=a[e];if(t&&t.classList&&t.classList.contains("smart-data-view-header-drop-down"))return;if(t&&t.classList&&t.classList.contains("smart-formatting-panel-popup"))return}if(n&&n.ownerElement){const e=n.ownerElement.parents;for(let t=0;t<e.length;t++){const a=e[t];if(a&&a.classList&&a.classList.contains("smart-data-view-header-drop-down"))return}}if(s&&s.ownerElement){const e=s.ownerElement.parents;for(let t=0;t<e.length;t++){const a=e[t];if(a&&a.classList&&a.classList.contains("smart-data-view-header-drop-down"))return}}if(t.$.headerDropDown.querySelector("[open]"))return;t.closePanel()}}}_refreshColumns(e){const t=this,a=t.grid;let o,n=new Map;if("kanban"===a.view&&a._kanban)switch(e){case"customize":return o=a._kanban._getCustomizeColumnPanelDataSource(),o=JSON.parse(JSON.stringify(o)),t._refreshCustomizeButton(),void(t.columns=o)}o=Array.isArray(a.columns)?[...a.columns]:[...a.columns.toArray()],o=o.filter((t=>!1!==t._visible&&("filter"!==e&&"sort"!==e||!1!==t.visible))),o=o.map((e=>{let t=e.allowHide;return a.grouping&&a.grouping.autoHideGroupColumn&&a.dataSource.groupBy.indexOf(e.dataField)>=0&&(t=!1),{label:e.label,dataField:e.dataField,dataType:e.dataType||"string",columnGroup:e.columnGroup||null,allowHide:void 0===e.allowHide||t,allowSort:void 0===e.allowSort||e.allowSort,allowFilter:void 0===e.allowFilter||e.allowFilter,allowGroup:void 0===e.allowGroup||e.allowGroup,visible:void 0===e.visible||e.visible,sortIndex:void 0!==e.sortIndex&&null!==e.sortIndex?e.sortIndex:-1,sortDirection:void 0!==e.sortOrder?e.sortOrder:null}})),o=JSON.parse(JSON.stringify(o)),o.forEach((e=>{let t=e.columnGroup?e.columnGroup+"."+e.label:e.label,a=1;for(;n.get(t);)t=e.columnGroup?e.columnGroup+"."+e.label+` (${a})`:e.label+` (${a})`,a++;n.set(t,e),e.label=t})),t.columns=o,t._refreshCustomizeButton()}_init(e){const t=this;if(t.grid=e,e.dataSource&&e.dataSource.boundSource){t._refreshColumns("init");const a=Array.isArray(e.dataSource.boundSource)?e.dataSource.boundSource:e.dataSource.boundSource.toArray();t.dataSource=new Smart.DataAdapter({observable:!1,dataSource:[...a],dataFields:e.dataSource.dataFields})}t.grid._openRowSettingsDialog=t._openRowSettingsDialog,t.rightToLeft=t.grid.rightToLeft,t.refreshTools(),t.$.headerDropDown.onclick=e=>{t.grid._headerClickHandler(e),e.stopPropagation(),e.preventDefault()},t.grid.removeEventListener("change",t._refreshFromSelection),t.grid.addEventListener("change",t._refreshFromSelection),e.header.onInit&&e.header.onInit(t)}_removeMenu(){const e=this;if(e.downloadMenu){const t=e.downloadMenu.querySelector("smart-menu");t&&e.downloadMenu.removeChild(t)}}_removeViewsMenu(){const e=this;if(e.viewsMenu){const t=e.viewsMenu.querySelector("smart-menu");t&&e.viewsMenu.removeChild(t)}}_createViewsMenuItems(){const e=this,t=e.grid;e._removeViewsMenu();const a=document.createElement("smart-menu"),o=document.createDocumentFragment();a.mode="vertical",a.dropDownAppendTo="body",a.classList.add("smart-grid-views-menu"),a.rightToLeft=t.rightToLeft;const n=(e,a)=>{const o=document.createElement("smart-menu-item");let n="#D50000",s="smart-icon-table-alt";switch(a){case"grid":n="#3f51b5",s="smart-icon-table-alt","grid"===t.view&&o.setAttribute("focus","");break;case"pdf":n="#f4511e";break;case"kanban":n="#C40093",s="smart-icon-kanban","kanban"===t.view&&o.setAttribute("focus","");break;case"json":n="#8e24aa"}return o.label='<span style="color: '+n+'" class="smart-grid-icon '+s+'"></span>'+e,o.value=a,o};o.appendChild(n(t.localize("viewGrid"),"grid")),o.appendChild(n(t.localize("viewKanban"),"kanban")),a.appendChild(o),e.viewsMenu.appendChild(a),a.onItemClick=t=>{e._setView(t.detail.value)}}_setView(e){const t=this,a=t.grid;if(a.view!==e){if("kanban"===e){const e=a.context;a.context=a,a.view="kanban",a.context=e,a._kanbanInitialized&&a.columnByDataField.taskStatus?(a._showKanbanView(),t._refresh()):(delete a._kanbanInitialized,a._initKanbanView())}else"grid"===e&&(a.view="grid",a._hideKanbanView(),t._refresh());a.$.fireEvent("viewChanged",{view:e}),t._refresh()}}_createMenuItems(){const e=this,t=e.grid;e._removeMenu();const a=document.createElement("smart-menu"),o=document.createDocumentFragment();a.mode="vertical",a.dropDownAppendTo="body",a.classList.add("smart-grid-download-menu"),a.rightToLeft=t.rightToLeft;const n=(e,t)=>{const a=document.createElement("smart-menu-item");let o="#D50000";switch(t){case"csv":o="#3f51b5";break;case"pdf":o="#f4511e";break;case"xlsx":o="#0b8043";break;case"json":o="#8e24aa"}const n='<span style="position: absolute; top: 0px; font-size: 10px; color: '+o+'">'+t+"</span>";return a.label='<span style="color: '+o+'" class="smart-grid-icon smart-icon-docs"></span>'+n+e,a.value=t,a};o.appendChild(n(t.localize("download")+" CSV","csv")),o.appendChild(n(t.localize("download")+" XLSX","xlsx")),o.appendChild(n(t.localize("download")+" JSON","json")),a.appendChild(o),e.downloadMenu.appendChild(a),a.onItemClick=e=>{const a=new Date;t.dataExport.fileName="data_"+a.getFullYear()+"-"+a.getMonth()+"-"+a.getDate(),t.exportData(e.detail.value)}}closePanel(){const e=this;super.closePanel(),e.grid&&e.grid.focus(),e.downloadMenu&&e.downloadMenu.classList.contains("open")?e._closeDownloadMenu():e.viewsMenu&&e.viewsMenu.classList.contains("open")&&e._closeViewsMenu()}_closeDownloadMenu(){const e=this,t=e.downloadMenu;t&&(t.parentNode&&(t.classList.remove("open"),setTimeout((()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),100)),e.$.downloadButton.classList.remove("selected"),e.$.downloadButton.removeAttribute("aria-expanded"),t.classList.remove("open"))}_openDownloadMenu(){const e=this;if(e.grid.editing.isEditing&&e.grid.cancelEdit(),e.downloadMenu&&e.downloadMenu.classList.contains("open"))return void e._closeDownloadMenu();e.$.headerDropDown.classList.remove("group-panel","customize-panel","filter-panel","sort-panel","search-panel","format-panel"),e.$.group.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e.closePanel(),e.$.downloadButton.classList.add("selected"),e.$.downloadButton.setAttribute("aria-expanded",!0),e.downloadMenu||(e.downloadMenu=document.createElement("div"),e.downloadMenu.classList.add("smart-grid-column-menu","smart-grid-download-menu"),e.downloadMenu.setAttribute("theme",e.getAttribute("theme")),e.downloadMenu.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),e.downloadMenu.classList.add("smart-animate"),e._createMenuItems(),e.downloadMenu.style.height="auto",e.isInShadowDOM?e.getRootNode().appendChild(e.downloadMenu):document.body.appendChild(e.downloadMenu);const t=e.$.downloadButton.getBoundingClientRect();let a=t.left+window.pageXOffset,o=t.bottom+window.pageYOffset;a+e.downloadMenu.offsetWidth>window.innerWidth&&(a=t.right+window.pageXOffset-e.downloadMenu.offsetWidth,a+e.downloadMenu.offsetWidth>window.innerWidth&&(a=window.innerWidth-e.downloadMenu.offsetWidth)),e.downloadMenu.style.left=a+"px",e.downloadMenu.style.top=o+"px",e.downloadMenu.classList.remove("smart-hidden"),e.downloadMenu.classList.add("open")}_closeViewsMenu(){const e=this,t=e.viewsMenu;t&&(t.parentNode&&(t.classList.remove("open"),setTimeout((()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),100)),t.classList.remove("open"),e.$.viewsButton.classList.remove("selected"),e.$.viewsButton.removeAttribute("aria-expanded"))}_openViewsMenu(){const e=this;if(e.grid.editing.isEditing&&e.grid.cancelEdit(),e.viewsMenu&&e.viewsMenu.classList.contains("open"))return void e._closeViewsMenu();e.$.headerDropDown.classList.remove("group-panel","customize-panel","filter-panel","sort-panel","search-panel","format-panel"),e.$.group.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e.closePanel(),e.$.viewsButton.classList.add("selected"),e.$.viewsButton.setAttribute("aria-expanded",!0),e.viewsMenu||(e.viewsMenu=document.createElement("div"),e.viewsMenu.classList.add("smart-grid-column-menu","smart-grid-download-menu"),e.viewsMenu.setAttribute("theme",e.getAttribute("theme")),e.viewsMenu.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),e.viewsMenu.classList.add("smart-animate"),e._createViewsMenuItems("views"),e.viewsMenu.style.height="auto",e.isInShadowDOM?e.getRootNode().appendChild(e.viewsMenu):document.body.appendChild(e.viewsMenu);const t=e.$.viewsButton.getBoundingClientRect();let a=t.left+window.pageXOffset,o=t.bottom+window.pageYOffset;a+e.viewsMenu.offsetWidth>window.innerWidth&&(a=t.right+window.pageXOffset-e.downloadMenu.offsetWidth,a+e.viewsMenu.offsetWidth>window.innerWidth&&(a=window.innerWidth-e.viewsMenu.offsetWidth)),e.viewsMenu.style.left=a+"px",e.viewsMenu.style.top=o+"px",e.viewsMenu.classList.remove("smart-hidden"),e.viewsMenu.classList.add("open")}_refresh(){const e=this,t=e.grid;e._refreshColumns("refresh");let a=!1;for(let t=0;t<e.columns.length;t++)if("number"===e.columns[t].dataType){a=!0;break}if(t.header.buttons.indexOf("sort")>=0&&t.sorting.enabled?e.$.sortButton.classList.remove("smart-hidden"):e.$.sortButton.classList.add("smart-hidden"),t.header.buttons.indexOf("filter")>=0&&t.filtering.enabled?e.$.filterButton.classList.remove("smart-hidden"):e.$.filterButton.classList.add("smart-hidden"),t.header.buttons.indexOf("group")>=0&&t.grouping.enabled&&"grid"===t.view?e.$.groupButton.classList.remove("smart-hidden"):e.$.groupButton.classList.add("smart-hidden"),t.header.buttons.indexOf("columns")>=0?e.$.customizeButton.classList.remove("smart-hidden"):e.$.customizeButton.classList.add("smart-hidden"),t.header.buttons.indexOf("search")>=0?e.$.searchButton.classList.remove("smart-hidden"):e.$.searchButton.classList.add("smart-hidden"),t.header.buttons.indexOf("format")>=0&&a?e.$.formatButton.classList.remove("smart-hidden"):e.$.formatButton.classList.add("smart-hidden"),t.header.buttons.indexOf("delete")>=0?e.$.deleteButton.classList.remove("smart-hidden"):e.$.deleteButton.classList.add("smart-hidden"),t.header.buttons.indexOf("download")>=0?e.$.downloadButton.classList.remove("smart-hidden"):e.$.downloadButton.classList.add("smart-hidden"),t.header.buttons.indexOf("views")>=0?e.$.viewsButton.classList.remove("smart-hidden"):e.$.viewsButton.classList.add("smart-hidden"),e.$.downloadButton.onpointerup=a=>{t.closeMenu(),e._openDownloadMenu(),a.stopPropagation()},e.$.viewsButton.onpointerup=a=>{t.closeMenu(),e._openViewsMenu(),a.stopPropagation()},t._sortedColumns){const a=[],o=[],n=[];for(let e=0;e<t._sortedColumns.length;e++){const s=t._sortedColumns[e];a.push(s.dataField),o.push(s.sortOrder),n.push(s.dataType)}e._appliedSorting={dataFields:a,dataTypes:n,orderBy:o},e._refreshSortButton()}if("grid"===t.view){const a={filters:[],operator:"and"},o=t.getFilteredColumns();if(o)for(let e in o){const t=o[e];for(let o=0;o<t.filters.length;o++){const n=t.filters[o];a.filters.push([e,n.condition,n.value])}}e._appliedFiltering&&(a.operator=e._appliedFiltering.operator),e._appliedFiltering=a,e._refreshFilterButton()}else e.$.sortButton.classList.add("smart-hidden"),e.$.filterButton.classList.add("smart-hidden");e._appliedGrouping?e._appliedGrouping.dataFields=t.dataSource.groupBy:e._appliedGrouping={dataFields:t.dataSource.groupBy,expandAll:!1,collapseAll:!1},e._refreshGroupButton(),e._refreshDeleteButton(),e._refreshDownloadButton(),e._refreshCustomizeButton(),e._refreshViewsButton(),e.refreshTools()}_refreshViewsButton(){const e=this;let t=e.grid.localize("viewGrid");switch(e.grid.view){case"kanban":t=e.grid.localize("viewKanban"),e.$.viewsButton.classList.add("kanban");break;case"grid":e.$.viewsButton.classList.remove("kanban"),t=e.grid.localize("viewGrid")}e.$.viewsButton.innerHTML='<div class="smart-tool-label" role="presentation">'+t+"</div>"}_refreshDownloadButton(){this.$.downloadButton.innerHTML='<div class="smart-tool-label" role="presentation">'+this.grid.localize("download")+"</div>"}_openRowSettingsDialog(e){let t=this;t.getSelectedRows||(t=t.grid);const a=t.editing.dialog.enabled,o=t.editing.mode,n=t.context;t.context=t,t.editing.dialog.enabled=!0,t.editing.mode="row",t._settingsDialogRowId=e,t.beginEdit(e),t._endToolbarEdit?(t.removeEventListener("endEdit",t._endToolbarEdit,null),t.removeEventListener("cancelEdit",t._endToolbarEdit,null)):t._endToolbarEdit=()=>{t.context=t,t.editing.dialog.enabled=a,t.editing.mode=o,t.context=n,delete t._settingsDialogRowId,delete t._dialogEdit},t.addEventListener("endEdit",t._endToolbarEdit),t.addEventListener("cancelEdit",t._endToolbarEdit)}_refreshDeleteButton(){let e=this;if(e.getSelectedRows||(e=e.grid),-1===e.header.buttons.indexOf("delete"))return;const t=e.getSelectedRows().length,a=e.querySelector("smart-grid-toolbar").$.deleteButton;0!==t?(a.classList.remove("smart-hidden"),a.firstElementChild.innerHTML=1===t?e.localize("deleteByOne"):e.localize("deleteByMultiple",{n:t}),a.classList.add("selected"),a.onclick=()=>{const t=e.getSelectedRows().map((e=>e[0]));this.grid.removeRow(t)}):a.classList.add("smart-hidden")}_refreshFromSelection(){this.querySelector("smart-grid-toolbar")._refreshDeleteButton()}openGroupPanel(e){const t=this;let a;const o=t.grid;t.$.headerDropDown.classList.add("group-panel"),t.$.headerDropDown.classList.remove("customize-panel","filter-panel","sort-panel","search-panel","format-panel"),t.$.group.classList.remove("smart-hidden"),t.$.filter.classList.add("smart-hidden"),t.$.customize.classList.add("smart-hidden"),t.$.sort.classList.add("smart-hidden"),t.$.search.classList.add("smart-hidden"),t.$.format.classList.add("smart-hidden"),t._closeDownloadMenu(),t._closeViewsMenu(),t._refreshColumns("group"),o.closeMenu();const n=t.columns.map((e=>{const a=Object.assign({},e);if(t._appliedGrouping&&t._appliedGrouping.dataFields){const e=t._appliedGrouping.dataFields.indexOf(a.dataField);a.groupIndex=e}return a})).filter((e=>e.allowGroup));e&&t._appliedGrouping&&-1===t._appliedGrouping.dataFields.indexOf(e.dataField)&&(n.find((t=>t.dataField===e.dataField)).groupIndex=t._appliedGrouping.dataFields.length),t._groupPartCreated?(a=t.$.group.firstElementChild,a.rightToLeft=t.rightToLeft,a.dataSource=n,a.locale=t.locale,a.messages=t._innerElementMessages.groupPanel):(a=document.createElement("smart-group-panel"),a.rightToLeft=t.rightToLeft,a.animation=t.animation,a.locale=t.locale,a.messages=t._innerElementMessages.groupPanel,a.theme=t.theme,a.dataSource=n,t.$.group.appendChild(a),t._groupPartCreated=!0,a.onExpandAll=()=>{if(t._appliedGrouping.expandAll)return t._appliedGrouping.expandAll=!1,void a.querySelector(".smart-group-panel-expand-button").removeAttribute("active");t._appliedGrouping.expandAll=!0,t._appliedGrouping.collapseAll=!1,a.querySelector(".smart-group-panel-expand-button").setAttribute("active",""),a.querySelector(".smart-group-panel-collapse-button").removeAttribute("active")},a.onCollapseAll=()=>{if(t._appliedGrouping.collapseAll)return t._appliedGrouping.collapseAll=!1,void a.querySelector(".smart-group-panel-collapse-button").removeAttribute("active");t._appliedGrouping.expandAll=!1,t._appliedGrouping.collapseAll=!0,a.querySelector(".smart-group-panel-collapse-button").setAttribute("active",""),a.querySelector(".smart-group-panel-expand-button").removeAttribute("active")},a.addEventListener("apply",(e=>{const a=e.detail.sortByInfo,n=t._appliedGrouping.dataFields;t._appliedGrouping.dataFields=a.dataFields;const s=o.onRowInserted;if(o.onRowInserted=null,o.beginUpdate(),o.grouping.autoHideGroupColumn&&n)for(let e=0;e<n.length;e++){const t=o.columnByDataField[n[e]];t&&(t.visible=!0)}o.clearGroups();for(let e=0;e<a.dataFields.length;e++){const t=a.dataFields[e];o.addGroup(t)}t._appliedGrouping.expandAll&&o.expandAllRows(),t._appliedGrouping.collapseAll&&o.collapseAllRows(),o.endUpdate();const i=[];for(let e=0;e<o.dataSource.groupBy.length;e++)i.push(o.dataSource.groupBy[e]);o.$.fireEvent("group",{groups:i}),o.paging.enabled&&o._refreshPagesCount(),o.onRowInserted=s}))),t._refreshGroupButton(),t._openHeaderDropDown(t.$.groupButton)}_refreshGroupButton(){const e=this,t=e._appliedGrouping.dataFields?e._appliedGrouping.dataFields.length:0;if(0===t){const t=e.localize("group");return e.$.groupButton.firstElementChild.innerHTML!==t&&(e.$.groupButton.firstElementChild.innerHTML=t),void e.$.groupButton.classList.remove("grouped")}e.$.groupButton.firstElementChild.innerHTML=1===t?e.localize("groupedByOne"):e.localize("groupedByMultiple",{n:t}),e.$.groupButton.classList.add("grouped")}openSearchPanel(){this._openSearchPanel()}_closeSearchPanel(){this._search("",!1),super._closeSearchPanel()}_openSearchPanel(){const e=this,t=e.grid;e.$.headerDropDown.classList.add("search-panel"),e.$.headerDropDown.classList.remove("customize-panel","filter-panel","sort-panel","group-panel","format-panel"),e.$.search.classList.remove("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.group.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e._openHeaderDropDown(e.$.searchButton),e._closeDownloadMenu(),e._closeViewsMenu(),t.closeMenu();const a=[],o=t.getVisibleRows();for(let e=0;e<o.length;e++)a.push(Object.assign(o[e].data));const n=new Smart.DataAdapter({id:"id",observable:!1,dataSource:a,dataFields:t.dataSource.dataFields});e._searchInfo={source:n,stringDataFields:e.dataSource.dataFields.filter((e=>"string"===e.dataType)).map((e=>e.name))},""!==e.$.searchInput.value&&e._search(e.$.searchInput.value,!1)}_search(e,t=!0){const a=this;if(!a._searchInfo)return;if(a._searchInfo.query=e,""===e)return a.$.search.classList.remove("matches","no-matches"),delete a._searchInfo.foundIdsArray,delete a._searchInfo.foundIdsObject,delete a._searchInfo.highlighted,a.grid.highlighted=null,void a.grid._recycle(!1);const o=a._searchInfo.source,n=[],s=[],i={};a._searchInfo.stringDataFields.forEach((t=>{const a=new Smart.Utilities.FilterGroup,o=a.createFilter("string",e,"CONTAINS");a.addFilter("or",o),n.push([t,a])})),o._filter(n,"or");for(let e=0;e<o.length;e++){const t=o[e];!1!==t.$.filtered&&(s.push(t.$.id),i[t.$.id]=!0)}if(a._searchInfo.foundIdsArray=s,a._searchInfo.foundIdsObject=i,a.grid.highlighted=null,s.length>0)return a.$.search.classList.remove("no-matches"),a.$.search.classList.add("matches"),a.$.searchLabel.innerHTML=a.localize("found",{nth:t?1:0,n:s.length}),a._searchInfo.highlighted=s[0],a.grid.highlighted=a._searchInfo.highlighted,a.grid.ensureVisible(a._searchInfo.highlighted),void a.grid._recycle(!1);a.$.search.classList.remove("matches"),a.$.search.classList.add("no-matches"),a.$.searchLabel.innerHTML=a.localize("found",{nth:0,n:0})}_refreshCustomizeButton(){const e=this,t=e.grid;let a=0;if("kanban"===t.view&&t._kanban)return e.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+t._kanban.localize("customize")+"</div>",e.$.customizeButton.classList.remove("hidden"),void e.$.customizeButton.classList.add("smart-hidden");for(let e=0;e<t.columns.length;e++){const o=t.columns[e];o.autoGenerated||!1!==o._visible&&(t.grouping&&t.grouping.autoHideGroupColumn&&t.dataSource.groupBy.indexOf(o.dataField)>=0||o.visible||a++)}const o=-1===t.header.buttons.indexOf("views");a>0&&o?(e.$.customizeButton.innerHTML=1===a?'<div class="smart-tool-label" role="presentation">'+t.localize("customizeOne",{n:a})+"</div>":'<div class="smart-tool-label" role="presentation">'+t.localize("customizeHidden",{n:a})+"</div>",e.$.customizeButton.classList.add("hidden")):(e.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+t.localize("customize")+"</div>",e.$.customizeButton.classList.remove("hidden"))}_applyColumns(e,t){const a=this,o=a.grid;o.beginUpdate();let n=0,s=[],i=[],r=[];const l=o.onColumnChange;o.onColumnChange=null;for(let t in e){const a=e[t],l=o.columnByDataField[a.dataField];l&&(l.visible!==a.visible&&(s.push(a),i.push(l.visible),r.push(a.visible)),l.visible=a.visible,a.visible||n++)}o.onColumnChange=l,o.onColumnChange&&o.onColumnChange(s,"visible",i,r),n>0?(a.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+o.localize("customizeHidden",{n})+"</div>",a.$.customizeButton.classList.add("hidden")):(a.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+o.localize("customize")+"</div>",a.$.customizeButton.classList.remove("hidden"));for(let e=0;e<t.length;e++){const a=t[e],n=a.oldIndex,s=a.newIndex,i=o.columns[s+1],r=o.columns[s-1],l=o.columns[n];i?l.columnGroup=i.columnGroup:r&&(l.columnGroup=r.columnGroup),o.reorderColumns(n,s,!0)}o.endUpdate()}});
@@ -1,5 +1,5 @@
1
1
 
2
- /* Smart UI v14.2.83 (2022-09-09)
2
+ /* Smart UI v14.3.0 (2022-09-27)
3
3
  Copyright (c) 2011-2021 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
@@ -1,6 +1,6 @@
1
1
 
2
- /* Smart UI v14.2.83 (2022-09-09)
2
+ /* Smart UI v14.3.0 (2022-09-27)
3
3
  Copyright (c) 2011-2021 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
6
- Smart.Utilities.Assign("Grid.View",class{createBasicKanban(){this._initKanbanView("basic")}createBlankKanban(){this._initKanbanView("blank")}_getStatusColumn(e){const t=this;return new Smart.Grid.Column({label:!e||e&&"blank"===e?t.localize("dialogNewColumn"):t.localize("status"),description:t.localize("dialogAddColumnStatusDescription"),dataField:"taskStatus",showDescriptionButton:!0,dataType:"string",defaultValue:"",editor:{template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:[{color:"#DD5347",label:"",value:""},{color:"#33B679",label:t.localize("toDo"),value:"toDo"},{color:"#039BE5",label:t.localize("inProgress"),value:"inProgress"},{color:"#8E24AA",label:t.localize("done"),value:"done"}]},template:"tags",cellsAlign:"left",align:"left",grid:t,visible:!0,_visible:!0,_view:!0})}_initKanbanView(e){const t=this;if(t._kanbanInitialized)return;t._kanbanInitialized=!0;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];a._dataField&&!t.columnByDataField[a._dataField]&&(t.columnByDataField[a._dataField]=a)}const a=t._getStatusColumn(e),l=t.columnByDataField.taskStatus;return l&&l.statusColumn?(t.beginUpdate(),t._createKanban(t.columnByDataField.taskStatus),t._refreshHeaderBar(),t.endUpdate(!1),void t._showKanbanView(!1)):(t._onColumnUpdated=(e,a)=>{e._view&&(delete e._view,delete e._state,delete t._onColumnUpdated,e.allowSort=e.allowEdit=e.allowFilter=!0,"blank"===a.kanban?(delete t.columnByDataField.taskStatus,e.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,defaultValue:"",singleSelect:!0,dataSource:[{color:"#DD5347",label:"",value:""}]}):t.columnByDataField.taskStatus&&(t.columnByDataField.taskStatus.editor=e.editor,e=t.columnByDataField.taskStatus),e.statusColumn=!0,t.beginUpdate(),t._createKanban(e),t._refreshHeaderBar(),t.endUpdate(!1),t._showKanbanView())},e&&"blank"===e?(delete a._view,a.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:[]},a.allowSort=a.allowEdit=a.allowFilter=!0,a.label="New Column",t.beginUpdate(),t._createKanban(a),t._resetCachedLayout(),t._refreshHeaderBar(),void t.endUpdate()):e&&"basic"===e?(delete a._view,t.beginUpdate(),t._createKanban(a),t._resetCachedLayout(),t._refreshHeaderBar(),void t.endUpdate()):void t._openAddColumnDialog(a,!0,(e=>{!1===e&&(delete a._view,a.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,defaultValue:"",singleSelect:!0,dataSource:[{color:"#DD5347",label:t.localize("uncategorized"),value:""}]},a.allowSort=a.allowEdit=a.allowFilter=!0,a.label=t.localize("dialogNewColumn"),t.beginUpdate(),t._createKanban(a),t._refreshHeaderBar(),t.endUpdate(!1),t._showKanbanView())})))}_showKanbanView(e){const t=this;t.beginUpdate(),t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t._showAddNewRowButton("float"),t.$.viewContent.appendChild(t._kanban),t.classList.add("smart-kanban-view"),!1!==e&&(t._updateKanbanView(),t._kanban.refresh()),t._onFilter=t._onSort=()=>{"kanban"===t.view&&(t._updateKanbanView(),t._kanban.refresh())}}_hideKanbanView(){const e=this;e.classList.contains("smart-kanban-view")&&(e.$.viewContent.classList.add("smart-hidden"),e.$.content.classList.remove("smart-hidden"),e._kanban.remove(),e.classList.remove("smart-kanban-view"),e._resetCachedLayout(),e.dataSource.boundHierarchy&&(e.dataSource.refreshHierarchy(),e._refreshRowHierarchy(!0,!0)),e.endUpdate(),e.dataSource.boundHierarchy&&e._recycle())}_getPriorityDataSource(){const e=this;return[{color:"#33B679",label:e.localize("priority_low"),value:"low"},{color:"#039BE5",label:e.localize("priority_average"),value:"average"},{color:"#DD5347",label:e.localize("priority_high"),value:"high"},{color:"#AF0020",label:e.localize("priority_critical"),value:"critical"}]}_updateKanbanTaskFields(){const e=this;for(let t=0;t<e.columns.length;t++){const a=e.columns[t];if(a.dataField.startsWith("taskStartDate")){const t=e._getKanbanTaskField("startDate");a.editor=t.editor}else if(a.dataField.startsWith("taskDueDate")){const t=e._getKanbanTaskField("dueDate");a.editor=t.editor}else if("checklist"===a.template){const t=e._getKanbanTaskField("checklist");a.editor=t.editor}}}_getKanbanTaskField(e){const t=this;switch(e){case"startDate":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeStartDate"),dataField:"taskStartDate",cellsFormat:"d",showDescriptionButton:!0,dataType:"date",allowDelete:!0,editor:{template:"dateInput",autoOpen:!0,onValidate:(e,a)=>!(e>a.taskDueDate&&a.taskDueDate&&e)||t.localize("invalidMaxValue",{value:t.localize("dialogAddColumnTypeStartDate"),max:a.taskDueDate.toLocaleDateString()})},visible:!0,_visible:!0,grid:t});case"dueDate":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeDueDate"),dataField:"taskDueDate",cellsFormat:"d",showDescriptionButton:!0,allowDelete:!0,dataType:"date",editor:{template:"dateInput",autoOpen:!0,onValidate:(e,a)=>!(e<a.taskStartDate&&a.taskStartDate&&e)||t.localize("invalidMinValue",{value:t.localize("dialogAddColumnTypeDueDate"),min:a.taskStartDate.toLocaleDateString()})},visible:!0,_visible:!0,grid:t});case"progress":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeProgress"),dataField:"taskProgress",showDescriptionButton:!0,allowDelete:!0,visible:!0,_visible:!0,disabledDialogOptions:["numberFormat","minValue","maxValue"],dataType:"number",cellsFormat:"p0",template:"progress",editor:{disabledDialogOptions:!0,template:"numberInput",min:0,max:1},grid:t});case"checklist":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeChecklist"),dataField:"taskChecklist",allowGroup:!1,showDescriptionButton:!0,allowSort:!1,allowDelete:!0,allowFilter:!1,visible:!0,_visible:!0,disabledDialogOptions:["allowFilter","allowSort"],template:"checklist",editor:{template:"<smart-multi-combo-input></smart-multi-combo-input>",settings:{inputTagsMode:"one",readonly:!0,allowItemsAdd:!0,allowItemsRemove:!0},onRender:function(e,a,l,o){const i="string"==typeof o[a]&&o[a]?JSON.parse(o[a]):o[a],s=[],n=l.firstElementChild;if(n.isInitialized&&t._kanban&&t._kanban.messages[t.locale]&&(n.messages[t.locale].tagLabel=t._kanban.messages[t.locale].taskCompleted,n.messages[t.locale].tagLabelOne=t._kanban.messages[t.locale].taskCompleted),i){const e=i.map((e=>{const t={label:e.text,value:e.text};return e.completed&&s.push(t),t}));n.dataSource=e}else n.dataSource=[];n.selectedItems=s,!t.editing.editRow&&n.open&&n.open()},setValue:function(){},getValue:function(){const e=this.firstElementChild;return e.dataSource.map((t=>{const a=e.selectedItems.find((e=>t.value===e.value));return{text:t.label,completed:void 0!==a}}))}},dataType:"any",grid:t});case"priority":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypePriority"),dataField:"taskPriority",showDescriptionButton:!0,dataType:"string",visible:!0,_visible:!0,allowDelete:!0,defaultValue:"average",disabledDialogOptions:["allowColorItems","options"],editor:{template:"multiComboInput",readonly:!0,allowEmptyItem:!1,disabledDialogOptions:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:t._getPriorityDataSource()},template:"tags",grid:t});case"tags":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeTags"),dataField:"taskTags",allowDelete:!0,allowGroup:!1,visible:!0,_visible:!0,showDescriptionButton:!0,dataType:"string",template:"tags",grid:t});case"name":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeName"),allowDelete:!0,allowGroup:!1,dataField:"taskText",showDescriptionButton:!0,dataType:"string",_visible:!0,visible:!0,grid:t});case"description":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeDescription"),dataField:"taskDescription",allowGroup:!1,allowDelete:!0,showDescriptionButton:!0,editor:{template:"textarea"},dataType:"string",_visible:!0,visible:!0,grid:t});case"assigned":{let e=[""];for(let a=0;a<t.users.length;a++)e.push({label:t.users[a].name,value:t.users[a].id,id:t.users[a].id,image:t.users[a].image,color:t.users[a].color||""});return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeAssigned"),allowDelete:!0,dataField:"taskUserId",showDescriptionButton:!0,disabledDialogOptions:["allowColorItems","options"],editor:{template:"multiComboInput",readonly:!0,collaborator:!0,disabledDialogOptions:!0,colorItems:!0,dropDownButtonPosition:"right",autoOpen:!0,pills:!0,singleSelect:!0,dataSource:e},dataType:"string",visible:!0,_visible:!0,template:"tags",grid:t})}case"color":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeColor"),allowDelete:!0,dataField:"taskColor",showDescriptionButton:!0,dataType:"string",editor:{template:"colorInput"},template:"color",width:60,visible:!0,_visible:!0,grid:t});case"status":return t._getStatusColumn("basic")}}_getKanbanTaskFields(e){const t=this,a=[],l=t._getKanbanTaskField("startDate"),o=t._getKanbanTaskField("dueDate"),i=t._getKanbanTaskField("priority"),s=t._getKanbanTaskField("tags"),n=t._getKanbanTaskField("progress"),r=t._getKanbanTaskField("description"),d=t._getKanbanTaskField("name"),u=t._getKanbanTaskField("color"),c=t._getKanbanTaskField("checklist");let m=!0;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.editor&&a.editor.collaborator){m=!1;break}}if(a.push(d),a.push(r),a.push(e),a.push(l),a.push(o),a.push(n),a.push(i),a.push(s),a.push(c),a.push(u),m){let e=[""];for(let a=0;a<t.users.length;a++)e.push({label:t.users[a].name,value:t.users[a].id,id:t.users[a].id,image:t.users[a].image,color:t.users[a].color||""});const o=t._getKanbanTaskField("assigned");a.push(o),t._kanbanViewColumns=[l,o,n,i,s,c,u]}else t._kanbanViewColumns=[l,n,i,s,c,u];return a}getKanbanProperties(){const e=this;return e._kanbanProperties||(e._kanbanProperties={},e._kanbanProperties=Object.assign({},{taskColorEntireSurface:!1,collapsible:!0,addNewButton:!0,addNewButtonDisplayMode:"both",addNewColumn:!0,allowColumnRemove:!0,editable:!0,columnActions:!0,columnEditMode:"headerAndMenu",allowColumnEdit:!0,allowColumnReorder:!0,taskActions:!0,taskDue:!0,autoColumnHeight:!0,columnWidth:270,taskComments:!0,taskProgress:!0,columnSummary:!0,columnColors:!0,taskPriority:!0,taskUserIcon:!0,taskSubTasks:"none",taskCustomFieldsHide:!0,columnColorEntireSurface:!0,columnFooter:!0})),e._kanbanProperties}setKanbanProperties(e){const t=this,a=t.getKanbanProperties();for(let t in e)void 0!==e[t]&&void 0!==a[t]&&(a[t]=e[t]);t._kanbanProperties=a,t.classList.contains("smart-kanban-view")&&(t._updateKanbanView(),t._kanban.refresh())}_updateKanbanView(e){const t=this;if(!t._kanban)return;if(!t.isInitialized)return;if(!e&&!(e=t.columnByDataField.taskStatus))return;const a=t._kanban,l=a.context;a.context=a;const o=e.editor.dataSource&&e.editor.dataSource.length>0?e.editor.dataSource:[{label:e.label,value:e.value,color:"#DD5347"}];a.users=t.users,a.currentUser=t.currentUser;const i=t.getKanbanProperties();for(let e in i)a[e]=i[e];let s=[];for(let e=0;e<t.columns.length;e++){const a=t.columns[e];let l=a.dataField;if(a._dataField&&(l=a._dataField),l.startsWith("task")){let e=l.replace("task","");e=e.substring(0,1).toLowerCase()+e.substring(1),-1===s.indexOf(e)&&s.push(e)}}a.$.scrollViewer&&(a.$.scrollViewer.scrollLeft=0),a.dialogEditors=s;let n=[];for(let e=0;e<o.length;e++){const a=o[e];let l=a.label;""===a.label&&(l=a.labelAlt?a.labelAlt:t.localize("uncategorized")),n.push({label:l,value:a.value,status:a.value,dataField:a.value,color:a.color})}a.columns=n;let r=[];for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.dataField.startsWith("task"))continue;if(a._dataField)continue;if(!1===a.allowEdit)continue;if("any"===a.dataType)continue;r.push({label:a.label||"",dataField:a.dataField,dataType:a.dataType,visible:a.visible,editor:a.editor.template});const l=r[r.length-1];a.editor.dataSource&&(l.dataSource=[...a.editor.dataSource]),a.editor.colorItems&&(l.colorItems=a.editor.colorItems),a.editor.colorItems&&(l.pills=a.editor.pills),a.editor.colorItems&&(l.singleSelect=a.editor.singleSelect),a.editor.dropDownButtonPosition&&(l.dropDownButtonPosition=a.editor.dropDownButtonPosition),["min","max","minLength","maxLength","minDate","maxDate"].forEach((e=>{void 0!==a.editor[e]&&(l[e]=a.editor[e])}))}a.taskCustomFields=r;const d=[];for(let e=0;e<t.dataSource.length;e++){const a=t.dataSource[e],l={},o=a.$.id;if(!1===a.$.filtered)continue;const i=t.rowById[o];i&&(l.history=i.history,i.comments&&(l.comments=i.comments)),t.columnByDataField.taskStatus||void 0===a.taskStatus&&(a.taskStatus="");for(let e in a){if(e.startsWith("$"))continue;let o=a[e];const i=t.columnByDataField[e];if(i&&i._dataField&&(e=i._dataField),e.startsWith("task")){let t=e.replace("task","");t=t.substring(0,1).toLowerCase()+t.substring(1),"progress"===t&&(o=100*parseFloat(o)),"checklist"===t&&(o&&o.length?"string"==typeof o&&(o=JSON.parse(o)):o=[]),l[t]=o}else l[e]=o}l.id=a.$.id,void 0===l.status?l.status="":n.find((e=>e.value===l.status))||(l.status=""),d.push(l)}a.dataSource=d,a.context=l}_getTaskData(e){const t=this,a={},l=t._kanban;if(e.checklist&&e.checklist.length>0&&!t.columnByDataField.taskChecklist){const e=t._getKanbanTaskField("checklist");t.columns.push(e)}if(e.priority&&l.taskPriority&&!t.columnByDataField.taskPriority){const e=t._getKanbanTaskField("priority");t.columns.push(e)}for(let o=0;o<t.columns.length;o++){const i=t.columns[o];let s=i.dataField,n=s;if(i._dataField&&(s=i._dataField),s.startsWith("task")){let t=s.replace("task","");if(t=t.substring(0,1).toLowerCase()+t.substring(1),"checklist"===t){e.checklist?a[s]=e.checklist:a[s]="";continue}if("history"===t&&(a[s]=e.history),void 0===e[t])continue;if("status"===t)a[s]=e[t];else if("priority"===t){const l=e[t];a[s]=l}else a[s]="progress"===t?parseFloat(e[t])/100:e[t];i._dataField&&(a[n]=a[s],delete a[s])}else l.taskCustomFields&&l.taskCustomFields.length&&l.taskCustomFields.find((e=>e.dataField===s))&&(a[s]=e[s])}return a}_createKanban(e){const t=this;if(t._kanban)return void(t.columnByDataField[e.dataField]||(t.columns.push(e),t._updateKanbanView(e)));t.columnByDataField[e.dataField]||(t.columns.push(e),t._updateKanbanView(e));const a=document.createElement("smart-kanban");t._kanban=a,t.onViewInit&&t.onViewInit(a),t._updateKanbanView(e),a.style.width="100%",a.style.height="100%",a.style.borderTopColor="transparent",a.style.borderLeftColor="transparent",a.style.borderRightColor="transparent",a.style.borderBottomColor="transparent",a.style.background="inherit","kanban"===t.view&&(t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden")),t.$.viewContent.appendChild(a),"kanban"===t.view&&t.classList.add("smart-kanban-view"),t.editing.addNewColumn._addButton&&t.editing.addNewColumn._addButton.classList.remove("show");const l=()=>{const e=this,t=e.columnByDataField.taskStatus,a=e._kanban,l=[];for(let e=0;e<a.columns.length;e++){const t=a.columns[e],o={label:t.dataField?t.label:"",labelAlt:t.label,value:t.dataField,color:t.color};l.push(o)}if(t.editor.isDirty=!0,t.editor.dataSource=l,t._state&&(t._state.editor=t.editor),delete t.editor._items,e.onColumnUpdated){const a=e.viewColumns.indexOf(t);e.onColumnUpdated(a,t)}};a.addEventListener("columnUpdate",(()=>{l()})),a.addEventListener("columnAdd",(()=>{l()})),a.addEventListener("columnRemove",(()=>{l()})),a.addEventListener("taskAdd",(e=>{const a=e.detail.value,l=t._getTaskData(a);t._onRowInserted=e=>{a.id=e.id},t.addRow(l,!0,(e=>{a.id=e.id})),t._refreshHeaderBar(),delete t._onRowInserted})),a.addEventListener("taskRemove",(e=>{t.removeRow(e.detail.id),t._refreshHeaderBar()})),a.addEventListener("taskUpdate",(e=>{const l=e.detail.value,o=t._getTaskData(l);t.updateRow(e.detail.id,o);for(let e=0;e<a.taskCustomFields.length;e++){const l=a.taskCustomFields[e],o=t.columnByDataField[l.dataField];o&&(o.visible=l.visible)}const i=t.rowById[e.detail.id];i&&(i.history=l.history,i.comments=l.comments,t.onComment&&t.onComment(e.detail.id,i.comments))}))}});
6
+ Smart.Utilities.Assign("Grid.View",class{createBasicKanban(){this._initKanbanView("basic")}createBlankKanban(){this._initKanbanView("blank")}_getStatusColumn(e){const t=this;return new Smart.Grid.Column({label:!e||e&&"blank"===e?t.localize("dialogNewColumn"):t.localize("status"),description:t.localize("dialogAddColumnStatusDescription"),dataField:"taskStatus",showDescriptionButton:!0,dataType:"string",defaultValue:"",editor:{template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:[{color:"#DD5347",label:"",value:""},{color:"#33B679",label:t.localize("toDo"),value:"toDo"},{color:"#039BE5",label:t.localize("inProgress"),value:"inProgress"},{color:"#8E24AA",label:t.localize("done"),value:"done"}]},template:"tags",cellsAlign:"left",align:"left",grid:t,visible:!0,_visible:!0,_view:!0})}_initKanbanView(e){const t=this;if(t._kanbanInitialized)return;t._kanbanInitialized=!0;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];a._dataField&&!t.columnByDataField[a._dataField]&&(t.columnByDataField[a._dataField]=a)}const a=t._getStatusColumn(e),l=t.columnByDataField.taskStatus;if(l&&(l.statusColumn||!1===t.editing.enabled))return t.beginUpdate(),t._createKanban(t.columnByDataField.taskStatus),t._refreshHeaderBar(),t.endUpdate(!1),void t._showKanbanView(!1);if(t._onColumnUpdated=(e,a)=>{e._view&&(delete e._view,delete e._state,delete t._onColumnUpdated,e.allowSort=e.allowEdit=e.allowFilter=!0,"blank"===a.kanban?(delete t.columnByDataField.taskStatus,e.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,defaultValue:"",singleSelect:!0,dataSource:[{color:"#DD5347",label:"",value:""}]}):t.columnByDataField.taskStatus&&(t.columnByDataField.taskStatus.editor=e.editor,e=t.columnByDataField.taskStatus),e.statusColumn=!0,t.beginUpdate(),t._createKanban(e),t._refreshHeaderBar(),t.endUpdate(!1),t._showKanbanView())},e&&"blank"===e)return delete a._view,a.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:[]},a.allowSort=a.allowEdit=a.allowFilter=!0,a.label="New Column",t.beginUpdate(),t._createKanban(a),t._resetCachedLayout(),t._refreshHeaderBar(),void t.endUpdate();if(e&&"basic"===e)return delete a._view,t.beginUpdate(),t._createKanban(a),t._resetCachedLayout(),t._refreshHeaderBar(),void t.endUpdate();if(l){a.label=l.label,a.description=l.description;const e=l.editor.dataSource.filter((e=>""!==e));a.editor.dataSource=e}t._openAddColumnDialog(a,!0,(e=>{!1===e&&(delete a._view,a.editor={template:"multiComboInput",readonly:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,defaultValue:"",singleSelect:!0,dataSource:[{color:"#DD5347",label:t.localize("uncategorized"),value:""}]},a.allowSort=a.allowEdit=a.allowFilter=!0,a.label=t.localize("dialogNewColumn"),t.beginUpdate(),t._createKanban(a),t._refreshHeaderBar(),t.endUpdate(!1),t._showKanbanView())}))}_showKanbanView(e){const t=this;t.beginUpdate(),t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t.$.footerPager.classList.add("smart-hidden"),t._showAddNewRowButton("float"),t.$.viewContent.appendChild(t._kanban),t.classList.add("smart-kanban-view"),!1!==e&&(t._updateKanbanView(),t._kanban.refresh()),t._onFilter=t._onSort=()=>{"kanban"===t.view&&(t._updateKanbanView(),t._kanban.refresh())}}_hideKanbanView(){const e=this;e.classList.contains("smart-kanban-view")&&(e.$.viewContent.classList.add("smart-hidden"),e.$.content.classList.remove("smart-hidden"),e.$.footerPager.classList.remove("smart-hidden"),e._kanban.remove(),e.classList.remove("smart-kanban-view"),e._resetCachedLayout(),e.dataSource.boundHierarchy&&(e.dataSource.refreshHierarchy(),e._refreshRowHierarchy(!0,!0)),e.endUpdate(),e.dataSource.boundHierarchy&&e._recycle())}_getPriorityDataSource(){const e=this;return[{color:"#33B679",label:e.localize("priority_low"),value:"low"},{color:"#039BE5",label:e.localize("priority_average"),value:"average"},{color:"#DD5347",label:e.localize("priority_high"),value:"high"},{color:"#AF0020",label:e.localize("priority_critical"),value:"critical"}]}_updateKanbanTaskFields(){const e=this;for(let t=0;t<e.columns.length;t++){const a=e.columns[t];if(a.dataField.startsWith("taskStartDate")){const t=e._getKanbanTaskField("startDate");a.editor=t.editor}else if(a.dataField.startsWith("taskDueDate")){const t=e._getKanbanTaskField("dueDate");a.editor=t.editor}else if("checklist"===a.template){const t=e._getKanbanTaskField("checklist");a.editor=t.editor}}}_getKanbanTaskField(e){const t=this;switch(e){case"startDate":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeStartDate"),dataField:"taskStartDate",cellsFormat:"d",showDescriptionButton:!0,dataType:"date",allowDelete:!0,editor:{template:"dateInput",autoOpen:!0,onValidate:(e,a)=>!(e>a.taskDueDate&&a.taskDueDate&&e)||t.localize("invalidMaxValue",{value:t.localize("dialogAddColumnTypeStartDate"),max:a.taskDueDate.toLocaleDateString()})},visible:!0,_visible:!0,grid:t});case"dueDate":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeDueDate"),dataField:"taskDueDate",cellsFormat:"d",showDescriptionButton:!0,allowDelete:!0,dataType:"date",editor:{template:"dateInput",autoOpen:!0,onValidate:(e,a)=>!(e<a.taskStartDate&&a.taskStartDate&&e)||t.localize("invalidMinValue",{value:t.localize("dialogAddColumnTypeDueDate"),min:a.taskStartDate.toLocaleDateString()})},visible:!0,_visible:!0,grid:t});case"progress":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeProgress"),dataField:"taskProgress",showDescriptionButton:!0,allowDelete:!0,visible:!0,_visible:!0,disabledDialogOptions:["numberFormat","minValue","maxValue"],dataType:"number",cellsFormat:"p0",template:"progress",editor:{disabledDialogOptions:!0,template:"numberInput",min:0,max:1},grid:t});case"checklist":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeChecklist"),dataField:"taskChecklist",allowGroup:!1,showDescriptionButton:!0,allowSort:!1,allowDelete:!0,allowFilter:!1,visible:!0,_visible:!0,disabledDialogOptions:["allowFilter","allowSort"],template:"checklist",editor:{template:"<smart-multi-combo-input></smart-multi-combo-input>",settings:{inputTagsMode:"one",readonly:!0,allowItemsAdd:!0,allowItemsRemove:!0},onRender:function(e,a,l,o){const i="string"==typeof o[a]&&o[a]?JSON.parse(o[a]):o[a],s=[],n=l.firstElementChild;if(n.isInitialized&&t._kanban&&t._kanban.messages[t.locale]&&(n.messages[t.locale].tagLabel=t._kanban.messages[t.locale].taskCompleted,n.messages[t.locale].tagLabelOne=t._kanban.messages[t.locale].taskCompleted),i){const e=i.map((e=>{const t={label:e.text,value:e.text};return e.completed&&s.push(t),t}));n.dataSource=e}else n.dataSource=[];n.selectedItems=s,!t.editing.editRow&&n.open&&n.open()},setValue:function(){},getValue:function(){const e=this.firstElementChild;return e.dataSource.map((t=>{const a=e.selectedItems.find((e=>t.value===e.value));return{text:t.label,completed:void 0!==a}}))}},dataType:"any",grid:t});case"priority":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypePriority"),dataField:"taskPriority",showDescriptionButton:!0,dataType:"string",visible:!0,_visible:!0,allowDelete:!0,defaultValue:"average",disabledDialogOptions:["allowColorItems","options"],editor:{template:"multiComboInput",readonly:!0,allowEmptyItem:!1,disabledDialogOptions:!0,dropDownButtonPosition:"right",colorItems:!0,autoOpen:!0,pills:!0,singleSelect:!0,dataSource:t._getPriorityDataSource()},template:"tags",grid:t});case"tags":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeTags"),dataField:"taskTags",allowDelete:!0,allowGroup:!1,visible:!0,_visible:!0,showDescriptionButton:!0,dataType:"string",template:"tags",grid:t});case"name":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeName"),allowDelete:!0,allowGroup:!1,dataField:"taskText",showDescriptionButton:!0,dataType:"string",_visible:!0,visible:!0,grid:t});case"description":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeDescription"),dataField:"taskDescription",allowGroup:!1,allowDelete:!0,showDescriptionButton:!0,editor:{template:"textarea"},dataType:"string",_visible:!0,visible:!0,grid:t});case"assigned":{let e=[""];for(let a=0;a<t.users.length;a++)e.push({label:t.users[a].name,value:t.users[a].id,id:t.users[a].id,image:t.users[a].image,color:t.users[a].color||""});return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeAssigned"),allowDelete:!0,dataField:"taskUserId",showDescriptionButton:!0,disabledDialogOptions:["allowColorItems","options"],editor:{template:"multiComboInput",readonly:!0,collaborator:!0,disabledDialogOptions:!0,colorItems:!0,dropDownButtonPosition:"right",autoOpen:!0,pills:!0,singleSelect:!0,dataSource:e},dataType:"string",visible:!0,_visible:!0,template:"tags",grid:t})}case"color":return new Smart.Grid.Column({label:t.localize("dialogAddColumnTypeColor"),allowDelete:!0,dataField:"taskColor",showDescriptionButton:!0,dataType:"string",editor:{template:"colorInput"},template:"color",width:60,visible:!0,_visible:!0,grid:t});case"status":return t._getStatusColumn("basic")}}_getKanbanTaskFields(e){const t=this,a=[],l=t._getKanbanTaskField("startDate"),o=t._getKanbanTaskField("dueDate"),i=t._getKanbanTaskField("priority"),s=t._getKanbanTaskField("tags"),n=t._getKanbanTaskField("progress"),r=t._getKanbanTaskField("description"),d=t._getKanbanTaskField("name"),u=t._getKanbanTaskField("color"),c=t._getKanbanTaskField("checklist");let m=!0;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.editor&&a.editor.collaborator){m=!1;break}}if(a.push(d),a.push(r),a.push(e),a.push(l),a.push(o),a.push(n),a.push(i),a.push(s),a.push(c),a.push(u),m){let e=[""];for(let a=0;a<t.users.length;a++)e.push({label:t.users[a].name,value:t.users[a].id,id:t.users[a].id,image:t.users[a].image,color:t.users[a].color||""});const o=t._getKanbanTaskField("assigned");a.push(o),t._kanbanViewColumns=[l,o,n,i,s,c,u]}else t._kanbanViewColumns=[l,n,i,s,c,u];return a}getKanbanProperties(){const e=this;if(e._kanbanProperties)return e._kanbanProperties;e._kanbanProperties={};const t={taskColorEntireSurface:!1,collapsible:!0,addNewButton:!0,addNewButtonDisplayMode:"both",addNewColumn:!0,allowColumnRemove:!0,editable:!0,columnActions:!0,columnEditMode:"headerAndMenu",allowColumnEdit:!0,allowColumnReorder:!0,taskActions:!0,taskDue:!0,autoColumnHeight:!0,columnWidth:270,taskComments:!0,taskProgress:!0,columnSummary:!0,columnColors:!0,taskPriority:!0,taskUserIcon:!0,taskSubTasks:"none",taskCustomFieldsHide:!0,columnColorEntireSurface:!0,columnFooter:!0};return!1===e.editing.enabled&&(t.allowDrag=!1,t.allowDrop=!1,t.allowColumnReorder=!1,t.allowColumnRemove=!1,t.allowColumnEdit=!1,t.addNewButton=!1,t.addNewColumn=!1,t.columnActions=!1,t.editable=!1),e._kanbanProperties=Object.assign({},t),e._kanbanProperties}setKanbanProperties(e){const t=this,a=t.getKanbanProperties();for(let t in e)void 0!==e[t]&&void 0!==a[t]&&(a[t]=e[t]);t._kanbanProperties=a,t.classList.contains("smart-kanban-view")&&(t._updateKanbanView(),t._kanban.refresh())}_updateKanbanView(e){const t=this;if(!t._kanban)return;if(!t.isInitialized)return;if(!e&&!(e=t.columnByDataField.taskStatus))return;const a=t._kanban,l=a.context;a.context=a;const o=e.editor.dataSource&&e.editor.dataSource.length>0?e.editor.dataSource:[{label:e.label,value:e.value,color:"#DD5347"}];a.users=t.users,a.currentUser=t.currentUser;const i=t.getKanbanProperties();for(let e in i)a[e]=i[e];let s=[];for(let e=0;e<t.columns.length;e++){const a=t.columns[e];let l=a.dataField;if(a._dataField&&(l=a._dataField),l.startsWith("task")){let e=l.replace("task","");e=e.substring(0,1).toLowerCase()+e.substring(1),-1===s.indexOf(e)&&s.push(e)}}a.$.scrollViewer&&(a.$.scrollViewer.scrollLeft=0),a.dialogEditors=s;let n=[];for(let e=0;e<o.length;e++){const a=o[e];let l=a.label;""===a.label&&(l=a.labelAlt?a.labelAlt:t.localize("uncategorized")),n.push({label:l,value:a.value,status:a.value,dataField:a.value,color:a.color})}a.columns=n;let r=[];for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.dataField.startsWith("task"))continue;if(a._dataField)continue;if(!1===a.allowEdit)continue;if("any"===a.dataType)continue;r.push({label:a.label||"",dataField:a.dataField,dataType:a.dataType,visible:a.visible,editor:a.editor.template});const l=r[r.length-1];a.editor.dataSource&&(l.dataSource=[...a.editor.dataSource]),a.editor.colorItems&&(l.colorItems=a.editor.colorItems),a.editor.colorItems&&(l.pills=a.editor.pills),a.editor.colorItems&&(l.singleSelect=a.editor.singleSelect),a.editor.dropDownButtonPosition&&(l.dropDownButtonPosition=a.editor.dropDownButtonPosition),["min","max","minLength","maxLength","minDate","maxDate"].forEach((e=>{void 0!==a.editor[e]&&(l[e]=a.editor[e])}))}a.taskCustomFields=r;const d=[];for(let e=0;e<t.dataSource.length;e++){const a=t.dataSource[e],l={},o=a.$.id;if(!1===a.$.filtered)continue;const i=t.rowById[o];i&&(l.history=i.history,i.comments&&(l.comments=i.comments)),t.columnByDataField.taskStatus||void 0===a.taskStatus&&(a.taskStatus="");for(let e in a){if(e.startsWith("$"))continue;let o=a[e];const i=t.columnByDataField[e];if(i&&i._dataField&&(e=i._dataField),e.startsWith("task")){let t=e.replace("task","");t=t.substring(0,1).toLowerCase()+t.substring(1),"progress"===t&&(o=100*parseFloat(o)),"checklist"===t&&(o&&o.length?"string"==typeof o&&(o=JSON.parse(o)):o=[]),l[t]=o}else l[e]=o}l.id=a.$.id,void 0===l.status?l.status="":n.find((e=>e.value===l.status))||(l.status=""),d.push(l)}a.dataSource=d,a.context=l}_getTaskData(e){const t=this,a={},l=t._kanban;if(e.checklist&&e.checklist.length>0&&!t.columnByDataField.taskChecklist){const e=t._getKanbanTaskField("checklist");e.visible=e._visible=!1,t.columns.push(e)}if(e.priority&&l.taskPriority&&!t.columnByDataField.taskPriority){const e=t._getKanbanTaskField("priority");e.visible=e._visible=!1,t.columns.push(e)}for(let o=0;o<t.columns.length;o++){const i=t.columns[o];let s=i.dataField,n=s;if(i._dataField&&(s=i._dataField),s.startsWith("task")){let t=s.replace("task","");if(t=t.substring(0,1).toLowerCase()+t.substring(1),"checklist"===t){e.checklist?a[s]=e.checklist:a[s]="";continue}if("history"===t&&(a[s]=e.history),void 0===e[t])continue;if("status"===t)a[s]=e[t];else if("priority"===t){const l=e[t];a[s]=l}else a[s]="progress"===t?parseFloat(e[t])/100:e[t];i._dataField&&(a[n]=a[s],delete a[s])}else l.taskCustomFields&&l.taskCustomFields.length&&l.taskCustomFields.find((e=>e.dataField===s))&&(a[s]=e[s])}return a}_createKanban(e){const t=this;if(t._kanban)return void(t.columnByDataField[e.dataField]||(t.columns.push(e),t._updateKanbanView(e)));t.columnByDataField[e.dataField]||(t.columns.push(e),t._updateKanbanView(e));const a=document.createElement("smart-kanban");t._kanban=a,t.onViewInit&&t.onViewInit(a),t._updateKanbanView(e),a.style.width="100%",a.style.height="100%",a.style.borderTopColor="transparent",a.style.borderLeftColor="transparent",a.style.borderRightColor="transparent",a.style.borderBottomColor="transparent",a.style.background="inherit","kanban"===t.view&&(t.$.viewContent.classList.remove("smart-hidden"),t.$.content.classList.add("smart-hidden"),t.$.footerPager.classList.add("smart-hidden")),t.$.viewContent.appendChild(a),"kanban"===t.view&&t.classList.add("smart-kanban-view"),t.editing.addNewColumn._addButton&&t.editing.addNewColumn._addButton.classList.remove("show");const l=()=>{const e=this,t=e.columnByDataField.taskStatus,a=e._kanban,l=[];for(let e=0;e<a.columns.length;e++){const t=a.columns[e],o={label:t.dataField?t.label:"",labelAlt:t.label,value:t.dataField,color:t.color};l.push(o)}if(t.editor.isDirty=!0,t.editor.dataSource=l,t._state&&(t._state.editor=t.editor),delete t.editor._items,e.onColumnUpdated){const a=e.viewColumns.indexOf(t);e.onColumnUpdated(a,t)}};a.addEventListener("columnUpdate",(()=>{l()})),a.addEventListener("columnAdd",(()=>{l()})),a.addEventListener("columnRemove",(()=>{l()})),a.addEventListener("taskAdd",(e=>{const a=e.detail.value,l=t._getTaskData(a);t._onRowInserted=e=>{a.id=e.id},t.addRow(l,!0,(e=>{a.id=e.id})),t._refreshHeaderBar(),delete t._onRowInserted})),a.addEventListener("taskRemove",(e=>{t.removeRow(e.detail.id),t._refreshHeaderBar()})),a.addEventListener("taskUpdate",(e=>{const l=e.detail.value,o=t._getTaskData(l);t.updateRow(e.detail.id,o);for(let e=0;e<a.taskCustomFields.length;e++){const l=a.taskCustomFields[e],o=t.columnByDataField[l.dataField];o&&(o.visible=l.visible)}const i=t.rowById[e.detail.id];i&&(i.history=l.history,i.comments=l.comments,t.onComment&&t.onComment(e.detail.id,i.comments))}))}});
@@ -1,5 +1,5 @@
1
1
 
2
- /* Smart UI v14.2.83 (2022-09-09)
2
+ /* Smart UI v14.3.0 (2022-09-27)
3
3
  Copyright (c) 2011-2021 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
@@ -1,6 +1,6 @@
1
1
 
2
- /* Smart UI v14.2.83 (2022-09-09)
2
+ /* Smart UI v14.3.0 (2022-09-27)
3
3
  Copyright (c) 2011-2021 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
6
- Smart("smart-input",class extends Smart.BaseElement{static get properties(){return{autoCompleteDelay:{value:100,type:"number"},dataSource:{type:"any",value:[],reflectToAttribute:!1},dropDownClassList:{value:[],type:"array",reflectToAttribute:!1},dropDownDataSource:{type:"any",value:[]},dropDownHeight:{type:"any",value:200},dropDownOpenMode:{allowedValues:["default","manual"],value:"default",type:"string"},dropDownWidth:{type:"any",value:null},dropDownButtonPosition:{allowedValues:["none","left","right"],value:"none",type:"string"},dropDownOpenPosition:{allowedValues:["bottom","top"],value:"bottom",type:"string"},hint:{type:"string",value:""},inputPurpose:{type:"string",value:"off"},items:{type:"number",value:8},minLength:{type:"number",value:1},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},query:{type:"string",value:""},queryMode:{allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string",value:"containsIgnoreCase"},placeholder:{value:"",type:"string"},readonly:{type:"boolean",value:!1},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},selectedIndex:{type:"number",value:-1},selectedValue:{type:"any",value:""},selectedValues:{value:[],type:"array"},type:{type:"string"},value:{type:"string",value:""},innerHTML:{type:"string",reflectToAttribute:!1}}}static get styleUrls(){return["smart.textbox.css"]}template(){return'<div id="inputContainer" role="presentation"><div id="optionsContainer" inner-h-t-m-l=\'{{innerHTML}}\' class="smart-hidden"></div><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' value=\'{{value::keyup}}\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}static get listeners(){return{"input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","input.paste":"_pasteHandler","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}get selectedIndexes(){return this.isCompleted?[this.selectedIndex]:[]}set selectedIndexes(e){if(!this.isCompleted)return;const t=this;if(e&&void 0!==e[0]){if(this.selectedIndex=e[0],null===this.dataSource)return;const a=this.dataSource[this.selectedIndex];if(!a)return;const r=this.context;this.context=this,this.$.input.dataValue=this.selectedValue="string"==typeof a?a:a.value,this.setAttribute("data-value",this.$.input.dataValue);let o=t.dataSource;"string"==typeof o&&(o=t.$.deserialize(o,"array"));for(let e=0;e<o.length;e++){let a=o[e];"string"!=typeof a&&"number"!=typeof a&&(a.value===t.$.input.dataValue?a.selected=!0:a.selected=!1)}this.context=r}else{const e=this.context;this.context=this,this.$.input.dataValue=this.selectedValue="",this.setAttribute("data-value",this.$.input.dataValue),this.selectedIndex=-1;let a=t.dataSource;if("string"==typeof a&&(a=t.$.deserialize(a,"array")),a&&Array.isArray(a))for(let e=0;e<a.length;e++){let r=a[e];"string"!=typeof r&&(r.value===t.$.input.dataValue?r.selected=!0:r.selected=!1)}this.context=e}}focus(){this.$.input.focus()}select(){const e=this;e.readonly?e.$.input.focus():e.$.input.select()}_documentUpHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;a!==t&&a!==t.$.dropDownButton&&a!==t.$.input&&a!==t.$.arrow?t.$.scrollView.contains(a.shadowParent||a)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),"manual"===t.dropDownOpenMode||t._isPointerDown||t.close(),t._isPointerDown=!1):t._isPointerDown=!1}_focusHandler(){const e=this;e.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup?(e.$.fireEvent("focus"),delete e._preventLookup):e._lookup()}_blurHandler(){const e=this;e.opened||e.removeAttribute("focus"),e.opened||e.$.fireEvent("blur"),e._refreshSelectedIndex(),delete e._preventLookup}_pasteHandler(e){const t=this,a=t.$.input,r=a.value,o=a.selectionStart,l=a.selectionEnd;if(!e.clipboardData&&!window.clipboardData)return;const n=(e.clipboardData||window.clipboardData).getData("text");let s=r.slice(0,o)+n,i=s.length;s+=r.slice(l),e.preventDefault(),t.set("value",s),t.setAttribute("data-value",s),a.setSelectionRange(i,i),t._refreshSelectedIndex()}_refreshSelectedIndex(){const e=this;let t=e.dataSource;if(t){let a=-1,r=null;if(e.dataSource instanceof Promise)return;if("function"==typeof e.dataSource)return;"string"==typeof t&&(t=e.$.deserialize(t,"array"));for(let o=0;o<t.length;o++){let l=t[o];if("number"!=typeof l&&"boolean"!=typeof l||(l=""+l),"string"==typeof l){if(l===e.value){a=o,r=e.value;break}}else l&&(delete l.selected,l.label===e.value&&(a=o,r=l.value,l.selected=!0))}e.set("selectedIndex",a,!1),e.set("selectedValue",r,!1),-1===e.selectedIndex&&(e.$.input.dataValue=null)}}selectItem(e){const t=this;let a=t.dataSource;if("string"==typeof a&&(a=t.$.deserialize(a,"array")),a)for(let r=0;r<a.length;r++){const o=a[r];if(t.set("selectedIndex",-1),t.set("value",""),t.$.input.dataValue=null,"string"==typeof o){if(o===e)return t.set("selectedIndex",r,!1),t.set("value",t.$.input.dataValue=e),void t.setAttribute("data-value",t.$.input.dataValue)}else if(o.value===e)return t.set("selectedIndex",r,!1),t.set("value",o.label),t.$.input.dataValue=e,void t.setAttribute("data-value",t.$.input.dataValue)}else t.set("value",t.$.input.dataValue=e),t.setAttribute("data-value",t.$.input.dataValue),t.set("selectedIndex",-1,!1)}getItem(e){const t=this;if(t.dataSource)for(let a=0;a<t.dataSource.length;a++){const r=t.dataSource[a];if(r.value===e)return r}return null}getPrevItem(){const e=this,t=e.getSelectedItem();if(e.dataSource&&t)for(let a=0;a<e.dataSource.length;a++)if(e.dataSource[a].value===t.value)return e.dataSource[a-1];return null}getNextItem(){const e=this,t=e.getSelectedItem();if(e.dataSource&&t)for(let a=0;a<e.dataSource.length;a++)if(e.dataSource[a].value===t.value)return e.dataSource[a+1];return null}getSelectedItem(){const e=this;return e.dataSource&&0===e.dataSource.length?{label:e.value,value:e.$.input.dataValue?e.$.input.dataValue:e.value}:{label:e.value,value:void 0!==e.$.input.dataValue?e.$.input.dataValue:e.value}}_refreshMenu(){const e=this;e.$.menu.classList.remove("scroll"),e.$.scrollView.computedVerticalScrollBarVisibility&&e.$.menu.classList.add("scroll")}_performSelect(){const e=this,t=e.$.menu.querySelector(".active"),a=t.getAttribute("data-label"),r=t.dataValue,o=e.value,l=e.$.input.dataValue;e.set("value",a),e.$.input.dataValue=r,e.setAttribute("data-value",r),e.set("selectedIndex",t.index),e.set("selectedValues",[e.$.input.dataValue]),e.set("selectedValue",e.$.input.dataValue);let n=e.dataSource;if("string"==typeof n&&(n=e.$.deserialize(n,"array")),n&&Array.isArray(n))for(let t=0;t<n.length;t++){let a=n[t];"string"!=typeof a&&"number"!=typeof a&&(a.value===e.$.input.dataValue?a.selected=!0:a.selected=!1)}e.close(),a===o&&r===l||(e.$.fireEvent("change",{value:r,label:a,oldValue:l,oldLabel:o}),e._updateTargetValue())}_open(){const e=this;if(e.opened)return;const t=window.scrollX,a=window.scrollY;let r=e.getBoundingClientRect(),o=0,l=0;if(e.timer&&clearTimeout(e.timer),e.getRootNode()&&e.getRootNode().host?e.getRootNode().host.shadowRoot.appendChild(e.$.scrollView):document.body.appendChild(e.$.scrollView),e.setAttribute("aria-owns",e.$.scrollView.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.scrollView.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();o=e.left,l=e.top}e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.style.left=-3+r.left+t-o+"px",e.$.scrollView.classList.remove("open"),"bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=r.bottom+a-l+1+"px":e.$.scrollView.style.top=r.top-e.$.scrollView.offsetHeight+a-l+1+"px",e.opening=!0,e._positionTimer&&clearInterval(e._positionTimer),e._positionTimer=setInterval((()=>{const t=e.getBoundingClientRect();if(e.opening)e.opening=!1,r=t;else if(Math.abs(parseInt(t.top)-parseInt(r.top))>=10||Math.abs(parseInt(t.left)-parseInt(r.left))>=10){const a=window.scrollX,r=window.scrollY;return e.$.scrollView.style.left=-3+t.left+a-o+"px",void("bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=t.bottom+r-l+1+"px":e.$.scrollView.style.top=t.top-e.$.scrollView.offsetHeight+r-l+1+"px")}}),50),e.$.scrollView.onpointerdown=function(){e._isPointerDown=!0},requestAnimationFrame((function(){const t=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.scrollView.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),t&&"string"==typeof t&&-1!==t.indexOf("%")){const a=parseFloat(t)/100;e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*a+"px")}else if("auto"!==t&&t)e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(t)+"px");else if("auto"===t){if(e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const a=e.$.menu.querySelectorAll("li");for(let t=0;t<a.length;t++)e._maxDropDownWidth=Math.max((a[t].firstElementChild||a[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>{e.$.scrollView._scrollView&&e.$.scrollView._scrollView.vScrollBar.refresh()}))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.set("opened",!0),e.setAttribute("aria-expanded",!0),e.$.fireEvent("open")}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(e.$.scrollView.remove(),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e._positionTimer&&clearInterval(e._positionTimer),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.set("opened",!1),e.setAttribute("aria-expanded",!1),e.$.input.focus(),e.$.fireEvent("close"),!0)}refresh(){const e=this;e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._getDataSourceFromOption(),e.close()}_lookup(e){const t=this;if(t.query=t.$.input.value,t.$.input.readonly&&(t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700)),t.query.length<t.minLength)return void t.close();const a=function(e){clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((()=>{const a=t.context;t.context=t,t._process(e),t.context=a}),t.autoCompleteDelay)};"function"==typeof t.dataSource?t.dataSource(t.query,a):a(t.dataSource)}_downHandler(e){const t=this;t.readonly&&t._dropDownButtonDownHandler(e)}_dropDownButtonDownHandler(e){const t=this;return"manual"!==t.dropDownOpenMode&&t._toggle(),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),t._isPointerDown=!0,!1}_toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this;function t(t){e._process(t);const a=e.$.menu.querySelector(".active");if(a){const t=e.$.input.dataValue;for(let r=0;r<e.$.menu.children.length;r++){const o=e.$.menu.children[r],l=o.getAttribute("data-label"),n=o.dataValue;if(void 0!==t&&n===t||void 0===t&&l===e.$.input.value){a.classList.remove("active"),o.classList.add("active"),e._setActiveDescendant(o),e.$.input.dataValue=n,e.setAttribute("data-value",n);break}}}e.ensureVisible(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}e.dropDownDataSource&&(Array.isArray(e.dropDownDataSource)&&e.dropDownDataSource.length>0||"function"==typeof e.dropDownDataSource)?(e.query="","function"==typeof e.dropDownDataSource?e.dropDownDataSource(e.query,t):t(e.dropDownDataSource)):(e.query="","function"==typeof e.dataSource?e.dataSource(e.query,t):t(e.dataSource))}_process(e){const t=this;"string"==typeof e&&(e=t.$.deserialize(e,"array")),e=t.readonly?e.filter((function(){return!0})):e.filter((function(e){return""===e||(t.matcher?t.matcher(e):t._matcher(e))})),e=t._sorter(e),t.sorted&&(e.sort(((e,t)=>void 0!==e.label?e.label.localeCompare(t.label):e.localeCompare(t))),"desc"===t.sortDirection&&e.reverse()),!e.length&&t.opened&&t.close(),0===e.length&&!0!==t.allowItemsAdd||(t.query.length>0?t._render(e.slice(0,t.items)):t._render(e),t._open(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),t._refreshMenu(),t.ensureVisible())}_matcher(e){const t=this.query;switch(null===e&&(e="null"),e=""+(e=e.label||e),this.queryMode){case"startsWith":return e.startsWith(t);case"startsWithIgnoreCase":return e.toLowerCase().startsWith(t.toLowerCase());case"doesNotContain":return e.indexOf(t)<0;case"doesNotContainIgnoreCase":return e.toLowerCase().indexOf(t.toLowerCase())<0;case"contains":return e.indexOf(t)>-1;default:case"containsIgnoreCase":return~e.toLowerCase().indexOf(t.toLowerCase());case"equals":return 0===e.localeCompare(t);case"equalsIgnoreCase":return 0===e.toLowerCase().localeCompare(t.toLowerCase());case"endsWith":return e.endsWith(t);case"endsWithIgnoreCase":return e.toLowerCase().endsWith(t.toLowerCase())}}_sorter(e){const t=this;let a,r=[],o=[],l=[];if(e&&""===e[0])return e;for(;a=e.shift();){let e=a.label||a;e=""+e,e.toLowerCase().indexOf(t.query.toLowerCase())?~e.indexOf(t.query)?o.push(a):l.push(a):r.push(a)}return r.concat(o,l)}_highlighter(e){const t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return this.query?e.replace(new RegExp("("+t+")","ig"),(function(e,t){return"<strong>"+t+"</strong>"})):e}_render(e){const t=this;let a=0,r=-1,o=null;const l=e.map((function(e){let l=e,n=e;"object"==typeof e&&(l=e.label,n=void 0!==e.value?e.value:l),l=""+l;const s=document.createElement("li"),i=document.createElement("a");if(i.href="#",s.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),s.setAttribute("data-label",l),s.index=a++,s.dataValue=n,"string"==typeof n?s.setAttribute("value",n):s.setAttribute("value",JSON.stringify(n)),s.setAttribute("role","option"),s.setAttribute("aria-label",l),void 0!==e.menuLabel?(l=e.menuLabel,i.innerHTML=l):i.innerHTML=t.highlighter?t.highlighter(l):t._highlighter(l),i.setAttribute("aria-hidden",!0),e.disabled&&s.classList.add("smart-disabled"),e.icon&&(i.classList.add("icon"),i.classList.add(e.icon)),e.prefix){const t=document.createElement("span");t.innerHTML=e.prefix,i.classList.add("has-prefix"),i.innerHTML=t.innerHTML+i.innerHTML}if(e.suffix){const t=document.createElement("span");t.innerHTML=e.suffix,i.classList.add("has-suffix"),i.innerHTML=i.innerHTML+t.innerHTML}if(e.dataset)for(let t in e.dataset)s.setAttribute("data-"+t,e.dataset[t]);if(e.className){const t=e.className.split(" ");for(let e=0;e<t.length;e++)s.classList.add(t[e].trim())}return void 0!==t.selectedValue&&void 0!==e.value&&""!==t.selectedValue&&t.selectedValue===e.value&&(e.selected=!0,o=e,r=s.index,s.classList.add("active")),s.appendChild(i),s}));function n(){const e=t.$.menu.getElementsByClassName("active");e[0]&&e[0].classList.remove("active"),this.classList.add("active"),t._setActiveDescendant(this)}-1===r&&l.length>0&&(l[0].classList.add("active"),t._setActiveDescendant(l[0])),o&&(t.$.input.value=o.label,t.$.input.dataValue=o.value,t.setAttribute("data-value",t.$.input.dataValue)),t.$.menu.innerHTML="";for(let e=0;e<l.length;e++){const a=l[e];t.$.menu.appendChild(a),a.onmouseenter=n,a.onmouseleave=function(){this.classList.remove("active"),t._setActiveDescendant(null)},a.onclick=n}}ensureVisible(){const e=this,t=e.$.menu.querySelector(".active");t&&(t.offsetTop+t.offsetHeight>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight&&(e.$.scrollView.scrollTop=t.offsetTop+t.offsetHeight),(t.offsetTop<=e.$.scrollView.scrollTop||t.offsetTop>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight)&&(e.$.scrollView.scrollTop=t.offsetTop),0===[...e.$.menu.children].indexOf(t)?e.$.scrollView.scrollTop=0:[...e.$.menu.children].indexOf(t)===e.$.menu.children.length-1&&(e.$.scrollView.scrollTop=e.$.scrollView.scrollHeight))}_next(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let a=t.nextElementSibling;a||(a=e.$.menu.firstElementChild),a.classList.add("active"),e._setActiveDescendant(a),e.ensureVisible()}_prev(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let a=t.previousElementSibling;a||(a=e.$.menu.lastElementChild),a.classList.add("active"),e._setActiveDescendant(a),e.ensureVisible()}_move(e){const t=this;if(t.readonly&&!t.opened){if("ArrowUp"===e.key){const a=t.getPrevItem();a&&t.selectItem(a.value),e.preventDefault()}if("ArrowDown"===e.key){const a=t.getNextItem();a&&t.selectItem(a.value),e.preventDefault()}}if(t.opened){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),t._prev();break;case 40:e.preventDefault(),t._next()}e.stopPropagation()}}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),t._oldValue=t.$.input.value,e.shiftKey||e.altKey||e.ctrlKey||t._move(e)}_keyPressHandler(e){this._suppressKeyPressRepeat||e.shiftKey||e.altKey||e.ctrlKey||this._move(e)}_keyUpHandler(e){const t=this;if(!e.shiftKey&&"F2"!==e.key)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.$.fireEvent("changing",{value:t.$.input.value,oldValue:t._oldValue}),t.$.input.dataValue=t.$.input.value,t.setAttribute("data-value",t.$.input.dataValue),t._updateTargetValue()}}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const r=this;if("innerHTML"===e&&(r._getDataSourceFromOption(),r._setSelection(!1)),"selectedValue"===e){let e=-1;if(r.dataSource&&Array.isArray(r.dataSource)&&r.dataSource.forEach(((t,r)=>{"string"==typeof t?t===a&&(e=r):t&&t.value===a&&(e=r)})),e>=0){const t=r.context;r.context=r,r.selectedIndex=e,r.context=t}r._setSelection()}if("selectedIndex"===e){let e=r.dataSource;if(r.selectedValue=null,e&&Array.isArray(e))for(let t=0;t<e.length;t++){let a=e[t];"string"!=typeof a&&"number"!=typeof a&&(a.selected=!1)}r._setSelection()}else if("dataSource"===e){if(r.dataSource&&Array.isArray(r.dataSource)){let e=-1;if(r.dataSource.forEach(((t,a)=>{t.selected&&(e=a)})),e>=0){const t=r.context;r.context=r,r.selectedIndex=e,r.context=t}}r._setSelection(!1)}else if("dropDownClassList"===e){const e=r.$.scrollView;for(let a=0,r=t.length;a<r;a+=1)e.classList.remove(t[a]);for(let t=0,r=a.length;t<r;t+=1)e.classList.add(a[t])}else if("dropDownHeight"===e)"auto"!==r.dropDownHeight?r.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height",r.dropDownHeight+"px"):r.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height","auto");else if("opened"===e)r.opened=t,a?r.open():r.close();else if("placeholder"===e){if(r.readonly){const e=r.getAttribute("aria-label");if(e&&e!==t)return;a?r.setAttribute("aria-label",a):r.removeAttribute("aria-label")}}else if("selectedValues"===e)if(null===a)r.$.input.value="",r.$.input.dataValue=a,r.setAttribute("data-value",a),r._refreshSelectedIndex();else{const e=a.join(","),t=r.value;r.$.input.dataValue=e,r._setSelection(),r.propertyChangedHandler("value",t,r.value)}else"value"===e?(r.displayMember!==r.valueMember&&"string"!=typeof a?(r.set("value",a[r.displayMember]),r.$.input.dataValue=a[r.valueMember],r.setAttribute("data-value",r.$.input.dataValue)):(r.$.input.value=r.$.input.dataValue=a,r.setAttribute("data-value",a)),r._refreshSelectedIndex()):"readonly"===e?(r._setAriaRelations(),r._setInputPurpose()):"theme"===e||"rightToLeft"===e?r.$.scrollView[e]=a:"inputPurpose"===e?r._setInputPurpose():"inverted"===e?a?r.$.scrollView.setAttribute("inverted",""):r.$.scrollView.removeAttribute("inverted"):"disabled"!==e&&"unfocusable"!==e||r._setFocusable()}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const a=e.dataset.property,r=e.value;a&&void 0!==t[a]&&(t[a]=r)}}}detached(){super.detached(),this.close(),this.removeAttribute("focus")}_getDataSourceFromOption(){const e=this;if(e.innerHTML.indexOf("<option")>=0){e.$.optionsContainer.innerHTML=e.innerHTML.trim();const t=e.querySelectorAll("option");let a=[];for(let e=0;e<t.length;e++){const r=t[e],o=r.hasAttribute("selected"),l=(""+r.textContent).trim(),n=(""+r.innerHTML).trim(),s=r.hasAttribute("value")?r.getAttribute("value"):l,i=r.hasAttribute("disabled");a.push({label:l,menuLabel:n,value:s,disabled:i,selected:o,className:r.className,dataset:r.dataset}),r.classList.add("smart-hidden")}e.dataSource=a}}render(){const e=this,t=e.dropDownClassList;if(e._getDataSourceFromOption(),e.selectedValues&&e.selectedValues.length){const t=e.selectedValues.join(",");e.value=t}e._createElement&&e._createElement();const a=e.$.scrollView;for(let e=0,r=t.length;e<r;e+=1)a.classList.add(t[e]);e.opened&&(e.opened=!1,e.open());const r=e.$.menu;r&&(r.setAttribute("role","presentation"),a.appendChild(r)),"auto"!==e.dropDownHeight?a.style.setProperty("--smart-input-drop-down-menu-height",e.dropDownHeight+"px"):a.style.setProperty("--smart-input-drop-down-menu-height","auto"),a.classList.add("smart-input-drop-down-menu");for(let t=0;t<e.classList.length;t++){const r=e.classList[t];"smart-element"!==r&&"smart-input"!==r&&a.classList.add(r+"-drop-down-menu")}a.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),a.ownerElement=e;let o=e.dataSource;if("string"==typeof o&&(o=e.$.deserialize(o,"array")),o&&o.length&&Array.isArray(o)){let t=-1;if(o.forEach(((e,a)=>{e.selected&&(t=a)})),t>=0){e.selectedIndex=t;const a=o[t];e.selectedValue="string"==typeof a?o[t]:o[t].value}}e._setAriaRelations(),e._setInputPurpose(),e._setSelection(),e.isInitialized=!0,super.render()}_setSelection(e){const t=this;let a=t.dataSource;if("string"==typeof a&&(a=t.$.deserialize(a,"array")),t.selectedIndex>=0&&a&&a.length>0){let r=a[t.selectedIndex];if("number"!=typeof r&&"boolean"!=typeof r||(r=""+r),"string"==typeof r){let e=t.$.input.dataValue,a=t.value;t.set("value",r),t.$.input.dataValue=r,t.$.input.setAttribute("data-value",r),t.selectedValues=[t.$.input.dataValue],t.isInitialized&&(t.$.fireEvent("change",{value:t.value,label:t.label,oldValue:e,oldLabel:a}),t._updateTargetValue())}else{let a=t.$.input.dataValue,o=t.value;r&&(void 0!==r.value?(t.set("value",void 0!==r.value?r.value+"":""),t.$.input.dataValue=r.value,t.$.input.setAttribute("data-value",r.value),t.selectedValues=[t.$.input.dataValue]):r.label&&(t.selectedValues=[r.value]),r.label&&t.set("value",r.label)),t.isInitialized&&!1!==e&&(t.$.fireEvent("change",{value:t.$.input.dataValue,label:r.value,oldValue:a,oldLabel:o}),t._updateTargetValue())}}}_createElement(){const e=this,t=document.createElement("ul"),a=document.createElement("smart-scroll-viewer");a.rightToLeft=e.rightToLeft,a.theme=e.theme,a.horizontalScrollBarVisibility="hidden",e.inverted?a.setAttribute("inverted",""):a.removeAttribute("inverted"),e.$.scrollView=a,e.$.menu=t,e._setFocusable(),e.$.menu.onclick=function(t){const a=t.target.closest("li");t.stopPropagation(),t.preventDefault(),e._performSelect(),a&&e.$.fireEvent("itemClick",{item:a,label:a.getAttribute("aria-label"),value:a.dataValue}),e.$.input.focus()}}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.removeAttribute("aria-readonly"),e.$.input.setAttribute("aria-hidden",!0),e.$.input.removeAttribute("aria-activedescendant"),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","combobox"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.setAttribute("role","searchbox"),e.$.input.removeAttribute("aria-hidden",!0),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-expanded",e.opened),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-owns",e.$.scrollView.id),e.$.scrollView.setAttribute("role","listbox")}_setActiveDescendant(e){const t=this;t.readonly||(e?t.setAttribute("aria-activedescendant",e.id):t.removeAttribute("aria-activedescendant"))}_setInputPurpose(){const e=this;e.readonly?e.$.input.removeAttribute("autocomplete"):e.$.input.setAttribute("autocomplete",e.inputPurpose)}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.$.input.setAttribute("tabindex",-1):e.$.input.removeAttribute("tabindex")}});
6
+ Smart("smart-input",class extends Smart.BaseElement{static get properties(){return{autoCompleteDelay:{value:100,type:"number"},dataSource:{type:"any",value:[],reflectToAttribute:!1},dropDownClassList:{value:[],type:"array",reflectToAttribute:!1},dropDownDataSource:{type:"any",value:[]},dropDownHeight:{type:"any",value:200},dropDownOpenMode:{allowedValues:["default","manual"],value:"default",type:"string"},dropDownAppendTo:{value:null,type:"any"},dropDownWidth:{type:"any",value:null},dropDownButtonPosition:{allowedValues:["none","left","right"],value:"none",type:"string"},dropDownOpenPosition:{allowedValues:["bottom","top"],value:"bottom",type:"string"},hint:{type:"string",value:""},inputPurpose:{type:"string",value:"off"},items:{type:"number",value:8},minLength:{type:"number",value:1},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},query:{type:"string",value:""},queryMode:{allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string",value:"containsIgnoreCase"},placeholder:{value:"",type:"string"},readonly:{type:"boolean",value:!1},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},selectedIndex:{type:"number",value:-1},selectedValue:{type:"any",value:""},selectedValues:{value:[],type:"array"},type:{type:"string"},value:{type:"string",value:""},innerHTML:{type:"string",reflectToAttribute:!1}}}static get styleUrls(){return["smart.textbox.css"]}template(){return'<div id="inputContainer" role="presentation"><div id="optionsContainer" inner-h-t-m-l=\'{{innerHTML}}\' class="smart-hidden"></div><input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' value=\'{{value::keyup}}\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}static get listeners(){return{"input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","input.paste":"_pasteHandler","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}get selectedIndexes(){return this.isCompleted?[this.selectedIndex]:[]}set selectedIndexes(e){if(!this.isCompleted)return;const t=this;if(e&&void 0!==e[0]){if(this.selectedIndex=e[0],null===this.dataSource)return;const o=this.dataSource[this.selectedIndex];if(!o)return;const a=this.context;this.context=this,this.$.input.dataValue=this.selectedValue="string"==typeof o?o:o.value,this.setAttribute("data-value",this.$.input.dataValue);let r=t.dataSource;"string"==typeof r&&(r=t.$.deserialize(r,"array"));for(let e=0;e<r.length;e++){let o=r[e];"string"!=typeof o&&"number"!=typeof o&&(o.value===t.$.input.dataValue?o.selected=!0:o.selected=!1)}this.context=a}else{const e=this.context;this.context=this,this.$.input.dataValue=this.selectedValue="",this.setAttribute("data-value",this.$.input.dataValue),this.selectedIndex=-1;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),o&&Array.isArray(o))for(let e=0;e<o.length;e++){let a=o[e];"string"!=typeof a&&(a.value===t.$.input.dataValue?a.selected=!0:a.selected=!1)}this.context=e}}focus(){this.$.input.focus()}select(){const e=this;e.readonly?e.$.input.focus():e.$.input.select()}_documentUpHandler(e){const t=this,o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;o!==t&&o!==t.$.dropDownButton&&o!==t.$.input&&o!==t.$.arrow?t.$.scrollView.contains(o.shadowParent||o)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),"manual"===t.dropDownOpenMode||t._isPointerDown||t.close(),t._isPointerDown=!1):t._isPointerDown=!1}_focusHandler(){const e=this;e.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup?(e.$.fireEvent("focus"),delete e._preventLookup):e._lookup()}_blurHandler(){const e=this;e.opened||e.removeAttribute("focus"),e.opened||e.$.fireEvent("blur"),e._refreshSelectedIndex(),delete e._preventLookup}_pasteHandler(e){const t=this,o=t.$.input,a=o.value,r=o.selectionStart,l=o.selectionEnd;if(!e.clipboardData&&!window.clipboardData)return;const n=(e.clipboardData||window.clipboardData).getData("text");let s=a.slice(0,r)+n,i=s.length;s+=a.slice(l),e.preventDefault(),t.set("value",s),t.setAttribute("data-value",s),o.setSelectionRange(i,i),t._refreshSelectedIndex()}_refreshSelectedIndex(){const e=this;let t=e.dataSource;if(t){let o=-1,a=null;if(e.dataSource instanceof Promise)return;if("function"==typeof e.dataSource)return;"string"==typeof t&&(t=e.$.deserialize(t,"array"));for(let r=0;r<t.length;r++){let l=t[r];if("number"!=typeof l&&"boolean"!=typeof l||(l=""+l),"string"==typeof l){if(l===e.value){o=r,a=e.value;break}}else l&&(delete l.selected,l.label===e.value&&(o=r,a=l.value,l.selected=!0))}e.set("selectedIndex",o,!1),e.set("selectedValue",a,!1),-1===e.selectedIndex&&(e.$.input.dataValue=null)}}selectItem(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),o)for(let a=0;a<o.length;a++){const r=o[a];if(t.set("selectedIndex",-1),t.set("value",""),t.$.input.dataValue=null,"string"==typeof r){if(r===e)return t.set("selectedIndex",a,!1),t.set("value",t.$.input.dataValue=e),void t.setAttribute("data-value",t.$.input.dataValue)}else if(r.value===e)return t.set("selectedIndex",a,!1),t.set("value",r.label),t.$.input.dataValue=e,void t.setAttribute("data-value",t.$.input.dataValue)}else t.set("value",t.$.input.dataValue=e),t.setAttribute("data-value",t.$.input.dataValue),t.set("selectedIndex",-1,!1)}getItem(e){const t=this;if(t.dataSource)for(let o=0;o<t.dataSource.length;o++){const a=t.dataSource[o];if(a.value===e)return a}return null}getPrevItem(){const e=this,t=e.getSelectedItem();if(e.dataSource&&t)for(let o=0;o<e.dataSource.length;o++)if(e.dataSource[o].value===t.value)return e.dataSource[o-1];return null}getNextItem(){const e=this,t=e.getSelectedItem();if(e.dataSource&&t)for(let o=0;o<e.dataSource.length;o++)if(e.dataSource[o].value===t.value)return e.dataSource[o+1];return null}getSelectedItem(){const e=this;return e.dataSource&&0===e.dataSource.length?{label:e.value,value:e.$.input.dataValue?e.$.input.dataValue:e.value}:{label:e.value,value:void 0!==e.$.input.dataValue?e.$.input.dataValue:e.value}}_refreshMenu(){const e=this;e.$.menu.classList.remove("scroll"),e.$.scrollView.computedVerticalScrollBarVisibility&&e.$.menu.classList.add("scroll")}_performSelect(){const e=this,t=e.$.menu.querySelector(".active"),o=t.getAttribute("data-label"),a=t.dataValue,r=e.value,l=e.$.input.dataValue;e.set("value",o),e.$.input.dataValue=a,e.setAttribute("data-value",a),e.set("selectedIndex",t.index),e.set("selectedValues",[e.$.input.dataValue]),e.set("selectedValue",e.$.input.dataValue);let n=e.dataSource;if("string"==typeof n&&(n=e.$.deserialize(n,"array")),n&&Array.isArray(n))for(let t=0;t<n.length;t++){let o=n[t];"string"!=typeof o&&"number"!=typeof o&&(o.value===e.$.input.dataValue?o.selected=!0:o.selected=!1)}e.close(),o===r&&a===l||(e.$.fireEvent("change",{value:a,label:o,oldValue:l,oldLabel:r}),e._updateTargetValue())}_open(){const e=this;if(e.opened)return;const t=window.scrollX,o=window.scrollY;let a=e.getBoundingClientRect(),r=0,l=0;if(e.timer&&clearTimeout(e.timer),e.getRootNode()&&e.getRootNode().host)e.getRootNode().host.shadowRoot.appendChild(e.$.scrollView);else if(e.dropDownAppendTo){if("body"===e.dropDownAppendTo||e.dropDownAppendTo===document.body)document.body.appendChild(e.$.scrollView);else if(e.dropDownAppendTo instanceof HTMLElement)e.dropDownAppendTo.appendChild(e.$.scrollView);else if("string"==typeof dropDownAppendTo){let t=document.getElementById(e.dropDownAppendTo);t instanceof HTMLElement?t.appendChild(e.$.scrollView):document.body.appendChild(e.$.scrollView)}}else document.body.appendChild(e.$.scrollView);if(e.setAttribute("aria-owns",e.$.scrollView.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.scrollView.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();r=e.left,l=e.top}if(e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.style.left=-3+a.left+t-r+"px",e.$.scrollView.classList.remove("open"),"bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=a.bottom+o-l+1+"px":e.$.scrollView.style.top=a.top-e.$.scrollView.offsetHeight+o-l+1+"px",e.dropDownAppendTo&&"body"!==e.dropDownAppendTo){e.$.scrollView.style.position="absolute",e.$.scrollView.style.width="auto",e.$.scrollView.style.height="auto";const t=e.$.scrollView.parentNode.getBoundingClientRect();e.$.scrollView.style.top=a.bottom-t.top+"px","top"===e.dropDownOpenPosition&&(e.$.scrollView.style.top=a.top-t.top-e.$.scrollView.offsetHeight+"px"),e.$.scrollView.style.left=-3+a.left-t.left+"px",e.dropDownHeight&&(e.$.scrollView.style.height=e.dropDownHeight),e.dropDownWidth&&(e.$.scrollView.style.width=e.dropDownWidth)}e.opening=!0,e._positionTimer&&clearInterval(e._positionTimer),e.dropDownAppendTo||(e._positionTimer=setInterval((()=>{const t=e.getBoundingClientRect();if(e.opening)e.opening=!1,a=t;else if(Math.abs(parseInt(t.top)-parseInt(a.top))>=10||Math.abs(parseInt(t.left)-parseInt(a.left))>=10){const o=window.scrollX,a=window.scrollY;return e.$.scrollView.style.left=-3+t.left+o-r+"px",void("bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=t.bottom+a-l+1+"px":e.$.scrollView.style.top=t.top-e.$.scrollView.offsetHeight+a-l+1+"px")}}),50)),e.$.scrollView.onpointerdown=function(){e._isPointerDown=!0},requestAnimationFrame((function(){const t=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.scrollView.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),t&&"string"==typeof t&&-1!==t.indexOf("%")){const o=parseFloat(t)/100;e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*o+"px")}else if("auto"!==t&&t)e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(t)+"px");else if("auto"===t){if(e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const o=e.$.menu.querySelectorAll("li");for(let t=0;t<o.length;t++)e._maxDropDownWidth=Math.max((o[t].firstElementChild||o[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>{e.$.scrollView._scrollView&&e.$.scrollView._scrollView.vScrollBar.refresh()}))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.set("opened",!0),e.setAttribute("aria-expanded",!0),e.$.fireEvent("open")}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(e.$.scrollView.remove(),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e._positionTimer&&clearInterval(e._positionTimer),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.set("opened",!1),e.setAttribute("aria-expanded",!1),e.$.input.focus(),e.$.fireEvent("close"),!0)}refresh(){const e=this;e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._getDataSourceFromOption(),e.close()}_lookup(e){const t=this;if(t.query=t.$.input.value,t.$.input.readonly&&(t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700)),t.query.length<t.minLength)return void t.close();const o=function(e){clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((()=>{const o=t.context;t.context=t,t._process(e),t.context=o}),t.autoCompleteDelay)};"function"==typeof t.dataSource?t.dataSource(t.query,o):o(t.dataSource)}_downHandler(e){const t=this;t.readonly&&t._dropDownButtonDownHandler(e)}_dropDownButtonDownHandler(e){const t=this;return"manual"!==t.dropDownOpenMode&&t._toggle(),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),t._isPointerDown=!0,!1}_toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this;function t(t){e._process(t);const o=e.$.menu.querySelector(".active");if(o){const t=e.$.input.dataValue;for(let a=0;a<e.$.menu.children.length;a++){const r=e.$.menu.children[a],l=r.getAttribute("data-label"),n=r.dataValue;if(void 0!==t&&n===t||void 0===t&&l===e.$.input.value){o.classList.remove("active"),r.classList.add("active"),e._setActiveDescendant(r),e.$.input.dataValue=n,e.setAttribute("data-value",n);break}}}e.ensureVisible(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}e.dropDownDataSource&&(Array.isArray(e.dropDownDataSource)&&e.dropDownDataSource.length>0||"function"==typeof e.dropDownDataSource)?(e.query="","function"==typeof e.dropDownDataSource?e.dropDownDataSource(e.query,t):t(e.dropDownDataSource)):(e.query="","function"==typeof e.dataSource?e.dataSource(e.query,t):t(e.dataSource))}_process(e){const t=this;"string"==typeof e&&(e=t.$.deserialize(e,"array")),e=t.readonly?e.filter((function(){return!0})):e.filter((function(e){return""===e||(t.matcher?t.matcher(e):t._matcher(e))})),e=t._sorter(e),t.sorted&&(e.sort(((e,t)=>void 0!==e.label?e.label.localeCompare(t.label):e.localeCompare(t))),"desc"===t.sortDirection&&e.reverse()),!e.length&&t.opened&&t.close(),0===e.length&&!0!==t.allowItemsAdd||(t.query.length>0?t._render(e.slice(0,t.items)):t._render(e),t._open(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),t._refreshMenu(),t.ensureVisible())}_matcher(e){const t=this.query;switch(null===e&&(e="null"),e=""+(e=e.label||e),this.queryMode){case"startsWith":return e.startsWith(t);case"startsWithIgnoreCase":return e.toLowerCase().startsWith(t.toLowerCase());case"doesNotContain":return e.indexOf(t)<0;case"doesNotContainIgnoreCase":return e.toLowerCase().indexOf(t.toLowerCase())<0;case"contains":return e.indexOf(t)>-1;default:case"containsIgnoreCase":return~e.toLowerCase().indexOf(t.toLowerCase());case"equals":return 0===e.localeCompare(t);case"equalsIgnoreCase":return 0===e.toLowerCase().localeCompare(t.toLowerCase());case"endsWith":return e.endsWith(t);case"endsWithIgnoreCase":return e.toLowerCase().endsWith(t.toLowerCase())}}_sorter(e){const t=this;let o,a=[],r=[],l=[];if(e&&""===e[0])return e;for(;o=e.shift();){let e=o.label||o;e=""+e,e.toLowerCase().indexOf(t.query.toLowerCase())?~e.indexOf(t.query)?r.push(o):l.push(o):a.push(o)}return a.concat(r,l)}_highlighter(e){const t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return this.query?e.replace(new RegExp("("+t+")","ig"),(function(e,t){return"<strong>"+t+"</strong>"})):e}_render(e){const t=this;let o=0,a=-1,r=null;const l=e.map((function(e){let l=e,n=e;"object"==typeof e&&(l=e.label,n=void 0!==e.value?e.value:l),l=""+l,l=l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;");const s=document.createElement("li"),i=document.createElement("a");if(i.href="#",s.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),s.setAttribute("data-label",l),s.index=o++,s.dataValue=n,"string"==typeof n?s.setAttribute("value",n):s.setAttribute("value",JSON.stringify(n)),s.setAttribute("role","option"),s.setAttribute("aria-label",l),void 0!==e.menuLabel?(l=e.menuLabel,i.innerHTML=l):i.innerHTML=t.highlighter?t.highlighter(l):t._highlighter(l),i.setAttribute("aria-hidden",!0),e.disabled&&s.classList.add("smart-disabled"),e.icon&&(i.classList.add("icon"),i.classList.add(e.icon)),e.prefix){const t=document.createElement("span");t.innerHTML=e.prefix,i.classList.add("has-prefix"),i.innerHTML=t.innerHTML+i.innerHTML}if(e.suffix){const t=document.createElement("span");t.innerHTML=e.suffix,i.classList.add("has-suffix"),i.innerHTML=i.innerHTML+t.innerHTML}if(e.dataset)for(let t in e.dataset)s.setAttribute("data-"+t,e.dataset[t]);if(e.className){const t=e.className.split(" ");for(let e=0;e<t.length;e++)s.classList.add(t[e].trim())}return void 0!==t.selectedValue&&void 0!==e.value&&""!==t.selectedValue&&t.selectedValue===e.value&&(e.selected=!0,r=e,a=s.index,s.classList.add("active")),s.appendChild(i),s}));function n(){const e=t.$.menu.getElementsByClassName("active");e[0]&&e[0].classList.remove("active"),this.classList.add("active"),t._setActiveDescendant(this)}-1===a&&l.length>0&&(l[0].classList.add("active"),t._setActiveDescendant(l[0])),r&&(t.$.input.value=r.label,t.$.input.dataValue=r.value,t.setAttribute("data-value",t.$.input.dataValue)),t.$.menu.innerHTML="";for(let e=0;e<l.length;e++){const o=l[e];t.$.menu.appendChild(o),o.onmouseenter=n,o.onmouseleave=function(){this.classList.remove("active"),t._setActiveDescendant(null)},o.onclick=n}}ensureVisible(){const e=this,t=e.$.menu.querySelector(".active");t&&(t.offsetTop+t.offsetHeight>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight&&(e.$.scrollView.scrollTop=t.offsetTop+t.offsetHeight),(t.offsetTop<=e.$.scrollView.scrollTop||t.offsetTop>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight)&&(e.$.scrollView.scrollTop=t.offsetTop),0===[...e.$.menu.children].indexOf(t)?e.$.scrollView.scrollTop=0:[...e.$.menu.children].indexOf(t)===e.$.menu.children.length-1&&(e.$.scrollView.scrollTop=e.$.scrollView.scrollHeight))}_next(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.nextElementSibling;o||(o=e.$.menu.firstElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_prev(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.previousElementSibling;o||(o=e.$.menu.lastElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_move(e){const t=this;if(t.readonly&&!t.opened){if("ArrowUp"===e.key){const o=t.getPrevItem();o&&t.selectItem(o.value),e.preventDefault()}if("ArrowDown"===e.key){const o=t.getNextItem();o&&t.selectItem(o.value),e.preventDefault()}}if(t.opened){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),t._prev();break;case 40:e.preventDefault(),t._next()}e.stopPropagation()}}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),t._oldValue=t.$.input.value,e.shiftKey||e.altKey||e.ctrlKey||t._move(e)}_keyPressHandler(e){this._suppressKeyPressRepeat||e.shiftKey||e.altKey||e.ctrlKey||this._move(e)}_keyUpHandler(e){const t=this;if(!e.shiftKey&&"F2"!==e.key)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.$.fireEvent("changing",{value:t.$.input.value,oldValue:t._oldValue}),t.$.input.dataValue=t.$.input.value,t.setAttribute("data-value",t.$.input.dataValue),t._updateTargetValue()}}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const a=this;if("innerHTML"===e&&(a._getDataSourceFromOption(),a._setSelection(!1)),"selectedValue"===e){let e=-1;if(a.dataSource&&Array.isArray(a.dataSource)&&a.dataSource.forEach(((t,a)=>{"string"==typeof t?t===o&&(e=a):t&&t.value===o&&(e=a)})),e>=0){const t=a.context;a.context=a,a.selectedIndex=e,a.context=t}a._setSelection()}if("selectedIndex"===e){let e=a.dataSource;if(a.selectedValue=null,e&&Array.isArray(e))for(let t=0;t<e.length;t++){let o=e[t];"string"!=typeof o&&"number"!=typeof o&&(o.selected=!1)}a._setSelection()}else if("dataSource"===e){if(a.dataSource&&Array.isArray(a.dataSource)){let e=-1;if(a.dataSource.forEach(((t,o)=>{t.selected&&(e=o)})),e>=0){const t=a.context;a.context=a,a.selectedIndex=e,a.context=t}}a._setSelection(!1)}else if("dropDownClassList"===e){const e=a.$.scrollView;for(let o=0,a=t.length;o<a;o+=1)e.classList.remove(t[o]);for(let t=0,a=o.length;t<a;t+=1)e.classList.add(o[t])}else if("dropDownHeight"===e)"auto"!==a.dropDownHeight?a.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height",a.dropDownHeight+"px"):a.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height","auto");else if("opened"===e)a.opened=t,o?a.open():a.close();else if("placeholder"===e){if(a.readonly){const e=a.getAttribute("aria-label");if(e&&e!==t)return;o?a.setAttribute("aria-label",o):a.removeAttribute("aria-label")}}else if("selectedValues"===e)if(null===o)a.$.input.value="",a.$.input.dataValue=o,a.setAttribute("data-value",o),a._refreshSelectedIndex();else{const e=o.join(","),t=a.value;a.$.input.dataValue=e,a._setSelection(),a.propertyChangedHandler("value",t,a.value)}else"value"===e?(a.displayMember!==a.valueMember&&"string"!=typeof o?(a.set("value",o[a.displayMember]),a.$.input.dataValue=o[a.valueMember],a.setAttribute("data-value",a.$.input.dataValue)):(a.$.input.value=a.$.input.dataValue=o,a.setAttribute("data-value",o)),a._refreshSelectedIndex()):"readonly"===e?(a._setAriaRelations(),a._setInputPurpose()):"theme"===e||"rightToLeft"===e?a.$.scrollView[e]=o:"inputPurpose"===e?a._setInputPurpose():"inverted"===e?o?a.$.scrollView.setAttribute("inverted",""):a.$.scrollView.removeAttribute("inverted"):"disabled"!==e&&"unfocusable"!==e||a._setFocusable()}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const o=e.dataset.property,a=e.value;o&&void 0!==t[o]&&(t[o]=a)}}}detached(){super.detached(),this.close(),this.removeAttribute("focus")}_getDataSourceFromOption(){const e=this;if(e.innerHTML.indexOf("<option")>=0){e.$.optionsContainer.innerHTML=e.innerHTML.trim();const t=e.querySelectorAll("option");let o=[];for(let e=0;e<t.length;e++){const a=t[e],r=a.hasAttribute("selected"),l=(""+a.textContent).trim(),n=(""+a.innerHTML).trim(),s=a.hasAttribute("value")?a.getAttribute("value"):l,i=a.hasAttribute("disabled");o.push({label:l,menuLabel:n,value:s,disabled:i,selected:r,className:a.className,dataset:a.dataset}),a.classList.add("smart-hidden")}e.dataSource=o}}render(){const e=this,t=e.dropDownClassList;if(e._getDataSourceFromOption(),e.selectedValues&&e.selectedValues.length){const t=e.selectedValues.join(",");e.value=t}e._createElement&&e._createElement();const o=e.$.scrollView;for(let e=0,a=t.length;e<a;e+=1)o.classList.add(t[e]);e.opened&&(e.opened=!1,e.open());const a=e.$.menu;a&&(a.setAttribute("role","presentation"),o.appendChild(a)),"auto"!==e.dropDownHeight?o.style.setProperty("--smart-input-drop-down-menu-height",e.dropDownHeight+"px"):o.style.setProperty("--smart-input-drop-down-menu-height","auto"),o.classList.add("smart-input-drop-down-menu");for(let t=0;t<e.classList.length;t++){const a=e.classList[t];"smart-element"!==a&&"smart-input"!==a&&o.classList.add(a+"-drop-down-menu")}o.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),o.ownerElement=e;let r=e.dataSource;if("string"==typeof r&&(r=e.$.deserialize(r,"array")),r&&r.length&&Array.isArray(r)){let t=-1;if(r.forEach(((e,o)=>{e.selected&&(t=o)})),t>=0){e.selectedIndex=t;const o=r[t];e.selectedValue="string"==typeof o?r[t]:r[t].value}}e._setAriaRelations(),e._setInputPurpose(),e._setSelection(),e.isInitialized=!0,super.render()}_setSelection(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),t.selectedIndex>=0&&o&&o.length>0){let a=o[t.selectedIndex];if("number"!=typeof a&&"boolean"!=typeof a||(a=""+a),"string"==typeof a){let e=t.$.input.dataValue,o=t.value;t.set("value",a),t.$.input.dataValue=a,t.$.input.setAttribute("data-value",a),t.selectedValues=[t.$.input.dataValue],t.isInitialized&&(t.$.fireEvent("change",{value:t.value,label:t.label,oldValue:e,oldLabel:o}),t._updateTargetValue())}else{let o=t.$.input.dataValue,r=t.value;a&&(void 0!==a.value?(t.set("value",void 0!==a.value?a.value+"":""),t.$.input.dataValue=a.value,t.$.input.setAttribute("data-value",a.value),t.selectedValues=[t.$.input.dataValue]):a.label&&(t.selectedValues=[a.value]),a.label&&t.set("value",a.label)),t.isInitialized&&!1!==e&&(t.$.fireEvent("change",{value:t.$.input.dataValue,label:a.value,oldValue:o,oldLabel:r}),t._updateTargetValue())}}}_createElement(){const e=this,t=document.createElement("ul"),o=document.createElement("smart-scroll-viewer");o.rightToLeft=e.rightToLeft,o.theme=e.theme,o.horizontalScrollBarVisibility="hidden",e.inverted?o.setAttribute("inverted",""):o.removeAttribute("inverted"),e.$.scrollView=o,e.$.menu=t,e._setFocusable();const a=e.$.input;e.$.menu.onclick=function(t){const o=t.target.closest("li");t.stopPropagation(),t.preventDefault(),e._performSelect(),o&&e.$.fireEvent("itemClick",{item:o,label:o.getAttribute("aria-label"),value:o.dataValue}),a.focus()}}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.removeAttribute("aria-readonly"),e.$.input.setAttribute("aria-hidden",!0),e.$.input.removeAttribute("aria-activedescendant"),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","combobox"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.setAttribute("role","searchbox"),e.$.input.removeAttribute("aria-hidden",!0),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-expanded",e.opened),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-owns",e.$.scrollView.id),e.$.scrollView.setAttribute("role","listbox")}_setActiveDescendant(e){const t=this;t.readonly||(e?t.setAttribute("aria-activedescendant",e.id):t.removeAttribute("aria-activedescendant"))}_setInputPurpose(){const e=this;e.readonly?e.$.input.removeAttribute("autocomplete"):e.$.input.setAttribute("autocomplete",e.inputPurpose)}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.$.input.setAttribute("tabindex",-1):e.$.input.removeAttribute("tabindex")}});