smart-webcomponents-react 15.2.10 → 15.2.11

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 (401) hide show
  1. package/accordion/accordion.esm.js +2 -2
  2. package/accordion/accordion.umd.js +2 -2
  3. package/alertwindow/alertwindow.esm.js +1 -1
  4. package/alertwindow/alertwindow.umd.js +1 -1
  5. package/array/array.esm.js +1 -1
  6. package/array/array.umd.js +1 -1
  7. package/barcode/barcode.esm.js +1 -1
  8. package/barcode/barcode.umd.js +1 -1
  9. package/breadcrumb/breadcrumb.esm.js +1 -1
  10. package/breadcrumb/breadcrumb.umd.js +1 -1
  11. package/button/button.esm.js +4 -4
  12. package/button/button.umd.js +4 -4
  13. package/buttongroup/buttongroup.esm.js +1 -1
  14. package/buttongroup/buttongroup.umd.js +1 -1
  15. package/calendar/calendar.esm.js +1 -1
  16. package/calendar/calendar.umd.js +1 -1
  17. package/card/card.esm.js +1 -1
  18. package/card/card.umd.js +1 -1
  19. package/cardview/cardview.esm.js +1 -1
  20. package/cardview/cardview.umd.js +1 -1
  21. package/carousel/carousel.esm.js +1 -1
  22. package/carousel/carousel.umd.js +1 -1
  23. package/chart/chart.esm.js +1 -1
  24. package/chart/chart.umd.js +1 -1
  25. package/checkbox/checkbox.esm.js +1 -1
  26. package/checkbox/checkbox.umd.js +1 -1
  27. package/checkinput/checkinput.esm.js +1 -1
  28. package/checkinput/checkinput.umd.js +1 -1
  29. package/chip/chip.esm.js +1 -1
  30. package/chip/chip.umd.js +1 -1
  31. package/colorinput/colorinput.esm.js +1 -1
  32. package/colorinput/colorinput.umd.js +1 -1
  33. package/colorpanel/colorpanel.esm.js +1 -1
  34. package/colorpanel/colorpanel.umd.js +1 -1
  35. package/colorpicker/colorpicker.esm.js +1 -1
  36. package/colorpicker/colorpicker.umd.js +1 -1
  37. package/columnpanel/columnpanel.esm.js +1 -1
  38. package/columnpanel/columnpanel.umd.js +1 -1
  39. package/combobox/combobox.esm.js +3 -3
  40. package/combobox/combobox.umd.js +3 -3
  41. package/countryinput/countryinput.esm.js +1 -1
  42. package/countryinput/countryinput.umd.js +1 -1
  43. package/customizationdialog/customizationdialog.esm.js +1 -1
  44. package/customizationdialog/customizationdialog.umd.js +1 -1
  45. package/dateinput/dateinput.esm.js +1 -1
  46. package/dateinput/dateinput.umd.js +1 -1
  47. package/daterangeinput/daterangeinput.esm.js +1 -1
  48. package/daterangeinput/daterangeinput.umd.js +1 -1
  49. package/datetimepicker/datetimepicker.esm.js +1 -1
  50. package/datetimepicker/datetimepicker.umd.js +1 -1
  51. package/dialogwindow/dialogwindow.esm.js +1 -1
  52. package/dialogwindow/dialogwindow.umd.js +1 -1
  53. package/dockinglayout/dockinglayout.esm.js +1 -1
  54. package/dockinglayout/dockinglayout.umd.js +1 -1
  55. package/dropdownbutton/dropdownbutton.esm.js +1 -1
  56. package/dropdownbutton/dropdownbutton.umd.js +1 -1
  57. package/dropdownlist/dropdownlist.esm.js +3 -3
  58. package/dropdownlist/dropdownlist.umd.js +3 -3
  59. package/editor/editor.esm.js +1 -1
  60. package/editor/editor.umd.js +1 -1
  61. package/element/element.esm.js +1 -1
  62. package/element/element.umd.js +1 -1
  63. package/fileupload/fileupload.esm.js +1 -1
  64. package/fileupload/fileupload.umd.js +1 -1
  65. package/filterbuilder/filterbuilder.esm.js +1 -1
  66. package/filterbuilder/filterbuilder.umd.js +1 -1
  67. package/filterpanel/filterpanel.esm.js +1 -1
  68. package/filterpanel/filterpanel.umd.js +1 -1
  69. package/form/form.esm.js +3 -3
  70. package/form/form.umd.js +3 -3
  71. package/ganttchart/ganttchart.esm.js +1 -1
  72. package/ganttchart/ganttchart.umd.js +1 -1
  73. package/gauge/gauge.esm.js +1 -1
  74. package/gauge/gauge.umd.js +1 -1
  75. package/grid/grid.esm.js +1 -1
  76. package/grid/grid.umd.js +1 -1
  77. package/grouppanel/grouppanel.esm.js +1 -1
  78. package/grouppanel/grouppanel.umd.js +1 -1
  79. package/input/input.esm.js +1 -1
  80. package/input/input.umd.js +1 -1
  81. package/kanban/kanban.esm.js +1 -1
  82. package/kanban/kanban.umd.js +1 -1
  83. package/layout/layout.esm.js +5 -5
  84. package/layout/layout.umd.js +5 -5
  85. package/led/led.esm.js +1 -1
  86. package/led/led.umd.js +1 -1
  87. package/listbox/listbox.esm.js +3 -3
  88. package/listbox/listbox.umd.js +3 -3
  89. package/listmenu/listmenu.esm.js +3 -3
  90. package/listmenu/listmenu.umd.js +3 -3
  91. package/map/map.esm.js +1 -1
  92. package/map/map.umd.js +1 -1
  93. package/maskedtextbox/maskedtextbox.esm.js +1 -1
  94. package/maskedtextbox/maskedtextbox.umd.js +1 -1
  95. package/menu/menu.esm.js +3 -3
  96. package/menu/menu.umd.js +3 -3
  97. package/multicolumnfilterpanel/multicolumnfilterpanel.esm.js +1 -1
  98. package/multicolumnfilterpanel/multicolumnfilterpanel.umd.js +1 -1
  99. package/multicomboinput/multicomboinput.esm.js +1 -1
  100. package/multicomboinput/multicomboinput.umd.js +1 -1
  101. package/multiinput/multiinput.esm.js +1 -1
  102. package/multiinput/multiinput.umd.js +1 -1
  103. package/multilinetextbox/multilinetextbox.esm.js +3 -3
  104. package/multilinetextbox/multilinetextbox.umd.js +3 -3
  105. package/multilinewindow/multilinewindow.esm.js +1 -1
  106. package/multilinewindow/multilinewindow.umd.js +1 -1
  107. package/multisplitbutton/multisplitbutton.esm.js +3 -3
  108. package/multisplitbutton/multisplitbutton.umd.js +3 -3
  109. package/numberinput/numberinput.esm.js +1 -1
  110. package/numberinput/numberinput.umd.js +1 -1
  111. package/numerictextbox/numerictextbox.esm.js +1 -1
  112. package/numerictextbox/numerictextbox.umd.js +1 -1
  113. package/package.json +1 -1
  114. package/pager/pager.esm.js +1 -1
  115. package/pager/pager.umd.js +1 -1
  116. package/passwordinput/passwordinput.esm.js +1 -1
  117. package/passwordinput/passwordinput.umd.js +1 -1
  118. package/passwordtextbox/passwordtextbox.esm.js +1 -1
  119. package/passwordtextbox/passwordtextbox.umd.js +1 -1
  120. package/path/path.esm.js +1 -1
  121. package/path/path.umd.js +1 -1
  122. package/phoneinput/phoneinput.esm.js +1 -1
  123. package/phoneinput/phoneinput.umd.js +1 -1
  124. package/pivottable/pivottable.esm.js +1 -1
  125. package/pivottable/pivottable.umd.js +1 -1
  126. package/progressbar/progressbar.esm.js +2 -2
  127. package/progressbar/progressbar.umd.js +2 -2
  128. package/progresswindow/progresswindow.esm.js +1 -1
  129. package/progresswindow/progresswindow.umd.js +1 -1
  130. package/promptwindow/promptwindow.esm.js +1 -1
  131. package/promptwindow/promptwindow.umd.js +1 -1
  132. package/qrcode/qrcode.esm.js +1 -1
  133. package/qrcode/qrcode.umd.js +1 -1
  134. package/querybuilder/querybuilder.esm.js +1 -1
  135. package/querybuilder/querybuilder.umd.js +1 -1
  136. package/radiobutton/radiobutton.esm.js +1 -1
  137. package/radiobutton/radiobutton.umd.js +1 -1
  138. package/rating/rating.esm.js +1 -1
  139. package/rating/rating.umd.js +1 -1
  140. package/scheduler/scheduler.esm.js +1 -1
  141. package/scheduler/scheduler.umd.js +1 -1
  142. package/scrollbar/scrollbar.esm.js +1 -1
  143. package/scrollbar/scrollbar.umd.js +1 -1
  144. package/slider/slider.esm.js +1 -1
  145. package/slider/slider.umd.js +1 -1
  146. package/sortable/sortable.esm.js +1 -1
  147. package/sortable/sortable.umd.js +1 -1
  148. package/sortpanel/sortpanel.esm.js +1 -1
  149. package/sortpanel/sortpanel.umd.js +1 -1
  150. package/source/modules/smart.3dchart.js +2 -2
  151. package/source/modules/smart.accordion.js +1 -1
  152. package/source/modules/smart.array.js +2 -2
  153. package/source/modules/smart.barcode.js +1 -1
  154. package/source/modules/smart.breadcrumb.js +1 -1
  155. package/source/modules/smart.button.js +2 -2
  156. package/source/modules/smart.buttongroup.js +1 -1
  157. package/source/modules/smart.calendar.js +2 -2
  158. package/source/modules/smart.card.js +1 -1
  159. package/source/modules/smart.cardview.js +3 -3
  160. package/source/modules/smart.carousel.js +1 -1
  161. package/source/modules/smart.chart.js +1 -1
  162. package/source/modules/smart.checkbox.js +2 -2
  163. package/source/modules/smart.checkinput.js +2 -2
  164. package/source/modules/smart.chip.js +1 -1
  165. package/source/modules/smart.colorinput.js +2 -2
  166. package/source/modules/smart.colorpanel.js +2 -2
  167. package/source/modules/smart.colorpicker.js +3 -3
  168. package/source/modules/smart.combobox.js +2 -2
  169. package/source/modules/smart.common.js +1 -1
  170. package/source/modules/smart.countryinput.js +2 -2
  171. package/source/modules/smart.dateinput.js +2 -2
  172. package/source/modules/smart.daterangeinput.js +3 -3
  173. package/source/modules/smart.datetimepicker.js +3 -3
  174. package/source/modules/smart.dockinglayout.js +1 -1
  175. package/source/modules/smart.dropdownbutton.js +2 -2
  176. package/source/modules/smart.dropdownlist.js +2 -2
  177. package/source/modules/smart.editor.js +4 -4
  178. package/source/modules/smart.element.js +1 -1
  179. package/source/modules/smart.fileupload.js +3 -3
  180. package/source/modules/smart.form.js +2 -2
  181. package/source/modules/smart.formulaparser.js +1 -1
  182. package/source/modules/smart.ganttchart.js +4 -4
  183. package/source/modules/smart.gauge.js +1 -1
  184. package/source/modules/smart.grid.js +14 -14
  185. package/source/modules/smart.gridpanel.js +3 -3
  186. package/source/modules/smart.input.js +2 -2
  187. package/source/modules/smart.kanban.js +5 -5
  188. package/source/modules/smart.layout.js +1 -1
  189. package/source/modules/smart.led.js +1 -1
  190. package/source/modules/smart.listbox.js +2 -2
  191. package/source/modules/smart.listmenu.js +1 -1
  192. package/source/modules/smart.map.js +1 -1
  193. package/source/modules/smart.maskedtextbox.js +2 -2
  194. package/source/modules/smart.menu.js +1 -1
  195. package/source/modules/smart.multicomboinput.js +3 -3
  196. package/source/modules/smart.multiinput.js +2 -2
  197. package/source/modules/smart.multilinetextbox.js +2 -2
  198. package/source/modules/smart.multisplitbutton.js +2 -2
  199. package/source/modules/smart.numberinput.js +2 -2
  200. package/source/modules/smart.numerictextbox.js +2 -2
  201. package/source/modules/smart.pager.js +2 -2
  202. package/source/modules/smart.passwordinput.js +2 -2
  203. package/source/modules/smart.passwordtextbox.js +2 -2
  204. package/source/modules/smart.path.js +1 -1
  205. package/source/modules/smart.phoneinput.js +2 -2
  206. package/source/modules/smart.pivottable.js +3 -3
  207. package/source/modules/smart.progressbar.js +1 -1
  208. package/source/modules/smart.qrcode.js +1 -1
  209. package/source/modules/smart.querybuilder.js +3 -3
  210. package/source/modules/smart.radiobutton.js +2 -2
  211. package/source/modules/smart.rating.js +1 -1
  212. package/source/modules/smart.router.js +1 -1
  213. package/source/modules/smart.scheduler.js +3 -3
  214. package/source/modules/smart.scrollbar.js +1 -1
  215. package/source/modules/smart.slider.js +1 -1
  216. package/source/modules/smart.sortable.js +1 -1
  217. package/source/modules/smart.splitter.js +1 -1
  218. package/source/modules/smart.switchbutton.js +2 -2
  219. package/source/modules/smart.table.js +3 -3
  220. package/source/modules/smart.tabs.js +1 -1
  221. package/source/modules/smart.tank.js +1 -1
  222. package/source/modules/smart.textarea.js +2 -2
  223. package/source/modules/smart.textbox.js +2 -2
  224. package/source/modules/smart.timeinput.js +2 -2
  225. package/source/modules/smart.timepicker.js +1 -1
  226. package/source/modules/smart.toast.js +1 -1
  227. package/source/modules/smart.tooltip.js +1 -1
  228. package/source/modules/smart.tree.js +1 -1
  229. package/source/modules/smart.validator.js +1 -1
  230. package/source/modules/smart.window.js +2 -2
  231. package/source/smart.3dchart.js +1 -1
  232. package/source/smart.accordion.js +1 -1
  233. package/source/smart.ajax.js +1 -1
  234. package/source/smart.array.js +1 -1
  235. package/source/smart.barcode.js +1 -1
  236. package/source/smart.bootstrap.js +1 -1
  237. package/source/smart.breadcrumb.js +1 -1
  238. package/source/smart.button.js +1 -1
  239. package/source/smart.buttongroup.js +1 -1
  240. package/source/smart.calendar.js +1 -1
  241. package/source/smart.card.js +1 -1
  242. package/source/smart.cardview.js +1 -1
  243. package/source/smart.carousel.js +1 -1
  244. package/source/smart.chart.annotations.js +1 -1
  245. package/source/smart.chart.api.js +1 -1
  246. package/source/smart.chart.core.js +1 -1
  247. package/source/smart.chart.js +1 -1
  248. package/source/smart.chart.rangeselector.js +1 -1
  249. package/source/smart.chart.waterfall.js +1 -1
  250. package/source/smart.checkbox.js +1 -1
  251. package/source/smart.checkinput.js +1 -1
  252. package/source/smart.chip.js +1 -1
  253. package/source/smart.colorinput.js +1 -1
  254. package/source/smart.colorpanel.js +1 -1
  255. package/source/smart.colorpicker.js +1 -1
  256. package/source/smart.combobox.js +1 -1
  257. package/source/smart.complex.js +1 -1
  258. package/source/smart.core.js +1 -1
  259. package/source/smart.countryinput.js +1 -1
  260. package/source/smart.data.js +1 -1
  261. package/source/smart.date.js +1 -1
  262. package/source/smart.dateformatpanel.js +1 -1
  263. package/source/smart.dateinput.js +1 -1
  264. package/source/smart.daterangeinput.js +1 -1
  265. package/source/smart.datetimepicker.js +1 -1
  266. package/source/smart.dockinglayout.js +1 -1
  267. package/source/smart.draw.js +1 -1
  268. package/source/smart.dropdownbutton.js +2 -2
  269. package/source/smart.dropdownlist.js +1 -1
  270. package/source/smart.editor.js +1 -1
  271. package/source/smart.element.js +1 -1
  272. package/source/smart.elements.js +17 -17
  273. package/source/smart.export.js +1 -1
  274. package/source/smart.fileupload.js +2 -2
  275. package/source/smart.filter.js +1 -1
  276. package/source/smart.filterbuilder.js +1 -1
  277. package/source/smart.filterpanel.js +1 -1
  278. package/source/smart.form.js +1 -1
  279. package/source/smart.format.js +1 -1
  280. package/source/smart.formulaparser.js +1 -1
  281. package/source/smart.ganttchart.js +2 -2
  282. package/source/smart.gauge.js +1 -1
  283. package/source/smart.grid.cell.js +2 -2
  284. package/source/smart.grid.chart.js +1 -1
  285. package/source/smart.grid.column.js +2 -2
  286. package/source/smart.grid.core.js +2 -2
  287. package/source/smart.grid.dialog.js +2 -2
  288. package/source/smart.grid.edit.js +2 -2
  289. package/source/smart.grid.export.js +1 -1
  290. package/source/smart.grid.filter.js +1 -1
  291. package/source/smart.grid.group.js +1 -1
  292. package/source/smart.grid.js +1 -1
  293. package/source/smart.grid.menu.js +1 -1
  294. package/source/smart.grid.pager.js +1 -1
  295. package/source/smart.grid.reorder.js +1 -1
  296. package/source/smart.grid.resize.js +2 -2
  297. package/source/smart.grid.row.js +2 -2
  298. package/source/smart.grid.select.js +2 -2
  299. package/source/smart.grid.sort.js +1 -1
  300. package/source/smart.grid.toolbar.js +2 -2
  301. package/source/smart.grid.tree.js +1 -1
  302. package/source/smart.grid.view.js +2 -2
  303. package/source/smart.gridpanel.js +1 -1
  304. package/source/smart.input.js +2 -2
  305. package/source/smart.kanban.js +2 -2
  306. package/source/smart.layout.js +1 -1
  307. package/source/smart.led.js +1 -1
  308. package/source/smart.listbox.js +2 -2
  309. package/source/smart.listmenu.js +1 -1
  310. package/source/smart.map.js +1 -1
  311. package/source/smart.maskedtextbox.js +1 -1
  312. package/source/smart.math.js +1 -1
  313. package/source/smart.menu.js +1 -1
  314. package/source/smart.multicomboinput.js +2 -2
  315. package/source/smart.multiinput.js +1 -1
  316. package/source/smart.multilinetextbox.js +1 -1
  317. package/source/smart.multisplitbutton.js +1 -1
  318. package/source/smart.numberformatpanel.js +1 -1
  319. package/source/smart.numberinput.js +1 -1
  320. package/source/smart.numeric.js +1 -1
  321. package/source/smart.numerictextbox.js +1 -1
  322. package/source/smart.pager.js +1 -1
  323. package/source/smart.passwordinput.js +1 -1
  324. package/source/smart.passwordtextbox.js +1 -1
  325. package/source/smart.path.js +1 -1
  326. package/source/smart.phoneinput.js +1 -1
  327. package/source/smart.pivottable.js +1 -1
  328. package/source/smart.powerbutton.js +1 -1
  329. package/source/smart.progressbar.js +1 -1
  330. package/source/smart.qrcode.js +1 -1
  331. package/source/smart.radiobutton.js +1 -1
  332. package/source/smart.rating.js +1 -1
  333. package/source/smart.router.js +1 -1
  334. package/source/smart.scheduler.js +1 -1
  335. package/source/smart.scrollbar.js +1 -1
  336. package/source/smart.slider.js +1 -1
  337. package/source/smart.sortable.js +1 -1
  338. package/source/smart.splitter.js +1 -1
  339. package/source/smart.switchbutton.js +1 -1
  340. package/source/smart.table.js +1 -1
  341. package/source/smart.tabs.js +1 -1
  342. package/source/smart.tank.js +1 -1
  343. package/source/smart.textarea.js +1 -1
  344. package/source/smart.textbox.js +1 -1
  345. package/source/smart.tickintervalhandler.js +1 -1
  346. package/source/smart.timeinput.js +1 -1
  347. package/source/smart.timepicker.js +1 -1
  348. package/source/smart.toast.js +1 -1
  349. package/source/smart.tooltip.js +1 -1
  350. package/source/smart.tree.js +1 -1
  351. package/source/smart.validationpanel.js +1 -1
  352. package/source/smart.validator.js +1 -1
  353. package/source/smart.window.js +1 -1
  354. package/source/styles/components/smart.editor.css +1 -1
  355. package/source/styles/components/smart.fileupload.css +1 -1
  356. package/source/styles/components/smart.filterbuilder.css +1 -1
  357. package/source/styles/components/smart.grid.css +1 -1
  358. package/source/styles/components/smart.progressbar.css +1 -1
  359. package/source/styles/components/smart.window.css +1 -1
  360. package/source/styles/default/scss/_functions.scss +1 -4
  361. package/source/styles/default/scss/grid/_checkbox.scss +15 -0
  362. package/source/styles/default/scss/rtl/_progressbar.scss +0 -2
  363. package/source/styles/default/scss/smart.grid.scss +22 -13
  364. package/source/styles/default/scss/smart.progressbar.scss +4 -2
  365. package/source/styles/default/smart.grid.css +4282 -4277
  366. package/source/styles/default/smart.progressbar.css +502 -474
  367. package/source/styles/smart.default.css +2 -2
  368. package/splitter/splitter.esm.js +3 -3
  369. package/splitter/splitter.umd.js +3 -3
  370. package/switchbutton/switchbutton.esm.js +1 -1
  371. package/switchbutton/switchbutton.umd.js +1 -1
  372. package/table/table.esm.js +1 -1
  373. package/table/table.umd.js +1 -1
  374. package/tabs/tabs.esm.js +3 -3
  375. package/tabs/tabs.umd.js +3 -3
  376. package/tabswindow/tabswindow.esm.js +1 -1
  377. package/tabswindow/tabswindow.umd.js +1 -1
  378. package/tank/tank.esm.js +1 -1
  379. package/tank/tank.umd.js +1 -1
  380. package/textarea/textarea.esm.js +1 -1
  381. package/textarea/textarea.umd.js +1 -1
  382. package/textbox/textbox.esm.js +3 -3
  383. package/textbox/textbox.umd.js +3 -3
  384. package/threedchart/threedchart.esm.js +1 -1
  385. package/threedchart/threedchart.umd.js +1 -1
  386. package/timeinput/timeinput.esm.js +1 -1
  387. package/timeinput/timeinput.umd.js +1 -1
  388. package/timepicker/timepicker.esm.js +1 -1
  389. package/timepicker/timepicker.umd.js +1 -1
  390. package/toast/toast.esm.js +1 -1
  391. package/toast/toast.umd.js +1 -1
  392. package/tooltip/tooltip.esm.js +1 -1
  393. package/tooltip/tooltip.umd.js +1 -1
  394. package/tree/tree.esm.js +3 -3
  395. package/tree/tree.umd.js +3 -3
  396. package/validator/validator.esm.js +1 -1
  397. package/validator/validator.umd.js +1 -1
  398. package/waitwindow/waitwindow.esm.js +1 -1
  399. package/waitwindow/waitwindow.umd.js +1 -1
  400. package/window/window.esm.js +1 -1
  401. package/window/window.umd.js +1 -1
