ps-toolkit-ui 0.0.210 → 0.0.211

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/karma.conf.js +32 -0
  2. package/ng-package.json +16 -0
  3. package/package.json +19 -22
  4. package/src/lib/classes/chart.class.ts +140 -0
  5. package/src/lib/classes/enum.class.ts +193 -0
  6. package/src/lib/classes/excel.class.ts +46 -0
  7. package/src/lib/classes/form.class.ts +528 -0
  8. package/src/lib/classes/helper.class.ts +283 -0
  9. package/src/lib/classes/lang.class.ts +32 -0
  10. package/src/lib/classes/login.class.ts +27 -0
  11. package/src/lib/classes/modal.class.ts +59 -0
  12. package/src/lib/classes/permission.class.ts +55 -0
  13. package/src/lib/classes/request.class.ts +255 -0
  14. package/src/lib/classes/safestyle.class.ts +4 -0
  15. package/src/lib/classes/sidebar.class.ts +20 -0
  16. package/src/lib/classes/steps.class.ts +19 -0
  17. package/src/lib/classes/string.class.ts +219 -0
  18. package/src/lib/classes/table.class.ts +228 -0
  19. package/src/lib/components/accordion/accordion.component.css +116 -0
  20. package/src/lib/components/accordion/accordion.component.html +19 -0
  21. package/src/lib/components/accordion/accordion.component.ts +41 -0
  22. package/src/lib/components/alert/alert.component.css +112 -0
  23. package/src/lib/components/alert/alert.component.html +1 -0
  24. package/src/lib/components/alert/alert.component.ts +35 -0
  25. package/src/lib/components/base.component.ts +38 -0
  26. package/src/lib/components/calendar/calendar.component.css +206 -0
  27. package/src/lib/components/calendar/calendar.component.html +36 -0
  28. package/src/lib/components/calendar/calendar.component.ts +99 -0
  29. package/src/lib/components/chart/chart.component.css +24 -0
  30. package/src/lib/components/chart/chart.component.html +6 -0
  31. package/src/lib/components/chart/chart.component.ts +14 -0
  32. package/src/lib/components/clock/clock.component.css +141 -0
  33. package/src/lib/components/clock/clock.component.html +10 -0
  34. package/src/lib/components/clock/clock.component.ts +37 -0
  35. package/src/lib/components/confirm/confirm.component.css +112 -0
  36. package/src/lib/components/confirm/confirm.component.html +1 -0
  37. package/src/lib/components/confirm/confirm.component.ts +47 -0
  38. package/src/lib/components/footer/footer.component.css +46 -0
  39. package/src/lib/components/footer/footer.component.html +9 -0
  40. package/src/lib/components/footer/footer.component.ts +18 -0
  41. package/src/lib/components/form/bank-card/form.bank-card.component.css +115 -0
  42. package/src/lib/components/form/bank-card/form.bank-card.component.html +13 -0
  43. package/src/lib/components/form/bank-card/form.bank-card.component.ts +144 -0
  44. package/src/lib/components/form/button/form.button.component.css +222 -0
  45. package/src/lib/components/form/button/form.button.component.html +16 -0
  46. package/src/lib/components/form/button/form.button.component.ts +65 -0
  47. package/src/lib/components/form/car/form.car.component.css +287 -0
  48. package/src/lib/components/form/car/form.car.component.html +11 -0
  49. package/src/lib/components/form/car/form.car.component.ts +82 -0
  50. package/src/lib/components/form/car/search/form.car.search.component.css +287 -0
  51. package/src/lib/components/form/car/search/form.car.search.component.html +15 -0
  52. package/src/lib/components/form/car/search/form.car.search.component.ts +170 -0
  53. package/src/lib/components/form/checkbox/form.checkbox.component.css +128 -0
  54. package/src/lib/components/form/checkbox/form.checkbox.component.html +8 -0
  55. package/src/lib/components/form/checkbox/form.checkbox.component.ts +64 -0
  56. package/src/lib/components/form/date/form.date.component.css +310 -0
  57. package/src/lib/components/form/date/form.date.component.html +46 -0
  58. package/src/lib/components/form/date/form.date.component.ts +247 -0
  59. package/src/lib/components/form/datetime/form.datetime.component.css +157 -0
  60. package/src/lib/components/form/datetime/form.datetime.component.html +11 -0
  61. package/src/lib/components/form/datetime/form.datetime.component.ts +98 -0
  62. package/src/lib/components/form/file/form.file.component.css +151 -0
  63. package/src/lib/components/form/file/form.file.component.html +12 -0
  64. package/src/lib/components/form/file/form.file.component.ts +130 -0
  65. package/src/lib/components/form/finger/form.finger.component.css +215 -0
  66. package/src/lib/components/form/finger/form.finger.component.html +59 -0
  67. package/src/lib/components/form/finger/form.finger.component.ts +131 -0
  68. package/src/lib/components/form/hidden/form.hidden.component.css +0 -0
  69. package/src/lib/components/form/hidden/form.hidden.component.html +0 -0
  70. package/src/lib/components/form/hidden/form.hidden.component.ts +29 -0
  71. package/src/lib/components/form/icon/form.icon.component.css +108 -0
  72. package/src/lib/components/form/icon/form.icon.component.html +14 -0
  73. package/src/lib/components/form/icon/form.icon.component.ts +73 -0
  74. package/src/lib/components/form/index/form.component.css +89 -0
  75. package/src/lib/components/form/index/form.component.html +35 -0
  76. package/src/lib/components/form/index/form.component.ts +45 -0
  77. package/src/lib/components/form/label/form.label.component.css +45 -0
  78. package/src/lib/components/form/label/form.label.component.html +2 -0
  79. package/src/lib/components/form/label/form.label.component.ts +30 -0
  80. package/src/lib/components/form/plaque/form.plaque.component.css +76 -0
  81. package/src/lib/components/form/plaque/form.plaque.component.html +10 -0
  82. package/src/lib/components/form/plaque/form.plaque.component.ts +178 -0
  83. package/src/lib/components/form/plaque/select/form.plaque.select.component.css +167 -0
  84. package/src/lib/components/form/plaque/select/form.plaque.select.component.html +19 -0
  85. package/src/lib/components/form/plaque/select/form.plaque.select.component.ts +385 -0
  86. package/src/lib/components/form/radio/form.radio.component.css +158 -0
  87. package/src/lib/components/form/radio/form.radio.component.html +16 -0
  88. package/src/lib/components/form/radio/form.radio.component.ts +78 -0
  89. package/src/lib/components/form/select/form.select.component.css +326 -0
  90. package/src/lib/components/form/select/form.select.component.html +16 -0
  91. package/src/lib/components/form/select/form.select.component.ts +358 -0
  92. package/src/lib/components/form/select/item/form.select.item.component.css +59 -0
  93. package/src/lib/components/form/select/item/form.select.item.component.html +10 -0
  94. package/src/lib/components/form/select/item/form.select.item.component.ts +40 -0
  95. package/src/lib/components/form/table/form.table.component.css +50 -0
  96. package/src/lib/components/form/table/form.table.component.html +8 -0
  97. package/src/lib/components/form/table/form.table.component.ts +94 -0
  98. package/src/lib/components/form/textarea/form.textarea.component.css +109 -0
  99. package/src/lib/components/form/textarea/form.textarea.component.html +10 -0
  100. package/src/lib/components/form/textarea/form.textarea.component.ts +76 -0
  101. package/src/lib/components/form/textbox/form.textbox.component.css +296 -0
  102. package/src/lib/components/form/textbox/form.textbox.component.html +13 -0
  103. package/src/lib/components/form/textbox/form.textbox.component.ts +185 -0
  104. package/src/lib/components/form/time/form.time.component.css +205 -0
  105. package/src/lib/components/form/time/form.time.component.html +22 -0
  106. package/src/lib/components/form/time/form.time.component.ts +139 -0
  107. package/src/lib/components/form/tree/form.tree.component.css +109 -0
  108. package/src/lib/components/form/tree/form.tree.component.html +11 -0
  109. package/src/lib/components/form/tree/form.tree.component.ts +98 -0
  110. package/src/lib/components/form/tree/item/form.tree.item.component.css +142 -0
  111. package/src/lib/components/form/tree/item/form.tree.item.component.html +9 -0
  112. package/src/lib/components/form/tree/item/form.tree.item.component.ts +49 -0
  113. package/src/lib/components/header/header.component.css +57 -0
  114. package/src/lib/components/header/header.component.html +5 -0
  115. package/src/lib/components/header/header.component.ts +28 -0
  116. package/src/lib/components/header/sub/sub.header.component.css +62 -0
  117. package/src/lib/components/header/sub/sub.header.component.html +8 -0
  118. package/src/lib/components/header/sub/sub.header.component.ts +11 -0
  119. package/src/lib/components/layout/layout.component.css +300 -0
  120. package/src/lib/components/layout/layout.component.html +20 -0
  121. package/src/lib/components/layout/layout.component.ts +21 -0
  122. package/src/lib/components/loading/loading.component.css +39 -0
  123. package/src/lib/components/loading/loading.component.html +8 -0
  124. package/src/lib/components/loading/loading.component.ts +18 -0
  125. package/src/lib/components/login/login.component.css +389 -0
  126. package/src/lib/components/login/login.component.html +27 -0
  127. package/src/lib/components/login/login.component.ts +145 -0
  128. package/src/lib/components/modal/modal.component.css +60 -0
  129. package/src/lib/components/modal/modal.component.html +12 -0
  130. package/src/lib/components/modal/modal.component.ts +23 -0
  131. package/src/lib/components/notfound/notfound.component.css +134 -0
  132. package/src/lib/components/notfound/notfound.component.html +10 -0
  133. package/src/lib/components/notfound/notfound.component.ts +25 -0
  134. package/src/lib/components/notification/notification.component.css +45 -0
  135. package/src/lib/components/notification/notification.component.html +2 -0
  136. package/src/lib/components/notification/notification.component.ts +11 -0
  137. package/src/lib/components/sidebar/item/sidebar.item.component.css +236 -0
  138. package/src/lib/components/sidebar/item/sidebar.item.component.html +16 -0
  139. package/src/lib/components/sidebar/item/sidebar.item.component.ts +54 -0
  140. package/src/lib/components/sidebar/sidebar.component.css +42 -0
  141. package/src/lib/components/sidebar/sidebar.component.html +10 -0
  142. package/src/lib/components/sidebar/sidebar.component.ts +60 -0
  143. package/src/lib/components/steps/steps.component.css +320 -0
  144. package/src/lib/components/steps/steps.component.html +18 -0
  145. package/src/lib/components/steps/steps.component.ts +44 -0
  146. package/src/lib/components/table/loading/table.loading.component.css +29 -0
  147. package/src/lib/components/table/loading/table.loading.component.html +9 -0
  148. package/src/lib/components/table/loading/table.loading.component.ts +14 -0
  149. package/src/lib/components/table/pagination/table.pagination.component.css +138 -0
  150. package/src/lib/components/table/pagination/table.pagination.component.html +9 -0
  151. package/src/lib/components/table/pagination/table.pagination.component.ts +89 -0
  152. package/src/lib/components/table/report/table.report.component.css +125 -0
  153. package/src/lib/components/table/report/table.report.component.html +19 -0
  154. package/src/lib/components/table/report/table.report.component.ts +238 -0
  155. package/src/lib/components/table/row/table.row.component.css +170 -0
  156. package/src/lib/components/table/row/table.row.component.html +21 -0
  157. package/src/lib/components/table/row/table.row.component.ts +373 -0
  158. package/src/lib/components/table/table.component.css +116 -0
  159. package/src/lib/components/table/table.component.html +62 -0
  160. package/src/lib/components/table/table.component.ts +180 -0
  161. package/src/lib/components/tooltip/tooltip.component.css +159 -0
  162. package/src/lib/components/tooltip/tooltip.component.html +1 -0
  163. package/src/lib/components/tooltip/tooltip.component.ts +15 -0
  164. package/src/lib/ps-toolkit-ui.module.ts +94 -0
  165. package/src/lib/services/config.service.ts +8 -0
  166. package/{public-api.d.ts → src/public-api.ts} +53 -48
  167. package/src/test.ts +26 -0
  168. package/tsconfig.lib.json +25 -0
  169. package/tsconfig.lib.prod.json +10 -0
  170. package/tsconfig.spec.json +17 -0
  171. package/tslint.json +17 -0
  172. package/bundles/ps-toolkit-ui.umd.js +0 -7646
  173. package/bundles/ps-toolkit-ui.umd.js.map +0 -1
  174. package/bundles/ps-toolkit-ui.umd.min.js +0 -2
  175. package/bundles/ps-toolkit-ui.umd.min.js.map +0 -1
  176. package/esm2015/lib/classes/chart.class.js +0 -140
  177. package/esm2015/lib/classes/enum.class.js +0 -187
  178. package/esm2015/lib/classes/form.class.js +0 -481
  179. package/esm2015/lib/classes/helper.class.js +0 -284
  180. package/esm2015/lib/classes/lang.class.js +0 -32
  181. package/esm2015/lib/classes/login.class.js +0 -22
  182. package/esm2015/lib/classes/modal.class.js +0 -52
  183. package/esm2015/lib/classes/permission.class.js +0 -61
  184. package/esm2015/lib/classes/request.class.js +0 -256
  185. package/esm2015/lib/classes/safestyle.class.js +0 -15
  186. package/esm2015/lib/classes/sidebar.class.js +0 -14
  187. package/esm2015/lib/classes/steps.class.js +0 -20
  188. package/esm2015/lib/classes/string.class.js +0 -220
  189. package/esm2015/lib/classes/table.class.js +0 -215
  190. package/esm2015/lib/components/accordion/accordion.component.js +0 -45
  191. package/esm2015/lib/components/alert/alert.component.js +0 -39
  192. package/esm2015/lib/components/base.component.js +0 -45
  193. package/esm2015/lib/components/calendar/calendar.component.js +0 -97
  194. package/esm2015/lib/components/chart/chart.component.js +0 -17
  195. package/esm2015/lib/components/clock/clock.component.js +0 -33
  196. package/esm2015/lib/components/confirm/confirm.component.js +0 -50
  197. package/esm2015/lib/components/footer/footer.component.js +0 -23
  198. package/esm2015/lib/components/form/bank-card/form.bank-card.component.js +0 -148
  199. package/esm2015/lib/components/form/button/form.button.component.js +0 -68
  200. package/esm2015/lib/components/form/car/form.car.component.js +0 -84
  201. package/esm2015/lib/components/form/car/search/form.car.search.component.js +0 -172
  202. package/esm2015/lib/components/form/checkbox/form.checkbox.component.js +0 -66
  203. package/esm2015/lib/components/form/date/form.date.component.js +0 -254
  204. package/esm2015/lib/components/form/datetime/form.datetime.component.js +0 -104
  205. package/esm2015/lib/components/form/file/form.file.component.js +0 -133
  206. package/esm2015/lib/components/form/finger/form.finger.component.js +0 -138
  207. package/esm2015/lib/components/form/hidden/form.hidden.component.js +0 -31
  208. package/esm2015/lib/components/form/icon/form.icon.component.js +0 -76
  209. package/esm2015/lib/components/form/index/form.component.js +0 -48
  210. package/esm2015/lib/components/form/label/form.label.component.js +0 -32
  211. package/esm2015/lib/components/form/plaque/form.plaque.component.js +0 -176
  212. package/esm2015/lib/components/form/plaque/select/form.plaque.select.component.js +0 -390
  213. package/esm2015/lib/components/form/radio/form.radio.component.js +0 -79
  214. package/esm2015/lib/components/form/select/form.select.component.js +0 -374
  215. package/esm2015/lib/components/form/select/item/form.select.item.component.js +0 -43
  216. package/esm2015/lib/components/form/table/form.table.component.js +0 -98
  217. package/esm2015/lib/components/form/textarea/form.textarea.component.js +0 -78
  218. package/esm2015/lib/components/form/textbox/form.textbox.component.js +0 -186
  219. package/esm2015/lib/components/form/time/form.time.component.js +0 -145
  220. package/esm2015/lib/components/form/tree/form.tree.component.js +0 -99
  221. package/esm2015/lib/components/form/tree/item/form.tree.item.component.js +0 -48
  222. package/esm2015/lib/components/header/header.component.js +0 -33
  223. package/esm2015/lib/components/header/sub/sub.header.component.js +0 -14
  224. package/esm2015/lib/components/layout/layout.component.js +0 -25
  225. package/esm2015/lib/components/loading/loading.component.js +0 -22
  226. package/esm2015/lib/components/login/login.component.js +0 -148
  227. package/esm2015/lib/components/modal/modal.component.js +0 -25
  228. package/esm2015/lib/components/notfound/notfound.component.js +0 -29
  229. package/esm2015/lib/components/notification/notification.component.js +0 -14
  230. package/esm2015/lib/components/sidebar/item/sidebar.item.component.js +0 -53
  231. package/esm2015/lib/components/sidebar/sidebar.component.js +0 -67
  232. package/esm2015/lib/components/steps/steps.component.js +0 -51
  233. package/esm2015/lib/components/table/loading/table.loading.component.js +0 -17
  234. package/esm2015/lib/components/table/pagination/table.pagination.component.js +0 -84
  235. package/esm2015/lib/components/table/report/table.report.component.js +0 -246
  236. package/esm2015/lib/components/table/row/table.row.component.js +0 -379
  237. package/esm2015/lib/components/table/table.component.js +0 -179
  238. package/esm2015/lib/components/tooltip/tooltip.component.js +0 -19
  239. package/esm2015/lib/ps-toolkit-ui.module.js +0 -95
  240. package/esm2015/lib/services/config.service.js +0 -14
  241. package/esm2015/ps-toolkit-ui.js +0 -20
  242. package/esm2015/public-api.js +0 -52
  243. package/fesm2015/ps-toolkit-ui.js +0 -6566
  244. package/fesm2015/ps-toolkit-ui.js.map +0 -1
  245. package/lib/classes/chart.class.d.ts +0 -11
  246. package/lib/classes/enum.class.d.ts +0 -158
  247. package/lib/classes/form.class.d.ts +0 -173
  248. package/lib/classes/helper.class.d.ts +0 -28
  249. package/lib/classes/lang.class.d.ts +0 -5
  250. package/lib/classes/login.class.d.ts +0 -17
  251. package/lib/classes/modal.class.d.ts +0 -19
  252. package/lib/classes/permission.class.d.ts +0 -31
  253. package/lib/classes/request.class.d.ts +0 -12
  254. package/lib/classes/safestyle.class.d.ts +0 -7
  255. package/lib/classes/sidebar.class.d.ts +0 -11
  256. package/lib/classes/steps.class.d.ts +0 -17
  257. package/lib/classes/string.class.d.ts +0 -218
  258. package/lib/classes/table.class.d.ts +0 -69
  259. package/lib/components/accordion/accordion.component.d.ts +0 -7
  260. package/lib/components/alert/alert.component.d.ts +0 -10
  261. package/lib/components/base.component.d.ts +0 -14
  262. package/lib/components/calendar/calendar.component.d.ts +0 -26
  263. package/lib/components/chart/chart.component.d.ts +0 -5
  264. package/lib/components/clock/clock.component.d.ts +0 -11
  265. package/lib/components/confirm/confirm.component.d.ts +0 -14
  266. package/lib/components/footer/footer.component.d.ts +0 -6
  267. package/lib/components/form/bank-card/form.bank-card.component.d.ts +0 -22
  268. package/lib/components/form/button/form.button.component.d.ts +0 -15
  269. package/lib/components/form/car/form.car.component.d.ts +0 -16
  270. package/lib/components/form/car/search/form.car.search.component.d.ts +0 -17
  271. package/lib/components/form/checkbox/form.checkbox.component.d.ts +0 -14
  272. package/lib/components/form/date/form.date.component.d.ts +0 -42
  273. package/lib/components/form/datetime/form.datetime.component.d.ts +0 -13
  274. package/lib/components/form/file/form.file.component.d.ts +0 -17
  275. package/lib/components/form/finger/form.finger.component.d.ts +0 -15
  276. package/lib/components/form/hidden/form.hidden.component.d.ts +0 -7
  277. package/lib/components/form/icon/form.icon.component.d.ts +0 -15
  278. package/lib/components/form/index/form.component.d.ts +0 -10
  279. package/lib/components/form/label/form.label.component.d.ts +0 -8
  280. package/lib/components/form/plaque/form.plaque.component.d.ts +0 -22
  281. package/lib/components/form/plaque/select/form.plaque.select.component.d.ts +0 -36
  282. package/lib/components/form/radio/form.radio.component.d.ts +0 -13
  283. package/lib/components/form/select/form.select.component.d.ts +0 -39
  284. package/lib/components/form/select/item/form.select.item.component.d.ts +0 -12
  285. package/lib/components/form/table/form.table.component.d.ts +0 -9
  286. package/lib/components/form/textarea/form.textarea.component.d.ts +0 -13
  287. package/lib/components/form/textbox/form.textbox.component.d.ts +0 -20
  288. package/lib/components/form/time/form.time.component.d.ts +0 -25
  289. package/lib/components/form/tree/form.tree.component.d.ts +0 -16
  290. package/lib/components/form/tree/item/form.tree.item.component.d.ts +0 -17
  291. package/lib/components/header/header.component.d.ts +0 -9
  292. package/lib/components/header/sub/sub.header.component.d.ts +0 -3
  293. package/lib/components/layout/layout.component.d.ts +0 -8
  294. package/lib/components/loading/loading.component.d.ts +0 -5
  295. package/lib/components/login/login.component.d.ts +0 -13
  296. package/lib/components/modal/modal.component.d.ts +0 -9
  297. package/lib/components/notfound/notfound.component.d.ts +0 -8
  298. package/lib/components/notification/notification.component.d.ts +0 -3
  299. package/lib/components/sidebar/item/sidebar.item.component.d.ts +0 -14
  300. package/lib/components/sidebar/sidebar.component.d.ts +0 -19
  301. package/lib/components/steps/steps.component.d.ts +0 -10
  302. package/lib/components/table/loading/table.loading.component.d.ts +0 -5
  303. package/lib/components/table/pagination/table.pagination.component.d.ts +0 -15
  304. package/lib/components/table/report/table.report.component.d.ts +0 -34
  305. package/lib/components/table/row/table.row.component.d.ts +0 -34
  306. package/lib/components/table/table.component.d.ts +0 -40
  307. package/lib/components/tooltip/tooltip.component.d.ts +0 -5
  308. package/lib/ps-toolkit-ui.module.d.ts +0 -4
  309. package/lib/services/config.service.d.ts +0 -6
  310. package/ps-toolkit-ui.d.ts +0 -19
  311. package/ps-toolkit-ui.metadata.json +0 -1
