@wertzui/ngx-restworld-client 1.0.2 → 2.0.0

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 (31) hide show
  1. package/bundles/wertzui-ngx-restworld-client.umd.js +1101 -301
  2. package/bundles/wertzui-ngx-restworld-client.umd.js.map +1 -1
  3. package/esm2015/lib/models/problem-details.js +2 -2
  4. package/esm2015/lib/pipes/as.pipe.js +25 -0
  5. package/esm2015/lib/pipes/safe-url.pipe.js +23 -0
  6. package/esm2015/lib/restworld-client.module.js +68 -8
  7. package/esm2015/lib/services/avatar-generator.js +2 -2
  8. package/esm2015/lib/services/form.service.js +69 -0
  9. package/esm2015/lib/services/restworld-client-collection.js +1 -1
  10. package/esm2015/lib/services/restworld-client.js +46 -8
  11. package/esm2015/lib/views/restworld-edit-form/restworld-edit-form.component.js +238 -0
  12. package/esm2015/lib/views/restworld-edit-view/restworld-edit-view.component.js +209 -143
  13. package/esm2015/lib/views/restworld-file-view/restworld-file-view.component.js +63 -0
  14. package/esm2015/lib/views/restworld-image-view/restworld-image-view.component.js +107 -0
  15. package/esm2015/lib/views/restworld-list-view/restworld-list-view.component.js +64 -37
  16. package/esm2015/public-api.js +7 -1
  17. package/fesm2015/wertzui-ngx-restworld-client.js +880 -220
  18. package/fesm2015/wertzui-ngx-restworld-client.js.map +1 -1
  19. package/lib/models/problem-details.d.ts +4 -8
  20. package/lib/pipes/as.pipe.d.ts +18 -0
  21. package/lib/pipes/safe-url.pipe.d.ts +10 -0
  22. package/lib/restworld-client.module.d.ts +35 -21
  23. package/lib/services/form.service.d.ts +14 -0
  24. package/lib/services/restworld-client.d.ts +4 -1
  25. package/lib/views/restworld-edit-form/restworld-edit-form.component.d.ts +69 -0
  26. package/lib/views/restworld-edit-view/restworld-edit-view.component.d.ts +53 -32
  27. package/lib/views/restworld-file-view/restworld-file-view.component.d.ts +21 -0
  28. package/lib/views/restworld-image-view/restworld-image-view.component.d.ts +38 -0
  29. package/lib/views/restworld-list-view/restworld-list-view.component.d.ts +20 -8
  30. package/package.json +29 -8
  31. package/public-api.d.ts +6 -0
@@ -5,9 +5,7 @@ export interface ProblemDetailsDto {
5
5
  status?: number;
6
6
  detail?: string;
7
7
  instance?: string;
8
- extensions?: {
9
- [key: string]: any;
10
- };
8
+ [key: string]: unknown;
11
9
  }
12
10
  export declare class ProblemDetails extends Resource implements ResourceOfDto<ProblemDetailsDto> {
13
11
  type?: string;
@@ -15,10 +13,8 @@ export declare class ProblemDetails extends Resource implements ResourceOfDto<Pr
15
13
  status?: number;
16
14
  detail?: string;
17
15
  instance?: string;
18
- extensions?: {
19
- [key: string]: any;
20
- };
21
- static isProblemDetails(resource: any): resource is ProblemDetails;
22
- static containsProblemDetailsInformation(resource: any): any;
16
+ [key: string]: unknown;
17
+ static isProblemDetails(resource: unknown): resource is ProblemDetails;
18
+ static containsProblemDetailsInformation(resource: unknown): unknown;
23
19
  static fromResource(resource: Resource | null | undefined): ProblemDetails;
24
20
  }
@@ -0,0 +1,18 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Cast super type into type using generics
5
+ * Return Type obtained by optional @param type OR assignment type.
6
+ */
7
+ export declare class AsPipe implements PipeTransform {
8
+ /**
9
+ * Cast (S: SuperType) into (T: Type) using @Generics.
10
+ * @param value (S: SuperType) obtained from input type.
11
+ * @optional @param type (T CastingType)
12
+ * type?: { new (): T }
13
+ * type?: new () => T
14
+ */
15
+ transform<S, T extends S>(value: S, type: new (...args: any[]) => T): T;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<AsPipe, never>;
17
+ static ɵpipe: i0.ɵɵPipeDeclaration<AsPipe, "as">;
18
+ }
@@ -0,0 +1,10 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { DomSanitizer } from '@angular/platform-browser';
3
+ import * as i0 from "@angular/core";
4
+ export declare class SafeUrlPipe implements PipeTransform {
5
+ private _domSanitizer;
6
+ constructor(_domSanitizer: DomSanitizer);
7
+ transform(url: unknown): import("@angular/platform-browser").SafeResourceUrl;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<SafeUrlPipe, never>;
9
+ static ɵpipe: i0.ɵɵPipeDeclaration<SafeUrlPipe, "safeUrl">;
10
+ }
@@ -2,29 +2,43 @@ import { SettingsService } from './services/settings.service';
2
2
  import * as i0 from "@angular/core";
