@mediusinc/mng-commons 0.2.0 → 0.2.1-rc

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 (328) hide show
  1. package/.browserslistrc +16 -0
  2. package/karma.conf.js +51 -0
  3. package/ng-package.json +14 -0
  4. package/package.json +3 -24
  5. package/src/lib/api/models/builders/query-param.builder.ts +54 -0
  6. package/src/lib/api/models/filter-match-type.model.ts +25 -0
  7. package/src/lib/api/models/filter-param.model.ts +59 -0
  8. package/{lib/api/models/index.d.ts → src/lib/api/models/index.ts} +10 -8
  9. package/src/lib/api/models/mappers.ts +18 -0
  10. package/{lib/api/models/filter-match-type.model.d.ts → src/lib/api/models/query-mode.model.ts} +18 -23
  11. package/src/lib/api/models/query-param.model.ts +99 -0
  12. package/src/lib/api/models/query-result.model.ts +77 -0
  13. package/{lib/api/models/serialization.model.d.ts → src/lib/api/models/serialization.model.ts} +9 -8
  14. package/src/lib/api/services/crud-api.abstract.service.ts +113 -0
  15. package/{lib/api/services/index.d.ts → src/lib/api/services/index.ts} +1 -1
  16. package/{lib/api/utils/index.d.ts → src/lib/api/utils/index.ts} +2 -2
  17. package/src/lib/api/utils/medius-rest.util.ts +146 -0
  18. package/src/lib/api/utils/object-serializer.util.ts +227 -0
  19. package/src/lib/components/action/action.component.html +30 -0
  20. package/src/lib/components/action/action.component.ts +77 -0
  21. package/src/lib/components/action/dialog/action-dialog.component.html +26 -0
  22. package/src/lib/components/action/dialog/action-dialog.component.ts +171 -0
  23. package/{lib/components/action/index.d.ts → src/lib/components/action/index.ts} +3 -3
  24. package/{lib/components/action/models/action-confirmation-service.model.d.ts → src/lib/components/action/models/action-confirmation-service.model.ts} +7 -6
  25. package/src/lib/components/action/models/action-execution.model.ts +81 -0
  26. package/{lib/components/action/models/index.d.ts → src/lib/components/action/models/index.ts} +2 -2
  27. package/src/lib/components/action/route/action-route.component.html +1 -0
  28. package/src/lib/components/action/route/action-route.component.ts +159 -0
  29. package/src/lib/components/form/autocomplete/autocomplete.component.html +16 -0
  30. package/src/lib/components/form/autocomplete/autocomplete.component.ts +113 -0
  31. package/src/lib/components/form/dropdown/dropdown.component.html +29 -0
  32. package/src/lib/components/form/dropdown/dropdown.component.ts +109 -0
  33. package/src/lib/components/form/editor/form-editor.component.html +5 -0
  34. package/src/lib/components/form/editor/form-editor.component.ts +149 -0
  35. package/src/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.html +7 -0
  36. package/src/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.ts +21 -0
  37. package/src/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.html +9 -0
  38. package/src/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.ts +22 -0
  39. package/src/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.html +8 -0
  40. package/src/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.ts +10 -0
  41. package/src/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.html +56 -0
  42. package/src/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.ts +22 -0
  43. package/src/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.html +13 -0
  44. package/src/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.scss +4 -0
  45. package/src/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.ts +114 -0
  46. package/src/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.html +37 -0
  47. package/src/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.ts +133 -0
  48. package/src/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.html +10 -0
  49. package/src/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.ts +10 -0
  50. package/{lib/components/form/formly/fields/index.d.ts → src/lib/components/form/formly/fields/index.ts} +7 -7
  51. package/src/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.html +7 -0
  52. package/src/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.ts +13 -0
  53. package/src/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.html +6 -0
  54. package/src/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.ts +13 -0
  55. package/{lib/components/form/formly/wrappers/index.d.ts → src/lib/components/form/formly/wrappers/index.ts} +2 -2
  56. package/{lib/components/form/index.d.ts → src/lib/components/form/index.ts} +3 -3
  57. package/src/lib/components/form/models/form-editor.event.ts +7 -0
  58. package/{lib/components/form/models/index.d.ts → src/lib/components/form/models/index.ts} +1 -1
  59. package/src/lib/components/layout/breadcrumb.component.html +5 -0
  60. package/src/lib/components/layout/breadcrumb.component.ts +12 -0
  61. package/src/lib/components/layout/footer.component.html +7 -0
  62. package/src/lib/components/layout/footer.component.ts +15 -0
  63. package/{lib/components/layout/index.d.ts → src/lib/components/layout/index.ts} +6 -6
  64. package/src/lib/components/layout/main-layout.component.html +26 -0
  65. package/src/lib/components/layout/main-layout.component.ts +54 -0
  66. package/src/lib/components/layout/menu-item.component.html +41 -0
  67. package/src/lib/components/layout/menu-item.component.ts +170 -0
  68. package/src/lib/components/layout/menu.component.html +27 -0
  69. package/src/lib/components/layout/menu.component.ts +17 -0
  70. package/{lib/components/layout/services/index.d.ts → src/lib/components/layout/services/index.ts} +1 -1
  71. package/src/lib/components/layout/services/main-layout.component.service.ts +231 -0
  72. package/src/lib/components/layout/topbar.component.html +38 -0
  73. package/src/lib/components/layout/topbar.component.ts +62 -0
  74. package/{lib/components/tableview/index.d.ts → src/lib/components/tableview/index.ts} +5 -5
  75. package/{lib/components/tableview/models/index.d.ts → src/lib/components/tableview/models/index.ts} +1 -1
  76. package/src/lib/components/tableview/models/table.event.ts +22 -0
  77. package/src/lib/components/tableview/route/tableview-route.abstract.component.ts +31 -0
  78. package/{lib/components/tableview/services/index.d.ts → src/lib/components/tableview/services/index.ts} +1 -1
  79. package/src/lib/components/tableview/services/tableview.component.service.ts +22 -0
  80. package/src/lib/components/tableview/table/column-filter/column-filter.component.html +36 -0
  81. package/src/lib/components/tableview/table/column-filter/column-filter.component.ts +70 -0
  82. package/src/lib/components/tableview/table/column-value/column-value.component.html +14 -0
  83. package/src/lib/components/tableview/table/column-value/column-value.component.ts +19 -0
  84. package/src/lib/components/tableview/table/table.component.html +110 -0
  85. package/src/lib/components/tableview/table/table.component.ts +327 -0
  86. package/src/lib/components/tableview/tableview.component.html +37 -0
  87. package/src/lib/components/tableview/tableview.component.ts +78 -0
  88. package/src/lib/config/formly.config.ts +154 -0
  89. package/{lib/config/index.d.ts → src/lib/config/index.ts} +1 -1
  90. package/{lib/config/models/index.d.ts → src/lib/config/models/index.ts} +1 -1
  91. package/{lib/config/models/mng-config.model.d.ts → src/lib/config/models/mng-config.model.ts} +35 -34
  92. package/src/lib/data-providers/base.data-provider.ts +42 -0
  93. package/src/lib/data-providers/editor.data-provider.ts +60 -0
  94. package/{lib/data-providers/index.d.ts → src/lib/data-providers/index.ts} +5 -5
  95. package/src/lib/data-providers/lookup.data-provider.ts +29 -0
  96. package/{lib/data-providers/table.data-provider.d.ts → src/lib/data-providers/table.data-provider.ts} +8 -6
  97. package/src/lib/data-providers/tableview.data-provider.ts +29 -0
  98. package/src/lib/descriptors/action.descriptor.ts +439 -0
  99. package/src/lib/descriptors/editor.descriptor.ts +880 -0
  100. package/src/lib/descriptors/field.validator.ts +35 -0
  101. package/{lib/descriptors/index.d.ts → src/lib/descriptors/index.ts} +7 -7
  102. package/{lib/descriptors/lookup.descriptor.d.ts → src/lib/descriptors/lookup.descriptor.ts} +20 -17
  103. package/src/lib/descriptors/model.descriptor.ts +47 -0
  104. package/src/lib/descriptors/table.descriptor.ts +514 -0
  105. package/src/lib/descriptors/tableview.descriptor.ts +180 -0
  106. package/src/lib/directives/component.directive.ts +18 -0
  107. package/{lib/directives/index.d.ts → src/lib/directives/index.ts} +2 -2
  108. package/src/lib/directives/template.directive.ts +24 -0
  109. package/src/lib/mng-commons.module.ts +240 -0
  110. package/{lib/models/index.d.ts → src/lib/models/index.ts} +2 -2
  111. package/src/lib/models/router.model.ts +16 -0
  112. package/{lib/models/user.model.d.ts → src/lib/models/user.model.ts} +9 -8
  113. package/src/lib/pipes/boolean.pipe.ts +17 -0
  114. package/{lib/pipes/index.d.ts → src/lib/pipes/index.ts} +2 -2
  115. package/src/lib/pipes/property-path.pipe.ts +30 -0
  116. package/src/lib/services/action.service.ts +310 -0
  117. package/src/lib/services/commons.service.ts +407 -0
  118. package/src/lib/services/configuration.service.ts +98 -0
  119. package/{lib/services/index.d.ts → src/lib/services/index.ts} +4 -4
  120. package/src/lib/services/navigation.service.ts +42 -0
  121. package/src/lib/services/providers/commons-init.provider.ts +5 -0
  122. package/src/lib/services/providers/config-service.provider.ts +22 -0
  123. package/src/lib/services/providers/formly-config.provider.ts +39 -0
  124. package/{lib/services/providers/index.d.ts → src/lib/services/providers/index.ts} +3 -3
  125. package/src/lib/services/tokens/browser-storage.token.ts +9 -0
  126. package/{lib/services/tokens/index.d.ts → src/lib/services/tokens/index.ts} +2 -2
  127. package/src/lib/services/tokens/module-config.token.ts +5 -0
  128. package/{lib/types/index.d.ts → src/lib/types/index.ts} +2 -2
  129. package/src/lib/types/type.decorator.ts +7 -0
  130. package/src/lib/types/type.model.ts +12 -0
  131. package/src/lib/utils/editor-formly.util.ts +193 -0
  132. package/src/lib/utils/i18n.util.ts +148 -0
  133. package/{lib/utils/index.d.ts → src/lib/utils/index.ts} +5 -5
  134. package/src/lib/utils/model.util.ts +66 -0
  135. package/src/lib/utils/toast.util.ts +49 -0
  136. package/src/lib/utils/type.util.ts +44 -0
  137. package/{public-api.d.ts → src/public-api.ts} +42 -25
  138. package/src/test.ts +26 -0
  139. package/tsconfig.lib.json +15 -0
  140. package/tsconfig.lib.prod.json +10 -0
  141. package/tsconfig.spec.json +17 -0
  142. package/esm2020/lib/api/models/builders/query-param.builder.mjs +0 -48
  143. package/esm2020/lib/api/models/filter-match-type.model.mjs +0 -26
  144. package/esm2020/lib/api/models/filter-param.model.mjs +0 -46
  145. package/esm2020/lib/api/models/index.mjs +0 -9
  146. package/esm2020/lib/api/models/mappers.mjs +0 -17
  147. package/esm2020/lib/api/models/query-mode.model.mjs +0 -19
  148. package/esm2020/lib/api/models/query-param.model.mjs +0 -69
  149. package/esm2020/lib/api/models/query-result.model.mjs +0 -45
  150. package/esm2020/lib/api/models/serialization.model.mjs +0 -2
  151. package/esm2020/lib/api/services/crud-api.abstract.service.mjs +0 -72
  152. package/esm2020/lib/api/services/index.mjs +0 -2
  153. package/esm2020/lib/api/utils/index.mjs +0 -3
  154. package/esm2020/lib/api/utils/medius-rest.util.mjs +0 -122
  155. package/esm2020/lib/api/utils/object-serializer.util.mjs +0 -226
  156. package/esm2020/lib/components/action/action.component.mjs +0 -65
  157. package/esm2020/lib/components/action/dialog/action-dialog.component.mjs +0 -148
  158. package/esm2020/lib/components/action/index.mjs +0 -4
  159. package/esm2020/lib/components/action/models/action-confirmation-service.model.mjs +0 -2
  160. package/esm2020/lib/components/action/models/action-execution.model.mjs +0 -58
  161. package/esm2020/lib/components/action/models/index.mjs +0 -3
  162. package/esm2020/lib/components/action/route/action-route.component.mjs +0 -144
  163. package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +0 -114
  164. package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +0 -113
  165. package/esm2020/lib/components/form/editor/form-editor.component.mjs +0 -141
  166. package/esm2020/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +0 -19
  167. package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +0 -19
  168. package/esm2020/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +0 -16
  169. package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +0 -26
  170. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +0 -109
  171. package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +0 -122
  172. package/esm2020/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +0 -17
  173. package/esm2020/lib/components/form/formly/fields/index.mjs +0 -8
  174. package/esm2020/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +0 -17
  175. package/esm2020/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.mjs +0 -16
  176. package/esm2020/lib/components/form/formly/wrappers/index.mjs +0 -3
  177. package/esm2020/lib/components/form/index.mjs +0 -4
  178. package/esm2020/lib/components/form/models/form-editor.event.mjs +0 -7
  179. package/esm2020/lib/components/form/models/index.mjs +0 -2
  180. package/esm2020/lib/components/layout/breadcrumb.component.mjs +0 -17
  181. package/esm2020/lib/components/layout/footer.component.mjs +0 -17
  182. package/esm2020/lib/components/layout/index.mjs +0 -7
  183. package/esm2020/lib/components/layout/main-layout.component.mjs +0 -54
  184. package/esm2020/lib/components/layout/menu-item.component.mjs +0 -173
  185. package/esm2020/lib/components/layout/menu.component.mjs +0 -20
  186. package/esm2020/lib/components/layout/services/index.mjs +0 -2
  187. package/esm2020/lib/components/layout/services/main-layout.component.service.mjs +0 -190
  188. package/esm2020/lib/components/layout/topbar.component.mjs +0 -59
  189. package/esm2020/lib/components/tableview/index.mjs +0 -6
  190. package/esm2020/lib/components/tableview/models/index.mjs +0 -2
  191. package/esm2020/lib/components/tableview/models/table.event.mjs +0 -16
  192. package/esm2020/lib/components/tableview/route/tableview-route.abstract.component.mjs +0 -24
  193. package/esm2020/lib/components/tableview/services/index.mjs +0 -2
  194. package/esm2020/lib/components/tableview/services/tableview.component.service.mjs +0 -17
  195. package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +0 -74
  196. package/esm2020/lib/components/tableview/table/column-value/column-value.component.mjs +0 -25
  197. package/esm2020/lib/components/tableview/table/table.component.mjs +0 -307
  198. package/esm2020/lib/components/tableview/tableview.component.mjs +0 -82
  199. package/esm2020/lib/config/formly.config.mjs +0 -136
  200. package/esm2020/lib/config/index.mjs +0 -2
  201. package/esm2020/lib/config/models/index.mjs +0 -2
  202. package/esm2020/lib/config/models/mng-config.model.mjs +0 -2
  203. package/esm2020/lib/data-providers/base.data-provider.mjs +0 -24
  204. package/esm2020/lib/data-providers/editor.data-provider.mjs +0 -37
  205. package/esm2020/lib/data-providers/index.mjs +0 -6
  206. package/esm2020/lib/data-providers/lookup.data-provider.mjs +0 -16
  207. package/esm2020/lib/data-providers/table.data-provider.mjs +0 -2
  208. package/esm2020/lib/data-providers/tableview.data-provider.mjs +0 -17
  209. package/esm2020/lib/descriptors/action.descriptor.mjs +0 -332
  210. package/esm2020/lib/descriptors/editor.descriptor.mjs +0 -670
  211. package/esm2020/lib/descriptors/field.validator.mjs +0 -21
  212. package/esm2020/lib/descriptors/index.mjs +0 -8
  213. package/esm2020/lib/descriptors/lookup.descriptor.mjs +0 -2
  214. package/esm2020/lib/descriptors/model.descriptor.mjs +0 -34
  215. package/esm2020/lib/descriptors/table.descriptor.mjs +0 -401
  216. package/esm2020/lib/descriptors/tableview.descriptor.mjs +0 -131
  217. package/esm2020/lib/directives/component.directive.mjs +0 -23
  218. package/esm2020/lib/directives/index.mjs +0 -3
  219. package/esm2020/lib/directives/template.directive.mjs +0 -29
  220. package/esm2020/lib/mng-commons.module.mjs +0 -410
  221. package/esm2020/lib/models/index.mjs +0 -3
  222. package/esm2020/lib/models/router.model.mjs +0 -2
  223. package/esm2020/lib/models/user.model.mjs +0 -2
  224. package/esm2020/lib/pipes/boolean.pipe.mjs +0 -22
  225. package/esm2020/lib/pipes/index.mjs +0 -3
  226. package/esm2020/lib/pipes/property-path.pipe.mjs +0 -36
  227. package/esm2020/lib/services/action.service.mjs +0 -269
  228. package/esm2020/lib/services/commons.service.mjs +0 -353
  229. package/esm2020/lib/services/configuration.service.mjs +0 -78
  230. package/esm2020/lib/services/index.mjs +0 -5
  231. package/esm2020/lib/services/navigation.service.mjs +0 -48
  232. package/esm2020/lib/services/providers/commons-init.provider.mjs +0 -4
  233. package/esm2020/lib/services/providers/config-service.provider.mjs +0 -20
  234. package/esm2020/lib/services/providers/formly-config.provider.mjs +0 -31
  235. package/esm2020/lib/services/providers/index.mjs +0 -4
  236. package/esm2020/lib/services/tokens/browser-storage.token.mjs +0 -6
  237. package/esm2020/lib/services/tokens/index.mjs +0 -3
  238. package/esm2020/lib/services/tokens/module-config.token.mjs +0 -3
  239. package/esm2020/lib/types/index.mjs +0 -3
  240. package/esm2020/lib/types/type.decorator.mjs +0 -7
  241. package/esm2020/lib/types/type.model.mjs +0 -2
  242. package/esm2020/lib/utils/editor-formly.util.mjs +0 -176
  243. package/esm2020/lib/utils/i18n.util.mjs +0 -125
  244. package/esm2020/lib/utils/index.mjs +0 -6
  245. package/esm2020/lib/utils/model.util.mjs +0 -57
  246. package/esm2020/lib/utils/toast.util.mjs +0 -39
  247. package/esm2020/lib/utils/type.util.mjs +0 -39
  248. package/esm2020/mediusinc-mng-commons.mjs +0 -5
  249. package/esm2020/public-api.mjs +0 -36
  250. package/fesm2015/mediusinc-mng-commons.mjs +0 -6250
  251. package/fesm2015/mediusinc-mng-commons.mjs.map +0 -1
  252. package/fesm2020/mediusinc-mng-commons.mjs +0 -6176
  253. package/fesm2020/mediusinc-mng-commons.mjs.map +0 -1
  254. package/lib/api/models/builders/query-param.builder.d.ts +0 -11
  255. package/lib/api/models/filter-param.model.d.ts +0 -23
  256. package/lib/api/models/mappers.d.ts +0 -6
  257. package/lib/api/models/query-mode.model.d.ts +0 -16
  258. package/lib/api/models/query-param.model.d.ts +0 -31
  259. package/lib/api/models/query-result.model.d.ts +0 -36
  260. package/lib/api/services/crud-api.abstract.service.d.ts +0 -23
  261. package/lib/api/utils/medius-rest.util.d.ts +0 -12
  262. package/lib/api/utils/object-serializer.util.d.ts +0 -30
  263. package/lib/components/action/action.component.d.ts +0 -36
  264. package/lib/components/action/dialog/action-dialog.component.d.ts +0 -46
  265. package/lib/components/action/models/action-execution.model.d.ts +0 -53
  266. package/lib/components/action/route/action-route.component.d.ts +0 -32
  267. package/lib/components/form/autocomplete/autocomplete.component.d.ts +0 -36
  268. package/lib/components/form/dropdown/dropdown.component.d.ts +0 -34
  269. package/lib/components/form/editor/form-editor.component.d.ts +0 -39
  270. package/lib/components/form/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +0 -11
  271. package/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +0 -11
  272. package/lib/components/form/formly/fields/formly-field-fieldset/formly-field-fieldset.component.d.ts +0 -6
  273. package/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.d.ts +0 -12
  274. package/lib/components/form/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +0 -17
  275. package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +0 -36
  276. package/lib/components/form/formly/fields/formly-field-tabs/formly-field-tabs.component.d.ts +0 -6
  277. package/lib/components/form/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.d.ts +0 -8
  278. package/lib/components/form/formly/wrappers/formly-table-wrapper/formly-table-wrapper.component.d.ts +0 -8
  279. package/lib/components/form/models/form-editor.event.d.ts +0 -5
  280. package/lib/components/layout/breadcrumb.component.d.ts +0 -8
  281. package/lib/components/layout/footer.component.d.ts +0 -9
  282. package/lib/components/layout/main-layout.component.d.ts +0 -21
  283. package/lib/components/layout/menu-item.component.d.ts +0 -29
  284. package/lib/components/layout/menu.component.d.ts +0 -10
  285. package/lib/components/layout/services/main-layout.component.service.d.ts +0 -65
  286. package/lib/components/layout/topbar.component.d.ts +0 -25
  287. package/lib/components/tableview/models/table.event.d.ts +0 -17
  288. package/lib/components/tableview/route/tableview-route.abstract.component.d.ts +0 -14
  289. package/lib/components/tableview/services/tableview.component.service.d.ts +0 -13
  290. package/lib/components/tableview/table/column-filter/column-filter.component.d.ts +0 -22
  291. package/lib/components/tableview/table/column-value/column-value.component.d.ts +0 -12
  292. package/lib/components/tableview/table/table.component.d.ts +0 -79
  293. package/lib/components/tableview/tableview.component.d.ts +0 -35
  294. package/lib/config/formly.config.d.ts +0 -14
  295. package/lib/data-providers/base.data-provider.d.ts +0 -17
  296. package/lib/data-providers/editor.data-provider.d.ts +0 -25
  297. package/lib/data-providers/lookup.data-provider.d.ts +0 -14
  298. package/lib/data-providers/tableview.data-provider.d.ts +0 -15
  299. package/lib/descriptors/action.descriptor.d.ts +0 -148
  300. package/lib/descriptors/editor.descriptor.d.ts +0 -255
  301. package/lib/descriptors/field.validator.d.ts +0 -18
  302. package/lib/descriptors/model.descriptor.d.ts +0 -15
  303. package/lib/descriptors/table.descriptor.d.ts +0 -164
  304. package/lib/descriptors/tableview.descriptor.d.ts +0 -39
  305. package/lib/directives/component.directive.d.ts +0 -11
  306. package/lib/directives/template.directive.d.ts +0 -13
  307. package/lib/mng-commons.module.d.ts +0 -79
  308. package/lib/models/router.model.d.ts +0 -14
  309. package/lib/pipes/boolean.pipe.d.ts +0 -7
  310. package/lib/pipes/property-path.pipe.d.ts +0 -7
  311. package/lib/services/action.service.d.ts +0 -92
  312. package/lib/services/commons.service.d.ts +0 -72
  313. package/lib/services/configuration.service.d.ts +0 -35
  314. package/lib/services/navigation.service.d.ts +0 -14
  315. package/lib/services/providers/commons-init.provider.d.ts +0 -2
  316. package/lib/services/providers/config-service.provider.d.ts +0 -5
  317. package/lib/services/providers/formly-config.provider.d.ts +0 -4
  318. package/lib/services/tokens/browser-storage.token.d.ts +0 -2
  319. package/lib/services/tokens/module-config.token.d.ts +0 -3
  320. package/lib/types/type.decorator.d.ts +0 -2
  321. package/lib/types/type.model.d.ts +0 -10
  322. package/lib/utils/editor-formly.util.d.ts +0 -9
  323. package/lib/utils/i18n.util.d.ts +0 -18
  324. package/lib/utils/model.util.d.ts +0 -7
  325. package/lib/utils/toast.util.d.ts +0 -13
  326. package/lib/utils/type.util.d.ts +0 -15
  327. package/mediusinc-mng-commons-0.2.0.tgz +0 -0
  328. package/mediusinc-mng-commons.d.ts +0 -5
