@things-factory/compliance 0.0.0-stage → 10.1.254

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 (356) hide show
  1. package/dist-client/bootstrap.d.ts +2 -0
  2. package/dist-client/bootstrap.js +28 -0
  3. package/dist-client/bootstrap.js.map +1 -0
  4. package/dist-client/components/compliance-case-form.d.ts +42 -0
  5. package/dist-client/components/compliance-case-form.js +313 -0
  6. package/dist-client/components/compliance-case-form.js.map +1 -0
  7. package/dist-client/components/compliance-case-sheet.d.ts +35 -0
  8. package/dist-client/components/compliance-case-sheet.js +335 -0
  9. package/dist-client/components/compliance-case-sheet.js.map +1 -0
  10. package/dist-client/components/compliance-my-inventions.d.ts +17 -0
  11. package/dist-client/components/compliance-my-inventions.js +133 -0
  12. package/dist-client/components/compliance-my-inventions.js.map +1 -0
  13. package/dist-client/components/compliance-my-privacy-requests.d.ts +34 -0
  14. package/dist-client/components/compliance-my-privacy-requests.js +232 -0
  15. package/dist-client/components/compliance-my-privacy-requests.js.map +1 -0
  16. package/dist-client/components/compliance-my-reports.d.ts +19 -0
  17. package/dist-client/components/compliance-my-reports.js +137 -0
  18. package/dist-client/components/compliance-my-reports.js.map +1 -0
  19. package/dist-client/components/guide-link.d.ts +13 -0
  20. package/dist-client/components/guide-link.js +55 -0
  21. package/dist-client/components/guide-link.js.map +1 -0
  22. package/dist-client/components/invention-report-form.d.ts +30 -0
  23. package/dist-client/components/invention-report-form.js +188 -0
  24. package/dist-client/components/invention-report-form.js.map +1 -0
  25. package/dist-client/components/legal-todo.d.ts +10 -0
  26. package/dist-client/components/legal-todo.js +43 -0
  27. package/dist-client/components/legal-todo.js.map +1 -0
  28. package/dist-client/components/my-trainings.d.ts +18 -0
  29. package/dist-client/components/my-trainings.js +149 -0
  30. package/dist-client/components/my-trainings.js.map +1 -0
  31. package/dist-client/components/regulation-form.d.ts +26 -0
  32. package/dist-client/components/regulation-form.js +161 -0
  33. package/dist-client/components/regulation-form.js.map +1 -0
  34. package/dist-client/components/seal-use-form.d.ts +47 -0
  35. package/dist-client/components/seal-use-form.js +300 -0
  36. package/dist-client/components/seal-use-form.js.map +1 -0
  37. package/dist-client/components/training-attendance-form.d.ts +37 -0
  38. package/dist-client/components/training-attendance-form.js +186 -0
  39. package/dist-client/components/training-attendance-form.js.map +1 -0
  40. package/dist-client/components/training-certificate-form.d.ts +41 -0
  41. package/dist-client/components/training-certificate-form.js +198 -0
  42. package/dist-client/components/training-certificate-form.js.map +1 -0
  43. package/dist-client/components/training-session-form.d.ts +39 -0
  44. package/dist-client/components/training-session-form.js +270 -0
  45. package/dist-client/components/training-session-form.js.map +1 -0
  46. package/dist-client/components/training-setting-form.d.ts +45 -0
  47. package/dist-client/components/training-setting-form.js +175 -0
  48. package/dist-client/components/training-setting-form.js.map +1 -0
  49. package/dist-client/index.d.ts +4 -0
  50. package/dist-client/index.js +8 -0
  51. package/dist-client/index.js.map +1 -0
  52. package/dist-client/legal-record/dispute-calendar-source.d.ts +1 -0
  53. package/dist-client/legal-record/dispute-calendar-source.js +51 -0
  54. package/dist-client/legal-record/dispute-calendar-source.js.map +1 -0
  55. package/dist-client/legal-record/legal-child-grid.d.ts +31 -0
  56. package/dist-client/legal-record/legal-child-grid.js +76 -0
  57. package/dist-client/legal-record/legal-child-grid.js.map +1 -0
  58. package/dist-client/legal-record/legal-codes.d.ts +3 -0
  59. package/dist-client/legal-record/legal-codes.js +5 -0
  60. package/dist-client/legal-record/legal-codes.js.map +1 -0
  61. package/dist-client/legal-record/legal-grid.d.ts +59 -0
  62. package/dist-client/legal-record/legal-grid.js +68 -0
  63. package/dist-client/legal-record/legal-grid.js.map +1 -0
  64. package/dist-client/legal-record/legal-record-files.d.ts +26 -0
  65. package/dist-client/legal-record/legal-record-files.js +162 -0
  66. package/dist-client/legal-record/legal-record-files.js.map +1 -0
  67. package/dist-client/pages/compliance-case-list.d.ts +35 -0
  68. package/dist-client/pages/compliance-case-list.js +112 -0
  69. package/dist-client/pages/compliance-case-list.js.map +1 -0
  70. package/dist-client/pages/dispute-list.d.ts +57 -0
  71. package/dist-client/pages/dispute-list.js +156 -0
  72. package/dist-client/pages/dispute-list.js.map +1 -0
  73. package/dist-client/pages/invention-list.d.ts +57 -0
  74. package/dist-client/pages/invention-list.js +166 -0
  75. package/dist-client/pages/invention-list.js.map +1 -0
  76. package/dist-client/pages/legal-registration-list.d.ts +63 -0
  77. package/dist-client/pages/legal-registration-list.js +206 -0
  78. package/dist-client/pages/legal-registration-list.js.map +1 -0
  79. package/dist-client/pages/privacy-record-list.d.ts +52 -0
  80. package/dist-client/pages/privacy-record-list.js +225 -0
  81. package/dist-client/pages/privacy-record-list.js.map +1 -0
  82. package/dist-client/pages/regulation-detail.d.ts +43 -0
  83. package/dist-client/pages/regulation-detail.js +370 -0
  84. package/dist-client/pages/regulation-detail.js.map +1 -0
  85. package/dist-client/pages/regulation-list.d.ts +52 -0
  86. package/dist-client/pages/regulation-list.js +144 -0
  87. package/dist-client/pages/regulation-list.js.map +1 -0
  88. package/dist-client/pages/regulations.d.ts +49 -0
  89. package/dist-client/pages/regulations.js +412 -0
  90. package/dist-client/pages/regulations.js.map +1 -0
  91. package/dist-client/pages/seal-use-list.d.ts +57 -0
  92. package/dist-client/pages/seal-use-list.js +168 -0
  93. package/dist-client/pages/seal-use-list.js.map +1 -0
  94. package/dist-client/pages/training-list.d.ts +51 -0
  95. package/dist-client/pages/training-list.js +333 -0
  96. package/dist-client/pages/training-list.js.map +1 -0
  97. package/dist-client/regulation/regulation-fragments.d.ts +1 -0
  98. package/dist-client/regulation/regulation-fragments.js +37 -0
  99. package/dist-client/regulation/regulation-fragments.js.map +1 -0
  100. package/dist-client/regulation/regulation-guide.d.ts +19 -0
  101. package/dist-client/regulation/regulation-guide.js +48 -0
  102. package/dist-client/regulation/regulation-guide.js.map +1 -0
  103. package/dist-client/route.d.ts +1 -0
  104. package/dist-client/route.js +36 -0
  105. package/dist-client/route.js.map +1 -0
  106. package/dist-client/training-words.d.ts +11 -0
  107. package/dist-client/training-words.js +11 -0
  108. package/dist-client/training-words.js.map +1 -0
  109. package/dist-client/tsconfig.tsbuildinfo +1 -0
  110. package/dist-client/words.d.ts +15 -0
  111. package/dist-client/words.js +20 -0
  112. package/dist-client/words.js.map +1 -0
  113. package/dist-server/activities/index.d.ts +6 -0
  114. package/dist-server/activities/index.js +35 -0
  115. package/dist-server/activities/index.js.map +1 -0
  116. package/dist-server/activities/legal-todo-activity-names.d.ts +1 -0
  117. package/dist-server/activities/legal-todo-activity-names.js +5 -0
  118. package/dist-server/activities/legal-todo-activity-names.js.map +1 -0
  119. package/dist-server/activities/legal-todo-activity.d.ts +37 -0
  120. package/dist-server/activities/legal-todo-activity.js +41 -0
  121. package/dist-server/activities/legal-todo-activity.js.map +1 -0
  122. package/dist-server/activities/regulation-activity-names.d.ts +1 -0
  123. package/dist-server/activities/regulation-activity-names.js +5 -0
  124. package/dist-server/activities/regulation-activity-names.js.map +1 -0
  125. package/dist-server/activities/regulation-activity.d.ts +48 -0
  126. package/dist-server/activities/regulation-activity.js +47 -0
  127. package/dist-server/activities/regulation-activity.js.map +1 -0
  128. package/dist-server/activities/seal-use-activity-names.d.ts +2 -0
  129. package/dist-server/activities/seal-use-activity-names.js +6 -0
  130. package/dist-server/activities/seal-use-activity-names.js.map +1 -0
  131. package/dist-server/activities/seal-use-activity.d.ts +48 -0
  132. package/dist-server/activities/seal-use-activity.js +47 -0
  133. package/dist-server/activities/seal-use-activity.js.map +1 -0
  134. package/dist-server/index.d.ts +2 -0
  135. package/dist-server/index.js +21 -0
  136. package/dist-server/index.js.map +1 -0
  137. package/dist-server/role-tasks.d.ts +2 -0
  138. package/dist-server/role-tasks.js +28 -0
  139. package/dist-server/role-tasks.js.map +1 -0
  140. package/dist-server/service/common/correction.d.ts +32 -0
  141. package/dist-server/service/common/correction.js +98 -0
  142. package/dist-server/service/common/correction.js.map +1 -0
  143. package/dist-server/service/common/employee-reader.d.ts +11 -0
  144. package/dist-server/service/common/employee-reader.js +46 -0
  145. package/dist-server/service/common/employee-reader.js.map +1 -0
  146. package/dist-server/service/common/legal-todo.d.ts +19 -0
  147. package/dist-server/service/common/legal-todo.js +37 -0
  148. package/dist-server/service/common/legal-todo.js.map +1 -0
  149. package/dist-server/service/compliance-case/compliance-case-mutation.d.ts +9 -0
  150. package/dist-server/service/compliance-case/compliance-case-mutation.js +73 -0
  151. package/dist-server/service/compliance-case/compliance-case-mutation.js.map +1 -0
  152. package/dist-server/service/compliance-case/compliance-case-query.d.ts +28 -0
  153. package/dist-server/service/compliance-case/compliance-case-query.js +212 -0
  154. package/dist-server/service/compliance-case/compliance-case-query.js.map +1 -0
  155. package/dist-server/service/compliance-case/compliance-case-rules.d.ts +71 -0
  156. package/dist-server/service/compliance-case/compliance-case-rules.js +111 -0
  157. package/dist-server/service/compliance-case/compliance-case-rules.js.map +1 -0
  158. package/dist-server/service/compliance-case/compliance-case-service.d.ts +76 -0
  159. package/dist-server/service/compliance-case/compliance-case-service.js +425 -0
  160. package/dist-server/service/compliance-case/compliance-case-service.js.map +1 -0
  161. package/dist-server/service/compliance-case/compliance-case-type.d.ts +56 -0
  162. package/dist-server/service/compliance-case/compliance-case-type.js +200 -0
  163. package/dist-server/service/compliance-case/compliance-case-type.js.map +1 -0
  164. package/dist-server/service/compliance-case/compliance-case.d.ts +76 -0
  165. package/dist-server/service/compliance-case/compliance-case.js +260 -0
  166. package/dist-server/service/compliance-case/compliance-case.js.map +1 -0
  167. package/dist-server/service/compliance-case/index.d.ts +7 -0
  168. package/dist-server/service/compliance-case/index.js +17 -0
  169. package/dist-server/service/compliance-case/index.js.map +1 -0
  170. package/dist-server/service/dispute/dispute-mutation.d.ts +9 -0
  171. package/dist-server/service/dispute/dispute-mutation.js +64 -0
  172. package/dist-server/service/dispute/dispute-mutation.js.map +1 -0
  173. package/dist-server/service/dispute/dispute-query.d.ts +16 -0
  174. package/dist-server/service/dispute/dispute-query.js +124 -0
  175. package/dist-server/service/dispute/dispute-query.js.map +1 -0
  176. package/dist-server/service/dispute/dispute-rules.d.ts +20 -0
  177. package/dist-server/service/dispute/dispute-rules.js +42 -0
  178. package/dist-server/service/dispute/dispute-rules.js.map +1 -0
  179. package/dist-server/service/dispute/dispute-service.d.ts +17 -0
  180. package/dist-server/service/dispute/dispute-service.js +96 -0
  181. package/dist-server/service/dispute/dispute-service.js.map +1 -0
  182. package/dist-server/service/dispute/dispute-type.d.ts +39 -0
  183. package/dist-server/service/dispute/dispute-type.js +149 -0
  184. package/dist-server/service/dispute/dispute-type.js.map +1 -0
  185. package/dist-server/service/dispute/dispute.d.ts +48 -0
  186. package/dist-server/service/dispute/dispute.js +198 -0
  187. package/dist-server/service/dispute/dispute.js.map +1 -0
  188. package/dist-server/service/dispute/index.d.ts +5 -0
  189. package/dist-server/service/dispute/index.js +9 -0
  190. package/dist-server/service/dispute/index.js.map +1 -0
  191. package/dist-server/service/index.d.ts +46 -0
  192. package/dist-server/service/index.js +112 -0
  193. package/dist-server/service/index.js.map +1 -0
  194. package/dist-server/service/invention/index.d.ts +5 -0
  195. package/dist-server/service/invention/index.js +9 -0
  196. package/dist-server/service/invention/index.js.map +1 -0
  197. package/dist-server/service/invention/invention-mutation.d.ts +10 -0
  198. package/dist-server/service/invention/invention-mutation.js +79 -0
  199. package/dist-server/service/invention/invention-mutation.js.map +1 -0
  200. package/dist-server/service/invention/invention-query.d.ts +18 -0
  201. package/dist-server/service/invention/invention-query.js +141 -0
  202. package/dist-server/service/invention/invention-query.js.map +1 -0
  203. package/dist-server/service/invention/invention-rules.d.ts +28 -0
  204. package/dist-server/service/invention/invention-rules.js +54 -0
  205. package/dist-server/service/invention/invention-rules.js.map +1 -0
  206. package/dist-server/service/invention/invention-service.d.ts +25 -0
  207. package/dist-server/service/invention/invention-service.js +176 -0
  208. package/dist-server/service/invention/invention-service.js.map +1 -0
  209. package/dist-server/service/invention/invention-type.d.ts +34 -0
  210. package/dist-server/service/invention/invention-type.js +129 -0
  211. package/dist-server/service/invention/invention-type.js.map +1 -0
  212. package/dist-server/service/invention/invention.d.ts +55 -0
  213. package/dist-server/service/invention/invention.js +214 -0
  214. package/dist-server/service/invention/invention.js.map +1 -0
  215. package/dist-server/service/legal-record/attachment-readers.d.ts +1 -0
  216. package/dist-server/service/legal-record/attachment-readers.js +27 -0
  217. package/dist-server/service/legal-record/attachment-readers.js.map +1 -0
  218. package/dist-server/service/legal-record/days.d.ts +7 -0
  219. package/dist-server/service/legal-record/days.js +26 -0
  220. package/dist-server/service/legal-record/days.js.map +1 -0
  221. package/dist-server/service/legal-record/legal-record-support.d.ts +24 -0
  222. package/dist-server/service/legal-record/legal-record-support.js +51 -0
  223. package/dist-server/service/legal-record/legal-record-support.js.map +1 -0
  224. package/dist-server/service/legal-registration/centre-change-subscriber.d.ts +9 -0
  225. package/dist-server/service/legal-registration/centre-change-subscriber.js +50 -0
  226. package/dist-server/service/legal-registration/centre-change-subscriber.js.map +1 -0
  227. package/dist-server/service/legal-registration/index.d.ts +7 -0
  228. package/dist-server/service/legal-registration/index.js +11 -0
  229. package/dist-server/service/legal-registration/index.js.map +1 -0
  230. package/dist-server/service/legal-registration/legal-registration-mutation.d.ts +10 -0
  231. package/dist-server/service/legal-registration/legal-registration-mutation.js +77 -0
  232. package/dist-server/service/legal-registration/legal-registration-mutation.js.map +1 -0
  233. package/dist-server/service/legal-registration/legal-registration-query.d.ts +26 -0
  234. package/dist-server/service/legal-registration/legal-registration-query.js +199 -0
  235. package/dist-server/service/legal-registration/legal-registration-query.js.map +1 -0
  236. package/dist-server/service/legal-registration/legal-registration-rules.d.ts +80 -0
  237. package/dist-server/service/legal-registration/legal-registration-rules.js +106 -0
  238. package/dist-server/service/legal-registration/legal-registration-rules.js.map +1 -0
  239. package/dist-server/service/legal-registration/legal-registration-service.d.ts +37 -0
  240. package/dist-server/service/legal-registration/legal-registration-service.js +248 -0
  241. package/dist-server/service/legal-registration/legal-registration-service.js.map +1 -0
  242. package/dist-server/service/legal-registration/legal-registration-type.d.ts +55 -0
  243. package/dist-server/service/legal-registration/legal-registration-type.js +207 -0
  244. package/dist-server/service/legal-registration/legal-registration-type.js.map +1 -0
  245. package/dist-server/service/legal-registration/legal-registration.d.ts +76 -0
  246. package/dist-server/service/legal-registration/legal-registration.js +311 -0
  247. package/dist-server/service/legal-registration/legal-registration.js.map +1 -0
  248. package/dist-server/service/privacy-record/index.d.ts +5 -0
  249. package/dist-server/service/privacy-record/index.js +9 -0
  250. package/dist-server/service/privacy-record/index.js.map +1 -0
  251. package/dist-server/service/privacy-record/privacy-record-mutation.d.ts +7 -0
  252. package/dist-server/service/privacy-record/privacy-record-mutation.js +56 -0
  253. package/dist-server/service/privacy-record/privacy-record-mutation.js.map +1 -0
  254. package/dist-server/service/privacy-record/privacy-record-query.d.ts +18 -0
  255. package/dist-server/service/privacy-record/privacy-record-query.js +131 -0
  256. package/dist-server/service/privacy-record/privacy-record-query.js.map +1 -0
  257. package/dist-server/service/privacy-record/privacy-record-rules.d.ts +52 -0
  258. package/dist-server/service/privacy-record/privacy-record-rules.js +91 -0
  259. package/dist-server/service/privacy-record/privacy-record-rules.js.map +1 -0
  260. package/dist-server/service/privacy-record/privacy-record-service.d.ts +33 -0
  261. package/dist-server/service/privacy-record/privacy-record-service.js +133 -0
  262. package/dist-server/service/privacy-record/privacy-record-service.js.map +1 -0
  263. package/dist-server/service/privacy-record/privacy-record-type.d.ts +40 -0
  264. package/dist-server/service/privacy-record/privacy-record-type.js +153 -0
  265. package/dist-server/service/privacy-record/privacy-record-type.js.map +1 -0
  266. package/dist-server/service/privacy-record/privacy-record.d.ts +69 -0
  267. package/dist-server/service/privacy-record/privacy-record.js +245 -0
  268. package/dist-server/service/privacy-record/privacy-record.js.map +1 -0
  269. package/dist-server/service/regulation/index.d.ts +5 -0
  270. package/dist-server/service/regulation/index.js +9 -0
  271. package/dist-server/service/regulation/index.js.map +1 -0
  272. package/dist-server/service/regulation/regulation-mutation.d.ts +15 -0
  273. package/dist-server/service/regulation/regulation-mutation.js +152 -0
  274. package/dist-server/service/regulation/regulation-mutation.js.map +1 -0
  275. package/dist-server/service/regulation/regulation-query.d.ts +10 -0
  276. package/dist-server/service/regulation/regulation-query.js +109 -0
  277. package/dist-server/service/regulation/regulation-query.js.map +1 -0
  278. package/dist-server/service/regulation/regulation-read.d.ts +21 -0
  279. package/dist-server/service/regulation/regulation-read.js +111 -0
  280. package/dist-server/service/regulation/regulation-read.js.map +1 -0
  281. package/dist-server/service/regulation/regulation-rules.d.ts +83 -0
  282. package/dist-server/service/regulation/regulation-rules.js +170 -0
  283. package/dist-server/service/regulation/regulation-rules.js.map +1 -0
  284. package/dist-server/service/regulation/regulation-service.d.ts +63 -0
  285. package/dist-server/service/regulation/regulation-service.js +365 -0
  286. package/dist-server/service/regulation/regulation-service.js.map +1 -0
  287. package/dist-server/service/regulation/regulation-type.d.ts +61 -0
  288. package/dist-server/service/regulation/regulation-type.js +226 -0
  289. package/dist-server/service/regulation/regulation-type.js.map +1 -0
  290. package/dist-server/service/regulation/regulation.d.ts +113 -0
  291. package/dist-server/service/regulation/regulation.js +382 -0
  292. package/dist-server/service/regulation/regulation.js.map +1 -0
  293. package/dist-server/service/seal-use/index.d.ts +5 -0
  294. package/dist-server/service/seal-use/index.js +9 -0
  295. package/dist-server/service/seal-use/index.js.map +1 -0
  296. package/dist-server/service/seal-use/seal-use-mutation.d.ts +8 -0
  297. package/dist-server/service/seal-use/seal-use-mutation.js +69 -0
  298. package/dist-server/service/seal-use/seal-use-mutation.js.map +1 -0
  299. package/dist-server/service/seal-use/seal-use-query.d.ts +14 -0
  300. package/dist-server/service/seal-use/seal-use-query.js +100 -0
  301. package/dist-server/service/seal-use/seal-use-query.js.map +1 -0
  302. package/dist-server/service/seal-use/seal-use-rules.d.ts +35 -0
  303. package/dist-server/service/seal-use/seal-use-rules.js +64 -0
  304. package/dist-server/service/seal-use/seal-use-rules.js.map +1 -0
  305. package/dist-server/service/seal-use/seal-use-service.d.ts +20 -0
  306. package/dist-server/service/seal-use/seal-use-service.js +168 -0
  307. package/dist-server/service/seal-use/seal-use-service.js.map +1 -0
  308. package/dist-server/service/seal-use/seal-use-type.d.ts +24 -0
  309. package/dist-server/service/seal-use/seal-use-type.js +93 -0
  310. package/dist-server/service/seal-use/seal-use-type.js.map +1 -0
  311. package/dist-server/service/seal-use/seal-use.d.ts +57 -0
  312. package/dist-server/service/seal-use/seal-use.js +181 -0
  313. package/dist-server/service/seal-use/seal-use.js.map +1 -0
  314. package/dist-server/service/training/index.d.ts +5 -0
  315. package/dist-server/service/training/index.js +9 -0
  316. package/dist-server/service/training/index.js.map +1 -0
  317. package/dist-server/service/training/training-checks.d.ts +20 -0
  318. package/dist-server/service/training/training-checks.js +56 -0
  319. package/dist-server/service/training/training-checks.js.map +1 -0
  320. package/dist-server/service/training/training-kinds.d.ts +24 -0
  321. package/dist-server/service/training/training-kinds.js +42 -0
  322. package/dist-server/service/training/training-kinds.js.map +1 -0
  323. package/dist-server/service/training/training-mutation.d.ts +14 -0
  324. package/dist-server/service/training/training-mutation.js +140 -0
  325. package/dist-server/service/training/training-mutation.js.map +1 -0
  326. package/dist-server/service/training/training-query.d.ts +21 -0
  327. package/dist-server/service/training/training-query.js +196 -0
  328. package/dist-server/service/training/training-query.js.map +1 -0
  329. package/dist-server/service/training/training-read.d.ts +5 -0
  330. package/dist-server/service/training/training-read.js +35 -0
  331. package/dist-server/service/training/training-read.js.map +1 -0
  332. package/dist-server/service/training/training-register.d.ts +1 -0
  333. package/dist-server/service/training/training-register.js +27 -0
  334. package/dist-server/service/training/training-register.js.map +1 -0
  335. package/dist-server/service/training/training-rules.d.ts +72 -0
  336. package/dist-server/service/training/training-rules.js +143 -0
  337. package/dist-server/service/training/training-rules.js.map +1 -0
  338. package/dist-server/service/training/training-service.d.ts +98 -0
  339. package/dist-server/service/training/training-service.js +455 -0
  340. package/dist-server/service/training/training-service.js.map +1 -0
  341. package/dist-server/service/training/training-type.d.ts +94 -0
  342. package/dist-server/service/training/training-type.js +352 -0
  343. package/dist-server/service/training/training-type.js.map +1 -0
  344. package/dist-server/service/training/training.d.ts +127 -0
  345. package/dist-server/service/training/training.js +448 -0
  346. package/dist-server/service/training/training.js.map +1 -0
  347. package/dist-server/tsconfig.tsbuildinfo +1 -0
  348. package/package.json +61 -4
  349. package/things-factory.config.js +19 -0
  350. package/translations/en.json +610 -0
  351. package/translations/es.json +610 -0
  352. package/translations/ja.json +610 -0
  353. package/translations/ko.json +610 -0
  354. package/translations/ms.json +610 -0
  355. package/translations/zh.json +610 -0
  356. package/README.md +0 -3