3
3
  import * as i1 from "./views/restworld-list-view/restworld-list-view.component";
4
4
  import * as i2 from "./views/restworld-edit-view/restworld-edit-view.component";
5
- import * as i3 from "@angular/common";
6
- import * as i4 from "@angular/router";
7
- import * as i5 from "@angular/forms";
8
- import * as i6 from "primeng/table";
9
- import * as i7 from "primeng/tooltip";
10
- import * as i8 from "@angular/cdk/scrolling";
11
- import * as i9 from "primeng/inputtext";
12
- import * as i10 from "primeng/inputnumber";
13
- import * as i11 from "primeng/calendar";
14
- import * as i12 from "primeng/checkbox";
15
- import * as i13 from "primeng/confirmdialog";
16
- import * as i14 from "primeng/toast";
17
- import * as i15 from "primeng/messages";
18
- import * as i16 from "primeng/panel";
19
- import * as i17 from "primeng/tabview";
20
- import * as i18 from "primeng/skeleton";
21
- import * as i19 from "primeng/progressspinner";
22
- import * as i20 from "primeng/ripple";
23
- import * as i21 from "primeng/tristatecheckbox";
24
- import * as i22 from "primeng/avatar";
5
+ import * as i3 from "./views/restworld-image-view/restworld-image-view.component";
6
+ import * as i4 from "./views/restworld-file-view/restworld-file-view.component";
7
+ import * as i5 from "./pipes/safe-url.pipe";
8
+ import * as i6 from "./pipes/as.pipe";
9
+ import * as i7 from "./views/restworld-edit-form/restworld-edit-form.component";
10
+ import * as i8 from "@angular/common";
11
+ import * as i9 from "@angular/router";
12
+ import * as i10 from "@angular/forms";
13
+ import * as i11 from "primeng/table";
14
+ import * as i12 from "primeng/tooltip";
15
+ import * as i13 from "@angular/cdk/scrolling";
16
+ import * as i14 from "primeng/inputtext";
17
+ import * as i15 from "primeng/inputnumber";
18
+ import * as i16 from "primeng/calendar";
19
+ import * as i17 from "primeng/checkbox";
20
+ import * as i18 from "primeng/confirmdialog";
21
+ import * as i19 from "primeng/toast";
22
+ import * as i20 from "primeng/messages";
23
+ import * as i21 from "primeng/panel";
24
+ import * as i22 from "primeng/tabview";
25
+ import * as i23 from "primeng/skeleton";
26
+ import * as i24 from "primeng/progressspinner";
27
+ import * as i25 from "primeng/ripple";
28
+ import * as i26 from "primeng/tristatecheckbox";
29
+ import * as i27 from "primeng/avatar";
30
+ import * as i28 from "primeng/dropdown";
31
+ import * as i29 from "primeng/multiselect";
32
+ import * as i30 from "primeng/fileupload";
33
+ import * as i31 from "ngx-valdemort";
34
+ import * as i32 from "ngx-image-cropper";
35
+ import * as i33 from "primeng/dialog";
36
+ import * as i34 from "primeng/button";
37
+ import * as i35 from "primeng/colorpicker";
38
+ import * as i36 from "@angular/cdk/drag-drop";
25
39
  export declare function initializeSettings(settingsService: SettingsService): () => Promise<void>;
