ps-toolkit-ui 0.0.211 → 0.0.212

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 (311) hide show
  1. package/bundles/ps-toolkit-ui.umd.js +7812 -0
  2. package/bundles/ps-toolkit-ui.umd.js.map +1 -0
  3. package/bundles/ps-toolkit-ui.umd.min.js +2 -0
  4. package/bundles/ps-toolkit-ui.umd.min.js.map +1 -0
  5. package/esm2015/lib/classes/chart.class.js +140 -0
  6. package/esm2015/lib/classes/enum.class.js +187 -0
  7. package/esm2015/lib/classes/form.class.js +481 -0
  8. package/esm2015/lib/classes/helper.class.js +284 -0
  9. package/esm2015/lib/classes/lang.class.js +32 -0
  10. package/esm2015/lib/classes/login.class.js +22 -0
  11. package/esm2015/lib/classes/modal.class.js +52 -0
  12. package/esm2015/lib/classes/permission.class.js +61 -0
  13. package/esm2015/lib/classes/request.class.js +256 -0
  14. package/esm2015/lib/classes/safestyle.class.js +15 -0
  15. package/esm2015/lib/classes/sidebar.class.js +14 -0
  16. package/esm2015/lib/classes/steps.class.js +20 -0
  17. package/esm2015/lib/classes/string.class.js +220 -0
  18. package/esm2015/lib/classes/table.class.js +215 -0
  19. package/esm2015/lib/components/accordion/accordion.component.js +45 -0
  20. package/esm2015/lib/components/alert/alert.component.js +39 -0
  21. package/esm2015/lib/components/base.component.js +45 -0
  22. package/esm2015/lib/components/calendar/calendar.component.js +97 -0
  23. package/esm2015/lib/components/chart/chart.component.js +17 -0
  24. package/esm2015/lib/components/clock/clock.component.js +33 -0
  25. package/esm2015/lib/components/confirm/confirm.component.js +50 -0
  26. package/esm2015/lib/components/footer/footer.component.js +23 -0
  27. package/esm2015/lib/components/form/bank-card/form.bank-card.component.js +148 -0
  28. package/esm2015/lib/components/form/button/form.button.component.js +68 -0
  29. package/esm2015/lib/components/form/car/form.car.component.js +84 -0
  30. package/esm2015/lib/components/form/car/search/form.car.search.component.js +172 -0
  31. package/esm2015/lib/components/form/checkbox/form.checkbox.component.js +66 -0
  32. package/esm2015/lib/components/form/date/form.date.component.js +254 -0
  33. package/esm2015/lib/components/form/datetime/form.datetime.component.js +104 -0
  34. package/esm2015/lib/components/form/file/form.file.component.js +133 -0
  35. package/esm2015/lib/components/form/finger/form.finger.component.js +138 -0
  36. package/esm2015/lib/components/form/hidden/form.hidden.component.js +31 -0
  37. package/esm2015/lib/components/form/icon/form.icon.component.js +76 -0
  38. package/esm2015/lib/components/form/index/form.component.js +48 -0
  39. package/esm2015/lib/components/form/label/form.label.component.js +32 -0
  40. package/esm2015/lib/components/form/plaque/form.plaque.component.js +176 -0
  41. package/esm2015/lib/components/form/plaque/select/form.plaque.select.component.js +390 -0
  42. package/esm2015/lib/components/form/radio/form.radio.component.js +79 -0
  43. package/esm2015/lib/components/form/select/form.select.component.js +374 -0
  44. package/esm2015/lib/components/form/select/item/form.select.item.component.js +43 -0
  45. package/esm2015/lib/components/form/table/form.table.component.js +98 -0
  46. package/esm2015/lib/components/form/textarea/form.textarea.component.js +78 -0
  47. package/esm2015/lib/components/form/textbox/form.textbox.component.js +186 -0
  48. package/esm2015/lib/components/form/time/form.time.component.js +145 -0
  49. package/esm2015/lib/components/form/tree/form.tree.component.js +99 -0
  50. package/esm2015/lib/components/form/tree/item/form.tree.item.component.js +48 -0
  51. package/esm2015/lib/components/header/header.component.js +33 -0
  52. package/esm2015/lib/components/header/sub/sub.header.component.js +14 -0
  53. package/esm2015/lib/components/layout/layout.component.js +25 -0
  54. package/esm2015/lib/components/loading/loading.component.js +22 -0
  55. package/esm2015/lib/components/login/login.component.js +148 -0
  56. package/esm2015/lib/components/modal/modal.component.js +25 -0
  57. package/esm2015/lib/components/notfound/notfound.component.js +29 -0
  58. package/esm2015/lib/components/notification/notification.component.js +14 -0
  59. package/esm2015/lib/components/sidebar/item/sidebar.item.component.js +53 -0
  60. package/esm2015/lib/components/sidebar/sidebar.component.js +67 -0
  61. package/esm2015/lib/components/steps/steps.component.js +51 -0
  62. package/esm2015/lib/components/table/loading/table.loading.component.js +17 -0
  63. package/esm2015/lib/components/table/pagination/table.pagination.component.js +84 -0
  64. package/esm2015/lib/components/table/report/table.report.component.js +246 -0
  65. package/esm2015/lib/components/table/row/table.row.component.js +379 -0
  66. package/esm2015/lib/components/table/table.component.js +179 -0
  67. package/esm2015/lib/components/tooltip/tooltip.component.js +19 -0
  68. package/esm2015/lib/ps-toolkit-ui.module.js +95 -0
  69. package/esm2015/lib/services/config.service.js +14 -0
  70. package/esm2015/ps-toolkit-ui.js +20 -0
  71. package/esm2015/public-api.js +53 -0
  72. package/fesm2015/ps-toolkit-ui.js +6706 -0
  73. package/fesm2015/ps-toolkit-ui.js.map +1 -0
  74. package/lib/classes/chart.class.d.ts +11 -0
  75. package/lib/classes/enum.class.d.ts +158 -0
  76. package/lib/classes/form.class.d.ts +173 -0
  77. package/lib/classes/helper.class.d.ts +28 -0
  78. package/lib/classes/lang.class.d.ts +5 -0
  79. package/lib/classes/login.class.d.ts +17 -0
  80. package/lib/classes/modal.class.d.ts +19 -0
  81. package/lib/classes/permission.class.d.ts +31 -0
  82. package/lib/classes/request.class.d.ts +12 -0
  83. package/lib/classes/safestyle.class.d.ts +7 -0
  84. package/lib/classes/sidebar.class.d.ts +11 -0
  85. package/lib/classes/steps.class.d.ts +17 -0
  86. package/lib/classes/string.class.d.ts +218 -0
  87. package/lib/classes/table.class.d.ts +69 -0
  88. package/lib/components/accordion/accordion.component.d.ts +7 -0
  89. package/lib/components/alert/alert.component.d.ts +10 -0
  90. package/lib/components/base.component.d.ts +14 -0
  91. package/lib/components/calendar/calendar.component.d.ts +26 -0
  92. package/lib/components/chart/chart.component.d.ts +5 -0
  93. package/lib/components/clock/clock.component.d.ts +11 -0
  94. package/lib/components/confirm/confirm.component.d.ts +14 -0
  95. package/lib/components/footer/footer.component.d.ts +6 -0
  96. package/lib/components/form/bank-card/form.bank-card.component.d.ts +22 -0
  97. package/lib/components/form/button/form.button.component.d.ts +15 -0
  98. package/lib/components/form/car/form.car.component.d.ts +16 -0
  99. package/lib/components/form/car/search/form.car.search.component.d.ts +17 -0
  100. package/lib/components/form/checkbox/form.checkbox.component.d.ts +14 -0
  101. package/lib/components/form/date/form.date.component.d.ts +42 -0
  102. package/lib/components/form/datetime/form.datetime.component.d.ts +13 -0
  103. package/lib/components/form/file/form.file.component.d.ts +17 -0
  104. package/lib/components/form/finger/form.finger.component.d.ts +15 -0
  105. package/lib/components/form/hidden/form.hidden.component.d.ts +7 -0
  106. package/lib/components/form/icon/form.icon.component.d.ts +15 -0
  107. package/lib/components/form/index/form.component.d.ts +10 -0
  108. package/lib/components/form/label/form.label.component.d.ts +8 -0
  109. package/lib/components/form/plaque/form.plaque.component.d.ts +22 -0
  110. package/lib/components/form/plaque/select/form.plaque.select.component.d.ts +36 -0
  111. package/lib/components/form/radio/form.radio.component.d.ts +13 -0
  112. package/lib/components/form/select/form.select.component.d.ts +39 -0
  113. package/lib/components/form/select/item/form.select.item.component.d.ts +12 -0
  114. package/lib/components/form/table/form.table.component.d.ts +9 -0
  115. package/lib/components/form/textarea/form.textarea.component.d.ts +13 -0
  116. package/lib/components/form/textbox/form.textbox.component.d.ts +20 -0
  117. package/lib/components/form/time/form.time.component.d.ts +25 -0
  118. package/lib/components/form/tree/form.tree.component.d.ts +16 -0
  119. package/lib/components/form/tree/item/form.tree.item.component.d.ts +17 -0
  120. package/lib/components/header/header.component.d.ts +9 -0
  121. package/lib/components/header/sub/sub.header.component.d.ts +3 -0
  122. package/lib/components/layout/layout.component.d.ts +8 -0
  123. package/lib/components/loading/loading.component.d.ts +5 -0
  124. package/lib/components/login/login.component.d.ts +13 -0
  125. package/lib/components/modal/modal.component.d.ts +9 -0
  126. package/lib/components/notfound/notfound.component.d.ts +8 -0
  127. package/lib/components/notification/notification.component.d.ts +3 -0
  128. package/lib/components/sidebar/item/sidebar.item.component.d.ts +14 -0
  129. package/lib/components/sidebar/sidebar.component.d.ts +19 -0
  130. package/lib/components/steps/steps.component.d.ts +10 -0
  131. package/lib/components/table/loading/table.loading.component.d.ts +5 -0
  132. package/lib/components/table/pagination/table.pagination.component.d.ts +15 -0
  133. package/lib/components/table/report/table.report.component.d.ts +34 -0
  134. package/lib/components/table/row/table.row.component.d.ts +34 -0
  135. package/lib/components/table/table.component.d.ts +40 -0
  136. package/lib/components/tooltip/tooltip.component.d.ts +5 -0
  137. package/lib/ps-toolkit-ui.module.d.ts +4 -0
  138. package/lib/services/config.service.d.ts +6 -0
  139. package/package.json +23 -19
  140. package/ps-toolkit-ui.d.ts +19 -0
  141. package/ps-toolkit-ui.metadata.json +1 -0
  142. package/{src/public-api.ts → public-api.d.ts} +49 -53
  143. package/karma.conf.js +0 -32
  144. package/ng-package.json +0 -16
  145. package/src/lib/classes/chart.class.ts +0 -140
  146. package/src/lib/classes/enum.class.ts +0 -193
  147. package/src/lib/classes/excel.class.ts +0 -46
  148. package/src/lib/classes/form.class.ts +0 -528
  149. package/src/lib/classes/helper.class.ts +0 -283
  150. package/src/lib/classes/lang.class.ts +0 -32
  151. package/src/lib/classes/login.class.ts +0 -27
  152. package/src/lib/classes/modal.class.ts +0 -59
  153. package/src/lib/classes/permission.class.ts +0 -55
  154. package/src/lib/classes/request.class.ts +0 -255
  155. package/src/lib/classes/safestyle.class.ts +0 -4
  156. package/src/lib/classes/sidebar.class.ts +0 -20
  157. package/src/lib/classes/steps.class.ts +0 -19
  158. package/src/lib/classes/string.class.ts +0 -219
  159. package/src/lib/classes/table.class.ts +0 -228
  160. package/src/lib/components/accordion/accordion.component.css +0 -116
  161. package/src/lib/components/accordion/accordion.component.html +0 -19
  162. package/src/lib/components/accordion/accordion.component.ts +0 -41
  163. package/src/lib/components/alert/alert.component.css +0 -112
  164. package/src/lib/components/alert/alert.component.html +0 -1
  165. package/src/lib/components/alert/alert.component.ts +0 -35
  166. package/src/lib/components/base.component.ts +0 -38
  167. package/src/lib/components/calendar/calendar.component.css +0 -206
  168. package/src/lib/components/calendar/calendar.component.html +0 -36
  169. package/src/lib/components/calendar/calendar.component.ts +0 -99
  170. package/src/lib/components/chart/chart.component.css +0 -24
  171. package/src/lib/components/chart/chart.component.html +0 -6
  172. package/src/lib/components/chart/chart.component.ts +0 -14
  173. package/src/lib/components/clock/clock.component.css +0 -141
  174. package/src/lib/components/clock/clock.component.html +0 -10
  175. package/src/lib/components/clock/clock.component.ts +0 -37
  176. package/src/lib/components/confirm/confirm.component.css +0 -112
  177. package/src/lib/components/confirm/confirm.component.html +0 -1
  178. package/src/lib/components/confirm/confirm.component.ts +0 -47
  179. package/src/lib/components/footer/footer.component.css +0 -46
  180. package/src/lib/components/footer/footer.component.html +0 -9
  181. package/src/lib/components/footer/footer.component.ts +0 -18
  182. package/src/lib/components/form/bank-card/form.bank-card.component.css +0 -115
  183. package/src/lib/components/form/bank-card/form.bank-card.component.html +0 -13
  184. package/src/lib/components/form/bank-card/form.bank-card.component.ts +0 -144
  185. package/src/lib/components/form/button/form.button.component.css +0 -222
  186. package/src/lib/components/form/button/form.button.component.html +0 -16
  187. package/src/lib/components/form/button/form.button.component.ts +0 -65
  188. package/src/lib/components/form/car/form.car.component.css +0 -287
  189. package/src/lib/components/form/car/form.car.component.html +0 -11
  190. package/src/lib/components/form/car/form.car.component.ts +0 -82
  191. package/src/lib/components/form/car/search/form.car.search.component.css +0 -287
  192. package/src/lib/components/form/car/search/form.car.search.component.html +0 -15
  193. package/src/lib/components/form/car/search/form.car.search.component.ts +0 -170
  194. package/src/lib/components/form/checkbox/form.checkbox.component.css +0 -128
  195. package/src/lib/components/form/checkbox/form.checkbox.component.html +0 -8
  196. package/src/lib/components/form/checkbox/form.checkbox.component.ts +0 -64
  197. package/src/lib/components/form/date/form.date.component.css +0 -310
  198. package/src/lib/components/form/date/form.date.component.html +0 -46
  199. package/src/lib/components/form/date/form.date.component.ts +0 -247
  200. package/src/lib/components/form/datetime/form.datetime.component.css +0 -157
  201. package/src/lib/components/form/datetime/form.datetime.component.html +0 -11
  202. package/src/lib/components/form/datetime/form.datetime.component.ts +0 -98
  203. package/src/lib/components/form/file/form.file.component.css +0 -151
  204. package/src/lib/components/form/file/form.file.component.html +0 -12
  205. package/src/lib/components/form/file/form.file.component.ts +0 -130
  206. package/src/lib/components/form/finger/form.finger.component.css +0 -215
  207. package/src/lib/components/form/finger/form.finger.component.html +0 -59
  208. package/src/lib/components/form/finger/form.finger.component.ts +0 -131
  209. package/src/lib/components/form/hidden/form.hidden.component.css +0 -0
  210. package/src/lib/components/form/hidden/form.hidden.component.html +0 -0
  211. package/src/lib/components/form/hidden/form.hidden.component.ts +0 -29
  212. package/src/lib/components/form/icon/form.icon.component.css +0 -108
  213. package/src/lib/components/form/icon/form.icon.component.html +0 -14
  214. package/src/lib/components/form/icon/form.icon.component.ts +0 -73
  215. package/src/lib/components/form/index/form.component.css +0 -89
  216. package/src/lib/components/form/index/form.component.html +0 -35
  217. package/src/lib/components/form/index/form.component.ts +0 -45
  218. package/src/lib/components/form/label/form.label.component.css +0 -45
  219. package/src/lib/components/form/label/form.label.component.html +0 -2
  220. package/src/lib/components/form/label/form.label.component.ts +0 -30
  221. package/src/lib/components/form/plaque/form.plaque.component.css +0 -76
  222. package/src/lib/components/form/plaque/form.plaque.component.html +0 -10
  223. package/src/lib/components/form/plaque/form.plaque.component.ts +0 -178
  224. package/src/lib/components/form/plaque/select/form.plaque.select.component.css +0 -167
  225. package/src/lib/components/form/plaque/select/form.plaque.select.component.html +0 -19
  226. package/src/lib/components/form/plaque/select/form.plaque.select.component.ts +0 -385
  227. package/src/lib/components/form/radio/form.radio.component.css +0 -158
  228. package/src/lib/components/form/radio/form.radio.component.html +0 -16
  229. package/src/lib/components/form/radio/form.radio.component.ts +0 -78
  230. package/src/lib/components/form/select/form.select.component.css +0 -326
  231. package/src/lib/components/form/select/form.select.component.html +0 -16
  232. package/src/lib/components/form/select/form.select.component.ts +0 -358
  233. package/src/lib/components/form/select/item/form.select.item.component.css +0 -59
  234. package/src/lib/components/form/select/item/form.select.item.component.html +0 -10
  235. package/src/lib/components/form/select/item/form.select.item.component.ts +0 -40
  236. package/src/lib/components/form/table/form.table.component.css +0 -50
  237. package/src/lib/components/form/table/form.table.component.html +0 -8
  238. package/src/lib/components/form/table/form.table.component.ts +0 -94
  239. package/src/lib/components/form/textarea/form.textarea.component.css +0 -109
  240. package/src/lib/components/form/textarea/form.textarea.component.html +0 -10
  241. package/src/lib/components/form/textarea/form.textarea.component.ts +0 -76
  242. package/src/lib/components/form/textbox/form.textbox.component.css +0 -296
  243. package/src/lib/components/form/textbox/form.textbox.component.html +0 -13
  244. package/src/lib/components/form/textbox/form.textbox.component.ts +0 -185
  245. package/src/lib/components/form/time/form.time.component.css +0 -205
  246. package/src/lib/components/form/time/form.time.component.html +0 -22
  247. package/src/lib/components/form/time/form.time.component.ts +0 -139
  248. package/src/lib/components/form/tree/form.tree.component.css +0 -109
  249. package/src/lib/components/form/tree/form.tree.component.html +0 -11
  250. package/src/lib/components/form/tree/form.tree.component.ts +0 -98
  251. package/src/lib/components/form/tree/item/form.tree.item.component.css +0 -142
  252. package/src/lib/components/form/tree/item/form.tree.item.component.html +0 -9
  253. package/src/lib/components/form/tree/item/form.tree.item.component.ts +0 -49
  254. package/src/lib/components/header/header.component.css +0 -57
  255. package/src/lib/components/header/header.component.html +0 -5
  256. package/src/lib/components/header/header.component.ts +0 -28
  257. package/src/lib/components/header/sub/sub.header.component.css +0 -62
  258. package/src/lib/components/header/sub/sub.header.component.html +0 -8
  259. package/src/lib/components/header/sub/sub.header.component.ts +0 -11
  260. package/src/lib/components/layout/layout.component.css +0 -300
  261. package/src/lib/components/layout/layout.component.html +0 -20
  262. package/src/lib/components/layout/layout.component.ts +0 -21
  263. package/src/lib/components/loading/loading.component.css +0 -39
  264. package/src/lib/components/loading/loading.component.html +0 -8
  265. package/src/lib/components/loading/loading.component.ts +0 -18
  266. package/src/lib/components/login/login.component.css +0 -389
  267. package/src/lib/components/login/login.component.html +0 -27
  268. package/src/lib/components/login/login.component.ts +0 -145
  269. package/src/lib/components/modal/modal.component.css +0 -60
  270. package/src/lib/components/modal/modal.component.html +0 -12
  271. package/src/lib/components/modal/modal.component.ts +0 -23
  272. package/src/lib/components/notfound/notfound.component.css +0 -134
  273. package/src/lib/components/notfound/notfound.component.html +0 -10
  274. package/src/lib/components/notfound/notfound.component.ts +0 -25
  275. package/src/lib/components/notification/notification.component.css +0 -45
  276. package/src/lib/components/notification/notification.component.html +0 -2
  277. package/src/lib/components/notification/notification.component.ts +0 -11
  278. package/src/lib/components/sidebar/item/sidebar.item.component.css +0 -236
  279. package/src/lib/components/sidebar/item/sidebar.item.component.html +0 -16
  280. package/src/lib/components/sidebar/item/sidebar.item.component.ts +0 -54
  281. package/src/lib/components/sidebar/sidebar.component.css +0 -42
  282. package/src/lib/components/sidebar/sidebar.component.html +0 -10
  283. package/src/lib/components/sidebar/sidebar.component.ts +0 -60
  284. package/src/lib/components/steps/steps.component.css +0 -320
  285. package/src/lib/components/steps/steps.component.html +0 -18
  286. package/src/lib/components/steps/steps.component.ts +0 -44
  287. package/src/lib/components/table/loading/table.loading.component.css +0 -29
  288. package/src/lib/components/table/loading/table.loading.component.html +0 -9
  289. package/src/lib/components/table/loading/table.loading.component.ts +0 -14
  290. package/src/lib/components/table/pagination/table.pagination.component.css +0 -138
  291. package/src/lib/components/table/pagination/table.pagination.component.html +0 -9
  292. package/src/lib/components/table/pagination/table.pagination.component.ts +0 -89
  293. package/src/lib/components/table/report/table.report.component.css +0 -125
  294. package/src/lib/components/table/report/table.report.component.html +0 -19
  295. package/src/lib/components/table/report/table.report.component.ts +0 -238
  296. package/src/lib/components/table/row/table.row.component.css +0 -170
  297. package/src/lib/components/table/row/table.row.component.html +0 -21
  298. package/src/lib/components/table/row/table.row.component.ts +0 -373
  299. package/src/lib/components/table/table.component.css +0 -116
  300. package/src/lib/components/table/table.component.html +0 -62
  301. package/src/lib/components/table/table.component.ts +0 -180
  302. package/src/lib/components/tooltip/tooltip.component.css +0 -159
  303. package/src/lib/components/tooltip/tooltip.component.html +0 -1
  304. package/src/lib/components/tooltip/tooltip.component.ts +0 -15
  305. package/src/lib/ps-toolkit-ui.module.ts +0 -94
  306. package/src/lib/services/config.service.ts +0 -8
  307. package/src/test.ts +0 -26
  308. package/tsconfig.lib.json +0 -25
  309. package/tsconfig.lib.prod.json +0 -10
  310. package/tsconfig.spec.json +0 -17
  311. package/tslint.json +0 -17
