@smartsoft001/crud-shell-angular 1.1.542 → 1.1.546

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 (71) hide show
  1. package/bundles/smartsoft001-crud-shell-angular.umd.js +162 -27
  2. package/bundles/smartsoft001-crud-shell-angular.umd.js.map +1 -1
  3. package/esm2015/lib/+state/crud.effects.js +8 -1
  4. package/esm2015/lib/+state/crud.effects.js.map +1 -1
  5. package/esm2015/lib/+state/crud.facade.js +8 -1
  6. package/esm2015/lib/+state/crud.facade.js.map +1 -1
  7. package/esm2015/lib/components/components.module.js +1 -0
  8. package/esm2015/lib/components/components.module.js.map +1 -1
  9. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  10. package/esm2015/lib/components/export/export.component.js +9 -2
  11. package/esm2015/lib/components/export/export.component.js.map +1 -1
  12. package/esm2015/lib/components/export/export.component.metadata.json +1 -1
  13. package/esm2015/lib/components/filter/base/base.component.js +9 -1
  14. package/esm2015/lib/components/filter/base/base.component.js.map +1 -1
  15. package/esm2015/lib/components/filter/check/check.component.js +2 -1
  16. package/esm2015/lib/components/filter/check/check.component.js.map +1 -1
  17. package/esm2015/lib/components/filter/check/check.component.metadata.json +1 -1
  18. package/esm2015/lib/components/filter/date/date.component.js +2 -1
  19. package/esm2015/lib/components/filter/date/date.component.js.map +1 -1
  20. package/esm2015/lib/components/filter/date/date.component.metadata.json +1 -1
  21. package/esm2015/lib/components/filter/date-with-edit/date-with-edit.component.js +3 -1
  22. package/esm2015/lib/components/filter/date-with-edit/date-with-edit.component.js.map +1 -1
  23. package/esm2015/lib/components/filter/date-with-edit/date-with-edit.component.metadata.json +1 -1
  24. package/esm2015/lib/components/filter/filter.component.js +9 -1
  25. package/esm2015/lib/components/filter/filter.component.js.map +1 -1
  26. package/esm2015/lib/components/filter/flag/flag.component.js +2 -1
  27. package/esm2015/lib/components/filter/flag/flag.component.js.map +1 -1
  28. package/esm2015/lib/components/filter/flag/flag.component.metadata.json +1 -1
  29. package/esm2015/lib/components/filter/radio/radio.component.js +2 -1
  30. package/esm2015/lib/components/filter/radio/radio.component.js.map +1 -1
  31. package/esm2015/lib/components/filter/radio/radio.component.metadata.json +1 -1
  32. package/esm2015/lib/components/filter/text/text.component.js +2 -1
  33. package/esm2015/lib/components/filter/text/text.component.js.map +1 -1
  34. package/esm2015/lib/components/filter/text/text.component.metadata.json +1 -1
  35. package/esm2015/lib/components/filters/filters.component.js +10 -2
  36. package/esm2015/lib/components/filters/filters.component.js.map +1 -1
  37. package/esm2015/lib/components/filters/filters.component.metadata.json +1 -1
  38. package/esm2015/lib/components/filters-config/filters-config.component.js +9 -2
  39. package/esm2015/lib/components/filters-config/filters-config.component.js.map +1 -1
  40. package/esm2015/lib/components/filters-config/filters-config.component.metadata.json +1 -1
  41. package/esm2015/lib/components/multiselect/multiselect.component.js +9 -2
  42. package/esm2015/lib/components/multiselect/multiselect.component.js.map +1 -1
  43. package/esm2015/lib/components/multiselect/multiselect.component.metadata.json +1 -1
  44. package/esm2015/lib/crud-full.module.js +8 -1
  45. package/esm2015/lib/crud-full.module.js.map +1 -1
  46. package/esm2015/lib/crud-full.module.ngfactory.js.map +1 -1
  47. package/esm2015/lib/crud.config.js +2 -0
  48. package/esm2015/lib/crud.config.js.map +1 -1
  49. package/esm2015/lib/crud.module.js +9 -1
  50. package/esm2015/lib/crud.module.js.map +1 -1
  51. package/esm2015/lib/crud.module.ngfactory.js.map +1 -1
  52. package/esm2015/lib/factories/list-pagination/list-pagination.factory.js +8 -1
  53. package/esm2015/lib/factories/list-pagination/list-pagination.factory.js.map +1 -1
  54. package/esm2015/lib/pages/base/base.component.js +8 -1
  55. package/esm2015/lib/pages/base/base.component.js.map +1 -1
  56. package/esm2015/lib/pages/item/item.component.js +9 -1
  57. package/esm2015/lib/pages/item/item.component.js.map +1 -1
  58. package/esm2015/lib/pages/list/list.component.js +8 -1
  59. package/esm2015/lib/pages/list/list.component.js.map +1 -1
  60. package/esm2015/lib/pipes/form-options/form-options.pipe.js +8 -1
  61. package/esm2015/lib/pipes/form-options/form-options.pipe.js.map +1 -1
  62. package/esm2015/lib/pipes/pipes.module.js +1 -0
  63. package/esm2015/lib/pipes/pipes.module.js.map +1 -1
  64. package/esm2015/lib/services/crud/crud.service.js +8 -1
  65. package/esm2015/lib/services/crud/crud.service.js.map +1 -1
  66. package/esm2015/lib/services/socket/socket.service.js +8 -1
  67. package/esm2015/lib/services/socket/socket.service.js.map +1 -1
  68. package/fesm2015/smartsoft001-crud-shell-angular.js +162 -27
  69. package/fesm2015/smartsoft001-crud-shell-angular.js.map +1 -1
  70. package/package.json +17 -17
  71. package/smartsoft001-crud-shell-angular.metadata.json +1 -1
