smart-webcomponents-react 17.0.0 → 17.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (551) hide show
  1. package/accordion/accordion.d.ts +0 -1
  2. package/accordion/accordion.esm.js +19 -10
  3. package/accordion/accordion.umd.js +8 -3
  4. package/accordion/accordionitem.d.ts +0 -1
  5. package/alertwindow/alertwindow.d.ts +0 -1
  6. package/alertwindow/alertwindow.esm.js +15 -9
  7. package/alertwindow/alertwindow.umd.js +4 -2
  8. package/array/array.d.ts +0 -1
  9. package/array/array.esm.js +15 -9
  10. package/array/array.umd.js +4 -2
  11. package/barcode/barcode.d.ts +0 -1
  12. package/barcode/barcode.esm.js +15 -9
  13. package/barcode/barcode.umd.js +4 -2
  14. package/breadcrumb/breadcrumb.d.ts +0 -1
  15. package/breadcrumb/breadcrumb.esm.js +15 -9
  16. package/breadcrumb/breadcrumb.umd.js +4 -2
  17. package/button/button.d.ts +0 -1
  18. package/button/button.esm.js +27 -12
  19. package/button/button.umd.js +16 -5
  20. package/button/buttongroup.d.ts +0 -1
  21. package/button/dropdownbutton.d.ts +0 -1
  22. package/button/multisplitbutton.d.ts +0 -1
  23. package/button/powerbutton.d.ts +0 -1
  24. package/button/radiobutton.d.ts +0 -1
  25. package/button/repeatbutton.d.ts +0 -1
  26. package/button/switchbutton.d.ts +0 -1
  27. package/button/togglebutton.d.ts +0 -1
  28. package/buttongroup/buttongroup.d.ts +0 -1
  29. package/buttongroup/buttongroup.esm.js +15 -9
  30. package/buttongroup/buttongroup.umd.js +4 -2
  31. package/calendar/calendar.d.ts +0 -1
  32. package/calendar/calendar.esm.js +15 -9
  33. package/calendar/calendar.umd.js +4 -2
  34. package/card/card.d.ts +0 -1
  35. package/card/card.esm.js +15 -9
  36. package/card/card.umd.js +4 -2
  37. package/card/cardview.d.ts +0 -1
  38. package/cardview/cardview.d.ts +0 -1
  39. package/cardview/cardview.esm.js +15 -9
  40. package/cardview/cardview.umd.js +4 -2
  41. package/carousel/carousel.d.ts +0 -1
  42. package/carousel/carousel.esm.js +15 -9
  43. package/carousel/carousel.umd.js +4 -2
  44. package/chart/chart.d.ts +0 -1
  45. package/chart/chart.esm.js +15 -9
  46. package/chart/chart.umd.js +4 -2
  47. package/chart/ganttchart.d.ts +0 -11
  48. package/chart/threedchart.d.ts +0 -1
  49. package/checkbox/checkbox.d.ts +0 -1
  50. package/checkbox/checkbox.esm.js +15 -9
  51. package/checkbox/checkbox.umd.js +4 -2
  52. package/checkinput/checkinput.d.ts +0 -1
  53. package/checkinput/checkinput.esm.js +15 -9
  54. package/checkinput/checkinput.umd.js +4 -2
  55. package/chip/chip.d.ts +0 -1
  56. package/chip/chip.esm.js +15 -9
  57. package/chip/chip.umd.js +4 -2
  58. package/colorinput/colorinput.d.ts +0 -1
  59. package/colorinput/colorinput.esm.js +15 -9
  60. package/colorinput/colorinput.umd.js +4 -2
  61. package/colorpanel/colorpanel.d.ts +0 -1
  62. package/colorpanel/colorpanel.esm.js +15 -9
  63. package/colorpanel/colorpanel.umd.js +4 -2
  64. package/colorpicker/colorpicker.d.ts +0 -1
  65. package/colorpicker/colorpicker.esm.js +15 -9
  66. package/colorpicker/colorpicker.umd.js +4 -2
  67. package/columnpanel/columnpanel.d.ts +0 -1
  68. package/columnpanel/columnpanel.esm.js +15 -9
  69. package/columnpanel/columnpanel.umd.js +4 -2
  70. package/combobox/combobox.d.ts +0 -1
  71. package/combobox/combobox.esm.js +23 -11
  72. package/combobox/combobox.umd.js +12 -4
  73. package/countryinput/countryinput.d.ts +0 -1
  74. package/countryinput/countryinput.esm.js +15 -9
  75. package/countryinput/countryinput.umd.js +4 -2
  76. package/customizationdialog/customizationdialog.d.ts +0 -1
  77. package/customizationdialog/customizationdialog.esm.js +15 -9
  78. package/customizationdialog/customizationdialog.umd.js +4 -2
  79. package/dateinput/dateinput.d.ts +0 -1
  80. package/dateinput/dateinput.esm.js +15 -9
  81. package/dateinput/dateinput.umd.js +4 -2
  82. package/daterangeinput/daterangeinput.d.ts +0 -1
  83. package/daterangeinput/daterangeinput.esm.js +15 -9
  84. package/daterangeinput/daterangeinput.umd.js +4 -2
  85. package/datetimepicker/datetimepicker.d.ts +0 -1
  86. package/datetimepicker/datetimepicker.esm.js +15 -9
  87. package/datetimepicker/datetimepicker.umd.js +4 -2
  88. package/dialogwindow/dialogwindow.d.ts +0 -1
  89. package/dialogwindow/dialogwindow.esm.js +15 -9
  90. package/dialogwindow/dialogwindow.umd.js +4 -2
  91. package/dockinglayout/dockinglayout.d.ts +0 -1
  92. package/dockinglayout/dockinglayout.esm.js +15 -9
  93. package/dockinglayout/dockinglayout.umd.js +4 -2
  94. package/dropdownbutton/dropdownbutton.d.ts +0 -1
  95. package/dropdownbutton/dropdownbutton.esm.js +15 -9
  96. package/dropdownbutton/dropdownbutton.umd.js +4 -2
  97. package/dropdownlist/dropdownlist.d.ts +0 -1
  98. package/dropdownlist/dropdownlist.esm.js +23 -11
  99. package/dropdownlist/dropdownlist.umd.js +12 -4
  100. package/editor/editor.d.ts +0 -1
  101. package/editor/editor.esm.js +15 -9
  102. package/editor/editor.umd.js +4 -2
  103. package/element/element.d.ts +0 -1
  104. package/element/element.esm.js +15 -9
  105. package/element/element.umd.js +4 -2
  106. package/fileupload/fileupload.d.ts +0 -1
  107. package/fileupload/fileupload.esm.js +15 -9
  108. package/fileupload/fileupload.umd.js +4 -2
  109. package/filterbuilder/filterbuilder.d.ts +0 -1
  110. package/filterbuilder/filterbuilder.esm.js +15 -9
  111. package/filterbuilder/filterbuilder.umd.js +4 -2
  112. package/filterpanel/filterpanel.d.ts +0 -1
  113. package/filterpanel/filterpanel.esm.js +15 -9
  114. package/filterpanel/filterpanel.umd.js +4 -2
  115. package/filterpanel/multicolumnfilterpanel.d.ts +0 -1
  116. package/form/form.d.ts +0 -1
  117. package/form/form.esm.js +23 -11
  118. package/form/form.umd.js +12 -4
  119. package/form/formcontrol.d.ts +0 -1
  120. package/form/formgroup.d.ts +0 -1
  121. package/ganttchart/ganttchart.d.ts +0 -11
  122. package/ganttchart/ganttchart.esm.js +16 -32
  123. package/ganttchart/ganttchart.umd.js +5 -25
  124. package/gauge/gauge.d.ts +0 -1
  125. package/gauge/gauge.esm.js +15 -9
  126. package/gauge/gauge.umd.js +4 -2
  127. package/grid/grid.d.ts +0 -1
  128. package/grid/grid.esm.js +15 -9
  129. package/grid/grid.umd.js +4 -2
  130. package/grouppanel/grouppanel.d.ts +0 -1
  131. package/grouppanel/grouppanel.esm.js +15 -9
  132. package/grouppanel/grouppanel.umd.js +4 -2
  133. package/index.d.ts +1 -11
  134. package/input/checkinput.d.ts +0 -1
  135. package/input/colorinput.d.ts +0 -1
  136. package/input/countryinput.d.ts +0 -1
  137. package/input/dateinput.d.ts +0 -1
  138. package/input/daterangeinput.d.ts +0 -1
  139. package/input/input.d.ts +0 -1
  140. package/input/input.esm.js +15 -9
  141. package/input/input.umd.js +4 -2
  142. package/input/multicomboinput.d.ts +0 -1
  143. package/input/multiinput.d.ts +0 -1
  144. package/input/numberinput.d.ts +0 -1
  145. package/input/passwordinput.d.ts +0 -1
  146. package/input/phoneinput.d.ts +0 -1
  147. package/input/timeinput.d.ts +0 -1
  148. package/kanban/kanban.d.ts +0 -1
  149. package/kanban/kanban.esm.js +15 -9
  150. package/kanban/kanban.umd.js +4 -2
  151. package/layout/dockinglayout.d.ts +0 -1
  152. package/layout/layout.d.ts +0 -1
  153. package/layout/layout.esm.js +31 -13
  154. package/layout/layout.umd.js +20 -6
  155. package/layout/layoutgroup.d.ts +0 -1
  156. package/layout/layoutitem.d.ts +0 -1
  157. package/layout/tablayoutgroup.d.ts +0 -1
  158. package/layout/tablayoutitem.d.ts +0 -1
  159. package/led/led.d.ts +0 -1
  160. package/led/led.esm.js +15 -9
  161. package/led/led.umd.js +4 -2
  162. package/listbox/listbox.d.ts +0 -1
  163. package/listbox/listbox.esm.js +23 -11
  164. package/listbox/listbox.umd.js +12 -4
  165. package/listmenu/listmenu.d.ts +0 -1
  166. package/listmenu/listmenu.esm.js +23 -11
  167. package/listmenu/listmenu.umd.js +12 -4
  168. package/map/map.d.ts +0 -1
  169. package/map/map.esm.js +15 -9
  170. package/map/map.umd.js +4 -2
  171. package/maskedtextbox/maskedtextbox.d.ts +0 -1
  172. package/maskedtextbox/maskedtextbox.esm.js +15 -9
  173. package/maskedtextbox/maskedtextbox.umd.js +4 -2
  174. package/menu/listmenu.d.ts +0 -1
  175. package/menu/menu.d.ts +0 -1
  176. package/menu/menu.esm.js +23 -11
  177. package/menu/menu.umd.js +12 -4
  178. package/menu/menuitem.d.ts +0 -1
  179. package/menu/menuitemsgroup.d.ts +0 -1
  180. package/multicolumnfilterpanel/multicolumnfilterpanel.d.ts +0 -1
  181. package/multicolumnfilterpanel/multicolumnfilterpanel.esm.js +15 -9
  182. package/multicolumnfilterpanel/multicolumnfilterpanel.umd.js +4 -2
  183. package/multicomboinput/multicomboinput.d.ts +0 -1
  184. package/multicomboinput/multicomboinput.esm.js +15 -9
  185. package/multicomboinput/multicomboinput.umd.js +4 -2
  186. package/multiinput/multiinput.d.ts +0 -1
  187. package/multiinput/multiinput.esm.js +15 -9
  188. package/multiinput/multiinput.umd.js +4 -2
  189. package/multilinetextbox/multilinetextbox.d.ts +0 -1
  190. package/multilinetextbox/multilinetextbox.esm.js +23 -11
  191. package/multilinetextbox/multilinetextbox.umd.js +12 -4
  192. package/multilinewindow/multilinewindow.d.ts +0 -1
  193. package/multilinewindow/multilinewindow.esm.js +15 -9
  194. package/multilinewindow/multilinewindow.umd.js +4 -2
  195. package/multisplitbutton/multisplitbutton.d.ts +0 -1
  196. package/multisplitbutton/multisplitbutton.esm.js +23 -11
  197. package/multisplitbutton/multisplitbutton.umd.js +12 -4
  198. package/numberinput/numberinput.d.ts +0 -1
  199. package/numberinput/numberinput.esm.js +15 -9
  200. package/numberinput/numberinput.umd.js +4 -2
  201. package/numerictextbox/numerictextbox.d.ts +0 -1
  202. package/numerictextbox/numerictextbox.esm.js +15 -9
  203. package/numerictextbox/numerictextbox.umd.js +4 -2
  204. package/package.json +2 -1
  205. package/pager/pager.d.ts +0 -1
  206. package/pager/pager.esm.js +15 -9
  207. package/pager/pager.umd.js +4 -2
  208. package/passwordinput/passwordinput.d.ts +0 -1
  209. package/passwordinput/passwordinput.esm.js +15 -9
  210. package/passwordinput/passwordinput.umd.js +4 -2
  211. package/passwordtextbox/passwordtextbox.d.ts +0 -1
  212. package/passwordtextbox/passwordtextbox.esm.js +15 -9
  213. package/passwordtextbox/passwordtextbox.umd.js +4 -2
  214. package/path/path.d.ts +0 -1
  215. package/path/path.esm.js +15 -9
  216. package/path/path.umd.js +4 -2
  217. package/phoneinput/phoneinput.d.ts +0 -1
  218. package/phoneinput/phoneinput.esm.js +15 -9
  219. package/phoneinput/phoneinput.umd.js +4 -2
  220. package/pivottable/pivottable.d.ts +0 -1
  221. package/pivottable/pivottable.esm.js +15 -9
  222. package/pivottable/pivottable.umd.js +4 -2
  223. package/progressbar/circularprogressbar.d.ts +0 -1
  224. package/progressbar/progressbar.d.ts +0 -1
  225. package/progressbar/progressbar.esm.js +19 -10
  226. package/progressbar/progressbar.umd.js +8 -3
  227. package/progresswindow/progresswindow.d.ts +0 -1
  228. package/progresswindow/progresswindow.esm.js +15 -9
  229. package/progresswindow/progresswindow.umd.js +4 -2
  230. package/promptwindow/promptwindow.d.ts +0 -1
  231. package/promptwindow/promptwindow.esm.js +15 -9
  232. package/promptwindow/promptwindow.umd.js +4 -2
  233. package/qrcode/qrcode.d.ts +0 -1
  234. package/qrcode/qrcode.esm.js +15 -9
  235. package/qrcode/qrcode.umd.js +4 -2
  236. package/querybuilder/querybuilder.d.ts +0 -1
  237. package/querybuilder/querybuilder.esm.js +15 -9
  238. package/querybuilder/querybuilder.umd.js +4 -2
  239. package/radiobutton/radiobutton.d.ts +0 -1
  240. package/radiobutton/radiobutton.esm.js +15 -9
  241. package/radiobutton/radiobutton.umd.js +4 -2
  242. package/rating/rating.d.ts +0 -1
  243. package/rating/rating.esm.js +15 -9
  244. package/rating/rating.umd.js +4 -2
  245. package/ribbon/ribbon.d.ts +0 -1
  246. package/ribbon/ribbon.esm.js +27 -12
  247. package/ribbon/ribbon.umd.js +16 -5
  248. package/ribbon/ribbongroup.d.ts +0 -1
  249. package/ribbon/ribbonitem.d.ts +0 -1
  250. package/ribbon/ribbontab.d.ts +0 -1
  251. package/scheduler/scheduler.d.ts +0 -1
  252. package/scheduler/scheduler.esm.js +15 -9
  253. package/scheduler/scheduler.umd.js +4 -2
  254. package/scrollbar/scrollbar.d.ts +0 -1
  255. package/scrollbar/scrollbar.esm.js +15 -9
  256. package/scrollbar/scrollbar.umd.js +4 -2
  257. package/slider/slider.d.ts +0 -1
  258. package/slider/slider.esm.js +15 -9
  259. package/slider/slider.umd.js +4 -2
  260. package/sortable/sortable.d.ts +0 -1
  261. package/sortable/sortable.esm.js +15 -9
  262. package/sortable/sortable.umd.js +4 -2
  263. package/sortpanel/sortpanel.d.ts +0 -1
  264. package/sortpanel/sortpanel.esm.js +15 -9
  265. package/sortpanel/sortpanel.umd.js +4 -2
  266. package/source/modules/smart.3dchart.js +2 -2
  267. package/source/modules/smart.accordion.js +1 -1
  268. package/source/modules/smart.array.js +2 -2
  269. package/source/modules/smart.barcode.js +1 -1
  270. package/source/modules/smart.breadcrumb.js +1 -1
  271. package/source/modules/smart.button.js +1 -1
  272. package/source/modules/smart.buttongroup.js +1 -1
  273. package/source/modules/smart.calendar.js +2 -2
  274. package/source/modules/smart.card.js +1 -1
  275. package/source/modules/smart.cardview.js +5 -5
  276. package/source/modules/smart.carousel.js +1 -1
  277. package/source/modules/smart.chart.js +2 -2
  278. package/source/modules/smart.checkbox.js +1 -1
  279. package/source/modules/smart.checkinput.js +1 -1
  280. package/source/modules/smart.chip.js +1 -1
  281. package/source/modules/smart.colorinput.js +1 -1
  282. package/source/modules/smart.colorpanel.js +2 -2
  283. package/source/modules/smart.colorpicker.js +2 -2
  284. package/source/modules/smart.combobox.js +2 -2
  285. package/source/modules/smart.common.js +3 -3
  286. package/source/modules/smart.countryinput.js +1 -1
  287. package/source/modules/smart.dateinput.js +2 -2
  288. package/source/modules/smart.daterangeinput.js +3 -3
  289. package/source/modules/smart.datetimepicker.js +4 -4
  290. package/source/modules/smart.dockinglayout.js +1 -1
  291. package/source/modules/smart.dropdownbutton.js +1 -1
  292. package/source/modules/smart.dropdownlist.js +2 -2
  293. package/source/modules/smart.editor.js +2 -2
  294. package/source/modules/smart.element.js +1 -1
  295. package/source/modules/smart.fileupload.js +2 -2
  296. package/source/modules/smart.form.js +1 -1
  297. package/source/modules/smart.formulaparser.js +1 -1
  298. package/source/modules/smart.ganttchart.js +5 -5
  299. package/source/modules/smart.gauge.js +2 -2
  300. package/source/modules/smart.grid.js +15 -15
  301. package/source/modules/smart.gridpanel.js +5 -5
  302. package/source/modules/smart.input.js +1 -1
  303. package/source/modules/smart.kanban.js +6 -6
  304. package/source/modules/smart.layout.js +1 -1
  305. package/source/modules/smart.led.js +1 -1
  306. package/source/modules/smart.listbox.js +1 -1
  307. package/source/modules/smart.listmenu.js +1 -1
  308. package/source/modules/smart.map.js +1 -1
  309. package/source/modules/smart.maskedtextbox.js +1 -1
  310. package/source/modules/smart.menu.js +1 -1
  311. package/source/modules/smart.multicomboinput.js +1 -1
  312. package/source/modules/smart.multiinput.js +1 -1
  313. package/source/modules/smart.multilinetextbox.js +2 -2
  314. package/source/modules/smart.multisplitbutton.js +2 -2
  315. package/source/modules/smart.numberinput.js +1 -1
  316. package/source/modules/smart.numerictextbox.js +2 -2
  317. package/source/modules/smart.pager.js +1 -1
  318. package/source/modules/smart.passwordinput.js +1 -1
  319. package/source/modules/smart.passwordtextbox.js +1 -1
  320. package/source/modules/smart.path.js +1 -1
  321. package/source/modules/smart.phoneinput.js +1 -1
  322. package/source/modules/smart.pivottable.js +4 -4
  323. package/source/modules/smart.progressbar.js +1 -1
  324. package/source/modules/smart.qrcode.js +1 -1
  325. package/source/modules/smart.querybuilder.js +4 -4
  326. package/source/modules/smart.radiobutton.js +1 -1
  327. package/source/modules/smart.rating.js +1 -1
  328. package/source/modules/smart.ribbon.js +2 -2
  329. package/source/modules/smart.router.js +2 -2
  330. package/source/modules/smart.scheduler.js +6 -6
  331. package/source/modules/smart.scrollbar.js +1 -1
  332. package/source/modules/smart.slider.js +2 -2
  333. package/source/modules/smart.sortable.js +1 -1
  334. package/source/modules/smart.splitter.js +1 -1
  335. package/source/modules/smart.switchbutton.js +1 -1
  336. package/source/modules/smart.table.js +4 -4
  337. package/source/modules/smart.tabs.js +1 -1
  338. package/source/modules/smart.tank.js +2 -2
  339. package/source/modules/smart.textarea.js +1 -1
  340. package/source/modules/smart.textbox.js +2 -2
  341. package/source/modules/smart.timeinput.js +1 -1
  342. package/source/modules/smart.timepicker.js +1 -1
  343. package/source/modules/smart.toast.js +1 -1
  344. package/source/modules/smart.tooltip.js +1 -1
  345. package/source/modules/smart.tree.js +1 -1
  346. package/source/modules/smart.validator.js +1 -1
  347. package/source/modules/smart.window.js +2 -2
  348. package/source/smart.3dchart.js +1 -1
  349. package/source/smart.accordion.js +1 -1
  350. package/source/smart.ajax.js +1 -1
  351. package/source/smart.array.js +1 -1
  352. package/source/smart.barcode.js +1 -1
  353. package/source/smart.bootstrap.js +1 -1
  354. package/source/smart.breadcrumb.js +1 -1
  355. package/source/smart.button.js +1 -1
  356. package/source/smart.buttongroup.js +1 -1
  357. package/source/smart.calendar.js +1 -1
  358. package/source/smart.card.js +1 -1
  359. package/source/smart.cardview.js +1 -1
  360. package/source/smart.carousel.js +1 -1
  361. package/source/smart.chart.annotations.js +1 -1
  362. package/source/smart.chart.api.js +1 -1
  363. package/source/smart.chart.core.js +1 -1
  364. package/source/smart.chart.js +1 -1
  365. package/source/smart.chart.rangeselector.js +1 -1
  366. package/source/smart.chart.waterfall.js +1 -1
  367. package/source/smart.checkbox.js +1 -1
  368. package/source/smart.checkinput.js +1 -1
  369. package/source/smart.chip.js +1 -1
  370. package/source/smart.colorinput.js +1 -1
  371. package/source/smart.colorpanel.js +1 -1
  372. package/source/smart.colorpicker.js +1 -1
  373. package/source/smart.combobox.js +1 -1
  374. package/source/smart.complex.js +1 -1
  375. package/source/smart.core.js +1 -1
  376. package/source/smart.countryinput.js +1 -1
  377. package/source/smart.data.js +2 -2
  378. package/source/smart.date.js +2 -2
  379. package/source/smart.dateformatpanel.js +1 -1
  380. package/source/smart.dateinput.js +1 -1
  381. package/source/smart.daterangeinput.js +1 -1
  382. package/source/smart.datetimepicker.js +2 -2
  383. package/source/smart.dockinglayout.js +1 -1
  384. package/source/smart.draw.js +1 -1
  385. package/source/smart.dropdownbutton.js +1 -1
  386. package/source/smart.dropdownlist.js +2 -2
  387. package/source/smart.editor.js +2 -2
  388. package/source/smart.element.js +1 -1
  389. package/source/smart.elements.js +17 -17
  390. package/source/smart.export.js +1 -1
  391. package/source/smart.fileupload.js +1 -1
  392. package/source/smart.filter.js +1 -1
  393. package/source/smart.filterbuilder.js +1 -1
  394. package/source/smart.filterpanel.js +1 -1
  395. package/source/smart.form.js +1 -1
  396. package/source/smart.format.js +1 -1
  397. package/source/smart.formulaparser.js +1 -1
  398. package/source/smart.ganttchart.js +1 -1
  399. package/source/smart.gauge.js +1 -1
  400. package/source/smart.grid.cell.js +2 -2
  401. package/source/smart.grid.chart.js +1 -1
  402. package/source/smart.grid.column.js +1 -1
  403. package/source/smart.grid.core.js +2 -2
  404. package/source/smart.grid.dialog.js +2 -2
  405. package/source/smart.grid.edit.js +2 -2
  406. package/source/smart.grid.export.js +1 -1
  407. package/source/smart.grid.filter.js +1 -1
  408. package/source/smart.grid.group.js +2 -2
  409. package/source/smart.grid.js +1 -1
  410. package/source/smart.grid.menu.js +1 -1
  411. package/source/smart.grid.pager.js +1 -1
  412. package/source/smart.grid.reorder.js +2 -2
  413. package/source/smart.grid.resize.js +1 -1
  414. package/source/smart.grid.row.js +1 -1
  415. package/source/smart.grid.select.js +2 -2
  416. package/source/smart.grid.sort.js +2 -2
  417. package/source/smart.grid.toolbar.js +2 -2
  418. package/source/smart.grid.tree.js +1 -1
  419. package/source/smart.grid.view.js +2 -2
  420. package/source/smart.gridpanel.js +1 -1
  421. package/source/smart.input.js +1 -1
  422. package/source/smart.kanban.js +2 -2
  423. package/source/smart.layout.js +1 -1
  424. package/source/smart.led.js +1 -1
  425. package/source/smart.listbox.js +1 -1
  426. package/source/smart.listmenu.js +1 -1
  427. package/source/smart.map.js +1 -1
  428. package/source/smart.maskedtextbox.js +1 -1
  429. package/source/smart.math.js +1 -1
  430. package/source/smart.menu.js +1 -1
  431. package/source/smart.multicomboinput.js +1 -1
  432. package/source/smart.multiinput.js +1 -1
  433. package/source/smart.multilinetextbox.js +1 -1
  434. package/source/smart.multisplitbutton.js +1 -1
  435. package/source/smart.numberformatpanel.js +1 -1
  436. package/source/smart.numberinput.js +1 -1
  437. package/source/smart.numeric.js +1 -1
  438. package/source/smart.numerictextbox.js +1 -1
  439. package/source/smart.pager.js +1 -1
  440. package/source/smart.passwordinput.js +1 -1
  441. package/source/smart.passwordtextbox.js +1 -1
  442. package/source/smart.path.js +1 -1
  443. package/source/smart.phoneinput.js +1 -1
  444. package/source/smart.pivottable.js +1 -1
  445. package/source/smart.powerbutton.js +1 -1
  446. package/source/smart.progressbar.js +1 -1
  447. package/source/smart.qrcode.js +1 -1
  448. package/source/smart.radiobutton.js +1 -1
  449. package/source/smart.rating.js +1 -1
  450. package/source/smart.ribbon.js +1 -1
  451. package/source/smart.router.js +1 -1
  452. package/source/smart.scheduler.js +2 -2
  453. package/source/smart.scrollbar.js +1 -1
  454. package/source/smart.slider.js +1 -1
  455. package/source/smart.sortable.js +1 -1
  456. package/source/smart.splitter.js +1 -1
  457. package/source/smart.switchbutton.js +1 -1
  458. package/source/smart.table.js +1 -1
  459. package/source/smart.tabs.js +1 -1
  460. package/source/smart.tank.js +1 -1
  461. package/source/smart.textarea.js +1 -1
  462. package/source/smart.textbox.js +1 -1
  463. package/source/smart.tickintervalhandler.js +1 -1
  464. package/source/smart.timeinput.js +1 -1
  465. package/source/smart.timepicker.js +1 -1
  466. package/source/smart.toast.js +1 -1
  467. package/source/smart.tooltip.js +1 -1
  468. package/source/smart.tree.js +1 -1
  469. package/source/smart.validationpanel.js +1 -1
  470. package/source/smart.validator.js +1 -1
  471. package/source/smart.window.js +1 -1
  472. package/source/styles/components/smart.grid.css +1 -1
  473. package/source/styles/components/smart.kanban.css +1 -1
  474. package/source/styles/default/scss/smart.grid.scss +14 -3
  475. package/source/styles/default/scss/smart.kanban.scss +13 -2
  476. package/source/styles/default/smart.grid.css +15 -3
  477. package/source/styles/default/smart.kanban.css +1607 -1599
  478. package/source/styles/smart.default.css +2 -2
  479. package/source/typescript/smart.elements.d.ts +1 -11
  480. package/source/typescript/smart.ganttchart.d.ts +0 -10
  481. package/source/typescript/smart.ribbon.d.ts +1 -1
  482. package/splitter/splitter.d.ts +0 -1
  483. package/splitter/splitter.esm.js +23 -11
  484. package/splitter/splitter.umd.js +12 -4
  485. package/splitter/splitterbar.d.ts +0 -1
  486. package/splitter/splitteritem.d.ts +0 -1
  487. package/switchbutton/switchbutton.d.ts +0 -1
  488. package/switchbutton/switchbutton.esm.js +15 -9
  489. package/switchbutton/switchbutton.umd.js +4 -2
  490. package/table/pivottable.d.ts +0 -1
  491. package/table/sortable.d.ts +0 -1
  492. package/table/table.d.ts +0 -1
  493. package/table/table.esm.js +15 -9
  494. package/table/table.umd.js +4 -2
  495. package/tabs/tabs.d.ts +0 -1
  496. package/tabs/tabs.esm.js +23 -11
  497. package/tabs/tabs.umd.js +12 -4
  498. package/tabs/tabswindow.d.ts +0 -1
  499. package/tabswindow/tabswindow.d.ts +0 -1
  500. package/tabswindow/tabswindow.esm.js +15 -9
  501. package/tabswindow/tabswindow.umd.js +4 -2
  502. package/tank/tank.d.ts +0 -1
  503. package/tank/tank.esm.js +15 -9
  504. package/tank/tank.umd.js +4 -2
  505. package/textarea/textarea.d.ts +0 -1
  506. package/textarea/textarea.esm.js +15 -9
  507. package/textarea/textarea.umd.js +4 -2
  508. package/textbox/maskedtextbox.d.ts +0 -1
  509. package/textbox/multilinetextbox.d.ts +0 -1
  510. package/textbox/numerictextbox.d.ts +0 -1
  511. package/textbox/passwordtextbox.d.ts +0 -1
  512. package/textbox/textbox.d.ts +0 -1
  513. package/textbox/textbox.esm.js +23 -11
  514. package/textbox/textbox.umd.js +12 -4
  515. package/threedchart/threedchart.d.ts +0 -1
  516. package/threedchart/threedchart.esm.js +15 -9
  517. package/threedchart/threedchart.umd.js +4 -2
  518. package/timeinput/timeinput.d.ts +0 -1
  519. package/timeinput/timeinput.esm.js +15 -9
  520. package/timeinput/timeinput.umd.js +4 -2
  521. package/timepicker/datetimepicker.d.ts +0 -1
  522. package/timepicker/timepicker.d.ts +0 -1
  523. package/timepicker/timepicker.esm.js +15 -9
  524. package/timepicker/timepicker.umd.js +4 -2
  525. package/toast/toast.d.ts +0 -1
  526. package/toast/toast.esm.js +15 -9
  527. package/toast/toast.umd.js +4 -2
  528. package/tooltip/tooltip.d.ts +0 -1
  529. package/tooltip/tooltip.esm.js +15 -9
  530. package/tooltip/tooltip.umd.js +4 -2
  531. package/tree/tree.d.ts +0 -1
  532. package/tree/tree.esm.js +23 -11
  533. package/tree/tree.umd.js +12 -4
  534. package/tree/treeitem.d.ts +0 -1
  535. package/tree/treeitemsgroup.d.ts +0 -1
  536. package/validator/validator.d.ts +0 -1
  537. package/validator/validator.esm.js +15 -9
  538. package/validator/validator.umd.js +4 -2
  539. package/waitwindow/waitwindow.d.ts +0 -1
  540. package/waitwindow/waitwindow.esm.js +15 -9
  541. package/waitwindow/waitwindow.umd.js +4 -2
  542. package/window/alertwindow.d.ts +0 -1
  543. package/window/dialogwindow.d.ts +0 -1
  544. package/window/multilinewindow.d.ts +0 -1
  545. package/window/progresswindow.d.ts +0 -1
  546. package/window/promptwindow.d.ts +0 -1
  547. package/window/tabswindow.d.ts +0 -1
  548. package/window/waitwindow.d.ts +0 -1
  549. package/window/window.d.ts +0 -1
  550. package/window/window.esm.js +15 -9
  551. package/window/window.umd.js +4 -2
@@ -1,6 +1,6 @@
1
1
 