26
40
  export declare class RestworldClientModule {
27
41
  static ɵfac: i0.ɵɵFactoryDeclaration<RestworldClientModule, never>;
28
- static ɵmod: i0.ɵɵNgModuleDeclaration<RestworldClientModule, [typeof i1.RESTworldListViewComponent, typeof i2.RESTworldEditViewComponent], [typeof i3.CommonModule, typeof i4.RouterModule, typeof i5.FormsModule, typeof i5.ReactiveFormsModule, typeof i6.TableModule, typeof i7.TooltipModule, typeof i8.ScrollingModule, typeof i9.InputTextModule, typeof i10.InputNumberModule, typeof i11.CalendarModule, typeof i12.CheckboxModule, typeof i13.ConfirmDialogModule, typeof i14.ToastModule, typeof i15.MessagesModule, typeof i16.PanelModule, typeof i17.TabViewModule, typeof i18.SkeletonModule, typeof i19.ProgressSpinnerModule, typeof i20.RippleModule, typeof i21.TriStateCheckboxModule, typeof i22.AvatarModule], [typeof i1.RESTworldListViewComponent, typeof i2.RESTworldEditViewComponent]>;
42
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RestworldClientModule, [typeof i1.RESTworldListViewComponent, typeof i2.RESTworldEditViewComponent, typeof i3.RESTWorldImageViewComponent, typeof i4.RESTWorldFileViewComponent, typeof i5.SafeUrlPipe, typeof i6.AsPipe, typeof i7.RestworldEditFormComponent], [typeof i8.CommonModule, typeof i9.RouterModule, typeof i10.FormsModule, typeof i10.ReactiveFormsModule, typeof i11.TableModule, typeof i12.TooltipModule, typeof i13.ScrollingModule, typeof i14.InputTextModule, typeof i15.InputNumberModule, typeof i16.CalendarModule, typeof i17.CheckboxModule, typeof i18.ConfirmDialogModule, typeof i19.ToastModule, typeof i20.MessagesModule, typeof i21.PanelModule, typeof i22.TabViewModule, typeof i23.SkeletonModule, typeof i24.ProgressSpinnerModule, typeof i25.RippleModule, typeof i26.TriStateCheckboxModule, typeof i27.AvatarModule, typeof i28.DropdownModule, typeof i29.MultiSelectModule, typeof i30.FileUploadModule, typeof i31.ValdemortModule, typeof i32.ImageCropperModule, typeof i33.DialogModule, typeof i34.ButtonModule, typeof i35.ColorPickerModule, typeof i36.DragDropModule], [typeof i1.RESTworldListViewComponent, typeof i2.RESTworldEditViewComponent, typeof i3.RESTWorldImageViewComponent, typeof i4.RESTWorldFileViewComponent, typeof i5.SafeUrlPipe]>;
29
43
  static ɵinj: i0.ɵɵInjectorDeclaration<RestworldClientModule>;
30
44
  }
@@ -0,0 +1,14 @@
1
+ import { FormArray, FormControl, FormGroup } from '@angular/forms';
2
+ import { Property, Template, Templates } from '@wertzui/ngx-hal-client';
3
+ import * as i0 from "@angular/core";
4
+ export declare class FormService {
5
+ createFormGroupsFromTemplates(templates: Templates): {
6
+ [key: string]: FormGroup;
7
+ };
8
+ private createFormGroupFromTemplates;
9
+ createFormArrayFromTemplates(templates: Templates, ignoredProperties: string[]): FormArray;
10
+ createFormGroupFromTemplate(template: Template): FormGroup;
11
+ createFormControl(property: Property): FormControl | FormGroup | FormArray;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormService>;
14
+ }
@@ -1,5 +1,5 @@
1
1
  import { HttpHeaders, HttpResponse } from '@angular/common/http';
2
- import { HalClient, Link, PagedListResource, Resource } from "@wertzui/ngx-hal-client";
2
+ import { FormsResource, HalClient, Link, PagedListResource, Resource, Template } from "@wertzui/ngx-hal-client";
3
3
  import { ProblemDetails } from "../models/problem-details";
4
4
  import { RESTworldOptions } from "../models/restworld-options";