@@ -37,12 +37,19 @@ export class FormOptionsPipe {
37
37
  }
38
38
  }
39
39
  }
40
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
40
41
  FormOptionsPipe.decorators = [
41
42
  { type: Pipe, args: [{
42
43
  name: "smartFormOptions",
43
44
  },] }
44
45
  ];
45
- /** @nocollapse */
46
+ /**
47
+ * @type {function(): !Array<(null|{
48
+ * type: ?,
49
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
50
+ * })>}
51
+ * @nocollapse
52
+ */
46
53
  FormOptionsPipe.ctorParameters = () => [
47
54
  { type: ICrudModelPossibilitiesProvider, decorators: [{ type: Optional }, { type: Inject, args: [CRUD_MODEL_POSSIBILITIES_PROVIDER,] }] }
48
55
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"form-options.pipe.js","sourceRoot":"","sources":["../../../../../../../../../libs/crud/shell/angular/src/lib/pipes/form-options/form-options.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAsB,MAAM,eAAe,CAAC;AAK1E,OAAO,EACL,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,kEAAkE,CAAC;AAK1E,MAAM,OAAO,eAAe;IAE1B,YAGU,0BAA2D;QAA3D,+BAA0B,GAA1B,0BAA0B,CAAiC;IAClE,CAAC;IAEJ,SAAS,CACP,IAAO,EACP,IAAY,EACZ,IAAS,EACT,cAAmE,EACnE,eAAkE;QAElE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QAEhC,IAAI,aAAa,GAAG,EAAE,CAAC;QAEvB,IAAI,IAAI,IAAI,IAAI,CAAC,0BAA0B,EAAE;YAC3C,aAAa,GAAG,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAC3D;QAED,IAAI,IAAI,KAAK,QAAQ,EAAE;YACrB,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,aAAa;gBACb,eAAe;gBACf,cAAc;gBACd,KAAK,EAAE,IAAI,IAAI,EAAE;aAClB,CAAC;SACH;aAAM;YACL,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;YAEzB,IAAI,IAAI,EAAE;gBACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;oBAChC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;gBACzB,CAAC,CAAC,CAAC;aACJ;YAED,OAAO;gBACL,IAAI,EAAE,IAAI;gBACV,cAAc;gBACd,aAAa,EAAE,aAAa;gBAC5B,eAAe;gBACf,KAAK,EAAE,KAAK;aACb,CAAC;SACH;IACH,CAAC;;;YAnDF,IAAI,SAAC;gBACJ,IAAI,EAAE,kBAAkB;aACzB;;;;YALC,+BAA+B,uBAS5B,QAAQ,YACR,MAAM,SAAC,iCAAiC","sourcesContent":["import {Inject, Optional, Pipe, PipeTransform, Type} from \"@angular/core\";\n\nimport { IEntity } from \"@smartsoft001/domain-core\";\nimport {IFormOptions, InputBaseComponent} from \"@smartsoft001/angular\";\n\nimport {\n CRUD_MODEL_POSSIBILITIES_PROVIDER,\n ICrudModelPossibilitiesProvider,\n} from \"../../providers/model-possibilities/model-possibilities.provider\";\n\n@Pipe({\n name: \"smartFormOptions\",\n})\nexport class FormOptionsPipe<T extends IEntity<string>>\n implements PipeTransform {\n constructor(\n @Optional()\n @Inject(CRUD_MODEL_POSSIBILITIES_PROVIDER)\n private modelPossibilitiesProvider: ICrudModelPossibilitiesProvider\n ) {}\n\n transform(\n item: T,\n mode: string,\n type: any,\n uniqueProvider?: (values: Record<keyof T, any>) => Promise<boolean>,\n inputComponents?: { [key: string]: Type<InputBaseComponent<any>> }\n ): IFormOptions<T> {\n if (!mode || !type) return null;\n\n let possibilities = {};\n\n if (type && this.modelPossibilitiesProvider) {\n possibilities = this.modelPossibilitiesProvider.get(type);\n }\n\n if (mode === \"create\") {\n return {\n mode: \"create\",\n possibilities,\n inputComponents,\n uniqueProvider,\n model: new type(),\n };\n } else {\n const model = new type();\n\n if (item) {\n Object.keys(item).forEach((key) => {\n model[key] = item[key];\n });\n }\n\n return {\n mode: mode,\n uniqueProvider,\n possibilities: possibilities,\n inputComponents,\n model: model,\n };\n }\n }\n}\n"]}
1
+ {"version":3,"file":"form-options.pipe.js","sourceRoot":"","sources":["../../../../../../../../../libs/crud/shell/angular/src/lib/pipes/form-options/form-options.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAsB,MAAM,eAAe,CAAC;AAK1E,OAAO,EACL,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,kEAAkE,CAAC;AAK1E,MAAM,OAAO,eAAe;IAE1B,YAGU,0BAA2D;QAA3D,+BAA0B,GAA1B,0BAA0B,CAAiC;IAClE,CAAC;IAEJ,SAAS,CACP,IAAO,EACP,IAAY,EACZ,IAAS,EACT,cAAmE,EACnE,eAAkE;QAElE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QAEhC,IAAI,aAAa,GAAG,EAAE,CAAC;QAEvB,IAAI,IAAI,IAAI,IAAI,CAAC,0BAA0B,EAAE;YAC3C,aAAa,GAAG,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAC3D;QAED,IAAI,IAAI,KAAK,QAAQ,EAAE;YACrB,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,aAAa;gBACb,eAAe;gBACf,cAAc;gBACd,KAAK,EAAE,IAAI,IAAI,EAAE;aAClB,CAAC;SACH;aAAM;YACL,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;YAEzB,IAAI,IAAI,EAAE;gBACR,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;oBAChC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;gBACzB,CAAC,CAAC,CAAC;aACJ;YAED,OAAO;gBACL,IAAI,EAAE,IAAI;gBACV,cAAc;gBACd,aAAa,EAAE,aAAa;gBAC5B,eAAe;gBACf,KAAK,EAAE,KAAK;aACb,CAAC;SACH;IACH,CAAC;;;;YAnDF,IAAI,SAAC;gBACJ,IAAI,EAAE,kBAAkB;aACzB;;;;;;;;;;YALC,+BAA+B,uBAS5B,QAAQ,YACR,MAAM,SAAC,iCAAiC","sourcesContent":["import {Inject, Optional, Pipe, PipeTransform, Type} from \"@angular/core\";\n\nimport { IEntity } from \"@smartsoft001/domain-core\";\nimport {IFormOptions, InputBaseComponent} from \"@smartsoft001/angular\";\n\nimport {\n CRUD_MODEL_POSSIBILITIES_PROVIDER,\n ICrudModelPossibilitiesProvider,\n} from \"../../providers/model-possibilities/model-possibilities.provider\";\n\n@Pipe({\n name: \"smartFormOptions\",\n})\nexport class FormOptionsPipe<T extends IEntity<string>>\n implements PipeTransform {\n constructor(\n @Optional()\n @Inject(CRUD_MODEL_POSSIBILITIES_PROVIDER)\n private modelPossibilitiesProvider: ICrudModelPossibilitiesProvider\n ) {}\n\n transform(\n item: T,\n mode: string,\n type: any,\n uniqueProvider?: (values: Record<keyof T, any>) => Promise<boolean>,\n inputComponents?: { [key: string]: Type<InputBaseComponent<any>> }\n ): IFormOptions<T> {\n if (!mode || !type) return null;\n\n let possibilities = {};\n\n if (type && this.modelPossibilitiesProvider) {\n possibilities = this.modelPossibilitiesProvider.get(type);\n }\n\n if (mode === \"create\") {\n return {\n mode: \"create\",\n possibilities,\n inputComponents,\n uniqueProvider,\n model: new type(),\n };\n } else {\n const model = new type();\n\n if (item) {\n Object.keys(item).forEach((key) => {\n model[key] = item[key];\n });\n }\n\n return {\n mode: mode,\n uniqueProvider,\n possibilities: possibilities,\n inputComponents,\n model: model,\n };\n }\n }\n}\n"]}
@@ -2,6 +2,7 @@ import { NgModule } from "@angular/core";
2
2
  import { FormOptionsPipe } from "./form-options/form-options.pipe";
3
3
  export class CrudPipesModule {
4
4
  }
5
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
5
6
  CrudPipesModule.decorators = [
6
7
  { type: NgModule, args: [{
7
8
  declarations: [
@@ -1 +1 @@
1
- {"version":3,"file":"pipes.module.js","sourceRoot":"","sources":["../../../../../../../../libs/crud/shell/angular/src/lib/pipes/pipes.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAUjE,MAAM,OAAO,eAAe;;;YAR3B,QAAQ,SAAC;gBACN,YAAY,EAAE;oBACV,eAAe;iBAClB;gBACD,OAAO,EAAE;oBACL,eAAe;iBAClB;aACJ","sourcesContent":["import {NgModule} from \"@angular/core\";\n\nimport {FormOptionsPipe} from \"./form-options/form-options.pipe\";\n\n@NgModule({\n declarations: [\n FormOptionsPipe\n ],\n exports: [\n FormOptionsPipe\n ]\n})\nexport class CrudPipesModule {\n\n}\n"]}
1
+ {"version":3,"file":"pipes.module.js","sourceRoot":"","sources":["../../../../../../../../libs/crud/shell/angular/src/lib/pipes/pipes.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAUjE,MAAM,OAAO,eAAe;;;;YAR3B,QAAQ,SAAC;gBACN,YAAY,EAAE;oBACV,eAAe;iBAClB;gBACD,OAAO,EAAE;oBACL,eAAe;iBAClB;aACJ","sourcesContent":["import {NgModule} from \"@angular/core\";\n\nimport {FormOptionsPipe} from \"./form-options/form-options.pipe\";\n\n@NgModule({\n declarations: [\n FormOptionsPipe\n ],\n exports: [\n FormOptionsPipe\n ]\n})\nexport class CrudPipesModule {\n\n}\n"]}
@@ -115,10 +115,17 @@ export class CrudService {
115
115
  return query ? "?" + query.replace("&", "") : "";
116
116
  }
117
117
  }
118
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
118
119
  CrudService.decorators = [
119
120
  { type: Injectable }
120
121
  ];
121
- /** @nocollapse */
122
+ /**
123
+ * @type {function(): !Array<(null|{
124
+ * type: ?,
125
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
126
+ * })>}
127
+ * @nocollapse
128
+ */
122
129
  CrudService.ctorParameters = () => [
123
130
  { type: CrudConfig },
124
131
  { type: HttpClient },
@@ -1 +1 @@
1
- {"version":3,"file":"crud.service.js","sourceRoot":"","sources":["../../../../../../../../../libs/crud/shell/angular/src/lib/services/crud/crud.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAa,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAKrC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,MAA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aAAa,uBAYjB,QAAQ","sourcesContent":["import {Injectable, Optional} from \"@angular/core\";\nimport {forkJoin, Observable} from \"rxjs\";\nimport { HttpClient } from \"@angular/common/http\";\nimport { map } from \"rxjs/operators\";\n\nimport { IEntity } from \"@smartsoft001/domain-core\";\nimport { ItemChangedData } from \"@smartsoft001/crud-shell-dtos\";\n\nimport { CrudConfig } from \"../../crud.config\";\nimport { ICrudCreateManyOptions, ICrudFilter } from \"../../models/interfaces\";\nimport { SocketService } from \"../socket/socket.service\";\n\n@Injectable()\nexport class CrudService<T extends IEntity<string>> {\n protected _formatMap = {\n csv: \"text/csv\",\n xlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n };\n\n constructor(\n protected config: CrudConfig<T>,\n protected http: HttpClient,\n @Optional() protected socket: SocketService<T>\n ) {}\n\n changes(criteria: { id?: string } = {}): Observable<ItemChangedData> {\n this.socket.emit(\"changes\", criteria);\n return this.socket.fromEvent(\"changes\");\n }\n\n // TODO : Location is null\n create(item: T): Observable<string> {\n return this.http\n .post<void>(this.config.apiUrl, item, { observe: \"response\" })\n .pipe(\n map((response) => {\n const location = response.headers[\"Location\"];\n if (!location) return null;\n const array = location.split(\"/\");\n return array[array.length - 1];\n })\n );\n }\n\n createMany(\n items: Array<T>,\n options: ICrudCreateManyOptions\n ): Observable<void> {\n return this.http.post<void>(\n this.config.apiUrl + \"/bulk?mode=\" + options.mode,\n items\n );\n }\n\n getById(id: string): Observable<T> {\n return this.http.get<T>(this.config.apiUrl + \"/\" + id);\n }\n\n getList(\n filter: ICrudFilter = null\n ): Observable<{ data: T[]; totalCount: number; links }> {\n return this.http.get<{ data: T[]; totalCount: number; links }>(\n this.config.apiUrl + this.getQuery(filter)\n );\n }\n\n exportList(filter: ICrudFilter = null, format): Observable<void> {\n if (!format) {\n format = \"csv\";\n }\n\n if (format === \"xlsx\") {\n return this.http\n .get(this.config.apiUrl + this.getQuery(filter), {\n headers: {\n \"Content-Type\": this._formatMap[format],\n },\n observe: \"response\",\n reportProgress: false,\n responseType: \"blob\",\n })\n .pipe(\n map((res) => {\n const downloadLink = document.createElement(\"a\");\n const blob = res.body;\n\n const url = URL.createObjectURL(blob);\n downloadLink.href = url;\n downloadLink.download = \"data.\" + format;\n\n document.body.appendChild(downloadLink);\n downloadLink.click();\n document.body.removeChild(downloadLink);\n })\n );\n }\n\n return this.http\n .get<string>(this.config.apiUrl + this.getQuery(filter), {\n headers: {\n \"Content-Type\": this._formatMap[format],\n },\n responseType: \"text\" as \"json\",\n })\n .pipe(\n map((res) => {\n const downloadLink = document.createElement(\"a\");\n const blob = new Blob([\"\\ufeff\", res]);\n\n const url = URL.createObjectURL(blob);\n downloadLink.href = url;\n downloadLink.download = \"data.\" + format;\n\n document.body.appendChild(downloadLink);\n downloadLink.click();\n document.body.removeChild(downloadLink);\n })\n );\n }\n\n update(item: T): Observable<void> {\n return this.http.put<void>(this.config.apiUrl + \"/\" + item.id, item);\n }\n\n updatePartial(item: Partial<T> & { id: string }): Observable<void> {\n return this.http.patch<void>(this.config.apiUrl + \"/\" + item.id, item);\n }\n\n updatePartialMany(items: (Partial<T> & { id: string })[]): Observable<any> {\n return forkJoin(items.map(item => {\n return this.updatePartial(item);\n }));\n }\n\n delete(id: string): Observable<void> {\n return this.http.delete<void>(this.config.apiUrl + \"/\" + id);\n }\n\n protected getQuery(filter: ICrudFilter): string {\n let query = \"\";\n\n if (filter && filter.searchText) {\n query += \"&$search=\" + filter.searchText;\n }\n\n if (filter && filter.limit) {\n query += `&limit=${filter.limit}&offset=${\n filter.offset ? filter.offset : 0\n }`;\n }\n\n if (filter && filter.sortBy) {\n query += `&sort=${(filter.sortDesc ? \"-\" : \"\") + filter.sortBy}`;\n }\n\n if (filter && filter.query) {\n filter.query.forEach((q) => {\n query += \"&\" + q.key + q.type + q.value;\n });\n }\n\n return query ? \"?\" + query.replace(\"&\", \"\") : \"\";\n }\n}\n"]}
1
+ {"version":3,"file":"crud.service.js","sourceRoot":"","sources":["../../../../../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B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBACzB,KAAK,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC;YAC1C,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnD,CAAC;;;;YAtJF,UAAU;;;;;;;;;;YAJF,UAAU;YANV,UAAU;YAQV,aAAa,uBAYjB,QAAQ","sourcesContent":["import {Injectable, Optional} from \"@angular/core\";\nimport {forkJoin, Observable} from \"rxjs\";\nimport { HttpClient } from \"@angular/common/http\";\nimport { map } from \"rxjs/operators\";\n\nimport { IEntity } from \"@smartsoft001/domain-core\";\nimport { ItemChangedData } from \"@smartsoft001/crud-shell-dtos\";\n\nimport { CrudConfig } from \"../../crud.config\";\nimport { ICrudCreateManyOptions, ICrudFilter } from \"../../models/interfaces\";\nimport { SocketService } from \"../socket/socket.service\";\n\n@Injectable()\nexport class CrudService<T extends IEntity<string>> {\n protected _formatMap = {\n csv: \"text/csv\",\n xlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n };\n\n constructor(\n protected config: CrudConfig<T>,\n protected http: HttpClient,\n @Optional() protected socket: SocketService<T>\n ) {}\n\n changes(criteria: { id?: string } = {}): Observable<ItemChangedData> {\n this.socket.emit(\"changes\", criteria);\n return this.socket.fromEvent(\"changes\");\n }\n\n // TODO : Location is null\n create(item: T): Observable<string> {\n return this.http\n .post<void>(this.config.apiUrl, item, { observe: \"response\" })\n .pipe(\n map((response) => {\n const location = response.headers[\"Location\"];\n if (!location) return null;\n const array = location.split(\"/\");\n return array[array.length - 1];\n })\n );\n }\n\n createMany(\n items: Array<T>,\n options: ICrudCreateManyOptions\n ): Observable<void> {\n return this.http.post<void>(\n this.config.apiUrl + \"/bulk?mode=\" + options.mode,\n items\n );\n }\n\n getById(id: string): Observable<T> {\n return this.http.get<T>(this.config.apiUrl + \"/\" + id);\n }\n\n getList(\n filter: ICrudFilter = null\n ): Observable<{ data: T[]; totalCount: number; links }> {\n return this.http.get<{ data: T[]; totalCount: number; links }>(\n this.config.apiUrl + this.getQuery(filter)\n );\n }\n\n exportList(filter: ICrudFilter = null, format): Observable<void> {\n if (!format) {\n format = \"csv\";\n }\n\n if (format === \"xlsx\") {\n return this.http\n .get(this.config.apiUrl + this.getQuery(filter), {\n headers: {\n \"Content-Type\": this._formatMap[format],\n },\n observe: \"response\",\n reportProgress: false,\n responseType: \"blob\",\n })\n .pipe(\n map((res) => {\n const downloadLink = document.createElement(\"a\");\n const blob = res.body;\n\n const url = URL.createObjectURL(blob);\n downloadLink.href = url;\n downloadLink.download = \"data.\" + format;\n\n document.body.appendChild(downloadLink);\n downloadLink.click();\n document.body.removeChild(downloadLink);\n })\n );\n }\n\n return this.http\n .get<string>(this.config.apiUrl + this.getQuery(filter), {\n headers: {\n \"Content-Type\": this._formatMap[format],\n },\n responseType: \"text\" as \"json\",\n })\n .pipe(\n map((res) => {\n const downloadLink = document.createElement(\"a\");\n const blob = new Blob([\"\\ufeff\", res]);\n\n const url = URL.createObjectURL(blob);\n downloadLink.href = url;\n downloadLink.download = \"data.\" + format;\n\n document.body.appendChild(downloadLink);\n downloadLink.click();\n document.body.removeChild(downloadLink);\n })\n );\n }\n\n update(item: T): Observable<void> {\n return this.http.put<void>(this.config.apiUrl + \"/\" + item.id, item);\n }\n\n updatePartial(item: Partial<T> & { id: string }): Observable<void> {\n return this.http.patch<void>(this.config.apiUrl + \"/\" + item.id, item);\n }\n\n updatePartialMany(items: (Partial<T> & { id: string })[]): Observable<any> {\n return forkJoin(items.map(item => {\n return this.updatePartial(item);\n }));\n }\n\n delete(id: string): Observable<void> {\n return this.http.delete<void>(this.config.apiUrl + \"/\" + id);\n }\n\n protected getQuery(filter: ICrudFilter): string {\n let query = \"\";\n\n if (filter && filter.searchText) {\n query += \"&$search=\" + filter.searchText;\n }\n\n if (filter && filter.limit) {\n query += `&limit=${filter.limit}&offset=${\n filter.offset ? filter.offset : 0\n }`;\n }\n\n if (filter && filter.sortBy) {\n query += `&sort=${(filter.sortDesc ? \"-\" : \"\") + filter.sortBy}`;\n }\n\n if (filter && filter.query) {\n filter.query.forEach((q) => {\n query += \"&\" + q.key + q.type + q.value;\n });\n }\n\n return query ? \"?\" + query.replace(\"&\", \"\") : \"\";\n }\n}\n"]}
@@ -13,10 +13,17 @@ export class SocketService extends Socket {
13
13
  this.crudConfig = crudConfig;
14
14
  }
15
15
  }
16
+ /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
16
17
  SocketService.decorators = [
17
18
  { type: Injectable }
18
19
  ];
19
- /** @nocollapse */
20
+ /**
21
+ * @type {function(): !Array<(null|{
22
+ * type: ?,
23
+ * decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>),
24
+ * })>}
25
+ * @nocollapse
26
+ */
20
27
  SocketService.ctorParameters = () => [
21
28
  { type: CrudConfig }
22
29
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"socket.service.js","sourceRoot":"","sources":["../../../../../../../../../libs/crud/shell/angular/src/lib/services/socket/socket.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAG7C,MAAM,OAAO,aAAiB,SAAQ,MAAM;IACxC,YAAoB,UAAyB;QACzC,KAAK,CAAE;YACH,GAAG,EAAE,UAAU,CAAC,MAAM;YACtB,OAAO,EAAE;gBACL,UAAU,EAAE,CAAC,WAAW,CAAC;gBACzB,IAAI,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,GAAG,WAAW;aAC1D;SACJ,CAAC,CAAC;QAPa,eAAU,GAAV,UAAU,CAAe;IAQ7C,CAAC;;;YAVJ,UAAU;;;;YAFH,UAAU","sourcesContent":["import {Socket} from \"ngx-socket-io\";\nimport {Injectable} from \"@angular/core\";\n\nimport {CrudConfig} from \"../../crud.config\";\n\n@Injectable()\nexport class SocketService<T> extends Socket {\n constructor(private crudConfig: CrudConfig<T>) {\n super( {\n url: crudConfig.apiUrl,\n options: {\n transports: [\"websocket\"],\n path: new URL(crudConfig.apiUrl).pathname + '/_socket/'\n }\n });\n }\n}\n"]}
1
+ {"version":3,"file":"socket.service.js","sourceRoot":"","sources":["../../../../../../../../../libs/crud/shell/angular/src/lib/services/socket/socket.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAG7C,MAAM,OAAO,aAAiB,SAAQ,MAAM;IACxC,YAAoB,UAAyB;QACzC,KAAK,CAAE;YACH,GAAG,EAAE,UAAU,CAAC,MAAM;YACtB,OAAO,EAAE;gBACL,UAAU,EAAE,CAAC,WAAW,CAAC;gBACzB,IAAI,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,GAAG,WAAW;aAC1D;SACJ,CAAC,CAAC;QAPa,eAAU,GAAV,UAAU,CAAe;IAQ7C,CAAC;;;;YAVJ,UAAU;;;;;;;;;;YAFH,UAAU","sourcesContent":["import {Socket} from \"ngx-socket-io\";\nimport {Injectable} from \"@angular/core\";\n\nimport {CrudConfig} from \"../../crud.config\";\n\n@Injectable()\nexport class SocketService<T> extends Socket {\n constructor(private crudConfig: CrudConfig<T>) {\n super( {\n url: crudConfig.apiUrl,\n options: {\n transports: [\"websocket\"],\n path: new URL(crudConfig.apiUrl).pathname + '/_socket/'\n }\n });\n }\n}\n"]}