2
- /* Smart UI v17.0.3 (2023-10-20)
2
+ /* Smart UI v17.0.17 (2023-11-08)
3
3
  Copyright (c) 2011-2023 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
6
- Smart.Utilities.Assign("Grid.Reorder",class{reorderColumns(e,r,t=!1){const o=this;if(void 0===e||void 0===r)return;let a=o.columnByDataField[e];const n=o.columnByDataField[r],d="string"==typeof e?o.columns.indexOf(a):e,i="string"==typeof r?o.columns.indexOf(n):r;"string"==typeof e&&"string"===r?a.columnGroup=n.columnGroup:(a=o.columns[d],a.columnGroup=o.columns[i].columnGroup);const l=a.sortIndex,s=a.sortOrder,g=a.filter;t&&i+1<=o.columns.length?o.columns.move(d,i):o.columns.move(d,i-1),a.sortOrder=s,a.sortIndex=l,a.filter=g}swapColumns(e,r){const t=this;if(void 0===e||void 0===r)return;const o=t.columnByDataField[e],a=t.columnByDataField[r],n="string"==typeof e?t.columns.indexOf(o):e,d="string"==typeof r?t.columns.indexOf(a):r,i="string"==typeof e?o.columnGroup:t.columns[n].columnGroup;"string"==typeof e&&"string"===r?o.columnGroup=a.columnGroup:t.columns[n].columnGroup=t.columns[d].columnGroup;const l=o.sortIndex,s=o.sortOrder,g=o.filter;t.columns.move(n,d),"string"==typeof e&&"string"===r?a.columnGroup=i:t.columns[d-1].columnGroup=i,t.columns.move(d-1,n),o.sortOrder=s,o.sortIndex=l,o.filter=g}_createLine(e){const r=this;return e.classList.contains("smart-breadcrumb-item")||e.column?function(){const t=document.createElement("div"),o=r.getBoundingRect(e),a=r.getBoundingRect(r.$.columnHeader),n=r.getBoundingRect(r),d=r.$.content.offsetHeight-7-r._scrollView.hScrollBar.offsetHeight-o.top+n.top;return t.classList.add("smart-grid-drag-line"),r.rightToLeft?t.style.left=-a.left+o.left+"px":t.style.left=-a.left+o.right+"px",t.style.top=o.top-n.top+"px",t.style.height=d+"px",t.style.opacity=0,t}():function(){const t=document.createElement("div"),o=r.getBoundingRect(e);return t.classList.add("smart-grid-drag-line","row"),t.style.width=r.$.scrollView.offsetWidth-e.offsetLeft-e.row.header.offsetWidth-r._scrollView.vScrollBar.offsetWidth+"px",t.style.left=e.row.header.offsetWidth+"px",t.style.top=o.bottom-r.offsetTop+"px",t.style.opacity=0,t}()}_drag(e){const r=this,t=e.originalEvent;if(r._dialogDragDetails&&r._dragDialog(e,"both"),!r._dragDrop)return;let o=r._dragDrop.dragDetails.feedback;if(!o&&r._dragDrop.showFeedback){if(o=r._dragDrop.createFeedback(t),!o)return;if(r._overlay=document.createElement("div"),r._overlay.classList.add("smart-grid-overlay"),r._overlay.style.cursor="",r.$.root.appendChild(r._overlay),r._dragDrop.column)r._dragLine=r._createLine(r._dragDrop.column.element),r.$.root.appendChild(r._dragLine),requestAnimationFrame((()=>{r._dragLine&&(r._dragLine.style.opacity=1)})),r._dragDrop.feedbackLine=r._dragLine,o.classList.add("smart-grid-column-drag-feedback");else{const e=r._dragDrop.row;let t="<div>";for(let o=0;o<r.columns.length;o++){const a=r.columns[o];t+="<div>"+a.label+": "+e["column_"+a.dataField].value+"</div>"}r._dragDrop.items=r._rowElements,r._dragDrop.getItemCoordinates(r._rowElements),t+="</div>",o.innerHTML=t,r._dragLine=r._createLine(r._dragDrop.row.element),r.$.root.appendChild(r._dragLine),requestAnimationFrame((()=>{r._dragLine&&(r._dragLine.style.opacity=1)})),o.classList.add("smart-grid-row-drag-feedback"),r._dragDrop.feedbackLine=r._dragLine}}r._dragDrop.drag(e),r._dragDrop.column?r._dragColumn(e):r._dragRow(e),t.preventDefault()}_dragRow(e){const r=this,t=r._dragDrop.dragDetails,o=r._dragLine,a=e.originalEvent,n=r.getBoundingRect(r);if(e.pageY<n.top||e.pageY>n.bottom||e.pageX<n.left||e.pageX>n.right||t.target&&!t.target.row||!t.target)r._dragDrop.error(),o.style.opacity=0;else{if(r._dragDrop.getItemCoordinates(r._dragDrop.items),o.style.opacity=1,r._dragDrop.success(),!t.target)return;let a=r.getBoundingRect(t.target);o.style.width=r.$.scrollView.offsetWidth-r._dragDrop.row.offsetLeft-r._dragDrop.row.header.offsetWidth-r._scrollView.vScrollBar.offsetWidth+"px",o.style.left=r._dragDrop.row.header.offsetWidth+"px";const d=r.offset(r).top;let i=a.top-d-r.scrollTop;r._recyclingRows[r._recyclingRows.length-1].element===t.target&&e.pageY>n.bottom-10&&(t.before=!1),e.pageY>i+d+a.height-7&&(t.before=!1),o.style.top=t.before?i+"px":i+a.height-7+"px"}r.$.fireEvent("rowDragging",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:r._dragDrop.visibleIndex,data:r._dragDrop,originalEvent:a})}_dragColumn(e){const r=this,t=r._dragDrop.dragDetails,o=r.getBoundingRect(r),a=e.originalEvent;e.pageY<o.top||e.pageY>o.bottom||e.pageX<o.left||e.pageX>o.right?(r._dragDrop.error(),r._dragLine.style.opacity=0):r._dragLine.style.opacity=1;const n=r.$.groupHeader.getBoundingClientRect();if(e.pageY>=n.top&&e.pageY<n.bottom&&e.pageX>=n.left&&e.pageX<n.right&&(!1===r._dragDrop.column.allowGroup?(r._dragLine.style.opacity=0,r._dragDrop.error()):(t.feedback.classList.remove("freeze"),t.feedback.classList.remove("error"))),t.target&&r._dragDrop.feedback&&!r._dragDrop.feedback.classList.contains("error")){r._dragDrop.getItemCoordinates(r._dragDrop.items);for(let o=0;o<r._dragDrop._itemCoordinates.coordinates.length;o++){const a=r._dragDrop._itemCoordinates.coordinates[o];if(Array.isArray(a))for(let o=0;o<a.length;o++){let n=a[o];e.pageY>=n.rect.top&&e.pageY<n.rect.bottom&&e.pageX>=n.rect.left&&e.pageX<n.rect.right&&(t.target=r._dragDrop.items[n.index],t.before=!0)}}const a=r.getBoundingRect(t.target),n=r.getBoundingRect(r.$.content);if(r._dragDrop.column){r._dragLine.style.opacity=1;const d=r.appearance.showViewBar?r.layout.viewBarWidth:0;if(!1===t.before?r._dragLine.style.left=d+a.right-n.left+"px":r._dragLine.style.left=d+a.left-n.left+"px",r.behavior.allowColumnFreeze&&r.dataSource&&0===r.dataSource.groupBy.length){const o=r._dragDrop._itemCoordinates.coordinates[0][0].rect;r._dragDrop.column.allowFreeze&&(e.pageX>=o.left&&e.pageX<=o.left+10?t.feedback.classList.add("freeze"):t.feedback.classList.remove("freeze"),t.target&&t.target.hasAttribute("freeze")&&t.feedback.classList.add("freeze"),t.item.column.freeze&&!t.target.hasAttribute("freeze")?t.feedback.classList.add("unfreeze"):t.feedback.classList.remove("unfreeze"))}if(t.target.classList.contains("smart-breadcrumb-item"))r._dragLine.style.top=a.top-o.top-r.scrollTop+"px",r._dragLine.style.height=a.height+"px",r.$.breadcrumb.dataSource.forEach((e=>{e.value===t.item.column.dataField&&(r._dragLine.style.opacity=0,r._dragDrop.error())}));else{r._dragLine.style.top=a.top-o.top-r.scrollTop+"px";const e=r.$.content.offsetHeight-7-r._scrollView.hScrollBar.offsetHeight-a.top+n.top;r._dragLine.style.height=e+"px"}parseInt(r._dragLine.style.left)<3?r._dragLine.style.left="3px":parseInt(r._dragLine.style.left)>=r.offsetWidth-3&&(r._dragLine.style.left=r.offsetWidth-7+"px")}}else r._dragLine.style.opacity=0;r.$.fireEvent("columnDragging",{column:r._dragDrop.column,dataField:r._dragDrop.column.dataField,index:r.columns.indexOf(r._dragDrop.column),data:r._dragDrop,originalEvent:a})}_beginRowDrag(e,r){const t=this;let o=!1;t.behavior.allowRowReorder&&r.allowReorder&&(o=!0),o&&(t.$.fireEvent("rowDragStart",{row:r,id:r.id,index:r.visibleIndex,data:null,originalEvent:e.originalEvent}).defaultPrevented||(t._dragDrop=new Smart.Utilities.DragDrop(t),t._dragDrop.capture(r.element,e),t._dragDrop.row=r,t._recycle(!1),t._dragInterval&&clearInterval(t._dragInterval),t._dragInterval=setInterval((function(){const e=t._dragDrop.dragDetails;if(!e.feedback)return;const r=parseInt(e.feedback.style.left),o=parseInt(e.feedback.style.top),a=t.getBoundingClientRect();t._dragLine&&a.left<=r&&a.left+a.width>=r&&(o>=a.top&&o<=a.top+20?t.scrollTop-=5:o>=a.top+a.height+5&&o<=a.top+a.height+20&&(t.scrollTop+=5))}),10)))}_beginDrag(e,r){const t=this;if(!r.dataField)return void t._beginRowDrag(e,r);const o=r;if(t.behavior.allowColumnReorder&&o.allowReorder&&!o.autoGenerated){if(t.appearance.showColumnHeaderDragIcon&&!e.originalEvent.target.classList.contains("smart-drag-handle"))return;if(!t.$.fireEvent("columnDragStart",{column:o,dataField:o.dataField,index:t.columns.indexOf(o),data:null,originalEvent:e.originalEvent}).defaultPrevented){t._dragDrop=new Smart.Utilities.DragDrop(t),t._dragDrop.capture(o.element,e),t._dragDrop.column=o;const r=()=>{let e=t.columns.map((e=>e.element));if(!t.behavior.allowColumnFreeze){const r=t.columns.filter((e=>!e.freeze));e=r.map((e=>e.element))}if(t.grouping.enabled&&"multipleColumns"===t.grouping.renderMode&&t.dataSource&&-1===t.dataSource.groupBy.indexOf(o.dataField)){const r=t.columns.filter((e=>{if(t.dataSource&&-1===t.dataSource.groupBy.indexOf(e.dataField))return!0}));e=r.map((e=>e.element))}e=e.filter((e=>!e.classList.contains("smart-visibility-hidden"))),t.$.breadcrumb?t._dragDrop.items=e.concat(t.$.breadcrumb._items):t._dragDrop.items=e};r(),t._dragInterval&&clearInterval(t._dragInterval),t._dragInterval=setInterval((function(){const e=t._dragDrop.dragDetails;if(!e.feedback)return;r();const o=parseInt(e.feedback.style.left),a=t.getBoundingClientRect();t._dragLine&&a.left<=o&&a.left+a.width>=o&&(o>=a.left&&o<=a.left+20?t.scrollLeft-=5:o>=a.left+a.width-20&&o<=a.left+a.width&&(t.scrollLeft+=5))}),3)}}}_cancelDrag(){const e=this;e._dragLine&&(e._dragLine.parentNode&&e._dragLine.parentNode.removeChild(e._dragLine),e._dragLine=null),e._dragDrop&&(e._dragDrop.removeFeedback(),e._dragDrop=null),e._dragInterval&&clearInterval(e._dragInterval),e._recycle()}_endDrag(e){const r=this;if(r._dialogDragDetails&&(r._dialogDragDetails.started=!1),r._dragDrop){const t=r._dragDrop.dragDetails;if(!t.feedback||t.feedback&&t.feedback.classList.contains("error")&&!t.feedback.classList.contains("data"))return void r._cancelDrag();if(e.key&&"Escape"===e.key)return r._dragDrop.column?r.$.fireEvent("columnDragCancel",{column:t.item.column,dataField:t.item.column.dataField,index:r.columns.indexOf(r._dragDrop.column),data:r._dragDrop}):r._dragDrop.row&&r.$.fireEvent("rowDragCancel",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:r._dragDrop.row.visibleIndex,data:r._dragDrop}),void r._cancelDrag();r.beginUpdate();let o=t.target;const a=t.before;if(r._dragDrop.column){if(r.filtering.filterRow)for(let e=0;e<r.columns.length;e++)r.columns[e]._filterEditorInitialized=!1;if(o&&o.column&&"Escape"!==e.key&&!t.feedback.classList.contains("data")){r.columns.indexOf(r._dragDrop.column);let t=r.columns.indexOf(o.column);if(t+=a?0:1,!r.$.fireEvent("columnDragEnd",{column:r._dragDrop.column,dataField:r._dragDrop.column.dataField,index:r.columns.indexOf(r._dragDrop.column),newIndex:t,data:r._dragDrop,originalEvent:e.originalEvent}).defaultPrevented){const t=r.columns.indexOf(r._dragDrop.column);let n=r.columns.indexOf(o.column);r._dragDrop.column.freeze,n+=a?0:1,r._dragDrop.column.columnGroup=o.column.columnGroup,r._dragDrop.column.freeze=o.column.freeze,r.behavior.allowColumnFreeze&&(r._dragDrop.feedback.classList.contains("freeze")&&(r._dragDrop.column.freeze=!0),r._dragDrop.feedback.classList.contains("unfreeze")&&(r._dragDrop.column.freeze=!1)),t<n&&n--;const d=r._dragDrop.column,i=d.sortIndex,l=d.sortOrder,s=d.filter,g=r.columns.canNotify;r.columns.canNotify=!1,r.columns.move(t,n),r.columns.canNotify=g;const c=r.context;r.context=document,d.sortOrder=l,d.sortIndex=i,d.filter=s,r.context=c,r._renderColumns(),r.$.fireEvent("columnReorder",{column:r._dragDrop.column,dataField:r._dragDrop.column.dataField,index:t,newIndex:n,data:r._dragDrop,originalEvent:e.originalEvent}),r.autoSaveState()}}else r.$.fireEvent("columnDragEnd",{column:r._dragDrop.column,dataField:r._dragDrop.column.dataField,index:r.columns.indexOf(r._dragDrop.column),newIndex:-1,data:r._dragDrop,originalEvent:e.originalEvent});if("Escape"!==e.key&&r.$.breadcrumb&&r._dragDrop.column.allowGroup){const t=r.getBoundingRect(r.$.breadcrumb);if(e.originalEvent.pageY>=t.top-r.scrollTop&&e.originalEvent.pageY<=t.bottom-r.scrollTop){const e=r.$.breadcrumb._items.indexOf(o),t=r._dragDrop.dragDetails.item.column,n=r.$.breadcrumb.dataSource.slice(0);n.splice(Math.max(0,e+(a?0:1)),0,{label:t.label,value:t.dataField}),r.$.breadcrumb.dataSource=n;const d=r.$.breadcrumb.dataSource.map((e=>e.value));r.dataSource.groupBy=d,r.refresh(!0),r.refreshFilters(),r.$.fireEvent("group",{groups:r.dataSource.groupBy}),r.autoSaveState()}}}else if(r._dragDrop.row)if(o&&o.row&&"Escape"!==e.key&&!t.feedback.classList.contains("data")){if(!r.$.fireEvent("rowDragEnd",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:r._dragDrop.row.visibleIndex,newIndex:o.row.visibleIndex,data:r._dragDrop,originalEvent:e.originalEvent}).defaultPrevented){const a=r._dragDrop.row.visibleIndex;let n=o.row.visibleIndex;t.before||n++,a<n&&n--,r.rows.move(a,n),r.$.fireEvent("rowReorder",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:a,newIndex:n,data:r._dragDrop,originalEvent:e.originalEvent})}}else r.$.fireEvent("rowDragEnd",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:r._dragDrop.row.visibleIndex,newIndex:-1,data:r._dragDrop,originalEvent:e.originalEvent});r._cancelDrag(),r.endUpdate(),r.columnGroups&&r.columnGroups.length>0&&r._renderColumns(!0),r.paging.enabled&&r.grouping.enabled&&r._refreshPagesCount()}}});
6
+ Smart.Utilities.Assign("Grid.Reorder",class{reorderColumns(e,r,t=!1){const o=this;if(void 0===e||void 0===r)return;let a=o.columnByDataField[e];const n=o.columnByDataField[r],i="string"==typeof e?o.columns.indexOf(a):e,l="string"==typeof r?o.columns.indexOf(n):r;"string"==typeof e&&"string"===r?a.columnGroup=n.columnGroup:(a=o.columns[i],a.columnGroup=o.columns[l].columnGroup);const d=a.sortIndex,s=a.sortOrder,g=a.filter;t&&l+1<=o.columns.length?o.columns.move(i,l):o.columns.move(i,l-1),a.sortOrder=s,a.sortIndex=d,a.filter=g}swapColumns(e,r){const t=this;if(void 0===e||void 0===r)return;const o=t.columnByDataField[e],a=t.columnByDataField[r],n="string"==typeof e?t.columns.indexOf(o):e,i="string"==typeof r?t.columns.indexOf(a):r,l="string"==typeof e?o.columnGroup:t.columns[n].columnGroup;"string"==typeof e&&"string"===r?o.columnGroup=a.columnGroup:t.columns[n].columnGroup=t.columns[i].columnGroup;const d=o.sortIndex,s=o.sortOrder,g=o.filter;t.columns.move(n,i),"string"==typeof e&&"string"===r?a.columnGroup=l:t.columns[i-1].columnGroup=l,t.columns.move(i-1,n),o.sortOrder=s,o.sortIndex=d,o.filter=g}_createLine(e){const r=this;return e.classList.contains("smart-breadcrumb-item")||e.column?function(){const t=document.createElement("div"),o=r.getBoundingRect(e),a=r.getBoundingRect(r.$.columnHeader),n=r.getBoundingRect(r),i=r.$.content.offsetHeight-7-r._scrollView.hScrollBar.offsetHeight-o.top+n.top;return t.classList.add("smart-grid-drag-line"),r.rightToLeft?t.style.left=-a.left+o.left+"px":t.style.left=-a.left+o.right+"px",t.style.top=o.top-n.top+"px",t.style.height=i+"px",t.style.opacity=0,t}():function(){const t=document.createElement("div"),o=r.getBoundingRect(e);return t.classList.add("smart-grid-drag-line","row"),t.style.width=r.$.scrollView.offsetWidth-e.offsetLeft-e.row.header.offsetWidth-r._scrollView.vScrollBar.offsetWidth+"px",t.style.left=e.row.header.offsetWidth+"px",t.style.top=o.bottom-r.offsetTop+"px",t.style.opacity=0,t}()}_drag(e){const r=this,t=e.originalEvent;if(r._dialogDragDetails&&r._dragDialog(e,"both"),!r._dragDrop)return;let o=r._dragDrop.dragDetails.feedback;if(!o&&r._dragDrop.showFeedback){if(o=r._dragDrop.createFeedback(t),!o)return;if(r._overlay=document.createElement("div"),r._overlay.classList.add("smart-grid-overlay"),r._overlay.style.cursor="",r.$.root.appendChild(r._overlay),r._dragDrop.column)r._dragLine=r._createLine(r._dragDrop.column.element),r.$.root.appendChild(r._dragLine),requestAnimationFrame((()=>{r._dragLine&&(r._dragLine.style.opacity=1)})),r._dragDrop.feedbackLine=r._dragLine,o.classList.add("smart-grid-column-drag-feedback");else{const e=r._dragDrop.row;let t="<div>";for(let o=0;o<r.columns.length;o++){const a=r.columns[o];t+="<div>"+a.label+": "+e["column_"+a.dataField].value+"</div>"}r._dragDrop.items=r._rowElements,r._dragDrop.getItemCoordinates(r._rowElements),t+="</div>",o.innerHTML=t,r._dragLine=r._createLine(r._dragDrop.row.element),r.$.root.appendChild(r._dragLine),requestAnimationFrame((()=>{r._dragLine&&(r._dragLine.style.opacity=1)})),o.classList.add("smart-grid-row-drag-feedback"),r._dragDrop.feedbackLine=r._dragLine}}r._dragDrop.drag(e),r._dragDrop.column?r._dragColumn(e):r._dragRow(e),t.preventDefault()}_dragRow(e){const r=this,t=r._dragDrop.dragDetails,o=r._dragLine,a=e.originalEvent,n=r.getBoundingRect(r);if(e.pageY<n.top||e.pageY>n.bottom||e.pageX<n.left||e.pageX>n.right||t.target&&!t.target.row||!t.target)r._dragDrop.error(),o.style.opacity=0;else{if(r._dragDrop.getItemCoordinates(r._dragDrop.items),o.style.opacity=1,r._dragDrop.success(),!t.target)return;let a=r.getBoundingRect(t.target);o.style.width=r.$.scrollView.offsetWidth-r._dragDrop.row.offsetLeft-r._dragDrop.row.header.offsetWidth-r._scrollView.vScrollBar.offsetWidth+"px",o.style.left=r._dragDrop.row.header.offsetWidth+"px";const i=r.offset(r).top;let l=a.top-i-r.scrollTop;r._recyclingRows[r._recyclingRows.length-1].element===t.target&&e.pageY>n.bottom-10&&(t.before=!1),e.pageY>l+i+a.height-7&&(t.before=!1),o.style.top=t.before?l+"px":l+a.height-7+"px"}r.$.fireEvent("rowDragging",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:r._dragDrop.visibleIndex,data:r._dragDrop,originalEvent:a})}_dragColumn(e){const r=this,t=r._dragDrop.dragDetails,o=r.getBoundingRect(r),a=e.originalEvent;e.pageY<o.top||e.pageY>o.bottom||e.pageX<o.left||e.pageX>o.right?(r._dragDrop.error(),r._dragLine.style.opacity=0):r._dragLine.style.opacity=1;const n=r.$.groupHeader.getBoundingClientRect();if(e.pageY>=n.top&&e.pageY<n.bottom&&e.pageX>=n.left&&e.pageX<n.right&&(!1===r._dragDrop.column.allowGroup?(r._dragLine.style.opacity=0,r._dragDrop.error()):(t.feedback.classList.remove("freeze"),t.feedback.classList.remove("error"))),t.target&&r._dragDrop.feedback&&!r._dragDrop.feedback.classList.contains("error")){r._dragDrop.getItemCoordinates(r._dragDrop.items);for(let o=0;o<r._dragDrop._itemCoordinates.coordinates.length;o++){const a=r._dragDrop._itemCoordinates.coordinates[o];if(Array.isArray(a))for(let o=0;o<a.length;o++){let n=a[o];e.pageY>=n.rect.top&&e.pageY<n.rect.bottom&&e.pageX>=n.rect.left&&e.pageX<n.rect.right&&(t.target=r._dragDrop.items[n.index],t.before=!0)}}const a=r.getBoundingRect(t.target),n=r.getBoundingRect(r.$.content);if(r._dragDrop.column){r._dragLine.style.opacity=1;const i=r.appearance.showViewBar?r.layout.viewBarWidth:0;if(!1===t.before?r._dragLine.style.left=i+a.right-n.left+"px":r._dragLine.style.left=i+a.left-n.left+"px",r.behavior.allowColumnFreeze&&r.dataSource&&0===r.dataSource.groupBy.length){const o=r._dragDrop._itemCoordinates.coordinates[0][0].rect;r._dragDrop.column.allowFreeze&&(e.pageX>=o.left&&e.pageX<=o.left+10?t.feedback.classList.add("freeze"):t.feedback.classList.remove("freeze"),t.target&&t.target.hasAttribute("freeze")&&t.feedback.classList.add("freeze"),t.item.column.freeze&&!t.target.hasAttribute("freeze")?t.feedback.classList.add("unfreeze"):t.feedback.classList.remove("unfreeze"))}if(t.target.classList.contains("smart-breadcrumb-item"))r._dragLine.style.top=a.top-o.top-r.scrollTop+"px",r._dragLine.style.height=a.height+"px",r.$.breadcrumb.dataSource.forEach((e=>{e.value===t.item.column.dataField&&(r._dragLine.style.opacity=0,r._dragDrop.error())}));else{r._dragLine.style.top=a.top-o.top-r.scrollTop+"px";const e=r.$.content.offsetHeight-7-r._scrollView.hScrollBar.offsetHeight-a.top+n.top;r._dragLine.style.height=e+"px"}parseInt(r._dragLine.style.left)<3?r._dragLine.style.left="3px":parseInt(r._dragLine.style.left)>=r.offsetWidth-3&&(r._dragLine.style.left=r.offsetWidth-7+"px")}}else r._dragLine.style.opacity=0;r.$.fireEvent("columnDragging",{column:r._dragDrop.column,dataField:r._dragDrop.column.dataField,index:r.columns.indexOf(r._dragDrop.column),data:r._dragDrop,originalEvent:a})}_beginRowDrag(e,r){const t=this;let o=!1;t.behavior.allowRowReorder&&r.allowReorder&&(o=!0),o&&(t.$.fireEvent("rowDragStart",{row:r,id:r.id,index:r.visibleIndex,data:null,originalEvent:e.originalEvent}).defaultPrevented||(t._dragDrop=new Smart.Utilities.DragDrop(t),t._dragDrop.capture(r.element,e),t._dragDrop.row=r,t._recycle(!1),t._dragInterval&&clearInterval(t._dragInterval),t._dragInterval=setInterval((function(){const e=t._dragDrop.dragDetails;if(!e.feedback)return;const r=parseInt(e.feedback.style.left),o=parseInt(e.feedback.style.top),a=t.getBoundingClientRect();t._dragLine&&a.left<=r&&a.left+a.width>=r&&(o>=a.top&&o<=a.top+20?t.scrollTop-=5:o>=a.top+a.height+5&&o<=a.top+a.height+20&&(t.scrollTop+=5))}),10)))}_beginDrag(e,r){const t=this;if(!r.dataField)return void t._beginRowDrag(e,r);const o=r;if(t.behavior.allowColumnReorder&&o.allowReorder&&!o.autoGenerated){if(t.appearance.showColumnHeaderDragIcon&&!e.originalEvent.target.classList.contains("smart-drag-handle"))return;if(!t.$.fireEvent("columnDragStart",{column:o,dataField:o.dataField,index:t.columns.indexOf(o),data:null,originalEvent:e.originalEvent}).defaultPrevented){t._dragDrop=new Smart.Utilities.DragDrop(t),t._dragDrop.capture(o.element,e),t._dragDrop.column=o;const r=()=>{let e=t.columns.map((e=>e.element));if(!t.behavior.allowColumnFreeze){const r=t.columns.filter((e=>!e.freeze));e=r.map((e=>e.element))}if(t.grouping.enabled&&"multipleColumns"===t.grouping.renderMode&&t.dataSource&&-1===t.dataSource.groupBy.indexOf(o.dataField)){const r=t.columns.filter((e=>{if(t.dataSource&&-1===t.dataSource.groupBy.indexOf(e.dataField))return!0}));e=r.map((e=>e.element))}e=e.filter((e=>!e.classList.contains("smart-visibility-hidden"))),t.$.breadcrumb?t._dragDrop.items=e.concat(t.$.breadcrumb._items):t._dragDrop.items=e};r(),t._dragInterval&&clearInterval(t._dragInterval),t._dragInterval=setInterval((function(){const e=t._dragDrop.dragDetails;if(!e.feedback)return;r();const o=parseInt(e.feedback.style.left),a=t.getBoundingClientRect();t._dragLine&&a.left<=o&&a.left+a.width>=o&&(o>=a.left&&o<=a.left+20?t.scrollLeft-=5:o>=a.left+a.width-20&&o<=a.left+a.width&&(t.scrollLeft+=5))}),3)}}}_cancelDrag(){const e=this;e._dragLine&&(e._dragLine.parentNode&&e._dragLine.parentNode.removeChild(e._dragLine),e._dragLine=null),e._dragDrop&&(e._dragDrop.removeFeedback(),e._dragDrop=null),e._dragInterval&&clearInterval(e._dragInterval),e._recycle()}_endDrag(e){const r=this;if(r._dialogDragDetails&&(r._dialogDragDetails.started=!1),r._dragDrop){const t=r._dragDrop.dragDetails;if(!t.feedback||t.feedback&&t.feedback.classList.contains("error")&&!t.feedback.classList.contains("data"))return void r._cancelDrag();if(e.key&&"Escape"===e.key)return r._dragDrop.column?r.$.fireEvent("columnDragCancel",{column:t.item.column,dataField:t.item.column.dataField,index:r.columns.indexOf(r._dragDrop.column),data:r._dragDrop}):r._dragDrop.row&&r.$.fireEvent("rowDragCancel",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:r._dragDrop.row.visibleIndex,data:r._dragDrop}),void r._cancelDrag();r.beginUpdate();let o=t.target;const a=t.before;if(r._dragDrop.column){if(r.filtering.filterRow&&r.filtering.filterRow.visible)for(let e=0;e<r.columns.length;e++)r.columns[e]._filterEditorInitialized=!1;if(o&&o.column&&"Escape"!==e.key&&!t.feedback.classList.contains("data")){r.columns.indexOf(r._dragDrop.column);let t=r.columns.indexOf(o.column);if(t+=a?0:1,!r.$.fireEvent("columnDragEnd",{column:r._dragDrop.column,dataField:r._dragDrop.column.dataField,index:r.columns.indexOf(r._dragDrop.column),newIndex:t,data:r._dragDrop,originalEvent:e.originalEvent}).defaultPrevented){const t=r.columns.indexOf(r._dragDrop.column);let n=r.columns.indexOf(o.column);r._dragDrop.column.freeze,n+=a?0:1,r._dragDrop.column.columnGroup=o.column.columnGroup,r._dragDrop.column.freeze=o.column.freeze,r.behavior.allowColumnFreeze&&(r._dragDrop.feedback.classList.contains("freeze")&&(r._dragDrop.column.freeze=!0),r._dragDrop.feedback.classList.contains("unfreeze")&&(r._dragDrop.column.freeze=!1)),t<n&&n--;const i=r._dragDrop.column,l=i.sortIndex,d=i.sortOrder,s=i.filter,g=r.columns.canNotify;r.columns.canNotify=!1,r.columns.move(t,n),r.columns.canNotify=g;const c=r.context;r.context=document,i.sortOrder=d,i.sortIndex=l,i.filter=s,r.context=c,r._renderColumns(),r.$.fireEvent("columnReorder",{column:r._dragDrop.column,dataField:r._dragDrop.column.dataField,index:t,newIndex:n,data:r._dragDrop,originalEvent:e.originalEvent}),r.autoSaveState()}}else r.$.fireEvent("columnDragEnd",{column:r._dragDrop.column,dataField:r._dragDrop.column.dataField,index:r.columns.indexOf(r._dragDrop.column),newIndex:-1,data:r._dragDrop,originalEvent:e.originalEvent});if("Escape"!==e.key&&r.$.breadcrumb&&r._dragDrop.column.allowGroup){const t=r.getBoundingRect(r.$.breadcrumb);if(e.originalEvent.pageY>=t.top-r.scrollTop&&e.originalEvent.pageY<=t.bottom-r.scrollTop){const e=r.$.breadcrumb._items.indexOf(o),t=r._dragDrop.dragDetails.item.column,n=r.$.breadcrumb.dataSource.slice(0);n.splice(Math.max(0,e+(a?0:1)),0,{label:t.label,value:t.dataField}),r.$.breadcrumb.dataSource=n;const i=r.$.breadcrumb.dataSource.map((e=>e.value));r.dataSource.groupBy=i,r.refreshFilters(),r.$.fireEvent("group",{groups:r.dataSource.groupBy}),r.autoSaveState()}}}else if(r._dragDrop.row)if(o&&o.row&&"Escape"!==e.key&&!t.feedback.classList.contains("data")){if(!r.$.fireEvent("rowDragEnd",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:r._dragDrop.row.visibleIndex,newIndex:o.row.visibleIndex,data:r._dragDrop,originalEvent:e.originalEvent}).defaultPrevented){const a=r._dragDrop.row.visibleIndex;let n=o.row.visibleIndex;t.before||n++,a<n&&n--,r.rows.move(a,n),r.$.fireEvent("rowReorder",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:a,newIndex:n,data:r._dragDrop,originalEvent:e.originalEvent})}}else r.$.fireEvent("rowDragEnd",{row:r._dragDrop.row,id:r._dragDrop.row.id,index:r._dragDrop.row.visibleIndex,newIndex:-1,data:r._dragDrop,originalEvent:e.originalEvent});r._cancelDrag();const n=r.columnGroups&&r.columnGroups.length>0;r.endUpdate(!n),n&&r._renderColumns(!0),r.paging.enabled&&r.grouping.enabled&&r._refreshPagesCount()}}});
@@ -1,5 +1,5 @@
1
1
 
2
- /* Smart UI v17.0.3 (2023-10-20)
2
+ /* Smart UI v17.0.17 (2023-11-08)
3
3
  Copyright (c) 2011-2023 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
@@ -1,5 +1,5 @@
1
1
 
2
- /* Smart UI v17.0.3 (2023-10-20)
2
+ /* Smart UI v17.0.17 (2023-11-08)
3
3
  Copyright (c) 2011-2023 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
@@ -1,6 +1,6 @@
1
1
 
2
- /* Smart UI v17.0.3 (2023-10-20)
2
+ /* Smart UI v17.0.17 (2023-11-08)
3
3
  Copyright (c) 2011-2023 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
6
- Smart.Utilities.Assign("Grid.Select",class{_refreshSelection(){const e=this;if(e.selection.enabled&&(e._selectionColumn.refresh(),!e._isVirtualMode()&&e._selection&&e._selection.rows))for(let t in e._selection.rows)e.rowById[t]||delete e._selection.rows[t];e._refreshCellSelectionRect()}_toggleColumnSelection(e){const t=this;if(!t.selection.enabled||"none"===t.selection.checkBoxes.selectAllMode)return void(t._inputOverlay&&t._inputOverlay.parentNode&&t._inputOverlay.parentNode.removeChild(t._inputOverlay));let l=e.element.getAttribute("selected");l="indeterminate"===l||""!==l;let n=t._recyclingRows;t._selectionColumn._selecting=!0,t.beginUpdate(),t._selection.indexes=[];for(let e=0;e<n.length;e++)n[e].selected=l;if(t._selectionColumn._selecting=!1,t.endUpdate(!1),t._isVirtualMode())if(l)for(let e=0;e<t.dataSource.virtualDataSourceLength;e++)l&&(t._selection.indexes[e]=e,t._selection.rows[e]=e);else t._selection.indexes=[],t._selection.rows=[];if(t._recycle(!1),t.$.fireEvent("change",{started:!1,finished:!0}),t.selection.enabled&&t.selection.checkBoxes.enabled&&"none"!==t.selection.checkBoxes.selectAllMode){const l=e.element,n=l.querySelector(".smart-input");t._inputOverlay?t._inputOverlay.parentNode!==t.$.columnHeader&&(t._inputOverlay.parentNode&&t._inputOverlay.parentNode.removeChild(t._inputOverlay),t._inputOverlay=document.createElement("div"),t.$.columnHeader.appendChild(t._inputOverlay)):(t._inputOverlay=document.createElement("div"),t.$.columnHeader.appendChild(t._inputOverlay)),t._inputOverlay.column=e,t._inputOverlay.onpointerdown=function(){t._inputOverlay||(t._inputOverlay.onpointerdown=null);const e=t._inputOverlay.column;t._inputOverlay.classList.remove("smart-animate"),t._selectionColumn._selecting=!0,t.beginUpdate();let l=e.element.hasAttribute("selected"),n=t._recyclingRows;for(let e=0;e<n.length;e++)n[e].selected=!l;t._selectionColumn._selecting=!1;const o=t._inputOverlay;if(t.endUpdate(!1),t._isVirtualMode())if(l)t._selection.indexes=[],t._selection.rows=[];else for(let e=0;e<t.dataSource.virtualDataSourceLength;e++)l&&(t._selection.indexes[e]=e,t._selection.rows[e]=e);return t._recycle(),t.$.fireEvent("change",{started:!1,finished:!0}),t.$.fireEvent("columnClick",{column:e,dataField:e.dataField}),t.$.columnHeader.appendChild(o),t._inputOverlay=o,t._inputOverlay.classList.add("smart-animate"),!1},t._inputOverlay.classList.add("smart-input-overlay"),t._inputOverlay.classList.add("smart-input-overlay-column"),t.appearance.allowCheckBoxesSelectionAnimation&&t._inputOverlay.classList.add("smart-animate"),t._inputOverlay.style.top=(l.offsetHeight-n.offsetHeight)/4+1+"px";const o=t._selectionColumn.element.parentElement.offsetLeft+t._selectionColumn.element.offsetLeft;t.rightToLeft?t._inputOverlay.style.right=o+"px":t._inputOverlay.style.left=o+"px",t._inputOverlay.style.height=l.offsetWidth+"px",t._inputOverlay.style.width=l.offsetWidth+"px",t._inputOverlay.onmousedown=null,t._inputOverlay.classList.add("smart-input-overlay-on"),t._selectionColumn.refresh()}}_refreshCheckBoxColumnSelection(){const e=this;if(e.selection.enabled&&e.selection.checkBoxes.enabled){const t=e._selectionColumn.element;"none"===e.selection.checkBoxes.selectAllMode?(t.removeAttribute("checkbox"),t.label.classList.remove("smart-input")):(t.setAttribute("checkbox",""),t.label.classList.add("smart-input")),e._selectionColumn.refresh()}}_handleExtendedRowSelection(e,t){const l=this;if(!e)return;let n=l._recyclingRows;if(l.paging.enabled&&"page"===l.selection.selectAllMode&&(n=n.slice(l.paging.pageIndex*l.paging.pageSize,(l.paging.pageIndex+1)*l.paging.pageSize)),!t||t.ctrlKey||t.metaKey||(l._selection.rows=[],l._selection.indexes=[]),t&&!t.shiftKey&&(l._rangeSelectionStartRow=e,l._rangeSelectionEndRow=e),t&&t.shiftKey){l._rangeSelectionEndRow=e;const t=n.indexOf(l._rangeSelectionStartRow),o=n.indexOf(l._rangeSelectionEndRow),i=Math.min(t,o),a=Math.max(t,o);if(-1===t||-1===o)return;for(let e=i;e<=a;e++){const t=n[e];t.allowSelect&&t.setProperty("selected",!0)}}else!1!==e.allowSelect&&(t&&(t.ctrlKey||t.metaKey)?null===e.selected?e.setProperty("selected",!0):e.setProperty("selected",!e.selected):e.setProperty("selected",!0))}_setSelection(e,t,l){const n=this;if(!n.selection.enabled)return;if(n._lastColumnSelectionRange=null,n._lastRowSelectionRange=null,n.closeMenu(),null===e&&null===t)return void n.clearSelection();const o=function(){if(l&&!l.ctrlKey&&!l.metaKey&&!l.shiftKey||"one"===n.selection.mode){if("many"!==n.selection.mode){for(let e in n._selection.rows){const t=n.rowById[e];t&&(t.canNotify=!1,t.selected=!1,t.canNotify=!0)}n._selection.indexes=[],n._selection.rows=[],n._selection.columns=[],n._selection.cells=[]}n._selection.focusedCell=null}if(n._selection.selectionRect){const e=n._selection.selectionRect;e.parentNode.removeChild(e);const t={down:"pointerdown",move:"pointermove",up:"pointerup"};Smart.Utilities.Core.isMobile&&(t.down="touchstart",t.move="touchmove",t.up="touchend"),document.removeEventListener(t.move,e.onMove),document.removeEventListener(t.up,e.onUp),document.removeEventListener(t.down,e.onDown),n._selection.selectionRect=null}};n.beginUpdate();const i=n.columnByDataField[t],a=()=>{const t=n.rowById[e];t&&(t.allowSelect||null===t.allowSelect&&!l)&&(n.selection.checkBoxes.enabled&&l&&l.originalEvent&&l.originalEvent.target&&l.originalEvent.target.parentNode&&l.originalEvent.target.parentNode.hasAttribute("checkbox")&&(l.ctrlKey=!0),o(),n._selectRow(e,l))};if(n.selection.allowCellSelection&&null!=e&&i&&!i.autoGenerated){const i=n.rowById[e];if(!i)return n.endUpdate(!1),void n._recycle();let a=i.getCell(t);const r=n._getParentCell(i,t);r&&(a=r.row.getCell(r.column.dataField)),a&&a.column.allowSelect&&(o(),!l||l.ctrlKey||l.metaKey||(n._selection.rows=[],n._selection.indexes=[],n._selection.columns=[],"many"!==n.selection.mode&&(n._selection.cells=[])),"extended"===n.selection.mode?l&&(l.ctrlKey||l.metaKey)?a.selected=!a.selected:a.selected=!0:"one"===n.selection.mode?a.selected=!0:a.selected=!a.selected,(l&&!l.shiftKey||!n._selection.focusedCell)&&(n._selection.focusedCell={id:a.row.id,value:a.value,index:a.row.index,dataField:a.column.dataField}),l&&(l.shiftKey||n._selection.focusedCell.id===a.row.id&&n._selection.focusedCell.dataField===a.column.dataField&&"extended"===n.selection.mode)&&(r?n._renderCellSelectionRect(a.row,a.column,r.endRow,r.endColumn):n._renderCellSelectionRect(a.row,a.column,a.row,a.column)))}else n.selection.allowRowHeaderSelection&&null!=e&&void 0===n.columnByDataField[t]||n.selection.checkBoxes.enabled&&null!=e&&"_checkBoxColumn"===t&&void 0===n.columnByDataField[t]?a():null==e||null!=t&&void 0===n.columnByDataField[t]||!n.selection.allowRowSelection?n.selection.allowColumnHeaderSelection&&i&&(o(),n._selectColumn(t,l||new KeyboardEvent("keydown"))):a();n.endUpdate(!1,!1),n._recycle(!0,!0,!1),null==e||i||n._renderInputOverlay(e,l),n.__selectionStarted=new Date}_renderCellSelectionRect(e,t,l,n){const o=this;let i=o._recyclingRows;const a=i.indexOf(e),r=i.indexOf(l);if(!(o.grouping.enabled&&"advanced"===o.grouping.renderMode&&o.dataSource&&o.dataSource.groupBy.length>0)&&!o._mobile&&a>=0&&r>=0){if(!o._selection.selectionRect){const e=function(e){const t=document.createElement("div"),l=document.createElement("div"),n=document.createElement("div");return n.classList.add("smart-selection-overlay"),n.appendChild(l),l.appendChild(t),t.classList.add("smart-selection-overlay-content"),l.classList.add("smart-selection-overlay-border-content"),o.selection.allowCellDragSelectionHandle&&e&&l.classList.add("handle"),o.$.scrollView.appendChild(n),n},t=o._selection.selectionRect=e(!0);if(o.selection.allowCellDragSelectionHandle){let e=null,l=null,n=null;t.onMove=function(t){const a=o._selection.selectionRect;let r=t.clientX,s=t.clientY;t.touches&&(r=t.touches[0].clientX,s=t.touches[0].clientY);const d=function(e){const t=(o.enableShadowDOM?o.shadowRoot:o.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let l=null;for(let e=0;e<t.length;e++){const n=t[e];if(n.getAttribute("data-field")){l=n.getAttribute("data-field");break}}let n=null;for(let e=0;e<t.length;e++){const l=t[e];if(l.getAttribute("data-id")){n=l.row;break}}return{column:o.columnByDataField[l],row:n}};if(a&&a.capturedDrag){let e=d({clientX:r,clientY:s}),l=d({clientX:r,clientY:s+a.top}).row,n=d({clientX:r+a.left,clientY:s}).column;if(l||(l=i[i.length-1]),n||(n=e.column),l&&n&&e.row&&e.column){a.row=e.row,a.rowId=a.row.id,a.column=e.column,a.endDragRow=a.endRow=l,a.endDragColumn=a.endColumn=n,a.endDragRowId=a.endDragRow.id,o._dragSelectionStartDataField=a.column.dataField,o._dragSelectionStartRow=a.row;const t=a.row.getCell(a.column.dataField);o._selection.focusedCell={index:t.row.index,id:t.row.id,dataField:t.column.dataField,value:t.value}}o._resizeSelectionRect(),t.preventDefault()}else if(a&&a.captured)if(o._dragSelectionStartDataField=o._selection.focusedCell.dataField,o._dragSelectionStartRow=o.rowById[o._selection.focusedCell.id],null===l&&null===n&&(Math.abs(r-e.left)>=30?l=!0:Math.abs(s-e.top)>=30&&(n=!0)),a.lastPoint&&Math.abs(a.lastPoint.top-s)>=40?(l=null,n=!0):a.lastPoint&&Math.abs(a.lastPoint.left-r)>=40&&(n=null,l=!0),l){const t=a.endDragColumn.dataField,l=d({clientX:r,clientY:e.top-5});l.row&&l.column&&(a.endDragRow=a.endRow,a.endDragColumn=l.column,a.endDragColumn.dataField!==t&&(a.lastPoint={left:r,top:s}),o._resizeSelectionRect())}else if(n){const t=a.endDragRow,l=d({clientX:e.left-5,clientY:s});l.row&&l.column&&(a.endDragRow=l.row,a.endDragColumn=a.endColumn,a.endDragRow.id&&a.endDragRow.id!==t.id&&(a.lastPoint={left:r,top:s}),o._resizeSelectionRect())}a&&a.captured&&o.selection.allowDragSelectionAutoScroll&&(o._autoScrollSelectionDragInterval&&clearInterval(o._autoScrollSelectionDragInterval),o.selection.isDragging=!0,o._autoScrollSelectionDragInterval=setInterval((function(){const e=o.$.scrollView.getBoundingClientRect();r<=e.left+20?(o.scrollLeft-=15,o._resizeSelectionRect()):r>=e.left+e.width-20&&(o.scrollLeft+=15,o._resizeSelectionRect()),s<=e.top+20?(o.scrollTop-=15,o._resizeSelectionRect()):s>=e.top+e.height-20&&(o.scrollTop+=15,o._resizeSelectionRect())}),25))},t.onUp=function(){if(!t.captured)return;o._autoScrollSelectionDragInterval&&clearInterval(o._autoScrollSelectionDragInterval),o.editing.editCell||o.editing.editRow||o.focus(),t.capturedDrag=!1,t.captured=!1,l=null,n=null,e=null,t.lastPoint=null;const i=t.cellValues;t.minRow&&t.maxRow&&t.maxRow&&t.maxColumn&&(o._selectCellsRange(t.minRow,t.maxRow,t.minColumn.dataField,t.maxColumn.dataField),t.row=t.minRow,t.rowId=t.row.id,t.column=t.minColumn,t.endColumn=t.maxColumn,t.endRow=t.maxRow,t.endRowId=t.maxRow.id,t.cellValues=i,o._resizeSelectionRect(),o.selection.allowCellDragSelectionAutoFill&&o._pasteSelectedCells({row:t.row,endRow:t.endDragRow,column:t.column,endColumn:t.endColumn},i)),t.endDragColumn=null,t.endDragRow=null,t.minColumn=null,t.minRow=null,t.maxColumn=null,t.maxRow=null},t.onDown=function(l){if(t.captured&&!e){let t=l.clientX,n=l.clientY;l.touches&&(t=l.touches[0].clientX,n=l.touches[0].clientY),e={left:t,top:n}}};const a={down:"pointerdown",move:"pointermove",up:"pointerup"};Smart.Utilities.Core.isMobile&&(a.down="touchstart",a.move="touchmove",a.up="touchend"),t["on"+a.down]=function(e){const l=t.getBoundingClientRect();let n=e.clientX,i=e.clientY;e.touches&&(n=e.touches[0].clientX,i=e.touches[0].clientY),n>=l.right-5&&i>=l.bottom-5?(t.captured=!0,t.endDragRow=t.endRow,t.endDragColumn=t.endColumn):o.selection.allowCellDragDropSelectionHandle&&i>=l.bottom-5?(t.captured=!0,t.capturedDrag=!0,t.endDragRow=t.endRow,t.endDragColumn=t.endColumn,t.left=t.endColumn.left-t.column.left,t.top=t.endRow.top-t.row.top):t.captured||o._rowDownHandler(e)},document.addEventListener(a.move,t.onMove,{passive:!1}),document.addEventListener(a.up,t.onUp,{passive:!1}),document.addEventListener(a.down,t.onDown,{passive:!1})}}const e=o._selection.selectionRect;e.row=o.rowById[o._selection.focusedCell.id],e.rowId=o._selection.focusedCell.id,e.column=o.columnByDataField[o._selection.focusedCell.dataField],e.endRow=l,e.endRowId=l.id,e.endDragRow=l,e.endColumn=n,e.endDragColumn=n,o._refreshCellSelectionRect()}}_resizeSelectionRect(){const e=this,t=e._selection.selectionRect;if(!t)return;let l=e._recyclingRows,n=t.row,o=t.endDragRow,i=t.column,a=t.endDragColumn;const r=e.viewColumns,s=l.indexOf(n),d=l.indexOf(o),c=l.indexOf(t.endRow),u=r.indexOf(i),f=r.indexOf(a),g=r.indexOf(t.endColumn),m=Math.min(c,Math.min(s,d)),_=Math.max(c,Math.max(s,d)),p=Math.min(g,Math.min(u,f)),w=Math.max(g,Math.max(u,f));c<=Math.min(s,d)?t.minRow=t.endRow:t.minRow=s<=d?n:o,c>=Math.max(s,d)?t.maxRow=t.endRow:t.maxRow=s>=d?n:o,g<=Math.min(u,f)?t.minColumn=t.endColumn:t.minColumn=u<=f?i:a,g>=Math.max(u,f)?t.maxColumn=t.endColumn:t.maxColumn=u>=f?i:a;let h=0,y=0,v=0,S=0;for(let e=m;e<=_;e++){const t=l[e];if(t){e===m&&(h=t.top),e===_&&(y=t.top+t.height-h);for(let e=p;e<=w;e++){const l=r[e].dataField,n=t.getCell(l);e===p&&(v=n.column.left),e===w&&(S=n.column.left+n.column.computedWidth-v)}}}t.style.top=h-e.scrollTop-1+"px",e._isVirtualMode()&&(t.style.top=h+parseFloat(e.$.rowContainer.style.top)-1+"px"),e.rightToLeft?t.style.right=v-e.scrollLeft+"px":t.style.left=v-e.scrollLeft+"px",t.style.height=y+1+"px",t.style.width=S+1+"px"}_getPatternValue(e,t,l){let n=[],o=0,i=[],a=[],r=[],s=[];const d={names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},c={names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},u=function(e){if(void 0!==e&&!(e.toString().indexOf("GMT+")>=0||e.toString().indexOf("GMT-")>=0)){if(!isNaN(parseFloat(e)))return/[A-Za-z]/.test(e.toString())?void 0:parseFloat(e);if(d.names.indexOf(e)>=0)return s=d.names,d.names.indexOf(e);if(d.namesAbbr.indexOf(e)>=0)return s=d.namesAbbr,d.namesAbbr.indexOf(e);if(d.namesShort.indexOf(e)>=0)return s=d.namesShort,d.namesShort.indexOf(e);if(c.names.indexOf(e)>=0)return s=c.names,c.names.indexOf(e);if(c.namesAbbr.indexOf(e)>=0)return s=c.namesAbbr,c.namesAbbr.indexOf(e);if(void 0!==e&&(null===e&&(e=""),/\d+/.test(e.toString()))){r.push(e.toString().replace(/[0-9]/,"#")),r[r.length-1]=r[r.length-1].replace(/[0-9]/g,"");const t=parseFloat(e.toString().replace(/\D/g,""));return isNaN(t)?0:t}}};let f=0;for(let e in l){let t=l[e];n[o]=[],f=0;for(let e in t){let l=u(t[e]);void 0!==l&&(n[o].push(l),f++)}if(0===n[o].length)continue;let a=n[o][0],d=0;for(let e=0;e<n[o].length;e++){let t=u(n[o][e-1]),l=u(n[o][e]);0===e&&(t=l),a+=l,d+=l-t}a/=n[o].length,a-=n[o][0],a+=n[o][n[o].length-1],0!==d&&(d/=n[o].length-1),(s.length>0||r.length>0)&&(d=1,a=n[o][0]),n[o].length<=2&&(a=n[o][n[o].length-1]+d),i.push({step:d,stepStart:a}),o++}for(let e=0;e<f;e++){let t=n[0][e],l=0;for(let o=1;o<n.length;o++){const i=u(n[o-1][e]),a=u(n[o][e]);t+=a,l+=a-i}t/=n.length,t-=n[0][e],t+=n[n.length-1][e],0!==l&&(l/=n.length-1),(s.length>0||r.length>0)&&(l=1,t=n[0][e]),n.length<=2&&(t=n[n.length-1][e]+l),a.push({step:l,stepStart:t})}if(!n[e]){let l=n.length;for(let o=l;o<=e;o++){n[o]=[];for(let e=0;e<=t;e++)a[e]||(a[e]=a[e-1]),a[e]&&(o===l?n[o][e]=a[e].stepStart:(n[o][e]=n[o-1][e]+a[e].step,s.length>1&&n[o][e]>=s.length&&(n[o][e]=0)))}return s.length>0?s[n[e][t]]:r.length>0?r[e%r.length].replace("#",n[e][t]):n[e][t]}if(!n[e][t]){let l=f;for(let o=l;o<=t;o++)i[e]&&(o===l?n[e].push(i[e].stepStart):(n[e][o]=n[e][o-1]+i[e].step,s.length>1&&n[e][o]>=s.length&&(n[e][o]=0)));return s.length>0?s[n[e][t]]:r.length>0?r[e%r.length].replace("#",n[e][t]):n[e][t]}return n[e]&&n[e][t]?r.length>0?r[e%r.length].replace("#",n[e][t]):n[e][t]:0}_pasteDataType(e){const t=this.dataSource&&"number"==typeof this.dataSource.dataSource,l=e.cell,n=e.value;let o=l.column.dataType;return o&&!t||(o=isNaN(parseFloat(n))?"string":n instanceof Date?"date":"true"===n||"false"===n?"boolean":"number"),o}_pasteModeCopy(e){const t=this,l=t.dataSource&&"number"==typeof t.dataSource.dataSource,n=t._pasteDataType(e),o=e.cell;let i=e.value;if(o.column.editor&&o.column.editor.dataSource&&i){const e=e=>{let l;const n=o.column.editor.collaborator?t.users:o.column.editor.dataSource;for(let t=0;t<n.length;t++){const i=n[t];if("string"!=typeof i&&(i.label===e||i.name===e))return l=i.value,o.column.editor.collaborator&&(l=i.id),l;if("string"!=typeof i&&i.value===e)return l=i.value,o.column.editor.collaborator&&(l=i.id),l}return-1};let l=-1;if(i&&-1!==i.indexOf(",")?(l=[],i.split(",").forEach((t=>{const n=e(t.trim());-1!==n&&l.push(n)})),l=l.join(",")):l=e(i),-1!==l&&(i=l),-1===l)return}if(o.column.editor&&"custom"===o.column.editor.template)return;const a=i,r=e.dataField;if(a&&"string"==typeof a&&a.indexOf("[{")>=0&&"image"!==o.column.template&&"attachment"!==o.column.template)return;let s=a,d=!1;if("string"===n){if(s=a,s){if((""+s).indexOf("&#")>=0&&(s=t._fromHTMLEntities(s)),(""+s).indexOf("GMT")>=0){const e=new Smart.Utilities.DateTime(s).toString("d");e&&e.length&&(s=e)}o.column.editor.collaborator||(s=s.replaceAll("\\"," ").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/[\r\n]+/g," ").replace(/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi,(e=>"&#"+e.codePointAt(0)+";")))}d=!0}else if("bool"===n||"boolean"===n)1!==a&&"1"!==a&&!0!==a&&"true"!==a&&"TRUE"!==a&&"True"!==a||(s=!0,d=!0);else if("date"===n||"time"===n||"dateTime"===n){const e=t.columnByDataField[r];l?(s=a,d=!0):e&&e.dataType!==n?(s=null,d=!0):(s=a,"string"==typeof a&&(s=new Date(a)),o&&"duration"===o.column.template&&(s=[s,s]),d=!0)}else if("number"===n||"float"===n||"int"===n){const e=t.columnByDataField[r];l?(s=a,d=!0):e&&e.dataType!==n?(s=null,d=!0):null!==a?"int"===n||"integer"===n?(s=parseInt(a),d=!0):(s=parseFloat(a),isNaN(s)&&(s=null),d=!0):(s=null,d=!0)}if(!1!==o.column.allowEdit&&!1!==t.editing.enabled||(d=!1),d)if(t.dataSource&&t.dataSource.virtualDataSource){const e={};e[o.column.dataField]=s,t.editing.batch?t._batchUpdateCell(o.row,o.column,s,o.value):t.updateRow(o.row.id,e)}else{const e=o.value;if(t._setCellUndoRedo(o,e,s),t.onCellUpdate){t._pasteTempValues||(t._pasteTempValues=[]),t._pasteTempValues.push({id:o.row.id,cell:o,dataField:o.column.dataField,oldValue:e,newValue:s}),t._pasteTimer&&clearTimeout(t._pasteTimer);const l=(e,l)=>{const n=e.row;if(n){let o=null;if(t.storeHistory&&(o=t._stringifyRow(n)),l!==(void 0!==e.value?e.value:"")&&(n.updatedDate=new Date,n.updatedBy=t.currentUser,t.storeHistory)){e.value=l;const i=t._stringifyRow(n);t._updateRowHistory(n,o,i)}}};t._pasteTimer=setTimeout((()=>{if(t._pasteTempValues&&t._pasteTempValues.length>1){let e=[],n=[],o=[];for(let l=0;l<t._pasteTempValues.length;l++){const i=t._pasteTempValues[l];e.push(i.cell),n.push(i.oldValue),o.push(i.newValue)}t.onCellUpdate(e,n,o,(function(n){if(n){const n=t.onRowHistory;t.onRowHistory=null,t.beginUpdate();for(let t=0;t<e.length;t++){const n=e[t];l(n,o[t]),n.value=o[t]}t.endUpdate(!1),t.onRowHistory=n}}),t)}else t.onCellUpdate([o],[e],[s],(function(e){if(e){const e=t.onRowHistory;t.onRowHistory=null,l(o,s),o.value=s,t.onRowHistory=e}}),t);delete t._pasteTempValues}),100)}else if(t.onRowUpdate){const e=Object.assign({},o.row.data),l=Object.assign({},o.row.data);l[o.column.dataField]=s,o.row.updatedDate=new Date,o.row.updatedBy=t.currentUser,t.onRowUpdate([o.row.index],[o.row],[e],[l],(function(e){e&&(o.value=s)}),t)}else t.formulas&&"string"==typeof s&&/=.+/.test(s)?o.formula=t._fromHTMLEntities(s):o.value=s}}_pasteModeFill(e){const t=this,l=t.dataSource&&"number"==typeof t.dataSource.dataSource,n=t._pasteDataType(e),o=e.cell,i=e.selectedValues,a=e.minRowIndex,r=e.minColumnIndex,s=e.currentRowIndex,d=e.currentColumnIndex,c=e.dataField;let u=e.value;if("string"===n)/\d+/.test(u.toString())?(u=t._getPatternValue(s-a,d-r,i),void 0===u&&i[s-a]&&i[s-a][d-r]&&(u=i[s-a][d-r])):(u=t._getPatternValue(s-a,d-r,i),void 0===u&&(u=i[s-a]?i[s-a][d-r]:e.value),void 0===u&&(u=e.value)),void 0!==u&&(o.value=u);else if("bool"===n||"boolean"===n)1!==u&&"1"!==u&&!0!==u&&"true"!==u&&"TRUE"!==u&&"True"!==u||(o.value=!0);else if("date"===n||"time"===n||"dateTime"===n){const e=t.columnByDataField[c];l?o.value=u:e&&e.dataType!==n&&(o.value=null),i[s-a]&&(u=i[s-a][d-r],void 0!==u&&(o.value=u))}else if("number"===n||"float"===n||"int"===n){u=t._getPatternValue(s-a,d-r,i);const e=t.columnByDataField[c];l?o.value=u:e&&e.dataType!==n?o.value=null:o.value=null!==u?"int"===n||"integer"===n?parseInt(u):parseFloat(u):null}}_pasteSelectedCells(e,t){const l=this;l.beginUpdate();let n=l._recyclingRows,o=e.row,i=e.endRow,a=e.column,r=e.endColumn;const s=n.indexOf(o),d=n.indexOf(i),c=n.indexOf(e.endRow),u=l.viewColumns,f=u.indexOf(a),g=u.indexOf(r),m=u.indexOf(e.endColumn),_=Math.min(c,Math.min(s,d));let p=Math.max(c,Math.max(s,d)),w=!1,h=Object.keys(t).length;p-_<h&&(p=_+h-1,w=!0);const y=Math.min(m,Math.min(f,g));let v=Math.max(m,Math.max(f,g));if(t[0]){const e=Object.keys(t[0]).length;v-y<e&&(v=v+e-1,w=!0)}let S=0,R=0,C=0,x=0;for(let e in t)0===S&&(R+=Object.keys(t[e]).length),S++;for(let e=_;e<=p;e++){const o=n[e];if(o){C=0;for(let n=y;n<=v;n++){if(!u[n])continue;const i=u[n].dataField,a=o.getCell(i);let r=0;for(let s in t){if(r===x){let r=0,d=t[s];for(let s in d){if(C===r){let r=d[s],c=!0;if(t[o.id]&&t[o.id][i]&&(c=!1),c&&"none"!==l.clipboard.autoFillMode){const o={value:r,targetValue:a.value,dataField:s,index:a.row.visibleIndex,targetDataField:i,targetRowIndex:e};if(l.clipboard.onPasteValue){l.clipboard.onPasteValue(o);const e=a.value;a.value=o.value,l._setCellUndoRedo(a,e,o.value)}else o.cell=a,o.selectedValues=t,o.minRowIndex=_,o.maxRowIndex=p,o.minColumnIndex=y,o.maxColumnIndex=v,o.currentColumnIndex=n,o.currentRowIndex=e,"copy"===l.clipboard.autoFillMode?l._pasteModeCopy(o):"fillSeries"===l.clipboard.autoFillMode&&l._pasteModeFill(o)}}r++}}r++}C++,C>=R&&(C=0)}x++,x>=S&&(x=0)}}l.endUpdate(!1),w&&l._selectCellsRange(n[_],n[p],l.viewColumns[y].dataField,l.viewColumns[v].dataField),l._recycle(!1),l._refreshDataFilters()}_refreshCellSelectionRect(){const e=this,t=e._selection.selectionRect;if(!t||t&&t.captured)return;let l=e._recyclingRows,n=t.row,o=t.endRow,i=t.column,a=t.endColumn;const r=e.viewColumns;if(!a||!i)return;if(e._isVirtualMode()){if(n.id!==t.rowId&&!e.rowById[t.rowId])return t.style.height="0px",void(t.style.width="0px");n=e.rowById[t.rowId],o=e.rowById[t.endRowId]}if(!i.allowSelect||!a.allowSelect){if(i===a)return t.style.width="0px",void(t.style.height="0px");{const e=r.indexOf(i),l=r.indexOf(a);i=null,a=null;for(let t=e;t<l;t++){const e=r[t];e.allowSelect&&!i&&(i=e),a=e}if(!i||!a)return t.style.width="0px",void(t.style.height="0px")}}const s=l.indexOf(n),d=l.indexOf(o),c=r.indexOf(i),u=r.indexOf(a);let f=Math.min(s,d),g=Math.max(s,d),m=Math.min(c,u),_=Math.max(c,u);m=Math.max(0,m),f=Math.max(0,f);const p=function(e){const t=l.indexOf(e.row),n=l.indexOf(e.endRow),o=r.indexOf(e.column),i=r.indexOf(e.endColumn);f=Math.min(f,t),f=Math.min(f,n),f=Math.max(0,f),g=Math.max(g,t),g=Math.max(g,n),m=Math.min(m,o),m=Math.min(m,i),m=Math.max(0,m),_=Math.max(_,o),_=Math.max(_,i)},w=e._getParentCell(n,i.dataField),h=e._getParentCell(n,a.dataField),y=e._getParentCell(o,a.dataField),v=e._getParentCell(o,i.dataField);w&&p(w),h&&p(h),y&&p(y),v&&p(v);let S=0,R=0,C=0,x=0;t.cellValues=[];let b=[],F=[];for(let n=f;n<=g;n++){const o=l[n];if(n===f&&(S=o.top,!0!==o.freeze&&"near"!==o.freeze&&(S+=e.__frozenNearHeight),"far"===o.freeze&&(S=o.top+e.__scrollHeight+e.scrollTop-e._scrollView.hScrollBar.offsetHeight)),n===g){let t=o.top;"far"===o.freeze&&(t=o.top+e.__scrollHeight+e.scrollTop-e._scrollView.hScrollBar.offsetHeight),R=t+o.height-S,!0!==o.freeze&&"near"!==o.freeze&&(R+=e.__frozenNearHeight)}t.cellValues[o.id]=[];const i=e._isUpdating;e._isUpdating=!0,t.style.zIndex="";for(let l=m;l<=_;l++){const n=r[l].dataField,i=o.getCell(n);let a=i.value;if(void 0===a&&(a=""),r[l].freeze?b.push(r[l]):F.push(r[l]),"tags"===r[l].template)if(null!=a)if("number"==typeof a)a=null;else{const t=a.trim().split(","),n=[];if(r[l].editor&&r[l].editor.dataSource){const o=r[l].editor.collaborator?e.users:r[l].editor.dataSource;for(let e=0;e<t.length;e++)for(let l=0;l<o.length;l++){const i=o[l];if(t[e]===i.value||t[e]===i.id){n.push(i.label||i.name);break}}}a=n.join(", ")}else a=null;else if("createdBy"===r[l].template||"updatedBy"===r[l].template){for(let t=0;t<e.users.length;t++)if(e.users[t].id===o[r[l].template]){a=e.users[t].label||e.users[t].name;break}}else"createdTime"===r[l].template||"createdDate"===r[l].template?(a=o.createdDate,a&&(a=new Smart.Utilities.DateTime(a).toString("d"))):"updatedTime"!==r[l].template&&"updatedDate"!==r[l].template||(a=o.updatedTime,!a)||(a=new Smart.Utilities.DateTime(a).toString("d"));if(i.formula&&(a=i.formula),t.cellValues[o.id][n]=a,l===m&&(C=i.column.left,i.column.freeze&&"far"===i.column.freeze&&(C=e.__clientSize.width-e.__frozenFarWidth+C+e.scrollLeft-e._scrollView.vScrollBar.offsetWidth)),l===_){let t=i.column.left;i.column.freeze&&"far"===i.column.freeze&&(t=e.__clientSize.width-e.__frozenFarWidth+t+e.scrollLeft-e._scrollView.vScrollBar.offsetWidth),x=t+i.column.computedWidth-C}i.selected=!0}e._isUpdating=i}if(S-e.scrollTop<e.layout.rowMinHeight&&e.filtering.enabled&&e.filtering.filterRow.visible){const t=S;S=e.layout.rowMinHeight+e.scrollTop,R-=S-t}if(R<=0)t.classList.add("smart-visibility-hidden");else{if(t.classList.remove("smart-visibility-hidden"),0===b.length&&(t.style.zIndex=5),t.style.top=S-e.scrollTop-1+"px",e._isVirtualMode()&&(t.style.top=S+parseFloat(e.$.rowContainer.style.top)-1+"px"),e.rightToLeft)t.style.right=C-e.scrollLeft+"px";else if(t.style.left=C-e.scrollLeft+"px",C-e.scrollLeft<e.__frozenNearWidth-1){let l=0;for(let t=0;t<e._frozenNearColumns.length;t++){const n=e._frozenNearColumns[t];n&&n.autoGenerated&&n.visible&&(l+=n.width)}if(C-e.scrollLeft<l){const n=l-C+e.scrollLeft;!F.length&&b.length&&(x+=n),x-=n,t.style.left=n+C-e.scrollLeft+"px"}}t.style.height=R+1+"px",t.style.width=x+1+"px",x<0?t.classList.add("smart-visibility-hidden"):t.classList.remove("smart-visibility-hidden")}}_renderInputOverlay(e,t,l){const n=this,o=n.rowById[e];if(o&&!1!==o.allowSelect&&!o.label&&t&&n.selection.checkBoxes.enabled){n._inputOverlay&&n._inputOverlay.classList.contains("smart-input-overlay-column")&&(n._inputOverlay.parentNode&&n._inputOverlay.parentNode.removeChild(n._inputOverlay),n._inputOverlay=null),n._inputOverlay||(n._inputOverlay=document.createElement("div"),n.$.scrollView.appendChild(n._inputOverlay),n._inputOverlay.classList.add("smart-input-overlay"));let e=o.freeze?o.top:n.__frozenNearHeight+o.top;const t=Math.round((o.cellHeight-n._selectionColumn.computedWidth)/2),i=n._selectionColumn.element.parentElement.offsetLeft+n._selectionColumn.element.offsetLeft;if(n._inputOverlay.style.left=i+"px",n._inputOverlay.style.height=n._selectionColumn.computedWidth+"px",n._inputOverlay.style.width=n._selectionColumn.computedWidth+"px",n._inputOverlay.style.top=e+t-n.scrollTop+"px",o&&o.element){const e=o.element.querySelector("smart-grid-cell");e&&(n._inputOverlay.cell=e.cell)}n._inputOverlay.row=o,n._inputOverlay.onpointerdown=function(e){n._inputOverlay||(n._inputOverlay.onpointerdown=null);const t=n._inputOverlay.row,l=n._inputOverlay.cell;n.beginUpdate(),t.selected=!t.selected,n.endUpdate(!1),n.$.fireEvent("change",{started:!1,finished:!0}),n._refreshSummary(!1);const o=e.originalEvent?e.originalEvent:e,i=3===o.which;n.$.fireEvent("rowClick",{row:t,id:t.id,isRightClick:i,originalEvent:o,pageX:parseInt(o.pageX),pageY:parseInt(o.pageY)}),l&&n.$.fireEvent("cellClick",{cell:l,id:t.id,dataField:l.column.dataField,isRightClick:i,originalEvent:o,pageX:parseInt(o.pageX),pageY:parseInt(o.pageY)}),n._recycle(),n._renderInputOverlay(t.id,e,!0),e.preventDefault()},n.appearance.allowCheckBoxesSelectionAnimation&&void 0===l&&n._inputOverlay.classList.add("smart-animate"),requestAnimationFrame((()=>{n._inputOverlay&&n._inputOverlay.classList.add("smart-input-overlay-on")}))}}_selectRow(e,t){const l=this,n=l.rowById[e];if(n&&l.selection.enabled&&(!n.header||"row-resize"!==n.header.style.cursor)){if(t&&(!t.shiftKey||!l._selection.focusedCell)){const t=n.getCell(l.columns[0].dataField);l._selection.focusedCell={index:t.row.index,id:e,dataField:t.column.dataField,value:t.value}}l._lastRowsSelectionRange=null,"extended"===l.selection.mode?l._handleExtendedRowSelection(n,t):"one"===l.selection.mode?n.select():n.selected?n.unselect():n.select()}}_getParentCell(e,t){const l=this;let n=l._recyclingRows;for(let o=0;o<l._cellsMerge.length;o++){const i=l._cellsMerge[o];let a=[],r=[];if(a.push(i.row),i.rowSpan>1){const e=n.indexOf(i.row);if(e>=0)for(let t=e;t<e+i.rowSpan;t++)n[t]&&-1===a.indexOf(n[t])&&a.push(n[t])}if(r.push(i.column.dataField),i.colSpan>1){const e=l.viewColumns,t=e.indexOf(l.columnByDataField[i.column.dataField]);for(let l=t;l<t+i.colSpan;l++)e[l]&&-1===r.indexOf(e[l].dataField)&&r.push(e[l].dataField)}if(a.indexOf(e)>=0&&r.indexOf(t)>=0)return{row:i.row,column:i.column,endRow:a[a.length-1],endColumn:l.columnByDataField[r[r.length-1]]}}if(l._cellRowSpan)for(let o=0;o<l._cellRowSpan.length;o++){const o=e.visibleIndex;let i=-1,a=null;for(let e=0;e<l._cellRowSpan.length;e++){const t=l._cellRowSpan[e];if(o>t[0]&&o<t[1]){i=t[0],a=t[2];break}}if(i>=0&&a===t){const e=n[i];if(e)return{row:e,column:l.columnByDataField[t],endRow:e,endColumn:l.columnByDataField[t]}}}return null}_selectCellsRange(e,t,l,n){const o=this,i=o._selection.selectionRect;if(o._lastRowsSelectionRange&&o._lastRowsSelectionRange.id===e.id&&o._lastRowsSelectionRange.endId===t.id&&o._lastColumnSelectionRange&&o._lastColumnSelectionRange.dataField===l&&o._lastColumnSelectionRange.endDataField===n)return;o.beginUpdate(),o._clearSelection(),o._lastRowsSelectionRange={id:e.id,endId:t.id},o._lastColumnSelectionRange={dataField:l,endDataField:n},(!i||i&&!i.captured)&&o._selection.focusedCell&&o._renderCellSelectionRect(o.rowById[o._selection.focusedCell.id],o.columnByDataField[o._selection.focusedCell.dataField],o.rowById[o._lastRowsSelectionRange.endId],o.columnByDataField[o._lastColumnSelectionRange.endDataField]);let a=o._recyclingRows;const r=o.viewColumns;let s=-1,d=-1,c=a.indexOf(e),u=a.indexOf(t),f=-1;for(let e=0;e<r.length;e++){const t=r[e];t.allowSelect&&(-1===f&&(f=e),t.dataField===l&&(s=e),t.dataField===n&&(d=e))}if(-1===f)return o.endUpdate(!1),void o._recycle();-1===s?s=f:-1===d&&(d=f);let g=Math.min(c,u),m=Math.max(c,u),_=Math.min(s,d),p=Math.max(s,d);const w=function(e){const t=a.indexOf(e.row),l=a.indexOf(e.endRow),n=r.indexOf(e.column),o=r.indexOf(e.endColumn);g=Math.min(g,t),g=Math.min(g,l),m=Math.max(m,t),m=Math.max(m,l),_=Math.min(_,n),_=Math.min(_,o),p=Math.max(p,n),p=Math.max(p,o)},h=o._getParentCell(e,l),y=o._getParentCell(t,n);if(h&&w(h),y&&w(y),m<0||g<0||_<0||p<0)return o.endUpdate(!1),void o._recycle();for(let e=g;e<=m;e++){const t=a[e];if(t.allowSelect)for(let e=0;e<r.length;e++){const l=r[e];l.allowSelect&&e>=_&&e<=p&&(t.getCell(l.dataField).selected=!0)}}o.endUpdate(!1,!1),o._recycle(!0,!0,!1),o._selectionTimer&&clearTimeout(o._selectionTimer),o._selectionTimer=setTimeout((()=>{o._recycle(!0,!0,!1)}),50)}_selectRowsRange(e,t,l){const n=this;if(n._lastRowsSelectionRange&&n._lastRowsSelectionRange.id===e.id&&n._lastRowsSelectionRange.endId===t.id)return;if(n._dragDrop&&n._dragDrop.dragDetails)return;n.beginUpdate(),n._clearSelection(),n._lastRowsSelectionRange={id:e.id,endId:t.id};let o=n._recyclingRows;const i=o.indexOf(e),a=o.indexOf(t),r=Math.min(i,a),s=Math.max(i,a);if(s<0)return n.endUpdate(!1),void n._recycle();for(let e=r;e<=s;e++){const t=o[e];t&&t.allowSelect&&(t.selected=!1!==l)}n.endUpdate(!1),n._recycle()}_selectColumnsRange(e,t){const l=this;if(l._lastColumnSelectionRange&&l._lastColumnSelectionRange.dataField===e&&l._lastColumnSelectionRange.endDataField===t)return;if(l._dragDrop&&l._dragDrop.dragDetails)return;l.beginUpdate(),l._clearSelection(),l._lastColumnSelectionRange={dataField:e,endDataField:t};const n=l.viewColumns;let o=-1,i=n.length;for(let l=0;l<n.length;l++){const a=n[l];a.allowSelect&&(a.dataField===e&&(o=l),a.dataField===t&&(i=l))}const a=Math.min(o,i),r=Math.max(o,i);for(let e=0;e<n.length;e++){const t=n[e];t.allowSelect&&e>=a&&e<=r&&(t.selected=!0)}l.endUpdate(!1),l._recycle()}_selectColumn(e,t){const l=this,n=l.columnByDataField[e],o=l.viewColumns;if(!n||!l.selection.enabled||!1===n.allowSelect||!l.selection.allowColumnHeaderSelection)return;if(n&&"col-resize"===n.element.style.cursor)return;let i=!1;if(n&&(n.allowSelect||null===n.allowSelect&&!t)&&(i=!0),i&&t)if("extended"===l.selection.mode){if(t.ctrlKey||t.metaKey||t.shiftKey||(l._rangeSelectionStartColumn=n,l._rangeSelectionEndColumn=n),t.ctrlKey||t.metaKey?n.selected=!n.selected:n.selected=!0,t&&t.shiftKey){l._rangeSelectionStartColumn||(l._rangeSelectionStartColumn=n),l._rangeSelectionEndColumn=n,l._selection.columns=[];const e=o.indexOf(l._rangeSelectionStartColumn),t=o.indexOf(l._rangeSelectionEndColumn),i=Math.min(e,t),a=Math.max(e,t);for(let e=i;e<=a;e++){const t=o[e];t&&!1!==t.allowSelect&&(t.selected=!0)}}}else"one"===l.selection.mode||null===n.selected?n.selected=!0:n.selected=!n.selected}selectAllRows(){const e=this;let t=e.rows;e._selectionColumn._selecting=!0,e.beginUpdate();for(let e=0;e<t.length;e++)t[e].selected=!0;e._selectionColumn._selecting=!1,e.endUpdate(!1),e._refreshSummary(!1),e._recycle(!1),e._refreshCheckBoxColumnSelection(),e.$.fireEvent("change",{started:!1,finished:!0})}hasSelectedRows(){const e=this.getVisibleRows(),t=this._getSelectedRows(!0,!1);return t.length===e.length||t.length>0&&t.length<e.length||0!==t.length&&0!==e.length&&void 0}areAllRowsSelected(){const e=this.getVisibleRows(),t=this._getSelectedRows(!0,!1);return t.length>0&&t.length===e.length}_getSelectedRows(e,t){const l=this,n=[];let o=l.rows;if(l.rows.canNotify=!1,e&&(o=l.getVisibleRows()),l._isVirtualMode()){let e=l._selection.indexes;return l.paging.enabled&&t&&l._isVirtualMode()&&(e=e.slice(0,l.paging.pageSize)),l.rows.canNotify=!0,Object.keys(e).length}l.paging.enabled&&t&&(o=l._isVirtualMode()?o.slice(0,l.paging.pageSize):o.slice(l.paging.pageIndex*l.paging.pageSize,(l.paging.pageIndex+1)*l.paging.pageSize));for(let e=0;e<o.length;e++){const t=o[e];t.getProperty("selected")?n.push(t):(t.canNotify=!1,t.selected=!1,t.canNotify=!0)}return l.rows.canNotify=!0,n}_dragSelectionEnd(e){const t=this;t._dragSelectionStartDataField=null,t._dragSelectionStartRow=null,t.__selectionStarted&&(t.$.fireEvent("change",{started:!1,finished:!0,originalEvent:e}),t._refreshSummary(),delete t.__selectionStarted,delete t.__selectionStartedFired),t.selection.allowDragSelection&&t.selection.isDragging&&(t.selection.isDragging=!1,t._autoScrollSelectionDragInterval&&(clearInterval(t._autoScrollSelectionDragInterval),t.editing.isEditing||t._recycle()))}_dragSelection(e){const t=this;if("extended"!==t.selection.mode||!1===t.selection.allowDragSelection)return;if(!t._dragSelectionStartDataField&&!t._dragSelectionStartRow)return;const l=()=>{t.__selectionStarted&&!t.__selectionStartedFired&&(t.$.fireEvent("change",{started:!0,finished:!1,originalEvent:e}),t.__selectionStartedFired=!0),t.$.fireEvent("change",{started:!1,finished:!1,originalEvent:e})};if(!t.selection.allowCellSelection||!t._dragSelectionStartDataField||t._columnResizeLine||t._dragSelectionStartDataField.startsWith("_")||!t._dragSelectionStartRow||t._rowResizeLine){if(t._dragSelectionStartRow&&!t._rowResizeLine&&(t.selection.allowRowSelection&&!t._dragSelectionStartDataField.startsWith("_")||t.selection.allowRowHeaderSelection&&t._dragSelectionStartDataField.startsWith("_"))){const n=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let o=null;for(let e=0;e<n.length;e++){const t=n[e];if(t.getAttribute("data-id")){o=t.row,!o&&t.cell&&(o=t.cell.row);break}}let i=!0;t._lastRowsSelectionRange&&t._lastRowsSelectionRange.id===t._dragSelectionStartRow.id&&o&&t._lastRowsSelectionRange.endId===o.id&&(i=!1),o&&!o.allowSelect&&(i=!1),o&&o.allowSelect&&t._selectRowsRange(t._dragSelectionStartRow,o),t._autoScrollSelectionDragInterval&&clearInterval(t._autoScrollSelectionDragInterval),t.selection.isDragging=!0,i&&l(),t._autoScrollSelectionDragInterval=setInterval((function(){const l=t.$.scrollView.getBoundingClientRect();e.clientY<=l.top+20?t.scrollTop-=15:e.clientY>=l.top+l.height-20&&(t.scrollTop+=15)}),25)}else if(t._dragSelectionStartDataField&&!t._columnResizeLine&&!t._dragSelectionStartDataField.startsWith("_")&&t.selection.allowColumnHeaderSelection){const n=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let o=null;for(let e=0;e<n.length;e++){const t=n[e];if(t.getAttribute("data-field")){o=t.getAttribute("data-field");break}}o&&t._selectColumnsRange(t._dragSelectionStartDataField,o),t._autoScrollSelectionDragInterval&&clearInterval(t._autoScrollSelectionDragInterval);let i=!0;t._lastColumnSelectionRange&&t._lastColumnSelectionRange.dataField===t._dragSelectionStartDataField&&t._lastColumnSelectionRange.endDataField===o&&(i=!1),i&&l(),t.selection.isDragging=!0,t._autoScrollSelectionDragInterval=setInterval((function(){const l=t.$.scrollView.getBoundingClientRect();e.clientX<=l.left+20?t.scrollLeft-=15:e.clientX>=l.left+l.width-20&&(t.scrollLeft+=15)}),25)}}else{const n=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let o=null;for(let e=0;e<n.length;e++){const t=n[e];if(t.getAttribute("data-field")){o=t.getAttribute("data-field");break}}let i=null;for(let e=0;e<n.length;e++){const t=n[e];if(t.getAttribute("data-id")){i=t.row;break}}if(!i&&n.length&&n[0].classList.contains("smart-grid-scroll-view")){i=t._recyclingRows[t._recyclingRows.length-1];const l=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,i.element.getBoundingClientRect().top);for(let e=0;e<l.length;e++){const t=l[e];if(t.getAttribute("data-field")){o=t.getAttribute("data-field");break}}}if(o&&i){if(i.id===t._dragSelectionStartRow.id&&t._dragSelectionStartDataField===o)return;if(o&&o.startsWith("_"))return;let e=!0;t._lastRowsSelectionRange&&t._lastRowsSelectionRange.id===t._dragSelectionStartRow.id&&t._lastRowsSelectionRange.endId===i.id&&t._lastColumnSelectionRange&&t._lastColumnSelectionRange.dataField===t._dragSelectionStartDataField&&t._lastColumnSelectionRange.endDataField===o&&(e=!1),t._selectCellsRange(t._dragSelectionStartRow,i,t._dragSelectionStartDataField,o),t._removeCellContentPopup(),e&&l()}t.selection.allowDragSelectionAutoScroll&&(t._autoScrollSelectionDragInterval&&clearInterval(t._autoScrollSelectionDragInterval),t.selection.isDragging=!0,t._autoScrollSelectionDragInterval=setInterval((function(){const l=t.$.scrollView.getBoundingClientRect();e.clientX<=l.left+20?t.scrollLeft-=15:e.clientX>=l.left+l.width-20&&(t.scrollLeft+=15),e.clientY<=l.top+20?t.scrollTop-=15:e.clientY>=l.top+l.height-20&&(t.scrollTop+=15)}),25))}}select(e,t){const l=this;l.isInitialized&&(!t&&void 0!==e&&l._selection&&l._selection.rows[e]||(l._setSelection(e,t),l.$.fireEvent("change",{started:!1,finished:!0}),l._refreshSummary()))}selectRowsByIndex(e){const t=this;e||(e=[]),requestAnimationFrame((()=>{if("extended"!==t.selection.mode&&"many"!==t.selection.mode&&t._clearSelection(),t._isVirtualMode()){let l=[];for(let t=0;t<e.length;t++)l[e[t]]=!0;return t._selection.indexes=l,void t._recycle()}t.beginUpdate();for(let l in e){const e=t.rows[l];e&&t._setSelection(e.id)}t.endUpdate(!1),t._recycle()}))}selectRowsRange(e,t){const l=this,n=l.rowById[e],o=l.rowById[t];n&&o&&(l._selectRowsRange(n,o),l.$.fireEvent("change",{started:!1,finished:!0}),l._refreshSummary())}selectCellsByQuery(e){const t=this,l=t.findCells(e);requestAnimationFrame((()=>{"extended"!==t.selection.mode&&"many"!==t.selection.mode&&t._clearSelection(),t.beginUpdate();for(let e in l){const n=l[e][0],o=l[e][1];t._setSelection(n,o)}t.endUpdate(!1),t._recycle()}))}selectRowsByQuery(e,t,l){const n=this,o=n.find(e,t,l).map((e=>e.$.id));o.length&&n.selectRows(o)}selectRows(e){const t=this;e||(e=[]),requestAnimationFrame((()=>{"extended"!==t.selection.mode&&"many"!==t.selection.mode&&t._clearSelection(),t.beginUpdate();for(let l in e)t._setSelection(e[l]);t.endUpdate(!1),t._recycle()}))}selectCells(e,t){const l=this;e||(e=[]),requestAnimationFrame((()=>{"extended"!==l.selection.mode&&"many"!==l.selection.mode&&l._clearSelection(),l.beginUpdate();for(let n in e)for(let o=0;o<t.length;o++)l._setSelection(e[n],t[o]);l.endUpdate(!1),l._recycle()}))}selectRange(e,t,l,n){const o=this;!function(){const i=new KeyboardEvent("keydown",{shiftKey:!0});requestAnimationFrame((()=>{"extended"!==o.selection.mode&&"many"!==o.selection.mode&&o._clearSelection(),o.beginUpdate(),o._setSelection(e,t),o._setSelection(l,n,i),o.ensureVisible(e,t),o.endUpdate(!1),o._refreshSummary(!1),o._recycle()}))}(),o.$.fireEvent("change",{started:!1,finished:!0})}unselect(e,t){const l=this;if(l._selection){if(l._selection.rows&&l._selection.rows[e]){delete l._selection.rows[e];const t=l.rowById[e];t&&t.unselect()}l._selection.columns&&l._selection.columns[t]&&delete l._selection.columns[t],l._selection.cells&&(l._selection.cells["row"+e]&&(delete l._selection.cells["row"+e][t],1===Object.getOwnPropertyNames(l._selection.cells["row"+e]).length&&delete l._selection.cells["row"+e]),l._selection.cells["column"+t]&&(delete l._selection.cells["column"+t][e],1===Object.getOwnPropertyNames(l._selection.cells["column"+t]).length&&delete l._selection.cells["column"+t])),l.$.fireEvent("change",{started:!1,finished:!0}),l._refreshSummary()}}getSelectedRows(){const e=this;let t=[];if(e._selection.rows&&Object.keys(e._selection.rows).length>0){const l=Object.keys(e._selection.rows);if(e._isVirtualMode()){for(let e in l){const n=l[e];t.push([n,{}])}return t}for(let n in l){const o=l[n],i=e.rowById[o];if(!i)continue;const a={};for(let e in i.data)switch(e){case"$":case"parent":case"level":case"leaf":case"children":continue;default:a[e]=i.data[e]}t.push([i.id,a])}}return t}getSelectedRowIndexes(){const e=this;return e._selection.indexes&&Object.keys(e._selection.indexes).length>0?e._selection.indexes:[]}getSelectedRowIds(){const e=this;let t=[];if(e._isVirtualMode())return e._selection.rows&&Object.keys(e._selection.rows).length>0?e._selection.rows:void 0;if(e._selection.rows&&Object.keys(e._selection.rows).length>0){const l=Object.keys(e._selection.rows);for(let n in l){const o=l[n],i=e.rowById[o];i&&t.push(i.id)}}return t}getSelectedCells(e){const t=this;let l=[];if(t._selection.cells)for(let n in t._selection.cells)if(n.startsWith("row")){let o=n.replace("row",""),i=null;for(let a in t._selection.cells[n])if(i=a.replace("column",""),l||(l=[]),!1===e)l.push([o,i]);else{const e=t.getCellValue(o,i);l.push([o,i,e])}}return l}getSelection(){const e=this;let t=null,l=null,n=null,o=null;if(e._selection.rows&&Object.keys(e._selection.rows).length>0){const l=Object.keys(e._selection.rows);t=[];for(let n=0;n<l.length;n++){const o=l[n];t.push({id:o,row:e.rowById[o]})}}if(e._selection.columns&&Object.keys(e._selection.columns).length>0){const t=Object.keys(e._selection.columns);l=[];for(let n=0;n<t.length;n++){const o=t[n];l.push({dataField:o,column:e.columnByDataField[o]})}}if(e._selection.cells)for(let t in e._selection.cells)if(t.startsWith("row")){let l=t.replace("row",""),o=null;for(let i in e._selection.cells[t])o=i.replace("column",""),n||(n=[]),n.push({id:l,dataField:o,column:e.columnByDataField[o],row:e.rowById[l]})}return e._selection.focusedCell&&(e._isVirtualMode(),o={index:e._selection.focusedCell.index,id:e._selection.focusedCell.id,dataField:e._selection.focusedCell.dataField}),{rows:t,columns:l,cells:n,focused:o}}focusAndSelect(e,t){const l=this;if(l.focus(),l.selection.enabled&&l.selection.allowCellSelection)l._focusCell(e,t);else{const t=l.rowById[e];if(!t)return;l.beginUpdate(),l._selection.rows=[],l._selection.columns=[],l._selection.cells=[],l._selection.indexes=[],l._setSelection(e),l._selection.focusedCell={id:t.id,value:null,index:t.index,dataField:l.columns[0].dataField},l.endUpdate(!1)}}_focusCell(e,t){const l=this;if(l.selection.enabled&&l.selection.allowCellSelection){const n=l.rowById[e];if(!n)return;l.beginUpdate(),l._selection.rows=[],l._selection.columns=[],l._selection.cells=[],l._selection.indexes=[],l._setSelection(e,t);const o=n.getCell(t);o&&(l._selection.focusedCell={id:o.row.id,value:o.value,dataField:t,index:o.row.index}),l.endUpdate(!1)}}_clearSelection(e){const t=this;if(t._selection.rows=[],t._selection.columns=[],t._selection.cells=[],t._selection.indexes=[],e&&(t._selection.focusedCell=null,t._selection.selectionRect)){const e=t._selection.selectionRect;e.parentNode.removeChild(e);const l={down:"pointerdown",move:"pointermove",up:"pointerup"};Smart.Utilities.Core.isMobile&&(l.down="touchstart",l.move="touchmove",l.up="touchend"),document.removeEventListener(l.move,e.onMove),document.removeEventListener(l.up,e.onUp),document.removeEventListener(l.down,e.onDown),t._selection.selectionRect=null}t._recycle(),t._refreshCheckBoxColumnSelection()}_getSelectionCellValues(){const e=this;if(e._selection.selectionRect)return e._selection.selectionRect.cellValues;const t=e.viewColumns;if(e._selection.rows.length>0){let l=[];for(let n in e._selection.rows){const o=e.rowById[n];for(let e=0;e<t.length;e++){const i=t[e];i&&(l[n]||(l[n]=[]),i.autoGenerated||(l[n][i.dataField]=o.data[i.dataField]))}}return l}if(e._selection.columns.length>0){let t=[];for(let l in e._selection.columns){const n=e.columnByDataField[l];if(n)for(let l=0;l<e._recyclingRows.length;l++){const o=e._recyclingRows[l];o&&(t[o.id]||(t[o.id]=[]),t[o.id][n.dataField]=o.data[n.dataField])}}return t}if(e._selection.cells&&Object.keys(e._selection.cells).length>0){const t=e.getSelection();if(t.cells){let e=[];for(let l in t.cells){const n=t.cells[l],o=n.id;e[o]||(e[o]=[]),e[o][n.column.dataField]=n.row.data[n.column.dataField]}return e}}}_clipboardHandler(e,t){const l=this;if(l.clipboard.enabled){if((t.ctrlKey||t.metaKey)&&("c"===e||"x"===e)){const t=l._getSelectionCellValues();let n="",o=Object.keys(t).length,i=0;for(let a in t){let r="",s=Object.keys(t[a]).length,d=0;for(let e in t[a])r+=t[a][e],d++,d<s&&(r+="\t");if(n+=r,i++,i<o&&(n+="\r\n"),"x"===e&&l.editing.enabled){const e=l.getSelection();if(e.cells){l.beginUpdate();for(let t=0;t<e.cells.length;t++){const n=e.cells[t],o=l.rowById[n.id];if(o){const e=o.getCell(n.dataField),t=l._pasteDataType({cell:e,value:e.value});let i=null;"int"!==t&&"number"!==t||(i=0),"string"===t&&(i=""),"boolean"!==t&&"bool"!==t||(i=!1),"date"===t&&(i=new Date),e.column.allowNull&&(i=null);const a=e.oldValue;if(l.onCellUpdate)l.onCellUpdate([e],[a],[i],(function(t){t&&(e.value=i)}),l);else if(l.onRowUpdate){const t=Object.assign({},e.row.data),n=Object.assign({},e.row.data);n[e.column.dataField]=i,l.onRowUpdate([e.row.index],[e.row],[t],[n],(function(t){t&&(e.value=i)}),l)}else e.value=i}}l.endUpdate(!1),l._recycle()}}}if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(n).then((function(){}),(function(){})),Smart.Utilities.Core.Browser.Firefox&&(l._clipboardText=n);else{const e=document.createElement("textarea");e.value=n,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select(),setTimeout((()=>{document.execCommand("copy"),e.remove(),l._clipboardText=n}),25)}}if(t.shiftKey&&" "===e&&l.editing.addNewRow.visible&&(l._keyboardAdd=!0,l._addNewGridRow(),l._keyboardAddTimer&&clearTimeout(l._keyboardAddTimer),l._keyboardAddTimer=setTimeout((()=>{l._keyboardAdd=!1}),300)),(t.ctrlKey||t.metaKey)&&"v"===e&&l.editing.enabled){const e=window.Smart.Utilities.Core.Browser.Firefox;if(navigator.clipboard&&!navigator.clipboard.readText&&!e)return;const t=e=>{if(!e)return;const t=[],n=e.trim().split("\r");for(let e=0;e<n.length;e++){const l=n[e].split("\t");let o={};for(let e=0;e<l.length;e++)o[e]=l[e].trim(),void 0!==o[e]&&"undefined"!==o[e]||(o[e]="");t[e]=o}const o=l._selection.selectionRect;if(o)l._pasteSelectedCells({row:o.row,endRow:o.endDragRow,column:o.column,endColumn:o.endColumn},t);else{let e=null,n=null;for(let t in l._selection.rows){const o=l.rowById[t];e||(e=o),n||(n=o),e.visibleIndex>o.visibleIndex&&(e=o),n.visibleIndex<o.visibleIndex&&(n=o)}if(e&&n&&l._pasteSelectedCells({row:e,endRow:n,column:l.firstColumn(),endColumn:l.lastColumn()},t),0===l._selection.rows.length){const o=l.getSelectedCells();let i=null,a=null;for(let t=0;t<o.length;t++){const r=l.rowById[o[t][0]];if(!r)continue;e||(e=r),n||(n=r);const s=l.columnByDataField[o[t][1]];i||(i=a=s),i&&i.visibleIndex>s.visibleIndex&&(i=s),a&&a.visibleIndex<s.visibleIndex&&(a=s),e.visibleIndex>r.visibleIndex&&(e=r),n.visibleIndex<r.visibleIndex&&(n=r)}l._pasteSelectedCells({row:e,endRow:n,column:i,endColumn:a},t)}}};if(!window.isSecureContext||e){if(document.activeElement&&"INPUT"===document.activeElement.nodeName)return!0;const e=document.createElement("textarea");return e.style.position="absolute",e.style.left="-1000px",e.style.top="-1000px",document.body.appendChild(e),e.select(),void setTimeout((()=>{l._clipboardSelection=new Array;let n=e.value;0===n.length&&window.clipboardData&&(e.val(window.clipboardData.getData("Text")),n=e.value);let o=n.split("\n");for(let e=0;e<o.length;e++)if(o[e].split("\t").length>0){var i=o[e].split("\t");if(1===i.length&&e===o.length-1&&""===i[0])continue;i.length>0&&l._clipboardSelection.push(i)}l._clipboardText=l._clipboardSelection.toString(),t(n.trim().replaceAll("\n","\r")),e.remove(),l.focus()}),100)}navigator.clipboard.readText().then((e=>{t(e)}))}}}_setRemoveUndoRedo(e){const t=this;if(!t.isInitialized)return;const l=Smart.Utilities.Core.createGUID().replace(/-/gi,"");if(!t._undoRedoAction){t._removeUndoRedoHigherIndexes();const n=t.getRowData(e.id);t._undoRedo.push({action:"remove",data:n,index:e.visibleIndex,uid:l}),t._undoRedoIndex=t._undoRedo.length-1}}_setAddUndoRedo(e){const t=this;if(!t.isInitialized)return;const l=Smart.Utilities.Core.createGUID().replace(/-/gi,"");if(!t._undoRedoAction){let n=!1;for(let l=0;l<t._undoRedo.length;l++){const o=t._undoRedo[l];"add"===o.action&&o.index===e.index&&(n=!0)}if(n)return;t._removeUndoRedoHigherIndexes();const o=t.getRowData(e.id);t._undoRedo.push({action:"add",data:o,index:e.visibleIndex,uid:l}),t._undoRedoIndex=t._undoRedo.length-1}}_removeUndoRedoHigherIndexes(){const e=this,t=e._undoRedoIndex;t>=0?e._undoRedo.splice(t+1,e._undoRedo.length-t):-1===t&&(e._undoRedo=[])}_setCellUndoRedo(e,t,l){const n=this;if(!n.isInitialized)return;const o=Smart.Utilities.Core.createGUID().replace(/-/gi,"");n._setCellUndoRedoTimer&&clearTimeout(n._setCellUndoRedoTimer),n._undoRedoAction||(n._pasteUndoRedoValues||(n._pasteUndoRedoValues=[]),void 0===t&&(t=null),n._pasteUndoRedoValues.push({cell:e,index:e.row.index,dataField:e.column.dataField,oldValue:t,newValue:l}),n._setCellUndoRedoTimer=setTimeout((()=>{delete n._setCellUndoRedoTimer,n._removeUndoRedoHigherIndexes(),n._undoRedo||(n._undoRedo=[]),n._pasteUndoRedoValues.length>1?n._undoRedo.push({action:"updateMultiple",items:n._pasteUndoRedoValues,uid:o}):n._undoRedo.push({action:"update",index:e.row.visibleIndex,cell:e,dataField:e.column.dataField,oldValue:t,newValue:l,uid:o}),n._undoRedoIndex=n._undoRedo.length-1,n._pasteUndoRedoValues=[]}),50))}_undoRedoHandler(e){const t=this,l=e.key;if(e.ctrlKey||e.metaKey){if("z"===l)return t.undo(),void e.preventDefault();if("y"===l)return t.redo(),void e.preventDefault()}}_updateMultiple(e,t){const l=this;let n=9999999,o=0,i=999999,a=0,r=l._recyclingRows,s=[],d=[],c=[];l.beginUpdate();for(let u=0;u<e.items.length;u++){const f=e.items[u],g=r[f.index];if(g){const e=g.id,r=f.dataField,u=t?f.oldValue:f.newValue,m=l.columnByDataField[r],_=l.viewColumns.indexOf(m),p=g.getCell(r);p&&(s.push(p),d.push(p.value),c.push(u)),i=Math.min(i,_),a=Math.max(a,_),n=Math.min(n,g.visibleIndex),o=Math.max(o,g.visibleIndex),l.setCellValue(e,r,u)}}l.onCellUpdate&&s.length&&l.onCellUpdate(s,d,c,(function(){}),l),l._focusCell(r[n].id,l.viewColumns[i].dataField),l._selectCellsRange(r[n],r[o],l.viewColumns[i].dataField,l.viewColumns[a].dataField),delete l._undoRedoAction,l.endUpdate(!1)}redo(){const e=this,t=e._undoRedoIndex,l=e._undoRedo[t+1];if(l)switch(e._undoRedoIndex++,e._undoRedoAction=!0,l.action){case"add":e.addRow(l.data,!0);break;case"remove":{const t=e._recyclingRows[l.index];t&&(e.removeRow(t.id),delete e._undoRedoAction);break}case"update":{const t=e.rows[l.index];if(t){const n=t.id,o=l.dataField,i=l.newValue,a=l.oldValue,r=t.getCell(o);r&&(e.setCellValue(n,o,i),e._focusCell(n,o),e.onCellUpdate&&e.onCellUpdate([r],[a],[i],(function(){e.onCellUpdated&&e.onCellUpdated([r.row.index],[r.row],[r.column],[r.row.data],[a],[i],e),e._onCellUpdated&&e._onCellUpdated(r.row.index,r.row,r.column,r.row.data,a,i)}),e))}delete e._undoRedoAction;break}case"updateMultiple":e._updateMultiple(l,!1)}else delete e._undoRedoAction}undo(){const e=this,t=e._undoRedoIndex,l=e._undoRedo[t];if(l)switch(e._undoRedoIndex--,e._undoRedoAction=!0,l.action){case"add":{const t=e._recyclingRows[l.index];t&&(e.removeRow(t.id),delete e._undoRedoAction);break}case"remove":{const t=l.data;t&&(e._recyclingRows[l.index]?e.insertRow(t,l.index):e.addRow(t,!0));break}case"update":{const t=e.rows[l.index];if(t){const n=t.id,o=l.dataField,i=l.oldValue;let a=e._cellsUpdatedValues?e._cellsUpdatedValues[n+"_"+o]:void 0;void 0!==a&&delete e._cellsUpdatedValues[n+"_"+o];const r=t.getCell(o);r&&(void 0===a&&(a=r.value),e.setCellValue(n,o,i),e._focusCell(n,o),e.onCellUpdate&&e.onCellUpdate([r],[a],[i],(function(){e.onCellUpdated&&e.onCellUpdated([r.row.index],[r.row],[r.column],[r.row.data],[a],[i],e),e._onCellUpdated&&e._onCellUpdated(r.row.index,r.row,r.column,r.row.data,a,i)}),e))}delete e._undoRedoAction;break}case"updateMultiple":e._updateMultiple(l,!0)}else e._currentUndoRedo=e._undoRedo[0],delete e._undoRedoAction}_keyDownHandler(e){const t=this;if("grid"!==t.view)return;if(t.onKey&&(t.onKey(e),e.defaultPrevented))return;let l=e.key;if(t.disabled||t.displayLoadingIndicator)return;if(t._undoRedoHandler(e),0===t.dataSource.length)return;if("CapsLock"===l)return;if("Escape"===l&&(t.editing.editRow||t.editing.editCell)){t.closeMenu(),t.cancelEdit();let l=t.getSelection().focused;return void(l&&l.dataField&&t._setSelection(l.id,l.dataField,e))}if(t.editing.editRow||t.editing.editCell||t.filtering.filterRow.cell)return;t.rightToLeft&&("ArrowLeft"===l?l="ArrowRight":"ArrowRight"===l&&(l="ArrowLeft")),t._refreshCellSelectionRect();const n=t.getSelection();let o=n.focused;if(!n.focused){if(t.editing.enabled&&!0!==t.editing.isEditing&&("F2"===l||"Enter"===l)&&n.columns&&n.columns.length>0){const e=n.columns[n.columns.length-1];e.column.allowHeaderEdit&&t._beginColumnEdit(e.column)}return void(t.menu&&t.menu.classList.contains("open")&&"Escape"===l&&t.closeMenu())}if(e.shiftKey&&e.ctrlKey&&" "===l){const e=t.rowById[o.id];if(e){const t=e.getCell(o.dataField);if(t)return void t.autoWrap()}}const i=t._getParentCell(t.rowById[o.id],o.dataField);if(i&&("ArrowLeft"===l?(o.id=i.row.id,o.dataField=i.column.dataField):"ArrowRight"===l?(o.id=i.row.id,o.dataField=i.endColumn.dataField):"ArrowUp"===l?(o.id=i.row.id,o.dataField=i.column.dataField):"ArrowDown"===l&&(o.id=i.endRow.id,o.dataField=i.column.dataField)),t._selection.selectionRect&&e.shiftKey&&!e.ctrlKey&&!e.metaKey?(t._selection.selectionRect.endRow&&(o.id=t._selection.selectionRect.endRow.id),t._selection.selectionRect.endColumn&&(o.dataField=t._selection.selectionRect.endColumn.dataField)):t.selection.allowRowSelection&&!t.selection.allowCellSelection&&void 0!==t._rangeSelectionEndRow&&(o.id=t._rangeSelectionEndRow.id),t._clipboardHandler(l,e),((e.ctrlKey||e.metaKey)&&"x"!==l&&"c"!==l&&"v"!==l&&"Control"!==l||t.selection.allowCellSelection&&"Tab"===l)&&(t._selection.rows=[],t._selection.columns=[],t._selection.cells=[],t._selection.indexes=[]),"Escape"===l)return t.closeMenu(),t.cancelEdit(),void t._setSelection(o.id,o.dataField,e);if(t.hasMenu())return;if(e.shiftKey&&"Enter"===l&&t.rowDetail.dialog.enabled&&!t.rowDetail.dialog.visible){const l=t.rowById[o.id];if(l)return l.showDetail=!0,e.preventDefault(),void e.stopPropagation()}if(e.ctrlKey||e.metaKey){let n=!1;"f"===l&&(t.$.headerBar&&t.$.headerBar.openSearchPanel(),n=!0),"s"===l&&(t.$.headerBar&&t.$.headerBar.openSortPanel(),n=!0),"d"===l&&(t.$.headerBar&&t.$.headerBar._openDownloadMenu(),n=!0),"u"===l&&(t.$.headerBar&&t.$.headerBar.openFilterPanel(),n=!0),"w"===l&&(t.$.headerBar&&t.$.headerBar._openViewsMenu(),n=!0),n&&(e.stopPropagation(),e.preventDefault())}if(e.altKey){if("ArrowDown"===l){const l=t.columnByDataField[o.dataField];l&&t.hasColumnMenu(l)&&(l.element._showActionButton(),l.onAction(),t.menu&&t.menu.querySelector("smart-menu").$.dispatch(e))}else"ArrowUp"===l&&t.closeMenu();if("s"===l.toLowerCase()){const e=t.columnByDataField[o.dataField];e&&(e.sorted?"asc"===e.sortOrder?t.sortBy(e.dataField,"desc"):t.sortBy(e.dataField,null):t.sortBy(e.dataField,"asc"))}if("g"===l.toLowerCase()){const e=t.columnByDataField[o.dataField];e&&(e.group=!e.group)}return}const a=function(l,n){const o=(l,n)=>{if("extended"!==t.selection.mode&&"many"!==t.selection.mode&&t._clearSelection(!0),"many"===t.selection.mode){if(" "===e.key)t._setSelection(l,n,e);else{const e=t.rowById[l].getCell(n);t._selection.focusedCell={id:e.row.id,value:e.value,dataField:n,index:e.row.index}}return t.ensureVisible(l,n),void t._recycle()}t.beginUpdate(),t._setSelection(l,n,e),t.ensureVisible(l,n),t.endUpdate(!1,!1),"ArrowDown"===e.key||"ArrowUp"===e.key?t._recycle(!1,!0):t._recycle(),e.shiftKey?t.__selectionStarted&&!t.__selectionStartedFired?(t.$.fireEvent("change",{started:!0,finished:!1}),t.__selectionStartedFired=!0):t.$.fireEvent("change",{started:!1,finished:!1}):(t.$.fireEvent("change",{started:!1,finished:!0}),t._refreshSummary())};if(t._isVirtualMode()){t._keyboardNavigationTimer&&clearTimeout(t._keyboardNavigationTimer);const e=e=>{for(let l=0;l<t.rows.length;l++){const n=t.rows[l];if(n.index===e)return n.id}return null},i=l,a=JSON.parse(JSON.stringify(t._selection.focusedCell));t._selection.focusedCell.index=i,t._selection.focusedCell.dataField=n;const r=t.rows[0],s=r.height;if(-1===i)return;const d=t._scrollView.hScrollBar,c="virtual"!==t.scrolling?r.top:i*s;let u=0;if(t.paging.enabled||(c+d.offsetHeight+t.__frozenNearHeight>t._scrollView.scrollTop+t.$.scrollView.offsetHeight-t.__frozenFarHeight?(t._scrollView.scrollTop=c-t.$.scrollView.offsetHeight-t.__frozenFarHeight+d.offsetHeight,u=50):c<=t._scrollView.scrollTop&&(t._scrollView.scrollTop=c,u=50)),t._onDataUpdated||(t._onDataUpdated=()=>{t._recycle();const l=e(t._selection.focusedCell.index);t.rowById[l]?o(l,t._selection.focusedCell.dataField):t.paging.enabled&&(t._selection.focusedCell=a),t._onDataUpdated=null}),t.paging.enabled){const l=e(t._selection.focusedCell.index);t.rowById[l]?o(l,t._selection.focusedCell.dataField):t._selection.focusedCell=a}else t._keyboardNavigationTimer=setTimeout((()=>{const l=e(t._selection.focusedCell.index);t.rowById[l]&&o(l,t._selection.focusedCell.dataField)}),u)}else requestAnimationFrame((()=>{o(l,n)})),e.stopPropagation(),e.preventDefault()};switch("Enter"!==l||!t.editing.enabled||"cell"!==t.editing.mode||t.editing.isEditing||t._editDownKey||(l="F2"),l){case"Tab":{if("none"===t.selection.tabKeyBehavior)return;const l=e.shiftKey?t.prevColumn(o.dataField):t.nextColumn(o.dataField);if(l&&t.selection.allowCellSelection){const n=t.rowById[o.id].getCell(l.dataField);t._selection.focusedCell={id:n.row.id,value:n.value,dataField:l.dataField,index:n.row.index},t._setSelection(o.id,l.dataField,e),t.ensureVisible(o.id,l.dataField),t.focus(),e.stopPropagation(),e.preventDefault()}else{let l=e.shiftKey?t.prevRow(o.id):t.nextRow(o.id),n=e.shiftKey?t.lastColumn().dataField:t.firstColumn().dataField;if(t.editing.addNewRow.autoCreate&&!e.shiftKey&&o.id===t.lastRow().id&&(t.addUnboundRow(1),l=t.lastRow()),!l)return;e.shiftKey&&(t._selection.focusedCell=null),a(t._isVirtualMode()?l.index:l.id,n)}t.$.fireEvent("change",{started:!1,finished:!0}),t._refreshSummary();break}case" ":case"F2":{const n=t.rowById[o.id];if(!n||t.editing.editCell)return;if(e.ctrlKey||e.metaKey)return;if(" "===l&&t.dataSource.boundHierarchy&&(n.checked=!n.checked),t.editing.enabled&&!e.shiftKey){const e=t.getSelectedCells();let i=!1;if(e.length>0){let l=[];for(let n=0;n<e.length;n++){const o=e[n],i=o[1],a=t.columnByDataField[i];!a||"bool"!==a.dataType&&"boolean"!==a.dataType||l.push(o)}if(l.length>0){i=!0,t.beginUpdate();const e=l[0],o=e[1],a=e[0],r=e[2],s=t.columnByDataField[o];t.$.fireEvent("beginEdit",{id:null,dataField:o,row:a,column:s,cell:null,data:null,value:r});const d=[],c=[],u=[],f=[],g=[];for(let e=0;e<l.length;e++){const n=l[e],o=n[1],i=n[0],a=n[2],r=t.rowById[i],m=r.getCell(o);g.push(r),f.push(t.columnByDataField[s]),u.push(m),c.push(!a),d.push(a),t.setCellValue(i,o,!a)}t.onCellUpdate&&t.onCellUpdate(u,d,c,(function(){}),t),t.$.fireEvent("endEdit",{id:n?n.id:null,dataField:o,row:n,column:s,cell:e,data:n?n.data:null,value:!r}),t.endUpdate(!1)}}i||(t._beginEdit(n,o.dataField),setTimeout((function(){if(t.editing.editCell&&t.editing.editCell.column.dataType.indexOf("bool")>=0){const e=t.editing.editCell.editor.instance,n=e.getValue();" "===l&&e.setValue(!n)}}),50))}else t.selection.enabled&&"many"===t.selection.mode&&(t._isVirtualMode()?a(o.index,o.dataField):a(o.id,o.dataField));break}case"Delete":case"Backspace":{const e=t.rowById[o.id];if(!e||t.editing.editCell)return;if(t.editing.enabled&&(e.getCell(o.dataField).value,n.cells)){t.beginUpdate();for(let e=0;e<n.cells.length;e++){const l=n.cells[e],o=t.rowById[l.id];if(o){const e=o.getCell(l.dataField);if(!e.column.allowEdit)continue;if("image"===e.column.template){const l=e.value,n=l&&l.indexOf("[{")>=0?JSON.parse(l):[];for(let e=0;e<n.length;e++){if(t.uploadSettings.removeUrl){let l=new FormData,o=new XMLHttpRequest,i=n[e].value;l.append(t.uploadSettings.name,i),o.open("POST",t.uploadSettings.removeUrl),o.send(l)}t.uploadSettings.onUploadRemove&&t.uploadSettings.onUploadRemove(n[e])}}const n=t._pasteDataType({cell:e,value:e.value});let i=null;"int"!==n&&"number"!==n||(i=0),"string"===n&&(i=""),"boolean"!==n&&"bool"!==n||(i=!1),"date"===n&&(i=new Date),e.column.allowNull&&(i=null),e.formula=null;const a=e.value;if(t.dataSource&&t.dataSource.virtualDataSource){const l={};l[e.column.dataField]=i,t.editing.batch?t._batchUpdateCell(e.row,e.column,i,e.value):t.updateRow(e.row.id,l)}else if(t._setCellUndoRedo(e,a,i),t.onCellUpdate){t._pasteTempValues||(t._pasteTempValues=[]);const n=i;t._pasteTempValues.push({id:e.row.id,cell:e,dataField:l.column.dataField,oldValue:a,newValue:n}),t._pasteTimer&&clearTimeout(t._pasteTimer),t._pasteTimer=setTimeout((()=>{const l=(e,l)=>{const n=e.row;if(n){let o=null;if(t.storeHistory&&(o=t._stringifyRow(n)),l!==(void 0!==e.value?e.value:"")&&(n.updatedDate=new Date,n.updatedBy=t.currentUser,t.storeHistory)){e.value=l;const i=t._stringifyRow(n);t._updateRowHistory(n,o,i)}}};if(t._pasteTempValues&&t._pasteTempValues.length>1){let e=[],n=[],o=[];for(let l=0;l<t._pasteTempValues.length;l++){const i=t._pasteTempValues[l];e.push(i.cell),n.push(i.oldValue),o.push(i.newValue)}t.onCellUpdate(e,n,o,(function(n){if(n){const n=t.onRowHistory;t.onRowHistory=null,t.beginUpdate();for(let t=0;t<e.length;t++){const n=e[t];l(n,o[t]),n.value=o[t]}t.endUpdate(!1),t.onRowHistory=n}}),t)}else t.onCellUpdate([e],[a],[n],(function(o){if(o){const o=t.onRowHistory;t.onRowHistory=null,l(e,n),e.value=n,t.onRowHistory=o}}),t);delete t._pasteTempValues}),100)}else if(t.onRowUpdate){const l=Object.assign({},e.row.data),n=Object.assign({},e.row.data);n[e.column.dataField]=i,t.onRowUpdate(e.row.index,e.row,l,n,(function(t){t&&(e.value=i)}),t)}else e.value=i}}t.endUpdate(!1),t._recycle(),t._refreshDataFilters()}break}default:if(t.editing.enabled&&!t.editing.editCell&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!t.editing.editRow){const e=t.rowById[o.id];if(!e)return;if(["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","Shift","Up","Down","Left","Right","Control","F2","Esc"," ","Home","End","PageUp","PageDown"].indexOf(l)>=0)return;t._beginEdit(e,o.dataField),setTimeout((function(){if(t.editing.editCell)t.editing.editCell.editor.instance.setValue(l);else if(t.editing.editRow){const e=t.editing.editRow.getCell(o.dataField);if(!e)return;e.editor.instance.setValue(l)}}),50)}break;case"Home":{const l=t.firstRow();if(t.paging.enabled&&e.shiftKey)return t.firstPage(),e.stopPropagation(),void e.preventDefault();if(!l)return;a(l.id,o.dataField);break}case"End":{if(t.paging.enabled&&e.shiftKey)return t.lastPage(),e.stopPropagation(),void e.preventDefault();const l=t.lastRow();if(!l)return;a(l.id,o.dataField);break}case"PageUp":{const l=t._recyclingRows,n=t.rowById[o.id],i=l.indexOf(n);if(t.paging.enabled&&e.shiftKey)return t.prevPage(),e.stopPropagation(),void e.preventDefault();if(t._isVirtualMode()){const e=Math.round(t.$.scrollView.offsetHeight/t.rows[0].height);a(Math.max(o.index-e,0),o.dataField)}else{for(let e=i;e>=0;e--){const i=l[e];if(n.top-i.top>=t.$.scrollView.offsetHeight)return void a(i.id,o.dataField)}a(t.firstRow().id,o.dataField)}break}case"PageDown":{const l=t._recyclingRows,n=t.rowById[o.id],i=l.indexOf(n);if(t.paging.enabled&&e.shiftKey)return t.nextPage(),e.stopPropagation(),void e.preventDefault();if(t._isVirtualMode()){const e=Math.round(t.$.scrollView.offsetHeight/t.rows[0].height);a(Math.min(o.index+e,t.dataSource.virtualDataSourceLength-1),o.dataField)}else{for(let e=i;e<l.length;e++){const i=l[e];if(i.top-n.top>=t.$.scrollView.offsetHeight)return void a(i.id,o.dataField)}a(t.lastRow().id,o.dataField)}break}case"Enter":case"ArrowDown":if(t._isVirtualMode())a(e.ctrlKey||e.metaKey?t.lastRow():o.index+1,o.dataField);else{let n=e.ctrlKey||e.metaKey?t.lastRow():t.nextRow(o.id);if(!t.editing.addNewRow.autoCreate||"Enter"!==l||o.id!==t.lastRow().id||e.ctrlKey||e.metaKey||(t.addUnboundRow(1),n=t.lastRow()),!n)return;let i=!0;"Enter"===l&&(e.ctrlKey||e.metaKey)&&(i=!1),i&&a(n.id,o.dataField)}break;case"ArrowUp":if(t._isVirtualMode())a(e.ctrlKey||e.metaKey?t.lastRow():Math.max(0,o.index-1),o.dataField);else{const l=e.ctrlKey||e.metaKey?t.firstRow():t.prevRow(o.id);if(!l)return;a(l.id,o.dataField)}break;case"ArrowRight":{const l=t.rowById[o.id],n=t.columnByDataField[o.dataField]._treeColumn;if((!t.selection.allowCellSelection||n)&&!1===l.leaf){if(!l.expanded)return l.expand(),e.stopPropagation(),void e.preventDefault();{const e=t.nextRow(o.id);if(e)return void a(e.id,o.dataField)}}const i=e.ctrlKey||e.metaKey?t.lastColumn():t.nextColumn(o.dataField);if(!i)return;a(t._isVirtualMode()?o.index:o.id,i.dataField);break}case"ArrowLeft":{const l=t.rowById[o.id],n=t.columnByDataField[o.dataField]._treeColumn;if(!t.selection.allowCellSelection||n){if(!1===l.leaf)return void(l.expanded?(l.collapse(),e.stopPropagation(),e.preventDefault()):l.parent&&a(l.parent.id,o.dataField));if(!0===l.leaf&&l.parent)return void a(l.parent.id,o.dataField)}const i=e.ctrlKey||e.metaKey?t.firstColumn():t.prevColumn(o.dataField);if(!i)return;a(t._isVirtualMode()?o.index:o.id,i.dataField);break}}["Shift","Up","Down","Left","Right","Control","F2","Esc"," ","Home","End","PageUp","PageDown"].indexOf(l)<0||(e.stopPropagation(),e.preventDefault())}_keyUpHandler(e){const t=this;"Escape"===e.key&&t._dragDrop&&t._endDrag(e),t._focused&&"Shift"===e.key&&(t.$.fireEvent("change",{started:!1,finished:!0}),t._refreshSummary())}firstRow(){const e=this._recyclingRows;if(this._isVirtualMode())return{id:0};if(e&&e.length>0){if(!e[0].autoGenerated&&e[0].allowSelect)return e[0];for(let t=0;t<e.length;t++)if(!e[t].autoGenerated&&e[t].allowSelect)return e[t]}return null}lastRow(){const e=this,t=e._recyclingRows;if(e._isVirtualMode())return{id:e.dataSource.virtualDataSourceLength-1};if(t&&t.length>0){const e=t[t.length-1];if(!e.autoGenerated&&e.allowSelect)return e;for(let e=t.length-1;e>=0;e--)if(!t[e].autoGenerated&&t[e].allowSelect)return t[e]}return null}nextRow(e){const t=this._recyclingRows,l=this.rowById[e],n=t.indexOf(l);let o=1;if(l&&void 0!==l._rowSpan&&(o=l._rowSpan),n>=0&&t[n+o]&&!t[n+o].autoGenerated){const e=t[n+o];if(e.allowSelect&&!e.disabled)return e;for(let e=n+o;e<t.length;e++){const l=t[e];if(l.allowSelect&&!l.disabled)return l}}return null}_isVirtualMode(){const e=this;return e.dataSource&&e.dataSource.virtualDataSource&&!e.dataSource.virtualDataSourceOnExpand&&e.dataSource.length>e.virtualModeCachedRowsCount&&"infinite"!==e.scrolling}prevRow(e){const t=this,l=t._recyclingRows,n=t.rowById[e],o=l.indexOf(n);if(t._isVirtualMode())return 0===e?null:{id:n.index-1};if(o>=0&&l[o-1]&&!l[o-1].autoGenerated){const e=l[o-1];if(e.allowSelect&&!e.disabled)return e;for(let e=o-1;e>=0;e--){const t=l[e];if(t.allowSelect&&!t.disabled)return t}}return null}firstColumn(){const e=this.viewColumns;if(e&&e.length>0)for(let t=0;t<e.length;t++){const l=e[t];if(l.allowSelect&&!l.autoGenerated)return l}return null}lastColumn(){const e=this.viewColumns;if(e&&e.length>0)for(let t=e.length-1;t>=0;t--){const l=e[t];if(l.allowSelect&&!l.autoGenerated)return l}return null}nextColumn(e){const t=this.viewColumns,l=this.columnByDataField[e];let n=t.indexOf(l);for(;n<t.length;){const e=t[n+1];if(e.autoGenerated)return null;if(e.visible)return e;n++}return null}prevColumn(e){const t=this.viewColumns,l=this.columnByDataField[e];let n=t.indexOf(l);for(;n>0;){const e=t[n-1];if(e.autoGenerated)return null;if(e.visible)return e;n--}return null}isVisible(e,t){const l=this,n=l._scrollView.vScrollBar,o=l._scrollView.hScrollBar,i=l.rowById[e],a=l.columnByDataField[t],r=function(e){if(!e)return!1;const t=e.visibleIndex;if(-1===t)return!1;const n=l.dataSource&&l.dataSource.virtualDataSource&&!l.dataSource.virtualDataSourceOnExpand&&l.dataSource.length>l.virtualModeCachedRowsCount&&"infinite"!==l.scrolling;let i=e.top;return n&&(i=t*l.rows[0].height),!(i+e.height+o.offsetHeight+l.__frozenNearHeight>=l._scrollView.scrollTop+l.$.scrollView.offsetHeight-l.__frozenFarHeight||i<=l._scrollView.scrollTop)}(i),s=function(e){return!!t&&!(-1===e.visibleIndex||e.left+e.computedWidth+n.offsetWidth>=l._scrollView.scrollLeft+l._clientSize.width||e.left<=l._scrollView.scrollLeft)}(a);return{row:r,column:s}}_ensureRowVisible(e){const t=this;if(!t._scrollView)return;const l=t._scrollView.hScrollBar;if(!e)return;const n=e.visibleIndex;if(-1===n)return;const o="virtual"!==t.scrolling?e.top:n*t.rows[0].height,i=t.summaryRow.visible?t.layout.rowMinHeight:0;if(o+e.height+l.offsetHeight+t.__frozenNearHeight>=t._scrollView.scrollTop+t.$.scrollView.offsetHeight-t.__frozenFarHeight-i&&(t._scrollView.scrollTop=o+e.height-t.$.scrollView.offsetHeight+t.__frozenNearHeight+t.__frozenFarHeight+l.offsetHeight+i),o<=t._scrollView.scrollTop&&(t._scrollView.scrollTop=o),t.paging.enabled){const o=t.paging.pageSize,i=Math.floor(n/o);if(t.paging.pageIndex!==i)return t.goToPage(i),t._scrollView.scrollTop=0,void setTimeout((()=>{e.top+e.height+l.offsetHeight+t.__frozenNearHeight>=t._scrollView.scrollTop+t.$.scrollView.offsetHeight-t.__frozenFarHeight&&(t._scrollView.scrollTop=e.top+e.height),e.top<=t._scrollView.scrollTop&&(t._scrollView.scrollTop=e.top)}),50)}0===n?t._scrollView.scrollTop=0:n===t.dataSource.length-1&&(t._scrollView.scrollTop=t._scrollView.scrollHeight)}_ensureColumnVisible(e){const t=this,l=t._scrollView.vScrollBar;if(!e)return;const n=e.visibleIndex;-1!==n&&(e.left+e.computedWidth+l.offsetWidth>=t._scrollView.scrollLeft+t._clientSize.width&&(t._scrollView.scrollLeft=t._scrollView.scrollLeft+e.computedWidth),e.left<=t._scrollView.scrollLeft&&(t._scrollView.scrollLeft=e.left),0===n?t._scrollView.scrollLeft=0:n===t.columns.length-1&&(t._scrollView.scrollLeft=t._scrollView.scrollWidth))}ensureVisible(e,t){const l=this,n=l.rowById[e],o=l.columnByDataField[t];if("virtual"===l.scrolling){const e=l._scrollView.hScrollBar,t=n.visibleIndex*l.rows[0].height,i=l.summaryRow.visible?l.layout.rowMinHeight:0;return t+n.height+e.offsetHeight+l.__frozenNearHeight>=l._scrollView.scrollTop+l.$.scrollView.offsetHeight-l.__frozenFarHeight-i&&l.setVerticalScrollValue(t),void l._ensureColumnVisible(o)}l._ensureRowVisible(n),l._ensureColumnVisible(o)}clearSelection(){const e=this;delete e._rangeSelectionStartRow,delete e._rangeSelectionEndRow,e._clearSelection(!0),e.$.fireEvent("change",{started:!1,finished:!0}),e._refreshSummary()}});
6
+ Smart.Utilities.Assign("Grid.Select",class{_refreshSelection(){const e=this;if(e.selection.enabled&&(e._selectionColumn.refresh(),!e._isVirtualMode()&&e._selection&&e._selection.rows))for(let t in e._selection.rows)e.rowById[t]||delete e._selection.rows[t];e._refreshCellSelectionRect()}_toggleColumnSelection(e){const t=this;if(!t.selection.enabled||"none"===t.selection.checkBoxes.selectAllMode)return void(t._inputOverlay&&t._inputOverlay.parentNode&&t._inputOverlay.parentNode.removeChild(t._inputOverlay));let l=e.element.getAttribute("selected");l="indeterminate"===l||""!==l;let n=t._recyclingRows;t._selectionColumn._selecting=!0,t.beginUpdate(),t._selection.indexes=[];for(let e=0;e<n.length;e++)n[e].selected=l;if(t._selectionColumn._selecting=!1,t.endUpdate(!1),t._isVirtualMode())if(l)for(let e=0;e<t.dataSource.virtualDataSourceLength;e++)l&&(t._selection.indexes[e]=e,t._selection.rows[e]=e);else t._selection.indexes=[],t._selection.rows=[];if(t._recycle(!1),t.$.fireEvent("change",{started:!1,finished:!0}),t.selection.enabled&&t.selection.checkBoxes.enabled&&"none"!==t.selection.checkBoxes.selectAllMode){const l=e.element,n=l.querySelector(".smart-input");t._inputOverlay?t._inputOverlay.parentNode!==t.$.columnHeader&&(t._inputOverlay.parentNode&&t._inputOverlay.parentNode.removeChild(t._inputOverlay),t._inputOverlay=document.createElement("div"),t.$.columnHeader.appendChild(t._inputOverlay)):(t._inputOverlay=document.createElement("div"),t.$.columnHeader.appendChild(t._inputOverlay)),t._inputOverlay.column=e,t._inputOverlay.onpointerdown=function(){t._inputOverlay||(t._inputOverlay.onpointerdown=null);const e=t._inputOverlay.column;t._inputOverlay.classList.remove("smart-animate"),t._selectionColumn._selecting=!0,t.beginUpdate();let l=e.element.hasAttribute("selected"),n=t._recyclingRows;for(let e=0;e<n.length;e++)n[e].selected=!l;t._selectionColumn._selecting=!1;const o=t._inputOverlay;if(t.endUpdate(!1),t._isVirtualMode())if(l)t._selection.indexes=[],t._selection.rows=[];else for(let e=0;e<t.dataSource.virtualDataSourceLength;e++)l&&(t._selection.indexes[e]=e,t._selection.rows[e]=e);return t._recycle(),t.$.fireEvent("change",{started:!1,finished:!0}),t.$.fireEvent("columnClick",{column:e,dataField:e.dataField}),t.$.columnHeader.appendChild(o),t._inputOverlay=o,t._inputOverlay.classList.add("smart-animate"),!1},t._inputOverlay.classList.add("smart-input-overlay"),t._inputOverlay.classList.add("smart-input-overlay-column"),t.appearance.allowCheckBoxesSelectionAnimation&&t._inputOverlay.classList.add("smart-animate"),t._inputOverlay.style.top=(l.offsetHeight-n.offsetHeight)/4+1+"px";const o=t._selectionColumn.element.parentElement.offsetLeft+t._selectionColumn.element.offsetLeft;t.rightToLeft?t._inputOverlay.style.right=o+"px":t._inputOverlay.style.left=o+"px",t._inputOverlay.style.height=l.offsetWidth+"px",t._inputOverlay.style.width=l.offsetWidth+"px",t._inputOverlay.onmousedown=null,t._inputOverlay.classList.add("smart-input-overlay-on"),t._selectionColumn.refresh()}}_refreshCheckBoxColumnSelection(){const e=this;if(e.selection.enabled&&e.selection.checkBoxes.enabled){const t=e._selectionColumn.element;"none"===e.selection.checkBoxes.selectAllMode?(t.removeAttribute("checkbox"),t.label.classList.remove("smart-input")):(t.setAttribute("checkbox",""),t.label.classList.add("smart-input")),e._selectionColumn.refresh()}}_handleExtendedRowSelection(e,t){const l=this;if(!e)return;let n=l._recyclingRows;if(l.paging.enabled&&"page"===l.selection.selectAllMode&&(n=n.slice(l.paging.pageIndex*l.paging.pageSize,(l.paging.pageIndex+1)*l.paging.pageSize)),!t||t.ctrlKey||t.metaKey||(l._selection.rows=[],l._selection.indexes=[]),t&&!t.shiftKey&&(l._rangeSelectionStartRow=e,l._rangeSelectionEndRow=e),t&&t.shiftKey){l._rangeSelectionEndRow=e;const t=n.indexOf(l._rangeSelectionStartRow),o=n.indexOf(l._rangeSelectionEndRow),i=Math.min(t,o),a=Math.max(t,o);if(-1===t||-1===o)return;for(let e=i;e<=a;e++){const t=n[e];t.allowSelect&&t.setProperty("selected",!0)}}else!1!==e.allowSelect&&(t&&(t.ctrlKey||t.metaKey)?null===e.selected?e.setProperty("selected",!0):e.setProperty("selected",!e.selected):e.setProperty("selected",!0))}_setSelection(e,t,l){const n=this;if(!n.selection.enabled)return;if(delete n._areAllRowsSelected,n._lastColumnSelectionRange=null,n._lastRowSelectionRange=null,n.closeMenu(),null===e&&null===t)return void n.clearSelection();const o=function(){if(l&&!l.ctrlKey&&!l.metaKey&&!l.shiftKey||"one"===n.selection.mode){if("many"!==n.selection.mode){for(let e in n._selection.rows){const t=n.rowById[e];t&&(t.canNotify=!1,t.selected=!1,t.canNotify=!0)}n._selection.indexes=[],n._selection.rows=[],n._selection.columns=[],n._selection.cells=[]}n._selection.focusedCell=null}if(n._selection.selectionRect){const e=n._selection.selectionRect;e.parentNode.removeChild(e);const t={down:"pointerdown",move:"pointermove",up:"pointerup"};Smart.Utilities.Core.isMobile&&(t.down="touchstart",t.move="touchmove",t.up="touchend"),document.removeEventListener(t.move,e.onMove),document.removeEventListener(t.up,e.onUp),document.removeEventListener(t.down,e.onDown),n._selection.selectionRect=null}};n.beginUpdate();const i=n.columnByDataField[t],a=()=>{const t=n.rowById[e];t&&(t.allowSelect||null===t.allowSelect&&!l)&&(n.selection.checkBoxes.enabled&&l&&l.originalEvent&&l.originalEvent.target&&l.originalEvent.target.parentNode&&l.originalEvent.target.parentNode.hasAttribute("checkbox")&&(l.ctrlKey=!0),o(),n._selectRow(e,l))};if(n.selection.allowCellSelection&&null!=e&&i&&!i.autoGenerated){const i=n.rowById[e];if(!i)return n.endUpdate(!1),void n._recycle();let a=i.getCell(t);const r=n._getParentCell(i,t);r&&(a=r.row.getCell(r.column.dataField)),a&&a.column.allowSelect&&(o(),!l||l.ctrlKey||l.metaKey||(n._selection.rows=[],n._selection.indexes=[],n._selection.columns=[],"many"!==n.selection.mode&&(n._selection.cells=[])),"extended"===n.selection.mode?l&&(l.ctrlKey||l.metaKey)?a.selected=!a.selected:a.selected=!0:"one"===n.selection.mode?a.selected=!0:a.selected=!a.selected,(l&&!l.shiftKey||!n._selection.focusedCell)&&(n._selection.focusedCell={id:a.row.id,value:a.value,index:a.row.index,dataField:a.column.dataField}),l&&(l.shiftKey||n._selection.focusedCell.id===a.row.id&&n._selection.focusedCell.dataField===a.column.dataField&&"extended"===n.selection.mode)&&(r?n._renderCellSelectionRect(a.row,a.column,r.endRow,r.endColumn):n._renderCellSelectionRect(a.row,a.column,a.row,a.column)))}else n.selection.allowRowHeaderSelection&&null!=e&&void 0===n.columnByDataField[t]||n.selection.checkBoxes.enabled&&null!=e&&"_checkBoxColumn"===t&&void 0===n.columnByDataField[t]?a():null==e||null!=t&&void 0===n.columnByDataField[t]||!n.selection.allowRowSelection?n.selection.allowColumnHeaderSelection&&i&&(o(),n._selectColumn(t,l||new KeyboardEvent("keydown"))):a();n.endUpdate(!1,!1),n._recycle(!0,!0,!1),null==e||i||n._renderInputOverlay(e,l),n.__selectionStarted=new Date}_renderCellSelectionRect(e,t,l,n){const o=this;let i=o._recyclingRows;const a=i.indexOf(e),r=i.indexOf(l);if(!(o.grouping.enabled&&"advanced"===o.grouping.renderMode&&o.dataSource&&o.dataSource.groupBy.length>0)&&!o._mobile&&a>=0&&r>=0){if(!o._selection.selectionRect){const e=function(e){const t=document.createElement("div"),l=document.createElement("div"),n=document.createElement("div");return n.classList.add("smart-selection-overlay"),n.appendChild(l),l.appendChild(t),t.classList.add("smart-selection-overlay-content"),l.classList.add("smart-selection-overlay-border-content"),o.selection.allowCellDragSelectionHandle&&e&&l.classList.add("handle"),o.$.scrollView.appendChild(n),n},t=o._selection.selectionRect=e(!0);if(o.selection.allowCellDragSelectionHandle){let e=null,l=null,n=null;t.onMove=function(t){const a=o._selection.selectionRect;let r=t.clientX,s=t.clientY;t.touches&&(r=t.touches[0].clientX,s=t.touches[0].clientY);const d=function(e){const t=(o.enableShadowDOM?o.shadowRoot:o.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let l=null;for(let e=0;e<t.length;e++){const n=t[e];if(n.getAttribute("data-field")){l=n.getAttribute("data-field");break}}let n=null;for(let e=0;e<t.length;e++){const l=t[e];if(l.getAttribute("data-id")){n=l.row;break}}return{column:o.columnByDataField[l],row:n}};if(a&&a.capturedDrag){let e=d({clientX:r,clientY:s}),l=d({clientX:r,clientY:s+a.top}).row,n=d({clientX:r+a.left,clientY:s}).column;if(l||(l=i[i.length-1]),n||(n=e.column),l&&n&&e.row&&e.column){a.row=e.row,a.rowId=a.row.id,a.column=e.column,a.endDragRow=a.endRow=l,a.endDragColumn=a.endColumn=n,a.endDragRowId=a.endDragRow.id,o._dragSelectionStartDataField=a.column.dataField,o._dragSelectionStartRow=a.row;const t=a.row.getCell(a.column.dataField);o._selection.focusedCell={index:t.row.index,id:t.row.id,dataField:t.column.dataField,value:t.value}}o._resizeSelectionRect(),t.preventDefault()}else if(a&&a.captured)if(o._dragSelectionStartDataField=o._selection.focusedCell.dataField,o._dragSelectionStartRow=o.rowById[o._selection.focusedCell.id],null===l&&null===n&&(Math.abs(r-e.left)>=30?l=!0:Math.abs(s-e.top)>=30&&(n=!0)),a.lastPoint&&Math.abs(a.lastPoint.top-s)>=40?(l=null,n=!0):a.lastPoint&&Math.abs(a.lastPoint.left-r)>=40&&(n=null,l=!0),l){const t=a.endDragColumn.dataField,l=d({clientX:r,clientY:e.top-5});l.row&&l.column&&(a.endDragRow=a.endRow,a.endDragColumn=l.column,a.endDragColumn.dataField!==t&&(a.lastPoint={left:r,top:s}),o._resizeSelectionRect())}else if(n){const t=a.endDragRow,l=d({clientX:e.left-5,clientY:s});l.row&&l.column&&(a.endDragRow=l.row,a.endDragColumn=a.endColumn,a.endDragRow.id&&a.endDragRow.id!==t.id&&(a.lastPoint={left:r,top:s}),o._resizeSelectionRect())}a&&a.captured&&o.selection.allowDragSelectionAutoScroll&&(o._autoScrollSelectionDragInterval&&clearInterval(o._autoScrollSelectionDragInterval),o.selection.isDragging=!0,o._autoScrollSelectionDragInterval=setInterval((function(){const e=o.$.scrollView.getBoundingClientRect();r<=e.left+20?(o.scrollLeft-=15,o._resizeSelectionRect()):r>=e.left+e.width-20&&(o.scrollLeft+=15,o._resizeSelectionRect()),s<=e.top+20?(o.scrollTop-=15,o._resizeSelectionRect()):s>=e.top+e.height-20&&(o.scrollTop+=15,o._resizeSelectionRect())}),25))},t.onUp=function(){if(!t.captured)return;o._autoScrollSelectionDragInterval&&clearInterval(o._autoScrollSelectionDragInterval),o.editing.editCell||o.editing.editRow||o.focus(),t.capturedDrag=!1,t.captured=!1,l=null,n=null,e=null,t.lastPoint=null;const i=t.cellValues;t.minRow&&t.maxRow&&t.maxRow&&t.maxColumn&&(o._selectCellsRange(t.minRow,t.maxRow,t.minColumn.dataField,t.maxColumn.dataField),t.row=t.minRow,t.rowId=t.row.id,t.column=t.minColumn,t.endColumn=t.maxColumn,t.endRow=t.maxRow,t.endRowId=t.maxRow.id,t.cellValues=i,o._resizeSelectionRect(),o.selection.allowCellDragSelectionAutoFill&&o._pasteSelectedCells({row:t.row,endRow:t.endDragRow,column:t.column,endColumn:t.endColumn},i)),t.endDragColumn=null,t.endDragRow=null,t.minColumn=null,t.minRow=null,t.maxColumn=null,t.maxRow=null},t.onDown=function(l){if(t.captured&&!e){let t=l.clientX,n=l.clientY;l.touches&&(t=l.touches[0].clientX,n=l.touches[0].clientY),e={left:t,top:n}}};const a={down:"pointerdown",move:"pointermove",up:"pointerup"};Smart.Utilities.Core.isMobile&&(a.down="touchstart",a.move="touchmove",a.up="touchend"),t["on"+a.down]=function(e){const l=t.getBoundingClientRect();let n=e.clientX,i=e.clientY;e.touches&&(n=e.touches[0].clientX,i=e.touches[0].clientY),n>=l.right-5&&i>=l.bottom-5?(t.captured=!0,t.endDragRow=t.endRow,t.endDragColumn=t.endColumn):o.selection.allowCellDragDropSelectionHandle&&i>=l.bottom-5?(t.captured=!0,t.capturedDrag=!0,t.endDragRow=t.endRow,t.endDragColumn=t.endColumn,t.left=t.endColumn.left-t.column.left,t.top=t.endRow.top-t.row.top):t.captured||o._rowDownHandler(e)},document.addEventListener(a.move,t.onMove,{passive:!1}),document.addEventListener(a.up,t.onUp,{passive:!1}),document.addEventListener(a.down,t.onDown,{passive:!1})}}const e=o._selection.selectionRect;e.row=o.rowById[o._selection.focusedCell.id],e.rowId=o._selection.focusedCell.id,e.column=o.columnByDataField[o._selection.focusedCell.dataField],e.endRow=l,e.endRowId=l.id,e.endDragRow=l,e.endColumn=n,e.endDragColumn=n,o._refreshCellSelectionRect()}}_resizeSelectionRect(){const e=this,t=e._selection.selectionRect;if(!t)return;let l=e._recyclingRows,n=t.row,o=t.endDragRow,i=t.column,a=t.endDragColumn;const r=e.viewColumns,s=l.indexOf(n),d=l.indexOf(o),c=l.indexOf(t.endRow),u=r.indexOf(i),f=r.indexOf(a),g=r.indexOf(t.endColumn),m=Math.min(c,Math.min(s,d)),_=Math.max(c,Math.max(s,d)),p=Math.min(g,Math.min(u,f)),w=Math.max(g,Math.max(u,f));c<=Math.min(s,d)?t.minRow=t.endRow:t.minRow=s<=d?n:o,c>=Math.max(s,d)?t.maxRow=t.endRow:t.maxRow=s>=d?n:o,g<=Math.min(u,f)?t.minColumn=t.endColumn:t.minColumn=u<=f?i:a,g>=Math.max(u,f)?t.maxColumn=t.endColumn:t.maxColumn=u>=f?i:a;let h=0,y=0,S=0,v=0;for(let e=m;e<=_;e++){const t=l[e];if(t){e===m&&(h=t.top),e===_&&(y=t.top+t.height-h);for(let e=p;e<=w;e++){const l=r[e].dataField,n=t.getCell(l);e===p&&(S=n.column.left),e===w&&(v=n.column.left+n.column.computedWidth-S)}}}t.style.top=h-e.scrollTop-1+"px",e._isVirtualMode()&&(t.style.top=h+parseFloat(e.$.rowContainer.style.top)-1+"px"),e.rightToLeft?t.style.right=S-e.scrollLeft+"px":t.style.left=S-e.scrollLeft+"px",t.style.height=y+1+"px",t.style.width=v+1+"px"}_getPatternValue(e,t,l){let n=[],o=0,i=[],a=[],r=[],s=[];const d={names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},c={names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},u=function(e){if(void 0!==e&&!(e.toString().indexOf("GMT+")>=0||e.toString().indexOf("GMT-")>=0)){if(!isNaN(parseFloat(e)))return/[A-Za-z]/.test(e.toString())?void 0:parseFloat(e);if(d.names.indexOf(e)>=0)return s=d.names,d.names.indexOf(e);if(d.namesAbbr.indexOf(e)>=0)return s=d.namesAbbr,d.namesAbbr.indexOf(e);if(d.namesShort.indexOf(e)>=0)return s=d.namesShort,d.namesShort.indexOf(e);if(c.names.indexOf(e)>=0)return s=c.names,c.names.indexOf(e);if(c.namesAbbr.indexOf(e)>=0)return s=c.namesAbbr,c.namesAbbr.indexOf(e);if(void 0!==e&&(null===e&&(e=""),/\d+/.test(e.toString()))){r.push(e.toString().replace(/[0-9]/,"#")),r[r.length-1]=r[r.length-1].replace(/[0-9]/g,"");const t=parseFloat(e.toString().replace(/\D/g,""));return isNaN(t)?0:t}}};let f=0;for(let e in l){let t=l[e];n[o]=[],f=0;for(let e in t){let l=u(t[e]);void 0!==l&&(n[o].push(l),f++)}if(0===n[o].length)continue;let a=n[o][0],d=0;for(let e=0;e<n[o].length;e++){let t=u(n[o][e-1]),l=u(n[o][e]);0===e&&(t=l),a+=l,d+=l-t}a/=n[o].length,a-=n[o][0],a+=n[o][n[o].length-1],0!==d&&(d/=n[o].length-1),(s.length>0||r.length>0)&&(d=1,a=n[o][0]),n[o].length<=2&&(a=n[o][n[o].length-1]+d),i.push({step:d,stepStart:a}),o++}for(let e=0;e<f;e++){let t=n[0][e],l=0;for(let o=1;o<n.length;o++){const i=u(n[o-1][e]),a=u(n[o][e]);t+=a,l+=a-i}t/=n.length,t-=n[0][e],t+=n[n.length-1][e],0!==l&&(l/=n.length-1),(s.length>0||r.length>0)&&(l=1,t=n[0][e]),n.length<=2&&(t=n[n.length-1][e]+l),a.push({step:l,stepStart:t})}if(!n[e]){let l=n.length;for(let o=l;o<=e;o++){n[o]=[];for(let e=0;e<=t;e++)a[e]||(a[e]=a[e-1]),a[e]&&(o===l?n[o][e]=a[e].stepStart:(n[o][e]=n[o-1][e]+a[e].step,s.length>1&&n[o][e]>=s.length&&(n[o][e]=0)))}return s.length>0?s[n[e][t]]:r.length>0?r[e%r.length].replace("#",n[e][t]):n[e][t]}if(!n[e][t]){let l=f;for(let o=l;o<=t;o++)i[e]&&(o===l?n[e].push(i[e].stepStart):(n[e][o]=n[e][o-1]+i[e].step,s.length>1&&n[e][o]>=s.length&&(n[e][o]=0)));return s.length>0?s[n[e][t]]:r.length>0?r[e%r.length].replace("#",n[e][t]):n[e][t]}return n[e]&&n[e][t]?r.length>0?r[e%r.length].replace("#",n[e][t]):n[e][t]:0}_pasteDataType(e){const t=this.dataSource&&"number"==typeof this.dataSource.dataSource,l=e.cell,n=e.value;let o=l.column.dataType;return o&&!t||(o=isNaN(parseFloat(n))?"string":n instanceof Date?"date":"true"===n||"false"===n?"boolean":"number"),o}_pasteModeCopy(e){const t=this,l=t.dataSource&&"number"==typeof t.dataSource.dataSource,n=t._pasteDataType(e),o=e.cell;let i=e.value;if(o.column.editor&&o.column.editor.dataSource&&i){const e=e=>{let l;const n=o.column.editor.collaborator?t.users:o.column.editor.dataSource;for(let t=0;t<n.length;t++){const i=n[t];if("string"!=typeof i&&(i.label===e||i.name===e))return l=i.value,o.column.editor.collaborator&&(l=i.id),l;if("string"!=typeof i&&i.value===e)return l=i.value,o.column.editor.collaborator&&(l=i.id),l}return-1};let l=-1;if(i&&-1!==i.indexOf(",")?(l=[],i.split(",").forEach((t=>{const n=e(t.trim());-1!==n&&l.push(n)})),l=l.join(",")):l=e(i),-1!==l&&(i=l),-1===l)return}if(o.column.editor&&"custom"===o.column.editor.template)return;const a=i,r=e.dataField;if(a&&"string"==typeof a&&a.indexOf("[{")>=0&&"image"!==o.column.template&&"attachment"!==o.column.template)return;let s=a,d=!1;if("string"===n){if(s=a,s){if((""+s).indexOf("&#")>=0&&(s=t._fromHTMLEntities(s)),(""+s).indexOf("GMT")>=0){const e=new Smart.Utilities.DateTime(s).toString("d");e&&e.length&&(s=e)}o.column.editor.collaborator||(s=s.replaceAll("\\"," ").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/[\r\n]+/g," ").replace(/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi,(e=>"&#"+e.codePointAt(0)+";")))}d=!0}else if("bool"===n||"boolean"===n)1!==a&&"1"!==a&&!0!==a&&"true"!==a&&"TRUE"!==a&&"True"!==a||(s=!0,d=!0);else if("date"===n||"time"===n||"dateTime"===n){const e=t.columnByDataField[r];l?(s=a,d=!0):e&&e.dataType!==n?(s=null,d=!0):(s=a,"string"==typeof a&&(s=new Date(a)),o&&"duration"===o.column.template&&(s=[s,s]),d=!0)}else if("number"===n||"float"===n||"int"===n){const e=t.columnByDataField[r];l?(s=a,d=!0):e&&e.dataType!==n?(s=null,d=!0):null!==a?"int"===n||"integer"===n?(s=parseInt(a),d=!0):(s=parseFloat(a),isNaN(s)&&(s=null),d=!0):(s=null,d=!0)}if(!1!==o.column.allowEdit&&!1!==t.editing.enabled||(d=!1),d)if(t.dataSource&&t.dataSource.virtualDataSource){const e={};e[o.column.dataField]=s,t.editing.batch?t._batchUpdateCell(o.row,o.column,s,o.value):t.updateRow(o.row.id,e)}else{const e=o.value;if(t._setCellUndoRedo(o,e,s),t.onCellUpdate){t._pasteTempValues||(t._pasteTempValues=[]),t._pasteTempValues.push({id:o.row.id,cell:o,dataField:o.column.dataField,oldValue:e,newValue:s}),t._pasteTimer&&clearTimeout(t._pasteTimer);const l=(e,l)=>{const n=e.row;if(n){let o=null;if(t.storeHistory&&(o=t._stringifyRow(n)),l!==(void 0!==e.value?e.value:"")&&(n.updatedDate=new Date,n.updatedBy=t.currentUser,t.storeHistory)){e.value=l;const i=t._stringifyRow(n);t._updateRowHistory(n,o,i)}}};t._pasteTimer=setTimeout((()=>{if(t._pasteTempValues&&t._pasteTempValues.length>1){let e=[],n=[],o=[];for(let l=0;l<t._pasteTempValues.length;l++){const i=t._pasteTempValues[l];e.push(i.cell),n.push(i.oldValue),o.push(i.newValue)}t.onCellUpdate(e,n,o,(function(n){if(n){const n=t.onRowHistory;t.onRowHistory=null,t.beginUpdate();for(let t=0;t<e.length;t++){const n=e[t];l(n,o[t]),n.value=o[t]}t.endUpdate(!1),t.onRowHistory=n}}),t)}else t.onCellUpdate([o],[e],[s],(function(e){if(e){const e=t.onRowHistory;t.onRowHistory=null,l(o,s),o.value=s,t.onRowHistory=e}}),t);delete t._pasteTempValues}),100)}else if(t.onRowUpdate){const e=Object.assign({},o.row.data),l=Object.assign({},o.row.data);l[o.column.dataField]=s,o.row.updatedDate=new Date,o.row.updatedBy=t.currentUser,t.onRowUpdate([o.row.index],[o.row],[e],[l],(function(e){e&&(o.value=s)}),t)}else t.formulas&&"string"==typeof s&&/=.+/.test(s)?o.formula=t._fromHTMLEntities(s):o.value=s,t.flashCell(o.row.id,o.column.dataField)}}_pasteModeFill(e){const t=this,l=t.dataSource&&"number"==typeof t.dataSource.dataSource,n=t._pasteDataType(e),o=e.cell,i=e.selectedValues,a=e.minRowIndex,r=e.minColumnIndex,s=e.currentRowIndex,d=e.currentColumnIndex,c=e.dataField;let u=e.value;if("string"===n)/\d+/.test(u.toString())?(u=t._getPatternValue(s-a,d-r,i),void 0===u&&i[s-a]&&i[s-a][d-r]&&(u=i[s-a][d-r])):(u=t._getPatternValue(s-a,d-r,i),void 0===u&&(u=i[s-a]?i[s-a][d-r]:e.value),void 0===u&&(u=e.value)),void 0!==u&&(o.value=u);else if("bool"===n||"boolean"===n)1!==u&&"1"!==u&&!0!==u&&"true"!==u&&"TRUE"!==u&&"True"!==u||(o.value=!0);else if("date"===n||"time"===n||"dateTime"===n){const e=t.columnByDataField[c];l?o.value=u:e&&e.dataType!==n&&(o.value=null),i[s-a]&&(u=i[s-a][d-r],void 0!==u&&(o.value=u))}else if("number"===n||"float"===n||"int"===n){u=t._getPatternValue(s-a,d-r,i);const e=t.columnByDataField[c];l?o.value=u:e&&e.dataType!==n?o.value=null:o.value=null!==u?"int"===n||"integer"===n?parseInt(u):parseFloat(u):null}}_pasteSelectedCells(e,t){const l=this;l.beginUpdate();let n=l._recyclingRows,o=e.row,i=e.endRow,a=e.column,r=e.endColumn;const s=n.indexOf(o),d=n.indexOf(i),c=n.indexOf(e.endRow),u=l.viewColumns,f=u.indexOf(a),g=u.indexOf(r),m=u.indexOf(e.endColumn),_=Math.min(c,Math.min(s,d));let p=Math.max(c,Math.max(s,d)),w=!1,h=Object.keys(t).length;p-_<h&&(p=_+h-1,w=!0);const y=Math.min(m,Math.min(f,g));let S=Math.max(m,Math.max(f,g));if(t[0]){const e=Object.keys(t[0]).length;S-y<e&&(S=S+e-1,w=!0)}let v=0,R=0,C=0,x=0;for(let e in t)0===v&&(R+=Object.keys(t[e]).length),v++;for(let e=_;e<=p;e++){const o=n[e];if(o){C=0;for(let n=y;n<=S;n++){if(!u[n])continue;const i=u[n].dataField,a=o.getCell(i);let r=0;for(let s in t){if(r===x){let r=0,d=t[s];for(let s in d){if(C===r){let r=d[s],c=!0;if(t[o.id]&&t[o.id][i]&&(c=!1),c&&"none"!==l.clipboard.autoFillMode){const o={value:r,targetValue:a.value,dataField:s,index:a.row.visibleIndex,targetDataField:i,targetRowIndex:e};if(l.clipboard.onPasteValue){l.clipboard.onPasteValue(o);const e=a.value;a.value=o.value,l._setCellUndoRedo(a,e,o.value)}else o.cell=a,o.selectedValues=t,o.minRowIndex=_,o.maxRowIndex=p,o.minColumnIndex=y,o.maxColumnIndex=S,o.currentColumnIndex=n,o.currentRowIndex=e,"copy"===l.clipboard.autoFillMode?l._pasteModeCopy(o):"fillSeries"===l.clipboard.autoFillMode&&l._pasteModeFill(o)}}r++}}r++}C++,C>=R&&(C=0)}x++,x>=v&&(x=0)}}l.endUpdate(!1),w&&l._selectCellsRange(n[_],n[p],l.viewColumns[y].dataField,l.viewColumns[S].dataField),l._recycle(!1),l._refreshDataFilters()}_refreshCellSelectionRect(){const e=this,t=e._selection.selectionRect;if(!t||t&&t.captured)return;let l=e._recyclingRows,n=t.row,o=t.endRow,i=t.column,a=t.endColumn;const r=e.viewColumns;if(!a||!i)return;if(e._isVirtualMode()){if(n.id!==t.rowId&&!e.rowById[t.rowId])return t.style.height="0px",void(t.style.width="0px");n=e.rowById[t.rowId],o=e.rowById[t.endRowId]}if(!i.allowSelect||!a.allowSelect){if(i===a)return t.style.width="0px",void(t.style.height="0px");{const e=r.indexOf(i),l=r.indexOf(a);i=null,a=null;for(let t=e;t<l;t++){const e=r[t];e.allowSelect&&!i&&(i=e),a=e}if(!i||!a)return t.style.width="0px",void(t.style.height="0px")}}const s=l.indexOf(n),d=l.indexOf(o),c=r.indexOf(i),u=r.indexOf(a);let f=Math.min(s,d),g=Math.max(s,d),m=Math.min(c,u),_=Math.max(c,u);m=Math.max(0,m),f=Math.max(0,f);const p=function(e){const t=l.indexOf(e.row),n=l.indexOf(e.endRow),o=r.indexOf(e.column),i=r.indexOf(e.endColumn);f=Math.min(f,t),f=Math.min(f,n),f=Math.max(0,f),g=Math.max(g,t),g=Math.max(g,n),m=Math.min(m,o),m=Math.min(m,i),m=Math.max(0,m),_=Math.max(_,o),_=Math.max(_,i)},w=e._getParentCell(n,i.dataField),h=e._getParentCell(n,a.dataField),y=e._getParentCell(o,a.dataField),S=e._getParentCell(o,i.dataField);w&&p(w),h&&p(h),y&&p(y),S&&p(S);let v=0,R=0,C=0,x=0;t.cellValues=[];let b=[],F=[];for(let n=f;n<=g;n++){const o=l[n];if(n===f&&(v=o.top,!0!==o.freeze&&"near"!==o.freeze&&(v+=e.__frozenNearHeight),"far"===o.freeze&&(v=o.top+e.__scrollHeight+e.scrollTop-e._scrollView.hScrollBar.offsetHeight)),n===g){let t=o.top;"far"===o.freeze&&(t=o.top+e.__scrollHeight+e.scrollTop-e._scrollView.hScrollBar.offsetHeight),R=t+o.height-v,!0!==o.freeze&&"near"!==o.freeze&&(R+=e.__frozenNearHeight)}t.cellValues[o.id]=[];const i=e._isUpdating;e._isUpdating=!0,t.style.zIndex="";for(let l=m;l<=_;l++){const n=r[l].dataField,i=o.getCell(n);let a=i.value;if(void 0===a&&(a=""),r[l].freeze?b.push(r[l]):F.push(r[l]),"tags"===r[l].template)if(null!=a)if("number"==typeof a)a=null;else{const t=a.trim().split(","),n=[];if(r[l].editor&&r[l].editor.dataSource){const o=r[l].editor.collaborator?e.users:r[l].editor.dataSource;for(let e=0;e<t.length;e++)for(let l=0;l<o.length;l++){const i=o[l];if(t[e]===i.value||t[e]===i.id){n.push(i.label||i.name);break}}}a=n.join(", ")}else a=null;else if("createdBy"===r[l].template||"updatedBy"===r[l].template){for(let t=0;t<e.users.length;t++)if(e.users[t].id===o[r[l].template]){a=e.users[t].label||e.users[t].name;break}}else"createdTime"===r[l].template||"createdDate"===r[l].template?(a=o.createdDate,a&&(a=new Smart.Utilities.DateTime(a).toString("d"))):"updatedTime"!==r[l].template&&"updatedDate"!==r[l].template||(a=o.updatedTime,!a)||(a=new Smart.Utilities.DateTime(a).toString("d"));if(i.formula&&(a=i.formula),t.cellValues[o.id][n]=a,l===m&&(C=i.column.left,i.column.freeze&&"far"===i.column.freeze&&(C=e.__clientSize.width-e.__frozenFarWidth+C+e.scrollLeft-e._scrollView.vScrollBar.offsetWidth)),l===_){let t=i.column.left;i.column.freeze&&"far"===i.column.freeze&&(t=e.__clientSize.width-e.__frozenFarWidth+t+e.scrollLeft-e._scrollView.vScrollBar.offsetWidth),x=t+i.column.computedWidth-C}i.selected=!0}e._isUpdating=i}if(v-e.scrollTop<e.layout.rowMinHeight&&e.filtering.enabled&&e.filtering.filterRow.visible){const t=v;v=e.layout.rowMinHeight+e.scrollTop,R-=v-t}if(R<=0)t.classList.add("smart-visibility-hidden");else{if(t.classList.remove("smart-visibility-hidden"),0===b.length&&(t.style.zIndex=5),t.style.top=v-e.scrollTop-1+"px",e._isVirtualMode()&&(t.style.top=v+parseFloat(e.$.rowContainer.style.top)-1+"px"),e.rightToLeft)t.style.right=C-e.scrollLeft+"px";else if(t.style.left=C-e.scrollLeft+"px",C-e.scrollLeft<e.__frozenNearWidth-1){let l=0;for(let t=0;t<e._frozenNearColumns.length;t++){const n=e._frozenNearColumns[t];n&&n.autoGenerated&&n.visible&&(l+=n.width)}if(C-e.scrollLeft<l){const n=l-C+e.scrollLeft;!F.length&&b.length&&(x+=n),x-=n,t.style.left=n+C-e.scrollLeft+"px"}}t.style.height=R+1+"px",t.style.width=x+1+"px",x<0?t.classList.add("smart-visibility-hidden"):t.classList.remove("smart-visibility-hidden")}}_renderInputOverlay(e,t,l){const n=this,o=n.rowById[e];if(o&&!1!==o.allowSelect&&!o.label&&t&&n.selection.checkBoxes.enabled){n._inputOverlay&&n._inputOverlay.classList.contains("smart-input-overlay-column")&&(n._inputOverlay.parentNode&&n._inputOverlay.parentNode.removeChild(n._inputOverlay),n._inputOverlay=null),n._inputOverlay||(n._inputOverlay=document.createElement("div"),n.$.scrollView.appendChild(n._inputOverlay),n._inputOverlay.classList.add("smart-input-overlay"));let e=o.freeze?o.top:n.__frozenNearHeight+o.top;const t=Math.round((o.cellHeight-n._selectionColumn.computedWidth)/2),i=n._selectionColumn.element.parentElement.offsetLeft+n._selectionColumn.element.offsetLeft;if(n._inputOverlay.style.left=i+"px",n._inputOverlay.style.height=n._selectionColumn.computedWidth+"px",n._inputOverlay.style.width=n._selectionColumn.computedWidth+"px",n._inputOverlay.style.top=e+t-n.scrollTop+"px",o&&o.element){const e=o.element.querySelector("smart-grid-cell");e&&(n._inputOverlay.cell=e.cell)}n._inputOverlay.row=o,n._inputOverlay.onpointerdown=function(e){n._inputOverlay||(n._inputOverlay.onpointerdown=null);const t=n._inputOverlay.row,l=n._inputOverlay.cell;n.beginUpdate(),t.selected=!t.selected,n.endUpdate(!1),n.$.fireEvent("change",{started:!1,finished:!0}),n._refreshSummary(!1);const o=e.originalEvent?e.originalEvent:e,i=3===o.which;n.$.fireEvent("rowClick",{row:t,id:t.id,isRightClick:i,originalEvent:o,pageX:parseInt(o.pageX),pageY:parseInt(o.pageY)}),l&&n.$.fireEvent("cellClick",{cell:l,id:t.id,dataField:l.column.dataField,isRightClick:i,originalEvent:o,pageX:parseInt(o.pageX),pageY:parseInt(o.pageY)}),n._recycle(),n._renderInputOverlay(t.id,e,!0),e.preventDefault()},n.appearance.allowCheckBoxesSelectionAnimation&&void 0===l&&n._inputOverlay.classList.add("smart-animate"),requestAnimationFrame((()=>{n._inputOverlay&&n._inputOverlay.classList.add("smart-input-overlay-on")}))}}_selectRow(e,t){const l=this,n=l.rowById[e];if(n&&l.selection.enabled&&(!n.header||"row-resize"!==n.header.style.cursor)){if(t&&(!t.shiftKey||!l._selection.focusedCell)){const t=n.getCell(l.columns[0].dataField);l._selection.focusedCell={index:t.row.index,id:e,dataField:t.column.dataField,value:t.value}}l._lastRowsSelectionRange=null,"extended"===l.selection.mode?l._handleExtendedRowSelection(n,t):"one"===l.selection.mode?n.select():n.selected?n.unselect():n.select()}}_getParentCell(e,t){const l=this;let n=l._recyclingRows;for(let o=0;o<l._cellsMerge.length;o++){const i=l._cellsMerge[o];let a=[],r=[];if(a.push(i.row),i.rowSpan>1){const e=n.indexOf(i.row);if(e>=0)for(let t=e;t<e+i.rowSpan;t++)n[t]&&-1===a.indexOf(n[t])&&a.push(n[t])}if(r.push(i.column.dataField),i.colSpan>1){const e=l.viewColumns,t=e.indexOf(l.columnByDataField[i.column.dataField]);for(let l=t;l<t+i.colSpan;l++)e[l]&&-1===r.indexOf(e[l].dataField)&&r.push(e[l].dataField)}if(a.indexOf(e)>=0&&r.indexOf(t)>=0)return{row:i.row,column:i.column,endRow:a[a.length-1],endColumn:l.columnByDataField[r[r.length-1]]}}if(l._cellRowSpan)for(let o=0;o<l._cellRowSpan.length;o++){const o=e.visibleIndex;let i=-1,a=null;for(let e=0;e<l._cellRowSpan.length;e++){const t=l._cellRowSpan[e];if(o>t[0]&&o<t[1]){i=t[0],a=t[2];break}}if(i>=0&&a===t){const e=n[i];if(e)return{row:e,column:l.columnByDataField[t],endRow:e,endColumn:l.columnByDataField[t]}}}return null}_selectCellsRange(e,t,l,n){const o=this,i=o._selection.selectionRect;if(o._lastRowsSelectionRange&&o._lastRowsSelectionRange.id===e.id&&o._lastRowsSelectionRange.endId===t.id&&o._lastColumnSelectionRange&&o._lastColumnSelectionRange.dataField===l&&o._lastColumnSelectionRange.endDataField===n)return;o.beginUpdate(),o._clearSelection(),o._lastRowsSelectionRange={id:e.id,endId:t.id},o._lastColumnSelectionRange={dataField:l,endDataField:n},(!i||i&&!i.captured)&&o._selection.focusedCell&&o._renderCellSelectionRect(o.rowById[o._selection.focusedCell.id],o.columnByDataField[o._selection.focusedCell.dataField],o.rowById[o._lastRowsSelectionRange.endId],o.columnByDataField[o._lastColumnSelectionRange.endDataField]);let a=o._recyclingRows;const r=o.viewColumns;let s=-1,d=-1,c=a.indexOf(e),u=a.indexOf(t),f=-1;for(let e=0;e<r.length;e++){const t=r[e];t.allowSelect&&(-1===f&&(f=e),t.dataField===l&&(s=e),t.dataField===n&&(d=e))}if(-1===f)return o.endUpdate(!1),void o._recycle();-1===s?s=f:-1===d&&(d=f);let g=Math.min(c,u),m=Math.max(c,u),_=Math.min(s,d),p=Math.max(s,d);const w=function(e){const t=a.indexOf(e.row),l=a.indexOf(e.endRow),n=r.indexOf(e.column),o=r.indexOf(e.endColumn);g=Math.min(g,t),g=Math.min(g,l),m=Math.max(m,t),m=Math.max(m,l),_=Math.min(_,n),_=Math.min(_,o),p=Math.max(p,n),p=Math.max(p,o)},h=o._getParentCell(e,l),y=o._getParentCell(t,n);if(h&&w(h),y&&w(y),m<0||g<0||_<0||p<0)return o.endUpdate(!1),void o._recycle();for(let e=g;e<=m;e++){const t=a[e];if(t.allowSelect)for(let e=0;e<r.length;e++){const l=r[e];l.allowSelect&&e>=_&&e<=p&&(t.getCell(l.dataField).selected=!0)}}o.endUpdate(!1,!1),o._recycle(!0,!0,!1),o._selectionTimer&&clearTimeout(o._selectionTimer),o._selectionTimer=setTimeout((()=>{o._recycle(!0,!0,!1)}),50)}_selectRowsRange(e,t,l){const n=this;if(n._lastRowsSelectionRange&&n._lastRowsSelectionRange.id===e.id&&n._lastRowsSelectionRange.endId===t.id)return;if(n._dragDrop&&n._dragDrop.dragDetails)return;n.beginUpdate(),n._clearSelection(),n._lastRowsSelectionRange={id:e.id,endId:t.id};let o=n._recyclingRows;const i=o.indexOf(e),a=o.indexOf(t),r=Math.min(i,a),s=Math.max(i,a);if(s<0)return n.endUpdate(!1),void n._recycle();for(let e=r;e<=s;e++){const t=o[e];t&&t.allowSelect&&(t.selected=!1!==l)}n.endUpdate(!1),n._recycle()}_selectColumnsRange(e,t){const l=this;if(l._lastColumnSelectionRange&&l._lastColumnSelectionRange.dataField===e&&l._lastColumnSelectionRange.endDataField===t)return;if(l._dragDrop&&l._dragDrop.dragDetails)return;l.beginUpdate(),l._clearSelection(),l._lastColumnSelectionRange={dataField:e,endDataField:t};const n=l.viewColumns;let o=-1,i=n.length;for(let l=0;l<n.length;l++){const a=n[l];a.allowSelect&&(a.dataField===e&&(o=l),a.dataField===t&&(i=l))}const a=Math.min(o,i),r=Math.max(o,i);for(let e=0;e<n.length;e++){const t=n[e];t.allowSelect&&e>=a&&e<=r&&(t.selected=!0)}l.endUpdate(!1),l._recycle()}_selectColumn(e,t){const l=this,n=l.columnByDataField[e],o=l.viewColumns;if(!n||!l.selection.enabled||!1===n.allowSelect||!l.selection.allowColumnHeaderSelection)return;if(n&&"col-resize"===n.element.style.cursor)return;let i=!1;if(n&&(n.allowSelect||null===n.allowSelect&&!t)&&(i=!0),i&&t)if("extended"===l.selection.mode){if(t.ctrlKey||t.metaKey||t.shiftKey||(l._rangeSelectionStartColumn=n,l._rangeSelectionEndColumn=n),t.ctrlKey||t.metaKey?n.selected=!n.selected:n.selected=!0,t&&t.shiftKey){l._rangeSelectionStartColumn||(l._rangeSelectionStartColumn=n),l._rangeSelectionEndColumn=n,l._selection.columns=[];const e=o.indexOf(l._rangeSelectionStartColumn),t=o.indexOf(l._rangeSelectionEndColumn),i=Math.min(e,t),a=Math.max(e,t);for(let e=i;e<=a;e++){const t=o[e];t&&!1!==t.allowSelect&&(t.selected=!0)}}}else"one"===l.selection.mode||null===n.selected?n.selected=!0:n.selected=!n.selected}selectAllRows(){const e=this;let t=e.rows;e._selectionColumn._selecting=!0,delete e._areAllRowsSelected,e.beginUpdate();for(let e=0;e<t.length;e++)t[e].selected=!0;e._selectionColumn._selecting=!1,e.endUpdate(!1),e._refreshSummary(!1),e._recycle(!1),e._refreshCheckBoxColumnSelection(),e.$.fireEvent("change",{started:!1,finished:!0})}hasSelectedRows(){const e=this.getVisibleRows(),t=this._getSelectedRows(!0,!1);return t.length===e.length||t.length>0&&t.length<e.length||0!==t.length&&0!==e.length&&void 0}areAllRowsSelected(){const e=this;if(e._areAllRowsSelected!==this.undefined)return e._areAllRowsSelected;const t=e.getVisibleRows(),l=Object.keys(e._selection.rows).length;if(0===l||l<t.length)return!1;const n=e._getSelectedRows(!0,!1);return n.length>0&&n.length===t.length?(e._areAllRowsSelected=!0,!0):(e._areAllRowsSelected=!1,e._areAllRowsSelected)}_getSelectedRows(e,t){const l=this,n=[];let o=l.rows;if(l.rows.canNotify=!1,e&&(o=l.getVisibleRows()),l._isVirtualMode()){let e=l._selection.indexes;return l.paging.enabled&&t&&l._isVirtualMode()&&(e=e.slice(0,l.paging.pageSize)),l.rows.canNotify=!0,Object.keys(e).length}l.paging.enabled&&t&&(o=l._isVirtualMode()?o.slice(0,l.paging.pageSize):o.slice(l.paging.pageIndex*l.paging.pageSize,(l.paging.pageIndex+1)*l.paging.pageSize));for(let e=0;e<o.length;e++){const t=o[e];t.getProperty("selected")?n.push(t):(t.canNotify=!1,t.selected=!1,t.canNotify=!0)}return l.rows.canNotify=!0,n}_dragSelectionEnd(e){const t=this;t._dragSelectionStartDataField=null,t._dragSelectionStartRow=null,t.__selectionStarted&&(t.$.fireEvent("change",{started:!1,finished:!0,originalEvent:e}),t._refreshSummary(),delete t.__selectionStarted,delete t.__selectionStartedFired),t.selection.allowDragSelection&&t.selection.isDragging&&(t.selection.isDragging=!1,t._autoScrollSelectionDragInterval&&(clearInterval(t._autoScrollSelectionDragInterval),t.editing.isEditing||t._recycle()))}_dragSelection(e){const t=this;if("extended"!==t.selection.mode||!1===t.selection.allowDragSelection)return;if(!t._dragSelectionStartDataField&&!t._dragSelectionStartRow)return;const l=()=>{t.__selectionStarted&&!t.__selectionStartedFired&&(t.$.fireEvent("change",{started:!0,finished:!1,originalEvent:e}),t.__selectionStartedFired=!0),t.$.fireEvent("change",{started:!1,finished:!1,originalEvent:e})};if(!t.selection.allowCellSelection||!t._dragSelectionStartDataField||t._columnResizeLine||t._dragSelectionStartDataField.startsWith("_")||!t._dragSelectionStartRow||t._rowResizeLine){if(t._dragSelectionStartRow&&!t._rowResizeLine&&(t.selection.allowRowSelection&&!t._dragSelectionStartDataField.startsWith("_")||t.selection.allowRowHeaderSelection&&t._dragSelectionStartDataField.startsWith("_"))){const n=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let o=null;for(let e=0;e<n.length;e++){const t=n[e];if(t.getAttribute("data-id")){o=t.row,!o&&t.cell&&(o=t.cell.row);break}}let i=!0;t._lastRowsSelectionRange&&t._lastRowsSelectionRange.id===t._dragSelectionStartRow.id&&o&&t._lastRowsSelectionRange.endId===o.id&&(i=!1),o&&!o.allowSelect&&(i=!1),o&&o.allowSelect&&t._selectRowsRange(t._dragSelectionStartRow,o),t._autoScrollSelectionDragInterval&&clearInterval(t._autoScrollSelectionDragInterval),t.selection.isDragging=!0,i&&l(),t._autoScrollSelectionDragInterval=setInterval((function(){const l=t.$.scrollView.getBoundingClientRect();e.clientY<=l.top+20?t.scrollTop-=15:e.clientY>=l.top+l.height-20&&(t.scrollTop+=15)}),25)}else if(t._dragSelectionStartDataField&&!t._columnResizeLine&&!t._dragSelectionStartDataField.startsWith("_")&&t.selection.allowColumnHeaderSelection){const n=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let o=null;for(let e=0;e<n.length;e++){const t=n[e];if(t.getAttribute("data-field")){o=t.getAttribute("data-field");break}}o&&t._selectColumnsRange(t._dragSelectionStartDataField,o),t._autoScrollSelectionDragInterval&&clearInterval(t._autoScrollSelectionDragInterval);let i=!0;t._lastColumnSelectionRange&&t._lastColumnSelectionRange.dataField===t._dragSelectionStartDataField&&t._lastColumnSelectionRange.endDataField===o&&(i=!1),i&&l(),t.selection.isDragging=!0,t._autoScrollSelectionDragInterval=setInterval((function(){const l=t.$.scrollView.getBoundingClientRect();e.clientX<=l.left+20?t.scrollLeft-=15:e.clientX>=l.left+l.width-20&&(t.scrollLeft+=15)}),25)}}else{const n=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let o=null;for(let e=0;e<n.length;e++){const t=n[e];if(t.getAttribute("data-field")){o=t.getAttribute("data-field");break}}let i=null;for(let e=0;e<n.length;e++){const t=n[e];if(t.getAttribute("data-id")){i=t.row;break}}if(!i&&n.length&&n[0].classList.contains("smart-grid-scroll-view")){i=t._recyclingRows[t._recyclingRows.length-1];const l=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,i.element.getBoundingClientRect().top);for(let e=0;e<l.length;e++){const t=l[e];if(t.getAttribute("data-field")){o=t.getAttribute("data-field");break}}}if(o&&i){if(i.id===t._dragSelectionStartRow.id&&t._dragSelectionStartDataField===o)return;if(o&&o.startsWith("_"))return;let e=!0;t._lastRowsSelectionRange&&t._lastRowsSelectionRange.id===t._dragSelectionStartRow.id&&t._lastRowsSelectionRange.endId===i.id&&t._lastColumnSelectionRange&&t._lastColumnSelectionRange.dataField===t._dragSelectionStartDataField&&t._lastColumnSelectionRange.endDataField===o&&(e=!1),t._selectCellsRange(t._dragSelectionStartRow,i,t._dragSelectionStartDataField,o),t._removeCellContentPopup(),e&&l()}t.selection.allowDragSelectionAutoScroll&&(t._autoScrollSelectionDragInterval&&clearInterval(t._autoScrollSelectionDragInterval),t.selection.isDragging=!0,t._autoScrollSelectionDragInterval=setInterval((function(){const l=t.$.scrollView.getBoundingClientRect();e.clientX<=l.left+20?t.scrollLeft-=15:e.clientX>=l.left+l.width-20&&(t.scrollLeft+=15),e.clientY<=l.top+20?t.scrollTop-=15:e.clientY>=l.top+l.height-20&&(t.scrollTop+=15)}),25))}}select(e,t){const l=this;l.isInitialized&&(!t&&void 0!==e&&l._selection&&l._selection.rows[e]||(l._setSelection(e,t),l.$.fireEvent("change",{started:!1,finished:!0}),l._refreshSummary()))}selectRowsByIndex(e){const t=this;e||(e=[]),requestAnimationFrame((()=>{if("extended"!==t.selection.mode&&"many"!==t.selection.mode&&t._clearSelection(),t._isVirtualMode()){let l=[];for(let t=0;t<e.length;t++)l[e[t]]=!0;return t._selection.indexes=l,void t._recycle()}t.beginUpdate();for(let l in e){const e=t.rows[l];e&&t._setSelection(e.id)}t.endUpdate(!1),t._recycle()}))}selectRowsRange(e,t){const l=this,n=l.rowById[e],o=l.rowById[t];n&&o&&(l._selectRowsRange(n,o),l.$.fireEvent("change",{started:!1,finished:!0}),l._refreshSummary())}selectCellsByQuery(e){const t=this,l=t.findCells(e);requestAnimationFrame((()=>{"extended"!==t.selection.mode&&"many"!==t.selection.mode&&t._clearSelection(),t.beginUpdate();for(let e in l){const n=l[e][0],o=l[e][1];t._setSelection(n,o)}t.endUpdate(!1),t._recycle()}))}selectRowsByQuery(e,t,l){const n=this,o=n.find(e,t,l).map((e=>e.$.id));o.length&&n.selectRows(o)}selectRows(e){const t=this;e||(e=[]),requestAnimationFrame((()=>{"extended"!==t.selection.mode&&"many"!==t.selection.mode&&t._clearSelection(),t.beginUpdate();for(let l in e)t._setSelection(e[l]);t.endUpdate(!1),t._recycle()}))}selectCells(e,t){const l=this;e||(e=[]),requestAnimationFrame((()=>{"extended"!==l.selection.mode&&"many"!==l.selection.mode&&l._clearSelection(),l.beginUpdate();for(let n in e)for(let o=0;o<t.length;o++)l._setSelection(e[n],t[o]);l.endUpdate(!1),l._recycle()}))}selectRange(e,t,l,n){const o=this;!function(){const i=new KeyboardEvent("keydown",{shiftKey:!0});requestAnimationFrame((()=>{"extended"!==o.selection.mode&&"many"!==o.selection.mode&&o._clearSelection(),o.beginUpdate(),o._setSelection(e,t),o._setSelection(l,n,i),o.ensureVisible(e,t),o.endUpdate(!1),o._refreshSummary(!1),o._recycle()}))}(),o.$.fireEvent("change",{started:!1,finished:!0})}unselect(e,t){const l=this;if(l._selection){if(l._selection.rows&&l._selection.rows[e]){delete l._selection.rows[e];const t=l.rowById[e];t&&t.unselect()}l._selection.columns&&l._selection.columns[t]&&delete l._selection.columns[t],l._selection.cells&&(l._selection.cells["row"+e]&&(delete l._selection.cells["row"+e][t],1===Object.getOwnPropertyNames(l._selection.cells["row"+e]).length&&delete l._selection.cells["row"+e]),l._selection.cells["column"+t]&&(delete l._selection.cells["column"+t][e],1===Object.getOwnPropertyNames(l._selection.cells["column"+t]).length&&delete l._selection.cells["column"+t])),l.$.fireEvent("change",{started:!1,finished:!0}),l._refreshSummary()}}getSelectedRows(){const e=this;let t=[];if(e._selection.rows&&Object.keys(e._selection.rows).length>0){const l=Object.keys(e._selection.rows);if(e._isVirtualMode()){for(let e in l){const n=l[e];t.push([n,{}])}return t}for(let n in l){const o=l[n],i=e.rowById[o];if(!i)continue;const a={};for(let e in i.data)switch(e){case"$":case"parent":case"level":case"leaf":case"children":continue;default:a[e]=i.data[e]}t.push([i.id,a])}}return t}getSelectedRowIndexes(){const e=this;return e._selection.indexes&&Object.keys(e._selection.indexes).length>0?e._selection.indexes:[]}getSelectedRowIds(){const e=this;let t=[];if(e._isVirtualMode())return e._selection.rows&&Object.keys(e._selection.rows).length>0?e._selection.rows:void 0;if(e._selection.rows&&Object.keys(e._selection.rows).length>0){const l=Object.keys(e._selection.rows);for(let n in l){const o=l[n],i=e.rowById[o];i&&t.push(i.id)}}return t}getSelectedCells(e){const t=this;let l=[];if(t._selection.cells)for(let n in t._selection.cells)if(n.startsWith("row")){let o=n.replace("row",""),i=null;for(let a in t._selection.cells[n])if(i=a.replace("column",""),l||(l=[]),!1===e)l.push([o,i]);else{const e=t.getCellValue(o,i);l.push([o,i,e])}}return l}getSelection(){const e=this;let t=null,l=null,n=null,o=null;if(e._selection.rows&&Object.keys(e._selection.rows).length>0){const l=Object.keys(e._selection.rows);t=[];for(let n=0;n<l.length;n++){const o=l[n];t.push({id:o,row:e.rowById[o]})}}if(e._selection.columns&&Object.keys(e._selection.columns).length>0){const t=Object.keys(e._selection.columns);l=[];for(let n=0;n<t.length;n++){const o=t[n];l.push({dataField:o,column:e.columnByDataField[o]})}}if(e._selection.cells)for(let t in e._selection.cells)if(t.startsWith("row")){let l=t.replace("row",""),o=null;for(let i in e._selection.cells[t])o=i.replace("column",""),n||(n=[]),n.push({id:l,dataField:o,column:e.columnByDataField[o],row:e.rowById[l]})}return e._selection.focusedCell&&(e._isVirtualMode(),o={index:e._selection.focusedCell.index,id:e._selection.focusedCell.id,dataField:e._selection.focusedCell.dataField}),{rows:t,columns:l,cells:n,focused:o}}focusAndSelect(e,t){const l=this;if(l.focus(),l.selection.enabled&&l.selection.allowCellSelection)l._focusCell(e,t);else{const t=l.rowById[e];if(!t)return;l.beginUpdate(),l._selection.rows=[],l._selection.columns=[],l._selection.cells=[],l._selection.indexes=[],l._setSelection(e),l._selection.focusedCell={id:t.id,value:null,index:t.index,dataField:l.columns[0].dataField},l.endUpdate(!1)}}_focusCell(e,t){const l=this;if(l.selection.enabled&&l.selection.allowCellSelection){const n=l.rowById[e];if(!n)return;l.beginUpdate(),l._selection.rows=[],l._selection.columns=[],l._selection.cells=[],l._selection.indexes=[],l._setSelection(e,t);const o=n.getCell(t);o&&(l._selection.focusedCell={id:o.row.id,value:o.value,dataField:t,index:o.row.index}),l.endUpdate(!1)}}_clearSelection(e){const t=this;if(t._selection.rows=[],t._selection.columns=[],t._selection.cells=[],t._selection.indexes=[],e&&(t._selection.focusedCell=null,t._selection.selectionRect)){const e=t._selection.selectionRect;e.parentNode.removeChild(e);const l={down:"pointerdown",move:"pointermove",up:"pointerup"};Smart.Utilities.Core.isMobile&&(l.down="touchstart",l.move="touchmove",l.up="touchend"),document.removeEventListener(l.move,e.onMove),document.removeEventListener(l.up,e.onUp),document.removeEventListener(l.down,e.onDown),t._selection.selectionRect=null}t._recycle(),t._refreshCheckBoxColumnSelection()}_getSelectionCellValues(){const e=this;if(e._selection.selectionRect)return e._selection.selectionRect.cellValues;const t=e.viewColumns;if(e._selection.rows.length>0){let l=[];for(let n in e._selection.rows){const o=e.rowById[n];for(let e=0;e<t.length;e++){const i=t[e];i&&(l[n]||(l[n]=[]),i.autoGenerated||(l[n][i.dataField]=o.data[i.dataField]))}}return l}if(e._selection.columns.length>0){let t=[];for(let l in e._selection.columns){const n=e.columnByDataField[l];if(n)for(let l=0;l<e._recyclingRows.length;l++){const o=e._recyclingRows[l];o&&(t[o.id]||(t[o.id]=[]),t[o.id][n.dataField]=o.data[n.dataField])}}return t}if(e._selection.cells&&Object.keys(e._selection.cells).length>0){const t=e.getSelection();if(t.cells){let e=[];for(let l in t.cells){const n=t.cells[l],o=n.id;e[o]||(e[o]=[]),e[o][n.column.dataField]=n.row.data[n.column.dataField]}return e}}}_clipboardHandler(e,t){const l=this;if(l.clipboard.enabled){if((t.ctrlKey||t.metaKey)&&("c"===e||"x"===e)){const t=l._getSelectionCellValues();let n="",o=Object.keys(t).length,i=0;for(let a in t){let r="",s=Object.keys(t[a]).length,d=0;for(let e in t[a])r+=t[a][e],d++,d<s&&(r+="\t");if(n+=r,i++,i<o&&(n+="\r\n"),"x"===e&&l.editing.enabled){const e=l.getSelection();if(e.cells){l.beginUpdate();for(let t=0;t<e.cells.length;t++){const n=e.cells[t],o=l.rowById[n.id];if(o){const e=o.getCell(n.dataField),t=l._pasteDataType({cell:e,value:e.value});let i=null;"int"!==t&&"number"!==t||(i=0),"string"===t&&(i=""),"boolean"!==t&&"bool"!==t||(i=!1),"date"===t&&(i=new Date),e.column.allowNull&&(i=null);const a=e.oldValue;if(l.onCellUpdate)l.onCellUpdate([e],[a],[i],(function(t){t&&(e.value=i)}),l);else if(l.onRowUpdate){const t=Object.assign({},e.row.data),n=Object.assign({},e.row.data);n[e.column.dataField]=i,l.onRowUpdate([e.row.index],[e.row],[t],[n],(function(t){t&&(e.value=i)}),l)}else e.value=i}}l.endUpdate(!1),l._recycle()}}}if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(n).then((function(){}),(function(){})),Smart.Utilities.Core.Browser.Firefox&&(l._clipboardText=n);else{const e=document.createElement("textarea");e.value=n,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select(),setTimeout((()=>{document.execCommand("copy"),e.remove(),l._clipboardText=n}),25)}}if(t.shiftKey&&" "===e&&l.editing.addNewRow.visible&&(l._keyboardAdd=!0,l._addNewGridRow(),l._keyboardAddTimer&&clearTimeout(l._keyboardAddTimer),l._keyboardAddTimer=setTimeout((()=>{l._keyboardAdd=!1}),300)),(t.ctrlKey||t.metaKey)&&"v"===e&&l.editing.enabled){const e=window.Smart.Utilities.Core.Browser.Firefox;if(navigator.clipboard&&!navigator.clipboard.readText&&!e)return;const t=e=>{if(!e)return;const t=[],n=e.trim().split("\r");for(let e=0;e<n.length;e++){const l=n[e].split("\t");let o={};for(let e=0;e<l.length;e++)o[e]=l[e].trim(),void 0!==o[e]&&"undefined"!==o[e]||(o[e]="");t[e]=o}const o=l._selection.selectionRect;if(o)l._pasteSelectedCells({row:o.row,endRow:o.endDragRow,column:o.column,endColumn:o.endColumn},t);else{let e=null,n=null;for(let t in l._selection.rows){const o=l.rowById[t];e||(e=o),n||(n=o),e.visibleIndex>o.visibleIndex&&(e=o),n.visibleIndex<o.visibleIndex&&(n=o)}if(e&&n&&l._pasteSelectedCells({row:e,endRow:n,column:l.firstColumn(),endColumn:l.lastColumn()},t),0===l._selection.rows.length){const o=l.getSelectedCells();let i=null,a=null;for(let t=0;t<o.length;t++){const r=l.rowById[o[t][0]];if(!r)continue;e||(e=r),n||(n=r);const s=l.columnByDataField[o[t][1]];i||(i=a=s),i&&i.visibleIndex>s.visibleIndex&&(i=s),a&&a.visibleIndex<s.visibleIndex&&(a=s),e.visibleIndex>r.visibleIndex&&(e=r),n.visibleIndex<r.visibleIndex&&(n=r)}l._pasteSelectedCells({row:e,endRow:n,column:i,endColumn:a},t)}}};if(!window.isSecureContext||e){if(document.activeElement&&"INPUT"===document.activeElement.nodeName)return!0;const e=document.createElement("textarea");return e.style.position="absolute",e.style.left="-1000px",e.style.top="-1000px",document.body.appendChild(e),e.select(),void setTimeout((()=>{l._clipboardSelection=new Array;let n=e.value;0===n.length&&window.clipboardData&&(e.val(window.clipboardData.getData("Text")),n=e.value);let o=n.split("\n");for(let e=0;e<o.length;e++)if(o[e].split("\t").length>0){var i=o[e].split("\t");if(1===i.length&&e===o.length-1&&""===i[0])continue;i.length>0&&l._clipboardSelection.push(i)}l._clipboardText=l._clipboardSelection.toString(),t(n.trim().replaceAll("\n","\r")),e.remove(),l.focus()}),100)}navigator.clipboard.readText().then((e=>{t(e)}))}}}_setRemoveUndoRedo(e){const t=this;if(!t.isInitialized)return;const l=Smart.Utilities.Core.createGUID().replace(/-/gi,"");if(!t._undoRedoAction){t._removeUndoRedoHigherIndexes();const n=t.getRowData(e.id);t._undoRedo.push({action:"remove",data:n,index:e.visibleIndex,uid:l}),t._undoRedoIndex=t._undoRedo.length-1}}_setAddUndoRedo(e){const t=this;if(!t.isInitialized)return;const l=Smart.Utilities.Core.createGUID().replace(/-/gi,"");if(!t._undoRedoAction){let n=!1;for(let l=0;l<t._undoRedo.length;l++){const o=t._undoRedo[l];"add"===o.action&&o.index===e.index&&(n=!0)}if(n)return;t._removeUndoRedoHigherIndexes();const o=t.getRowData(e.id);t._undoRedo.push({action:"add",data:o,index:e.visibleIndex,uid:l}),t._undoRedoIndex=t._undoRedo.length-1}}_removeUndoRedoHigherIndexes(){const e=this,t=e._undoRedoIndex;t>=0?e._undoRedo.splice(t+1,e._undoRedo.length-t):-1===t&&(e._undoRedo=[])}_setCellUndoRedo(e,t,l){const n=this;if(!n.isInitialized)return;const o=Smart.Utilities.Core.createGUID().replace(/-/gi,"");n._setCellUndoRedoTimer&&clearTimeout(n._setCellUndoRedoTimer),n._undoRedoAction||(n._pasteUndoRedoValues||(n._pasteUndoRedoValues=[]),void 0===t&&(t=null),n._pasteUndoRedoValues.push({cell:e,index:e.row.index,dataField:e.column.dataField,oldValue:t,newValue:l}),n._setCellUndoRedoTimer=setTimeout((()=>{delete n._setCellUndoRedoTimer,n._removeUndoRedoHigherIndexes(),n._undoRedo||(n._undoRedo=[]),n._pasteUndoRedoValues.length>1?n._undoRedo.push({action:"updateMultiple",items:n._pasteUndoRedoValues,uid:o}):n._undoRedo.push({action:"update",index:e.row.visibleIndex,cell:e,dataField:e.column.dataField,oldValue:t,newValue:l,uid:o}),n._undoRedoIndex=n._undoRedo.length-1,n._pasteUndoRedoValues=[]}),50))}_undoRedoHandler(e){const t=this,l=e.key;if(e.ctrlKey||e.metaKey){if("z"===l)return t.undo(),void e.preventDefault();if("y"===l)return t.redo(),void e.preventDefault()}}_updateMultiple(e,t){const l=this;let n=9999999,o=0,i=999999,a=0,r=l._recyclingRows,s=[],d=[],c=[];l.beginUpdate();for(let u=0;u<e.items.length;u++){const f=e.items[u],g=r[f.index];if(g){const e=g.id,r=f.dataField,u=t?f.oldValue:f.newValue,m=l.columnByDataField[r],_=l.viewColumns.indexOf(m),p=g.getCell(r);p&&(s.push(p),d.push(p.value),c.push(u)),i=Math.min(i,_),a=Math.max(a,_),n=Math.min(n,g.visibleIndex),o=Math.max(o,g.visibleIndex),l.setCellValue(e,r,u)}}l.onCellUpdate&&s.length&&l.onCellUpdate(s,d,c,(function(){}),l),l._focusCell(r[n].id,l.viewColumns[i].dataField),l._selectCellsRange(r[n],r[o],l.viewColumns[i].dataField,l.viewColumns[a].dataField),delete l._undoRedoAction,l.endUpdate(!1)}redo(){const e=this,t=e._undoRedoIndex,l=e._undoRedo[t+1];if(l)switch(e._undoRedoIndex++,e._undoRedoAction=!0,l.action){case"add":e.addRow(l.data,!0);break;case"remove":{const t=e._recyclingRows[l.index];t&&(e.removeRow(t.id),delete e._undoRedoAction);break}case"update":{const t=e.rows[l.index];if(t){const n=t.id,o=l.dataField,i=l.newValue,a=l.oldValue,r=t.getCell(o);r&&(e.setCellValue(n,o,i),e._focusCell(n,o),e.onCellUpdate&&e.onCellUpdate([r],[a],[i],(function(){e.onCellUpdated&&e.onCellUpdated([r.row.index],[r.row],[r.column],[r.row.data],[a],[i],e),e._onCellUpdated&&e._onCellUpdated(r.row.index,r.row,r.column,r.row.data,a,i)}),e))}delete e._undoRedoAction;break}case"updateMultiple":e._updateMultiple(l,!1)}else delete e._undoRedoAction}undo(){const e=this,t=e._undoRedoIndex,l=e._undoRedo[t];if(l)switch(e._undoRedoIndex--,e._undoRedoAction=!0,l.action){case"add":{const t=e._recyclingRows[l.index];t&&(e.removeRow(t.id),delete e._undoRedoAction);break}case"remove":{const t=l.data;t&&(e._recyclingRows[l.index]?e.insertRow(t,l.index):e.addRow(t,!0));break}case"update":{const t=e.rows[l.index];if(t){const n=t.id,o=l.dataField,i=l.oldValue;let a=e._cellsUpdatedValues?e._cellsUpdatedValues[n+"_"+o]:void 0;void 0!==a&&delete e._cellsUpdatedValues[n+"_"+o];const r=t.getCell(o);r&&(void 0===a&&(a=r.value),e.setCellValue(n,o,i),e._focusCell(n,o),e.onCellUpdate&&e.onCellUpdate([r],[a],[i],(function(){e.onCellUpdated&&e.onCellUpdated([r.row.index],[r.row],[r.column],[r.row.data],[a],[i],e),e._onCellUpdated&&e._onCellUpdated(r.row.index,r.row,r.column,r.row.data,a,i)}),e))}delete e._undoRedoAction;break}case"updateMultiple":e._updateMultiple(l,!0)}else e._currentUndoRedo=e._undoRedo[0],delete e._undoRedoAction}_keyDownHandler(e){const t=this;if("grid"!==t.view)return;if(t.onKey&&(t.onKey(e),e.defaultPrevented))return;let l=e.key;if(t.disabled||t.displayLoadingIndicator)return;if(t._undoRedoHandler(e),0===t.dataSource.length)return;if("CapsLock"===l)return;if("Escape"===l&&(t.editing.editRow||t.editing.editCell)){t.closeMenu(),t.cancelEdit();let l=t.getSelection().focused;return void(l&&l.dataField&&t._setSelection(l.id,l.dataField,e))}if(t.editing.editRow||t.editing.editCell||t.filtering.filterRow.cell)return;t.rightToLeft&&("ArrowLeft"===l?l="ArrowRight":"ArrowRight"===l&&(l="ArrowLeft")),t._refreshCellSelectionRect();const n=t.getSelection();let o=n.focused;if(!n.focused){if(t.editing.enabled&&!0!==t.editing.isEditing&&("F2"===l||"Enter"===l)&&n.columns&&n.columns.length>0){const e=n.columns[n.columns.length-1];e.column.allowHeaderEdit&&t._beginColumnEdit(e.column)}return void(t.menu&&t.menu.classList.contains("open")&&"Escape"===l&&t.closeMenu())}if(e.shiftKey&&e.ctrlKey&&" "===l){const e=t.rowById[o.id];if(e){const t=e.getCell(o.dataField);if(t)return void t.autoWrap()}}const i=t._getParentCell(t.rowById[o.id],o.dataField);if(i&&("ArrowLeft"===l?(o.id=i.row.id,o.dataField=i.column.dataField):"ArrowRight"===l?(o.id=i.row.id,o.dataField=i.endColumn.dataField):"ArrowUp"===l?(o.id=i.row.id,o.dataField=i.column.dataField):"ArrowDown"===l&&(o.id=i.endRow.id,o.dataField=i.column.dataField)),t._selection.selectionRect&&e.shiftKey&&!e.ctrlKey&&!e.metaKey?(t._selection.selectionRect.endRow&&(o.id=t._selection.selectionRect.endRow.id),t._selection.selectionRect.endColumn&&(o.dataField=t._selection.selectionRect.endColumn.dataField)):t.selection.allowRowSelection&&!t.selection.allowCellSelection&&void 0!==t._rangeSelectionEndRow&&(o.id=t._rangeSelectionEndRow.id),t._clipboardHandler(l,e),((e.ctrlKey||e.metaKey)&&"x"!==l&&"c"!==l&&"v"!==l&&"Control"!==l||t.selection.allowCellSelection&&"Tab"===l)&&(t._selection.rows=[],t._selection.columns=[],t._selection.cells=[],t._selection.indexes=[]),"Escape"===l)return t.closeMenu(),t.cancelEdit(),void t._setSelection(o.id,o.dataField,e);if(t.hasMenu())return;if(e.shiftKey&&"Enter"===l&&t.rowDetail.dialog.enabled&&!t.rowDetail.dialog.visible){const l=t.rowById[o.id];if(l)return l.showDetail=!0,e.preventDefault(),void e.stopPropagation()}if(e.ctrlKey||e.metaKey){let n=!1;"f"===l&&(t.$.headerBar&&t.$.headerBar.openSearchPanel(),n=!0),"s"===l&&(t.$.headerBar&&t.$.headerBar.openSortPanel(),n=!0),"d"===l&&(t.$.headerBar&&t.$.headerBar._openDownloadMenu(),n=!0),"u"===l&&(t.$.headerBar&&t.$.headerBar.openFilterPanel(),n=!0),"w"===l&&(t.$.headerBar&&t.$.headerBar._openViewsMenu(),n=!0),n&&(e.stopPropagation(),e.preventDefault())}if(e.altKey){if("ArrowDown"===l){const l=t.columnByDataField[o.dataField];l&&t.hasColumnMenu(l)&&(l.element._showActionButton(),l.onAction(),t.menu&&t.menu.querySelector("smart-menu").$.dispatch(e))}else"ArrowUp"===l&&t.closeMenu();if("s"===l.toLowerCase()){const e=t.columnByDataField[o.dataField];e&&(e.sorted?"asc"===e.sortOrder?t.sortBy(e.dataField,"desc"):t.sortBy(e.dataField,null):t.sortBy(e.dataField,"asc"))}if("g"===l.toLowerCase()){const e=t.columnByDataField[o.dataField];e&&(e.group=!e.group)}return}const a=function(l,n){const o=(l,n)=>{if("extended"!==t.selection.mode&&"many"!==t.selection.mode&&t._clearSelection(!0),"many"===t.selection.mode){if(" "===e.key)t._setSelection(l,n,e);else{const e=t.rowById[l].getCell(n);t._selection.focusedCell={id:e.row.id,value:e.value,dataField:n,index:e.row.index}}return t.ensureVisible(l,n),void t._recycle()}t.beginUpdate(),t._setSelection(l,n,e),t.ensureVisible(l,n),t.endUpdate(!1,!1),"ArrowDown"===e.key||"ArrowUp"===e.key?t._recycle(!1,!0):t._recycle(),e.shiftKey?t.__selectionStarted&&!t.__selectionStartedFired?(t.$.fireEvent("change",{started:!0,finished:!1}),t.__selectionStartedFired=!0):t.$.fireEvent("change",{started:!1,finished:!1}):(t.$.fireEvent("change",{started:!1,finished:!0}),t._refreshSummary())};if(t._isVirtualMode()){t._keyboardNavigationTimer&&clearTimeout(t._keyboardNavigationTimer);const e=e=>{for(let l=0;l<t.rows.length;l++){const n=t.rows[l];if(n.index===e)return n.id}return null},i=l,a=JSON.parse(JSON.stringify(t._selection.focusedCell));t._selection.focusedCell.index=i,t._selection.focusedCell.dataField=n;const r=t.rows[0],s=r.height;if(-1===i)return;const d=t._scrollView.hScrollBar,c="virtual"!==t.scrolling?r.top:i*s;let u=0;if(t.paging.enabled||(c+d.offsetHeight+t.__frozenNearHeight>t._scrollView.scrollTop+t.$.scrollView.offsetHeight-t.__frozenFarHeight?(t._scrollView.scrollTop=c-t.$.scrollView.offsetHeight-t.__frozenFarHeight+d.offsetHeight,u=50):c<=t._scrollView.scrollTop&&(t._scrollView.scrollTop=c,u=50)),t._onDataUpdated||(t._onDataUpdated=()=>{t._recycle();const l=e(t._selection.focusedCell.index);t.rowById[l]?o(l,t._selection.focusedCell.dataField):t.paging.enabled&&(t._selection.focusedCell=a),t._onDataUpdated=null}),t.paging.enabled){const l=e(t._selection.focusedCell.index);t.rowById[l]?o(l,t._selection.focusedCell.dataField):t._selection.focusedCell=a}else t._keyboardNavigationTimer=setTimeout((()=>{const l=e(t._selection.focusedCell.index);t.rowById[l]&&o(l,t._selection.focusedCell.dataField)}),u)}else requestAnimationFrame((()=>{o(l,n)})),e.stopPropagation(),e.preventDefault()};switch("Enter"!==l||!t.editing.enabled||"cell"!==t.editing.mode||t.editing.isEditing||t._editDownKey||(l="F2"),l){case"Tab":{if("none"===t.selection.tabKeyBehavior)return;const l=e.shiftKey?t.prevColumn(o.dataField):t.nextColumn(o.dataField);if(l&&t.selection.allowCellSelection){const n=t.rowById[o.id].getCell(l.dataField);t._selection.focusedCell={id:n.row.id,value:n.value,dataField:l.dataField,index:n.row.index},t._setSelection(o.id,l.dataField,e),t.ensureVisible(o.id,l.dataField),t.focus(),e.stopPropagation(),e.preventDefault()}else{let l=e.shiftKey?t.prevRow(o.id):t.nextRow(o.id),n=e.shiftKey?t.lastColumn().dataField:t.firstColumn().dataField;if(t.editing.addNewRow.autoCreate&&!e.shiftKey&&o.id===t.lastRow().id&&(t.addUnboundRow(1),l=t.lastRow()),!l)return;e.shiftKey&&(t._selection.focusedCell=null),a(t._isVirtualMode()?l.index:l.id,n)}t.$.fireEvent("change",{started:!1,finished:!0}),t._refreshSummary();break}case" ":case"F2":{const n=t.rowById[o.id];if(!n||t.editing.editCell)return;if(e.ctrlKey||e.metaKey)return;if(" "===l&&t.dataSource.boundHierarchy&&(n.checked=!n.checked),t.editing.enabled&&!e.shiftKey){const e=t.getSelectedCells();let i=!1;if(e.length>0){let l=[];for(let n=0;n<e.length;n++){const o=e[n],i=o[1],a=t.columnByDataField[i];!a||"bool"!==a.dataType&&"boolean"!==a.dataType||l.push(o)}if(l.length>0){i=!0,t.beginUpdate();const e=l[0],o=e[1],a=e[0],r=e[2],s=t.columnByDataField[o];t.$.fireEvent("beginEdit",{id:null,dataField:o,row:a,column:s,cell:null,data:null,value:r});const d=[],c=[],u=[],f=[],g=[];for(let e=0;e<l.length;e++){const n=l[e],o=n[1],i=n[0],a=n[2],r=t.rowById[i],m=r.getCell(o);g.push(r),f.push(t.columnByDataField[s]),u.push(m),c.push(!a),d.push(a),t.setCellValue(i,o,!a)}t.onCellUpdate&&t.onCellUpdate(u,d,c,(function(){}),t),t.$.fireEvent("endEdit",{id:n?n.id:null,dataField:o,row:n,column:s,cell:e,data:n?n.data:null,value:!r}),t.endUpdate(!1)}}i||(t._beginEdit(n,o.dataField),setTimeout((function(){if(t.editing.editCell&&t.editing.editCell.column.dataType.indexOf("bool")>=0){const e=t.editing.editCell.editor.instance,n=e.getValue();" "===l&&e.setValue(!n)}}),50))}else t.selection.enabled&&"many"===t.selection.mode&&(t._isVirtualMode()?a(o.index,o.dataField):a(o.id,o.dataField));break}case"Delete":case"Backspace":{const e=t.rowById[o.id];if(!e||t.editing.editCell)return;if(t.editing.enabled&&(e.getCell(o.dataField).value,n.cells)){t.beginUpdate();for(let e=0;e<n.cells.length;e++){const l=n.cells[e],o=t.rowById[l.id];if(o){const e=o.getCell(l.dataField);if(!e.column.allowEdit)continue;if("image"===e.column.template){const l=e.value,n=l&&l.indexOf("[{")>=0?JSON.parse(l):[];for(let e=0;e<n.length;e++){if(t.uploadSettings.removeUrl){let l=new FormData,o=new XMLHttpRequest,i=n[e].value;l.append(t.uploadSettings.name,i),o.open("POST",t.uploadSettings.removeUrl),o.send(l)}t.uploadSettings.onUploadRemove&&t.uploadSettings.onUploadRemove(n[e])}}const n=t._pasteDataType({cell:e,value:e.value});let i=null;"int"!==n&&"number"!==n||(i=0),"string"===n&&(i=""),"boolean"!==n&&"bool"!==n||(i=!1),"date"===n&&(i=new Date),e.column.allowNull&&(i=null),e.formula=null;const a=e.value;if(t.dataSource&&t.dataSource.virtualDataSource){const l={};l[e.column.dataField]=i,t.editing.batch?t._batchUpdateCell(e.row,e.column,i,e.value):t.updateRow(e.row.id,l)}else if(t._setCellUndoRedo(e,a,i),t.onCellUpdate){t._pasteTempValues||(t._pasteTempValues=[]);const n=i;t._pasteTempValues.push({id:e.row.id,cell:e,dataField:l.column.dataField,oldValue:a,newValue:n}),t._pasteTimer&&clearTimeout(t._pasteTimer),t._pasteTimer=setTimeout((()=>{const l=(e,l)=>{const n=e.row;if(n){let o=null;if(t.storeHistory&&(o=t._stringifyRow(n)),l!==(void 0!==e.value?e.value:"")&&(n.updatedDate=new Date,n.updatedBy=t.currentUser,t.storeHistory)){e.value=l;const i=t._stringifyRow(n);t._updateRowHistory(n,o,i)}}};if(t._pasteTempValues&&t._pasteTempValues.length>1){let e=[],n=[],o=[];for(let l=0;l<t._pasteTempValues.length;l++){const i=t._pasteTempValues[l];e.push(i.cell),n.push(i.oldValue),o.push(i.newValue)}t.onCellUpdate(e,n,o,(function(n){if(n){const n=t.onRowHistory;t.onRowHistory=null,t.beginUpdate();for(let t=0;t<e.length;t++){const n=e[t];l(n,o[t]),n.value=o[t]}t.endUpdate(!1),t.onRowHistory=n}}),t)}else t.onCellUpdate([e],[a],[n],(function(o){if(o){const o=t.onRowHistory;t.onRowHistory=null,l(e,n),e.value=n,t.onRowHistory=o}}),t);delete t._pasteTempValues}),100)}else if(t.onRowUpdate){const l=Object.assign({},e.row.data),n=Object.assign({},e.row.data);n[e.column.dataField]=i,t.onRowUpdate(e.row.index,e.row,l,n,(function(t){t&&(e.value=i)}),t)}else e.value=i}}t.endUpdate(!1),t._recycle(),t._refreshDataFilters()}break}default:if(t.editing.enabled&&!t.editing.editCell&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!t.editing.editRow){const e=t.rowById[o.id];if(!e)return;if(["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","Shift","Up","Down","Left","Right","Control","F2","Esc"," ","Home","End","PageUp","PageDown"].indexOf(l)>=0)return;t._beginEdit(e,o.dataField),setTimeout((function(){if(t.editing.editCell)t.editing.editCell.editor.instance.setValue(l);else if(t.editing.editRow){const e=t.editing.editRow.getCell(o.dataField);if(!e)return;e.editor.instance.setValue(l)}}),50)}break;case"Home":{const l=t.firstRow();if(t.paging.enabled&&e.shiftKey)return t.firstPage(),e.stopPropagation(),void e.preventDefault();if(!l)return;a(l.id,o.dataField);break}case"End":{if(t.paging.enabled&&e.shiftKey)return t.lastPage(),e.stopPropagation(),void e.preventDefault();const l=t.lastRow();if(!l)return;a(l.id,o.dataField);break}case"PageUp":{const l=t._recyclingRows,n=t.rowById[o.id],i=l.indexOf(n);if(t.paging.enabled&&e.shiftKey)return t.prevPage(),e.stopPropagation(),void e.preventDefault();if(t._isVirtualMode()){const e=Math.round(t.$.scrollView.offsetHeight/t.rows[0].height);a(Math.max(o.index-e,0),o.dataField)}else{for(let e=i;e>=0;e--){const i=l[e];if(n.top-i.top>=t.$.scrollView.offsetHeight)return void a(i.id,o.dataField)}a(t.firstRow().id,o.dataField)}break}case"PageDown":{const l=t._recyclingRows,n=t.rowById[o.id],i=l.indexOf(n);if(t.paging.enabled&&e.shiftKey)return t.nextPage(),e.stopPropagation(),void e.preventDefault();if(t._isVirtualMode()){const e=Math.round(t.$.scrollView.offsetHeight/t.rows[0].height);a(Math.min(o.index+e,t.dataSource.virtualDataSourceLength-1),o.dataField)}else{for(let e=i;e<l.length;e++){const i=l[e];if(i.top-n.top>=t.$.scrollView.offsetHeight)return void a(i.id,o.dataField)}a(t.lastRow().id,o.dataField)}break}case"Enter":case"ArrowDown":if(t._isVirtualMode())a(e.ctrlKey||e.metaKey?t.lastRow():o.index+1,o.dataField);else{let n=e.ctrlKey||e.metaKey?t.lastRow():t.nextRow(o.id);if(!t.editing.addNewRow.autoCreate||"Enter"!==l||o.id!==t.lastRow().id||e.ctrlKey||e.metaKey||(t.addUnboundRow(1),n=t.lastRow()),!n)return;let i=!0;"Enter"===l&&(e.ctrlKey||e.metaKey)&&(i=!1),i&&a(n.id,o.dataField)}break;case"ArrowUp":if(t._isVirtualMode())a(e.ctrlKey||e.metaKey?t.lastRow():Math.max(0,o.index-1),o.dataField);else{const l=e.ctrlKey||e.metaKey?t.firstRow():t.prevRow(o.id);if(!l)return;a(l.id,o.dataField)}break;case"ArrowRight":{const l=t.rowById[o.id],n=t.columnByDataField[o.dataField]._treeColumn;if((!t.selection.allowCellSelection||n)&&!1===l.leaf){if(!l.expanded)return l.expand(),e.stopPropagation(),void e.preventDefault();{const e=t.nextRow(o.id);if(e)return void a(e.id,o.dataField)}}const i=e.ctrlKey||e.metaKey?t.lastColumn():t.nextColumn(o.dataField);if(!i)return;a(t._isVirtualMode()?o.index:o.id,i.dataField);break}case"ArrowLeft":{const l=t.rowById[o.id],n=t.columnByDataField[o.dataField]._treeColumn;if(!t.selection.allowCellSelection||n){if(!1===l.leaf)return void(l.expanded?(l.collapse(),e.stopPropagation(),e.preventDefault()):l.parent&&a(l.parent.id,o.dataField));if(!0===l.leaf&&l.parent)return void a(l.parent.id,o.dataField)}const i=e.ctrlKey||e.metaKey?t.firstColumn():t.prevColumn(o.dataField);if(!i)return;a(t._isVirtualMode()?o.index:o.id,i.dataField);break}}["Shift","Up","Down","Left","Right","Control","F2","Esc"," ","Home","End","PageUp","PageDown"].indexOf(l)<0||(e.stopPropagation(),e.preventDefault())}_keyUpHandler(e){const t=this;"Escape"===e.key&&t._dragDrop&&t._endDrag(e),t._focused&&"Shift"===e.key&&(t.$.fireEvent("change",{started:!1,finished:!0}),t._refreshSummary())}firstRow(){const e=this._recyclingRows;if(this._isVirtualMode())return{id:0};if(e&&e.length>0){if(!e[0].autoGenerated&&e[0].allowSelect)return e[0];for(let t=0;t<e.length;t++)if(!e[t].autoGenerated&&e[t].allowSelect)return e[t]}return null}lastRow(){const e=this,t=e._recyclingRows;if(e._isVirtualMode())return{id:e.dataSource.virtualDataSourceLength-1};if(t&&t.length>0){const e=t[t.length-1];if(!e.autoGenerated&&e.allowSelect)return e;for(let e=t.length-1;e>=0;e--)if(!t[e].autoGenerated&&t[e].allowSelect)return t[e]}return null}nextRow(e){const t=this._recyclingRows,l=this.rowById[e],n=t.indexOf(l);let o=1;if(l&&void 0!==l._rowSpan&&(o=l._rowSpan),n>=0&&t[n+o]&&!t[n+o].autoGenerated){const e=t[n+o];if(e.allowSelect&&!e.disabled)return e;for(let e=n+o;e<t.length;e++){const l=t[e];if(l.allowSelect&&!l.disabled)return l}}return null}_isVirtualMode(){const e=this;return e.dataSource&&e.dataSource.virtualDataSource&&!e.dataSource.virtualDataSourceOnExpand&&e.dataSource.length>e.virtualModeCachedRowsCount&&"infinite"!==e.scrolling}prevRow(e){const t=this,l=t._recyclingRows,n=t.rowById[e],o=l.indexOf(n);if(t._isVirtualMode())return 0===e?null:{id:n.index-1};if(o>=0&&l[o-1]&&!l[o-1].autoGenerated){const e=l[o-1];if(e.allowSelect&&!e.disabled)return e;for(let e=o-1;e>=0;e--){const t=l[e];if(t.allowSelect&&!t.disabled)return t}}return null}firstColumn(){const e=this.viewColumns;if(e&&e.length>0)for(let t=0;t<e.length;t++){const l=e[t];if(l.allowSelect&&!l.autoGenerated)return l}return null}lastColumn(){const e=this.viewColumns;if(e&&e.length>0)for(let t=e.length-1;t>=0;t--){const l=e[t];if(l.allowSelect&&!l.autoGenerated)return l}return null}nextColumn(e){const t=this.viewColumns,l=this.columnByDataField[e];let n=t.indexOf(l);for(;n<t.length;){const e=t[n+1];if(e.autoGenerated)return null;if(e.visible)return e;n++}return null}prevColumn(e){const t=this.viewColumns,l=this.columnByDataField[e];let n=t.indexOf(l);for(;n>0;){const e=t[n-1];if(e.autoGenerated)return null;if(e.visible)return e;n--}return null}isVisible(e,t){const l=this,n=l._scrollView.vScrollBar,o=l._scrollView.hScrollBar,i=l.rowById[e],a=l.columnByDataField[t],r=function(e){if(!e)return!1;const t=e.visibleIndex;if(-1===t)return!1;const n=l.dataSource&&l.dataSource.virtualDataSource&&!l.dataSource.virtualDataSourceOnExpand&&l.dataSource.length>l.virtualModeCachedRowsCount&&"infinite"!==l.scrolling;let i=e.top;return n&&(i=t*l.rows[0].height),!(i+e.height+o.offsetHeight+l.__frozenNearHeight>=l._scrollView.scrollTop+l.$.scrollView.offsetHeight-l.__frozenFarHeight||i<=l._scrollView.scrollTop)}(i),s=function(e){return!!t&&!(-1===e.visibleIndex||e.left+e.computedWidth+n.offsetWidth>=l._scrollView.scrollLeft+l._clientSize.width||e.left<=l._scrollView.scrollLeft)}(a);return{row:r,column:s}}_ensureRowVisible(e){const t=this;if(!t._scrollView)return;const l=t._scrollView.hScrollBar;if(!e)return;const n=e.visibleIndex;if(-1===n)return;const o="virtual"!==t.scrolling?e.top:n*t.rows[0].height,i=t.summaryRow.visible?t.layout.rowMinHeight:0;if(o+e.height+l.offsetHeight+t.__frozenNearHeight>=t._scrollView.scrollTop+t.$.scrollView.offsetHeight-t.__frozenFarHeight-i&&(t._scrollView.scrollTop=o+e.height-t.$.scrollView.offsetHeight+t.__frozenNearHeight+t.__frozenFarHeight+l.offsetHeight+i),o<=t._scrollView.scrollTop&&(t._scrollView.scrollTop=o),t.paging.enabled){const o=t.paging.pageSize,i=Math.floor(n/o);if(t.paging.pageIndex!==i)return t.goToPage(i),t._scrollView.scrollTop=0,void setTimeout((()=>{e.top+e.height+l.offsetHeight+t.__frozenNearHeight>=t._scrollView.scrollTop+t.$.scrollView.offsetHeight-t.__frozenFarHeight&&(t._scrollView.scrollTop=e.top+e.height),e.top<=t._scrollView.scrollTop&&(t._scrollView.scrollTop=e.top)}),50)}0===n?t._scrollView.scrollTop=0:n===t.dataSource.length-1&&(t._scrollView.scrollTop=t._scrollView.scrollHeight)}_ensureColumnVisible(e){const t=this,l=t._scrollView.vScrollBar;if(!e)return;const n=e.visibleIndex;-1!==n&&(e.left+e.computedWidth+l.offsetWidth>=t._scrollView.scrollLeft+t._clientSize.width&&(t._scrollView.scrollLeft=t._scrollView.scrollLeft+e.computedWidth),e.left<=t._scrollView.scrollLeft&&(t._scrollView.scrollLeft=e.left),0===n?t._scrollView.scrollLeft=0:n===t.columns.length-1&&(t._scrollView.scrollLeft=t._scrollView.scrollWidth))}ensureVisible(e,t){const l=this,n=l.rowById[e],o=l.columnByDataField[t];if("virtual"===l.scrolling){const e=l._scrollView.hScrollBar,t=n.visibleIndex*l.rows[0].height,i=l.summaryRow.visible?l.layout.rowMinHeight:0;return t+n.height+e.offsetHeight+l.__frozenNearHeight>=l._scrollView.scrollTop+l.$.scrollView.offsetHeight-l.__frozenFarHeight-i&&l.setVerticalScrollValue(t),void l._ensureColumnVisible(o)}l._ensureRowVisible(n),l._ensureColumnVisible(o)}clearSelection(){const e=this;delete e._rangeSelectionStartRow,delete e._rangeSelectionEndRow,delete e._areAllRowsSelected,e._clearSelection(!0),e.$.fireEvent("change",{started:!1,finished:!0}),e._refreshSummary()}});
@@ -1,6 +1,6 @@
1
1
 
2
- /* Smart UI v17.0.3 (2023-10-20)
2
+ /* Smart UI v17.0.17 (2023-11-08)
3
3
  Copyright (c) 2011-2023 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
6
- Smart.Utilities.Assign("Grid.Sort",class{clearSort(){const t=this;if(!t._isSorting&&t.dataSource){t._isSorting=!0,t.dataSource.clearSort(),t._sortedColumns||(t._sortedColumns=[]);for(let e=0;e<t._sortedColumns.length;e++){const r=t._sortedColumns[e],o=t.columnByDataField[r.dataField];o&&(o.setProperty("sortOrder",null),o.setProperty("sortIndex",null))}t._sortedColumns=[],t.rowById=[];for(let e=0;e<t.dataSource.length;e++){const r=t.rows[e],o=t.dataSource[e];r&&(r.data=o,o&&o.$&&(r.id=o.$.id,r._updateData()),t.rowById[r.id]=r)}t._recycle(),t._refreshHeaderBar(),t._isSorting=!1}}getSortedColumns(){const t=this,e=[];if(t._sortedColumns)for(let r=0;r<t._sortedColumns.length;r++){const o=t._sortedColumns[r];e[o.dataField]={sortOrder:o.sortOrder,sortIndex:o.sortIndex},e.length++}return e}addSort(t,e){this.sortBy(t,e)}removeSort(t){this.sortBy(t,null)}refreshSort(){this._refreshSort(this._sortedColumns)}_refreshSort(t){const e=this;if(e._isSorting||!t)return;if(e._suppressSort)return;if(!1===e.sorting.maintainSort)return;const r=[],o=[],s=[];e._isSorting=!0;let a=[];for(let n=0;n<t.length;n++){const d=t[n],i=e.columnByDataField[d.dataField];i&&(i.setProperty("sortOrder",d.sortOrder),i.setProperty("sortIndex",n),i.sortComparator&&(a[i.dataField]=i.sortComparator),r.push(d.dataField),o.push(d.sortOrder),s.push(d.dataType||"string"))}!function(){if(e.dataSource&&(e.dataSource.sortComparators=a),e.dataSource&&e.dataSource.virtualDataSource)e._virtualDataRequest("sort");else{if(e.dataSource.sortBy(r,s,o),e.dataSource.boundHierarchy)e._refreshRowHierarchy(),e.dataSource.groupBy.length>0&&(e._refreshRowHierarchy(!0,!0),e.refresh());else{e.rowById=[];for(let t=0;t<e.dataSource.length;t++){const r=e.rows[t],o=e.dataSource[t];r.data=o,r.id=o.$.id,r._updateData(),e.rowById[r.id]=r}}e._recycle()}}(),e._refreshHeaderBar(),e._isSorting=!1,e._sortedColumns=t}sortBy(t,e){const r=this,o=r.columnByDataField[t],s=[],a=[],n=[],d=void 0===e;if(r._isSorting||!o)return;r._isSorting=!0,"descending"===e&&(e="desc"),void 0!==e&&"ascending"!==e||(e="asc");const i=function(t){t&&(t.setProperty("sortOrder",null),t.setProperty("sortIndex",null))},l=function(){if(r._sortedColumns.length>0)for(let t=0;t<r._sortedColumns.length;t++){const e=r._sortedColumns[t],o=r.columnByDataField[e.dataField];i(o)}r._sortedColumns=[]};if(null===o)return l(),void(r._isSorting=!1);if(!r.sorting.enabled||!r.dataSource||!o.allowSort||r._sortAnimation)return void(r._isSorting=!1);i(o),r._sortedColumns||(r._sortedColumns=[]);let u="string";const c=r.dataSource&&r.dataSource.dataFields?r.dataSource.dataFields:r.dataSourceSettings.dataFields;if(c)for(let e=0;e<c.length;e++){const r=c[e];if(r.name===t){u=r.dataType;break}}let m=!0;for(let s=0;s<r._sortedColumns.length;s++){const a=r._sortedColumns[s];if(a.dataField===t)if(m=!1,a.sortIndex=o.sortIndex,d){if("asc"===a.sortOrder)a.sortOrder="desc",e="desc";else if("desc"===a.sortOrder){r.sorting.sortToggleThreeStates?(r._sortedColumns.splice(s,1),i(o),e=null):(a.sortOrder="asc",e="asc");break}}else a.sortOrder=e,null===e&&(r._sortedColumns.splice(s,1),i(o))}m&&("one"===r.sorting.mode&&l(),"many"===r.sorting.mode&&!1===r._canSort&&l(),null!==e&&r._sortedColumns.push({dataField:t,sortOrder:e,sortIndex:o.sortIndex,dataType:u})),o.setProperty("sortOrder",e),r._sortedColumns.sort(((t,e)=>"string"==typeof t.sortIndex&&"string"==typeof e.sortIndex?0:"number"==typeof t.sortIndex&&"string"==typeof e.sortIndex?-1:"string"==typeof t.sortIndex&&"number"==typeof e.sortIndex?1:"number"==typeof t.sortIndex&&"number"==typeof e.sortIndex?t.sortIndex-e.sortIndex:void 0));const f=[];for(let t=0;t<r._sortedColumns.length;t++){const e=r._sortedColumns[t];s.push(e.dataField),a.push(e.sortOrder),n.push(e.dataType||"string");const o=r.columnByDataField[e.dataField];o.sortComparator&&(f[o.dataField]=o.sortComparator)}const _=function(){if(r.dataSource.sortComparators=f,r.dataSource&&r.dataSource.virtualDataSource)r._virtualDataRequest("sort");else{if(r.dataSource.sortBy(s,n,a),r.dataSource.boundHierarchy)r._refreshRowHierarchy(),r.dataSource.groupBy.length>0&&r._refreshRowHierarchy(!0,!0),r.refresh();else{r.rowById=[];for(let t=0;t<r.dataSource.length;t++){const e=r.rows[t],o=r.dataSource[t];e&&(e.data=o,o&&o.$&&(e.id=o.$.id,e._updateData()),r._filters&&r._filters.length>0&&(e.filtered=void 0===e.data.$.filtered||e.data.$.filtered),r.rowById[e.id]=e)}if(r._filters&&r._filters.length>0&&r.refresh(),r.selection&&r.selection.enabled&&r._selection){r._selection.indexes=[];const t=r._selection.selectionRect;t&&(delete r._selection.selectionRect,t.parentNode.removeChild(t)),r._refreshCellSelectionRect()}}r._recycle()}const t=[],e=[];for(let o=0;o<r._sortedColumns.length;o++){const s=r.columnByDataField[r._sortedColumns[o].dataField];s&&(s.setProperty("sortIndex",o),t.push(s),e.push(s.sortIndex),r._sortedColumns[o].sortIndex=o)}r._refreshHeaderBar(),r.$.fireEvent("sort",{sortDataFields:s,sortOrders:a,sortDataTypes:n,sortIndexes:e,columns:t,data:r._sortedColumns}),r._onSort&&r._onSort()};if(r.appearance.allowSortAnimation){let t=[],e=[];r.rows.canNotify=!1,r._sortAnimation=!0;const o=function(){for(let e=0;e<r._rowElements.length;e++){const o=r._rowElements[e];o.classList.remove("smart-grid-sort-animation"),r.removeTransformMoveStyle(o),o.offsetHeight>0&&t.push(o.offsetTop)}};o(),r._sortTimer=setTimeout((function(){o(),r._sortAnimation=!1,r.rows.canNotify=!0}),r.appearance.sortAnimationDuration),r._sortTimer2=setTimeout((function(){_()}),r.appearance.sortAnimationDuration/2);for(let o=0;o<t.length;o++){const s=r._rowElements[o];s.classList.remove("smart-grid-sort-animation"),r.removeTransformMoveStyle(s);let a=Math.floor(Math.random()*t.length-1+1);for(;e[a];)a=Math.floor(Math.random()*t.length-1+1);e[a]=!0,r.addTransformMoveStyle(s,"0ms",0,-s.offsetTop+t[a],0,.5),s.classList.add("smart-grid-sort-animation"),setTimeout((function(){r.addTransformMoveStyle(s,r.appearance.sortAnimationDuration+"ms",0,0,0,1)})),setTimeout((function(){s.classList.remove("smart-grid-sort-animation")}),r.appearance.sortAnimationDuration)}}else _();r._isSorting=!1}});
6
+ Smart.Utilities.Assign("Grid.Sort",class{clearSort(){const t=this;if(!t._isSorting&&t.dataSource&&t._sortedColumns){t._isSorting=!0,t.dataSource.clearSort(),t._sortedColumns||(t._sortedColumns=[]);for(let e=0;e<t._sortedColumns.length;e++){const r=t._sortedColumns[e],o=t.columnByDataField[r.dataField];o&&(o.setProperty("sortOrder",null),o.setProperty("sortIndex",null))}t._sortedColumns=[],t.rowById=[];for(let e=0;e<t.dataSource.length;e++){const r=t.rows[e],o=t.dataSource[e];r&&(r.data=o,o&&o.$&&(r.id=o.$.id,r._updateData()),t.rowById[r.id]=r)}t._recycle(),t._refreshHeaderBar(),t._isSorting=!1}}getSortedColumns(){const t=this,e=[];if(t._sortedColumns)for(let r=0;r<t._sortedColumns.length;r++){const o=t._sortedColumns[r];e[o.dataField]={sortOrder:o.sortOrder,sortIndex:o.sortIndex},e.length++}return e}addSort(t,e){this.sortBy(t,e)}removeSort(t){this.sortBy(t,null)}refreshSort(){this._refreshSort(this._sortedColumns)}_refreshSort(t){const e=this;if(e._isSorting||!t)return;if(e._suppressSort)return;if(!1===e.sorting.maintainSort)return;const r=[],o=[],s=[];e._isSorting=!0;let a=[];for(let n=0;n<t.length;n++){const d=t[n],i=e.columnByDataField[d.dataField];i&&(i.setProperty("sortOrder",d.sortOrder),i.setProperty("sortIndex",n),i.sortComparator&&(a[i.dataField]=i.sortComparator),r.push(d.dataField),o.push(d.sortOrder),s.push(d.dataType||"string"))}!function(){if(e.dataSource&&(e.dataSource.sortComparators=a),e.dataSource&&e.dataSource.virtualDataSource)e._virtualDataRequest("sort");else{if(e.dataSource.sortBy(r,s,o),e.dataSource.boundHierarchy)e._refreshRowHierarchy(),e.dataSource.groupBy.length>0&&(e._refreshRowHierarchy(!0,!0),e.refresh());else{e.rowById=[];for(let t=0;t<e.dataSource.length;t++){const r=e.rows[t],o=e.dataSource[t];r.data=o,r.id=o.$.id,r._updateData(),e.rowById[r.id]=r}}e._recycle()}}(),e._refreshHeaderBar(),e._isSorting=!1,e._sortedColumns=t}sortBy(t,e){const r=this,o=r.columnByDataField[t],s=[],a=[],n=[],d=void 0===e;if(r._isSorting||!o)return;r._isSorting=!0,"descending"===e&&(e="desc"),void 0!==e&&"ascending"!==e||(e="asc");const i=function(t){t&&(t.setProperty("sortOrder",null),t.setProperty("sortIndex",null))},l=function(){if(r._sortedColumns.length>0)for(let t=0;t<r._sortedColumns.length;t++){const e=r._sortedColumns[t],o=r.columnByDataField[e.dataField];i(o)}r._sortedColumns=[]};if(null===o)return l(),void(r._isSorting=!1);if(!r.sorting.enabled||!r.dataSource||!o.allowSort||r._sortAnimation)return void(r._isSorting=!1);i(o),r._sortedColumns||(r._sortedColumns=[]);let u="string";const c=r.dataSource&&r.dataSource.dataFields?r.dataSource.dataFields:r.dataSourceSettings.dataFields;if(c)for(let e=0;e<c.length;e++){const r=c[e];if(r.name===t){u=r.dataType;break}}let m=!0;for(let s=0;s<r._sortedColumns.length;s++){const a=r._sortedColumns[s];if(a.dataField===t)if(m=!1,a.sortIndex=o.sortIndex,d){if("asc"===a.sortOrder)a.sortOrder="desc",e="desc";else if("desc"===a.sortOrder){r.sorting.sortToggleThreeStates?(r._sortedColumns.splice(s,1),i(o),e=null):(a.sortOrder="asc",e="asc");break}}else a.sortOrder=e,null===e&&(r._sortedColumns.splice(s,1),i(o))}m&&("one"===r.sorting.mode&&l(),"many"===r.sorting.mode&&!1===r._canSort&&l(),null!==e&&r._sortedColumns.push({dataField:t,sortOrder:e,sortIndex:o.sortIndex,dataType:u})),o.setProperty("sortOrder",e),r._sortedColumns.sort(((t,e)=>"string"==typeof t.sortIndex&&"string"==typeof e.sortIndex?0:"number"==typeof t.sortIndex&&"string"==typeof e.sortIndex?-1:"string"==typeof t.sortIndex&&"number"==typeof e.sortIndex?1:"number"==typeof t.sortIndex&&"number"==typeof e.sortIndex?t.sortIndex-e.sortIndex:void 0));const f=[];for(let t=0;t<r._sortedColumns.length;t++){const e=r._sortedColumns[t];s.push(e.dataField),a.push(e.sortOrder),n.push(e.dataType||"string");const o=r.columnByDataField[e.dataField];o.sortComparator&&(f[o.dataField]=o.sortComparator)}const _=function(){if(r.dataSource.sortComparators=f,r.dataSource&&r.dataSource.virtualDataSource)r._virtualDataRequest("sort");else{if(r.dataSource.sortBy(s,n,a),r.dataSource.boundHierarchy)r._refreshRowHierarchy(),r.dataSource.groupBy.length>0&&r._refreshRowHierarchy(!0,!0),r.refresh();else{r.rowById=[];const t=r.rows.canNotify;r.rows.canNotify=!1;for(let t=0;t<r.dataSource.length;t++){const e=r.rows[t],o=r.dataSource[t];e&&(e.data=o,o&&o.$&&(e.id=o.$.id,e._updateData()),r._filters&&r._filters.length>0&&(e.filtered=void 0===e.data.$.filtered||e.data.$.filtered),r.rowById[e.id]=e)}if(r.rows.canNotify=t,r._filters&&r._filters.length>0&&r.refresh(),r.selection&&r.selection.enabled&&r._selection){r._selection.indexes=[];const t=r._selection.selectionRect;t&&(delete r._selection.selectionRect,t.parentNode.removeChild(t)),r._refreshCellSelectionRect()}}r._recycle()}const t=[],e=[];for(let o=0;o<r._sortedColumns.length;o++){const s=r.columnByDataField[r._sortedColumns[o].dataField];s&&(s.setProperty("sortIndex",o),t.push(s),e.push(s.sortIndex),r._sortedColumns[o].sortIndex=o)}r._refreshHeaderBar(),r.$.fireEvent("sort",{sortDataFields:s,sortOrders:a,sortDataTypes:n,sortIndexes:e,columns:t,data:r._sortedColumns}),r._onSort&&r._onSort()};if(r.appearance.allowSortAnimation){let t=[],e=[];r.rows.canNotify=!1,r._sortAnimation=!0;const o=function(){for(let e=0;e<r._rowElements.length;e++){const o=r._rowElements[e];o.classList.remove("smart-grid-sort-animation"),r.removeTransformMoveStyle(o),o.offsetHeight>0&&t.push(o.offsetTop)}};o(),r._sortTimer=setTimeout((function(){o(),r._sortAnimation=!1,r.rows.canNotify=!0}),r.appearance.sortAnimationDuration),r._sortTimer2=setTimeout((function(){_()}),r.appearance.sortAnimationDuration/2);for(let o=0;o<t.length;o++){const s=r._rowElements[o];s.classList.remove("smart-grid-sort-animation"),r.removeTransformMoveStyle(s);let a=Math.floor(Math.random()*t.length-1+1);for(;e[a];)a=Math.floor(Math.random()*t.length-1+1);e[a]=!0,r.addTransformMoveStyle(s,"0ms",0,-s.offsetTop+t[a],0,.5),s.classList.add("smart-grid-sort-animation"),setTimeout((function(){r.addTransformMoveStyle(s,r.appearance.sortAnimationDuration+"ms",0,0,0,1)})),setTimeout((function(){s.classList.remove("smart-grid-sort-animation")}),r.appearance.sortAnimationDuration)}}else _();r._isSorting=!1}});