@@ -0,0 +1,370 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@operato/input/ox-input-file.js';
3
+ import '@operato/input/ox-input-select-buttons.js';
4
+ import '@operato/list-state/ox-page-state.js';
5
+ import gql from 'graphql-tag';
6
+ import { css, html, nothing } from 'lit';
7
+ import { customElement, state } from 'lit/decorators.js';
8
+ import { client, uploadContext } from '@operato/graphql';
9
+ import { i18next, localize } from '@operato/i18n';
10
+ import { notify } from '@operato/layout';
11
+ import { OxPrompt } from '@operato/popup/ox-prompt.js';
12
+ import { navigate, PageView } from '@operato/shell';
13
+ import { CommonButtonStyles, DocumentPageStyles, FormFieldStyles, ScrollbarStyles } from '@operato/styles';
14
+ import { VERSION_VIEW } from '../regulation/regulation-fragments.js';
15
+ import { failureOf, PROCEDURE_KINDS, PROCEDURE_METHODS, wordOf } from '../words.js';
16
+ /**
17
+ * 규정 한 건 (ADR-0187 decisions 2-6) - its versions, and of the one chosen: its text, the day it takes effect, what
18
+ * changed, whether it is against the workers, the procedure with its papers, its approval and whether the employees were
19
+ * told. A version being written changes here; one in approval is taken back to change; an adopted one stays and gets its
20
+ * filing.
21
+ */
22
+ let RegulationDetail = class RegulationDetail extends localize(i18next)(PageView) {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.view = null;
26
+ this.failure = '';
27
+ this.chosen = '';
28
+ this.draft = {};
29
+ this.employees = null;
30
+ this.procedure = { kind: 'OPINION', day: '', method: '', workersCount: '', consentCount: '', notes: '' };
31
+ this.files = [];
32
+ }
33
+ static { this.styles = [
34
+ DocumentPageStyles,
35
+ FormFieldStyles,
36
+ ScrollbarStyles,
37
+ css `
38
+ :host {
39
+ display: block;
40
+ overflow: auto;
41
+ }
42
+ .field {
43
+ display: flex;
44
+ flex-direction: column;
45
+ gap: var(--spacing-small, 4px);
46
+ }
47
+ .field > span:not(:first-child) {
48
+ color: var(--ui-muted, var(--md-sys-color-on-surface-variant));
49
+ font-size: var(--ui-t-small, 12px);
50
+ }
51
+ .form {
52
+ display: grid;
53
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
54
+ gap: var(--spacing-large, 12px);
55
+ }
56
+ textarea.body {
57
+ width: 100%;
58
+ min-height: 320px;
59
+ box-sizing: border-box;
60
+ font-family: inherit;
61
+ }
62
+ table {
63
+ border-collapse: collapse;
64
+ width: 100%;
65
+ }
66
+ td,
67
+ th {
68
+ text-align: left;
69
+ padding: var(--spacing-small, 4px) var(--spacing-medium, 8px);
70
+ border-bottom: 1px solid var(--ui-line-soft, var(--md-sys-color-outline-variant));
71
+ }
72
+ .note {
73
+ color: var(--ui-warn, var(--md-sys-color-error));
74
+ }
75
+ .muted {
76
+ color: var(--ui-muted, var(--md-sys-color-on-surface-variant));
77
+ }
78
+ .procedure-form {
79
+ display: grid;
80
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
81
+ gap: var(--spacing-medium, 8px);
82
+ align-items: end;
83
+ }
84
+ `
85
+ ]; }
86
+ get context() {
87
+ const version = this.current?.version;
88
+ const actions = [];
89
+ if (version?.status === 'DRAFT') {
90
+ actions.push({ title: i18next.t('button.regulation-version-delete'), action: () => this.deleteVersion(), ...CommonButtonStyles.delete });
91
+ actions.push({ title: i18next.t('button.save'), action: () => this.saveVersion() });
92
+ actions.push({ title: i18next.t('button.regulation-submit'), icon: 'approval', action: () => this.submit(), raised: true });
93
+ }
94
+ if (version?.status === 'IN_APPROVAL')
95
+ actions.push({ title: i18next.t('button.regulation-withdraw'), icon: 'undo', action: () => this.withdraw() });
96
+ if (this.view && !this.view.versions.some((one) => one.version.status !== 'ADOPTED'))
97
+ actions.push({ title: i18next.t('button.regulation-new-version'), icon: 'add', action: () => this.newVersion() });
98
+ return { title: this.view ? this.view.regulation.name : i18next.t('title.regulation-list'), frame: 'document', actions };
99
+ }
100
+ get current() {
101
+ const versions = this.view?.versions ?? [];
102
+ return versions.find((one) => one.version.id === this.chosen) ?? versions[0];
103
+ }
104
+ render() {
105
+ if (this.failure)
106
+ return html `<ox-page-state state="error" .message=${this.failure}></ox-page-state>`;
107
+ if (!this.view)
108
+ return html `<ox-page-state state="loading"></ox-page-state>`;
109
+ const current = this.current;
110
+ const { regulation } = this.view;
111
+ return html `<div class="page">
112
+ <section class="page-section">
113
+ <header class="page-section-header">
114
+ <h3>${regulation.code} · ${wordOf('regulation-kind', regulation.kind)}</h3>
115
+ <div class="page-section-actions"><button @click=${() => navigate('regulation-list')}>${i18next.t('button.regulation-all')}</button></div>
116
+ </header>
117
+ <ox-input-select-buttons
118
+ .value=${current.version.id}
119
+ .options=${this.view.versions.map((one) => ({ value: one.version.id, display: `${i18next.t('text.regulation-version-of', { version: one.version.version })} · ${wordOf('regulation-period', one.period)}` }))}
120
+ @change=${(e) => e.detail && this.choose(e.detail)}
121
+ ></ox-input-select-buttons>
122
+ </section>
123
+ ${current ? this.renderVersion(current) : nothing}
124
+ </div>`;
125
+ }
126
+ renderVersion(view) {
127
+ const { version } = view;
128
+ const writing = version.status === 'DRAFT';
129
+ const value = (name) => this.draft[name] ?? version[name] ?? '';
130
+ const set = (name, given) => (this.draft = { ...this.draft, [name]: given });
131
+ const words = { ADDED: i18next.t('text.regulation-change-added'), CHANGED: i18next.t('text.regulation-change-changed'), REMOVED: i18next.t('text.regulation-change-removed') };
132
+ const filing = this.view.regulation.kind === 'WORK_RULES' || this.view.regulation.kind === 'WORK_RULES_ANNEX';
133
+ const kinds = version.status === 'ADOPTED' ? ['FILING'] : writing ? PROCEDURE_KINDS : [];
134
+ return html `<section class="page-section">
135
+ <header class="page-section-header"><h3>${i18next.t('text.regulation-version-of', { version: version.version })} · ${wordOf('regulation-period', view.period)}</h3></header>
136
+ ${version.adoptionNote ? html `<p class="page-section-note note">${version.adoptionNote}</p>` : nothing}
137
+ ${version.status === 'ADOPTED' && !view.told ? html `<p class="page-section-note note">${i18next.t('text.regulation-not-told-note')}</p>` : nothing}
138
+ <div class="form">
139
+ <label class="field">
140
+ <span>${i18next.t('field.regulation-effective-on')}</span>
141
+ <input type="date" ?disabled=${!writing} .value=${value('effectiveOn')} @input=${(e) => set('effectiveOn', e.target.value)} />
142
+ <span>${i18next.t('text.regulation-effective-hint')}</span>
143
+ </label>
144
+ <div class="field">
145
+ <span>${i18next.t('field.regulation-unfavourable')}</span>
146
+ <ox-input-select-buttons
147
+ ?disabled=${!writing}
148
+ .value=${value('unfavourable') === '' ? '' : String(value('unfavourable'))}
149
+ .options=${[{ value: 'true', display: i18next.t('text.regulation-unfavourable-yes') }, { value: 'false', display: i18next.t('text.regulation-unfavourable-no') }]}
150
+ @change=${(e) => writing && e.detail && set('unfavourable', e.detail === 'true')}
151
+ ></ox-input-select-buttons>
152
+ <span>${i18next.t('text.regulation-unfavourable-hint')}</span>
153
+ </div>
154
+ <label class="field">
155
+ <span>${i18next.t('field.regulation-change-summary')}</span>
156
+ <input ?disabled=${!writing} .value=${value('changeSummary')} @input=${(e) => set('changeSummary', e.target.value)} />
157
+ </label>
158
+ </div>
159
+ </section>
160
+ <section class="page-section">
161
+ <header class="page-section-header"><h3>${i18next.t('field.regulation-body')}</h3></header>
162
+ <p class="page-section-note muted">${i18next.t('text.regulation-body-hint')}</p>
163
+ <textarea class="body" ?disabled=${!writing} .value=${value('body')} @input=${(e) => set('body', e.target.value)}></textarea>
164
+ </section>
165
+ ${view.changes.length
166
+ ? html `<section class="page-section">
167
+ <header class="page-section-header"><h3>${i18next.t('text.regulation-changes')}</h3></header>
168
+ <table>
169
+ ${view.changes.map((one) => html `<tr><td>제${one.number}조${one.title ? `(${one.title})` : ''}</td><td>${words[one.change]}</td></tr>`)}
170
+ </table>
171
+ </section>`
172
+ : nothing}
173
+ <section class="page-section">
174
+ <header class="page-section-header"><h3>${i18next.t('text.regulation-procedures')}</h3></header>
175
+ <p class="page-section-note muted">${i18next.t(filing ? 'text.regulation-procedures-hint' : 'text.regulation-procedures-none-asked')}</p>
176
+ <table>
177
+ ${(view.procedures ?? []).map((one) => html `<tr>
178
+ <td>${wordOf('regulation-procedure-kind', one.kind)}</td>
179
+ <td>${one.day}</td>
180
+ <td>${one.method ? wordOf('regulation-procedure-method', one.method) : ''}</td>
181
+ <td>${one.kind === 'CONSENT' ? i18next.t('text.regulation-consent-count', { consented: one.consentCount, workers: one.workersCount }) : ''}</td>
182
+ <td>${i18next.t('text.regulation-files', { count: one.files })}</td>
183
+ <td>${writing ? html `<button class="danger" @click=${() => this.deleteProcedure(one.id)}>${i18next.t('button.delete')}</button>` : nothing}</td>
184
+ </tr>`)}
185
+ </table>
186
+ ${kinds.length ? this.renderProcedureForm(kinds) : nothing}
187
+ </section>`;
188
+ }
189
+ renderProcedureForm(kinds) {
190
+ const kind = kinds.includes(this.procedure.kind) ? this.procedure.kind : kinds[0];
191
+ const set = (name, given) => (this.procedure = { ...this.procedure, kind, [name]: given });
192
+ return html `<div class="procedure-form">
193
+ <div class="field">
194
+ <span>${i18next.t('field.regulation-procedure-kind')}</span>
195
+ <ox-input-select-buttons .value=${kind} .options=${kinds.map(code => ({ value: code, display: wordOf('regulation-procedure-kind', code) }))} @change=${(e) => e.detail && set('kind', e.detail)}></ox-input-select-buttons>
196
+ </div>
197
+ <label class="field"><span>${i18next.t('field.regulation-procedure-day')}</span><input type="date" .value=${this.procedure.day} @input=${(e) => set('day', e.target.value)} /></label>
198
+ <div class="field">
199
+ <span>${i18next.t('field.regulation-procedure-method')}</span>
200
+ <ox-input-select-buttons .value=${this.procedure.method} .options=${PROCEDURE_METHODS[kind].map(code => ({ value: code, display: wordOf('regulation-procedure-method', code) }))} @change=${(e) => set('method', e.detail ?? '')}></ox-input-select-buttons>
201
+ </div>
202
+ ${kind === 'CONSENT'
203
+ ? html `<label class="field">
204
+ <span>${i18next.t('field.regulation-workers-count')}</span>
205
+ <input type="number" min="1" .value=${this.procedure.workersCount} @input=${(e) => set('workersCount', e.target.value)} />
206
+ ${this.employees !== null ? html `<span>${i18next.t('text.regulation-active-employees', { count: this.employees })}</span>` : nothing}
207
+ </label>
208
+ <label class="field"><span>${i18next.t('field.regulation-consent-count')}</span><input type="number" min="0" .value=${this.procedure.consentCount} @input=${(e) => set('consentCount', e.target.value)} /></label>`
209
+ : nothing}
210
+ <label class="field"><span>${i18next.t('field.regulation-procedure-notes')}</span><input .value=${this.procedure.notes} @input=${(e) => set('notes', e.target.value)} /></label>
211
+ <div class="field">
212
+ <span>${i18next.t('field.regulation-procedure-files')}</span>
213
+ <ox-input-file multiple .value=${this.files} @change=${(e) => (this.files = e.detail ?? [])}></ox-input-file>
214
+ </div>
215
+ <button @click=${() => this.recordProcedure(kind)}>${i18next.t('button.regulation-procedure-record')}</button>
216
+ </div>`;
217
+ }
218
+ async pageUpdated(changes, lifecycle) {
219
+ if (!this.active)
220
+ return;
221
+ const params = new URLSearchParams(location.search);
222
+ this.chosen = params.get('version') ?? this.chosen;
223
+ await this.fetch(params.get('id') ?? lifecycle?.params?.id);
224
+ }
225
+ async fetch(id = this.view?.regulation?.id) {
226
+ if (!id)
227
+ return;
228
+ try {
229
+ const response = await client.query({
230
+ query: gql `
231
+ query ($id: String) {
232
+ companyRegulation(id: $id) {
233
+ regulation { id code name kind topics }
234
+ versions {
235
+ ...RegulationVersionViewFields
236
+ procedures { id kind day method workersCount consentCount notes files }
237
+ }
238
+ }
239
+ activeEmployeeCount
240
+ }
241
+ ${VERSION_VIEW}
242
+ `,
243
+ variables: { id },
244
+ fetchPolicy: 'no-cache'
245
+ });
246
+ if (response.errors?.length)
247
+ throw response;
248
+ this.view = response.data.companyRegulation;
249
+ this.employees = response.data.activeEmployeeCount;
250
+ this.failure = '';
251
+ this.updateContext();
252
+ }
253
+ catch (error) {
254
+ this.failure = failureOf(error);
255
+ }
256
+ }
257
+ choose(id) {
258
+ this.chosen = id;
259
+ this.draft = {};
260
+ this.updateContext();
261
+ }
262
+ async call(mutation, variables, done = 'text.regulation-saved', context) {
263
+ try {
264
+ const response = await client.mutate({ mutation, variables, ...(context ? { context } : {}) });
265
+ if (response.errors?.length)
266
+ throw response;
267
+ notify({ message: i18next.t(done) });
268
+ this.draft = {};
269
+ await this.fetch();
270
+ return response.data;
271
+ }
272
+ catch (error) {
273
+ notify({ level: 'error', message: failureOf(error) });
274
+ return null;
275
+ }
276
+ }
277
+ patchOf() {
278
+ const patch = { ...this.draft };
279
+ if (patch.effectiveOn === '')
280
+ patch.effectiveOn = null;
281
+ return patch;
282
+ }
283
+ async saveVersion() {
284
+ if (!Object.keys(this.draft).length)
285
+ return;
286
+ await this.call(gql `mutation ($id: String!, $patch: RegulationVersionPatch!) { updateRegulationVersion(id: $id, patch: $patch) { id } }`, { id: this.current.version.id, patch: this.patchOf() });
287
+ }
288
+ async submit() {
289
+ const id = this.current.version.id;
290
+ if (Object.keys(this.draft).length && !(await this.call(gql `mutation ($id: String!, $patch: RegulationVersionPatch!) { updateRegulationVersion(id: $id, patch: $patch) { id } }`, { id, patch: this.patchOf() })))
291
+ return;
292
+ const confirmed = await OxPrompt.open({
293
+ title: i18next.t('button.regulation-submit'),
294
+ text: i18next.t('text.regulation-submit-confirm'),
295
+ confirmButton: { text: i18next.t('button.regulation-submit') },
296
+ cancelButton: { text: i18next.t('button.cancel') }
297
+ });
298
+ if (confirmed)
299
+ await this.call(gql `mutation ($id: String!) { submitRegulationVersion(id: $id) { id status } }`, { id }, 'text.regulation-submitted');
300
+ }
301
+ async withdraw() {
302
+ await this.call(gql `mutation ($id: String!) { withdrawRegulationVersion(id: $id) { id } }`, { id: this.current.version.id });
303
+ }
304
+ async newVersion() {
305
+ const data = await this.call(gql `mutation ($id: String!) { newRegulationVersion(regulationId: $id) { id } }`, { id: this.view.regulation.id });
306
+ if (data)
307
+ this.choose(data.newRegulationVersion.id);
308
+ }
309
+ async deleteVersion() {
310
+ const confirmed = await OxPrompt.open({
311
+ title: i18next.t('button.regulation-version-delete'),
312
+ text: i18next.t('text.regulation-version-delete-confirm'),
313
+ confirmButton: { text: i18next.t('button.delete'), destructive: true },
314
+ cancelButton: { text: i18next.t('button.cancel') }
315
+ });
316
+ if (confirmed && (await this.call(gql `mutation ($id: String!) { deleteRegulationVersion(id: $id) }`, { id: this.current.version.id })))
317
+ this.chosen = '';
318
+ }
319
+ async recordProcedure(kind) {
320
+ const { day, method, workersCount, consentCount, notes } = this.procedure;
321
+ const done = await this.call(gql `
322
+ mutation ($procedure: NewRegulationProcedure!, $files: [Upload!]) {
323
+ recordRegulationProcedure(procedure: $procedure, files: $files) { id }
324
+ }
325
+ `, {
326
+ procedure: { versionId: this.current.version.id, kind, day, method: method || null, workersCount: workersCount === '' ? null : Number(workersCount), consentCount: consentCount === '' ? null : Number(consentCount), notes: notes || null },
327
+ files: this.files
328
+ }, 'text.regulation-saved', this.files.length ? uploadContext(() => { }) : undefined);
329
+ if (done) {
330
+ this.procedure = { kind: 'OPINION', day: '', method: '', workersCount: '', consentCount: '', notes: '' };
331
+ this.files = [];
332
+ }
333
+ }
334
+ async deleteProcedure(id) {
335
+ await this.call(gql `mutation ($id: String!) { deleteRegulationProcedure(id: $id) }`, { id });
336
+ }
337
+ };
338
+ __decorate([
339
+ state(),
340
+ __metadata("design:type", Object)
341
+ ], RegulationDetail.prototype, "view", void 0);
342
+ __decorate([
343
+ state(),
344
+ __metadata("design:type", Object)
345
+ ], RegulationDetail.prototype, "failure", void 0);
346
+ __decorate([
347
+ state(),
348
+ __metadata("design:type", Object)
349
+ ], RegulationDetail.prototype, "chosen", void 0);
350
+ __decorate([
351
+ state(),
352
+ __metadata("design:type", Object)
353
+ ], RegulationDetail.prototype, "draft", void 0);
354
+ __decorate([
355
+ state(),
356
+ __metadata("design:type", Object)
357
+ ], RegulationDetail.prototype, "employees", void 0);
358
+ __decorate([
359
+ state(),
360
+ __metadata("design:type", Object)
361
+ ], RegulationDetail.prototype, "procedure", void 0);
362
+ __decorate([
363
+ state(),
364
+ __metadata("design:type", Array)
365
+ ], RegulationDetail.prototype, "files", void 0);
366
+ RegulationDetail = __decorate([
367
+ customElement('regulation-detail')
368
+ ], RegulationDetail);
369
+ export { RegulationDetail };
370
+ //# sourceMappingURL=regulation-detail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regulation-detail.js","sourceRoot":"","sources":["../../client/pages/regulation-detail.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AACxC,OAAO,2CAA2C,CAAA;AAClD,OAAO,sCAAsC,CAAA;AAE7C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAExD,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAE1G,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;A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AK,EAAE;;+CAAwB;AACf;IAAhB,KAAK,EAAE;;mDAAwC;AAC/B;IAAhB,KAAK,EAAE;;mDAAiH;AACxG;IAAhB,KAAK,EAAE;;+CAA2B;AA7DxB,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAkU5B","sourcesContent":["import '@operato/input/ox-input-file.js'\nimport '@operato/input/ox-input-select-buttons.js'\nimport '@operato/list-state/ox-page-state.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\n\nimport { client, uploadContext } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\nimport { navigate, PageView } from '@operato/shell'\nimport { CommonButtonStyles, DocumentPageStyles, FormFieldStyles, ScrollbarStyles } from '@operato/styles'\n\nimport { VERSION_VIEW } from '../regulation/regulation-fragments.js'\nimport { failureOf, PROCEDURE_KINDS, PROCEDURE_METHODS, wordOf } from '../words.js'\n\n/**\n * 규정 한 건 (ADR-0187 decisions 2-6) - its versions, and of the one chosen: its text, the day it takes effect, what\n * changed, whether it is against the workers, the procedure with its papers, its approval and whether the employees were\n * told. A version being written changes here; one in approval is taken back to change; an adopted one stays and gets its\n * filing.\n */\n@customElement('regulation-detail')\nexport class RegulationDetail extends localize(i18next)(PageView) {\n static styles = [\n DocumentPageStyles,\n FormFieldStyles,\n ScrollbarStyles,\n css`\n :host {\n display: block;\n overflow: auto;\n }\n .field {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-small, 4px);\n }\n .field > span:not(:first-child) {\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n font-size: var(--ui-t-small, 12px);\n }\n .form {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));\n gap: var(--spacing-large, 12px);\n }\n textarea.body {\n width: 100%;\n min-height: 320px;\n box-sizing: border-box;\n font-family: inherit;\n }\n table {\n border-collapse: collapse;\n width: 100%;\n }\n td,\n th {\n text-align: left;\n padding: var(--spacing-small, 4px) var(--spacing-medium, 8px);\n border-bottom: 1px solid var(--ui-line-soft, var(--md-sys-color-outline-variant));\n }\n .note {\n color: var(--ui-warn, var(--md-sys-color-error));\n }\n .muted {\n color: var(--ui-muted, var(--md-sys-color-on-surface-variant));\n }\n .procedure-form {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));\n gap: var(--spacing-medium, 8px);\n align-items: end;\n }\n `\n ]\n\n @state() private view: any = null\n @state() private failure = ''\n @state() private chosen = ''\n @state() private draft: any = {}\n @state() private employees: number | null = null\n @state() private procedure: any = { kind: 'OPINION', day: '', method: '', workersCount: '', consentCount: '', notes: '' }\n @state() private files: File[] = []\n\n get context() {\n const version = this.current?.version\n const actions: any[] = []\n if (version?.status === 'DRAFT') {\n actions.push({ title: i18next.t('button.regulation-version-delete'), action: () => this.deleteVersion(), ...CommonButtonStyles.delete })\n actions.push({ title: i18next.t('button.save'), action: () => this.saveVersion() })\n actions.push({ title: i18next.t('button.regulation-submit'), icon: 'approval', action: () => this.submit(), raised: true })\n }\n if (version?.status === 'IN_APPROVAL') actions.push({ title: i18next.t('button.regulation-withdraw'), icon: 'undo', action: () => this.withdraw() })\n if (this.view && !this.view.versions.some((one: any) => one.version.status !== 'ADOPTED')) actions.push({ title: i18next.t('button.regulation-new-version'), icon: 'add', action: () => this.newVersion() })\n return { title: this.view ? this.view.regulation.name : i18next.t('title.regulation-list'), frame: 'document', actions }\n }\n\n private get current() {\n const versions = this.view?.versions ?? []\n return versions.find((one: any) => one.version.id === this.chosen) ?? versions[0]\n }\n\n render() {\n if (this.failure) return html`<ox-page-state state=\"error\" .message=${this.failure}></ox-page-state>`\n if (!this.view) return html`<ox-page-state state=\"loading\"></ox-page-state>`\n const current = this.current\n const { regulation } = this.view\n return html`<div class=\"page\">\n <section class=\"page-section\">\n <header class=\"page-section-header\">\n <h3>${regulation.code} · ${wordOf('regulation-kind', regulation.kind)}</h3>\n <div class=\"page-section-actions\"><button @click=${() => navigate('regulation-list')}>${i18next.t('button.regulation-all')}</button></div>\n </header>\n <ox-input-select-buttons\n .value=${current.version.id}\n .options=${this.view.versions.map((one: any) => ({ value: one.version.id, display: `${i18next.t('text.regulation-version-of', { version: one.version.version })} · ${wordOf('regulation-period', one.period)}` }))}\n @change=${(e: CustomEvent) => e.detail && this.choose(e.detail)}\n ></ox-input-select-buttons>\n </section>\n ${current ? this.renderVersion(current) : nothing}\n </div>`\n }\n\n private renderVersion(view: any) {\n const { version } = view\n const writing = version.status === 'DRAFT'\n const value = (name: string) => this.draft[name] ?? version[name] ?? ''\n const set = (name: string, given: any) => (this.draft = { ...this.draft, [name]: given })\n const words: Record<string, string> = { ADDED: i18next.t('text.regulation-change-added'), CHANGED: i18next.t('text.regulation-change-changed'), REMOVED: i18next.t('text.regulation-change-removed') }\n const filing = this.view.regulation.kind === 'WORK_RULES' || this.view.regulation.kind === 'WORK_RULES_ANNEX'\n const kinds = version.status === 'ADOPTED' ? ['FILING'] : writing ? PROCEDURE_KINDS : []\n return html`<section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('text.regulation-version-of', { version: version.version })} · ${wordOf('regulation-period', view.period)}</h3></header>\n ${version.adoptionNote ? html`<p class=\"page-section-note note\">${version.adoptionNote}</p>` : nothing}\n ${version.status === 'ADOPTED' && !view.told ? html`<p class=\"page-section-note note\">${i18next.t('text.regulation-not-told-note')}</p>` : nothing}\n <div class=\"form\">\n <label class=\"field\">\n <span>${i18next.t('field.regulation-effective-on')}</span>\n <input type=\"date\" ?disabled=${!writing} .value=${value('effectiveOn')} @input=${(e: any) => set('effectiveOn', e.target.value)} />\n <span>${i18next.t('text.regulation-effective-hint')}</span>\n </label>\n <div class=\"field\">\n <span>${i18next.t('field.regulation-unfavourable')}</span>\n <ox-input-select-buttons\n ?disabled=${!writing}\n .value=${value('unfavourable') === '' ? '' : String(value('unfavourable'))}\n .options=${[{ value: 'true', display: i18next.t('text.regulation-unfavourable-yes') }, { value: 'false', display: i18next.t('text.regulation-unfavourable-no') }]}\n @change=${(e: CustomEvent) => writing && e.detail && set('unfavourable', e.detail === 'true')}\n ></ox-input-select-buttons>\n <span>${i18next.t('text.regulation-unfavourable-hint')}</span>\n </div>\n <label class=\"field\">\n <span>${i18next.t('field.regulation-change-summary')}</span>\n <input ?disabled=${!writing} .value=${value('changeSummary')} @input=${(e: any) => set('changeSummary', e.target.value)} />\n </label>\n </div>\n </section>\n <section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('field.regulation-body')}</h3></header>\n <p class=\"page-section-note muted\">${i18next.t('text.regulation-body-hint')}</p>\n <textarea class=\"body\" ?disabled=${!writing} .value=${value('body')} @input=${(e: any) => set('body', e.target.value)}></textarea>\n </section>\n ${view.changes.length\n ? html`<section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('text.regulation-changes')}</h3></header>\n <table>\n ${view.changes.map((one: any) => html`<tr><td>제${one.number}조${one.title ? `(${one.title})` : ''}</td><td>${words[one.change]}</td></tr>`)}\n </table>\n </section>`\n : nothing}\n <section class=\"page-section\">\n <header class=\"page-section-header\"><h3>${i18next.t('text.regulation-procedures')}</h3></header>\n <p class=\"page-section-note muted\">${i18next.t(filing ? 'text.regulation-procedures-hint' : 'text.regulation-procedures-none-asked')}</p>\n <table>\n ${(view.procedures ?? []).map(\n (one: any) =>\n html`<tr>\n <td>${wordOf('regulation-procedure-kind', one.kind)}</td>\n <td>${one.day}</td>\n <td>${one.method ? wordOf('regulation-procedure-method', one.method) : ''}</td>\n <td>${one.kind === 'CONSENT' ? i18next.t('text.regulation-consent-count', { consented: one.consentCount, workers: one.workersCount }) : ''}</td>\n <td>${i18next.t('text.regulation-files', { count: one.files })}</td>\n <td>${writing ? html`<button class=\"danger\" @click=${() => this.deleteProcedure(one.id)}>${i18next.t('button.delete')}</button>` : nothing}</td>\n </tr>`\n )}\n </table>\n ${kinds.length ? this.renderProcedureForm(kinds) : nothing}\n </section>`\n }\n\n private renderProcedureForm(kinds: string[]) {\n const kind = kinds.includes(this.procedure.kind) ? this.procedure.kind : kinds[0]\n const set = (name: string, given: any) => (this.procedure = { ...this.procedure, kind, [name]: given })\n return html`<div class=\"procedure-form\">\n <div class=\"field\">\n <span>${i18next.t('field.regulation-procedure-kind')}</span>\n <ox-input-select-buttons .value=${kind} .options=${kinds.map(code => ({ value: code, display: wordOf('regulation-procedure-kind', code) }))} @change=${(e: CustomEvent) => e.detail && set('kind', e.detail)}></ox-input-select-buttons>\n </div>\n <label class=\"field\"><span>${i18next.t('field.regulation-procedure-day')}</span><input type=\"date\" .value=${this.procedure.day} @input=${(e: any) => set('day', e.target.value)} /></label>\n <div class=\"field\">\n <span>${i18next.t('field.regulation-procedure-method')}</span>\n <ox-input-select-buttons .value=${this.procedure.method} .options=${PROCEDURE_METHODS[kind].map(code => ({ value: code, display: wordOf('regulation-procedure-method', code) }))} @change=${(e: CustomEvent) => set('method', e.detail ?? '')}></ox-input-select-buttons>\n </div>\n ${kind === 'CONSENT'\n ? html`<label class=\"field\">\n <span>${i18next.t('field.regulation-workers-count')}</span>\n <input type=\"number\" min=\"1\" .value=${this.procedure.workersCount} @input=${(e: any) => set('workersCount', e.target.value)} />\n ${this.employees !== null ? html`<span>${i18next.t('text.regulation-active-employees', { count: this.employees })}</span>` : nothing}\n </label>\n <label class=\"field\"><span>${i18next.t('field.regulation-consent-count')}</span><input type=\"number\" min=\"0\" .value=${this.procedure.consentCount} @input=${(e: any) => set('consentCount', e.target.value)} /></label>`\n : nothing}\n <label class=\"field\"><span>${i18next.t('field.regulation-procedure-notes')}</span><input .value=${this.procedure.notes} @input=${(e: any) => set('notes', e.target.value)} /></label>\n <div class=\"field\">\n <span>${i18next.t('field.regulation-procedure-files')}</span>\n <ox-input-file multiple .value=${this.files} @change=${(e: CustomEvent) => (this.files = e.detail ?? [])}></ox-input-file>\n </div>\n <button @click=${() => this.recordProcedure(kind)}>${i18next.t('button.regulation-procedure-record')}</button>\n </div>`\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (!this.active) return\n const params = new URLSearchParams(location.search)\n this.chosen = params.get('version') ?? this.chosen\n await this.fetch(params.get('id') ?? lifecycle?.params?.id)\n }\n\n private async fetch(id = this.view?.regulation?.id) {\n if (!id) return\n try {\n const response = await client.query({\n query: gql`\n query ($id: String) {\n companyRegulation(id: $id) {\n regulation { id code name kind topics }\n versions {\n ...RegulationVersionViewFields\n procedures { id kind day method workersCount consentCount notes files }\n }\n }\n activeEmployeeCount\n }\n ${VERSION_VIEW}\n `,\n variables: { id },\n fetchPolicy: 'no-cache'\n })\n if ((response as any).errors?.length) throw response\n this.view = response.data.companyRegulation\n this.employees = response.data.activeEmployeeCount\n this.failure = ''\n this.updateContext()\n } catch (error) {\n this.failure = failureOf(error)\n }\n }\n\n private choose(id: string) {\n this.chosen = id\n this.draft = {}\n this.updateContext()\n }\n\n private async call(mutation: any, variables: any, done = 'text.regulation-saved', context?: any) {\n try {\n const response = await client.mutate({ mutation, variables, ...(context ? { context } : {}) })\n if ((response as any).errors?.length) throw response\n notify({ message: i18next.t(done) })\n this.draft = {}\n await this.fetch()\n return response.data\n } catch (error) {\n notify({ level: 'error', message: failureOf(error) })\n return null\n }\n }\n\n private patchOf() {\n const patch: any = { ...this.draft }\n if (patch.effectiveOn === '') patch.effectiveOn = null\n return patch\n }\n\n private async saveVersion() {\n if (!Object.keys(this.draft).length) return\n await this.call(gql`mutation ($id: String!, $patch: RegulationVersionPatch!) { updateRegulationVersion(id: $id, patch: $patch) { id } }`, { id: this.current.version.id, patch: this.patchOf() })\n }\n\n private async submit() {\n const id = this.current.version.id\n if (Object.keys(this.draft).length && !(await this.call(gql`mutation ($id: String!, $patch: RegulationVersionPatch!) { updateRegulationVersion(id: $id, patch: $patch) { id } }`, { id, patch: this.patchOf() }))) return\n const confirmed = await OxPrompt.open({\n title: i18next.t('button.regulation-submit'),\n text: i18next.t('text.regulation-submit-confirm'),\n confirmButton: { text: i18next.t('button.regulation-submit') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n if (confirmed) await this.call(gql`mutation ($id: String!) { submitRegulationVersion(id: $id) { id status } }`, { id }, 'text.regulation-submitted')\n }\n\n private async withdraw() {\n await this.call(gql`mutation ($id: String!) { withdrawRegulationVersion(id: $id) { id } }`, { id: this.current.version.id })\n }\n\n private async newVersion() {\n const data = await this.call(gql`mutation ($id: String!) { newRegulationVersion(regulationId: $id) { id } }`, { id: this.view.regulation.id })\n if (data) this.choose(data.newRegulationVersion.id)\n }\n\n private async deleteVersion() {\n const confirmed = await OxPrompt.open({\n title: i18next.t('button.regulation-version-delete'),\n text: i18next.t('text.regulation-version-delete-confirm'),\n confirmButton: { text: i18next.t('button.delete'), destructive: true },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n if (confirmed && (await this.call(gql`mutation ($id: String!) { deleteRegulationVersion(id: $id) }`, { id: this.current.version.id }))) this.chosen = ''\n }\n\n private async recordProcedure(kind: string) {\n const { day, method, workersCount, consentCount, notes } = this.procedure\n const done = await this.call(\n gql`\n mutation ($procedure: NewRegulationProcedure!, $files: [Upload!]) {\n recordRegulationProcedure(procedure: $procedure, files: $files) { id }\n }\n `,\n {\n procedure: { versionId: this.current.version.id, kind, day, method: method || null, workersCount: workersCount === '' ? null : Number(workersCount), consentCount: consentCount === '' ? null : Number(consentCount), notes: notes || null },\n files: this.files\n },\n 'text.regulation-saved',\n this.files.length ? uploadContext(() => {}) : undefined\n )\n if (done) {\n this.procedure = { kind: 'OPINION', day: '', method: '', workersCount: '', consentCount: '', notes: '' }\n this.files = []\n }\n }\n\n private async deleteProcedure(id: string) {\n await this.call(gql`mutation ($id: String!) { deleteRegulationProcedure(id: $id) }`, { id })\n }\n}\n"]}
@@ -0,0 +1,52 @@
1
+ import '@operato/data-grist/ox-grist.js';
2
+ import { PageView } from '@operato/shell';
3
+ declare const RegulationList_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
4
+ /**
5
+ * 규정 (ADR-0187 decisions 2-6) - the company's rules for their keepers: each with the version in force, the one adopted
6
+ * to come, the one being written or in approval, and whether the version in force was filed and told. A rule opens on
7
+ * its versions; a new one is written from its form.
8
+ */
9
+ export declare class RegulationList extends RegulationList_base {
10
+ static styles: import("lit").CSSResult[];
11
+ gristConfig: any;
12
+ private grist;
13
+ get context(): {
14
+ title: string;
15
+ search: {
16
+ handler: (search: string) => string;
17
+ value: string;
18
+ };
19
+ actions: ({
20
+ title: string;
21
+ icon: string;
22
+ action: () => Promise<void>;
23
+ } | {
24
+ title: string;
25
+ icon: string;
26
+ action: () => Promise<boolean>;
27
+ } | {
28
+ icon: string;
29
+ emphasis: {
30
+ raised: boolean;
31
+ outlined: boolean;
32
+ dense: boolean;
33
+ danger: boolean;
34
+ };
35
+ title: string;
36
+ action: () => Promise<void>;
37
+ })[];
38
+ exportable: {
39
+ name: string;
40
+ data: () => any[];
41
+ };
42
+ };
43
+ render(): import("lit-html").TemplateResult<1>;
44
+ pageInitialized(): Promise<void>;
45
+ fetchHandler(): Promise<{
46
+ total: any;
47
+ records: any;
48
+ }>;
49
+ private create;
50
+ private delete;
51
+ }
52
+ export {};
@@ -0,0 +1,144 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@operato/data-grist/ox-grist.js';
3
+ import gql from 'graphql-tag';
4
+ import { html } from 'lit';
5
+ import { customElement, query, state } from 'lit/decorators.js';
6
+ import { DataGrist } from '@operato/data-grist';
7
+ import { client } from '@operato/graphql';
8
+ import { i18next, localize } from '@operato/i18n';
9
+ import { notify } from '@operato/layout';
10
+ import { OxPrompt } from '@operato/popup/ox-prompt.js';
11
+ import { navigate, PageView } from '@operato/shell';
12
+ import { CommonButtonStyles, CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
13
+ import { isMobileDevice } from '@operato/utils';
14
+ import { openRegulationForm } from '../components/regulation-form.js';
15
+ import { failureOf, wordOf } from '../words.js';
16
+ /**
17
+ * 규정 (ADR-0187 decisions 2-6) - the company's rules for their keepers: each with the version in force, the one adopted
18
+ * to come, the one being written or in approval, and whether the version in force was filed and told. A rule opens on
19
+ * its versions; a new one is written from its form.
20
+ */
21
+ let RegulationList = class RegulationList extends localize(i18next)(PageView) {
22
+ static { this.styles = [WorkSurfacePageStyles, CommonGristStyles, CommonHeaderStyles, ScrollbarStyles]; }
23
+ get context() {
24
+ return {
25
+ title: i18next.t('title.regulation-list'),
26
+ search: { handler: (search) => (this.grist.searchText = search), value: this.grist?.searchText || '' },
27
+ actions: [
28
+ { title: i18next.t('button.regulation-new'), icon: 'add', action: () => this.create() },
29
+ { title: i18next.t('button.regulation-employee-view'), icon: 'visibility', action: () => navigate('regulations') },
30
+ { title: i18next.t('button.delete'), action: () => this.delete(), ...CommonButtonStyles.delete }
31
+ ],
32
+ exportable: { name: i18next.t('title.regulation-list'), data: () => this.grist.exportRecords() }
33
+ };
34
+ }
35
+ render() {
36
+ return html `<ox-grist class="page-fill" search-mode="term" .mode=${isMobileDevice() ? 'CARD' : 'GRID'} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}></ox-grist>`;
37
+ }
38
+ async pageInitialized() {
39
+ const header = (name) => i18next.t(`field.regulation-${name.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()}`);
40
+ const shown = (name, width, renderer, extra = {}) => ({
41
+ type: 'string',
42
+ name,
43
+ header: header(name),
44
+ width,
45
+ ...extra,
46
+ record: { renderer, ...extra.record }
47
+ });
48
+ const day = (value) => value ?? '';
49
+ this.gristConfig = {
50
+ rows: { appendable: false, selectable: { multiple: true }, handlers: { click: (columns, data, column, record) => record?.id && navigate(`regulation-detail?id=${record.id}`) } },
51
+ pagination: { infinite: true },
52
+ emptyNote: { title: i18next.t('text.regulation-empty'), description: i18next.t('text.regulation-empty-description') },
53
+ list: { fields: ['name', 'inForce'], details: ['kind', 'open'] },
54
+ columns: [
55
+ { type: 'gutter', gutterName: 'sequence' },
56
+ { type: 'gutter', gutterName: 'row-selector', multiple: true },
57
+ shown('code', 90),
58
+ shown('name', 180),
59
+ shown('kind', 120, value => wordOf('regulation-kind', value)),
60
+ shown('inForce', 140, value => (value ? i18next.t('text.regulation-in-force', { version: value.version, day: value.effectiveOn }) : i18next.t('text.regulation-none-in-force'))),
61
+ shown('due', 140, value => (value ? i18next.t('text.regulation-due', { version: value.version, day: value.effectiveOn }) : '')),
62
+ shown('open', 130, value => (value ? `${i18next.t('text.regulation-version-of', { version: value.version })} · ${wordOf('regulation-period', value.status)}` : '')),
63
+ shown('filed', 90, value => (value === null ? '' : value ? i18next.t('text.regulation-filed') : i18next.t('text.regulation-not-filed'))),
64
+ shown('told', 110, value => (value === null ? '' : value ? i18next.t('text.regulation-told') : i18next.t('text.regulation-not-told'))),
65
+ shown('topics', 160, value => (value ?? []).join(', ')),
66
+ shown('effectiveOn', 0, day, { hidden: true })
67
+ ]
68
+ };
69
+ }
70
+ async fetchHandler() {
71
+ const response = await client.query({
72
+ query: gql `
73
+ query {
74
+ companyRegulations {
75
+ regulation { id code name kind topics }
76
+ inForce { told version { id version effectiveOn } procedures { kind } }
77
+ due { told version { id version effectiveOn } }
78
+ versions { version { id version status } }
79
+ }
80
+ }
81
+ `,
82
+ fetchPolicy: 'network-only'
83
+ });
84
+ if (response.errors?.length)
85
+ throw response;
86
+ const search = (this.grist?.searchText ?? '').trim();
87
+ const records = response.data.companyRegulations
88
+ .map((one) => {
89
+ const open = one.versions.find((view) => view.version.status !== 'ADOPTED')?.version;
90
+ const filing = one.regulation.kind === 'WORK_RULES' || one.regulation.kind === 'WORK_RULES_ANNEX';
91
+ return {
92
+ ...one.regulation,
93
+ inForce: one.inForce?.version ?? null,
94
+ due: one.due?.version ?? null,
95
+ open: open ?? null,
96
+ filed: one.inForce && filing ? one.inForce.procedures?.some((procedure) => procedure.kind === 'FILING') : null,
97
+ told: one.inForce ? one.inForce.told : null
98
+ };
99
+ })
100
+ .filter((one) => !search || `${one.code} ${one.name}`.includes(search));
101
+ return { total: records.length, records };
102
+ }
103
+ async create() {
104
+ const created = await openRegulationForm();
105
+ if (created)
106
+ navigate(`regulation-detail?id=${created.id}`);
107
+ }
108
+ async delete() {
109
+ const ids = this.grist.selected.map((one) => one.id).filter(Boolean);
110
+ if (!ids.length)
111
+ return;
112
+ const confirmed = await OxPrompt.open({
113
+ title: i18next.t('button.delete'),
114
+ text: i18next.t('text.regulation-delete-confirm', { count: ids.length }),
115
+ confirmButton: { text: i18next.t('button.delete'), destructive: true },
116
+ cancelButton: { text: i18next.t('button.cancel') }
117
+ });
118
+ if (!confirmed)
119
+ return;
120
+ try {
121
+ const response = await client.mutate({ mutation: gql `mutation ($ids: [String!]!) { deleteRegulations(ids: $ids) }`, variables: { ids } });
122
+ if (response.errors?.length)
123
+ throw response;
124
+ notify({ message: i18next.t('text.regulation-saved') });
125
+ }
126
+ catch (error) {
127
+ notify({ level: 'error', message: failureOf(error) });
128
+ }
129
+ this.grist.fetch();
130
+ }
131
+ };
132
+ __decorate([
133
+ state(),
134
+ __metadata("design:type", Object)
135
+ ], RegulationList.prototype, "gristConfig", void 0);
136
+ __decorate([
137
+ query('ox-grist'),
138
+ __metadata("design:type", DataGrist)
139
+ ], RegulationList.prototype, "grist", void 0);
140
+ RegulationList = __decorate([
141
+ customElement('regulation-list')
142
+ ], RegulationList);
143
+ export { RegulationList };
144
+ //# sourceMappingURL=regulation-list.js.map