@jsonforms/angular-material 3.2.1 → 3.3.0-alpha.1
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.
- package/lib/esm2022/library/controls/date.renderer.mjs +112 -14
- package/lib/esm2022/library/layouts/index.mjs +2 -1
- package/lib/esm2022/library/module.mjs +5 -3
- package/lib/esm2022/library/other/master-detail/master.mjs +3 -1
- package/lib/esm2022/library/other/table.renderer.mjs +190 -168
- package/lib/esm2022/library/util/date-format.mjs +27 -0
- package/lib/esm2022/library/util/dayjs-date-adapter.mjs +100 -0
- package/lib/fesm2022/jsonforms-angular-material.mjs +424 -184
- package/lib/fesm2022/jsonforms-angular-material.mjs.map +1 -1
- package/lib/library/controls/date.renderer.d.ts +15 -3
- package/lib/library/controls/date.renderer.d.ts.map +1 -1
- package/lib/library/layouts/index.d.ts +1 -0
- package/lib/library/layouts/index.d.ts.map +1 -1
- package/lib/library/module.d.ts +1 -1
- package/lib/library/module.d.ts.map +1 -1
- package/lib/library/other/master-detail/master.d.ts.map +1 -1
- package/lib/library/other/table.renderer.d.ts +10 -2
- package/lib/library/other/table.renderer.d.ts.map +1 -1
- package/lib/library/util/date-format.d.ts +17 -0
- package/lib/library/util/date-format.d.ts.map +1 -0
- package/lib/library/util/dayjs-date-adapter.d.ts +28 -0
- package/lib/library/util/dayjs-date-adapter.d.ts.map +1 -0
- package/lib/package.json +4 -3
- package/package.json +10 -8
- package/src/library/controls/date.renderer.ts +106 -8
- package/src/library/layouts/index.ts +1 -0
- package/src/library/module.ts +2 -1
- package/src/library/other/master-detail/master.ts +1 -0
- package/src/library/other/table.renderer.ts +104 -88
- package/src/library/util/date-format.ts +24 -0
- package/src/library/util/dayjs-date-adapter.ts +101 -0
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import { RankedTester } from '@jsonforms/core';
|
|
1
|
+
import { JsonFormsState, RankedTester, StatePropsOfControl } from '@jsonforms/core';
|
|
2
2
|
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
3
|
+
import { MyFormat } from '../util/date-format';
|
|
4
|
+
import { DayJsDateAdapter } from '../util/dayjs-date-adapter';
|
|
5
|
+
import { MatDatepicker } from '@angular/material/datepicker';
|
|
3
6
|
import * as i0 from "@angular/core";
|
|
4
7
|
export declare class DateControlRenderer extends JsonFormsControl {
|
|
8
|
+
private dateFormat;
|
|
9
|
+
private dateAdapter;
|
|
5
10
|
focused: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
views: string[];
|
|
12
|
+
startView: string;
|
|
13
|
+
panelClass: string;
|
|
14
|
+
constructor(jsonformsService: JsonFormsAngularService, dateFormat: MyFormat, dateAdapter: DayJsDateAdapter);
|
|
15
|
+
getEventValue: (event: any) => string;
|
|
16
|
+
protected mapToProps(state: JsonFormsState): StatePropsOfControl;
|
|
17
|
+
yearSelected($event: any, datepicker: MatDatepicker<DayJsDateAdapter>): void;
|
|
18
|
+
monthSelected($event: any, datepicker: MatDatepicker<DayJsDateAdapter>): void;
|
|
19
|
+
setViewProperties(): void;
|
|
8
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<DateControlRenderer, never>;
|
|
9
21
|
static ɵcmp: i0.ɵɵComponentDeclaration<DateControlRenderer, "DateControlRenderer", never, {}, {}, never, never, false, never>;
|
|
10
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.renderer.d.ts","sourceRoot":"","sources":["../../../src/library/controls/date.renderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date.renderer.d.ts","sourceRoot":"","sources":["../../../src/library/controls/date.renderer.ts"],"names":[],"mappings":"AA8BA,OAAO,EAGL,cAAc,EACd,YAAY,EAEZ,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;;AAE7D,qBAgEa,mBAAoB,SAAQ,gBAAgB;IAQ3B,OAAO,CAAC,UAAU;IACvB,OAAO,CAAC,WAAW;IAR1C,OAAO,UAAS;IAChB,KAAK,EAAE,MAAM,EAAE,CAAM;IACrB,SAAS,SAAM;IACf,UAAU,SAAM;gBAGd,gBAAgB,EAAE,uBAAuB,EACP,UAAU,EAAE,QAAQ,EACzB,WAAW,EAAE,gBAAgB;IAK5D,aAAa,UAAW,GAAG,YAGzB;IAEF,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,mBAAmB;IAwBhE,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,aAAa,CAAC,gBAAgB,CAAC;IAMrE,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,aAAa,CAAC,gBAAgB,CAAC;IAOtE,iBAAiB;yCAxDN,mBAAmB;2CAAnB,mBAAmB;CAgE/B;AAED,eAAO,MAAM,yBAAyB,EAAE,YAGvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/library/layouts/index.ts"],"names":[],"mappings":"AAwBA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/library/layouts/index.ts"],"names":[],"mappings":"AAwBA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
|
package/lib/library/module.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ import * as i40 from "@angular/material/tooltip";
|
|
|
42
42
|
import * as i41 from "@angular/material/badge";
|
|
43
43
|
export declare class JsonFormsAngularMaterialModule {
|
|
44
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormsAngularMaterialModule, never>;
|
|
45
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<JsonFormsAngularMaterialModule, [typeof i1.BooleanControlRenderer, typeof i2.TextAreaRenderer, typeof i3.TextControlRenderer, typeof i4.NumberControlRenderer, typeof i5.RangeControlRenderer, typeof i6.DateControlRenderer, typeof i7.ToggleControlRenderer, typeof i8.VerticalLayoutRenderer, typeof i9.HorizontalLayoutRenderer, typeof i10.CategorizationTabLayoutRenderer, typeof i11.GroupLayoutRenderer, typeof i12.LabelRenderer, typeof i13.MasterListComponent, typeof i14.JsonFormsDetailComponent, typeof i15.ObjectControlRenderer, typeof i16.AutocompleteControlRenderer, typeof i17.TableRenderer, typeof i18.ArrayLayoutRenderer, typeof i19.LayoutChildrenRenderPropsPipe], [typeof i20.CommonModule, typeof i21.JsonFormsModule, typeof i22.MatFormFieldModule, typeof i23.MatCheckboxModule, typeof i24.MatInputModule, typeof i25.MatSliderModule, typeof i26.MatSlideToggleModule, typeof i27.MatNativeDateModule, typeof i28.MatDatepickerModule, typeof i29.MatTabsModule, typeof i30.MatSidenavModule, typeof i31.MatListModule, typeof i32.ReactiveFormsModule, typeof i33.MatCardModule, typeof i34.MatSelectModule, typeof i35.MatButtonModule, typeof i36.MatIconModule, typeof i37.MatAutocompleteModule, typeof i38.MatTableModule, typeof i39.MatToolbarModule, typeof i40.MatTooltipModule, typeof i41.MatBadgeModule], [typeof i20.CommonModule, typeof i21.JsonFormsModule, typeof i22.MatFormFieldModule, typeof i23.MatCheckboxModule, typeof i24.MatInputModule, typeof i25.MatSliderModule, typeof i26.MatSlideToggleModule, typeof i27.MatNativeDateModule, typeof i28.MatDatepickerModule, typeof i29.MatTabsModule, typeof i30.MatSidenavModule, typeof i31.MatListModule, typeof i32.ReactiveFormsModule, typeof i33.MatCardModule, typeof i34.MatSelectModule, typeof i35.MatButtonModule, typeof i36.MatIconModule, typeof i37.MatAutocompleteModule]>;
|
|
45
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<JsonFormsAngularMaterialModule, [typeof i1.BooleanControlRenderer, typeof i2.TextAreaRenderer, typeof i3.TextControlRenderer, typeof i4.NumberControlRenderer, typeof i5.RangeControlRenderer, typeof i6.DateControlRenderer, typeof i7.ToggleControlRenderer, typeof i8.VerticalLayoutRenderer, typeof i9.HorizontalLayoutRenderer, typeof i10.CategorizationTabLayoutRenderer, typeof i11.GroupLayoutRenderer, typeof i12.LabelRenderer, typeof i13.MasterListComponent, typeof i14.JsonFormsDetailComponent, typeof i15.ObjectControlRenderer, typeof i16.AutocompleteControlRenderer, typeof i17.TableRenderer, typeof i18.ArrayLayoutRenderer, typeof i19.LayoutChildrenRenderPropsPipe, typeof i17.GetProps], [typeof i20.CommonModule, typeof i21.JsonFormsModule, typeof i22.MatFormFieldModule, typeof i23.MatCheckboxModule, typeof i24.MatInputModule, typeof i25.MatSliderModule, typeof i26.MatSlideToggleModule, typeof i27.MatNativeDateModule, typeof i28.MatDatepickerModule, typeof i29.MatTabsModule, typeof i30.MatSidenavModule, typeof i31.MatListModule, typeof i32.ReactiveFormsModule, typeof i33.MatCardModule, typeof i34.MatSelectModule, typeof i35.MatButtonModule, typeof i36.MatIconModule, typeof i37.MatAutocompleteModule, typeof i38.MatTableModule, typeof i39.MatToolbarModule, typeof i40.MatTooltipModule, typeof i41.MatBadgeModule], [typeof i20.CommonModule, typeof i21.JsonFormsModule, typeof i22.MatFormFieldModule, typeof i23.MatCheckboxModule, typeof i24.MatInputModule, typeof i25.MatSliderModule, typeof i26.MatSlideToggleModule, typeof i27.MatNativeDateModule, typeof i28.MatDatepickerModule, typeof i29.MatTabsModule, typeof i30.MatSidenavModule, typeof i31.MatListModule, typeof i32.ReactiveFormsModule, typeof i33.MatCardModule, typeof i34.MatSelectModule, typeof i35.MatButtonModule, typeof i36.MatIconModule, typeof i37.MatAutocompleteModule]>;
|
|
46
46
|
static ɵinj: i0.ɵɵInjectorDeclaration<JsonFormsAngularMaterialModule>;
|
|
47
47
|
}
|
|
48
48
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/library/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/library/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,qBAsEa,8BAA8B;yCAA9B,8BAA8B;0CAA9B,8BAA8B;0CAA9B,8BAA8B;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"master.d.ts","sourceRoot":"","sources":["../../../../src/library/other/master-detail/master.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,iBAAiB,EAEjB,MAAM,EACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAMjB,cAAc,EAGd,YAAY,EAGZ,wBAAwB,EAEzB,MAAM,iBAAiB,CAAC;;AAIzB,eAAO,MAAM,oBAAoB,SAAU,MAAM,WAOhD,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"master.d.ts","sourceRoot":"","sources":["../../../../src/library/other/master-detail/master.ts"],"names":[],"mappings":"AA0BA,OAAO,EAEL,iBAAiB,EAEjB,MAAM,EACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAMjB,cAAc,EAGd,YAAY,EAGZ,wBAAwB,EAEzB,MAAM,iBAAiB,CAAC;;AAIzB,eAAO,MAAM,oBAAoB,SAAU,MAAM,WAOhD,CAAC;AAEF,qBA2Fa,mBACX,SAAQ,qBACR,YAAW,MAAM;IAYf,OAAO,CAAC,iBAAiB;IAV3B,WAAW,EAAE,GAAG,EAAE,CAAC;IACnB,YAAY,EAAE,GAAG,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,MAAM,IAAI,CAAC;IAClD,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,MAAM,IAAI,CAAC;IAC9D,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,iBAAiB,CAAC;gBAG9B,gBAAgB,EAAE,uBAAuB,EACjC,iBAAiB,EAAE,iBAAiB;IAK9C,eAAe,CAAC,GAAG,EAAE,MAAM;IAI3B,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;IAIzC,QAAQ;IAUR,kBAAkB,CAAC,KAAK,EAAE,iBAAiB;IAwE3C,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAKtC,UAAU;IAOV,aAAa,CAAC,IAAI,EAAE,MAAM;IAI1B,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,wBAAwB;yCA7H1D,mBAAmB;2CAAnB,mBAAmB;CAiI/B;AAED,eAAO,MAAM,kBAAkB,EAAE,YAGhC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
1
|
+
import { OnInit, PipeTransform } from '@angular/core';
|
|
2
2
|
import { JsonFormsAngularService, JsonFormsArrayControl } from '@jsonforms/angular';
|
|
3
3
|
import { ArrayControlProps, ArrayTranslations, ControlElement, JsonSchema, OwnPropsOfRenderer, RankedTester, UISchemaElement } from '@jsonforms/core';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
@@ -15,7 +15,6 @@ export declare class TableRenderer extends JsonFormsArrayControl implements OnIn
|
|
|
15
15
|
constructor(jsonformsService: JsonFormsAngularService);
|
|
16
16
|
trackElement(index: number, _element: any): number;
|
|
17
17
|
mapAdditionalProps(props: ArrayControlProps): void;
|
|
18
|
-
getProps(index: number, props: OwnPropsOfRenderer): OwnPropsOfRenderer;
|
|
19
18
|
remove(index: number): void;
|
|
20
19
|
add(): void;
|
|
21
20
|
up(index: number): void;
|
|
@@ -33,5 +32,14 @@ interface ColumnDescription {
|
|
|
33
32
|
props: OwnPropsOfRenderer;
|
|
34
33
|
}
|
|
35
34
|
export declare const controlWithoutLabel: (scope: string) => ControlElement;
|
|
35
|
+
export declare class GetProps implements PipeTransform {
|
|
36
|
+
transform(index: number, props: OwnPropsOfRenderer): {
|
|
37
|
+
schema: JsonSchema;
|
|
38
|
+
uischema: UISchemaElement;
|
|
39
|
+
path: string;
|
|
40
|
+
};
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GetProps, never>;
|
|
42
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<GetProps, "getProps", false>;
|
|
43
|
+
}
|
|
36
44
|
export {};
|
|
37
45
|
//# sourceMappingURL=table.renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.renderer.d.ts","sourceRoot":"","sources":["../../../src/library/other/table.renderer.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAa,MAAM,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"table.renderer.d.ts","sourceRoot":"","sources":["../../../src/library/other/table.renderer.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAa,MAAM,EAAQ,aAAa,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EAMd,UAAU,EAGV,kBAAkB,EAElB,YAAY,EAGZ,eAAe,EAChB,MAAM,iBAAiB,CAAC;;AAEzB,qBAqGa,aAAc,SAAQ,qBAAsB,YAAW,MAAM;IACxE,cAAc,EAAE,eAAe,CAAC;IAChC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,QAAQ,CAAC,eAAe,WAAuB;IAC/C,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,MAAM,IAAI,CAAC;IAClD,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;IACxD,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;IAC1D,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,MAAM,IAAI,CAAC;IAC9D,YAAY,EAAE,iBAAiB,CAAC;gBAEpB,gBAAgB,EAAE,uBAAuB;IAGrD,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG;IAGzC,kBAAkB,CAAC,KAAK,EAAE,iBAAiB;IAS3C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAG3B,GAAG,IAAI,IAAI;IAMX,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAGvB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAGzB,QAAQ;IAaR,aAAa,WACH,UAAU,WACT,MAAM,KACd,iBAAiB,EAAE,CA+BpB;IAEF,mBAAmB,iBAAkB,UAAU,cAY7C;yCAtGS,aAAa;2CAAb,aAAa;CAuGzB;AACD,eAAO,MAAM,mBAAmB,EAAE,YAGjC,CAAC;AAEF,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,UAAW,MAAM,KAAG,cAIlD,CAAC;AAEH,qBACa,QAAS,YAAW,aAAa;IAC5C,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;;;;;yCADvC,QAAQ;uCAAR,QAAQ;CASpB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class MyFormat {
|
|
3
|
+
displayFormat: string;
|
|
4
|
+
setDisplayFormat(displayFormat: string): void;
|
|
5
|
+
get display(): {
|
|
6
|
+
monthYearLabel: string;
|
|
7
|
+
dateA11yLabel: string;
|
|
8
|
+
monthYearA11yLabel: string;
|
|
9
|
+
dateInput: string;
|
|
10
|
+
};
|
|
11
|
+
get parse(): {
|
|
12
|
+
dateInput: string;
|
|
13
|
+
};
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MyFormat, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MyFormat>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=date-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-format.d.ts","sourceRoot":"","sources":["../../../src/library/util/date-format.ts"],"names":[],"mappings":";AAEA,qBACa,QAAQ;IACnB,aAAa,SAAc;IAE3B,gBAAgB,CAAC,aAAa,EAAE,MAAM;IAItC,IAAI,OAAO;;;;;MAOV;IACD,IAAI,KAAK;;MAIR;yCAnBU,QAAQ;6CAAR,QAAQ;CAoBpB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NativeDateAdapter } from '@angular/material/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* date adapter for dayjs to parse and format dates
|
|
5
|
+
*/
|
|
6
|
+
export declare class DayJsDateAdapter extends NativeDateAdapter {
|
|
7
|
+
saveFormat: string;
|
|
8
|
+
setSaveFormat(format: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* parses a given data prop string in the save-format into a date object
|
|
11
|
+
* @param value date string to be parsed
|
|
12
|
+
* @returns date object or null if parsing failed
|
|
13
|
+
*/
|
|
14
|
+
parseSaveFormat(value: string): Date | null;
|
|
15
|
+
parse(value: string, format: string): Date | null;
|
|
16
|
+
toSaveFormat(value: Date): string;
|
|
17
|
+
/**
|
|
18
|
+
* transforms the date to a string representation for display
|
|
19
|
+
* @param date date to be formatted
|
|
20
|
+
* @param displayFormat format to be used for formatting the date e.g. YYYY-MM-DD
|
|
21
|
+
* @returns string representation of the date
|
|
22
|
+
*/
|
|
23
|
+
format(date: Date, displayFormat: string): string;
|
|
24
|
+
deserialize(value: any): Date | null;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DayJsDateAdapter, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DayJsDateAdapter>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=dayjs-date-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dayjs-date-adapter.d.ts","sourceRoot":"","sources":["../../../src/library/util/dayjs-date-adapter.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;;AAQ3D;;GAEG;AACH,qBACa,gBAAiB,SAAQ,iBAAiB;IACrD,UAAU,EAAE,MAAM,CAAqB;IAEvC,aAAa,CAAC,MAAM,EAAE,MAAM;IAI5B;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAI3C,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAajD,YAAY,CAAC,KAAK,EAAE,IAAI;IAYxB;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM;IAIjD,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;yCAnDzB,gBAAgB;6CAAhB,gBAAgB;CA8D5B"}
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsonforms/angular-material",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0-alpha.0",
|
|
4
4
|
"description": "Material Renderer Set for Angular module of JSON Forms",
|
|
5
5
|
"repository": "https://github.com/eclipsesource/jsonforms",
|
|
6
6
|
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
|
|
@@ -51,8 +51,9 @@
|
|
|
51
51
|
"@angular/material": "^16.0.0 || ^17.0.0",
|
|
52
52
|
"@angular/platform-browser": "^16.0.0 || ^17.0.0",
|
|
53
53
|
"@angular/router": "^16.0.0 || ^17.0.0",
|
|
54
|
-
"@jsonforms/angular": "3.
|
|
55
|
-
"@jsonforms/core": "3.
|
|
54
|
+
"@jsonforms/angular": "3.3.0-alpha.0",
|
|
55
|
+
"@jsonforms/core": "3.3.0-alpha.0",
|
|
56
|
+
"dayjs": "^1.11.7",
|
|
56
57
|
"rxjs": "^6.6.0 || ^7.4.0"
|
|
57
58
|
},
|
|
58
59
|
"dependencies": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsonforms/angular-material",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0-alpha.1",
|
|
4
4
|
"description": "Material Renderer Set for Angular module of JSON Forms",
|
|
5
5
|
"repository": "https://github.com/eclipsesource/jsonforms",
|
|
6
6
|
"bugs": "https://github.com/eclipsesource/jsonforms/issues",
|
|
@@ -51,8 +51,9 @@
|
|
|
51
51
|
"@angular/material": "^16.0.0 || ^17.0.0",
|
|
52
52
|
"@angular/platform-browser": "^16.0.0 || ^17.0.0",
|
|
53
53
|
"@angular/router": "^16.0.0 || ^17.0.0",
|
|
54
|
-
"@jsonforms/angular": "3.
|
|
55
|
-
"@jsonforms/core": "3.
|
|
54
|
+
"@jsonforms/angular": "3.3.0-alpha.1",
|
|
55
|
+
"@jsonforms/core": "3.3.0-alpha.1",
|
|
56
|
+
"dayjs": "^1.11.7",
|
|
56
57
|
"rxjs": "^6.6.0 || ^7.4.0"
|
|
57
58
|
},
|
|
58
59
|
"dependencies": {
|
|
@@ -87,7 +88,8 @@
|
|
|
87
88
|
"@typescript-eslint/parser": "^5.54.1",
|
|
88
89
|
"babel-loader": "^8.0.6",
|
|
89
90
|
"copy-webpack-plugin": "^11.0.0",
|
|
90
|
-
"
|
|
91
|
+
"dayjs": "^1.11.10",
|
|
92
|
+
"eslint": "^8.56.0",
|
|
91
93
|
"eslint-config-prettier": "^8.7.0",
|
|
92
94
|
"eslint-plugin-import": "^2.27.5",
|
|
93
95
|
"eslint-plugin-prettier": "^4.2.1",
|
|
@@ -116,10 +118,10 @@
|
|
|
116
118
|
"webpack": "^5.78.0",
|
|
117
119
|
"yargs": "^17.7.2",
|
|
118
120
|
"zone.js": "~0.13.0",
|
|
119
|
-
"@jsonforms/angular": "3.
|
|
120
|
-
"@jsonforms/
|
|
121
|
-
"@jsonforms/
|
|
122
|
-
"@jsonforms/examples": "3.
|
|
121
|
+
"@jsonforms/angular": "3.3.0-alpha.1",
|
|
122
|
+
"@jsonforms/core": "3.3.0-alpha.1",
|
|
123
|
+
"@jsonforms/angular-test": "3.3.0-alpha.1",
|
|
124
|
+
"@jsonforms/examples": "3.3.0-alpha.1"
|
|
123
125
|
},
|
|
124
126
|
"scripts": {
|
|
125
127
|
"build": "node ./build-package.js",
|
|
@@ -22,14 +22,33 @@
|
|
|
22
22
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
23
|
THE SOFTWARE.
|
|
24
24
|
*/
|
|
25
|
-
import {
|
|
26
|
-
|
|
25
|
+
import {
|
|
26
|
+
Component,
|
|
27
|
+
ChangeDetectionStrategy,
|
|
28
|
+
Inject,
|
|
29
|
+
ViewEncapsulation,
|
|
30
|
+
} from '@angular/core';
|
|
31
|
+
import {
|
|
32
|
+
defaultDateFormat,
|
|
33
|
+
isDateControl,
|
|
34
|
+
JsonFormsState,
|
|
35
|
+
RankedTester,
|
|
36
|
+
rankWith,
|
|
37
|
+
StatePropsOfControl,
|
|
38
|
+
} from '@jsonforms/core';
|
|
27
39
|
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
40
|
+
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
41
|
+
import { MyFormat } from '../util/date-format';
|
|
42
|
+
import { DayJsDateAdapter } from '../util/dayjs-date-adapter';
|
|
43
|
+
import { MatDatepicker } from '@angular/material/datepicker';
|
|
28
44
|
|
|
29
45
|
@Component({
|
|
30
46
|
selector: 'DateControlRenderer',
|
|
31
47
|
template: `
|
|
32
|
-
<mat-form-field
|
|
48
|
+
<mat-form-field
|
|
49
|
+
class="date-control-renderer"
|
|
50
|
+
[ngStyle]="{ display: hidden ? 'none' : '' }"
|
|
51
|
+
>
|
|
33
52
|
<mat-label>{{ label }}</mat-label>
|
|
34
53
|
<input
|
|
35
54
|
matInput
|
|
@@ -44,7 +63,13 @@ import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
|
44
63
|
matSuffix
|
|
45
64
|
[for]="datepicker"
|
|
46
65
|
></mat-datepicker-toggle>
|
|
47
|
-
<mat-datepicker
|
|
66
|
+
<mat-datepicker
|
|
67
|
+
#datepicker
|
|
68
|
+
(monthSelected)="monthSelected($event, datepicker)"
|
|
69
|
+
(yearSelected)="yearSelected($event, datepicker)"
|
|
70
|
+
[startView]="startView"
|
|
71
|
+
[panelClass]="panelClass"
|
|
72
|
+
></mat-datepicker>
|
|
48
73
|
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
|
|
49
74
|
description
|
|
50
75
|
}}</mat-hint>
|
|
@@ -53,25 +78,98 @@ import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
|
53
78
|
`,
|
|
54
79
|
styles: [
|
|
55
80
|
`
|
|
56
|
-
|
|
81
|
+
DateControlRenderer {
|
|
57
82
|
display: flex;
|
|
58
83
|
flex-direction: row;
|
|
59
84
|
}
|
|
60
|
-
|
|
85
|
+
.date-control-renderer {
|
|
61
86
|
flex: 1 1 auto;
|
|
62
87
|
}
|
|
88
|
+
.no-panel-navigation .mat-calendar-period-button {
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
}
|
|
91
|
+
.no-panel-navigation .mat-calendar-arrow {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
63
94
|
`,
|
|
64
95
|
],
|
|
96
|
+
encapsulation: ViewEncapsulation.None,
|
|
65
97
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
98
|
+
providers: [
|
|
99
|
+
{
|
|
100
|
+
provide: DateAdapter,
|
|
101
|
+
useClass: DayJsDateAdapter,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
provide: MAT_DATE_FORMATS,
|
|
105
|
+
useClass: MyFormat,
|
|
106
|
+
},
|
|
107
|
+
],
|
|
66
108
|
})
|
|
67
109
|
export class DateControlRenderer extends JsonFormsControl {
|
|
68
110
|
focused = false;
|
|
111
|
+
views: string[] = [];
|
|
112
|
+
startView = '';
|
|
113
|
+
panelClass = '';
|
|
69
114
|
|
|
70
|
-
constructor(
|
|
115
|
+
constructor(
|
|
116
|
+
jsonformsService: JsonFormsAngularService,
|
|
117
|
+
@Inject(MAT_DATE_FORMATS) private dateFormat: MyFormat,
|
|
118
|
+
@Inject(DateAdapter) private dateAdapter: DayJsDateAdapter
|
|
119
|
+
) {
|
|
71
120
|
super(jsonformsService);
|
|
72
121
|
}
|
|
73
122
|
|
|
74
|
-
getEventValue = (event: any) =>
|
|
123
|
+
getEventValue = (event: any) => {
|
|
124
|
+
const value = event.value ? event.value : event;
|
|
125
|
+
return this.dateAdapter.toSaveFormat(value);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
protected mapToProps(state: JsonFormsState): StatePropsOfControl {
|
|
129
|
+
const props = super.mapToProps(state);
|
|
130
|
+
const saveFormat = this.uischema?.options?.dateSaveFormat
|
|
131
|
+
? this.uischema.options.dateSaveFormat
|
|
132
|
+
: defaultDateFormat;
|
|
133
|
+
this.views = this.uischema?.options?.views
|
|
134
|
+
? this.uischema.options.views
|
|
135
|
+
: ['year', 'month', 'day'];
|
|
136
|
+
this.setViewProperties();
|
|
137
|
+
|
|
138
|
+
const dateFormat = this.uischema?.options?.dateFormat;
|
|
139
|
+
|
|
140
|
+
if (dateFormat) {
|
|
141
|
+
this.dateFormat.setDisplayFormat(dateFormat);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
this.dateAdapter.setSaveFormat(saveFormat);
|
|
145
|
+
if (this.jsonFormsService.getLocale()) {
|
|
146
|
+
this.dateAdapter.setLocale(this.jsonFormsService.getLocale());
|
|
147
|
+
}
|
|
148
|
+
const date = this.dateAdapter.parseSaveFormat(props.data);
|
|
149
|
+
return { ...props, data: date };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
yearSelected($event: any, datepicker: MatDatepicker<DayJsDateAdapter>) {
|
|
153
|
+
if (!this.views.includes('day') && !this.views.includes('month')) {
|
|
154
|
+
this.onChange($event);
|
|
155
|
+
datepicker.close();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
monthSelected($event: any, datepicker: MatDatepicker<DayJsDateAdapter>) {
|
|
159
|
+
if (!this.views.includes('day')) {
|
|
160
|
+
this.onChange($event);
|
|
161
|
+
datepicker.close();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
setViewProperties() {
|
|
166
|
+
if (!this.views.includes('day')) {
|
|
167
|
+
this.startView = 'multi-year';
|
|
168
|
+
this.panelClass = 'no-panel-navigation';
|
|
169
|
+
} else {
|
|
170
|
+
this.startView = 'month';
|
|
171
|
+
}
|
|
172
|
+
}
|
|
75
173
|
}
|
|
76
174
|
|
|
77
175
|
export const DateControlRendererTester: RankedTester = rankWith(
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
23
|
THE SOFTWARE.
|
|
24
24
|
*/
|
|
25
|
+
export * from './array-layout.renderer';
|
|
25
26
|
export * from './horizontal-layout.renderer';
|
|
26
27
|
export * from './vertical-layout.renderer';
|
|
27
28
|
export * from './categorization-layout.renderer';
|
package/src/library/module.ts
CHANGED
|
@@ -57,7 +57,7 @@ import { LabelRenderer } from './other/label.renderer';
|
|
|
57
57
|
import { JsonFormsDetailComponent } from './other/master-detail/detail';
|
|
58
58
|
import { MasterListComponent } from './other/master-detail/master';
|
|
59
59
|
import { ObjectControlRenderer } from './other/object.renderer';
|
|
60
|
-
import { TableRenderer } from './other/table.renderer';
|
|
60
|
+
import { TableRenderer, GetProps } from './other/table.renderer';
|
|
61
61
|
import { CategorizationTabLayoutRenderer } from './layouts/categorization-layout.renderer';
|
|
62
62
|
import { GroupLayoutRenderer } from './layouts/group-layout.renderer';
|
|
63
63
|
import { HorizontalLayoutRenderer } from './layouts/horizontal-layout.renderer';
|
|
@@ -110,6 +110,7 @@ import { LayoutChildrenRenderPropsPipe } from './layouts';
|
|
|
110
110
|
TableRenderer,
|
|
111
111
|
ArrayLayoutRenderer,
|
|
112
112
|
LayoutChildrenRenderPropsPipe,
|
|
113
|
+
GetProps,
|
|
113
114
|
],
|
|
114
115
|
exports: [
|
|
115
116
|
CommonModule,
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
THE SOFTWARE.
|
|
24
24
|
*/
|
|
25
25
|
import startCase from 'lodash/startCase';
|
|
26
|
-
import { Component, OnInit } from '@angular/core';
|
|
26
|
+
import { Component, OnInit, Pipe, PipeTransform } from '@angular/core';
|
|
27
27
|
import {
|
|
28
28
|
JsonFormsAngularService,
|
|
29
29
|
JsonFormsArrayControl,
|
|
@@ -51,91 +51,103 @@ import {
|
|
|
51
51
|
@Component({
|
|
52
52
|
selector: 'TableRenderer',
|
|
53
53
|
template: `
|
|
54
|
-
<table
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
mat-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
[disabled]="!isEnabled()"
|
|
68
|
-
[matTooltip]="translations.addTooltip"
|
|
69
|
-
>
|
|
70
|
-
<mat-icon>add</mat-icon>
|
|
71
|
-
</button>
|
|
72
|
-
</th>
|
|
73
|
-
</tr>
|
|
74
|
-
<tr>
|
|
75
|
-
<td
|
|
76
|
-
mat-cell
|
|
77
|
-
*matCellDef="
|
|
78
|
-
let row;
|
|
79
|
-
let i = index;
|
|
80
|
-
let first = first;
|
|
81
|
-
let last = last
|
|
82
|
-
"
|
|
83
|
-
>
|
|
84
|
-
<button
|
|
85
|
-
*ngIf="uischema?.options?.showSortButtons"
|
|
86
|
-
class="item-up"
|
|
87
|
-
mat-button
|
|
88
|
-
[disabled]="first"
|
|
89
|
-
(click)="up(i)"
|
|
90
|
-
[matTooltip]="translations.upAriaLabel"
|
|
91
|
-
matTooltipPosition="right"
|
|
92
|
-
>
|
|
93
|
-
<mat-icon>arrow_upward</mat-icon>
|
|
94
|
-
</button>
|
|
95
|
-
<button
|
|
96
|
-
*ngIf="uischema?.options?.showSortButtons"
|
|
97
|
-
class="item-down"
|
|
98
|
-
mat-button
|
|
99
|
-
[disabled]="last"
|
|
100
|
-
(click)="down(i)"
|
|
101
|
-
[matTooltip]="translations.downAriaLabel"
|
|
102
|
-
matTooltipPosition="right"
|
|
54
|
+
<div class="table-container">
|
|
55
|
+
<table
|
|
56
|
+
mat-table
|
|
57
|
+
[dataSource]="data"
|
|
58
|
+
class="mat-elevation-z8"
|
|
59
|
+
[trackBy]="trackElement"
|
|
60
|
+
>
|
|
61
|
+
<ng-container matColumnDef="action" stickyEnd>
|
|
62
|
+
<tr>
|
|
63
|
+
<th
|
|
64
|
+
mat-header-cell
|
|
65
|
+
*matHeaderCellDef
|
|
66
|
+
[ngClass]="{ 'sort-column': uischema?.options?.showSortButtons }"
|
|
103
67
|
>
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
68
|
+
<button
|
|
69
|
+
mat-button
|
|
70
|
+
color="primary"
|
|
71
|
+
(click)="add()"
|
|
72
|
+
[disabled]="!isEnabled()"
|
|
73
|
+
[matTooltip]="translations.addTooltip"
|
|
74
|
+
>
|
|
75
|
+
<mat-icon>add</mat-icon>
|
|
76
|
+
</button>
|
|
77
|
+
</th>
|
|
78
|
+
</tr>
|
|
79
|
+
<tr>
|
|
80
|
+
<td
|
|
81
|
+
[ngClass]="{ 'sort-column': uischema?.options?.showSortButtons }"
|
|
82
|
+
mat-cell
|
|
83
|
+
*matCellDef="
|
|
84
|
+
let row;
|
|
85
|
+
let i = index;
|
|
86
|
+
let first = first;
|
|
87
|
+
let last = last
|
|
88
|
+
"
|
|
113
89
|
>
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
90
|
+
<button
|
|
91
|
+
*ngIf="uischema?.options?.showSortButtons"
|
|
92
|
+
class="item-up"
|
|
93
|
+
mat-icon-button
|
|
94
|
+
[disabled]="first"
|
|
95
|
+
(click)="up(i)"
|
|
96
|
+
[matTooltip]="translations.upAriaLabel"
|
|
97
|
+
matTooltipPosition="right"
|
|
98
|
+
>
|
|
99
|
+
<mat-icon>arrow_upward</mat-icon>
|
|
100
|
+
</button>
|
|
101
|
+
<button
|
|
102
|
+
*ngIf="uischema?.options?.showSortButtons"
|
|
103
|
+
class="item-down"
|
|
104
|
+
mat-icon-button
|
|
105
|
+
[disabled]="last"
|
|
106
|
+
(click)="down(i)"
|
|
107
|
+
[matTooltip]="translations.downAriaLabel"
|
|
108
|
+
matTooltipPosition="right"
|
|
109
|
+
>
|
|
110
|
+
<mat-icon>arrow_downward</mat-icon>
|
|
111
|
+
</button>
|
|
112
|
+
<button
|
|
113
|
+
mat-icon-button
|
|
114
|
+
color="warn"
|
|
115
|
+
(click)="remove(i)"
|
|
116
|
+
[disabled]="!isEnabled()"
|
|
117
|
+
matTooltipPosition="right"
|
|
118
|
+
[matTooltip]="translations.removeTooltip"
|
|
119
|
+
>
|
|
120
|
+
<mat-icon>delete</mat-icon>
|
|
121
|
+
</button>
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
118
124
|
|
|
119
|
-
|
|
120
|
-
|
|
125
|
+
<tr></tr
|
|
126
|
+
></ng-container>
|
|
121
127
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
<ng-container
|
|
129
|
+
*ngFor="let item of items"
|
|
130
|
+
matColumnDef="{{ item.property }}"
|
|
131
|
+
>
|
|
132
|
+
<th mat-header-cell *matHeaderCellDef>{{ item.header }}</th>
|
|
133
|
+
<td mat-cell *matCellDef="let index = index">
|
|
134
|
+
<jsonforms-outlet
|
|
135
|
+
[renderProps]="index | getProps : item.props"
|
|
136
|
+
></jsonforms-outlet>
|
|
137
|
+
</td>
|
|
138
|
+
</ng-container>
|
|
133
139
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
140
|
+
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
141
|
+
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
142
|
+
</table>
|
|
143
|
+
</div>
|
|
137
144
|
`,
|
|
138
|
-
styles: [
|
|
145
|
+
styles: [
|
|
146
|
+
'table {width: 100%;}',
|
|
147
|
+
'.cdk-column-action { width: 15%;}',
|
|
148
|
+
'.sort-column { min-width: 12vw;}',
|
|
149
|
+
'.table-container {max-width: 100%; overflow: auto;}',
|
|
150
|
+
],
|
|
139
151
|
})
|
|
140
152
|
export class TableRenderer extends JsonFormsArrayControl implements OnInit {
|
|
141
153
|
detailUiSchema: UISchemaElement;
|
|
@@ -162,14 +174,6 @@ export class TableRenderer extends JsonFormsArrayControl implements OnInit {
|
|
|
162
174
|
}
|
|
163
175
|
this.translations = props.translations;
|
|
164
176
|
}
|
|
165
|
-
getProps(index: number, props: OwnPropsOfRenderer): OwnPropsOfRenderer {
|
|
166
|
-
const rowPath = Paths.compose(props.path, `${index}`);
|
|
167
|
-
return {
|
|
168
|
-
schema: props.schema,
|
|
169
|
-
uischema: props.uischema,
|
|
170
|
-
path: rowPath,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
177
|
|
|
174
178
|
remove(index: number): void {
|
|
175
179
|
this.removeItems(this.propsPath, [index])();
|
|
@@ -265,3 +269,15 @@ export const controlWithoutLabel = (scope: string): ControlElement => ({
|
|
|
265
269
|
scope: scope,
|
|
266
270
|
label: false,
|
|
267
271
|
});
|
|
272
|
+
|
|
273
|
+
@Pipe({ name: 'getProps' })
|
|
274
|
+
export class GetProps implements PipeTransform {
|
|
275
|
+
transform(index: number, props: OwnPropsOfRenderer) {
|
|
276
|
+
const rowPath = Paths.compose(props.path, `${index}`);
|
|
277
|
+
return {
|
|
278
|
+
schema: props.schema,
|
|
279
|
+
uischema: props.uischema,
|
|
280
|
+
path: rowPath,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
}
|