@@ -0,0 +1,16 @@
1
+ # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2
+ # For additional information regarding the format and rule options, please see:
3
+ # https://github.com/browserslist/browserslist#queries
4
+
5
+ # For the full list of supported browsers by the Angular framework, please see:
6
+ # https://angular.io/guide/browser-support
7
+
8
+ # You can see what browsers were selected by your queries by running:
9
+ # npx browserslist
10
+
11
+ last 1 Chrome version
12
+ last 1 Firefox version
13
+ last 2 Edge major versions
14
+ # last 2 Safari major versions
15
+ last 2 iOS major versions
16
+ Firefox ESR
package/karma.conf.js ADDED
@@ -0,0 +1,51 @@
1
+ // Karma configuration file, see link for more information
2
+ // https://karma-runner.github.io/1.0/config/configuration-file.html
3
+
4
+ module.exports = function (config) {
5
+ config.set({
6
+ basePath: '',
7
+ frameworks: ['jasmine', '@angular-devkit/build-angular'],
8
+ plugins: [
9
+ require('karma-jasmine'),
10
+ require('karma-chrome-launcher'),
11
+ require('karma-jasmine-html-reporter'),
12
+ require('karma-coverage'),
13
+ require('@angular-devkit/build-angular/plugins/karma')
14
+ ],
15
+ client: {
16
+ jasmine: {
17
+ // you can add configuration options for Jasmine here
18
+ // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19
+ // for example, you can disable the random execution with `random: false`
20
+ // or set a specific seed with `seed: 4321`
21
+ },
22
+ clearContext: false // leave Jasmine Spec Runner output visible in browser
23
+ },
24
+ jasmineHtmlReporter: {
25
+ suppressAll: true // removes the duplicated traces
26
+ },
27
+ coverageReporter: {
28
+ dir: require('path').join(__dirname, '../../coverage/mng-commons'),
29
+ subdir: '.',
30
+ reporters: [
31
+ { type: 'html' },
32
+ { type: 'text-summary' }
33
+ ]
34
+ },
35
+ reporters: ['progress', 'kjhtml'],
36
+ port: 9876,
37
+ colors: true,
38
+ logLevel: config.LOG_INFO,
39
+ autoWatch: true,
40
+ browsers: ['Chrome', 'ChromeHeadless', 'ChromeHeadlessCI'],
41
+ customLaunchers: {
42
+ ChromeHeadlessCI: {
43
+ base: 'ChromeHeadless',
44
+ flags: ['--no-sandbox']
45
+ }
46
+ },
47
+ singleRun: false,
48
+ restartOnFileChange: true,
49
+ failOnEmptyTestSuite: false
50
+ });
51
+ };
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/mng-commons",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ },
7
+ "assets": [
8
+ "assets/**/*",
9
+ "scss/**/*.scss"
10
+ ],
11
+ "allowedNonPeerDependencies": [
12
+ "reflect-metadata"
13
+ ]
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons",
3
- "version": "0.2.0",
3
+ "version": "0.2.1-rc",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^13.1.0",
6
6
  "@angular/common": "^13.1.0",