5
5
  export declare class RESTworldClient {
@@ -13,8 +13,11 @@ export declare class RESTworldClient {
13
13
  private getHomeForced;
14
14
  private setDefaultCurie;
15
15
  getList(rel: string, parameters: {}, headers?: HttpHeaders, curie?: string): Promise<HttpResponse<PagedListResource | ProblemDetails>>;
16
+ getListByUri(uri: string, parameters: {}, headers?: HttpHeaders): Promise<HttpResponse<PagedListResource | ProblemDetails>>;
16
17
  getSingle(relOrUri: string, id?: number, headers?: HttpHeaders, curie?: string): Promise<HttpResponse<Resource | ProblemDetails>>;
17
18
  save(resource: Resource): Promise<HttpResponse<Resource | ProblemDetails>>;
19
+ getAllForms(resource: Resource): Promise<HttpResponse<FormsResource | ProblemDetails>[]>;
20
+ submit(template: Template, formValues: {}): Promise<HttpResponse<FormsResource | ProblemDetails>>;
18
21
  delete(resource: Resource): Promise<HttpResponse<void | ProblemDetails>>;
19
22
  getAllLinksFromHome(): {
20
23
  [rel: string]: Link[] | undefined;
@@ -0,0 +1,69 @@
1
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
2
+ import { OnInit } from '@angular/core';
3
+ import { ChangeDetectorRef } from '@angular/core';
4
+ import { TemplateRef } from '@angular/core';
5
+ import { AbstractControl, FormArray, FormGroup } from '@angular/forms';
6
+ import { Property, PropertyType, Resource, Template } from '@wertzui/ngx-hal-client';
7
+ import { MessageService } from 'primeng/api';
8
+ import { FormService } from '../../services/form.service';
9
+ import { RESTworldClientCollection } from '../../services/restworld-client-collection';
10
+ import * as i0 from "@angular/core";
11
+ export declare class RestworldEditFormComponent implements OnInit {
12
+ private _formService;
13
+ private _changeDetectorRef;
14
+ private _messageService;
15
+ private _clients;
16
+ formGroup: FormGroup;
17
+ template: Template;
18
+ apiName?: string;
19
+ inputOptionsSingleRef?: TemplateRef<unknown>;
20
+ inputOptionsMultipleRef?: TemplateRef<unknown>;
21
+ inputOptionsRef?: TemplateRef<unknown>;
22
+ inputHiddenRef?: TemplateRef<unknown>;
23
+ inputTextRef?: TemplateRef<unknown>;
24
+ inputTextareaRef?: TemplateRef<unknown>;
25
+ inputSearchRef?: TemplateRef<unknown>;
26
+ inputTelRef?: TemplateRef<unknown>;
27
+ inputUrlRef?: TemplateRef<unknown>;
28
+ inputEmailRef?: TemplateRef<unknown>;
29
+ inputPasswordRef?: TemplateRef<unknown>;
30
+ inputDateRef?: TemplateRef<unknown>;
31
+ inputMonthRef?: TemplateRef<unknown>;
32
+ inputWeekRef?: TemplateRef<unknown>;
33
+ inputTimeRef?: TemplateRef<unknown>;
34
+ inputDatetimeLocalRef?: TemplateRef<unknown>;
35
+ inputNumberRef?: TemplateRef<unknown>;
36
+ inputRangeRef?: TemplateRef<unknown>;
37
+ inputColorRef?: TemplateRef<unknown>;
38
+ inputBoolRef?: TemplateRef<unknown>;
39
+ inputDatetimeOffsetRef?: TemplateRef<unknown>;
40
+ inputDurationRef?: TemplateRef<unknown>;
41
+ inputImageRef?: TemplateRef<unknown>;
42
+ inputFileRef?: TemplateRef<unknown>;
43
+ inputObjectRef?: TemplateRef<unknown>;
44
+ inputCollectionRef?: TemplateRef<unknown>;
45
+ inputDefaultRef?: TemplateRef<unknown>;
46
+ get PropertyType(): typeof PropertyType;
47
+ get dateFormat(): string;
48
+ FormGroup: typeof FormGroup;
49
+ FormArray: typeof FormArray;
50
+ Number: NumberConstructor;
51
+ constructor(_formService: FormService, _changeDetectorRef: ChangeDetectorRef, _messageService: MessageService, _clients: RESTworldClientCollection);
52
+ ngOnInit(): void;
53
+ getTooltip(resource: Resource, keysToExclude?: string[]): string;
54
+ private static jsonStringifyWithElipsis;
55
+ getCollectionEntryTemplates(property?: Property): Template[];
56
+ addNewItemToCollection(property: Property, formArray: FormArray | AbstractControl): void;
57
+ deleteItemFromCollection(property: Property, formArray: FormArray | AbstractControl, template: Template): void;
58
+ collectionItemDropped($event: CdkDragDrop<{
59
+ property: Property;
60
+ formArray: FormArray;
61
+ }>): void;
62
+ onOptionsFiltered(property: Property, event: {
63
+ originalEvent: unknown;
64
+ filter: string | null;
65
+ }): Promise<void>;
66
+ private getClient;
67
+ static ɵfac: i0.ɵɵFactoryDeclaration<RestworldEditFormComponent, never>;
68
+ static ɵcmp: i0.ɵɵComponentDeclaration<RestworldEditFormComponent, "rw-form", never, { "formGroup": "formGroup"; "template": "template"; "apiName": "apiName"; }, {}, ["inputOptionsSingleRef", "inputOptionsMultipleRef", "inputOptionsRef", "inputHiddenRef", "inputTextRef", "inputTextareaRef", "inputSearchRef", "inputTelRef", "inputUrlRef", "inputEmailRef", "inputPasswordRef", "inputDateRef", "inputMonthRef", "inputWeekRef", "inputTimeRef", "inputDatetimeLocalRef", "inputNumberRef", "inputRangeRef", "inputColorRef", "inputBoolRef", "inputDatetimeOffsetRef", "inputDurationRef", "inputImageRef", "inputFileRef", "inputObjectRef", "inputCollectionRef", "inputDefaultRef"], never>;
69
+ }
@@ -1,29 +1,28 @@
1
- import { Resource } from '@wertzui/ngx-hal-client';
1
+ import { PropertyType, Resource, Template, Templates } from '@wertzui/ngx-hal-client';
2
2
  import { RESTworldClientCollection } from '../../services/restworld-client-collection';
3
- import { FormGroup } from '@angular/forms';
3
+ import { FormControl, FormGroup } from '@angular/forms';
4
4
  import { ConfirmationService, MessageService } from 'primeng/api';
5
5
  import { Location } from '@angular/common';
6
6
  import { Router } from '@angular/router';
7
7
  import { TemplateRef } from '@angular/core';
8
+ import { ValdemortConfig } from 'ngx-valdemort';
9
+ import { FormService } from '../../services/form.service';
8
10
  import * as i0 from "@angular/core";
9
- interface PropertyDescription {
10
- field: string;
11
- value: any;
12
- label: string;
13
- type: 'text' | 'numeric' | 'date' | 'boolean' | 'object' | 'array';
14
- isReadOnly: boolean;
15
- children?: PropertyDescription[];
16
- }
17
11
  export declare class RESTworldEditViewComponent {
18
12
  private _clients;
19
13
  private _confirmationService;
20
14
  private _messageService;
21
15
  private _location;
22
16
  private _router;
23
- get properties(): PropertyDescription[];
24
- private _properties;
25
- get formGroup(): FormGroup;
26
- private _formGroup;
17
+ private _formService;
18
+ get PropertyType(): typeof PropertyType;
19
+ get templates(): Templates;
20
+ private _templates;
21
+ get isLoadingForTheFirstTime(): boolean;
22
+ get formTabs(): {
23
+ [name: string]: FormGroup;
24
+ };
25
+ private _formTabs;
27
26
  set apiName(value: string | undefined);
28
27
  get apiName(): string | undefined;
29
28
  private _apiName?;
@@ -35,27 +34,49 @@ export declare class RESTworldEditViewComponent {
35
34
  isLoading: boolean;
36
35
  get canSave(): boolean;
37
36
  get canDelete(): boolean;
38
- get dateFormat(): string;
39
- visualTabRef?: TemplateRef<any>;
40
- formRef?: TemplateRef<any>;
41
- formRowRef?: TemplateRef<any>;
42
- formLabelRef?: TemplateRef<any>;
43
- formInputRef?: TemplateRef<any>;
44
- visualTabAdditionalRef?: TemplateRef<any>;
45
- rawTabRef?: TemplateRef<any>;
46
- buttonsRef?: TemplateRef<any>;
47
- constructor(_clients: RESTworldClientCollection, _confirmationService: ConfirmationService, _messageService: MessageService, _location: Location, _router: Router);
37
+ canSubmit(templateName: string): boolean;
38
+ extraTabsRef?: TemplateRef<unknown>;
39
+ buttonsRef?: TemplateRef<unknown>;
40
+ inputOptionsSingleRef?: TemplateRef<unknown>;
41
+ inputOptionsMultipleRef?: TemplateRef<unknown>;
42
+ inputOptionsRef?: TemplateRef<unknown>;
43
+ inputHiddenRef?: TemplateRef<unknown>;
44
+ inputTextRef?: TemplateRef<unknown>;
45
+ inputTextareaRef?: TemplateRef<unknown>;
46
+ inputSearchRef?: TemplateRef<unknown>;
47
+ inputTelRef?: TemplateRef<unknown>;
48
+ inputUrlRef?: TemplateRef<unknown>;
49
+ inputEmailRef?: TemplateRef<unknown>;
50
+ inputPasswordRef?: TemplateRef<unknown>;
51
+ inputDateRef?: TemplateRef<unknown>;
52
+ inputMonthRef?: TemplateRef<unknown>;
53
+ inputWeekRef?: TemplateRef<unknown>;
54
+ inputTimeRef?: TemplateRef<unknown>;
55
+ inputDatetimeLocalRef?: TemplateRef<unknown>;
56
+ inputNumberRef?: TemplateRef<unknown>;
57
+ inputRangeRef?: TemplateRef<unknown>;
58
+ inputColorRef?: TemplateRef<unknown>;
59
+ inputBoolRef?: TemplateRef<unknown>;
60
+ inputDatetimeOffsetRef?: TemplateRef<unknown>;
61
+ inputDurationRef?: TemplateRef<unknown>;
62
+ inputImageRef?: TemplateRef<unknown>;
63
+ inputFileRef?: TemplateRef<unknown>;
64
+ inputDefaultRef?: TemplateRef<unknown>;
65
+ constructor(_clients: RESTworldClientCollection, _confirmationService: ConfirmationService, _messageService: MessageService, _location: Location, _router: Router, _formService: FormService, valdemortConfig: ValdemortConfig);
66
+ getTooltip(resource: Resource, keysToExclude?: string[]): string;
67
+ private static jsonStringifyWithElipsis;
48
68
  private getClient;
49
- save(): Promise<void>;
69
+ submit(templateName: string, template: Template, formValue: {}): Promise<void>;
50
70
  showDeleteConfirmatioModal(): void;
51
71
  delete(): Promise<void>;
52
72
  load(): Promise<void>;
53
- static createFormGroup(properties: PropertyDescription[]): FormGroup;
54
- private static createProperyInfos;
55
- private static getIsReadOnly;
56
- private static getColumnType;
57
- private static toTitleCase;
73
+ private setInitialSelectedOptionsElementsForTemplates;
74
+ imageChanged(formControl: FormControl, event: {
75
+ files: File[];
76
+ }): void;
77
+ private setInitialSelectedOptionsElementsForTemplate;
78
+ private setInitialSelectedOptionsElementForProperty;
79
+ private getAllTemplates;
58
80
  static ɵfac: i0.ɵɵFactoryDeclaration<RESTworldEditViewComponent, never>;
59
- static ɵcmp: i0.ɵɵComponentDeclaration<RESTworldEditViewComponent, "restworld-edit-view", never, { "apiName": "apiName"; "uri": "uri"; }, {}, ["visualTabRef", "formRef", "formRowRef", "formLabelRef", "formInputRef", "visualTabAdditionalRef", "rawTabRef", "buttonsRef"], never>;
81
+ static ɵcmp: i0.ɵɵComponentDeclaration<RESTworldEditViewComponent, "rw-edit", never, { "apiName": "apiName"; "uri": "uri"; }, {}, ["extraTabsRef", "buttonsRef", "inputOptionsSingleRef", "inputOptionsMultipleRef", "inputOptionsRef", "inputHiddenRef", "inputTextRef", "inputTextareaRef", "inputSearchRef", "inputTelRef", "inputUrlRef", "inputEmailRef", "inputPasswordRef", "inputDateRef", "inputMonthRef", "inputWeekRef", "inputTimeRef", "inputDatetimeLocalRef", "inputNumberRef", "inputRangeRef", "inputColorRef", "inputBoolRef", "inputDatetimeOffsetRef", "inputDurationRef", "inputImageRef", "inputFileRef", "inputDefaultRef"], never>;
60
82
  }
61
- export {};
@@ -0,0 +1,21 @@
1
+ import { QueryList } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { FileUpload } from 'primeng/fileupload';
4
+ import * as i0 from "@angular/core";
5
+ export declare class RESTWorldFileViewComponent implements ControlValueAccessor {
6
+ private onChange?;
7
+ accept?: string;
8
+ fileName?: string;
9
+ fileUploads?: QueryList<FileUpload>;
10
+ disabled: boolean;
11
+ uri?: string;
12
+ writeValue(obj?: string): void;
13
+ registerOnChange(fn?: Function): void;
14
+ registerOnTouched(): void;
15
+ setDisabledState?(isDisabled: boolean): void;
16
+ fileChanged(event: {
17
+ files: File[];
18
+ }): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<RESTWorldFileViewComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<RESTWorldFileViewComponent, "rw-file", never, { "accept": "accept"; "fileName": "fileName"; }, {}, never, never>;
21
+ }
@@ -0,0 +1,38 @@
1
+ import { QueryList } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { ImageCroppedEvent, OutputFormat } from 'ngx-image-cropper';
4
+ import { FileUpload } from 'primeng/fileupload';
5
+ import * as i0 from "@angular/core";
6
+ export declare class RESTWorldImageViewComponent implements ControlValueAccessor {
7
+ private onChange?;
8
+ alt?: string;
9
+ accept?: string;
10
+ fileName?: string;
11
+ maintainAspectRatio: boolean;
12
+ aspectRatio: number;
13
+ resizeToWidth: number;
14
+ resizeToHeight: number;
15
+ onlyScaleDown: boolean;
16
+ containWithinAspectRatio: boolean;
17
+ backgroundColor: string;
18
+ format: OutputFormat;
19
+ fileUploads?: QueryList<FileUpload>;
20
+ disabled: boolean;
21
+ uri?: string | null;
22
+ tempImageFile?: File;
23
+ displayCropDialog: boolean;
24
+ tempCroppedUri?: string | null;
25
+ writeValue(obj?: string | null): void;
26
+ registerOnChange(fn?: Function): void;
27
+ registerOnTouched(): void;
28
+ setDisabledState?(isDisabled: boolean): void;
29
+ showCropDialog(): void;
30
+ imageChanged(event: {
31
+ files: File[];
32
+ }): void;
33
+ croppedImageChanged(event: ImageCroppedEvent): void;
34
+ acceptCroppedImage(): void;
35
+ closeCropDialog(): void;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<RESTWorldImageViewComponent, never>;
37
+ static ɵcmp: i0.ɵɵComponentDeclaration<RESTWorldImageViewComponent, "rw-image", never, { "alt": "alt"; "accept": "accept"; "fileName": "fileName"; "maintainAspectRatio": "maintainAspectRatio"; "aspectRatio": "aspectRatio"; "resizeToWidth": "resizeToWidth"; "resizeToHeight": "resizeToHeight"; "onlyScaleDown": "onlyScaleDown"; "containWithinAspectRatio": "containWithinAspectRatio"; "backgroundColor": "backgroundColor"; "format": "format"; }, {}, never, never>;
38
+ }
@@ -1,14 +1,25 @@
1
1
  import { PagedListResource, Resource } from '@wertzui/ngx-hal-client';
2
- import { ConfirmationService, FilterMetadata, LazyLoadEvent, MessageService } from 'primeng/api';
2
+ import { ConfirmationService, LazyLoadEvent, MessageService } from 'primeng/api';
3
3
  import { RESTworldClientCollection } from '../../services/restworld-client-collection';
4
4
  import { AvatarGenerator } from '../../services/avatar-generator';
5
5
  import * as i0 from "@angular/core";
6
+ export declare enum ColumnType {
7
+ text = "text",
8
+ numeric = "numeric",
9
+ boolean = "boolean",
10
+ date = "date"
11
+ }
12
+ export interface Column {
13
+ header: string;
14
+ field: string;
15
+ type: ColumnType;
16
+ }
6
17
  export declare class RESTworldListViewComponent {
7
18
  private _clients;
8
19
  private _confirmationService;
9
20
  private _messageService;
10
21
  avatarGenerator: AvatarGenerator;
11
- get columns(): any[];
22
+ get columns(): Column[];
12
23
  private _columns;
13
24
  set editLink(value: string);
14
25
  get editLink(): string;
@@ -40,14 +51,15 @@ export declare class RESTworldListViewComponent {
40
51
  private createColumns;
41
52
  private static getColumnType;
42
53
  private static toTitleCase;
43
- private static createParametersFromEvent;
54
+ private createParametersFromEvent;
44
55
  static createSkipFromEvent(event: LazyLoadEvent): number | undefined;
45
56
  static createTopFromEvent(event: LazyLoadEvent): number | undefined;
46
57
  static createOrderByFromEvent(event: LazyLoadEvent): string | undefined;
47
- static createFilterFromEvent(event: LazyLoadEvent): string | undefined;
48
- static createFilterForProperty(property: string, filter: FilterMetadata): string | undefined;
49
- static createODataOperator(matchMode?: string): string;
50
- static createComparisonValue(value: unknown): string;
58
+ private createFilterFromEvent;
59
+ private createFilterForPropertyArray;
60
+ private createFilterForProperty;
61
+ private static createODataOperator;
62
+ private createComparisonValue;
51
63
  static ɵfac: i0.ɵɵFactoryDeclaration<RESTworldListViewComponent, never>;
52
- static ɵcmp: i0.ɵɵComponentDeclaration<RESTworldListViewComponent, "restworld-list-view", never, { "editLink": "editLink"; "apiName": "apiName"; "rel": "rel"; "rowsPerPage": "rowsPerPage"; }, {}, never, never>;
64
+ static ɵcmp: i0.ɵɵComponentDeclaration<RESTworldListViewComponent, "rw-list", never, { "editLink": "editLink"; "apiName": "apiName"; "rel": "rel"; "rowsPerPage": "rowsPerPage"; }, {}, never, never>;
53
65
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@wertzui/ngx-restworld-client",
3
- "version": "1.0.2",
3
+ "version": "2.0.0",
4
4
  "author": "wertzui",
5
- "description": "An Angular client to consume a RESTworld service that serves application/hal+json.",
5
+ "description": "An Angular client to consume a RESTworld service that serves application/hal+json or hal-forms+json.",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -16,20 +16,38 @@
16
16
  "angular",
17
17
  "hal",
18
18
  "hal+json",
19
+ "hal-forms",
20
+ "hal-forms+json",
19
21
  "rest"
20
22
  ],
21
23
  "license": "Unlicense",
22
24
  "readme": "https://github.com/wertzui/RESTworld/blob/main/README.md",
23
25
  "peerDependencies": {
26
+ "@angular/animations": "^12.2.13",
27
+ "@angular/cdk": "^12.2.13",
28
+ "@angular/common": "^12.2.13",
29
+ "@angular/compiler": "^12.2.13",
30
+ "@angular/core": "^12.2.13",
31
+ "@angular/forms": "^12.2.13",
32
+ "@angular/platform-browser": "^12.2.13",
33
+ "@angular/platform-browser-dynamic": "^12.2.13",
34
+ "@angular/platform-server": "^12.2.13",
35
+ "@angular/router": "^12.2.13",
24
36
  "@fortawesome/fontawesome-free": "^5.15.4",
25
- "@wertzui/ngx-hal-client": "^1.0.2",
37
+ "@jdrks/ngx-deep-linking": "^1.0.5",
38
+ "@wertzui/ngx-hal-client": "^1.1.0",
39
+ "cldr-dates-modern": "^39.0.0",
40
+ "cldr-numbers-modern": "^39.0.0",
26
41
  "lodash": "^4.17.21",
42
+ "ngx-image-cropper": "^5.0.1",
43
+ "ngx-take-until-destroy": "^5.4.0",
44
+ "ngx-valdemort": "^6.0.0",
27
45
  "primeflex": "^3.1.0",
28
46
  "primeicons": "^4.1.0",
29
- "primeng": "^12.2.1"
30
- },
31
- "dependencies": {
32
- "tslib": "^2.3.0"
47
+ "primeng": "^12.2.2",
48
+ "rxjs": "^6.6.7",
49
+ "uri-templates": "^0.2.0",
50
+ "zone.js": "^0.11.4"
33
51
  },
34
52
  "main": "bundles/wertzui-ngx-restworld-client.umd.js",
35
53
  "module": "fesm2015/wertzui-ngx-restworld-client.js",
@@ -37,5 +55,8 @@
37
55
  "esm2015": "esm2015/wertzui-ngx-restworld-client.js",
38
56
  "fesm2015": "fesm2015/wertzui-ngx-restworld-client.js",
39
57
  "typings": "wertzui-ngx-restworld-client.d.ts",
40
- "sideEffects": false
58
+ "sideEffects": false,
59
+ "dependencies": {
60
+ "tslib": "^2.2.0"
61
+ }
41
62
  }
package/public-api.d.ts CHANGED
@@ -3,10 +3,16 @@ export * from './lib/models/api-url';
3
3
  export * from './lib/models/client-settings';
4
4
  export * from './lib/models/problem-details';
5
5
  export * from './lib/models/restworld-options';
6
+ export * from './lib/pipes/safe-url.pipe';
7
+ export * from './lib/pipes/as.pipe';
6
8
  export * from './lib/services/avatar-generator';
9
+ export * from './lib/services/form.service';
7
10
  export * from './lib/services/restworld-client';
8
11
  export * from './lib/services/restworld-client-collection';
9
12
  export * from './lib/services/settings.service';
13
+ export * from './lib/views/restworld-edit-form/restworld-edit-form.component';
10
14
  export * from './lib/views/restworld-edit-view/restworld-edit-view.component';
15
+ export * from './lib/views/restworld-file-view/restworld-file-view.component';
16
+ export * from './lib/views/restworld-image-view/restworld-image-view.component';
11
17
  export * from './lib/views/restworld-list-view/restworld-list-view.component';
12
18
  export * from './lib/restworld-client.module';