@@ -1,385 +0,0 @@
1
- import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
2
- import * as $ from 'jquery';
3
- import {InputClass, OptionClass} from '../../../../classes/form.class';
4
- import {InputError, InputType} from '../../../../classes/enum.class';
5
-
6
- @Component({
7
- selector: 'lib-form-plaque-select',
8
- templateUrl: './form.plaque.select.component.html',
9
- styleUrls: ['./form.plaque.select.component.css']
10
- })
11
- export class FormPlaqueSelectComponent implements OnInit{
12
- @Output()
13
- changeIndex = new EventEmitter<string>();
14
- @Input()
15
- inp: InputClass;
16
- cSearch = '';
17
- open = false;
18
- top = false;
19
- part1: InputClass;
20
- part2: InputClass;
21
- part3: InputClass;
22
- part4: InputClass;
23
- get type(): typeof InputType { return InputType; }
24
- alphas = ['الف', 'ب', 'پ', 'ت', 'ث', 'ج', 'چ', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'ژ', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ک', 'گ', 'ل', 'م', 'ن', 'و', 'ه', 'ی'];
25
- @ViewChild('inputDiv') inputDiv: ElementRef;
26
- @ViewChild('inputBase') inputBase: ElementRef;
27
- @ViewChild('inputOptionsDiv') inputOptionsDiv: ElementRef;
28
- @ViewChild('inputLabel') inputLabel: ElementRef;
29
- ngOnInit(): void{
30
- this.inp.setValue = (v) => {
31
- this.inp.value = v;
32
- this.inp.options = [];
33
- };
34
- this.inp.setSearch = (s) => {
35
- const p = s ? s.split('_') : null;
36
- if (p && p.length === 4) {
37
- setTimeout(() => {
38
- this.part1.value = p[0];
39
- this.part2.value = p[1];
40
- this.part2.search = p[1];
41
- this.part3.value = p[2];
42
- this.part4.value = p[3];
43
- }, 100);
44
- } else if (p && p.length === 2) {
45
- setTimeout(() => {
46
- this.part1.value = p[0];
47
- this.part3.value = p[1];
48
- }, 100);
49
- }else {
50
- this.part1.value = '';
51
- this.part2.value = '';
52
- this.part2.search = '';
53
- this.part3.value = '';
54
- this.part4.value = '';
55
- }
56
- };
57
- this.inp.focus = () => {
58
- this.openOptions(true);
59
- };
60
- this.inp.isValid = () => {
61
- this.inp.error = null;
62
- if (this.inp.required && !this.inp.value) {
63
- this.inp.error = InputError.Required;
64
- return false;
65
- }
66
- return true;
67
- };
68
- this.inp.clear = () => {
69
- this.inp.error = null;
70
- this.inp.value = this.inp.default;
71
- this.inp.search = '';
72
- this.part1.value = '';
73
- this.part2.value = '';
74
- this.part2.search = '';
75
- this.part3.value = '';
76
- this.part4.value = '';
77
- if (this.inp.rel != null){
78
- this.inp.rel.options = [];
79
- }
80
- };
81
- this.inp.data = () => {
82
- return this.inp.value;
83
- };
84
- this.part1 = new InputClass(this.inp.environment, this.inp.l, 'Part1', null, InputType.Number,
85
- 'plaque-part-1 plaque-part-item' + (this.inp.type === InputType.SelectAutoCompletePlaqueM ? ' plaque-part-m' : ''),
86
- '', true,
87
- this.inp.type === InputType.SelectAutoCompletePlaqueM ? 100 : 10,
88
- this.inp.type === InputType.SelectAutoCompletePlaqueM ? 999 : 99);
89
- this.part2 = new InputClass(this.inp.environment, this.inp.l, 'Part2', null, InputType.Select,
90
- 'plaque-part-2 plaque-part-item' + (this.inp.type === InputType.SelectAutoCompletePlaqueM ? ' plaque-part-m' : ''),
91
- '', true);
92
- this.part2.options = this.alphas.map(x => new OptionClass(x, x));
93
- this.part3 = new InputClass(this.inp.environment, this.inp.l, 'Part3', null, InputType.Number,
94
- 'plaque-part-3 plaque-part-item' + (this.inp.type === InputType.SelectAutoCompletePlaqueM ? ' plaque-part-m' : ''),
95
- '', true,
96
- this.inp.type === InputType.SelectAutoCompletePlaqueM ? 10000 : 100,
97
- this.inp.type === InputType.SelectAutoCompletePlaqueM ? 99999 : 999);
98
- this.part4 = new InputClass(this.inp.environment, this.inp.l, 'Part4', null, InputType.Number,
99
- 'plaque-part-4 plaque-part-item' + (this.inp.type === InputType.SelectAutoCompletePlaqueM ? ' plaque-part-m' : ''),
100
- '', true, 10, 99);
101
- this.part1.displayLabel = this.part2.displayLabel = this.part3.displayLabel = this.part4.displayLabel = false;
102
- this.part1.placeholder = this.part2.placeholder = this.part3.placeholder = this.part4.placeholder = null;
103
- this.part1.onChange = (v) => {
104
- this.inp.error = null;
105
- this.inp.value = null;
106
- if (v.length === 2 && this.inp.type === InputType.SelectAutoCompletePlaque){
107
- this.part2.focus();
108
- this.loadOptions();
109
- } else if (v.length === 3 && this.inp.type === InputType.SelectAutoCompletePlaqueM){
110
- this.part3.focus();
111
- this.loadOptions();
112
- }
113
- };
114
- this.part2.onChange = () => {
115
- this.inp.error = null;
116
- this.inp.value = null;
117
- setTimeout(() => {
118
- this.part3.focus();
119
- this.loadOptions();
120
- }, 100);
121
- };
122
- this.part3.onChange = (v) => {
123
- this.inp.error = null;
124
- this.inp.value = null;
125
- if (v.length === 3 && this.inp.type === InputType.SelectAutoCompletePlaque){
126
- this.part4.focus();
127
- this.loadOptions();
128
- } else if (v.length === 5 && this.inp.type === InputType.SelectAutoCompletePlaqueM){
129
- this.loadOptions();
130
- }
131
- };
132
- this.part4.onChange = (v) => {
133
- this.inp.error = null;
134
- this.inp.value = null;
135
- if (v.length === 2){
136
- this.loadOptions();
137
- }
138
- };
139
- this.part1.onKeyDown = this.part2.onKeyDown = this.part3.onKeyDown = this.part4.onKeyDown = (e) => {
140
- const code = e.keyCode || e.which;
141
- if (code === 38 || code === 40){
142
- this.onKeyDown(e);
143
- }
144
- };
145
- this.part1.onFocusOut = (e) => {
146
- if (!$(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')){
147
- if (this.open){
148
- this.closeOptions();
149
- }
150
- }
151
- };
152
- this.part2.onFocusOut = (e) => {
153
- if (!$(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')){
154
- if (this.open){
155
- this.closeOptions();
156
- }
157
- }
158
- };
159
- this.part3.onFocusOut = (e) => {
160
- if (!$(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')){
161
- if (this.open){
162
- this.closeOptions();
163
- }
164
- }
165
- };
166
- this.part4.onFocusOut = (e) => {
167
- if (!$(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')){
168
- if (this.open){
169
- this.closeOptions();
170
- }
171
- }
172
- };
173
- }
174
- loadOptions(): void{
175
- const v = this.getSearch().replace(/^_+|_+$/g, '');
176
- if (v){
177
- this.inp.load(this.inp.url.replace('{}', v));
178
- }else{
179
- this.inp.options = [];
180
- }
181
- }
182
- openOptions(f = false): boolean{
183
- this.setPosition();
184
- this.setHoverCenter();
185
- this.open = true;
186
- this.focusInput(f);
187
- return true;
188
- }
189
- focusInput(f = false): void{
190
- if (f){
191
- this.part1.focus();
192
- }
193
- }
194
- closeOptions(): boolean{
195
- setTimeout(() => {
196
- this.open = false;
197
- this.top = false;
198
- this.inp.hover = -1;
199
- if (this.inp.value === null){
200
- this.inp.search = '';
201
- this.part1.value = '';
202
- this.part2.value = '';
203
- this.part2.search = '';
204
- this.part3.value = '';
205
- this.part4.value = '';
206
- this.inp.options = [];
207
- }
208
- }, 1);
209
- return true;
210
- }
211
- setPosition(): void{
212
- const rect = this.inputDiv.nativeElement.getBoundingClientRect();
213
- const offsetOfBottom = window.innerHeight - rect.bottom;
214
- const height = this.inputOptionsDiv.nativeElement.offsetHeight;
215
- this.top = offsetOfBottom < height;
216
- }
217
- onKeyDown(e): void{
218
- const code = e.keyCode || e.which;
219
- if (code === 9) {
220
- e.preventDefault();
221
- this.cI(e.shiftKey ? 'ShiftTab' : 'Tab');
222
- }
223
- else if (code === 13){
224
- e.preventDefault();
225
- if (this.open){
226
- const h = this.getSelected();
227
- if (!h){
228
- return;
229
- }
230
- this.selectOption(h.value);
231
- }else{
232
- this.cI('Tab');
233
- }
234
- }
235
- else if (code === 40){
236
- e.preventDefault();
237
- if (this.inp.hover + 1 >= this.inp.index){
238
- return;
239
- }
240
- this.inp.hover = this.getHover();
241
- this.setHoverCenter();
242
- }
243
- else if (code === 38){
244
- e.preventDefault();
245
- if (this.inp.hover <= 0){
246
- this.inp.hover = 0;
247
- return;
248
- }
249
- this.inp.hover = this.getHover(-1);
250
- this.setHoverCenter();
251
- }
252
- }
253
- toggleOption(): void{
254
- this.openOptions();
255
- }
256
- selectOption(v, isEdit = false): void{
257
- this.inp.error = null;
258
- const va = this.getValue(v);
259
- this.inp.value = v;
260
- this.inp.hover = va ? va.index : -1;
261
- this.inp.search = va ? va.search : '';
262
- this.cSearch = this.inp.search;
263
- if (this.inp.onChange){
264
- this.inp.onChange(this.inp);
265
- }
266
- if (this.inp.rel){
267
- this.inp.rel.value = null;
268
- this.inp.rel.hover = -1;
269
- this.inp.rel.index = 0;
270
- this.inp.rel.search = '';
271
- this.inp.rel.options = [];
272
- this.inp.rel.url = this.inp.relUrl.replace('{}', this.inp.value);
273
- if (this.inp.rel.type !== InputType.SelectAutoComplete) {
274
- this.inp.rel.load();
275
- }else{
276
- this.inp.rel.url += '_{}';
277
- }
278
- }
279
- const p = va ? va.option.Plaque.split('_') : null;
280
- if (p && p.length === 4) {
281
- this.part1.value = p ? p[0] : '';
282
- this.part2.value = p ? p[1] : '';
283
- this.part2.search = p ? p[1] : '';
284
- this.part3.value = p ? p[2] : '';
285
- this.part4.value = p ? p[3] : '';
286
- } else if (p && p.length === 2) {
287
- this.part1.value = p ? p[0] : '';
288
- this.part3.value = p ? p[1] : '';
289
- }
290
- if (!isEdit){
291
- this.cI('Tab');
292
- }
293
- }
294
- cI(i: string): void{
295
- setTimeout(() => {
296
- this.changeIndex.emit(i);
297
- }, 10);
298
- setTimeout(() => {
299
- this.closeOptions();
300
- }, 20);
301
- }
302
- setHoverCenter(): void {
303
- setTimeout(() => {
304
- const hover: any = $(this.inputOptionsDiv.nativeElement).find('.option.hover');
305
- const items: any = $(this.inputOptionsDiv.nativeElement).find('.items');
306
- if (hover.length === 0){
307
- return;
308
- }
309
- items.scrollTop = items.scrollTop - items.offset.top + hover.offset.top - hover.height();
310
- }, 1);
311
- }
312
- getSelected(o: OptionClass[] = this.inp.options): any{
313
- const h = o.find(x => x.index === this.inp.hover);
314
- if (h){
315
- return h;
316
- }
317
- for (const i of o){
318
- const hi = this.getSelected(i.options);
319
- if (hi){
320
- return hi;
321
- }
322
- }
323
- }
324
- getHover(i = 1, o: OptionClass[] = this.inp.options, h = this.inp.hover): number{
325
- const ho = o.find(x => x.index === h + i);
326
- if (ho){
327
- if (ho.show){
328
- return ho.index;
329
- }else {
330
- h = h + i;
331
- }
332
- }
333
- for (const it of o){
334
- const hi = this.getHover(i, it.options, h);
335
- if (hi){
336
- return hi;
337
- }
338
- }
339
- return 0;
340
- }
341
- getValue(v, o: OptionClass[] = this.inp.options): OptionClass{
342
- const h = o.find(x => x.value === v);
343
- if (h){
344
- return h;
345
- }
346
- for (const i of o){
347
- const hi = this.getValue(v, i.options);
348
- if (hi){
349
- return hi;
350
- }
351
- }
352
- }
353
- plaqueChangeFocus(p, a): void{
354
- if (p === 'Part1'){
355
- if (a === 'Tab' || a === 'Enter'){
356
- this.part2.focus();
357
- } else if (a === 'ShiftTab' || a === 'ShiftEnter'){
358
- this.changeIndex.emit('ShiftTab');
359
- }
360
- } else if (p === 'Part2'){
361
- if (a === 'Tab' || a === 'Enter'){
362
- this.part3.focus();
363
- } else if (a === 'ShiftTab' || a === 'ShiftEnter'){
364
- this.part1.focus();
365
- }
366
- } else if (p === 'Part3'){
367
- if (a === 'Tab' || a === 'Enter'){
368
- this.part4.focus();
369
- } else if (a === 'ShiftTab' || a === 'ShiftEnter'){
370
- this.part2.focus();
371
- }
372
- } else if (p === 'Part4'){
373
- if (a === 'Tab' || a === 'Enter'){
374
- this.changeIndex.emit('Tab');
375
- } else if (a === 'ShiftTab' || a === 'ShiftEnter'){
376
- this.part3.focus();
377
- }
378
- }
379
- }
380
- getSearch(): string{
381
- return this.inp.type === InputType.SelectAutoCompletePlaque ?
382
- `${this.part1.value ? this.part1.value + '_' : ''}${this.part2.value ? this.part2.value + '_' : ''}${this.part3.value ? this.part3.value + '_' : ''}${this.part4.value ? this.part4.value : ''}` :
383
- `${this.part1.value ? this.part1.value + '_' : ''}${this.part3.value ? this.part3.value + '_' : ''}`;
384
- }
385
- }
@@ -1,158 +0,0 @@
1
- .form-input-con.radio {
2
- float: right;
3
- width: 100%;
4
- padding: 0 15px;
5
- position: relative;
6
- }
7
- .form-input-con.radio .form-input {
8
- float: right;
9
- width: 100%;
10
- position: relative;
11
- }
12
-
13
- .form-input-con.radio .form-input .label {
14
- float: right;
15
- width: 100%;
16
- height: 20px;
17
- line-height: 20px;
18
- padding: 0 10px;
19
- font-size: 12px;
20
- margin-bottom: 3px;
21
- cursor: default;
22
- -webkit-user-select: none;
23
- -moz-user-select: none;
24
- -khtml-user-select: none;
25
- -ms-user-select: none;
26
- direction: rtl;
27
- text-align: right;
28
- }
29
-
30
- .form-input-con.radio.error .form-input .label {
31
- font-size: 10px;
32
- color: var(--red);
33
- }
34
-
35
- .form-input-con.radio .form-input .label .required-icon {
36
- height: 20px;
37
- width: 20px;
38
- line-height: 20px;
39
- font-size: 9px;
40
- color: var(--red);
41
- text-align: center;
42
- }
43
-
44
-
45
- .form-input-con.radio .form-input i.icon {
46
- position: absolute;
47
- font-size: 13px;
48
- color: var(--comp);
49
- cursor: default;
50
- bottom: 0;
51
- z-index: 1;
52
- -webkit-transition: all .35s ease-in-out;
53
- transition: all .35s ease-in-out;
54
- width: 35px;
55
- text-align: center;
56
- height: 35px;
57
- line-height: 35px;
58
- left: 0;
59
- }
60
-
61
- .form-input-con.radio .form-input > .control {
62
- display: table;
63
- width: 100%;
64
- height: 35px;
65
- background-color: white;
66
- padding: 0 35px;
67
- border: var(--border-input);
68
- border-radius: 5px;
69
- }
70
-
71
- .form-input-con.radio .form-input .input-base {
72
- position: absolute;
73
- width: 0;
74
- height: 0;
75
- opacity: 0;
76
- cursor: pointer;
77
- top: 50%;
78
- right: 50%;
79
- z-index: 1;
80
- }
81
-
82
- .form-input-con.radio .form-input:hover .control, .form-input-con.radio .form-input .input-base:focus + .control {
83
- outline: none;
84
- border: var(--border-input-dark);
85
- }
86
-
87
- .form-input-con.radio.error .form-input > .control {
88
- border: var(--border-input-red);
89
- }
90
-
91
- .form-input-con.radio.error .form-input i.icon {
92
- color: var(--red);
93
- }
94
-
95
-
96
- .form-input-con.radio .form-input .options {
97
- width: 100%;
98
- text-align: center;
99
- display: table;
100
- height: 100%;
101
- }
102
-
103
- .form-input-con.radio .form-input .option {
104
- text-align: center;
105
- cursor: pointer;
106
- font-size: 11px;
107
- -webkit-user-select: none;
108
- -moz-user-select: none;
109
- -ms-user-select: none;
110
- user-select: none;
111
- position: relative;
112
- float: right;
113
- width: 100%;
114
- justify-content: center;
115
- align-items: center;
116
- display: flex;
117
- }
118
-
119
- .form-input-con.radio .form-input .option-con {
120
- display: table-cell;
121
- position: relative;
122
- height: 100%;
123
- vertical-align: middle;
124
- }
125
-
126
- .form-input-con.radio .form-input .option-con .text {
127
- height: 25px;
128
- line-height: 25px;
129
- margin-right: 10px;
130
- float: right;
131
- padding: 0 20px;
132
- }
133
-
134
- .form-input-con.radio .form-input .option-con input {
135
- position: absolute;
136
- opacity: 0;
137
- cursor: pointer;
138
- right: 0;
139
- }
140
-
141
- .form-input-con.radio .form-input .option-con span:after {
142
- float: right;
143
- height: 30px;
144
- width: 15px;
145
- content: "\f111";
146
- font-family: "Font Awesome 5 Pro";
147
- font-weight: bold;
148
- color: var(--black-33);
149
- line-height: 30px;
150
- font-size: 14px;
151
- }
152
- .form-input-con.radio .form-input .option-con:hover span:after {
153
- color: var(--black-66);
154
- }
155
- .form-input-con.radio .form-input .option-con input:checked ~ span:after {
156
- color: var(--comp);
157
- content: "\f192";
158
- }
@@ -1,16 +0,0 @@
1
- <div #inputDiv [id]="inp.name + 'Input'" [className]="inp.class + ' form-input-con radio' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '')">
2
- <div class="form-input" (click)="onClick()">
3
- <div *ngIf="inp.displayLabel" class="label"><i *ngIf="inp.required" class="fas fa-star-of-life required-icon"></i>{{inp.getLabel()}}</div>
4
- <i *ngIf="inp.icon != null || inp.loading" #inputIcon [className]="(inp.loading ? 'fa-duotone fa-spin fa-spinner' : inp.icon) + ' icon'"></i>
5
- <input #inputBase type="text" class="input-base" (keydown)="onKeyDown($event)" (focusin)="onFocusIn()">
6
- <div class="control">
7
- <div [className]="(o.class ? o.class + ' ' : '') + 'option-con'" *ngFor="let o of inp.options">
8
- <label class="option">
9
- <input [disabled]="inp.disabled" (change)="onChange()" [value]="o.value" [(ngModel)]="inp.value" [checked]="inp.value == o.value" type="radio" [name]="inp.name">
10
- <span></span>
11
- <div class="text">{{inp.l(o.name)}}</div>
12
- </label>
13
- </div>
14
- </div>
15
- </div>
16
- </div>
@@ -1,78 +0,0 @@
1
- import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
2
- import * as $ from 'jquery';
3
- import {InputClass} from '../../../classes/form.class';
4
- import {InputError} from '../../../classes/enum.class';
5
-
6
- @Component({
7
- selector: 'lib-form-radio',
8
- templateUrl: './form.radio.component.html',
9
- styleUrls: ['./form.radio.component.css']
10
- })
11
- export class FormRadioComponent implements OnInit{
12
- @Input()
13
- inp: InputClass;
14
- @Output()
15
- changeIndex = new EventEmitter<string>();
16
- @ViewChild('inputBase') inputBase: ElementRef;
17
- constructor(){
18
- }
19
-
20
- ngOnInit(): void {
21
- this.inp.load();
22
- this.inp.setValue = (v) => {
23
- this.inp.value = v;
24
- if (this.inp.value == null){
25
- this.inp.value = this.inp.options.find(x => true).value;
26
- }
27
- this.onChange();
28
- };
29
- this.inp.setValue(this.inp.value, false);
30
- this.inp.isValid = () => {
31
- this.inp.error = null;
32
- if (this.inp.required && this.inp.value === null) {
33
- this.inp.error = InputError.Required;
34
- return false;
35
- }
36
- return true;
37
- };
38
- this.inp.clear = () => {
39
- this.inp.error = null;
40
- this.inp.setValue(this.inp.default, false);
41
- };
42
- this.inp.data = () => {
43
- return this.inp.value;
44
- };
45
- this.inp.focus = () => {
46
- this.onFocusIn();
47
- };
48
- }
49
-
50
- onClick(): void{
51
- this.onFocusIn();
52
- }
53
- onKeyDown(e): void{
54
- const code = e.keyCode || e.which;
55
- if (code === 9 || code === 13) {
56
- e.preventDefault();
57
- this.changeIndex.emit(e.shiftKey ? 'ShiftTab' : 'Tab');
58
- }
59
- const selected = this.inp.options.findIndex(x => x.value === this.inp.value);
60
- if (code === 37){
61
- const next = (selected >= this.inp.options.length - 1) ? selected : selected + 1;
62
- this.inp.value = this.inp.options[next].value;
63
- }
64
- if (code === 39){
65
- const next = (selected > 0) ? selected - 1 : 0;
66
- this.inp.value = this.inp.options[next].value;
67
- }
68
- }
69
- onChange(): void{
70
- this.inp.error = null;
71
- if (this.inp.onChange){
72
- this.inp.onChange(this.inp);
73
- }
74
- }
75
- onFocusIn(): void{
76
- $(this.inputBase.nativeElement).focus();
77
- }
78
- }