@@ -13,26 +13,5 @@
13
13
  "dependencies": {
14
14
  "tslib": "^2.3.0",
15
15
  "reflect-metadata": "^0.1.13"
16
- },
17
- "module": "fesm2015/mediusinc-mng-commons.mjs",
18
- "es2020": "fesm2020/mediusinc-mng-commons.mjs",
19
- "esm2020": "esm2020/mediusinc-mng-commons.mjs",
20
- "fesm2020": "fesm2020/mediusinc-mng-commons.mjs",
21
- "fesm2015": "fesm2015/mediusinc-mng-commons.mjs",
22
- "typings": "mediusinc-mng-commons.d.ts",
23
- "exports": {
24
- "./package.json": {
25
- "default": "./package.json"
26
- },
27
- ".": {
28
- "types": "./mediusinc-mng-commons.d.ts",
29
- "esm2020": "./esm2020/mediusinc-mng-commons.mjs",
30
- "es2020": "./fesm2020/mediusinc-mng-commons.mjs",
31
- "es2015": "./fesm2015/mediusinc-mng-commons.mjs",
32
- "node": "./fesm2015/mediusinc-mng-commons.mjs",
33
- "default": "./fesm2020/mediusinc-mng-commons.mjs"
34
- }
35
- },
36
- "sideEffects": false,
37
- "readme": "# Angular Commons\n\nCommons knjižnica za izgradnjo uporabniškega vmesnika na ogrodju Angular.\n\n## Predhodne zahteve\n\n- Node.js (LTS v14) in npm\n- pnpm package manager (https://pnpm.io/), ki optimizira delovanje privzetega npm.\n- Zahtevane skupne odvisnosti (peer dependencies)\n - Angular (moduli `@angular/core`, `@angular/common`, `@angular/forms`, `@angular/router`) verzije `^13.1.0`\n - Ngx Formly (modul `@ngx-formly/core`) verzije `^6.0.0-next.6`\n - Ngx Translate (module `@ngx-translate/core`) verzije `^14.0.0`\n - PrimeNG (modul `primeng`) verzije `^13.0.0`\n\n## Namestitev\n\n```bash\npnpm i @mediusinc/mng-commons\n```\n\n## Lokalizacija (i18n)\n\nModul `ngx-translate` se konfigurira na končnem projektu in je na končnem projektu potrebno določiti način za load prevodov.\nPrimer konfiguracije za multi-module HTTP loader:\n\n- HTTP loader factory:\n```ts\nexport function i18nHttpLoaderFactory(http: HttpClient) {\n return new MultiTranslateHttpLoader(http, [\n {prefix: './assets/i18n/mng/', suffix: '.json'},\n {prefix: './assets/i18n/', suffix: '.json'}\n ]);\n}\n```\n\n- Konfiguracija v `AppModule`:\n```ts\nTranslateModule.forRoot({\n loader: {\n provide: TranslateLoader,\n useFactory: i18nHttpLoaderFactory,\n deps: [HttpClient]\n }\n})\n```\n\n- Definicijo jezikov podamo preko konfiguracije `MngCommonsModule`:\n```ts\nMngCommonsModule.forRoot({\n languages: ['en', 'sl']\n})\n```\n\nKnjižnica pakira tudi osnovne prevode, ki so del modula. Za vključitev na zgornji način je potrebno dodati naslednjo konfiguracijo v `angular.json` med `assets` nastavitve:\n```json\n{\n \"glob\": \"**/*\",\n \"input\": \"./node_modules/@mediusinc/mng-commons/assets/i18n\",\n \"output\": \"/assets/i18n/mng\"\n}\n```\n\n## Tema\n\nOpcijsko se vključi tudi tema MNG Commons, ki ima dve svetlo in temno varianto.\nZa vključitev se v stile na končnem projektu doda import v `style.scss`:\n\n```scss\n# Za svetlo temo:\n@import '~../node_modules/@mediusinc/mng-commons/scss/mng-commons-light';\n\n# Za temno temo:\n@import '~../node_modules/@mediusinc/mng-commons/scss/mng-commons-dark';\n```\n\n~~~~\nPrimarno se uporablja svetla tema!\n~~~~\n\nPri uporabi temne teme je potrebno dodatno nastaviti tudi `colorMode` v modulu:\n```ts\nMngCommonsModule.forRoot({\n app: {\n colorScheme: 'dark'\n }\n});\n```\n\nTema za svoje delovanje uporablja primeNG stile (za posamezne komponente) in PrimeFlex kot pomožno CSS knjižnico.\nDodatno se lahko na končnem projektu lahko uporabi še ikone PrimeIcons.\nGlede ne preference se opcijsko dodajo naslednji importi (**pred importom MNG commons teme!**):\n\n```scss\n@import '~../node_modules/primeng/resources/primeng.min.css';\n@import '~../node_modules/primeflex/primeflex.scss';\n@import '~../node_modules/primeicons/primeicons.css';\n```\n\nPri prvem importu ni potrebno namestiti dodatnih odvisnosti (je že vključeno z primeng), za drugi dve pa je potrebno namestiti:\n```bash\npnpm i primeflex\npnpm i primeicons\n```\n\nDodajanje MNG Commons slik v `assets` na končnem projektu se uredi z konfiguracijo v `assets` segmentu znotraj `angular.json`, kjer se doda:\n\n```json\n{\n \"glob\": \"**/*\",\n \"input\": \"./node_modules/@mediusinc/mng-commons/assets/images\",\n \"output\": \"/assets/images/mng\"\n}\n```\n\n"
38
- }
16
+ }
17
+ }
@@ -0,0 +1,54 @@
1
+ import {MediusFilterMatchType, MediusFilterParam, MediusQueryParam} from '../';
2
+
3
+ export class MediusQueryParamBuilder {
4
+
5
+ private constructor(private queryParam: MediusQueryParam) {
6
+ }
7
+
8
+ public static create(itemsPerPage: number = 50, itemsOffset: number = 0): MediusQueryParamBuilder {
9
+ const queryParam = new MediusQueryParam();
10
+ queryParam.itemsPerPage = itemsPerPage;
11
+ queryParam.itemsOffset = itemsOffset;
12
+ return new MediusQueryParamBuilder(queryParam);
13
+ }
14
+
15
+ public withItemsPerPage(itemsPerPage: number): MediusQueryParamBuilder {
16
+ this.queryParam.itemsPerPage = itemsPerPage;
17
+ return this;
18
+ }
19
+
20
+ public withItemsOffset(itemsOffset: number): MediusQueryParamBuilder {
21
+ this.queryParam.itemsOffset = itemsOffset;
22
+ return this;
23
+ }
24
+
25
+ public withSort(property: string, asc: boolean = true): MediusQueryParamBuilder {
26
+ if (!this.queryParam.sortProperty || !this.queryParam.sortAsc) {
27
+ this.queryParam.sortProperty = [];
28
+ this.queryParam.sortAsc = [];
29
+ }
30
+ this.queryParam.sortProperty.push(property);
31
+ this.queryParam.sortAsc.push(asc);
32
+ return this;
33
+ }
34
+
35
+ public withFilter(property: string, value: any, valueTo: any = undefined, matchType: MediusFilterMatchType = MediusFilterMatchType.Contains, matchCaseSensitive: boolean = false): MediusQueryParamBuilder {
36
+ if (!this.queryParam.filterParams) {
37
+ this.queryParam.filterParams = [];
38
+ }
39
+ const filterParam = new MediusFilterParam();
40
+ filterParam.property = property;
41
+ filterParam.filterValue = value;
42
+ filterParam.filterValueTo = valueTo;
43
+ filterParam.filterMatchType = matchType;
44
+ filterParam.filterMatchCaseSensitive = matchCaseSensitive;
45
+ this.queryParam.filterParams.push(filterParam);
46
+ return this;
47
+ }
48
+
49
+ public build(): MediusQueryParam {
50
+ const queryParam = this.queryParam;
51
+ this.queryParam = new MediusQueryParam();
52
+ return queryParam;
53
+ }
54
+ }
@@ -0,0 +1,25 @@
1
+ /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
2
+ /**
3
+ * Generated API
4
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+ *
6
+ * The version of the OpenAPI document: 1.0
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+
14
+ export enum MediusFilterMatchType {
15
+ Equals = <any> 'EQUALS',
16
+ NotEquals = <any> 'NOT_EQUALS',
17
+ Contains = <any> 'CONTAINS',
18
+ EndsWith = <any> 'ENDS_WITH',
19
+ StartsWith = <any> 'STARTS_WITH',
20
+ FromTo = <any> 'FROM_TO',
21
+ SmallerThan = <any> 'SMALLER_THEN',
22
+ GreaterThan = <any> 'GREATER_THEN',
23
+ In = <any> 'IN',
24
+ NotIn = <any> 'NOT_IN'
25
+ }
@@ -0,0 +1,59 @@
1
+ /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
2
+ /**
3
+ * Generated API
4
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+ *
6
+ * The version of the OpenAPI document: 1.0
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+
14
+ import {AttributeDef} from './serialization.model';
15
+ import { MediusFilterMatchType } from './filter-match-type.model';
16
+
17
+ export class MediusFilterParam {
18
+ 'property'?: string;
19
+ 'filterMatchCaseSensitive'?: boolean;
20
+ 'filterMatchType'?: MediusFilterMatchType;
21
+ 'filterValue'?: object;
22
+ 'filterValueTo'?: object;
23
+
24
+ static discriminator: string | undefined = undefined;
25
+
26
+ static attributeTypeMap: Array<AttributeDef> =
27
+ [
28
+ {
29
+ 'name': 'property',
30
+ 'baseName': 'property',
31
+ 'type': 'string'
32
+ },
33
+ {
34
+ 'name': 'filterMatchCaseSensitive',
35
+ 'baseName': 'filter_match_case_sensitive',
36
+ 'type': 'boolean'
37
+ },
38
+ {
39
+ 'name': 'filterMatchType',
40
+ 'baseName': 'filter_match_type',
41
+ 'type': 'FilterMatchType'
42
+ },
43
+ {
44
+ 'name': 'filterValue',
45
+ 'baseName': 'filter_value',
46
+ 'type': 'object'
47
+ },
48
+ {
49
+ 'name': 'filterValueTo',
50
+ 'baseName': 'filter_value_to',
51
+ 'type': 'object'
52
+ }
53
+ ];
54
+
55
+ static getAttributeTypeMap() {
56
+ return MediusFilterParam.attributeTypeMap;
57
+ }
58
+ }
59
+
@@ -1,8 +1,10 @@
1
- export * from './filter-match-type.model';
2
- export * from './filter-param.model';
3
- export * from './query-mode.model';
4
- export * from './query-param.model';
5
- export * from './query-result.model';
6
- export * from './serialization.model';
7
- export * from './builders/query-param.builder';
8
- export * from './mappers';
1
+ export * from './filter-match-type.model';
2
+ export * from './filter-param.model';
3
+ export * from './query-mode.model';
4
+ export * from './query-param.model';
5
+ export * from './query-result.model';
6
+ export * from './serialization.model';
7
+
8
+ export * from './builders/query-param.builder';
9
+
10
+ export * from './mappers';
@@ -0,0 +1,18 @@
1
+ /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
2
+ import { MediusFilterMatchType } from './filter-match-type.model';
3
+ import { MediusFilterParam } from './filter-param.model';
4
+ import { MediusQueryMode } from './query-mode.model';
5
+ import { MediusQueryParam } from './query-param.model';
6
+ import { MediusQueryResult, MediusQueryResultWithObject } from './query-result.model';
7
+
8
+ export const enumsMapBase: {[index: string]: any} = {
9
+ 'FilterMatchType': MediusFilterMatchType,
10
+ 'QueryMode': MediusQueryMode,
11
+ };
12
+
13
+ export const typeMapBase: {[index: string]: any} = {
14
+ 'FilterParam': MediusFilterParam,
15
+ 'QueryParam': MediusQueryParam,
16
+ 'QueryResult': MediusQueryResult,
17
+ 'QueryResultWithObject': MediusQueryResultWithObject
18
+ };
@@ -1,23 +1,18 @@
1
- /**
2
- * Generated API
3
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
- *
5
- * The version of the OpenAPI document: 1.0
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- export declare enum MediusFilterMatchType {
13
- Equals,
14
- NotEquals,
15
- Contains,
16
- EndsWith,
17
- StartsWith,
18
- FromTo,
19
- SmallerThan,
20
- GreaterThan,
21
- In,
22
- NotIn
23
- }
1
+ /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
2
+ /**
3
+ * Generated API
4
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+ *
6
+ * The version of the OpenAPI document: 1.0
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+
14
+ export enum MediusQueryMode {
15
+ All = <any> 'ALL',
16
+ Count = <any> 'COUNT',
17
+ Data = <any> 'DATA'
18
+ }
@@ -0,0 +1,99 @@
1
+ /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
2
+ /**
3
+ * Generated API
4
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+ *
6
+ * The version of the OpenAPI document: 1.0
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+ import { MediusFilterParam } from './filter-param.model';
14
+ import { MediusQueryMode } from './query-mode.model';
15
+ import {AttributeDef} from './serialization.model';
16
+
17
+ export class MediusQueryParam {
18
+ 'filterAllParam'?: string;
19
+ 'filterAllProperties'?: Array<string>;
20
+ 'filterParams'?: Array<MediusFilterParam>;
21
+ 'groupByProperties'?: Array<string>;
22
+ 'itemsOffset': number;
23
+ 'itemsPerPage': number;
24
+ 'queryMode'?: MediusQueryMode;
25
+ 'selectInTwoSteps'?: boolean;
26
+ 'sortAsc'?: Array<boolean>;
27
+ 'sortEnumByOrdinal'?: boolean;
28
+ 'sortProperty'?: Array<string>;
29
+ 'validateProperties'?: Array<string>;
30
+
31
+ static discriminator: string | undefined = undefined;
32
+
33
+ static attributeTypeMap: Array<AttributeDef> = [
34
+ {
35
+ 'name': 'filterAllParam',
36
+ 'baseName': 'filter_all_param',
37
+ 'type': 'string'
38
+ },
39
+ {
40
+ 'name': 'filterAllProperties',
41
+ 'baseName': 'filter_all_properties',
42
+ 'type': 'Array<string>'
43
+ },
44
+ {
45
+ 'name': 'filterParams',
46
+ 'baseName': 'filter_params',
47
+ 'type': 'Array<FilterParam>'
48
+ },
49
+ {
50
+ 'name': 'groupByProperties',
51
+ 'baseName': 'group_by_properties',
52
+ 'type': 'Array<string>'
53
+ },
54
+ {
55
+ 'name': 'itemsOffset',
56
+ 'baseName': 'items_offset',
57
+ 'type': 'number'
58
+ },
59
+ {
60
+ 'name': 'itemsPerPage',
61
+ 'baseName': 'items_per_page',
62
+ 'type': 'number'
63
+ },
64
+ {
65
+ 'name': 'queryMode',
66
+ 'baseName': 'query_mode',
67
+ 'type': 'QueryMode'
68
+ },
69
+ {
70
+ 'name': 'selectInTwoSteps',
71
+ 'baseName': 'select_in_two_steps',
72
+ 'type': 'boolean'
73
+ },
74
+ {
75
+ 'name': 'sortAsc',
76
+ 'baseName': 'sort_asc',
77
+ 'type': 'Array<boolean>'
78
+ },
79
+ {
80
+ 'name': 'sortEnumByOrdinal',
81
+ 'baseName': 'sort_enum_by_ordinal',
82
+ 'type': 'boolean'
83
+ },
84
+ {
85
+ 'name': 'sortProperty',
86
+ 'baseName': 'sort_property',
87
+ 'type': 'Array<string>'
88
+ },
89
+ {
90
+ 'name': 'validateProperties',
91
+ 'baseName': 'validate_properties',
92
+ 'type': 'Array<string>'
93
+ } ];
94
+
95
+ static getAttributeTypeMap() {
96
+ return MediusQueryParam.attributeTypeMap;
97
+ }
98
+ }
99
+
@@ -0,0 +1,77 @@
1
+ /* tslint:disable:no-angle-bracket-type-assertion no-trailing-whitespace member-ordering object-literal-key-quotes */
2
+ /**
3
+ * Generated API
4
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+ *
6
+ * The version of the OpenAPI document: 1.0
7
+ *
8
+ *
9
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10
+ * https://openapi-generator.tech
11
+ * Do not edit the class manually.
12
+ */
13
+ import {AttributeDef} from './serialization.model';
14
+
15
+ export class MediusQueryResultBase {
16
+ 'selectInTwoSteps'?: boolean;
17
+ 'allDataCount'?: number;
18
+
19
+ static discriminator: string | undefined = undefined;
20
+ static attributeTypeMap: Array<AttributeDef> = [
21
+ {
22
+ 'name': 'allDataCount',
23
+ 'baseName': 'all_data_count',
24
+ 'type': 'number'
25
+ },
26
+ {
27
+ 'name': 'selectInTwoSteps',
28
+ 'baseName': 'selectInTwoSteps',
29
+ 'type': 'boolean'
30
+ }
31
+ ];
32
+ }
33
+
34
+ export class MediusQueryResultWithObject extends MediusQueryResultBase {
35
+ 'pageData'?: Array<object>;
36
+
37
+ static override discriminator: string | undefined = undefined;
38
+
39
+ static override attributeTypeMap: Array<AttributeDef> = [
40
+ ...MediusQueryResultBase.attributeTypeMap,
41
+ {
42
+ 'name': 'pageData',
43
+ 'baseName': 'page_data',
44
+ 'type': 'Array<object>'
45
+ }
46
+ ];
47
+
48
+ static getAttributeTypeMap() {
49
+ return MediusQueryResultWithObject.attributeTypeMap;
50
+ }
51
+ }
52
+
53
+ export class MediusQueryResult<T> extends MediusQueryResultBase implements IMediusQueryResult<T> {
54
+ 'pageData'?: Array<T>;
55
+
56
+ static override discriminator: string | undefined = undefined;
57
+
58
+ static attributeTypeMapBase: Array<AttributeDef> = MediusQueryResultBase.attributeTypeMap;
59
+ static override attributeTypeMap: Array<AttributeDef> = [
60
+ ...MediusQueryResultBase.attributeTypeMap,
61
+ {
62
+ 'name': 'pageData',
63
+ 'baseName': 'page_data',
64
+ 'type': 'Array<T>'
65
+ }
66
+ ];
67
+
68
+ static getAttributeTypeMap() {
69
+ return MediusQueryResultWithObject.attributeTypeMap;
70
+ }
71
+ }
72
+
73
+ export interface IMediusQueryResult<T> {
74
+ selectInTwoSteps?: boolean;
75
+ allDataCount?: number;
76
+ pageData?: Array<T>
77
+ }
@@ -1,8 +1,9 @@
1
- export interface AttributeDef {
2
- name: string;
3
- baseName: string;
4
- type: string;
5
- }
6
- export interface SerializableTypeMap {
7
- [index: string]: any;
8
- }
1
+ export interface AttributeDef {
2
+ name: string;
3
+ baseName: string;
4
+ type: string;
5
+ }
6
+
7
+ export interface SerializableTypeMap {
8
+ [index: string]: any;
9
+ }
@@ -0,0 +1,113 @@
1
+ import {HttpClient} from '@angular/common/http';
2
+
3
+ import {Observable} from 'rxjs';
4
+ import {map} from 'rxjs/operators';
5
+
6
+ import {MediusQueryParam, MediusQueryResult} from '../models';
7
+ import {ObjectSerializer} from '../utils';
8
+ import {ClassType} from '../../types';
9
+
10
+ export abstract class AMngCrudApiService<T, QRT extends MediusQueryResult<T>> {
11
+
12
+ private readonly objectSerializer: ObjectSerializer = ObjectSerializer.get();
13
+
14
+ protected constructor(
15
+ protected type: ClassType<T>,
16
+ protected queryResultType: ClassType<QRT>,
17
+ protected http: HttpClient
18
+ ) {
19
+ }
20
+
21
+ protected abstract getBasePath(): string;
22
+ protected abstract getServiceBasePath(): string;
23
+
24
+ protected getGetAllPostPath(): string {
25
+ return '/get-all';
26
+ }
27
+ protected getCreatePostPath(): string {
28
+ return '';
29
+ }
30
+ protected getUpdatePutPath(id: any, item: T): string {
31
+ return `/${id}`;
32
+ }
33
+ protected getGetByIdGetPath(id: any): string {
34
+ return `/${id}`;
35
+ }
36
+ protected getRemoveDeletePath(id: any, item: T) {
37
+ return `/${id}`;
38
+ }
39
+
40
+ public createPost(item: T): Observable<T> {
41
+
42
+ const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getCreatePostPath()}`;
43
+ return this.http.post<T>(url,
44
+ this.objectSerializer.serializeClass(item, this.type),
45
+ {
46
+ withCredentials: true,
47
+ observe: 'body',
48
+ reportProgress: false
49
+ })
50
+ .pipe(
51
+ map(res => this.objectSerializer.deserializeClass(res, this.type))
52
+ );
53
+ }
54
+
55
+ public getAllPost(queryParam?: MediusQueryParam): Observable<QRT> {
56
+
57
+ const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetAllPostPath()}`;
58
+ return this.http.post<QRT>(url,
59
+ this.objectSerializer.serialize(queryParam, 'QueryParam'),
60
+ {
61
+ withCredentials: true,
62
+ observe: 'body',
63
+ reportProgress: false
64
+ })
65
+ .pipe(
66
+ map(res => this.objectSerializer.deserializeClass(res, this.queryResultType))
67
+ );
68
+ }
69
+
70
+ public getByIdGet(id: any): Observable<T> {
71
+
72
+ const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getGetByIdGetPath(id)}`;
73
+ return this.http.get<T>(url,
74
+ {
75
+ withCredentials: true,
76
+ observe: 'body',
77
+ reportProgress: false
78
+ })
79
+ .pipe(
80
+ map(res => this.objectSerializer.deserializeClass(res, this.type))
81
+ );
82
+ }
83
+
84
+ public updatePut(id: any, item: T): Observable<T> {
85
+
86
+ const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getUpdatePutPath(id, item)}`;
87
+ return this.http.put<T>(url,
88
+ this.objectSerializer.serializeClass(item, this.type),
89
+ {
90
+ withCredentials: true,
91
+ observe: 'body',
92
+ reportProgress: false
93
+ })
94
+ .pipe(
95
+ map(res => this.objectSerializer.deserializeClass(res, this.type))
96
+ );
97
+ }
98
+
99
+ public removeDelete(id: any, item: T): Observable<any> {
100
+
101
+ const url = `${this.getBasePath()}/${this.getServiceBasePath()}${this.getRemoveDeletePath(id, item)}`;
102
+ return this.http.request<any>('delete', url,
103
+ {
104
+ withCredentials: true,
105
+ observe: 'body',
106
+ reportProgress: false,
107
+ body: this.objectSerializer.serializeClass(item, this.type)
108
+ })
109
+ .pipe(
110
+ map(res => this.objectSerializer.deserializeClass(res, this.type))
111
+ );
112
+ }
113
+ }
@@ -1 +1 @@
1
- export * from './crud-api.abstract.service';
1
+ export * from './crud-api.abstract.service';
@@ -1,2 +1,2 @@
1
- export * from './object-serializer.util';
2
- export * from './medius-rest.util';
1
+ export * from './object-serializer.util';
2
+ export * from './medius-rest.util';