@@ -1,5 +1,5 @@
1
1
 
2
- /* Smart UI v15.2.18 (2023-05-27)
2
+ /* Smart UI v15.2.19 (2023-06-12)
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 v15.2.18 (2023-05-27)
2
+ /* Smart UI v15.2.19 (2023-06-12)
3
3
  Copyright (c) 2011-2023 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5
 
6
- Smart("smart-file-upload",class extends Smart.BaseElement{static get properties(){return{accept:{value:null,type:"string?"},appendTo:{value:null,type:"any"},autoUpload:{value:!1,type:"boolean"},directory:{value:!1,type:"boolean"},dropZone:{value:null,type:"any"},hideFooter:{value:!1,type:"boolean"},itemTemplate:{value:null,type:"any"},messages:{value:{en:{browse:"Browse",uploadFile:"Upload File",cancelFile:"Cancel File",pauseFile:"Pause File",uploadAll:"Upload All",cancelAll:"Cancel All",pauseAll:"Pause All",totalFiles:"Total files: ",connectionError:"{{elementType}}: File Upload requires connection to the server.",wrongItemIndex:"{{elementType}}: There is no file with such an index in the list of uploaded files.",tooLongFileName:"{{elementType}}: File name is too long."}},type:"object",extend:!0},multiple:{value:!1,type:"boolean"},name:{value:"userfile[]",type:"string"},postData:{value:null,type:"object"},responseHandler:{value:null,type:"function?",reflectToAttribute:!1},setHeaders:{value:null,type:"function?",reflectToAttribute:!1},showProgress:{value:!1,type:"boolean"},validateFile:{value:null,type:"function?",reflectToAttribute:!1},uploadUrl:{value:"",type:"string",reflectToAttribute:!1},removeUrl:{value:"",type:"string",reflectToAttribute:!1}}}static get listeners(){return{"browseButton.click":"browse","browseButton.focus":"_focusHandler","browseButton.blur":"_blurHandler","browseInput.change":"_browseInputChangeHandler","selectedFiles.click":"_selectedFilesClickHandler","uploadAllButton.click":"uploadAll","cancelAllButton.click":"cancelAll","pauseAllButton.click":"pauseAll","dropZone.dragenter":"_dropZoneHandler","dropZone.dragleave":"_dropZoneHandler","dropZone.dragover":"_dropZoneHandler","dropZone.drop":"_dropZoneHandler",resize:"_handleComponentsByAvailableHeight"}}_blurHandler(){this.$.fireEvent("blur")}_focusHandler(){this.$.fireEvent("focus")}static get requires(){return{"Smart.Button":"smart.button.js","Smart.ProgressBar":"smart.progressbar.js"}}static get styleUrls(){return["smart.fileupload.css"]}template(){return'<div id="container" role="presentation">\n <div id="fileUploadHeader" class="smart-file-upload-header" role="presentation">\n <smart-button class="smart-browse-button" id="browseButton" disabled="[[disabled]]" theme="[[theme]]" right-to-left="[[rightToLeft]]"></smart-button>\n <input type="file" class="smart-browse-input" id="browseInput" name="[[name]]" animation="[[animation]]" disabled="[[disabled]]" unfocusable="[[unfocusable]]" multiple="[[multiple]]" webkitdirectory="[[directory]]" mozdirectory="[[directory]]" />\n </div>\n <div id="fileUploadContainer" class="smart-file-upload-container">\n <div id="dropZone" class="smart-drop-zone" aria-label="Drag files here"></div>\n <div id="selectedFiles" class="smart-selected-files" role="list" aria-label="Selected files"></div>\n </div>\n <div id="totalFiles" class="smart-total-files smart-hidden" role="presentation">Total flies: 0</div>\n <div id="fileUploadFooter" class="smart-file-upload-footer smart-hidden"><smart-button class="smart-upload-all-button success" id="uploadAllButton" animation="[[animation]]" disabled="[[disabled]]" unfocusable="[[unfocusable]]"" theme="[[theme]]" right-to-left="[[rightToLeft]]"></smart-button><smart-button class="smart-cancel-all-button error" id="cancelAllButton" animation="[[animation]]" disabled="[[disabled]]" unfocusable="[[unfocusable]]" theme="[[theme]]" right-to-left="[[rightToLeft]]"></smart-button><smart-button class="smart-pause-all-button primary" id="pauseAllButton" animation="[[animation]]" disabled="[[disabled]]" unfocusable="[[unfocusable]]" theme="[[theme]]" right-to-left="[[rightToLeft]]"></smart-button></div>\n </div>'}propertyChangedHandler(e,t,l){const s=this;switch(super.propertyChangedHandler(e,t,l),e){case"accept":s.$.browseInput.accept=l;break;case"dropZone":case"appendTo":s._handleContainers();break;case"messages":case"locale":s._updateTextValues();break;case"multiple":s.$.browseButton.disabled=!!(!s.multiple&&s._selectedFiles.length>0||s.disabled),!l&&s._selectedFiles.length>1&&(s._selectedFiles.splice(1),s._renderSelectedFiles());break;case"itemTemplate":s._items.length>0&&(s._renderSelectedFiles(),s._handleComponentsByAvailableHeight());break;case"rightToLeft":s._items&&s._items.forEach((e=>{const t=e.querySelector("smart-progress-bar");t&&(t.rightToLeft=l),l?e.setAttribute("right-to-left",""):e.removeAttribute("right-to-left")})),l?s.$.dropZone.setAttribute("right-to-left",""):s.$.dropZone.removeAttribute("right-to-left")}}attached(){super.attached(),this._handleContainers()}detached(){super.detached();const e=this;e.$.fileUploadContainer.contains(e.$.dropZone)||e.$.fileUploadContainer.insertBefore(e.$.dropZone,e.$.fileUploadContainer.firstChild),e.$.fileUploadContainer.contains(e.$.selectedFiles)||e.$.fileUploadContainer.appendChild(e.$.selectedFiles)}ready(){super.ready();const e=this;e.$.dropZone.id||(e.$.dropZone.id=e.id+"DropZone"),e.$.selectedFiles.id||(e.$.selectedFiles.id=e.id+"SelectedFiles"),e.$.fileUploadContainer.setAttribute("aria-owns",e.$.dropZone.id+" "+e.$.selectedFiles.id),e.setAttribute("role","dialog"),e.rightToLeft?e.$.dropZone.setAttribute("right-to-left",""):e.$.dropZone.removeAttribute("right-to-left"),e._setInitialValues(),e._updateTextValues(),e._handleContainers(),e._handleComponentsByAvailableHeight()}browse(){const e=this;e.disabled||!e.multiple&&e._selectedFiles.length>0||e.$.browseInput.click()}addFile(e){const t=this,l=t.multiple;let s=t._selectedFiles;s&&(l||!s.length)&&e instanceof File&&("function"!=typeof t.validateFile||t.validateFile(e))&&(s=s.push(e),t._renderSelectedFiles([e]),t.$.browseButton.disabled=!!(!l&&s.length>0||t.disabled),t.$.browseInput.value="")}cancelAll(){const e=this;if(!e.disabled&&0!==e._items.length){for(let t=e._items.length-1;t>=0;t--)e.cancelFile(e._items[t].index);e.$.browseButton.disabled=!!(!e.multiple&&e._selectedFiles.length>0||e.disabled)}}cancelFile(e){const t=this,l=()=>{t.$.selectedFiles.removeChild(s),t._selectedFiles.splice(i,1),t._items.splice(i,1),t.$.fireEvent("uploadCanceled",{filename:s.file.name,type:s.file.type,size:s.file.size,index:s.index}),t.$.browseButton.disabled=!!(!t.multiple&&t._selectedFiles.length>0||t.disabled),0===t._selectedFiles.length&&t.$.fileUploadFooter.classList.add("smart-hidden"),t._handleComponentsByAvailableHeight()};if("number"!=typeof e||t.disabled||0===t._selectedFiles.length)return;const s=t._getFileItem(e,!0);if(!s)return void t.error(t.localize("wrongItemIndex",{elementType:t.nodeName.toLowerCase()}));const i=t._items.indexOf(s),a=t._selectedFiles[i];if(s&&s.xhr&&s.xhr.abort(),!t.removeUrl)return void l();let n=new FormData,r=new XMLHttpRequest;n.append(t.name,a),r.open("POST",t.removeUrl),t.setHeaders&&"function"==typeof t.setHeaders&&t.setHeaders(r,a),r.onload=function(){r.status>=200&&r.status<=299?l():t.$.fireEvent("uploadCanceledError",{filename:s.file.name,type:s.file.type,size:s.file.size,status:r.status,index:s.index})},r.onreadystatechange=function(){t.responseHandler&&"function"==typeof t.responseHandler&&t.responseHandler(r)},r.send(n)}get value(){return this._selectedFiles}get files(){return this._selectedFiles}pauseAll(){const e=this;if(!e.disabled&&0!==e._items.length)for(let t=e._items.length-1;t>=0;t--){let l=e._items[t];l.xhr&&l.xhr.abort()}}pauseFile(e){const t=this;if("number"!=typeof e&&"string"!=typeof e||t.disabled||0===t._items.length)return;const l=t._getFileItem(e,!0);l?(l.classList.remove("smart-uploading-start"),l&&l.xhr&&l.xhr.abort(),t.$.fireEvent("uploadPaused",{filename:l.file.name,type:l.file.type,size:l.file.size,index:l.index})):t.error(t.localize("wrongItemIndex",{elementType:t.nodeName.toLowerCase()}))}uploadAll(){const e=this;if(!e.disabled&&0!==e._items.length)for(let t=e._items.length-1;t>=0;t--)e._items[t].uploading||e.uploadFile(e._items[t].index)}uploadFile(e){const t=this;let l=!1;if("number"!=typeof e||t.disabled||0===t._selectedFiles.length)return;const s=t._getFileItem(e,!0);if(!s)return;let i=new FormData,a=t.showProgress?s.getElementsByTagName("smart-progress-bar")[0]:null,n=s.file,r="";t.postData?r=JSON.stringify(t.postData):t.getAttribute("post-data")&&(r=t.getAttribute("post-data")),r&&""!==r&&i.append("postData",r),s.classList.remove("smart-pause","smart-error"),s.classList.add("smart-uploading-start"),i.append(t.name,n);let o=new XMLHttpRequest;o.open("POST",t.uploadUrl),t.setHeaders&&"function"==typeof t.setHeaders&&t.setHeaders(o,n),t.$.fireEvent("uploadStarted",{filename:s.file.name,type:s.file.type,size:s.file.size,index:s.index}),o.upload.onprogress=function(e){l||(l=!0,s.classList.remove("smart-uploading-start"),s.classList.add("smart-uploading"),s.uploading=!0,s.xhr=o),a&&(a.value=Math.round(e.loaded/e.total*100)),s.classList.remove("smart-pause","smart-error")},o.onabort=function(){s.classList.remove("smart-uploading-start","smart-uploading"),s.classList.add("smart-pause"),s.addEventListener("animationend",(function(){s.classList.remove("smart-pause","smart-error")}))},o.onerror=function(){s.classList.remove("smart-uploading-start","smart-uploading"),s.classList.add("smart-error"),s.addEventListener("animationend",(function(){s.classList.remove("smart-pause","smart-error")}))},o.onload=function(){if(l=!1,s.classList.remove("smart-uploading-start","smart-uploading"),o.status>=200&&o.status<=299){let e=t._items.indexOf(s);t.$.selectedFiles.removeChild(s),t._selectedFiles.splice(t._selectedFiles.indexOf(n),1),t._items.splice(e,1),t.$.browseButton.disabled=!!(!t.multiple&&t._selectedFiles.length>0||t.disabled);let l=t.uploadUrl+"/"+s.file.name;o.fileURL&&(l=o.file_url);let i=!1;o.response&&("string"==typeof o.response?(i=o.response,(i&&i.indexOf("[{")>=0||i&&i.indexOf("{")>=0)&&(i=JSON.parse(i))):i=JSON.parse(o.response),i&&(Array.isArray(i)?i[0].file_url?l=i[0].file_url:i[0].fileURL&&(l=i[0].fileURL):i.file_url?l=i.file_url:i.fileURL&&(l=i.fileURL))),t.$.fireEvent("uploadCompleted",{filename:s.file.name,type:s.file.type,size:s.file.size,status:o.status,index:s.index,fileURL:l,serverResponse:i}),0===t._selectedFiles.length&&t.$.fileUploadFooter.classList.add("smart-hidden")}else{s.classList.add("smart-error"),s.classList.remove("smart-uploading");let e="no server response";o.response&&(e="string"==typeof o.response?o.response:JSON.parse(o.response)),t.$.fireEvent("uploadError",{filename:s.file.name,type:s.file.type,size:s.file.size,status:o.status,index:s.index,serverResponse:e})}},o.onreadystatechange=function(){t.responseHandler&&"function"==typeof t.responseHandler&&t.responseHandler(o)},o.send(i)}_selectedFilesClickHandler(e){const t=this;if(t.disabled)return;const l=e.target,s=l.closest(".smart-item-upload-button"),i=l.closest(".smart-item-cancel-button"),a=l.closest(".smart-item-pause-button"),n=l.closest(".smart-file");s?t.uploadFile(n.index):i?t.cancelFile(n.index):a&&t.pauseFile(n.index)}_browseInputChangeHandler(){const e=this,t=e._filterNewFiles(Array.from(e.$.browseInput.files));let l=[];e.disabled||0===t.length||(l=e.validateFile&&"function"==typeof e.validateFile?t.filter((t=>!!e.validateFile(t)||(e.$.fireEvent("validationError",{filename:t.name,type:t.type,size:t.size}),!1))):t,e._selectedFiles=e._selectedFiles.concat(l),0!==e._selectedFiles.length&&(e._renderSelectedFiles(l),e.$.browseButton.disabled=!!(!e.multiple&&e._selectedFiles.length>0||e.disabled),e.$.browseInput.value="",e.autoUpload&&e.uploadAll()))}_defaultItemTemplate(e,t){const l=this,s=l.localize("uploadFile"),i=l.localize("cancelFile"),a=l.localize("pauseFile"),n=l.rightToLeft?"right-to-left ":"";return`<span id="${l.id+"File"+t+"Name"}" class="smart-item-name">${e}</span><span class="smart-item-upload-button" title="${s}" role="button" aria-label="${s}"></span><span class="smart-item-cancel-button" title="${i}" role="button" aria-label="${i}"></span><span class="smart-item-pause-button" title="${a}" role="button" aria-label="${a}"></span><smart-progress-bar ${n}aria-label="Upload progress"></smart-progress-bar>`}_dropZoneHandler(e){const t=this;if(e.preventDefault(),e.stopPropagation(),!t.disabled)if("dragenter"!==e.type&&"dragleave"!==e.type){if("drop"===e.type){if(t.$.dropZone.classList.remove("smart-drag-over"),!t.multiple&&t._selectedFiles.length>0)return;if(e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length){const l=t._filterNewFiles(Array.from(e.dataTransfer.files));if(0===l.length)return;t.multiple||l.splice(1);let s=[];if(t.disabled)return;if(s=t.validateFile&&"function"==typeof t.validateFile?l.filter((e=>!!t.validateFile(e)||(t.$.fireEvent("validationError",{filename:e.name,type:e.type,size:e.size}),!1))):l,t._selectedFiles=t._selectedFiles.concat(s),0===t._selectedFiles.length)return;t._renderSelectedFiles(l)}t.$.browseButton.disabled=!!(!t.multiple&&t._selectedFiles.length>0||t.disabled)}}else"dragenter"===e.type?t.$.dropZone.classList.add("smart-drag-over"):t.$.dropZone.classList.remove("smart-drag-over")}_filterNewFiles(e){const t=this;let l=[];for(let s=0;s<e.length;s++){let i=!0;for(let l=0;l<t._selectedFiles.length;l++){const a=t._selectedFiles[l],n=e[s];if(n.name===a.name&&n.size===a.size&&n.type===a.type&&n.lastModified===a.lastModified){i=!1;break}}i&&l.push(e[s])}return l}_getFileItem(e,t){const l=this;let s=null;if(e&&("string"==typeof e||"number"==typeof e)){if(!l._items||0===l._items.length)return null;for(let i=0;i<l._items.length;i++){const a=l._items[i];(t&&a.index===parseInt(e)||a.file.name===e)&&(s=a)}return s}}_handleContainers(){const e=this,t=e._validateDOMElement(e.dropZone),l=e._validateDOMElement(e.appendTo);t?t.appendChild(e.$.dropZone):e.$.fileUploadContainer.insertBefore(e.$.dropZone,e.$.fileUploadContainer.firstChild),l?l.appendChild(e.$.selectedFiles):e.$.fileUploadContainer.appendChild(e.$.selectedFiles)}_handleItemTemplate(e,t){const l=this;let s=l.itemTemplate;if("content"in document.createElement("template")){if(!s)return l._defaultItemTemplate(e,t);if("string"==typeof s&&(s=document.getElementById(s)),null!==s&&"content"in s)return s.innerHTML.replace(/{{\w+}}/g,e);l.error(l.localize("invalidTemplate",{elementType:l.nodeName.toLowerCase(),property:"template"}))}else l.error(l.localize("htmlTemplateNotSuported",{elementType:l.nodeName.toLowerCase()}))}_renderSelectedFiles(e){const t=this,l=document.createDocumentFragment(),s=e||t._selectedFiles;e||(t._items=[],t.$.selectedFiles.innerHTML="");for(let e=0;e<s.length;e++){const i=t.directory?s[e].webkitRelativePath:s[e].name,a=document.createElement("div");t._incrementIndex++,a.className="smart-file",a.index=t._incrementIndex,a.setAttribute("item-id",t._incrementIndex),a.innerHTML=t.itemTemplate?t._handleItemTemplate(i,t._incrementIndex):t._defaultItemTemplate(i,t._incrementIndex),a.file=s[e],a.uploading=!1,a.xhr=null,a.setAttribute("role","listitem"),a.setAttribute("aria-labelledby",t.id+"File"+t._incrementIndex+"Name"),t.rightToLeft&&a.setAttribute("right-to-left",""),l.appendChild(a),t._items.push(a),t.$.fireEvent("fileSelected",{filename:s[e].name,type:s[e].type,size:s[e].size,index:a.index})}t.$.selectedFiles.appendChild(l),t.$.fileUploadFooter.classList.remove("smart-hidden"),t._handleComponentsByAvailableHeight()}_setInitialValues(){const e=this;e.$.browseInput.accept=e.accept,e._selectedFiles=[],e._items=[],e._incrementIndex=0}_updateTextValues(){const e=this,t=["browse","uploadAll","cancelAll","pauseAll"];for(let l=0;l<t.length;l++){const s=t[l],i=s+"Button";e.$[i].innerHTML=e.localize(s)}for(let t=0;t<e._selectedFiles.length;t++){const l=e._items[t];l.querySelector(".smart-item-upload-button").title=e.localize("uploadFile"),l.querySelector(".smart-item-cancel-button").title=e.localize("cancelFile"),l.querySelector(".smart-item-pause-button").title=e.localize("pauseFile")}}_validateDOMElement(e){if(e)return"string"==typeof e?document.getElementById(e):e instanceof HTMLElement?e:void 0}refresh(){this._handleComponentsByAvailableHeight()}_handleComponentsByAvailableHeight(){const e=this;if(e._calculateAvailableContainerHeight(),e._elementsAutoHeight>e.offsetHeight){if(e.$.container.classList.add("smart-overflow"),e._containerOverflows=!0,e._rowHeight){const t=parseInt(e._availableHeight/e._rowHeight);for(let l=0;l<e._items.length;l++){const s=e._items[l];l<t?s.classList.remove("smart-hidden"):s.classList.add("smart-hidden")}e._items.length>t?(e.$.totalFiles.innerHTML=e.localize("totalFiles")+e._items.length,e.$.totalFiles.classList.remove("smart-hidden")):e.$.totalFiles.classList.add("smart-hidden")}}else""===e.dropZone&&e._elementsAutoHeight<e.offsetHeight&&(e.$.container.classList.remove("smart-overflow"),e._containerOverflows=!1)}_calculateAvailableContainerHeight(){const e=this,t=window.getComputedStyle(e.$.fileUploadContainer,null),l=parseInt(t.getPropertyValue("margin-top"))+parseInt(t.getPropertyValue("margin-bottom"))+parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom")),s=e.$.container.querySelector(".smart-file"),i=e.$.fileUploadHeader.offsetHeight,a=e.$.fileUploadFooter.offsetHeight,n=e.style.height;let r=0;s&&(e._rowHeight=s.offsetHeight),e.style.height="auto",e._containerOverflows&&e.$.container.classList.remove("smart-overflow"),e._elementsAutoHeight=e.offsetHeight,e.style.height=n,e._containerOverflows&&e.$.container.classList.add("smart-overflow"),e.$.totalFiles.classList.contains("smart-hidden")&&(e.$.totalFiles.classList.remove("smart-hidden"),r=e.$.totalFiles.offsetHeight,e.$.totalFiles.classList.add("smart-hidden")),e._availableHeight=e.offsetHeight-(i+a)-l-r}});
6
+ Smart("smart-file-upload",class extends Smart.BaseElement{static get properties(){return{accept:{value:null,type:"string?"},appendTo:{value:null,type:"any"},autoUpload:{value:!1,type:"boolean"},directory:{value:!1,type:"boolean"},dropZone:{value:null,type:"any"},hideFooter:{value:!1,type:"boolean"},itemTemplate:{value:null,type:"any"},messages:{value:{en:{browse:"Browse",uploadFile:"Upload File",cancelFile:"Cancel File",pauseFile:"Pause File",uploadAll:"Upload All",cancelAll:"Cancel All",pauseAll:"Pause All",totalFiles:"Total files: ",connectionError:"{{elementType}}: File Upload requires connection to the server.",wrongItemIndex:"{{elementType}}: There is no file with such an index in the list of uploaded files.",tooLongFileName:"{{elementType}}: File name is too long."}},type:"object",extend:!0},multiple:{value:!1,type:"boolean"},name:{value:"userfile[]",type:"string"},postData:{value:null,type:"object"},responseHandler:{value:null,type:"function?",reflectToAttribute:!1},setHeaders:{value:null,type:"function?",reflectToAttribute:!1},showProgress:{value:!1,type:"boolean"},validateFile:{value:null,type:"function?",reflectToAttribute:!1},uploadUrl:{value:"",type:"string",reflectToAttribute:!1},removeUrl:{value:"",type:"string",reflectToAttribute:!1}}}static get listeners(){return{"browseButton.click":"browse","browseButton.focus":"_focusHandler","browseButton.blur":"_blurHandler","browseInput.change":"_browseInputChangeHandler","selectedFiles.click":"_selectedFilesClickHandler","uploadAllButton.click":"uploadAll","cancelAllButton.click":"cancelAll","pauseAllButton.click":"pauseAll","dropZone.dragenter":"_dropZoneHandler","dropZone.dragleave":"_dropZoneHandler","dropZone.dragover":"_dropZoneHandler","dropZone.drop":"_dropZoneHandler",resize:"_handleComponentsByAvailableHeight"}}_blurHandler(){this.$.fireEvent("blur")}_focusHandler(){this.$.fireEvent("focus")}static get requires(){return{"Smart.Button":"smart.button.js","Smart.ProgressBar":"smart.progressbar.js"}}static get styleUrls(){return["smart.fileupload.css"]}template(){return'<div id="container" role="presentation">\n <div id="fileUploadHeader" class="smart-file-upload-header" role="presentation">\n <smart-button class="smart-browse-button" id="browseButton" disabled="[[disabled]]" theme="[[theme]]" right-to-left="[[rightToLeft]]"></smart-button>\n <input type="file" class="smart-browse-input" id="browseInput" name="[[name]]" animation="[[animation]]" disabled="[[disabled]]" unfocusable="[[unfocusable]]" multiple="[[multiple]]" webkitdirectory="[[directory]]" mozdirectory="[[directory]]" />\n </div>\n <div id="fileUploadContainer" class="smart-file-upload-container">\n <div id="dropZone" class="smart-drop-zone" aria-label="Drag files here"></div>\n <div id="selectedFiles" class="smart-selected-files" role="list" aria-label="Selected files"></div>\n </div>\n <div id="totalFiles" class="smart-total-files smart-hidden" role="presentation">Total flies: 0</div>\n <div id="fileUploadFooter" class="smart-file-upload-footer smart-hidden"><smart-button class="smart-upload-all-button success" id="uploadAllButton" animation="[[animation]]" disabled="[[disabled]]" unfocusable="[[unfocusable]]"" theme="[[theme]]" right-to-left="[[rightToLeft]]"></smart-button><smart-button class="smart-cancel-all-button error" id="cancelAllButton" animation="[[animation]]" disabled="[[disabled]]" unfocusable="[[unfocusable]]" theme="[[theme]]" right-to-left="[[rightToLeft]]"></smart-button><smart-button class="smart-pause-all-button primary" id="pauseAllButton" animation="[[animation]]" disabled="[[disabled]]" unfocusable="[[unfocusable]]" theme="[[theme]]" right-to-left="[[rightToLeft]]"></smart-button></div>\n </div>'}propertyChangedHandler(e,t,l){const s=this;switch(super.propertyChangedHandler(e,t,l),e){case"accept":s.$.browseInput.accept=l;break;case"dropZone":case"appendTo":s._handleContainers();break;case"messages":case"locale":s._updateTextValues();break;case"multiple":s.$.browseButton.disabled=!!(!s.multiple&&s._selectedFiles.length>0||s.disabled),!l&&s._selectedFiles.length>1&&(s._selectedFiles.splice(1),s._renderSelectedFiles());break;case"itemTemplate":s._items.length>0&&(s._renderSelectedFiles(),s._handleComponentsByAvailableHeight());break;case"rightToLeft":s._items&&s._items.forEach((e=>{const t=e.querySelector("smart-progress-bar");t&&(t.rightToLeft=l),l?e.setAttribute("right-to-left",""):e.removeAttribute("right-to-left")})),l?s.$.dropZone.setAttribute("right-to-left",""):s.$.dropZone.removeAttribute("right-to-left")}}attached(){super.attached(),this._handleContainers()}detached(){super.detached();const e=this;e.$.fileUploadContainer.contains(e.$.dropZone)||e.$.fileUploadContainer.insertBefore(e.$.dropZone,e.$.fileUploadContainer.firstChild),e.$.fileUploadContainer.contains(e.$.selectedFiles)||e.$.fileUploadContainer.appendChild(e.$.selectedFiles)}ready(){super.ready();const e=this;e.$.dropZone.id||(e.$.dropZone.id=e.id+"DropZone"),e.$.selectedFiles.id||(e.$.selectedFiles.id=e.id+"SelectedFiles"),e.$.fileUploadContainer.setAttribute("aria-owns",e.$.dropZone.id+" "+e.$.selectedFiles.id),e.setAttribute("role","dialog"),e.rightToLeft?e.$.dropZone.setAttribute("right-to-left",""):e.$.dropZone.removeAttribute("right-to-left"),e._setInitialValues(),e._updateTextValues(),e._handleContainers(),e._handleComponentsByAvailableHeight()}browse(){const e=this;e.disabled||!e.multiple&&e._selectedFiles.length>0||e.$.browseInput.click()}addFile(e){const t=this,l=t.multiple;let s=t._selectedFiles;s&&(l||!s.length)&&e instanceof File&&("function"!=typeof t.validateFile||t.validateFile(e))&&(s=s.push(e),t._renderSelectedFiles([e]),t.$.browseButton.disabled=!!(!l&&s.length>0||t.disabled),t.$.browseInput.value="")}cancelAll(){const e=this;if(!e.disabled&&0!==e._items.length){for(let t=e._items.length-1;t>=0;t--)e.cancelFile(e._items[t].index);e.$.browseButton.disabled=!!(!e.multiple&&e._selectedFiles.length>0||e.disabled)}}cancelFile(e){const t=this,l=()=>{t.$.selectedFiles.removeChild(s),t._selectedFiles.splice(i,1),t._items.splice(i,1),t.$.fireEvent("uploadCanceled",{filename:s.file.name,type:s.file.type,size:s.file.size,index:s.index}),t.$.browseButton.disabled=!!(!t.multiple&&t._selectedFiles.length>0||t.disabled),0===t._selectedFiles.length&&t.$.fileUploadFooter.classList.add("smart-hidden"),t._handleComponentsByAvailableHeight()};if("number"!=typeof e||t.disabled||0===t._selectedFiles.length)return;const s=t._getFileItem(e,!0);if(!s)return void t.error(t.localize("wrongItemIndex",{elementType:t.nodeName.toLowerCase()}));const i=t._items.indexOf(s),a=t._selectedFiles[i];if(s&&s.xhr&&s.xhr.abort(),!t.removeUrl)return void l();let n=new FormData,r=new XMLHttpRequest;n.append(t.name,a),r.open("POST",t.removeUrl),t.setHeaders&&"function"==typeof t.setHeaders&&t.setHeaders(r,a),r.onload=function(){r.status>=200&&r.status<=299?l():t.$.fireEvent("uploadCanceledError",{filename:s.file.name,type:s.file.type,size:s.file.size,status:r.status,index:s.index})},r.onreadystatechange=function(){t.responseHandler&&"function"==typeof t.responseHandler&&t.responseHandler(r)},r.send(n)}get value(){return this._selectedFiles}get files(){return this._selectedFiles}pauseAll(){const e=this;if(!e.disabled&&0!==e._items.length)for(let t=e._items.length-1;t>=0;t--){let l=e._items[t];l.xhr&&l.xhr.abort()}}pauseFile(e){const t=this;if("number"!=typeof e&&"string"!=typeof e||t.disabled||0===t._items.length)return;const l=t._getFileItem(e,!0);l?(l.classList.remove("smart-uploading-start"),l&&l.xhr&&l.xhr.abort(),t.$.fireEvent("uploadPaused",{filename:l.file.name,type:l.file.type,size:l.file.size,index:l.index})):t.error(t.localize("wrongItemIndex",{elementType:t.nodeName.toLowerCase()}))}uploadAll(){const e=this;if(!e.disabled&&0!==e._items.length)for(let t=e._items.length-1;t>=0;t--)e._items[t].uploading||e.uploadFile(e._items[t].index)}uploadFile(e){const t=this;let l=!1;if("number"!=typeof e||t.disabled||0===t._selectedFiles.length)return;const s=t._getFileItem(e,!0);if(!s)return;let i=new FormData,a=t.showProgress?s.getElementsByTagName("smart-progress-bar")[0]:null,n=s.file,r="";t.postData?r=JSON.stringify(t.postData):t.getAttribute("post-data")&&(r=t.getAttribute("post-data")),r&&""!==r&&i.append("postData",r),s.classList.remove("smart-pause","smart-error"),s.classList.add("smart-uploading-start"),i.append(t.name,n);let o=new XMLHttpRequest;o.open("POST",t.uploadUrl),t.setHeaders&&"function"==typeof t.setHeaders&&t.setHeaders(o,n),t.$.fireEvent("uploadStarted",{filename:s.file.name,type:s.file.type,size:s.file.size,index:s.index}),o.upload.onprogress=function(e){l||(l=!0,s.classList.remove("smart-uploading-start"),s.classList.add("smart-uploading"),s.uploading=!0,s.xhr=o),a&&(a.value=Math.round(e.loaded/e.total*100)),s.classList.remove("smart-pause","smart-error")},o.onabort=function(){s.classList.remove("smart-uploading-start","smart-uploading"),s.classList.add("smart-pause"),s.addEventListener("animationend",(function(){s.classList.remove("smart-pause","smart-error")}))},o.onerror=function(){s.classList.remove("smart-uploading-start","smart-uploading"),s.classList.add("smart-error"),s.addEventListener("animationend",(function(){s.classList.remove("smart-pause","smart-error")}))},o.onload=function(){if(l=!1,s.classList.remove("smart-uploading-start","smart-uploading"),o.status>=200&&o.status<=299){let e=t._items.indexOf(s);t.$.selectedFiles.removeChild(s),t._selectedFiles.splice(t._selectedFiles.indexOf(n),1),t._items.splice(e,1),t.$.browseButton.disabled=!!(!t.multiple&&t._selectedFiles.length>0||t.disabled);let l=t.uploadUrl+"/"+s.file.name;o.fileURL&&(l=o.file_url);let i=!1;o.response&&("string"==typeof o.response?(i=o.response,(i&&i.indexOf("[{")>=0||i&&i.indexOf("{")>=0)&&(i=JSON.parse(i))):i=JSON.parse(o.response),i&&(Array.isArray(i)?i[0].file_url?l=i[0].file_url:i[0].fileURL&&(l=i[0].fileURL):i.file_url?l=i.file_url:i.fileURL&&(l=i.fileURL))),t.$.fireEvent("uploadCompleted",{filename:s.file.name,type:s.file.type,size:s.file.size,status:o.status,index:s.index,fileURL:l,serverResponse:i}),0===t._selectedFiles.length&&t.$.fileUploadFooter.classList.add("smart-hidden")}else{s.classList.add("smart-error"),s.classList.remove("smart-uploading");let e="no server response";o.response&&(e="string"==typeof o.response?o.response:JSON.parse(o.response)),t.$.fireEvent("uploadError",{filename:s.file.name,type:s.file.type,size:s.file.size,status:o.status,index:s.index,serverResponse:e})}},o.onreadystatechange=function(){t.responseHandler&&"function"==typeof t.responseHandler&&t.responseHandler(o)},o.send(i)}_selectedFilesClickHandler(e){const t=this;if(t.disabled)return;const l=e.target,s=l.closest(".smart-item-upload-button"),i=l.closest(".smart-item-cancel-button"),a=l.closest(".smart-item-pause-button"),n=l.closest(".smart-file");s?t.uploadFile(n.index):i?t.cancelFile(n.index):a&&t.pauseFile(n.index)}_browseInputChangeHandler(){const e=this,t=e._filterNewFiles(Array.from(e.$.browseInput.files));let l=[];e.disabled||0===t.length||(l=e.validateFile&&"function"==typeof e.validateFile?t.filter((t=>!!e.validateFile(t)||(e.$.fireEvent("validationError",{filename:t.name,type:t.type,size:t.size}),!1))):t,e._selectedFiles=e._selectedFiles.concat(l),0!==e._selectedFiles.length&&(e._renderSelectedFiles(l),e.$.browseButton.disabled=!!(!e.multiple&&e._selectedFiles.length>0||e.disabled),e.$.browseInput.value="",e.autoUpload&&e.uploadAll()))}_defaultItemTemplate(e,t){const l=this,s=l.localize("uploadFile"),i=l.localize("cancelFile"),a=l.localize("pauseFile"),n=l.rightToLeft?"right-to-left ":"";return`<span id="${l.id+"File"+t+"Name"}" class="smart-item-name">${e}</span><span class="smart-item-upload-button" title="${s}" role="button" aria-label="${s}"></span><span class="smart-item-cancel-button" title="${i}" role="button" aria-label="${i}"></span><span class="smart-item-pause-button" title="${a}" role="button" aria-label="${a}"></span><smart-progress-bar ${n}aria-label="Upload progress"></smart-progress-bar>`}_dropZoneHandler(e){const t=this;if(e.preventDefault(),e.stopPropagation(),!t.disabled)if("dragenter"!==e.type&&"dragleave"!==e.type){if("drop"===e.type){if(t.$.dropZone.classList.remove("smart-drag-over"),!t.multiple&&t._selectedFiles.length>0)return;if(e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length){const l=t._filterNewFiles(Array.from(e.dataTransfer.files));if(0===l.length)return;t.multiple||l.splice(1);let s=[];if(t.disabled)return;if(s=t.validateFile&&"function"==typeof t.validateFile?l.filter((e=>!!t.validateFile(e)||(t.$.fireEvent("validationError",{filename:e.name,type:e.type,size:e.size}),!1))):l,t._selectedFiles=t._selectedFiles.concat(s),0===t._selectedFiles.length)return;t._renderSelectedFiles(l),t.autoUpload&&t.uploadAll()}t.$.browseButton.disabled=!!(!t.multiple&&t._selectedFiles.length>0||t.disabled)}}else"dragenter"===e.type?t.$.dropZone.classList.add("smart-drag-over"):t.$.dropZone.classList.remove("smart-drag-over")}_filterNewFiles(e){const t=this;let l=[];for(let s=0;s<e.length;s++){let i=!0;for(let l=0;l<t._selectedFiles.length;l++){const a=t._selectedFiles[l],n=e[s];if(n.name===a.name&&n.size===a.size&&n.type===a.type&&n.lastModified===a.lastModified){i=!1;break}}i&&l.push(e[s])}return l}_getFileItem(e,t){const l=this;let s=null;if(e&&("string"==typeof e||"number"==typeof e)){if(!l._items||0===l._items.length)return null;for(let i=0;i<l._items.length;i++){const a=l._items[i];(t&&a.index===parseInt(e)||a.file.name===e)&&(s=a)}return s}}_handleContainers(){const e=this,t=e._validateDOMElement(e.dropZone),l=e._validateDOMElement(e.appendTo);t?t.appendChild(e.$.dropZone):e.$.fileUploadContainer.insertBefore(e.$.dropZone,e.$.fileUploadContainer.firstChild),l?l.appendChild(e.$.selectedFiles):e.$.fileUploadContainer.appendChild(e.$.selectedFiles)}_handleItemTemplate(e,t){const l=this;let s=l.itemTemplate;if("content"in document.createElement("template")){if(!s)return l._defaultItemTemplate(e,t);if("string"==typeof s&&(s=document.getElementById(s)),null!==s&&"content"in s)return s.innerHTML.replace(/{{\w+}}/g,e);l.error(l.localize("invalidTemplate",{elementType:l.nodeName.toLowerCase(),property:"template"}))}else l.error(l.localize("htmlTemplateNotSuported",{elementType:l.nodeName.toLowerCase()}))}_renderSelectedFiles(e){const t=this,l=document.createDocumentFragment(),s=e||t._selectedFiles;e||(t._items=[],t.$.selectedFiles.innerHTML="");for(let e=0;e<s.length;e++){const i=t.directory?s[e].webkitRelativePath:s[e].name,a=document.createElement("div");t._incrementIndex++,a.className="smart-file",a.index=t._incrementIndex,a.setAttribute("item-id",t._incrementIndex),a.innerHTML=t.itemTemplate?t._handleItemTemplate(i,t._incrementIndex):t._defaultItemTemplate(i,t._incrementIndex),a.file=s[e],a.uploading=!1,a.xhr=null,a.setAttribute("role","listitem"),a.setAttribute("aria-labelledby",t.id+"File"+t._incrementIndex+"Name"),t.rightToLeft&&a.setAttribute("right-to-left",""),l.appendChild(a),t._items.push(a),t.$.fireEvent("fileSelected",{filename:s[e].name,type:s[e].type,size:s[e].size,index:a.index})}t.$.selectedFiles.appendChild(l),t.$.fileUploadFooter.classList.remove("smart-hidden"),t._handleComponentsByAvailableHeight()}_setInitialValues(){const e=this;e.$.browseInput.accept=e.accept,e._selectedFiles=[],e._items=[],e._incrementIndex=0}_updateTextValues(){const e=this,t=["browse","uploadAll","cancelAll","pauseAll"];for(let l=0;l<t.length;l++){const s=t[l],i=s+"Button";e.$[i].innerHTML=e.localize(s)}for(let t=0;t<e._selectedFiles.length;t++){const l=e._items[t];l.querySelector(".smart-item-upload-button").title=e.localize("uploadFile"),l.querySelector(".smart-item-cancel-button").title=e.localize("cancelFile"),l.querySelector(".smart-item-pause-button").title=e.localize("pauseFile")}}_validateDOMElement(e){if(e)return"string"==typeof e?document.getElementById(e):e instanceof HTMLElement?e:void 0}refresh(){this._handleComponentsByAvailableHeight()}_handleComponentsByAvailableHeight(){const e=this;if(e._calculateAvailableContainerHeight(),e._elementsAutoHeight>e.offsetHeight){if(e.$.container.classList.add("smart-overflow"),e._containerOverflows=!0,e._rowHeight){const t=parseInt(e._availableHeight/e._rowHeight);for(let l=0;l<e._items.length;l++){const s=e._items[l];l<t?s.classList.remove("smart-hidden"):s.classList.add("smart-hidden")}e._items.length>t?(e.$.totalFiles.innerHTML=e.localize("totalFiles")+e._items.length,e.$.totalFiles.classList.remove("smart-hidden")):e.$.totalFiles.classList.add("smart-hidden")}}else""===e.dropZone&&e._elementsAutoHeight<e.offsetHeight&&(e.$.container.classList.remove("smart-overflow"),e._containerOverflows=!1)}_calculateAvailableContainerHeight(){const e=this,t=window.getComputedStyle(e.$.fileUploadContainer,null),l=parseInt(t.getPropertyValue("margin-top"))+parseInt(t.getPropertyValue("margin-bottom"))+parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom")),s=e.$.container.querySelector(".smart-file"),i=e.$.fileUploadHeader.offsetHeight,a=e.$.fileUploadFooter.offsetHeight,n=e.style.height;let r=0;s&&(e._rowHeight=s.offsetHeight),e.style.height="auto",e._containerOverflows&&e.$.container.classList.remove("smart-overflow"),e._elementsAutoHeight=e.offsetHeight,e.style.height=n,e._containerOverflows&&e.$.container.classList.add("smart-overflow"),e.$.totalFiles.classList.contains("smart-hidden")&&(e.$.totalFiles.classList.remove("smart-hidden"),r=e.$.totalFiles.offsetHeight,e.$.totalFiles.classList.add("smart-hidden")),e._availableHeight=e.offsetHeight-(i+a)-l-r}});
@@ -1,5 +1,5 @@
1
1
 
2
- /* Smart UI v15.2.18 (2023-05-27)
2
+ /* Smart UI v15.2.19 (2023-06-12)
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 v15.2.18 (2023-05-27)
2
+ /* Smart UI v15.2.19 (2023-06-12)
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 v15.2.18 (2023-05-27)
2
+ /* Smart UI v15.2.19 (2023-06-12)
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 v15.2.18 (2023-05-27)
2
+ /* Smart UI v15.2.19 (2023-06-12)
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 v15.2.18 (2023-05-27)
2
+ /* Smart UI v15.2.19 (2023-06-12)
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 v15.2.18 (2023-05-27)
2
+ /* Smart UI v15.2.19 (2023-06-12)
3
3
  Copyright (c) 2011-2023 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */ //
5
5