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,22 @@
1
+ <div #inputDiv [id]="inp.name + 'Input'" [style]="inp.style" [className]="inp.class + ' form-input-con time' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '')">
2
+ <div class="form-input" (click)="toggleTime()">
3
+ <div *ngIf="inp.displayLabel" class="label"><i *ngIf="inp.required" class="fas fa-star-of-life required-icon"></i>{{inp.getLabel()}}</div>
4
+ <div class="w-100 p-r">
5
+ <i *ngIf="inp.icon != null || inp.loading" #inputIcon [className]="(inp.loading ? 'fa-duotone fa-spin fa-spinner' : inp.icon) + ' icon'"></i>
6
+ <i *ngIf="inp.withClear && inp.value" (click)="inp.clear()" class="fa-duotone fa-eraser clear-icon"></i>
7
+ <input (keydown)="onKeyDown($event)" (keyup)="onKeyUp($event)" (focusout)="onFocusOut()" [disabled]="inp.disabled" [(ngModel)]="inp.search" #inputBase [name]="inp.name" [placeholder]="inp.l(inp.name)" class="control" autocomplete="off" maxlength="">
8
+ <div #inputOptionsDiv class="options-con">
9
+ <div class="options">
10
+ <div class="hours">
11
+ <div [className]="(h === activeHour ? 'active ' : '') + 'hour'" (click)="selectTime(h, 'hour')" *ngFor="let h of hours">{{h}}</div>
12
+ </div>
13
+ <div class="rightline">
14
+ </div>
15
+ <div class="minutes">
16
+ <div [className]="(m === activeMinute ? 'active ' : '') + 'minute'" (click)="selectTime(m, 'minute')" *ngFor="let m of minutes">{{m}}</div>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
@@ -0,0 +1,139 @@
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-time',
8
+ templateUrl: './form.time.component.html',
9
+ styleUrls: ['./form.time.component.css']
10
+ })
11
+ export class FormTimeComponent implements OnInit{
12
+ @Input()
13
+ inp: InputClass;
14
+ @Input()
15
+ inForm: boolean;
16
+ @Output()
17
+ changeIndex = new EventEmitter<string>();
18
+ cSearch = '';
19
+ hours = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'];
20
+ minutes = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59'];
21
+ activeHour = null;
22
+ activeMinute = null;
23
+ @ViewChild('inputBase') inputBase: ElementRef;
24
+ @ViewChild('inputDiv') inputDiv: ElementRef;
25
+ @ViewChild('inputLabel') inputLabel: ElementRef;
26
+ @ViewChild('inputOptionsDiv') inputOptionsDiv: ElementRef;
27
+ constructor(){
28
+ }
29
+ ngOnInit(): void{
30
+ if (this.inp.value){
31
+ this.inp.setValue(this.inp.value, false);
32
+ }
33
+ this.inp.setValue = (v) => {
34
+ if (v === null){
35
+ this.inp.clear();
36
+ return;
37
+ } else {
38
+ this.activeHour = `${(v.Hours > 9 ? v.Hours : `0${v.Hours}`)}`;
39
+ this.activeMinute = `${(v.Minutes > 9 ? v.Minutes : `0${v.Minutes}`)}`;
40
+ this.inp.value = `${this.activeHour}:${this.activeMinute}`;
41
+ this.inp.search = `${this.activeHour}:${this.activeMinute}`;
42
+ }
43
+ };
44
+ this.inp.isValid = () => {
45
+ this.inp.error = null;
46
+ if (this.inp.required && !this.inp.value) {
47
+ this.inp.error = InputError.Required;
48
+ return false;
49
+ }
50
+ if (!this.inp.required && !this.inp.value) {
51
+ return true;
52
+ }
53
+ if (!RegExp(/^(?:(?:([01]?\d|2[0-3]):)([0-5]?\d))$/).test(this.inp.value)) {
54
+ this.inp.error = InputError.Invalid;
55
+ return false;
56
+ }
57
+ return true;
58
+ };
59
+ this.inp.clear = () => {
60
+ if (this.inp.default){
61
+ this.inp.setValue(this.inp.default, false);
62
+ }else{
63
+ this.inp.value = null;
64
+ this.inp.search = null;
65
+ }
66
+ };
67
+ this.inp.data = () => {
68
+ return this.inp.value;
69
+ };
70
+ this.inp.focus = () => {
71
+ this.openOptions();
72
+ };
73
+ this.inp.focusOut = () => {
74
+ $(this.inputBase.nativeElement).blur();
75
+ };
76
+ }
77
+ toggleTime(): void{
78
+ this.openOptions();
79
+ }
80
+ openOptions(): void {
81
+ this.setPosition();
82
+ $(this.inputBase.nativeElement).focus();
83
+ }
84
+ setPosition(): void{
85
+ const rect = this.inputDiv.nativeElement.getBoundingClientRect();
86
+ const offsetOfBottom = window.innerHeight - rect.bottom;
87
+ const height = this.inputOptionsDiv.nativeElement.offsetHeight;
88
+ if (offsetOfBottom < height){
89
+ $(this.inputDiv.nativeElement).addClass('top');
90
+ }else{
91
+ $(this.inputDiv.nativeElement).removeClass('top');
92
+ }
93
+ }
94
+ onKeyDown(e): void{
95
+ const code = e.keyCode || e.which;
96
+ if (code === 9 || code === 13) {
97
+ e.preventDefault();
98
+ $(this.inputDiv.nativeElement).removeClass('top');
99
+ this.changeIndex.emit(code === 9 ? e.shiftKey ? 'ShiftTab' : 'Tab' : e.shiftKey ? 'ShiftEnter' : 'Enter');
100
+ if (!this.inForm){
101
+ $(this.inputBase.nativeElement).blur();
102
+ }
103
+ }
104
+ }
105
+ onKeyUp(e): void{
106
+ this.inp.error = null;
107
+ if (this.cSearch !== e.target.value) {
108
+ this.cSearch = e.target.value;
109
+ if (this.inp.search !== '' && this.inp.search !== null){
110
+ if (RegExp(/^(?:(?:([01]?\d|2[0-3]):)([0-5]?\d))$/).test(this.inp.search)){
111
+ const hm = this.inp.search.split(':');
112
+ this.activeHour = hm[0].length === 2 ? hm[0] : `0${hm[0]}`;
113
+ this.activeMinute = hm[1].length === 2 ? hm[1] : `0${hm[1]}`;
114
+ this.inp.value = `${this.activeHour}:${this.activeMinute}`;
115
+ return;
116
+ }
117
+ }
118
+ this.activeHour = null;
119
+ this.activeMinute = null;
120
+ this.inp.value = null;
121
+ }
122
+ }
123
+ onFocusOut(): void{
124
+ $(this.inputDiv.nativeElement).removeClass('top');
125
+ this.inp.search = this.inp.value;
126
+ }
127
+ selectTime(v: string, s: string): void{
128
+ if (s === 'hour'){
129
+ this.activeMinute = this.activeMinute === null ? '00' : this.activeMinute;
130
+ this.activeHour = v;
131
+ }else{
132
+ this.activeHour = this.activeHour === null ? '00' : this.activeHour;
133
+ this.activeMinute = v;
134
+ this.changeIndex.emit('Tab');
135
+ }
136
+ this.inp.search = `${this.activeHour}:${this.activeMinute}`;
137
+ this.inp.value = `${this.activeHour}:${this.activeMinute}`;
138
+ }
139
+ }
@@ -0,0 +1,109 @@
1
+ .form-input-con.tree {
2
+ float: right;
3
+ width: 100%;
4
+ padding: 0 15px;
5
+ -webkit-user-select: none;
6
+ -moz-user-select: none;
7
+ -khtml-user-select: none;
8
+ -ms-user-select: none;
9
+ position: relative;
10
+ }
11
+ .form-input-con.tree .form-input {
12
+ float: right;
13
+ width: 100%;
14
+ position: relative;
15
+ }
16
+ .form-input-con.tree .form-input .label {
17
+ float: right;
18
+ width: 100%;
19
+ height: 20px;
20
+ line-height: 20px;
21
+ padding: 0 10px;
22
+ font-size: 12px;
23
+ margin-bottom: 3px;
24
+ cursor: default;
25
+ -webkit-user-select: none;
26
+ -moz-user-select: none;
27
+ -khtml-user-select: none;
28
+ -ms-user-select: none;
29
+ direction: rtl;
30
+ text-align: right;
31
+ }
32
+ .form-input-con.tree.error .form-input .label {
33
+ font-size: 10px;
34
+ color: var(--red);
35
+ }
36
+ .form-input-con.tree .form-input .label .required-icon{
37
+ height: 20px;
38
+ width: 20px;
39
+ line-height: 20px;
40
+ font-size: 9px;
41
+ color: var(--red);
42
+ text-align: center;
43
+ }
44
+ .form-input-con.tree .form-input > .control{
45
+ float: right;
46
+ width: 100%;
47
+ border-radius: 5px;
48
+ background-color: white;
49
+ min-height: 35px;
50
+ position: relative;
51
+ padding: 10px;
52
+ max-height: 400px;
53
+ overflow-y: auto;
54
+ overflow-x: hidden;
55
+ border: var(--border-input);
56
+ }
57
+ .form-input-con.tree .form-input:hover .control, .form-input-con.tree .form-input .input-base:focus + .control {
58
+ border: var(--border-input-dark);
59
+ }
60
+ .form-input-con.tree.error .form-input:hover .control, .form-input-con.tree.error .form-input .input-base:focus + .control {
61
+ border: var(--border-input-red-dark);
62
+ }
63
+ .form-input-con.tree .form-input .input-base {
64
+ position: absolute;
65
+ width: 0;
66
+ height: 0;
67
+ opacity: 0;
68
+ cursor: pointer;
69
+ top: 50%;
70
+ right: 50%;
71
+ z-index: 1;
72
+ }
73
+ .form-input-con.tree .form-input i.icon {
74
+ position: absolute;
75
+ font-size: 14px;
76
+ color: var(--comp);
77
+ cursor: default;
78
+ top: 0;
79
+ z-index: 1;
80
+ -webkit-transition: all .35s ease-in-out;
81
+ transition: all .35s ease-in-out;
82
+ width: 35px;
83
+ text-align: center;
84
+ height: 35px;
85
+ line-height: 35px;
86
+ left: 0;
87
+ }
88
+ .form-input-con.tree .form-input i.clear-icon {
89
+ position: absolute;
90
+ font-size: 14px;
91
+ color: var(--red);
92
+ cursor: pointer;
93
+ bottom: 0;
94
+ z-index: 3;
95
+ -webkit-transition: all .35s ease-in-out;
96
+ transition: all .35s ease-in-out;
97
+ width: 35px;
98
+ text-align: center;
99
+ height: 35px;
100
+ line-height: 38px;
101
+ right: 0;
102
+ }
103
+
104
+ .form-input-con.tree.error .form-input > .control {
105
+ border: var(--border-input-red);
106
+ }
107
+ .form-input-con.tree.error .form-input i.icon {
108
+ color: var(--red);
109
+ }
@@ -0,0 +1,11 @@
1
+ <div #inputDiv [id]="inp.name + 'Input'" [className]="inp.class + ' form-input-con tree' + (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
+ <input #inputBase type="checkbox" class="input-base" (keydown)="onKeyDown($event)" (focusin)="onFocusIn()">
5
+ <div [className]="(inp.loading ? 'o-h ' : '') + 'control'">
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
+ <lib-form-tree-item [level]="0" [index]="i" [item]="item" [tree]="inp" [base]="true" *ngFor="let item of inp.rows; let i = index"></lib-form-tree-item>
9
+ </div>
10
+ </div>
11
+ </div>
@@ -0,0 +1,98 @@
1
+ import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
2
+ import * as $ from 'jquery';
3
+ import {InputClass, TreeRowClass} from '../../../classes/form.class';
4
+ import {InputError} from '../../../classes/enum.class';
5
+
6
+ @Component({
7
+ selector: 'lib-form-tree',
8
+ templateUrl: './form.tree.component.html',
9
+ styleUrls: ['./form.tree.component.css']
10
+ })
11
+ export class FormTreeComponent implements OnInit{
12
+ @Input()
13
+ inp: InputClass;
14
+ @Output()
15
+ changeIndex = new EventEmitter<string>();
16
+ @ViewChild('inputBase') inputBase: ElementRef;
17
+ constructor(){
18
+ }
19
+ ngOnInit(): void {
20
+ this.inp.load();
21
+ this.inp.focus = () => {
22
+ this.onFocusIn();
23
+ };
24
+ this.inp.isValid = () => {
25
+ this.inp.error = null;
26
+ if (this.inp.required && this.getSelected().length === 0) {
27
+ this.inp.error = InputError.Required;
28
+ return false;
29
+ }
30
+ return true;
31
+ };
32
+ this.inp.data = () => {
33
+ return this.getSelected();
34
+ };
35
+ this.inp.setValue = (v) => {
36
+ this.check(v.map(String));
37
+ };
38
+ this.inp.clear = () => {
39
+ this.inp.setValue([], false);
40
+ };
41
+ }
42
+
43
+ onClick(): void{
44
+ this.onFocusIn();
45
+ }
46
+ onKeyDown(e): void{
47
+ const code = e.keyCode || e.which;
48
+ if (code === 9 || code === 13) {
49
+ e.preventDefault();
50
+ this.changeIndex.emit(e.shiftKey ? 'ShiftTab' : 'Tab');
51
+ }
52
+ }
53
+ onFocusIn(): void{
54
+ $(this.inputBase.nativeElement).focus();
55
+ }
56
+ getSelected(): any[]{
57
+ let l = [];
58
+ for (const f of this.inp.rows){
59
+ l = l.concat(this.getRowSelected(f));
60
+ }
61
+ return l;
62
+ }
63
+ getRowSelected(ch: TreeRowClass): any[]{
64
+ let l = [];
65
+ if (ch.selected && (!this.inp.onlyChild || ch.children.length === 0)){
66
+ l.push(ch.value);
67
+ }
68
+ ch.children.forEach((c) => {
69
+ const rs = this.getRowSelected(c);
70
+ l = l.concat(rs);
71
+ });
72
+ return l;
73
+ }
74
+
75
+ check(ids, chs = this.inp.rows): boolean{
76
+ let isChecked = false;
77
+ let cIsChecked = false;
78
+ for (const r of chs){
79
+ r.selected = ids.includes(r.value);
80
+ if (r.selected){
81
+ isChecked = true;
82
+ }
83
+ cIsChecked = this.check(ids, r.children);
84
+ if (this.inp.onlyChild && cIsChecked){
85
+ r.selected = true;
86
+ }
87
+ }
88
+ return isChecked || cIsChecked;
89
+ }
90
+ checkChildren(chs: TreeRowClass[], ids): void{
91
+ for (const r of chs){
92
+ if (ids.includes(r.value)){
93
+ r.toggle(this.inp.onlyChild);
94
+ }
95
+ setTimeout(() => {this.checkChildren(r.children, ids); });
96
+ }
97
+ }
98
+ }
@@ -0,0 +1,142 @@
1
+ .row-item {
2
+ float: left;
3
+ width: 90%;
4
+ text-align: center;
5
+ position: relative;
6
+ margin: 2px 0 2px 5px;
7
+ }
8
+
9
+ .row-item .content {
10
+ float: right;
11
+ width: 100%;
12
+ cursor: pointer;
13
+ border-radius: 5px;
14
+ background-color: #0b486b11;
15
+ }
16
+
17
+ .row-item .open-close {
18
+ position: absolute;
19
+ right: -30px;
20
+ height: 35px;
21
+ width: 10px;
22
+ text-align: center;
23
+ line-height: 30px;
24
+ font-size: 20px;
25
+ cursor: pointer;
26
+ }
27
+
28
+ .row-item .content:hover, .row-item .content.parent {
29
+ background-color: #0b486b22;
30
+ }
31
+
32
+ .row-item .content.parent:hover {
33
+ background-color: #0b486b44;
34
+ }
35
+
36
+ .row-item .children {
37
+ float: left;
38
+ width: 100%;
39
+ padding: 10px;
40
+ position: relative;
41
+ display: none;
42
+ }
43
+
44
+ .row-item .children .items {
45
+ float: left;
46
+ width: 100%;
47
+ }
48
+
49
+ .row-item .children > .line {
50
+ width: 2px;
51
+ background-color: #0b486b22;
52
+ top: 15px;
53
+ right: 20px;
54
+ height: calc(100% - 30px);
55
+ position: absolute;
56
+ }
57
+
58
+ .row-item .children .row-item > .line {
59
+ width: 10px;
60
+ background-color: #0b486b22;
61
+ top: 17px;
62
+ height: 2px;
63
+ position: absolute;
64
+ right: -35px;
65
+ }
66
+
67
+ .row-item .content .title {
68
+ float: right;
69
+ width: 100%;
70
+ height: 35px;
71
+ line-height: 35px;
72
+ font-size: 12px;
73
+ }
74
+
75
+
76
+ .row-item .checkbox {
77
+ float: right;
78
+ width: 100%;
79
+ text-align: center;
80
+ height: 35px;
81
+ line-height: 35px;
82
+ padding: 0 35px;
83
+ cursor: pointer;
84
+ -webkit-user-select: none;
85
+ -moz-user-select: none;
86
+ -khtml-user-select: none;
87
+ -ms-user-select: none;
88
+ font-size: 12px;
89
+ z-index: 2;
90
+ position: relative;
91
+ }
92
+
93
+ .row-item .control {
94
+ position: absolute;
95
+ width: 0;
96
+ height: 0;
97
+ opacity: 0;
98
+ cursor: pointer;
99
+ top: 50%;
100
+ right: 50%;
101
+ z-index: 1;
102
+ }
103
+ .row-item > .checkbox:before {
104
+ content: "\f0c8";
105
+ position: absolute;
106
+ font-family: "Font Awesome 5 Pro";
107
+ font-weight: normal;
108
+ width: 35px;
109
+ height: 35px;
110
+ line-height: 35px;
111
+ right: 0;
112
+ top: 0;
113
+ font-size: 18px;
114
+ }
115
+
116
+ .row-item.selected > .checkbox:before {
117
+ content: "\f14a";
118
+ color: var(--green);
119
+ font-weight: 900;
120
+ animation: pop 180ms ease-in;
121
+ }
122
+
123
+ .row-item.null > .checkbox:before {
124
+ content: "\f146";
125
+ color: var(--green);
126
+ font-weight: 900;
127
+ animation: pop 180ms ease-in;
128
+ }
129
+ .row-item:after{
130
+ content:"";
131
+ border: 0;
132
+ height: 1px;
133
+ width: 100%;
134
+ float: right;
135
+ position: absolute;
136
+ right: 0;
137
+ bottom: 0;
138
+ background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(50, 50, 50, 0.25), rgba(0, 0, 0, 0));
139
+ }
140
+ ::ng-deep lib-form-tree-item:last-of-type > .row-item:after{
141
+ display: none;
142
+ }
@@ -0,0 +1,9 @@
1
+ <div [className]="(item.selected ? 'selected ' : item.selected == null ? 'null ' : '') + 'row-item'">
2
+ <div (click)="onClick()" class="checkbox">{{tree.l(item.name)}}</div>
3
+ <i *ngIf="item.children.length > 0" (click)="openClose($event)" [className]="(index == 0 && level == 0 ? 'fa-duotone fa-caret-down ' : 'fa-duotone fa-caret-left ') + 'open-close'"></i>
4
+ <div [className]="(index == 0 && level == 0 ? 'open ' : '') + 'children'" [style]="index == 0 && level == 0 ? {display: 'block'} : {}" *ngIf="item.children.length > 0">
5
+ <div class="items rightline">
6
+ <lib-form-tree-item [level]="level + 1" [index]="i" [item]="child" [parent]="item" [tree]="tree" *ngFor="let child of item.children; let i = index"></lib-form-tree-item>
7
+ </div>
8
+ </div>
9
+ </div>
@@ -0,0 +1,49 @@
1
+ import {Component, ElementRef, EventEmitter, HostListener, Input, OnInit, Output, ViewChild} from '@angular/core';
2
+ import * as $ from 'jquery';
3
+ import {InputClass, TreeRowClass} from '../../../../classes/form.class';
4
+
5
+ @Component({
6
+ selector: 'lib-form-tree-item',
7
+ templateUrl: './form.tree.item.component.html',
8
+ styleUrls: ['./form.tree.item.component.css']
9
+ })
10
+ export class FormTreeItemComponent implements OnInit{
11
+ @Input()
12
+ item: TreeRowClass;
13
+ @Input()
14
+ level: number;
15
+ @Input()
16
+ index: number;
17
+ @Input()
18
+ tree: InputClass;
19
+ @Input()
20
+ parent: TreeRowClass = null;
21
+ @Input()
22
+ base: boolean;
23
+ @Output()
24
+ changeIndex = new EventEmitter<string>();
25
+ @ViewChild('inputDiv') inputDiv: ElementRef;
26
+ @ViewChild('inputBase') inputBase: ElementRef;
27
+ constructor(){
28
+ }
29
+ ngOnInit(): void{
30
+ this.item.parent = this.parent;
31
+ }
32
+ openClose(e): void {
33
+ const ch = $(e.target).closest('.row-item').find(' > .children');
34
+ const oc = $(e.target).closest('.row-item').find(' > .open-close');
35
+ if (ch.hasClass('open')) {
36
+ ch.removeClass('open');
37
+ ch.stop().slideUp();
38
+ oc.removeClass('fa-caret-down').addClass('fa-caret-left');
39
+ } else {
40
+ ch.addClass('open');
41
+ ch.stop().slideDown();
42
+ oc.addClass('fa-caret-down').removeClass('fa-caret-left');
43
+ }
44
+ }
45
+
46
+ onClick(): void {
47
+ this.item.toggle(this.tree.onlyChild);
48
+ }
49
+ }
@@ -0,0 +1,57 @@
1
+ #Header{
2
+ float: right;
3
+ width: 100%;
4
+ height: 50px;
5
+ background-color: white;
6
+ position: relative;
7
+ z-index: 11;
8
+ }
9
+ #Header .logout{
10
+ float: left;
11
+ width: 80px;
12
+ margin: 10px 30px;
13
+ }
14
+ @media (max-width: 399.98px) {
15
+ #Header .toggle-sidebar{
16
+ display: block;
17
+ }
18
+ }
19
+
20
+ @media (min-width: 400px) and (max-width: 499.98px) {
21
+ #Header .toggle-sidebar{
22
+ display: block;
23
+ }
24
+ }
25
+
26
+ @media (min-width: 500px) and (max-width: 599.98px) {
27
+ #Header .toggle-sidebar{
28
+ display: block;
29
+ }
30
+ }
31
+
32
+ @media (min-width: 600px) and (max-width: 699.98px) {
33
+ #Header .toggle-sidebar{
34
+ display: block;
35
+ }
36
+ }
37
+
38
+ @media (min-width: 700px) and (max-width: 799.98px) {
39
+ #Header .toggle-sidebar{
40
+ display: block;
41
+ }
42
+ }
43
+
44
+ @media (min-width: 800px) and (max-width: 899.98px) {
45
+ }
46
+
47
+ @media (min-width: 900px) and (max-width: 999.98px) {
48
+ }
49
+
50
+ @media (min-width: 1000px) and (max-width: 1099.98px) {
51
+ }
52
+
53
+ @media (min-width: 1100px) and (max-width: 1199.98px) {
54
+ }
55
+
56
+ @media (min-width: 1200px) {
57
+ }
@@ -0,0 +1,5 @@
1
+ <div id="Header" class="underline">
2
+ <div class="logout">
3
+ <lib-form-button [inp]="logoutInp"></lib-form-button>
4
+ </div>
5
+ </div>
@@ -0,0 +1,28 @@
1
+ import {Component, EventEmitter, Output} from '@angular/core';
2
+ import {InputClass} from '../../classes/form.class';
3
+ import {InputType} from '../../classes/enum.class';
4
+ import {PsToolkitUiConfigService} from '../../services/config.service';
5
+ import {LangClass} from '../../classes/lang.class';
6
+ import {strings} from '../../classes/string.class';
7
+ import {HelperClass} from '../../classes/helper.class';
8
+
9
+ @Component({
10
+ selector: 'lib-header',
11
+ templateUrl: './header.component.html',
12
+ styleUrls: ['./header.component.css']
13
+ })
14
+ export class HeaderComponent{
15
+ logoutInp: InputClass;
16
+ @Output()
17
+ logout = new EventEmitter();
18
+ constructor(public config: PsToolkitUiConfigService){
19
+ const lang = new LangClass(config.currentLang, config.strings);
20
+ const l = (key: string, v = null): string => {
21
+ return lang.get('Public', 'Header', key, v);
22
+ };
23
+ this.logoutInp = new InputClass(config.environment, l, 'Logout', null, InputType.Button, 'grey h-30');
24
+ this.logoutInp.onClick = () => {
25
+ this.logout.emit();
26
+ };
27
+ }
28
+ }