libre-jqgrid 4.15.9

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 (421) hide show
  1. package/.github/workflows/npm.yml +23 -0
  2. package/.jscsrc +13 -0
  3. package/LICENSE +674 -0
  4. package/LICENSE.md +304 -0
  5. package/README.md +2 -0
  6. package/bower.json +53 -0
  7. package/css/ui.jqgrid.css +1618 -0
  8. package/css/ui.jqgrid.min.css +4 -0
  9. package/css/ui.jqgrid.min.css.map +1 -0
  10. package/dist/css/ui.jqgrid.css +1618 -0
  11. package/dist/css/ui.jqgrid.min.css +4 -0
  12. package/dist/css/ui.jqgrid.min.css.map +1 -0
  13. package/dist/i18n/grid.locale-ar.js +198 -0
  14. package/dist/i18n/grid.locale-bg.js +201 -0
  15. package/dist/i18n/grid.locale-bs.js +230 -0
  16. package/dist/i18n/grid.locale-ca.js +204 -0
  17. package/dist/i18n/grid.locale-cn.js +237 -0
  18. package/dist/i18n/grid.locale-cs.js +197 -0
  19. package/dist/i18n/grid.locale-da.js +196 -0
  20. package/dist/i18n/grid.locale-de.js +240 -0
  21. package/dist/i18n/grid.locale-el.js +195 -0
  22. package/dist/i18n/grid.locale-en.js +256 -0
  23. package/dist/i18n/grid.locale-es.js +202 -0
  24. package/dist/i18n/grid.locale-fa.js +211 -0
  25. package/dist/i18n/grid.locale-fi.js +201 -0
  26. package/dist/i18n/grid.locale-fr.js +197 -0
  27. package/dist/i18n/grid.locale-gl.js +197 -0
  28. package/dist/i18n/grid.locale-he.js +198 -0
  29. package/dist/i18n/grid.locale-hr.js +231 -0
  30. package/dist/i18n/grid.locale-hu.js +196 -0
  31. package/dist/i18n/grid.locale-id.js +238 -0
  32. package/dist/i18n/grid.locale-is.js +197 -0
  33. package/dist/i18n/grid.locale-it.js +189 -0
  34. package/dist/i18n/grid.locale-ja.js +203 -0
  35. package/dist/i18n/grid.locale-kr.js +194 -0
  36. package/dist/i18n/grid.locale-lt.js +199 -0
  37. package/dist/i18n/grid.locale-me.js +198 -0
  38. package/dist/i18n/grid.locale-nl.js +208 -0
  39. package/dist/i18n/grid.locale-no.js +180 -0
  40. package/dist/i18n/grid.locale-pl.js +204 -0
  41. package/dist/i18n/grid.locale-pt-br.js +210 -0
  42. package/dist/i18n/grid.locale-pt.js +196 -0
  43. package/dist/i18n/grid.locale-ro.js +210 -0
  44. package/dist/i18n/grid.locale-ru.js +196 -0
  45. package/dist/i18n/grid.locale-sk.js +198 -0
  46. package/dist/i18n/grid.locale-sl.js +230 -0
  47. package/dist/i18n/grid.locale-sr.js +199 -0
  48. package/dist/i18n/grid.locale-sv.js +198 -0
  49. package/dist/i18n/grid.locale-th.js +195 -0
  50. package/dist/i18n/grid.locale-tr.js +197 -0
  51. package/dist/i18n/grid.locale-tw.js +199 -0
  52. package/dist/i18n/grid.locale-ua.js +199 -0
  53. package/dist/i18n/grid.locale-vi.js +238 -0
  54. package/dist/i18n/min/grid.locale-ar.js +10 -0
  55. package/dist/i18n/min/grid.locale-ar.js.map +1 -0
  56. package/dist/i18n/min/grid.locale-bg.js +10 -0
  57. package/dist/i18n/min/grid.locale-bg.js.map +1 -0
  58. package/dist/i18n/min/grid.locale-ca.js +15 -0
  59. package/dist/i18n/min/grid.locale-ca.js.map +1 -0
  60. package/dist/i18n/min/grid.locale-cn.js +10 -0
  61. package/dist/i18n/min/grid.locale-cn.js.map +1 -0
  62. package/dist/i18n/min/grid.locale-cs.js +11 -0
  63. package/dist/i18n/min/grid.locale-cs.js.map +1 -0
  64. package/dist/i18n/min/grid.locale-da.js +10 -0
  65. package/dist/i18n/min/grid.locale-da.js.map +1 -0
  66. package/dist/i18n/min/grid.locale-de.js +21 -0
  67. package/dist/i18n/min/grid.locale-de.js.map +1 -0
  68. package/dist/i18n/min/grid.locale-el.js +10 -0
  69. package/dist/i18n/min/grid.locale-el.js.map +1 -0
  70. package/dist/i18n/min/grid.locale-en.js +11 -0
  71. package/dist/i18n/min/grid.locale-en.js.map +1 -0
  72. package/dist/i18n/min/grid.locale-es.js +16 -0
  73. package/dist/i18n/min/grid.locale-es.js.map +1 -0
  74. package/dist/i18n/min/grid.locale-fa.js +8 -0
  75. package/dist/i18n/min/grid.locale-fa.js.map +1 -0
  76. package/dist/i18n/min/grid.locale-fi.js +11 -0
  77. package/dist/i18n/min/grid.locale-fi.js.map +1 -0
  78. package/dist/i18n/min/grid.locale-fr.js +10 -0
  79. package/dist/i18n/min/grid.locale-fr.js.map +1 -0
  80. package/dist/i18n/min/grid.locale-gl.js +9 -0
  81. package/dist/i18n/min/grid.locale-gl.js.map +1 -0
  82. package/dist/i18n/min/grid.locale-he.js +10 -0
  83. package/dist/i18n/min/grid.locale-he.js.map +1 -0
  84. package/dist/i18n/min/grid.locale-hr.js +11 -0
  85. package/dist/i18n/min/grid.locale-hr.js.map +1 -0
  86. package/dist/i18n/min/grid.locale-hu.js +10 -0
  87. package/dist/i18n/min/grid.locale-hu.js.map +1 -0
  88. package/dist/i18n/min/grid.locale-id.js +10 -0
  89. package/dist/i18n/min/grid.locale-id.js.map +1 -0
  90. package/dist/i18n/min/grid.locale-is.js +9 -0
  91. package/dist/i18n/min/grid.locale-is.js.map +1 -0
  92. package/dist/i18n/min/grid.locale-it.js +2 -0
  93. package/dist/i18n/min/grid.locale-it.js.map +1 -0
  94. package/dist/i18n/min/grid.locale-ja.js +10 -0
  95. package/dist/i18n/min/grid.locale-ja.js.map +1 -0
  96. package/dist/i18n/min/grid.locale-kr.js +2 -0
  97. package/dist/i18n/min/grid.locale-kr.js.map +1 -0
  98. package/dist/i18n/min/grid.locale-lt.js +10 -0
  99. package/dist/i18n/min/grid.locale-lt.js.map +1 -0
  100. package/dist/i18n/min/grid.locale-me.js +10 -0
  101. package/dist/i18n/min/grid.locale-me.js.map +1 -0
  102. package/dist/i18n/min/grid.locale-nl.js +2 -0
  103. package/dist/i18n/min/grid.locale-nl.js.map +1 -0
  104. package/dist/i18n/min/grid.locale-no.js +2 -0
  105. package/dist/i18n/min/grid.locale-no.js.map +1 -0
  106. package/dist/i18n/min/grid.locale-pl.js +18 -0
  107. package/dist/i18n/min/grid.locale-pl.js.map +1 -0
  108. package/dist/i18n/min/grid.locale-pt-br.js +21 -0
  109. package/dist/i18n/min/grid.locale-pt-br.js.map +1 -0
  110. package/dist/i18n/min/grid.locale-pt.js +9 -0
  111. package/dist/i18n/min/grid.locale-pt.js.map +1 -0
  112. package/dist/i18n/min/grid.locale-ro.js +10 -0
  113. package/dist/i18n/min/grid.locale-ro.js.map +1 -0
  114. package/dist/i18n/min/grid.locale-ru.js +10 -0
  115. package/dist/i18n/min/grid.locale-ru.js.map +1 -0
  116. package/dist/i18n/min/grid.locale-sk.js +10 -0
  117. package/dist/i18n/min/grid.locale-sk.js.map +1 -0
  118. package/dist/i18n/min/grid.locale-sr.js +10 -0
  119. package/dist/i18n/min/grid.locale-sr.js.map +1 -0
  120. package/dist/i18n/min/grid.locale-sv.js +10 -0
  121. package/dist/i18n/min/grid.locale-sv.js.map +1 -0
  122. package/dist/i18n/min/grid.locale-th.js +10 -0
  123. package/dist/i18n/min/grid.locale-th.js.map +1 -0
  124. package/dist/i18n/min/grid.locale-tr.js +10 -0
  125. package/dist/i18n/min/grid.locale-tr.js.map +1 -0
  126. package/dist/i18n/min/grid.locale-tw.js +11 -0
  127. package/dist/i18n/min/grid.locale-tw.js.map +1 -0
  128. package/dist/i18n/min/grid.locale-ua.js +10 -0
  129. package/dist/i18n/min/grid.locale-ua.js.map +1 -0
  130. package/dist/i18n/min/grid.locale-vi.js +10 -0
  131. package/dist/i18n/min/grid.locale-vi.js.map +1 -0
  132. package/dist/jquery.jqgrid.min.js +21144 -0
  133. package/dist/jquery.jqgrid.min.js.map +1 -0
  134. package/dist/jquery.jqgrid.src.js +21144 -0
  135. package/dist/modules/grid.base.js +8518 -0
  136. package/dist/modules/grid.celledit.js +673 -0
  137. package/dist/modules/grid.common.js +844 -0
  138. package/dist/modules/grid.custom.js +1795 -0
  139. package/dist/modules/grid.filter.js +897 -0
  140. package/dist/modules/grid.formedit.js +2537 -0
  141. package/dist/modules/grid.grouping.js +737 -0
  142. package/dist/modules/grid.import.js +251 -0
  143. package/dist/modules/grid.inlinedit.js +784 -0
  144. package/dist/modules/grid.jqueryui.js +965 -0
  145. package/dist/modules/grid.pivot.js +862 -0
  146. package/dist/modules/grid.subgrid.js +379 -0
  147. package/dist/modules/grid.tbltogrid.js +141 -0
  148. package/dist/modules/grid.treegrid.js +683 -0
  149. package/dist/modules/jqdnr.js +188 -0
  150. package/dist/modules/jqmodal.js +292 -0
  151. package/dist/modules/jquery.fmatter.js +1061 -0
  152. package/dist/modules/jsonxml.js +343 -0
  153. package/dist/modules/min/grid.base.js +11 -0
  154. package/dist/modules/min/grid.base.js.map +1 -0
  155. package/dist/modules/min/grid.celledit.js +2 -0
  156. package/dist/modules/min/grid.celledit.js.map +1 -0
  157. package/dist/modules/min/grid.common.js +2 -0
  158. package/dist/modules/min/grid.common.js.map +1 -0
  159. package/dist/modules/min/grid.custom.js +2 -0
  160. package/dist/modules/min/grid.custom.js.map +1 -0
  161. package/dist/modules/min/grid.filter.js +2 -0
  162. package/dist/modules/min/grid.filter.js.map +1 -0
  163. package/dist/modules/min/grid.formedit.js +2 -0
  164. package/dist/modules/min/grid.formedit.js.map +1 -0
  165. package/dist/modules/min/grid.grouping.js +2 -0
  166. package/dist/modules/min/grid.grouping.js.map +1 -0
  167. package/dist/modules/min/grid.import.js +2 -0
  168. package/dist/modules/min/grid.import.js.map +1 -0
  169. package/dist/modules/min/grid.inlinedit.js +2 -0
  170. package/dist/modules/min/grid.inlinedit.js.map +1 -0
  171. package/dist/modules/min/grid.jqueryui.js +2 -0
  172. package/dist/modules/min/grid.jqueryui.js.map +1 -0
  173. package/dist/modules/min/grid.pivot.js +2 -0
  174. package/dist/modules/min/grid.pivot.js.map +1 -0
  175. package/dist/modules/min/grid.subgrid.js +2 -0
  176. package/dist/modules/min/grid.subgrid.js.map +1 -0
  177. package/dist/modules/min/grid.tbltogrid.js +2 -0
  178. package/dist/modules/min/grid.tbltogrid.js.map +1 -0
  179. package/dist/modules/min/grid.treegrid.js +2 -0
  180. package/dist/modules/min/grid.treegrid.js.map +1 -0
  181. package/dist/modules/min/jqdnr.js +2 -0
  182. package/dist/modules/min/jqdnr.js.map +1 -0
  183. package/dist/modules/min/jqmodal.js +2 -0
  184. package/dist/modules/min/jqmodal.js.map +1 -0
  185. package/dist/modules/min/jquery.fmatter.js +2 -0
  186. package/dist/modules/min/jquery.fmatter.js.map +1 -0
  187. package/dist/modules/min/jsonxml.js +2 -0
  188. package/dist/modules/min/jsonxml.js.map +1 -0
  189. package/dist/plugins/css/ui.multiselect.css +30 -0
  190. package/dist/plugins/css/ui.multiselect.min.css +2 -0
  191. package/dist/plugins/css/ui.multiselect.min.css.map +1 -0
  192. package/dist/plugins/grid.odata.js +1313 -0
  193. package/dist/plugins/jqgrid_download.js +109 -0
  194. package/dist/plugins/jquery.contextmenu-ui.js +304 -0
  195. package/dist/plugins/jquery.contextmenu.js +174 -0
  196. package/dist/plugins/jquery.createcontexmenufromnavigatorbuttons.js +172 -0
  197. package/dist/plugins/jquery.jqgrid.showhidecolumnmenu.js +201 -0
  198. package/dist/plugins/min/grid.odata.js +11 -0
  199. package/dist/plugins/min/grid.odata.js.map +1 -0
  200. package/dist/plugins/min/jquery.contextmenu-ui.js +26 -0
  201. package/dist/plugins/min/jquery.contextmenu-ui.js.map +1 -0
  202. package/dist/plugins/min/jquery.contextmenu.js +19 -0
  203. package/dist/plugins/min/jquery.contextmenu.js.map +1 -0
  204. package/dist/plugins/min/jquery.createcontexmenufromnavigatorbuttons.js +12 -0
  205. package/dist/plugins/min/jquery.createcontexmenufromnavigatorbuttons.js.map +1 -0
  206. package/dist/plugins/min/jquery.jqgrid.showhidecolumnmenu.js +10 -0
  207. package/dist/plugins/min/jquery.jqgrid.showhidecolumnmenu.js.map +1 -0
  208. package/dist/plugins/min/ui.multiselect.js +30 -0
  209. package/dist/plugins/min/ui.multiselect.js.map +1 -0
  210. package/dist/plugins/ui.multiselect.js +389 -0
  211. package/dist/ts/free-jqgrid.d.ts +2132 -0
  212. package/github /workflows/npm.yml +23 -0
  213. package/gruntfile.js +397 -0
  214. package/js/grid.base.js +8518 -0
  215. package/js/grid.celledit.js +673 -0
  216. package/js/grid.common.js +844 -0
  217. package/js/grid.custom.js +1795 -0
  218. package/js/grid.filter.js +897 -0
  219. package/js/grid.formedit.js +2537 -0
  220. package/js/grid.grouping.js +737 -0
  221. package/js/grid.import.js +251 -0
  222. package/js/grid.inlinedit.js +784 -0
  223. package/js/grid.jqueryui.js +965 -0
  224. package/js/grid.pivot.js +862 -0
  225. package/js/grid.subgrid.js +379 -0
  226. package/js/grid.tbltogrid.js +141 -0
  227. package/js/grid.treegrid.js +683 -0
  228. package/js/i18n/grid.locale-ar.js +198 -0
  229. package/js/i18n/grid.locale-bg.js +201 -0
  230. package/js/i18n/grid.locale-bs.js +230 -0
  231. package/js/i18n/grid.locale-ca.js +204 -0
  232. package/js/i18n/grid.locale-cn.js +237 -0
  233. package/js/i18n/grid.locale-cs.js +197 -0
  234. package/js/i18n/grid.locale-da.js +196 -0
  235. package/js/i18n/grid.locale-de.js +240 -0
  236. package/js/i18n/grid.locale-el.js +195 -0
  237. package/js/i18n/grid.locale-en.js +256 -0
  238. package/js/i18n/grid.locale-es.js +202 -0
  239. package/js/i18n/grid.locale-fa.js +211 -0
  240. package/js/i18n/grid.locale-fi.js +201 -0
  241. package/js/i18n/grid.locale-fr.js +197 -0
  242. package/js/i18n/grid.locale-gl.js +197 -0
  243. package/js/i18n/grid.locale-he.js +198 -0
  244. package/js/i18n/grid.locale-hr.js +231 -0
  245. package/js/i18n/grid.locale-hu.js +196 -0
  246. package/js/i18n/grid.locale-id.js +238 -0
  247. package/js/i18n/grid.locale-is.js +197 -0
  248. package/js/i18n/grid.locale-it.js +189 -0
  249. package/js/i18n/grid.locale-ja.js +203 -0
  250. package/js/i18n/grid.locale-kr.js +194 -0
  251. package/js/i18n/grid.locale-lt.js +199 -0
  252. package/js/i18n/grid.locale-me.js +198 -0
  253. package/js/i18n/grid.locale-nl.js +208 -0
  254. package/js/i18n/grid.locale-no.js +180 -0
  255. package/js/i18n/grid.locale-pl.js +204 -0
  256. package/js/i18n/grid.locale-pt-br.js +210 -0
  257. package/js/i18n/grid.locale-pt.js +196 -0
  258. package/js/i18n/grid.locale-ro.js +210 -0
  259. package/js/i18n/grid.locale-ru.js +196 -0
  260. package/js/i18n/grid.locale-sk.js +198 -0
  261. package/js/i18n/grid.locale-sl.js +230 -0
  262. package/js/i18n/grid.locale-sr.js +199 -0
  263. package/js/i18n/grid.locale-sv.js +198 -0
  264. package/js/i18n/grid.locale-th.js +195 -0
  265. package/js/i18n/grid.locale-tr.js +197 -0
  266. package/js/i18n/grid.locale-tw.js +199 -0
  267. package/js/i18n/grid.locale-ua.js +199 -0
  268. package/js/i18n/grid.locale-vi.js +238 -0
  269. package/js/i18n/min/grid.locale-ar.js +10 -0
  270. package/js/i18n/min/grid.locale-ar.js.map +1 -0
  271. package/js/i18n/min/grid.locale-bg.js +10 -0
  272. package/js/i18n/min/grid.locale-bg.js.map +1 -0
  273. package/js/i18n/min/grid.locale-ca.js +15 -0
  274. package/js/i18n/min/grid.locale-ca.js.map +1 -0
  275. package/js/i18n/min/grid.locale-cn.js +10 -0
  276. package/js/i18n/min/grid.locale-cn.js.map +1 -0
  277. package/js/i18n/min/grid.locale-cs.js +11 -0
  278. package/js/i18n/min/grid.locale-cs.js.map +1 -0
  279. package/js/i18n/min/grid.locale-da.js +10 -0
  280. package/js/i18n/min/grid.locale-da.js.map +1 -0
  281. package/js/i18n/min/grid.locale-de.js +21 -0
  282. package/js/i18n/min/grid.locale-de.js.map +1 -0
  283. package/js/i18n/min/grid.locale-el.js +10 -0
  284. package/js/i18n/min/grid.locale-el.js.map +1 -0
  285. package/js/i18n/min/grid.locale-en.js +11 -0
  286. package/js/i18n/min/grid.locale-en.js.map +1 -0
  287. package/js/i18n/min/grid.locale-es.js +16 -0
  288. package/js/i18n/min/grid.locale-es.js.map +1 -0
  289. package/js/i18n/min/grid.locale-fa.js +8 -0
  290. package/js/i18n/min/grid.locale-fa.js.map +1 -0
  291. package/js/i18n/min/grid.locale-fi.js +11 -0
  292. package/js/i18n/min/grid.locale-fi.js.map +1 -0
  293. package/js/i18n/min/grid.locale-fr.js +10 -0
  294. package/js/i18n/min/grid.locale-fr.js.map +1 -0
  295. package/js/i18n/min/grid.locale-gl.js +9 -0
  296. package/js/i18n/min/grid.locale-gl.js.map +1 -0
  297. package/js/i18n/min/grid.locale-he.js +10 -0
  298. package/js/i18n/min/grid.locale-he.js.map +1 -0
  299. package/js/i18n/min/grid.locale-hr.js +11 -0
  300. package/js/i18n/min/grid.locale-hr.js.map +1 -0
  301. package/js/i18n/min/grid.locale-hu.js +10 -0
  302. package/js/i18n/min/grid.locale-hu.js.map +1 -0
  303. package/js/i18n/min/grid.locale-id.js +10 -0
  304. package/js/i18n/min/grid.locale-id.js.map +1 -0
  305. package/js/i18n/min/grid.locale-is.js +9 -0
  306. package/js/i18n/min/grid.locale-is.js.map +1 -0
  307. package/js/i18n/min/grid.locale-it.js +2 -0
  308. package/js/i18n/min/grid.locale-it.js.map +1 -0
  309. package/js/i18n/min/grid.locale-ja.js +10 -0
  310. package/js/i18n/min/grid.locale-ja.js.map +1 -0
  311. package/js/i18n/min/grid.locale-kr.js +2 -0
  312. package/js/i18n/min/grid.locale-kr.js.map +1 -0
  313. package/js/i18n/min/grid.locale-lt.js +10 -0
  314. package/js/i18n/min/grid.locale-lt.js.map +1 -0
  315. package/js/i18n/min/grid.locale-me.js +10 -0
  316. package/js/i18n/min/grid.locale-me.js.map +1 -0
  317. package/js/i18n/min/grid.locale-nl.js +2 -0
  318. package/js/i18n/min/grid.locale-nl.js.map +1 -0
  319. package/js/i18n/min/grid.locale-no.js +2 -0
  320. package/js/i18n/min/grid.locale-no.js.map +1 -0
  321. package/js/i18n/min/grid.locale-pl.js +18 -0
  322. package/js/i18n/min/grid.locale-pl.js.map +1 -0
  323. package/js/i18n/min/grid.locale-pt-br.js +21 -0
  324. package/js/i18n/min/grid.locale-pt-br.js.map +1 -0
  325. package/js/i18n/min/grid.locale-pt.js +9 -0
  326. package/js/i18n/min/grid.locale-pt.js.map +1 -0
  327. package/js/i18n/min/grid.locale-ro.js +10 -0
  328. package/js/i18n/min/grid.locale-ro.js.map +1 -0
  329. package/js/i18n/min/grid.locale-ru.js +10 -0
  330. package/js/i18n/min/grid.locale-ru.js.map +1 -0
  331. package/js/i18n/min/grid.locale-sk.js +10 -0
  332. package/js/i18n/min/grid.locale-sk.js.map +1 -0
  333. package/js/i18n/min/grid.locale-sr.js +10 -0
  334. package/js/i18n/min/grid.locale-sr.js.map +1 -0
  335. package/js/i18n/min/grid.locale-sv.js +10 -0
  336. package/js/i18n/min/grid.locale-sv.js.map +1 -0
  337. package/js/i18n/min/grid.locale-th.js +10 -0
  338. package/js/i18n/min/grid.locale-th.js.map +1 -0
  339. package/js/i18n/min/grid.locale-tr.js +10 -0
  340. package/js/i18n/min/grid.locale-tr.js.map +1 -0
  341. package/js/i18n/min/grid.locale-tw.js +11 -0
  342. package/js/i18n/min/grid.locale-tw.js.map +1 -0
  343. package/js/i18n/min/grid.locale-ua.js +10 -0
  344. package/js/i18n/min/grid.locale-ua.js.map +1 -0
  345. package/js/i18n/min/grid.locale-vi.js +10 -0
  346. package/js/i18n/min/grid.locale-vi.js.map +1 -0
  347. package/js/jqdnr.js +188 -0
  348. package/js/jqmodal.js +292 -0
  349. package/js/jquery.fmatter.js +1061 -0
  350. package/js/jquery.jqgrid.min.js +11 -0
  351. package/js/jquery.jqgrid.min.js.map +1 -0
  352. package/js/jquery.jqgrid.src.js +21144 -0
  353. package/js/jsonxml.js +343 -0
  354. package/js/min/grid.base.js +11 -0
  355. package/js/min/grid.base.js.map +1 -0
  356. package/js/min/grid.celledit.js +2 -0
  357. package/js/min/grid.celledit.js.map +1 -0
  358. package/js/min/grid.common.js +2 -0
  359. package/js/min/grid.common.js.map +1 -0
  360. package/js/min/grid.custom.js +2 -0
  361. package/js/min/grid.custom.js.map +1 -0
  362. package/js/min/grid.filter.js +2 -0
  363. package/js/min/grid.filter.js.map +1 -0
  364. package/js/min/grid.formedit.js +2 -0
  365. package/js/min/grid.formedit.js.map +1 -0
  366. package/js/min/grid.grouping.js +2 -0
  367. package/js/min/grid.grouping.js.map +1 -0
  368. package/js/min/grid.import.js +2 -0
  369. package/js/min/grid.import.js.map +1 -0
  370. package/js/min/grid.inlinedit.js +2 -0
  371. package/js/min/grid.inlinedit.js.map +1 -0
  372. package/js/min/grid.jqueryui.js +2 -0
  373. package/js/min/grid.jqueryui.js.map +1 -0
  374. package/js/min/grid.pivot.js +2 -0
  375. package/js/min/grid.pivot.js.map +1 -0
  376. package/js/min/grid.subgrid.js +2 -0
  377. package/js/min/grid.subgrid.js.map +1 -0
  378. package/js/min/grid.tbltogrid.js +2 -0
  379. package/js/min/grid.tbltogrid.js.map +1 -0
  380. package/js/min/grid.treegrid.js +2 -0
  381. package/js/min/grid.treegrid.js.map +1 -0
  382. package/js/min/jqdnr.js +2 -0
  383. package/js/min/jqdnr.js.map +1 -0
  384. package/js/min/jqmodal.js +2 -0
  385. package/js/min/jqmodal.js.map +1 -0
  386. package/js/min/jquery.fmatter.js +2 -0
  387. package/js/min/jquery.fmatter.js.map +1 -0
  388. package/js/min/jsonxml.js +2 -0
  389. package/js/min/jsonxml.js.map +1 -0
  390. package/package.json +79 -0
  391. package/plugins/css/ui.multiselect.css +30 -0
  392. package/plugins/css/ui.multiselect.min.css +2 -0
  393. package/plugins/css/ui.multiselect.min.css.map +1 -0
  394. package/plugins/grid.odata.js +1313 -0
  395. package/plugins/jqgrid_download.js +109 -0
  396. package/plugins/jquery.contextmenu-ui.js +304 -0
  397. package/plugins/jquery.contextmenu.js +174 -0
  398. package/plugins/jquery.createcontexmenufromnavigatorbuttons.js +172 -0
  399. package/plugins/jquery.jqgrid.showhidecolumnmenu.js +201 -0
  400. package/plugins/min/grid.odata.js +11 -0
  401. package/plugins/min/grid.odata.js.map +1 -0
  402. package/plugins/min/jquery.contextmenu-ui.js +26 -0
  403. package/plugins/min/jquery.contextmenu-ui.js.map +1 -0
  404. package/plugins/min/jquery.contextmenu.js +19 -0
  405. package/plugins/min/jquery.contextmenu.js.map +1 -0
  406. package/plugins/min/jquery.createcontexmenufromnavigatorbuttons.js +12 -0
  407. package/plugins/min/jquery.createcontexmenufromnavigatorbuttons.js.map +1 -0
  408. package/plugins/min/jquery.jqgrid.showhidecolumnmenu.js +10 -0
  409. package/plugins/min/jquery.jqgrid.showhidecolumnmenu.js.map +1 -0
  410. package/plugins/min/ui.multiselect.js +30 -0
  411. package/plugins/min/ui.multiselect.js.map +1 -0
  412. package/plugins/ui.multiselect.js +389 -0
  413. package/tests/fillingTest.htm +210 -0
  414. package/ts/free-jqgrid.d.ts +2132 -0
  415. package/ts/tests/README.txt +4 -0
  416. package/ts/tests/test.html +50 -0
  417. package/ts/tests/test.js +55 -0
  418. package/ts/tests/test.js.map +1 -0
  419. package/ts/tests/test.ts +149 -0
  420. package/ts/tests/tsconfig.json +7 -0
  421. package/tslint.json +20 -0