@@ -0,0 +1,326 @@
1
+ .form-input-con.select {
2
+ position: relative;
3
+ float: right;
4
+ width: 100%;
5
+ padding: 0 15px;
6
+ font-size: 12px;
7
+ -webkit-user-select: none;
8
+ -moz-user-select: none;
9
+ -khtml-user-select: none;
10
+ -ms-user-select: none;
11
+ }
12
+ .form-input-con.select.plaque {
13
+ width: 185px!important;
14
+ }
15
+
16
+ .form-input-con.select > .form-input{
17
+ float: right;
18
+ width: 100%;
19
+ position: relative;
20
+ }
21
+ .form-input-con.select > .form-input > .label {
22
+ float: right;
23
+ width: 100%;
24
+ height: 20px;
25
+ line-height: 20px;
26
+ padding: 0 10px;
27
+ font-size: 12px;
28
+ margin-bottom: 3px;
29
+ cursor: default;
30
+ -webkit-user-select: none;
31
+ -moz-user-select: none;
32
+ -khtml-user-select: none;
33
+ -ms-user-select: none;
34
+ direction: rtl;
35
+ text-align: right;
36
+ }
37
+ .form-input-con.select.error > .form-input > .label {
38
+ font-size: 10px;
39
+ color: var(--red);
40
+ }
41
+ .form-input-con.select > .form-input > .label .required-icon{
42
+ height: 20px;
43
+ width: 20px;
44
+ line-height: 20px;
45
+ font-size: 9px;
46
+ color: var(--red);
47
+ text-align: center;
48
+ }
49
+ .form-input-con.select > .form-input .without-search {
50
+ position: absolute;
51
+ width: 100%;
52
+ height: 100%;
53
+ top: 0;
54
+ right: 0;
55
+ z-index: 3;
56
+ cursor: pointer;
57
+ }
58
+ .form-input-con.select > .form-input .control {
59
+ display: block;
60
+ width: 100%;
61
+ height: 35px;
62
+ padding: 5px 35px;
63
+ font-family: Vazir;
64
+ color: var(--black);
65
+ background-image: none;
66
+ border-radius: 5px;
67
+ text-align: center;
68
+ background-color: white;
69
+ font-size: 11px;
70
+ border: var(--border-input);
71
+ }
72
+
73
+ .form-input-con.select > .form-input:hover .control, .form-input-con.select > .form-input .control:focus {
74
+ outline: none;
75
+ border: 1px solid var(--black-88);
76
+ }
77
+
78
+ .form-input-con.select > .form-input .control:focus {
79
+ border-radius: 5px 5px 0 0;
80
+ outline: none;
81
+ }
82
+ .form-input-con.select.error > .form-input .control {
83
+ border: var(--border-input-red);
84
+ }
85
+
86
+ .form-input-con.select.error > .form-input .control, .form-input-con.select.error > .form-input i.icon {
87
+ color: var(--red);
88
+ }
89
+ .form-input-con.select.error > .form-input:hover .control, .form-input-con.select.error > .form-input .control:focus {
90
+ border: var(--border-input-red-dark);
91
+ }
92
+
93
+ .form-input-con.select.top > .form-input .control:focus {
94
+ border-radius: 0 0 5px 5px;
95
+ outline: none;
96
+ }
97
+
98
+ .form-input-con.select > .form-input i.icon {
99
+ position: absolute;
100
+ width: 35px;
101
+ font-size: 15px;
102
+ color: var(--comp);
103
+ text-align: center;
104
+ height: 35px;
105
+ line-height: 35px;
106
+ left: 0;
107
+ bottom: 0;
108
+ z-index: 1;
109
+ }
110
+ .form-input-con.select > .form-input i.clear-icon {
111
+ position: absolute;
112
+ width: 35px;
113
+ font-size: 15px;
114
+ color: var(--red);
115
+ cursor: pointer;
116
+ text-align: center;
117
+ height: 35px;
118
+ line-height: 35px;
119
+ right: 0;
120
+ bottom: 0;
121
+ z-index: 1;
122
+ }
123
+
124
+ .form-input-con.select > .form-input .options {
125
+ position: absolute;
126
+ width: 100%;
127
+ background-color: white;
128
+ border-radius: 0 0 5px 5px;
129
+ top: -200000px;
130
+ right: 0;
131
+ z-index: 5;
132
+ overflow: hidden;
133
+ cursor: pointer;
134
+ border: var(--border-input);
135
+ }
136
+ .form-input-con.select > .form-input .control:focus + .options {
137
+ top: 35px !important;
138
+ }
139
+
140
+ .form-input-con.select.top > .form-input .control:focus + .options {
141
+ border-radius: 5px 5px 0 0;
142
+ bottom: 35px;
143
+ top: unset !important;
144
+ }
145
+
146
+ .form-input-con.select > .form-input .options .items {
147
+ float: right;
148
+ width: 100%;
149
+ max-height: 200px;
150
+ overflow-y: auto;
151
+ scroll-behavior: smooth;
152
+ }
153
+
154
+ .form-input-con.select > .form-input .options .option {
155
+ float: right;
156
+ width: 100%;
157
+ height: 35px;
158
+ line-height: 35px;
159
+ text-align: center;
160
+ font-size: 11px;
161
+ border-radius: 0;
162
+ }
163
+ .form-input-con.select .tags {
164
+ float: right;
165
+ width: 100%;
166
+ }
167
+ .form-input-con.select .tags .tag-con{
168
+ float: right;
169
+ width: auto;
170
+ padding: 5px;
171
+ }
172
+ .form-input-con.select .tags .tag-con .tag{
173
+ float: right;
174
+ width: auto;
175
+ position: relative;
176
+ background-color: var(--base);
177
+ color: white;
178
+ height: 25px;
179
+ line-height: 25px;
180
+ font-size: 12px;
181
+ border-radius: 5px;
182
+ overflow: hidden;
183
+ }
184
+ .form-input-con.select .tags .tag-con .tag > .label{
185
+ float: right;
186
+ width: auto;
187
+ padding: 0 5px 0 10px;
188
+ }
189
+ .form-input-con.select .tags .tag-con .tag > .delete{
190
+ float: right;
191
+ width: 25px;
192
+ text-align: center;
193
+ line-height: 25px;
194
+ cursor: pointer;
195
+ }
196
+ .form-input-con.select .tags .tag-con .tag > .delete:hover{
197
+ background-color: var(--base-dark);
198
+ }
199
+ .form-input-con.select.h-50 > .form-input .control {
200
+ height: 50px;
201
+ line-height: 50px;
202
+ }
203
+
204
+ .form-input-con.select.h-50 > .form-input .control:focus + .options {
205
+ top: 50px !important;
206
+ }
207
+
208
+ .form-input-con.select.h-50.top > .form-input .options {
209
+ top: unset !important;
210
+ bottom: 50px;
211
+ }
212
+ .form-input-con.select.h-25, .form-input-con.select.h-25 > .form-input .control {
213
+ height: 25px;
214
+ line-height: 25px;
215
+ padding: 0;
216
+ }
217
+
218
+ .form-input-con.select.h-25 > .form-input i.icon {
219
+ height: 25px;
220
+ width: 25px;
221
+ line-height: 25px;
222
+ }
223
+
224
+ .form-input-con.select.h-25 > .form-input .control:focus + .options {
225
+ top: 25px !important;
226
+ }
227
+
228
+ .form-input-con.select.h-25.top > .form-input .control:focus + .options {
229
+ border-radius: 5px 5px 0 0;
230
+ bottom: 25px;
231
+ top: unset !important;
232
+ }
233
+ .form-input-con.select.h-30, .form-input-con.select.h-30 > .form-input .control {
234
+ height: 30px;
235
+ line-height: 30px;
236
+ padding: 0;
237
+ }
238
+
239
+ .form-input-con.select.h-30 > .form-input i.icon {
240
+ height: 30px;
241
+ width: 30px;
242
+ line-height: 30px;
243
+ }
244
+
245
+ .form-input-con.select.h-30 > .form-input .control:focus + .options {
246
+ top: 30px !important;
247
+ }
248
+
249
+ .form-input-con.select.h-30.top > .form-input .control:focus + .options {
250
+ border-radius: 5px 5px 0 0;
251
+ bottom: 30px;
252
+ top: unset !important;
253
+ }
254
+
255
+ ::ng-deep .form-input-con.select.h-30 > .form-input .options .option {
256
+ height: 30px;
257
+ line-height: 30px;
258
+ font-size: 12px;
259
+ }
260
+
261
+ .form-input-con.select.h-45, .form-input-con.select.h-45 > .form-input .control {
262
+ height: 45px;
263
+ line-height: 45px;
264
+ padding: 0;
265
+ }
266
+ .form-input-con.select.h-45 > .form-input .control::-moz-placeholder, .form-input-con.select.h-45 > .form-input .control::-webkit-input-placeholder {
267
+ font-size: 12px;
268
+ }
269
+ .form-input-con.select.h-45 > .form-input i.icon {
270
+ height: 45px;
271
+ width: 45px;
272
+ line-height: 45px;
273
+ }
274
+
275
+ .form-input-con.select.h-45 > .form-input .control:focus + .options {
276
+ top: 45px !important;
277
+ }
278
+
279
+ .form-input-con.select.h-45.top > .form-input .control:focus + .options {
280
+ border-radius: 5px 5px 0 0;
281
+ bottom: 45px;
282
+ top: unset !important;
283
+ }
284
+
285
+ ::ng-deep .form-input-con.select.h-45 > .form-input .options .option {
286
+ min-height: 40px;
287
+ font-size: 12px;
288
+ }
289
+
290
+ .form-input-con.select.without-icon.h-25 > .form-input .control {
291
+ padding: 0;
292
+ }
293
+ .form-input-con.select.without-icon.h-30 > .form-input .control {
294
+ padding: 0;
295
+ }
296
+ .form-input-con.select.h-30 > .form-input i.icon {
297
+ font-size: 11px;
298
+ }
299
+
300
+
301
+ ::ng-deep .form-input-con.select.without-sub-options > .form-input .options .option {
302
+ width: 100%;
303
+ }
304
+
305
+ .form-input-con.select.disabled > .form-input .control, .form-input-con.select.disabled > .form-input span.icon, .form-input-con.select.disabled > .form-input .label {
306
+ cursor: default;
307
+ box-shadow: unset;
308
+ opacity: 0.7;
309
+ filter: blur(0.5px);
310
+ -webkit-user-select: none;
311
+ -moz-user-select: none;
312
+ -khtml-user-select: none;
313
+ -ms-user-select: none;
314
+ }
315
+ .form-input-con.select.plaque-part-2 > .form-input .control {
316
+ border: none !important;
317
+ }
318
+ .form-input-con.select.plaque-part-2{
319
+ width: 35px!important;
320
+ padding: 0!important;
321
+ float: left;
322
+ }
323
+ .form-input-con.select.plaque-part-2.plaque-part-m{
324
+ display: none!important;
325
+ }
326
+
@@ -0,0 +1,16 @@
1
+ <div #inputDiv [id]="inp.name + 'Input'" [style]="inp.style" [className]="inp.class + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + (inp.icon != null ? '' : ' without-icon') + ' form-input-con select'">
2
+ <div class="form-input" (click)="toggleOption($event)">
3
+ <div *ngIf="inp.displayLabel" class="label"><i *ngIf="inp.required" class="f-r fas fa-star-of-life required-icon"></i><span class="f-r" [innerHTML]="inp.getLabel()"></span></div>
4
+ <div class="w-100 p-r">
5
+ <div *ngIf="inp.type === type.Select" class="without-search"></div>
6
+ <i *ngIf="inp.icon != null || inp.loading" #inputIcon [className]="(inp.loading ? 'fa-duotone fa-spin fa-spinner' : inp.icon) + ' icon'"></i>
7
+ <i *ngIf="inp.withClear && inp.value" (click)="inp.clear()" class="fa-duotone fa-eraser clear-icon"></i>
8
+ <input (keydown)="onKeyDown($event)" (focusout)="onFocusOut()" (keyup)="onKeyUp($event)" [disabled]="inp.disabled" [(ngModel)]="inp.search" [placeholder]="inp.placeholder ? inp.l(inp.placeholder) : ''" #inputBase type="text" [name]="inp.name" class="control" autocomplete="off" [readOnly]="inp.type === type.Select" [maxLength]="inp.maxLength > 0 ? inp.maxLength : 524288">
9
+ <div #inputOptionsDiv class="options">
10
+ <div class="items">
11
+ <lib-form-select-item (selectOption)="selectOption($event)" [index]="1" [select]="inp" [item]="opt" *ngFor="let opt of inp.options"></lib-form-select-item>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
@@ -0,0 +1,358 @@
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-select',
8
+ templateUrl: './form.select.component.html',
9
+ styleUrls: ['./form.select.component.css']
10
+ })
11
+ export class FormSelectComponent implements OnInit{
12
+ @Output()
13
+ changeIndex = new EventEmitter<string>();
14
+ @Input()
15
+ inp: InputClass;
16
+ @Input()
17
+ inForm: boolean;
18
+ cSearch = '';
19
+ get type(): typeof InputType { return InputType; }
20
+ @ViewChild('inputDiv') inputDiv: ElementRef;
21
+ @ViewChild('inputBase') inputBase: ElementRef;
22
+ @ViewChild('inputOptionsDiv') inputOptionsDiv: ElementRef;
23
+ @ViewChild('inputLabel') inputLabel: ElementRef;
24
+ ngOnInit(): void{
25
+ if (this.inp.type !== InputType.SelectAutoComplete){
26
+ this.inp.load();
27
+ }
28
+ this.inp.setValue = (v, isEdit) => {
29
+ if (!this.inp.multiple){
30
+ this.selectOption(v == null ? null : v.toString(), isEdit);
31
+ }else{
32
+ for (const t of v){
33
+ this.selectOption(t.toString(), isEdit);
34
+ }
35
+ }
36
+ };
37
+ if (this.inp.default != null){
38
+ this.inp.setValue(this.inp.default, false);
39
+ }
40
+ this.inp.setSearch = (s) => {
41
+ this.inp.search = s;
42
+ };
43
+ this.inp.focus = () => {
44
+ this.openOptions();
45
+ };
46
+ this.inp.isValid = () => {
47
+ this.inp.error = null;
48
+ if (this.inp.required && ((!this.inp.multiple && ((this.inp.addNew && !this.inp.search) || (!this.inp.addNew && !this.inp.value))) ||
49
+ (this.inp.multiple && this.getSelected().length === 0))) {
50
+ this.inp.error = InputError.Required;
51
+ return false;
52
+ }
53
+ return true;
54
+ };
55
+ this.inp.clear = () => {
56
+ this.inp.error = null;
57
+ if (!this.inp.multiple){
58
+ this.inp.setValue(this.inp.default, true);
59
+ }else{
60
+ this.inp.options.forEach(x => this.unCheck(x));
61
+ }
62
+ if (this.inp.rel != null){
63
+ this.inp.rel.options = [];
64
+ }
65
+ if (this.inp.type === InputType.SelectAutoComplete){
66
+ this.inp.options = [];
67
+ }
68
+ };
69
+ this.inp.data = () => {
70
+ return !this.inp.multiple ? (this.inp.addNew ? this.inp.search : this.inp.value) : this.getSelected();
71
+ };
72
+ this.inp.focusOut = () => {
73
+ $(this.inputBase.nativeElement).blur();
74
+ };
75
+ }
76
+ loadOptions(): void{
77
+ const v = this.inp.search.replace(/^_+|_+$/g, '');
78
+ if (v){
79
+ this.inp.load(this.inp.url.replace('{}', v));
80
+ }else{
81
+ this.inp.options = [];
82
+ }
83
+ }
84
+ openOptions(): void{
85
+ this.setPosition();
86
+ this.setHoverCenter();
87
+ $(this.inputBase.nativeElement).focus();
88
+ }
89
+ onFocusOut(): void{
90
+ this.closeOptions();
91
+ }
92
+ closeOptions(): boolean{
93
+ setTimeout(() => {
94
+ $(this.inputDiv.nativeElement).removeClass('top');
95
+ this.inp.hover = -1;
96
+ if (this.inp.value === null){
97
+ if (!this.inp.addNew){
98
+ this.inp.search = '';
99
+ }
100
+ if (this.inp.type === InputType.SelectAutoComplete){
101
+ this.inp.options = [];
102
+ }else{
103
+ this.setOptions();
104
+ }
105
+ }
106
+ }, 1);
107
+ return true;
108
+ }
109
+ setPosition(): void{
110
+ const rect = this.inputDiv.nativeElement.getBoundingClientRect();
111
+ const offsetOfBottom = window.innerHeight - rect.bottom;
112
+ const height = this.inputOptionsDiv.nativeElement.offsetHeight;
113
+ if (offsetOfBottom < height){
114
+ $(this.inputDiv.nativeElement).addClass('top');
115
+ }else{
116
+ $(this.inputDiv.nativeElement).removeClass('top');
117
+ }
118
+ }
119
+ setOptions(r = this.inp.options): void{
120
+ r.map((x) => {
121
+ this.setOptions(x.options);
122
+ x.show = (this.inp.value !== null || this.inp.search === '' || x.name.includes(this.inp.search) ||
123
+ x.value.includes(this.inp.search) || x.options.filter(o => o.show).length > 0);
124
+ });
125
+ }
126
+ onKeyDown(e): void{
127
+ const code = e.keyCode || e.which;
128
+ if (code === 9) {
129
+ e.preventDefault();
130
+ this.cI(e.shiftKey ? 'ShiftTab' : 'Tab');
131
+ }
132
+ else if (code === 13){
133
+ e.preventDefault();
134
+ if ($(this.inputBase.nativeElement).is(':focus')){
135
+ const h = this.getSelectedHover();
136
+ if (!h){
137
+ return;
138
+ }
139
+ this.selectOption(h.value);
140
+ }else{
141
+ this.cI('Tab');
142
+ }
143
+ }
144
+ else if (code === 40){
145
+ e.preventDefault();
146
+ if (this.inp.hover + 1 >= this.inp.index){
147
+ return;
148
+ }
149
+ this.inp.hover = this.getHover();
150
+ this.setHoverCenter();
151
+ }
152
+ else if (code === 38){
153
+ e.preventDefault();
154
+ if (this.inp.hover <= 0){
155
+ this.inp.hover = 0;
156
+ return;
157
+ }
158
+ this.inp.hover = this.getHover(-1);
159
+ this.setHoverCenter();
160
+ }
161
+ }
162
+ toggleOption(e): void{
163
+ if (this.inp.multiple && $(e.target).closest('.option').hasClass('option')){
164
+ return;
165
+ }
166
+ this.openOptions();
167
+ }
168
+ onKeyUp(e): void{
169
+ if (this.cSearch !== e.target.value) {
170
+ this.cSearch = e.target.value;
171
+ if (this.inp.type === InputType.Select){
172
+ return;
173
+ }
174
+ this.inp.value = null;
175
+ if (this.inp.type === InputType.SelectSearch){
176
+ this.setOptions();
177
+ }else if (e.target.value){
178
+ this.loadOptions();
179
+ }else{
180
+ this.inp.options = [];
181
+ }
182
+ }
183
+ }
184
+ selectOption(v, isEdit = false): void{
185
+ this.inp.error = null;
186
+ const va = this.getValue(v);
187
+ if (this.inp.multiple){
188
+ this.toggle(va);
189
+ this.inp.search = '';
190
+ }else{
191
+ this.inp.value = v;
192
+ this.inp.hover = va ? va.index : -1;
193
+ this.inp.search = va ? (this.inp.type === InputType.SelectSearch || this.inp.type === InputType.Select ? va.name : va.search) : '';
194
+ }
195
+ this.setOptions();
196
+ this.cSearch = this.inp.search;
197
+ if (this.inp.onChange){
198
+ this.inp.onChange(this.inp, isEdit);
199
+ }
200
+ if (this.inp.rel){
201
+ this.inp.rel.value = null;
202
+ this.inp.rel.hover = -1;
203
+ this.inp.rel.index = 0;
204
+ this.inp.rel.search = '';
205
+ this.inp.rel.options = [];
206
+ if (v !== null){
207
+ this.inp.rel.url = this.inp.relUrl.replace('{}', this.inp.value);
208
+ if (this.inp.rel.type !== InputType.SelectAutoComplete) {
209
+ this.inp.rel.load();
210
+ }else{
211
+ this.inp.rel.url += '_{}';
212
+ }
213
+ }
214
+ }
215
+ if (!isEdit && !this.inp.multiple){
216
+ this.cI('Tab');
217
+ }
218
+ }
219
+ toggle(op: OptionClass): void {
220
+ if (op.selected){
221
+ this.unCheck(op);
222
+ setTimeout(() => {this.unCheckParent(op.parent); }, 100);
223
+ }else{
224
+ this.check(op);
225
+ setTimeout(() => {this.checkParent(op.parent); }, 100);
226
+ }
227
+ }
228
+ check(c: OptionClass): void {
229
+ c.selected = true;
230
+ this.checkChildren(c);
231
+ }
232
+ unCheck(c: OptionClass): void {
233
+ c.selected = false;
234
+ c.options.forEach((ch) => {
235
+ this.unCheck(ch);
236
+ });
237
+ }
238
+ checkChildren(o: OptionClass): void{
239
+ o.options.forEach((ch) => {
240
+ this.check(ch);
241
+ });
242
+ }
243
+ checkParent(p: OptionClass): void{
244
+ if (p){
245
+ if (p.options.filter(x => !x.selected).length > 0){
246
+ p.selected = null;
247
+ }else{
248
+ p.selected = true;
249
+ }
250
+ this.checkParent(p.parent);
251
+ }
252
+ }
253
+ unCheckParent(p: OptionClass): void{
254
+ if (p){
255
+ if (p.options.filter(x => x.selected || x.selected == null).length > 0){
256
+ p.selected = null;
257
+ }else{
258
+ p.selected = false;
259
+ }
260
+ this.unCheckParent(p.parent);
261
+ }
262
+ }
263
+ cI(i: string): void{
264
+ setTimeout(() => {
265
+ this.changeIndex.emit(i);
266
+ if (!this.inForm){
267
+ $(this.inputBase.nativeElement).blur();
268
+ }
269
+ }, 10);
270
+ setTimeout(() => {
271
+ this.closeOptions();
272
+ }, 20);
273
+ }
274
+ setHoverCenter(): void {
275
+ setTimeout(() => {
276
+ const hover: any = $(this.inputOptionsDiv.nativeElement).find('.option.hover');
277
+ const items: any = $(this.inputOptionsDiv.nativeElement).find('.items');
278
+ if (hover.length === 0){
279
+ return;
280
+ }
281
+ items.scrollTop = items.scrollTop - items.offset.top + hover.offset.top - hover.height();
282
+ }, 1);
283
+ }
284
+ title(): string {
285
+ if (this.inp.value == null){
286
+ return null;
287
+ }
288
+ return this.getTitle(this.inp);
289
+ }
290
+ getTitle(os): string{
291
+ for (const s of os.options){
292
+ if (s.value === this.inp.value.toString()){
293
+ return this.inp.l(s.name);
294
+ }
295
+ const v = this.getTitle(s);
296
+ if (v != null){
297
+ return v;
298
+ }
299
+ }
300
+ return null;
301
+ }
302
+ getSelectedHover(o: OptionClass[] = this.inp.options): any{
303
+ const h = o.find(x => x.index === this.inp.hover);
304
+ if (h){
305
+ return h;
306
+ }
307
+ for (const i of o){
308
+ const hi = this.getSelectedHover(i.options);
309
+ if (hi){
310
+ return hi;
311
+ }
312
+ }
313
+ }
314
+ getHover(i = 1, o: OptionClass[] = this.inp.options, h = this.inp.hover): number{
315
+ const ho = o.find(x => x.index === h + i);
316
+ if (ho){
317
+ if (ho.show){
318
+ return ho.index;
319
+ }else {
320
+ h = h + i;
321
+ }
322
+ }
323
+ for (const it of o){
324
+ const hi = this.getHover(i, it.options, h);
325
+ if (hi){
326
+ return hi;
327
+ }
328
+ }
329
+ return 0;
330
+ }
331
+ getValue(v, o: OptionClass[] = this.inp.options): OptionClass{
332
+ const h = o.find(x => x.value === v);
333
+ if (h){
334
+ return h;
335
+ }
336
+ for (const i of o){
337
+ const hi = this.getValue(v, i.options);
338
+ if (hi){
339
+ return hi;
340
+ }
341
+ }
342
+ }
343
+
344
+ getSelected(opts: OptionClass[]= this.inp.options): any[]{
345
+ let l = [];
346
+ for (const f of opts){
347
+ if (f.selected){
348
+ l.push(f.value);
349
+ }
350
+ if (f.selected && f.options.length !== 0){
351
+ continue;
352
+ }
353
+ const rs = this.getSelected(f.options);
354
+ l = l.concat(rs);
355
+ }
356
+ return l;
357
+ }
358
+ }