@@ -0,0 +1,844 @@
1
+ /**
2
+ * jqGrid common function
3
+ * Tony Tomov tony@trirand.com, http://trirand.com/blog/
4
+ * Changed by Oleg Kiriljuk, oleg.kiriljuk@ok-soft-gmbh.com
5
+ * Maintained by rany2, ranygh@riseup.net
6
+ * Dual licensed under the MIT and GPL licenses:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ * http://www.gnu.org/licenses/gpl-2.0.html
9
+ */
10
+
11
+ /*jshint eqeqeq:false */
12
+ /*global jQuery, define, HTMLElement, exports, module, require */
13
+ /*jslint browser: true, eqeq: true, plusplus: true, unparam: true, white: true, vars: true */
14
+ (function (global, factory) {
15
+ "use strict";
16
+ if (typeof define === "function" && define.amd) {
17
+ // AMD. Register as an anonymous module.
18
+ //console.log("grid.common AMD");
19
+ define([
20
+ "jquery",
21
+ "./grid.base",
22
+ "./jqdnr",
23
+ "./jqmodal"
24
+ ], function ($) {
25
+ //console.log("grid.common AMD: define callback");
26
+ return factory($, global.document);
27
+ });
28
+ } else if (typeof module === "object" && module.exports) {
29
+ // Node/CommonJS
30
+ //console.log("grid.common CommonJS");
31
+ module.exports = function (root, $) {
32
+ //console.log("grid.common CommonJS: in module.exports");
33
+ if (!root) {
34
+ root = window;
35
+ }
36
+ //console.log("grid.common CommonJS: before require('jquery')");
37
+ if ($ === undefined) {
38
+ // require("jquery") returns a factory that requires window to
39
+ // build a jQuery instance, we normalize how we use modules
40
+ // that require this pattern but the window provided is a noop
41
+ // if it's defined (how jquery works)
42
+ $ = typeof window !== "undefined" ?
43
+ require("jquery") :
44
+ require("jquery")(root);
45
+ }
46
+ //console.log("grid.common CommonJS: before require('./grid.base')");
47
+ require("./grid.base");
48
+ //console.log("grid.common CommonJS: before require('./jqdnr')");
49
+ require("./jqdnr");
50
+ //console.log("grid.common CommonJS: before require('./jqmodal')");
51
+ require("./jqmodal");
52
+ factory($, root.document);
53
+ return $;
54
+ };
55
+ } else {
56
+ // Browser globals
57
+ //console.log("grid.common Browser: before factory");
58
+ factory(jQuery, global.document);
59
+ }
60
+ }(typeof window !== "undefined" ? window : this, function ($, document) {
61
+ "use strict";
62
+ var jgrid = $.jgrid, base = $.fn.jqGrid;
63
+ // begin module grid.common
64
+ var getGuiStyles = base.getGuiStyles, getGridRes = base.getGridRes;
65
+
66
+ jgrid.jqModal = jgrid.jqModal || {};
67
+ $.extend(true, jgrid.jqModal, { toTop: true });
68
+
69
+ $.extend(jgrid, {
70
+ // Modal functions
71
+ // The methods showModal and closeModal will be used as callback of $.jqm jQuery plugin defined in jqModal.js
72
+ // The modul can support multiple modal dialods. It hold the information about evety active modules in internal array of "hashes".
73
+ // The modal dialogs as hidden typically. Before the dialog will be visible onShow callback (showModal) will be called.
74
+ //
75
+ // Every eleement contains "hash object" which have 4 properties:
76
+ // w: (jQuery object) The modal element, represent the outer div of the modal dialog
77
+ // o: (jQuery object) The overlay element. It will be assigned on the first opening of the modal
78
+ // c: (object) The modal's options object. The options used durin creating the modal.
79
+ // One can use global $.jgrid.jqModal or gris specifif p.jqModal to specify defaults of the options.
80
+ // t: (DOM object) The triggering element.
81
+ // s: numeric part of "id" used for modal dialog. The modal dialog have class "jqmID" + s.
82
+ // a: Boolean. It's false initially. It will be set to true during opening and will set to false on closing.
83
+ showModal: function (h) {
84
+ // w: (jQuery object) The modal element
85
+ h.w.show();
86
+ },
87
+ closeModal: function (h) {
88
+ // w: (jQuery object) The modal element
89
+ // o: (jQuery object) The overlay element
90
+ // c: (object) The modal's options object
91
+ h.w.hide().attr("aria-hidden", "true");
92
+ if (h.o) {
93
+ h.o.remove();
94
+ }
95
+ },
96
+ hideModal: function (selector, o) {
97
+ o = $.extend({ jqm: true, gb: "", removemodal: false }, o || {});
98
+ var thisgrid = o.gb && typeof o.gb === "string" && o.gb.substr(0, 6) === "#gbox_" ? $("#" + o.gb.substr(6))[0] : false,
99
+ $selector = $(selector);
100
+ if (o.onClose) {
101
+ var oncret = thisgrid ? o.onClose.call(thisgrid, selector) : o.onClose(selector);
102
+ if (typeof oncret === "boolean" && !oncret) { return; }
103
+ }
104
+ if ($.fn.jqm && o.jqm === true) {
105
+ $selector.attr("aria-hidden", "true").jqmHide();
106
+ } else {
107
+ if (o.gb !== "") {
108
+ try { $(">.jqgrid-overlay", o.gb).first().hide(); } catch (ignore) { }
109
+ }
110
+ $selector.hide().attr("aria-hidden", "true");
111
+ }
112
+ if (o.removemodal) {
113
+ $selector.remove();
114
+ }
115
+ },
116
+ //Helper functions
117
+ createModal: function (aIDs, content, o, insertSelector, posSelector, appendsel, css) {
118
+ var jqID = jgrid.jqID, p = this.p;
119
+ o = $.extend(true, {
120
+ resizingRightBottomIcon: base.getIconRes.call(this, "form.resizableLtr")
121
+ }, jgrid.jqModal || {},
122
+ p != null ? p.jqModal || {} : {},
123
+ o);
124
+ // create main window "div.ui-jqdialog", which will contains other components of the modal window:
125
+ // "div.ui-jqdialog-titlebar", "div.ui-jqdialog-content" and optionally resizer like "div.jqResize"
126
+ var mw = document.createElement("div"), themodalSelector = "#" + jqID(aIDs.themodal),
127
+ rtlsup = $(o.gbox).attr("dir") === "rtl" ? true : false,
128
+ resizeAlso = aIDs.resizeAlso ? "#" + jqID(aIDs.resizeAlso) : false;
129
+ css = $.extend({}, css || {});
130
+ mw.className = getGuiStyles.call(this, "dialog.window", "ui-jqdialog");
131
+ mw.id = aIDs.themodal;
132
+ mw.dir = rtlsup ? "rtl" : "ltr";
133
+ var mdoc = document.createElement("div");
134
+ mdoc.className = getGuiStyles.call(this, "dialog.document");
135
+ $(mdoc).attr("role", "document");
136
+ var msubdoc = document.createElement("div");
137
+ msubdoc.className = getGuiStyles.call(this, "dialog.subdocument");
138
+ mdoc.appendChild(msubdoc);
139
+ mw.appendChild(mdoc);
140
+ // create the title "div.ui-jqdialog-titlebar", which contains:
141
+ // "span.ui-jqdialog-title" with the title text and "a.ui-jqdialog-titlebar-close" with the closing button
142
+ var mh = document.createElement("div");
143
+ mh.className = getGuiStyles.call(this,
144
+ "dialog.header",
145
+ "ui-jqdialog-titlebar " + (rtlsup ? "ui-jqdialog-titlebar-rtl" : "ui-jqdialog-titlebar-ltr"));
146
+ mh.id = aIDs.modalhead;
147
+ $(mh).append("<span class='ui-jqdialog-title'>" + o.caption + "</span>");
148
+ var hoverClasses = getGuiStyles.call(this, "states.hover"),
149
+ ahr = $("<a aria-label='Close' class='" + getGuiStyles.call(this, "dialog.closeButton", "ui-jqdialog-titlebar-close") + "'></a>")
150
+ .hover(function () { ahr.addClass(hoverClasses); },
151
+ function () { ahr.removeClass(hoverClasses); })
152
+ .append("<span class='" + base.getIconRes.call(this, "form.close") + "'></span>");
153
+ $(mh).append(ahr);
154
+ // create "div.ui-jqdialog-content" which hold some HTML content (see input parameter)
155
+ var mc = document.createElement("div");
156
+ $(mc).addClass(getGuiStyles.call(this, "dialog.content", "ui-jqdialog-content"))
157
+ .attr("id", aIDs.modalcontent);
158
+ $(mc).append(content);
159
+ // place "div.ui-jqdialog-content" and "div.ui-jqdialog-titlebar" in main window "div.ui-jqdialog"
160
+ msubdoc.appendChild(mc);
161
+ $(msubdoc).prepend(mh);
162
+ // appendsel and insertSelector specifies where the dialog should be placed on the HTML page
163
+ if (appendsel === true) {
164
+ $("body").append(mw); //append as first child in body -for alert dialog
165
+ } else if (typeof appendsel === "string") {
166
+ $(appendsel).append(mw);
167
+ } else { $(mw).insertBefore(insertSelector); }
168
+ $(mw).css(css);
169
+ if (o.jqModal === undefined) { o.jqModal = true; } // internal use
170
+ var coord = {};
171
+ if ($.fn.jqm && o.jqModal === true) {
172
+ if (o.left === 0 && o.top === 0 && o.overlay) {
173
+ o = $(posSelector).offset();
174
+ o.left += 4;
175
+ o.top += 4;
176
+ }
177
+ coord.top = o.top + "px";
178
+ coord.left = o.left;
179
+ } else if (o.left !== 0 || o.top !== 0) {
180
+ coord.left = o.left;
181
+ coord.top = o.top + "px";
182
+ }
183
+ $("a.ui-jqdialog-titlebar-close", mh).click(function () {
184
+ var oncm = $(themodalSelector).data("onClose") || o.onClose;
185
+ var gboxclose = $(themodalSelector).data("gbox") || o.gbox;
186
+ jgrid.hideModal(themodalSelector, {
187
+ gb: gboxclose,
188
+ jqm: o.jqModal,
189
+ onClose: oncm,
190
+ removemodal: o.removemodal || false
191
+ });
192
+ return false;
193
+ });
194
+ if (o.width === 0 || !o.width) { o.width = 300; }
195
+ if (o.height === 0 || !o.height) { o.height = 200; }
196
+ if (!o.zIndex) {
197
+ var parentZ = $(insertSelector).parents("*[role=dialog]").first().css("z-index");
198
+ if (parentZ) {
199
+ o.zIndex = parseInt(parentZ, 10) + 2;
200
+ o.toTop = true;
201
+ } else {
202
+ o.zIndex = 950;
203
+ }
204
+ }
205
+ // ONE NEEDS correction of left position in case of RTL, but the current code places
206
+ // modal dialog OUT OF visible part of/ the window if <body dir="rtl">.
207
+ // Thus first of all the lines are commented. Later the FIXED code below will be included.
208
+ /*var rtlt = 0;
209
+ if( rtlsup && coord.left && !appendsel) {
210
+ rtlt = $(o.gbox).width()- (!isNaN(o.width) ? parseInt(o.width,10) :0) - 8; // to do
211
+ // just in case
212
+ coord.left = parseInt(coord.left,10) + parseInt(rtlt,10);
213
+ }*/
214
+ if (coord.left) { coord.left += "px"; }
215
+ $(mw).css($.extend({
216
+ width: isNaN(o.width) ? "auto" : o.width + "px",
217
+ height: isNaN(o.height) ? "auto" : o.height + "px",
218
+ zIndex: o.zIndex
219
+ }, coord))
220
+ .attr({ tabIndex: "-1", "role": "dialog", "aria-labelledby": aIDs.modalhead, "aria-hidden": "true" });
221
+ if (o.drag === undefined) { o.drag = true; }
222
+ if (o.resize === undefined) { o.resize = true; }
223
+ if (o.drag) {
224
+ if ($.fn.jqDrag) {
225
+ // .ui-draggable .ui-dialog-titlebar {cursor: move}
226
+ //$(mw).addClass("ui-draggable"); //css("cursor", "move");
227
+ $(mh).css("cursor", "move");
228
+ $(mw).jqDrag(mh);
229
+ } else {
230
+ try {
231
+ $(mw).draggable({ handle: $("#" + jqID(mh.id)) });
232
+ } catch (ignore) { }
233
+ }
234
+ }
235
+ if (o.resize) {
236
+ if ($.fn.jqResize) {
237
+ $(mc).append("<div class='jqResize ui-resizable-handle ui-resizable-se " + o.resizingRightBottomIcon + "'></div>");
238
+ $(themodalSelector).jqResize(".jqResize", resizeAlso);
239
+ } else {
240
+ try {
241
+ $(mw).resizable({ handles: "se, sw", alsoResize: resizeAlso });
242
+ } catch (ignore) { }
243
+ }
244
+ }
245
+ if (o.closeOnEscape === true) {
246
+ $(mw).keydown(function (e) {
247
+ if (e.which === 27) {
248
+ var cone = $(themodalSelector).data("onClose") || o.onClose;
249
+ jgrid.hideModal(themodalSelector, { gb: o.gbox, jqm: o.jqModal, onClose: cone, removemodal: o.removemodal || false, formprop: !o.recreateForm || false, form: o.form || "" });
250
+ }
251
+ });
252
+ }
253
+ },
254
+ viewModal: function (selector, o) {
255
+ o = $.extend(true, {
256
+ //toTop: false,
257
+ overlay: 30,
258
+ modal: false,
259
+ overlayClass: getGuiStyles.call(this, "overlay"), // "ui-widget-overlay"
260
+ onShow: jgrid.showModal,
261
+ onHide: jgrid.closeModal,
262
+ gbox: "",
263
+ jqm: true,
264
+ jqM: true
265
+ }, jgrid.jqModal || {}, o || {});
266
+ if ($.fn.jqm && o.jqm === true) {
267
+ if (o.jqM) {
268
+ $(selector).attr("aria-hidden", "false").jqm(o).jqmShow();
269
+ } else {
270
+ $(selector).attr("aria-hidden", "false").jqmShow();
271
+ }
272
+ } else {
273
+ if (o.gbox !== "") {
274
+ $(">.jqgrid-overlay", o.gbox).first().show();
275
+ $(selector).data("gbox", o.gbox);
276
+ }
277
+ $(selector).show().attr("aria-hidden", "false");
278
+ try { $(":input:visible", selector)[0].focus(); } catch (ignore) { }
279
+ }
280
+ },
281
+ info_dialog: function (caption, content, closeButtonText, modalopt) {
282
+ var $t = this, p = $t.p,
283
+ mopt = $.extend(true,
284
+ {
285
+ width: 290,
286
+ height: "auto",
287
+ dataheight: "auto",
288
+ drag: true,
289
+ resize: false,
290
+ left: 250,
291
+ top: 170,
292
+ zIndex: 1000,
293
+ jqModal: true,
294
+ modal: false,
295
+ closeOnEscape: true,
296
+ align: "center",
297
+ buttonalign: "center",
298
+ buttons: []
299
+ // {text:"textbutt", id:"buttid", onClick : function(){...}}
300
+ // if the id is not provided we set it like info_button_+ the index in the array - i.e info_button_0,info_button_1...
301
+ },
302
+ jgrid.jqModal || {},
303
+ p != null ? p.jqModal || {} : {},
304
+ { caption: "<b>" + caption + "</b>" },
305
+ modalopt || {}),
306
+ jm = mopt.jqModal;
307
+
308
+ if ($.fn.jqm && !jm) { jm = false; }
309
+ // in case there is no jqModal
310
+ var buttstr = "", i, hoverClasses = getGuiStyles.call($t, "states.hover");
311
+ if (mopt.buttons.length > 0) {
312
+ for (i = 0; i < mopt.buttons.length; i++) {
313
+ if (mopt.buttons[i].id === undefined) { mopt.buttons[i].id = "info_button_" + i; }
314
+ buttstr += jgrid.builderFmButon.call($t, mopt.buttons[i].id, mopt.buttons[i].text);
315
+ }
316
+ }
317
+ var dh = isNaN(mopt.dataheight) ? mopt.dataheight : mopt.dataheight + "px",
318
+ cn = "text-align:" + mopt.align + ";",
319
+ $dlg = $("#info_dialog"),
320
+ cnt = "<div id='info_id'>";
321
+ cnt += "<div id='infocnt' style='margin:0px;padding-bottom:1em;width:100%;overflow:auto;position:relative;height:" + dh + ";" + cn + "'>" + content + "</div>";
322
+ if (closeButtonText || buttstr !== "") {
323
+ cnt += "<hr class='" + getGuiStyles.call($t, "dialog.hr") + "' style='margin:1px'/><div style='text-align:" + mopt.buttonalign +
324
+ ";padding:.8em 0 .5em 0;background-image:none;border-width: 1px 0 0 0;'>" +
325
+ (closeButtonText ? jgrid.builderFmButon.call($t, "closedialog", closeButtonText) : "") + buttstr + "</div>";
326
+ }
327
+ cnt += "</div>";
328
+
329
+ try {
330
+ if ($dlg.attr("aria-hidden") === "false") {
331
+ jgrid.hideModal("#info_dialog", { jqm: jm });
332
+ }
333
+ $dlg.remove();
334
+ } catch (ignore) { }
335
+ jgrid.createModal.call($t,
336
+ {
337
+ themodal: "info_dialog",
338
+ modalhead: "info_head",
339
+ modalcontent: "info_content",
340
+ resizeAlso: "infocnt"
341
+ },
342
+ cnt,
343
+ mopt,
344
+ "", "", true);
345
+ // attach onclick after inserting into the dom
346
+ $dlg = $("#info_dialog");
347
+ if (buttstr) {
348
+ $.each(mopt.buttons, function () {
349
+ $("#" + jgrid.jqID(this.id), "#info_id")
350
+ .on("click",
351
+ { click: this.onClick },
352
+ function (e) {
353
+ if ($.jgrid.isFunction(e.data.click)) {
354
+ e.data.click.call($t, e, $dlg);
355
+ }
356
+ return false;
357
+ });
358
+ });
359
+ }
360
+ $("#closedialog", "#info_id").click(function () {
361
+ jgrid.hideModal("#info_dialog", {
362
+ jqm: jm,
363
+ onClose: $dlg.data("onClose") || mopt.onClose,
364
+ gb: $dlg.data("gbox") || mopt.gbox
365
+ });
366
+ return false;
367
+ });
368
+ $(".fm-button", "#info_dialog").hover(
369
+ function () { $(this).addClass(hoverClasses); },
370
+ function () { $(this).removeClass(hoverClasses); }
371
+ );
372
+ if ($.jgrid.isFunction(mopt.beforeOpen)) { mopt.beforeOpen(); }
373
+ jgrid.viewModal.call($t, "#info_dialog", {
374
+ onHide: function (h) {
375
+ h.w.hide().remove();
376
+ if (h.o) { h.o.remove(); }
377
+ },
378
+ modal: mopt.modal,
379
+ jqm: jm
380
+ });
381
+ if ($.jgrid.isFunction(mopt.afterOpen)) { mopt.afterOpen(); }
382
+ try { $dlg.focus(); } catch (ignore) { }
383
+ },
384
+ bindEv: function (el, opt) {
385
+ var $t = this, p = $t.p;
386
+ if ($.jgrid.isFunction(opt.dataInit)) {
387
+ opt.dataInit.call($t, el, opt);
388
+ }
389
+ if (opt.dataEvents) {
390
+ $.each(opt.dataEvents, function () {
391
+ var data = this.data === undefined ?
392
+ $.extend({ gridId: p.id, gridIdSel: p.idSel }, opt) :
393
+ (typeof this.data === "object" && this.data !== null ?
394
+ $.extend(true, { gridId: p.id, gridIdSel: p.idSel }, opt, this.data) :
395
+ this.data);
396
+ $(el).on(this.type, data, this.fn);
397
+ });
398
+ }
399
+ },
400
+ // Form Functions
401
+ createEl: function (eltype, options, vl, autowidth, ajaxso) {
402
+ var elem = "", $t = this, p = $t.p, infoDialog = jgrid.info_dialog,
403
+ getRes = function (path) { return getGridRes.call($($t), path); },
404
+ errcap = getRes("errors.errcap"), edit = getRes("edit"), editMsg = edit.msg, bClose = edit.bClose;
405
+ function setAttributes(elm, atr, exl) {
406
+ var exclude = [
407
+ "dataInit",
408
+ "dataEvents",
409
+ "dataUrl",
410
+ "buildSelect",
411
+ "sopt",
412
+ "searchhidden",
413
+ "defaultValue",
414
+ "attr",
415
+ "custom_element",
416
+ "custom_value",
417
+ "generateValue",
418
+ "postData",
419
+ "selectFilled",
420
+ "rowId",
421
+ "column",
422
+ "mode",
423
+ "cm",
424
+ "iCol"
425
+ ];
426
+ if (exl !== undefined && Array.isArray(exl)) {
427
+ $.merge(exclude, exl);
428
+ }
429
+ $.each(atr, function (attrName, value) {
430
+ if ($.inArray(attrName, exclude) === -1) {
431
+ $(elm).attr(attrName, value);
432
+ }
433
+ });
434
+ if (!atr.hasOwnProperty("id")) {
435
+ $(elm).attr("id", jgrid.randId());
436
+ }
437
+ }
438
+
439
+ if (options == null) { return ""; }
440
+
441
+ switch (eltype) {
442
+ case "textarea":
443
+ elem = document.createElement("textarea");
444
+ if (autowidth) {
445
+ if (!options.cols) { $(elem).css({ width: "100%", "box-sizing": "border-box" }); }
446
+ } else if (!options.cols) { options.cols = 19; }
447
+ if (!options.rows) { options.rows = 2; }
448
+ if (vl === "&nbsp;" || vl === "&#160;" || (vl.length === 1 && vl.charCodeAt(0) === 160)) { vl = ""; }
449
+ elem.value = vl;
450
+ setAttributes(elem, options);
451
+ $(elem).attr({ role: "textbox" }); // , "multiline": "true"
452
+ break;
453
+ case "checkbox": //what code for simple checkbox
454
+ elem = document.createElement("input");
455
+ elem.type = "checkbox";
456
+ if (vl === "" || vl == null) {
457
+ vl = !options.hasOwnProperty("defaultValue") ?
458
+ "false" :
459
+ $.jgrid.isFunction(options.defaultValue) ?
460
+ options.defaultValue.call($t, {
461
+ cellValue: vl,
462
+ options: options
463
+ }) :
464
+ options.defaultValue;
465
+ }
466
+ if (!options.value) {
467
+ var vl1 = String(vl).toLowerCase();
468
+ if (vl1.search(/(false|f|0|no|n|off|undefined)/i) < 0 && vl1 !== "") {
469
+ elem.checked = true;
470
+ elem.defaultChecked = true;
471
+ elem.value = vl;
472
+ } else {
473
+ elem.value = "on";
474
+ }
475
+ $(elem).data("offval", "off");
476
+ } else {
477
+ var cbval = options.value.split(":");
478
+ if (vl === cbval[0]) {
479
+ elem.checked = true;
480
+ elem.defaultChecked = true;
481
+ }
482
+ elem.value = vl;
483
+ $(elem).data("offval", cbval[1]);
484
+ }
485
+ setAttributes(elem, options, ["value"]);
486
+ $(elem).attr({ role: "checkbox", "aria-checked": elem.checked ? "true" : "false" });
487
+ break;
488
+ case "select":
489
+ elem = document.createElement("select");
490
+ //var msl, ovm = [], isSelected, rowid = null;
491
+ var msl, ovm = [], rowid = null;
492
+
493
+ if (options.multiple === true || options.multiple === "multiple") {
494
+ msl = true;
495
+ elem.multiple = "multiple";
496
+ $(elem).attr("aria-multiselectable", "true");
497
+ ovm = vl.split(",");
498
+ ovm = $.map(ovm, function (n) { return $.jgrid.trim(n); });
499
+ } else {
500
+ msl = false;
501
+ ovm[0] = $.jgrid.trim(vl);
502
+ }
503
+ if (options.size === undefined) {
504
+ options.size = msl ? 3 : 1;
505
+ }
506
+ try {
507
+ rowid = options.rowId;
508
+ } catch (ignore) { }
509
+
510
+ if (p && p.idPrefix) {
511
+ rowid = jgrid.stripPref(p.idPrefix, rowid);
512
+ }
513
+ if (options.dataUrl === undefined && options.generateValue && p.indexByColumnData[options.cm.name] != null) {
514
+ options.value = $t.generateValueFromColumnIndex(options.cm.name, options.separator, options.delimiter);
515
+ }
516
+ if (options.dataUrl !== undefined) {
517
+ var postData = options.postData || ajaxso.postData,
518
+ ajaxContext = {
519
+ elem: elem,
520
+ options: options,
521
+ cm: options.cm,
522
+ mode: options.mode,
523
+ rowid: rowid,
524
+ iCol: options.iCol,
525
+ ovm: ovm
526
+ };
527
+ setAttributes(elem, options, postData ? ["postData"] : undefined);
528
+ $.ajax($.extend({
529
+ url: $.jgrid.isFunction(options.dataUrl) ? options.dataUrl.call($t, rowid, vl, String(options.name), ajaxContext) : options.dataUrl,
530
+ type: "GET",
531
+ dataType: "html",
532
+ data: $.jgrid.isFunction(postData) ? postData.call($t, rowid, vl, String(options.name)) : postData,
533
+ context: ajaxContext,
534
+ success: function (data, textStatus, jqXHR) {
535
+ var ovm1 = this.ovm, elem1 = this.elem, cm1 = this.cm, iCol1 = this.iCol,
536
+ options1 = $.extend({}, this.options), rowid1 = this.rowid, mode1 = this.mode,
537
+ a = $.jgrid.isFunction(options1.buildSelect) ? options1.buildSelect.call($t, data, jqXHR, cm1, iCol1) : data;
538
+ if (typeof a === "string") {
539
+ a = $($.jgrid.trim(a)).html();
540
+ }
541
+ if (a) {
542
+ //$(elem1).empty(); // ???
543
+ $(elem1).append(a);
544
+ setTimeout(function () {
545
+ var isSelected1; // undefined
546
+ $("option", elem1).each(function (iOpt) {
547
+ //if(i===0) { this.selected = false; }
548
+ // fix IE8/IE7 problem with selecting of the first item on multiple=true
549
+ if (iOpt === 0 && elem1.multiple) { this.selected = false; }
550
+ if ($.inArray($.jgrid.trim($(this).val()), ovm1) > -1) {
551
+ // this.setAttribute("selected", "selected");
552
+ this.selected = true;
553
+ isSelected1 = true;
554
+ }
555
+ });
556
+ if (!isSelected1) {
557
+ $("option", elem1).each(function () {
558
+ if ($.inArray($.jgrid.trim($(this).text()), ovm1) > -1) {
559
+ // this.setAttribute("selected", "selected");
560
+ this.selected = true;
561
+ }
562
+ });
563
+ }
564
+ //$(elem1).change();
565
+ jgrid.fullBoolFeedback.call($t, options1.selectFilled, "jqGridSelectFilled", {
566
+ elem: elem1,
567
+ options: options1,
568
+ cm: cm1,
569
+ rowid: rowid1,
570
+ mode: mode1,
571
+ cmName: cm1 != null ? cm1.name : options1.name,
572
+ iCol: iCol1
573
+ });
574
+ }, 0);
575
+ }
576
+ }
577
+ }, ajaxso || {}));
578
+ } else if (options.value) {
579
+ jgrid.fillSelectOptions(
580
+ elem,
581
+ options.value,
582
+ options.separator === undefined ? ":" : options.separator,
583
+ options.delimiter === undefined ? ";" : options.delimiter,
584
+ msl,
585
+ vl
586
+ );
587
+
588
+ setAttributes(elem, options, ["value"]);
589
+ jgrid.fullBoolFeedback.call($t, options.selectFilled, "jqGridSelectFilled", {
590
+ elem: elem,
591
+ options: options,
592
+ cm: options.cm,
593
+ rowid: rowid,
594
+ mode: options.mode,
595
+ cmName: options.cm != null ? options.cm.name : options.name,
596
+ iCol: options.iCol
597
+ });
598
+ }
599
+ break;
600
+ case "text":
601
+ case "password":
602
+ case "button":
603
+ var role;
604
+ if (eltype === "button") {
605
+ role = "button";
606
+ } else {
607
+ role = "textbox";
608
+ }
609
+ elem = document.createElement("input");
610
+ elem.type = eltype;
611
+ setAttributes(elem, options);
612
+ elem.value = vl;
613
+ if (eltype !== "button") {
614
+ if (autowidth) {
615
+ if (!options.size) { $(elem).css({ width: "100%", "box-sizing": "border-box" }); }
616
+ } else if (!options.size) {
617
+ options.size = 20;
618
+ }
619
+ }
620
+ $(elem).attr("role", role);
621
+ break;
622
+ case "image":
623
+ case "file":
624
+ elem = document.createElement("input");
625
+ elem.type = eltype;
626
+ setAttributes(elem, options);
627
+ break;
628
+ case "custom":
629
+ elem = document.createElement("span");
630
+ try {
631
+ if ($.jgrid.isFunction(options.custom_element)) {
632
+ var celm = options.custom_element.call($t, vl, options);
633
+ if (celm instanceof jQuery || jgrid.isHTMLElement(celm) || typeof celm === "string") {
634
+ celm = $(celm).addClass("customelement").attr({ id: options.id, name: options.name });
635
+ $(elem).empty().append(celm);
636
+ } else {
637
+ throw "editoptions.custom_element returns value of a wrong type";
638
+ }
639
+ } else {
640
+ throw "editoptions.custom_element is not a function";
641
+ }
642
+ } catch (e) {
643
+ if (e === "e1") {
644
+ infoDialog.call($t, errcap, "function 'custom_element' " + editMsg.nodefined, bClose);
645
+ }
646
+ if (e === "e2") {
647
+ infoDialog.call($t, errcap, "function 'custom_element' " + editMsg.novalue, bClose);
648
+ } else {
649
+ infoDialog.call($t, errcap, typeof e === "string" ? e : e.message, bClose);
650
+ }
651
+ }
652
+ break;
653
+ }
654
+ return elem;
655
+ },
656
+ // Date Validation Javascript
657
+ checkDate: function (format, date) {
658
+ var daysInFebruary = function (year) {
659
+ // February has 29 days in any year evenly divisible by four,
660
+ // EXCEPT for centurial years which are not also divisible by 400.
661
+ return (((year % 4 === 0) && (year % 100 !== 0 || (year % 400 === 0))) ? 29 : 28);
662
+ },
663
+ tsp = {},
664
+ sep;
665
+ format = format.toLowerCase();
666
+ //we search for /,-,. for the date separator
667
+ if (format.indexOf("/") !== -1) {
668
+ sep = "/";
669
+ } else if (format.indexOf("-") !== -1) {
670
+ sep = "-";
671
+ } else if (format.indexOf(".") !== -1) {
672
+ sep = ".";
673
+ } else {
674
+ sep = "/";
675
+ }
676
+ format = format.split(sep);
677
+ date = date.split(sep);
678
+ if (date.length !== 3) { return false; }
679
+ var j = -1, yln, dln = -1, mln = -1, i, dv;
680
+ for (i = 0; i < format.length; i++) {
681
+ dv = isNaN(date[i]) ? 0 : parseInt(date[i], 10);
682
+ tsp[format[i]] = dv;
683
+ yln = format[i];
684
+ if (yln.indexOf("y") !== -1) { j = i; }
685
+ if (yln.indexOf("m") !== -1) { mln = i; }
686
+ if (yln.indexOf("d") !== -1) { dln = i; }
687
+ }
688
+ if (format[j] === "y" || format[j] === "yyyy") {
689
+ yln = 4;
690
+ } else if (format[j] === "yy") {
691
+ yln = 2;
692
+ } else {
693
+ yln = -1;
694
+ }
695
+ var strDate, daysInMonth = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
696
+ if (j === -1) {
697
+ return false;
698
+ }
699
+ strDate = tsp[format[j]].toString();
700
+ if (yln === 2 && strDate.length === 1) { yln = 1; }
701
+ if (strDate.length !== yln || (tsp[format[j]] === 0 && date[j] !== "00")) {
702
+ return false;
703
+ }
704
+ if (mln === -1) {
705
+ return false;
706
+ }
707
+ strDate = tsp[format[mln]].toString();
708
+ if (strDate.length < 1 || tsp[format[mln]] < 1 || tsp[format[mln]] > 12) {
709
+ return false;
710
+ }
711
+ if (dln === -1) {
712
+ return false;
713
+ }
714
+ strDate = tsp[format[dln]].toString();
715
+ if (strDate.length < 1 || tsp[format[dln]] < 1 || tsp[format[dln]] > 31 || (tsp[format[mln]] === 2 && tsp[format[dln]] > daysInFebruary(tsp[format[j]])) || tsp[format[dln]] > daysInMonth[tsp[format[mln]]]) {
716
+ return false;
717
+ }
718
+ return true;
719
+ },
720
+ isEmpty: function (val) {
721
+ if (val.match(/^\s+$/) || val === "") {
722
+ return true;
723
+ }
724
+ return false;
725
+ },
726
+ checkTime: function (time) {
727
+ // checks only hh:ss (and optional am/pm)
728
+ var re = /^(\d{1,2}):(\d{2})([apAP][Mm])?$/, regs;
729
+ if (!jgrid.isEmpty(time)) {
730
+ regs = time.match(re);
731
+ if (regs) {
732
+ if (regs[3]) {
733
+ if (regs[1] < 1 || regs[1] > 12) { return false; }
734
+ } else {
735
+ if (regs[1] > 23) { return false; }
736
+ }
737
+ if (regs[2] > 59) {
738
+ return false;
739
+ }
740
+ } else {
741
+ return false;
742
+ }
743
+ }
744
+ return true;
745
+ },
746
+ checkValues: function (val, iCol, customobject, nam, options) {
747
+ var edtrul, nm, dft, g = this, p = g.p, colModel = p.colModel, cm, isEmpty = jgrid.isEmpty,
748
+ editMsg = getGridRes.call($(g), "edit.msg"), ret,
749
+ getPropertyValue = function (propertyName) {
750
+ var propValue = edtrul[propertyName];
751
+ return $.jgrid.isFunction(propValue) ? propValue.call(g, options) : propValue;
752
+ },
753
+ dateMasks = getGridRes.call($(g), "formatter.date.masks");
754
+ if (customobject === undefined) {
755
+ if (typeof iCol === "string") {
756
+ iCol = p.iColByName[iCol];
757
+ }
758
+ if (iCol === undefined || iCol < 0) {
759
+ return [true, "", ""];
760
+ }
761
+ cm = colModel[iCol];
762
+ edtrul = cm.editrules;
763
+ if (cm.formoptions != null) { nm = cm.formoptions.label; }
764
+ } else {
765
+ edtrul = customobject;
766
+ nm = nam === undefined ? "_" : nam;
767
+ cm = colModel[iCol];
768
+ }
769
+ if (edtrul) {
770
+ if (!nm) { nm = p.colNames != null ? p.colNames[iCol] : cm.label; }
771
+ if (getPropertyValue("required") === true) {
772
+ if (isEmpty(val)) { return [false, nm + ": " + editMsg.required, ""]; }
773
+ }
774
+ // force required
775
+ var rqfield = getPropertyValue("required") === false ? false : true;
776
+ if (getPropertyValue("number") === true) {
777
+ if (!(rqfield === false && isEmpty(val))) {
778
+ if (isNaN(val)) { return [false, nm + ": " + editMsg.number, ""]; }
779
+ }
780
+ }
781
+ if (edtrul.minValue !== undefined && !isNaN(edtrul.minValue)) {
782
+ if (parseFloat(val) < parseFloat(edtrul.minValue)) { return [false, nm + ": " + editMsg.minValue + " " + edtrul.minValue, ""]; }
783
+ }
784
+ if (edtrul.maxValue !== undefined && !isNaN(edtrul.maxValue)) {
785
+ if (parseFloat(val) > parseFloat(edtrul.maxValue)) { return [false, nm + ": " + editMsg.maxValue + " " + edtrul.maxValue, ""]; }
786
+ }
787
+ var filter;
788
+ if (getPropertyValue("email") === true) {
789
+ if (!(rqfield === false && isEmpty(val))) {
790
+ // taken from $ Validate plugin
791
+ filter = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
792
+ if (!filter.test(val)) { return [false, nm + ": " + editMsg.email, ""]; }
793
+ }
794
+ }
795
+ if (getPropertyValue("integer") === true) {
796
+ if (!(rqfield === false && isEmpty(val))) {
797
+ if (isNaN(val)) { return [false, nm + ": " + editMsg.integer, ""]; }
798
+ if ((val % 1 !== 0) || (val.indexOf(".") !== -1)) { return [false, nm + ": " + editMsg.integer, ""]; }
799
+ }
800
+ }
801
+ if (getPropertyValue("date") === true) {
802
+ if (!(rqfield === false && isEmpty(val))) {
803
+ if (cm.formatoptions && cm.formatoptions.newformat) {
804
+ dft = cm.formatoptions.newformat;
805
+ if (dateMasks.hasOwnProperty(dft)) {
806
+ dft = dateMasks[dft];
807
+ }
808
+ } else {
809
+ dft = colModel[iCol].datefmt || "Y-m-d";
810
+ }
811
+ if (!jgrid.checkDate(dft, val)) { return [false, nm + ": " + editMsg.date + " - " + dft, ""]; }
812
+ }
813
+ }
814
+ if (getPropertyValue("time") === true) {
815
+ if (!(rqfield === false && isEmpty(val))) {
816
+ if (!jgrid.checkTime(val)) { return [false, nm + ": " + editMsg.date + " - hh:mm (am/pm)", ""]; }
817
+ }
818
+ }
819
+ if (getPropertyValue("url") === true) {
820
+ if (!(rqfield === false && isEmpty(val))) {
821
+ filter = /^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
822
+ if (!filter.test(val)) { return [false, nm + ": " + editMsg.url, ""]; }
823
+ }
824
+ }
825
+ if (edtrul.custom === true) {
826
+ if (!(rqfield === false && isEmpty(val))) {
827
+ if ($.jgrid.isFunction(edtrul.custom_func)) {
828
+ ret = edtrul.custom_func.call(g, val, nm, iCol);
829
+ return Array.isArray(ret) ? ret : [false, editMsg.customarray, ""];
830
+ }
831
+ return [false, editMsg.customfcheck, ""];
832
+ }
833
+ } else if ($.jgrid.isFunction(edtrul.custom)) {
834
+ if (!(rqfield === false && isEmpty(val))) {
835
+ ret = edtrul.custom.call(g, options);
836
+ return Array.isArray(ret) ? ret : [false, editMsg.customarray, ""];
837
+ }
838
+ }
839
+ }
840
+ return [true, "", ""];
841
+ }
842
+ });
843
+ // end module grid.common
844
+ }));