@jsonforms/angular-material 3.0.0-beta.3 → 3.0.0-beta.4
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/README.md +54 -2
- package/docs/assets/js/search.json +1 -1
- package/docs/classes/arraylayoutrenderer.html +17 -17
- package/docs/classes/autocompletecontrolrenderer.html +10 -10
- package/docs/classes/booleancontrolrenderer.html +5 -5
- package/docs/classes/categorizationtablayoutrenderer.html +6 -6
- package/docs/classes/datecontrolrenderer.html +18 -29
- package/docs/classes/grouplayoutrenderer.html +7 -7
- package/docs/classes/horizontallayoutrenderer.html +7 -7
- package/docs/classes/jsonformsdetailcomponent.html +4 -4
- package/docs/classes/labelrenderer.html +8 -8
- package/docs/classes/layoutrenderer.html +9 -9
- package/docs/classes/masterlistcomponent.html +17 -17
- package/docs/classes/numbercontrolrenderer.html +14 -14
- package/docs/classes/objectcontrolrenderer.html +3 -3
- package/docs/classes/rangecontrolrenderer.html +7 -7
- package/docs/classes/tablerenderer.html +10 -10
- package/docs/classes/textarearenderer.html +2 -2
- package/docs/classes/textcontrolrenderer.html +3 -3
- package/docs/classes/togglecontrolrenderer.html +5 -5
- package/docs/classes/verticallayoutrenderer.html +7 -7
- package/docs/globals.html +24 -24
- package/docs/index.html +55 -1
- package/docs/interfaces/columndescription.html +3 -3
- package/docs/interfaces/ownpropsofautocomplete.html +1 -1
- package/example/app/app.component.ts +7 -1
- package/lib/cjs/controls/date.renderer.d.ts +1 -4
- package/lib/cjs/controls/date.renderer.js +2 -9
- package/lib/cjs/controls/date.renderer.js.map +1 -1
- package/lib/cjs/controls/date.renderer.metadata.json +1 -1
- package/lib/esm/controls/date.renderer.d.ts +1 -4
- package/lib/esm/controls/date.renderer.js +3 -10
- package/lib/esm/controls/date.renderer.js.map +1 -1
- package/lib/esm/controls/date.renderer.metadata.json +1 -1
- package/package.json +8 -8
- package/src/controls/date.renderer.ts +0 -8
package/docs/index.html
CHANGED
|
@@ -97,10 +97,58 @@
|
|
|
97
97
|
})
|
|
98
98
|
<span class="hljs-keyword">export</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AppComponent</span> </span>{
|
|
99
99
|
renderers = angularMaterialRenderers;
|
|
100
|
+
uischema = {
|
|
101
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"VerticalLayout"</span>,
|
|
102
|
+
<span class="hljs-attr">elements</span>: [
|
|
103
|
+
{
|
|
104
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"Control"</span>,
|
|
105
|
+
<span class="hljs-attr">label</span>: <span class="hljs-literal">false</span>,
|
|
106
|
+
<span class="hljs-attr">scope</span>: <span class="hljs-string">"#/properties/done"</span>,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"Control"</span>,
|
|
110
|
+
<span class="hljs-attr">scope</span>: <span class="hljs-string">"#/properties/name"</span>,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"HorizontalLayout"</span>,
|
|
114
|
+
<span class="hljs-attr">elements</span>: [
|
|
115
|
+
{
|
|
116
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"Control"</span>,
|
|
117
|
+
<span class="hljs-attr">scope</span>: <span class="hljs-string">"#/properties/due_date"</span>,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"Control"</span>,
|
|
121
|
+
<span class="hljs-attr">scope</span>: <span class="hljs-string">"#/properties/recurrence"</span>,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
};
|
|
127
|
+
schema = {
|
|
128
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"object"</span>,
|
|
129
|
+
<span class="hljs-attr">properties</span>: {
|
|
130
|
+
<span class="hljs-attr">name</span>: {
|
|
131
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"string"</span>,
|
|
132
|
+
<span class="hljs-attr">minLength</span>: <span class="hljs-number">1</span>,
|
|
133
|
+
},
|
|
134
|
+
<span class="hljs-attr">done</span>: {
|
|
135
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"boolean"</span>,
|
|
136
|
+
},
|
|
137
|
+
<span class="hljs-attr">due_date</span>: {
|
|
138
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"string"</span>,
|
|
139
|
+
<span class="hljs-attr">format</span>: <span class="hljs-string">"date"</span>,
|
|
140
|
+
},
|
|
141
|
+
<span class="hljs-attr">recurrence</span>: {
|
|
142
|
+
<span class="hljs-attr">type</span>: <span class="hljs-string">"string"</span>,
|
|
143
|
+
<span class="hljs-attr">enum</span>: [<span class="hljs-string">"Never"</span>, <span class="hljs-string">"Daily"</span>, <span class="hljs-string">"Weekly"</span>, <span class="hljs-string">"Monthly"</span>],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
<span class="hljs-attr">required</span>: [<span class="hljs-string">"name"</span>, <span class="hljs-string">"due_date"</span>],
|
|
147
|
+
};
|
|
100
148
|
data = {};
|
|
101
149
|
}
|
|
102
150
|
</code></pre>
|
|
103
|
-
<p>Example module file
|
|
151
|
+
<p>Example module file <code>app.module.ts</code>:</p>
|
|
104
152
|
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { NgModule } <span class="hljs-keyword">from</span> <span class="hljs-string">"@angular/core"</span>;
|
|
105
153
|
<span class="hljs-keyword">import</span> { BrowserModule } <span class="hljs-keyword">from</span> <span class="hljs-string">"@angular/platform-browser"</span>;
|
|
106
154
|
<span class="hljs-keyword">import</span> { BrowserAnimationsModule } <span class="hljs-keyword">from</span> <span class="hljs-string">"@angular/platform-browser/animations"</span>;
|
|
@@ -119,6 +167,8 @@
|
|
|
119
167
|
<span class="hljs-attr">schemas</span>: [],
|
|
120
168
|
<span class="hljs-attr">bootstrap</span>: [AppComponent],
|
|
121
169
|
})
|
|
170
|
+
|
|
171
|
+
<span class="hljs-keyword">export</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AppModule</span> </span>{ }
|
|
122
172
|
</code></pre>
|
|
123
173
|
<a href="#license" id="license" style="color: inherit; text-decoration: none;">
|
|
124
174
|
<h2>License</h2>
|
|
@@ -136,6 +186,10 @@
|
|
|
136
186
|
For questions and discussions please use the <a href="https://jsonforms.discourse.group">JSON Forms board</a>.
|
|
137
187
|
You can also reach us via <a href="mailto:jsonforms@eclipsesource.com?subject=JSON%20Forms">email</a>.
|
|
138
188
|
In addition, EclipseSource also offers <a href="https://jsonforms.io/support">professional support</a> for JSON Forms.</p>
|
|
189
|
+
<a href="#migration" id="migration" style="color: inherit; text-decoration: none;">
|
|
190
|
+
<h2>Migration</h2>
|
|
191
|
+
</a>
|
|
192
|
+
<p>See our <a href="https://github.com/eclipsesource/jsonforms/blob/master/MIGRATION.md">migration guide</a> when updating JSON Forms.</p>
|
|
139
193
|
</div>
|
|
140
194
|
</div>
|
|
141
195
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
<div class="tsd-signature tsd-kind-icon">header<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
98
98
|
<aside class="tsd-sources">
|
|
99
99
|
<ul>
|
|
100
|
-
<li>Defined in <a href="https://github.com/sdirix/jsonforms/blob/
|
|
100
|
+
<li>Defined in <a href="https://github.com/sdirix/jsonforms/blob/c15d5420/packages/angular-material/src/other/table.renderer.ts#L156">packages/angular-material/src/other/table.renderer.ts:156</a></li>
|
|
101
101
|
</ul>
|
|
102
102
|
</aside>
|
|
103
103
|
</section>
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
<div class="tsd-signature tsd-kind-icon">property<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
108
108
|
<aside class="tsd-sources">
|
|
109
109
|
<ul>
|
|
110
|
-
<li>Defined in <a href="https://github.com/sdirix/jsonforms/blob/
|
|
110
|
+
<li>Defined in <a href="https://github.com/sdirix/jsonforms/blob/c15d5420/packages/angular-material/src/other/table.renderer.ts#L155">packages/angular-material/src/other/table.renderer.ts:155</a></li>
|
|
111
111
|
</ul>
|
|
112
112
|
</aside>
|
|
113
113
|
</section>
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
<div class="tsd-signature tsd-kind-icon">props<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">OwnPropsOfRenderer</span></div>
|
|
118
118
|
<aside class="tsd-sources">
|
|
119
119
|
<ul>
|
|
120
|
-
<li>Defined in <a href="https://github.com/sdirix/jsonforms/blob/
|
|
120
|
+
<li>Defined in <a href="https://github.com/sdirix/jsonforms/blob/c15d5420/packages/angular-material/src/other/table.renderer.ts#L157">packages/angular-material/src/other/table.renderer.ts:157</a></li>
|
|
121
121
|
</ul>
|
|
122
122
|
</aside>
|
|
123
123
|
</section>
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
<div class="tsd-signature tsd-kind-icon">options<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div>
|
|
148
148
|
<aside class="tsd-sources">
|
|
149
149
|
<ul>
|
|
150
|
-
<li>Defined in <a href="https://github.com/sdirix/jsonforms/blob/
|
|
150
|
+
<li>Defined in <a href="https://github.com/sdirix/jsonforms/blob/c15d5420/packages/angular-material/src/controls/autocomplete.renderer.ts#L150">packages/angular-material/src/controls/autocomplete.renderer.ts:150</a></li>
|
|
151
151
|
</ul>
|
|
152
152
|
</aside>
|
|
153
153
|
</section>
|
|
@@ -26,6 +26,8 @@ import { Component } from '@angular/core';
|
|
|
26
26
|
import { ExampleDescription, getExamples } from '@jsonforms/examples';
|
|
27
27
|
import { UISchemaElement, UISchemaTester } from '@jsonforms/core';
|
|
28
28
|
import { angularMaterialRenderers } from '../../src/index';
|
|
29
|
+
import { DateAdapter } from '@angular/material/core';
|
|
30
|
+
|
|
29
31
|
const uiSchema = {
|
|
30
32
|
type: 'HorizontalLayout',
|
|
31
33
|
elements: [
|
|
@@ -89,14 +91,17 @@ export class AppComponent {
|
|
|
89
91
|
i18n = {
|
|
90
92
|
locale: 'en-US'
|
|
91
93
|
}
|
|
94
|
+
private dateAdapter;
|
|
92
95
|
private readonly = false;
|
|
93
96
|
data: any;
|
|
94
97
|
uischemas: { tester: UISchemaTester; uischema: UISchemaElement; }[] = [
|
|
95
98
|
{ tester: itemTester, uischema: uiSchema }
|
|
96
99
|
];
|
|
97
100
|
|
|
98
|
-
constructor() {
|
|
101
|
+
constructor(dateAdapter: DateAdapter<Date>) {
|
|
99
102
|
this.selectedExample = this.examples[19];
|
|
103
|
+
this.dateAdapter = dateAdapter;
|
|
104
|
+
dateAdapter.setLocale(this.i18n.locale);
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
onChange(ev: any) {
|
|
@@ -105,6 +110,7 @@ export class AppComponent {
|
|
|
105
110
|
|
|
106
111
|
changeLocale(locale: string) {
|
|
107
112
|
this.i18n.locale = locale;
|
|
113
|
+
this.dateAdapter.setLocale(locale);
|
|
108
114
|
}
|
|
109
115
|
|
|
110
116
|
toggleReadonly() {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { RankedTester } from '@jsonforms/core';
|
|
2
2
|
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
3
|
-
import { DateAdapter, NativeDateAdapter } from '@angular/material/core';
|
|
4
3
|
export declare class DateControlRenderer extends JsonFormsControl {
|
|
5
|
-
|
|
6
|
-
constructor(jsonformsService: JsonFormsAngularService, dateAdapter: DateAdapter<NativeDateAdapter>);
|
|
7
|
-
mapAdditionalProps(): void;
|
|
4
|
+
constructor(jsonformsService: JsonFormsAngularService);
|
|
8
5
|
getEventValue: (event: any) => any;
|
|
9
6
|
}
|
|
10
7
|
export declare const DateControlRendererTester: RankedTester;
|
|
@@ -29,19 +29,13 @@ var tslib_1 = require("tslib");
|
|
|
29
29
|
var core_1 = require("@angular/core");
|
|
30
30
|
var core_2 = require("@jsonforms/core");
|
|
31
31
|
var angular_1 = require("@jsonforms/angular");
|
|
32
|
-
var core_3 = require("@angular/material/core");
|
|
33
32
|
var DateControlRenderer = /** @class */ (function (_super) {
|
|
34
33
|
tslib_1.__extends(DateControlRenderer, _super);
|
|
35
|
-
function DateControlRenderer(jsonformsService
|
|
34
|
+
function DateControlRenderer(jsonformsService) {
|
|
36
35
|
var _this = _super.call(this, jsonformsService) || this;
|
|
37
|
-
_this.dateAdapter = dateAdapter;
|
|
38
36
|
_this.getEventValue = function (event) { return event.value.toISOString().substr(0, 10); };
|
|
39
37
|
return _this;
|
|
40
38
|
}
|
|
41
|
-
DateControlRenderer.prototype.mapAdditionalProps = function () {
|
|
42
|
-
var locale = core_2.getLocale(this.jsonFormsService.getState());
|
|
43
|
-
this.dateAdapter.setLocale(locale);
|
|
44
|
-
};
|
|
45
39
|
DateControlRenderer.decorators = [
|
|
46
40
|
{ type: core_1.Component, args: [{
|
|
47
41
|
selector: 'DateControlRenderer',
|
|
@@ -50,8 +44,7 @@ var DateControlRenderer = /** @class */ (function (_super) {
|
|
|
50
44
|
},] }
|
|
51
45
|
];
|
|
52
46
|
DateControlRenderer.ctorParameters = function () { return [
|
|
53
|
-
{ type: angular_1.JsonFormsAngularService }
|
|
54
|
-
{ type: core_3.DateAdapter }
|
|
47
|
+
{ type: angular_1.JsonFormsAngularService }
|
|
55
48
|
]; };
|
|
56
49
|
return DateControlRenderer;
|
|
57
50
|
}(angular_1.JsonFormsControl));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.renderer.js","sourceRoot":"","sources":["../../../src/controls/date.renderer.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,sCAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"date.renderer.js","sourceRoot":"","sources":["../../../src/controls/date.renderer.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,sCAAmE;AACnE,wCAIyB;AACzB,8CAA+E;AAE/E;IAuByC,+CAAgB;IACvD,6BACE,gBAAyC;QAD3C,YAGE,kBAAM,gBAAgB,CAAC,SACxB;QAED,mBAAa,GAAG,UAAC,KAAU,IAAK,OAAA,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAvC,CAAuC,CAAC;;IAFxE,CAAC;;gBA5BF,gBAAS,SAAC;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,klBAkBT;oBACD,eAAe,EAAE,8BAAuB,CAAC,MAAM;iBAChD;;;gBAxBQ,iCAAuB;;IAiChC,0BAAC;CAAA,AA/BD,CAuByC,0BAAgB,GAQxD;AARY,kDAAmB;AAUnB,QAAA,yBAAyB,GAAiB,eAAQ,CAC7D,CAAC,EACD,oBAAa,CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"DateControlRenderer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@jsonforms/angular","name":"JsonFormsControl","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"DateControlRenderer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@jsonforms/angular","name":"JsonFormsControl","line":55,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":32,"character":1},"arguments":[{"selector":"DateControlRenderer","template":"\n <mat-form-field fxFlex [fxHide]=\"hidden\">\n <mat-label>{{ label }}</mat-label>\n <input\n matInput\n (dateChange)=\"onChange($event)\"\n [id]=\"id\"\n [formControl]=\"form\"\n [matDatepicker]=\"datepicker\"\n />\n <mat-datepicker-toggle\n matSuffix\n [for]=\"datepicker\"\n ></mat-datepicker-toggle>\n <mat-datepicker #datepicker></mat-datepicker>\n <mat-hint *ngIf=\"shouldShowUnfocusedDescription()\">{{ description }}</mat-hint>\n <mat-error>{{ error }}</mat-error>\n </mat-form-field>\n ","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":53,"character":19},"member":"OnPush"}}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@jsonforms/angular","name":"JsonFormsAngularService","line":57,"character":22}]}]}},"DateControlRendererTester":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@jsonforms/core","name":"rankWith","line":65,"character":55},"arguments":[2,{"__symbolic":"reference","module":"@jsonforms/core","name":"isDateControl","line":67,"character":2}]}}}]
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { RankedTester } from '@jsonforms/core';
|
|
2
2
|
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
3
|
-
import { DateAdapter, NativeDateAdapter } from '@angular/material/core';
|
|
4
3
|
export declare class DateControlRenderer extends JsonFormsControl {
|
|
5
|
-
|
|
6
|
-
constructor(jsonformsService: JsonFormsAngularService, dateAdapter: DateAdapter<NativeDateAdapter>);
|
|
7
|
-
mapAdditionalProps(): void;
|
|
4
|
+
constructor(jsonformsService: JsonFormsAngularService);
|
|
8
5
|
getEventValue: (event: any) => any;
|
|
9
6
|
}
|
|
10
7
|
export declare const DateControlRendererTester: RankedTester;
|
|
@@ -24,21 +24,15 @@ import { __extends } from "tslib";
|
|
|
24
24
|
THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
26
|
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
27
|
-
import {
|
|
27
|
+
import { isDateControl, rankWith } from '@jsonforms/core';
|
|
28
28
|
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
29
|
-
import { DateAdapter } from '@angular/material/core';
|
|
30
29
|
var DateControlRenderer = /** @class */ (function (_super) {
|
|
31
30
|
__extends(DateControlRenderer, _super);
|
|
32
|
-
function DateControlRenderer(jsonformsService
|
|
31
|
+
function DateControlRenderer(jsonformsService) {
|
|
33
32
|
var _this = _super.call(this, jsonformsService) || this;
|
|
34
|
-
_this.dateAdapter = dateAdapter;
|
|
35
33
|
_this.getEventValue = function (event) { return event.value.toISOString().substr(0, 10); };
|
|
36
34
|
return _this;
|
|
37
35
|
}
|
|
38
|
-
DateControlRenderer.prototype.mapAdditionalProps = function () {
|
|
39
|
-
var locale = getLocale(this.jsonFormsService.getState());
|
|
40
|
-
this.dateAdapter.setLocale(locale);
|
|
41
|
-
};
|
|
42
36
|
DateControlRenderer.decorators = [
|
|
43
37
|
{ type: Component, args: [{
|
|
44
38
|
selector: 'DateControlRenderer',
|
|
@@ -47,8 +41,7 @@ var DateControlRenderer = /** @class */ (function (_super) {
|
|
|
47
41
|
},] }
|
|
48
42
|
];
|
|
49
43
|
DateControlRenderer.ctorParameters = function () { return [
|
|
50
|
-
{ type: JsonFormsAngularService }
|
|
51
|
-
{ type: DateAdapter }
|
|
44
|
+
{ type: JsonFormsAngularService }
|
|
52
45
|
]; };
|
|
53
46
|
return DateControlRenderer;
|
|
54
47
|
}(JsonFormsControl));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.renderer.js","sourceRoot":"","sources":["../../../src/controls/date.renderer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"date.renderer.js","sourceRoot":"","sources":["../../../src/controls/date.renderer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AACF,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EACL,aAAa,EAEb,QAAQ,EACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE/E;IAuByC,uCAAgB;IACvD,6BACE,gBAAyC;QAD3C,YAGE,kBAAM,gBAAgB,CAAC,SACxB;QAED,mBAAa,GAAG,UAAC,KAAU,IAAK,OAAA,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAvC,CAAuC,CAAC;;IAFxE,CAAC;;gBA5BF,SAAS,SAAC;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,QAAQ,EAAE,klBAkBT;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;;gBAxBQ,uBAAuB;;IAiChC,0BAAC;CAAA,AA/BD,CAuByC,gBAAgB,GAQxD;SARY,mBAAmB;AAUhC,MAAM,CAAC,IAAM,yBAAyB,GAAiB,QAAQ,CAC7D,CAAC,EACD,aAAa,CACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"DateControlRenderer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@jsonforms/angular","name":"JsonFormsControl","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"DateControlRenderer":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@jsonforms/angular","name":"JsonFormsControl","line":55,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":32,"character":1},"arguments":[{"selector":"DateControlRenderer","template":"\n <mat-form-field fxFlex [fxHide]=\"hidden\">\n <mat-label>{{ label }}</mat-label>\n <input\n matInput\n (dateChange)=\"onChange($event)\"\n [id]=\"id\"\n [formControl]=\"form\"\n [matDatepicker]=\"datepicker\"\n />\n <mat-datepicker-toggle\n matSuffix\n [for]=\"datepicker\"\n ></mat-datepicker-toggle>\n <mat-datepicker #datepicker></mat-datepicker>\n <mat-hint *ngIf=\"shouldShowUnfocusedDescription()\">{{ description }}</mat-hint>\n <mat-error>{{ error }}</mat-error>\n </mat-form-field>\n ","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":53,"character":19},"member":"OnPush"}}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@jsonforms/angular","name":"JsonFormsAngularService","line":57,"character":22}]}]}},"DateControlRendererTester":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@jsonforms/core","name":"rankWith","line":65,"character":55},"arguments":[2,{"__symbolic":"reference","module":"@jsonforms/core","name":"isDateControl","line":67,"character":2}]}}}]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsonforms/angular-material",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.4",
|
|
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",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"@angular/material": "^12.0.0 || ^13.0.0",
|
|
64
64
|
"@angular/platform-browser": "^12.0.0 || ^13.0.0",
|
|
65
65
|
"@angular/router": "^12.0.0 || ^13.0.0",
|
|
66
|
-
"@jsonforms/angular": "3.0.0-beta.
|
|
67
|
-
"@jsonforms/core": "3.0.0-beta.
|
|
66
|
+
"@jsonforms/angular": "3.0.0-beta.4",
|
|
67
|
+
"@jsonforms/core": "3.0.0-beta.4",
|
|
68
68
|
"core-js": "^2.5.3",
|
|
69
69
|
"rxjs": "^6.4.0"
|
|
70
70
|
},
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"@angular/platform-browser": "^12.0.0",
|
|
85
85
|
"@angular/platform-browser-dynamic": "^12.0.0",
|
|
86
86
|
"@angular/router": "^12.0.0",
|
|
87
|
-
"@jsonforms/angular": "^3.0.0-beta.
|
|
88
|
-
"@jsonforms/angular-test": "^3.0.0-beta.
|
|
89
|
-
"@jsonforms/core": "^3.0.0-beta.
|
|
90
|
-
"@jsonforms/examples": "^3.0.0-beta.
|
|
87
|
+
"@jsonforms/angular": "^3.0.0-beta.4",
|
|
88
|
+
"@jsonforms/angular-test": "^3.0.0-beta.4",
|
|
89
|
+
"@jsonforms/core": "^3.0.0-beta.4",
|
|
90
|
+
"@jsonforms/examples": "^3.0.0-beta.4",
|
|
91
91
|
"@types/node": "^10.10.0",
|
|
92
92
|
"angular2-template-loader": "^0.6.2",
|
|
93
93
|
"copy-webpack-plugin": "^5.0.5",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"webpack-dev-server": "^3.9.0",
|
|
118
118
|
"zone.js": "^0.11.4"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "413b9767ea8e2c0b6adb3919f5e6b76263d4be31"
|
|
121
121
|
}
|
|
@@ -24,13 +24,11 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
26
26
|
import {
|
|
27
|
-
getLocale,
|
|
28
27
|
isDateControl,
|
|
29
28
|
RankedTester,
|
|
30
29
|
rankWith
|
|
31
30
|
} from '@jsonforms/core';
|
|
32
31
|
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
|
|
33
|
-
import { DateAdapter, NativeDateAdapter } from '@angular/material/core';
|
|
34
32
|
|
|
35
33
|
@Component({
|
|
36
34
|
selector: 'DateControlRenderer',
|
|
@@ -58,16 +56,10 @@ import { DateAdapter, NativeDateAdapter } from '@angular/material/core';
|
|
|
58
56
|
export class DateControlRenderer extends JsonFormsControl {
|
|
59
57
|
constructor(
|
|
60
58
|
jsonformsService: JsonFormsAngularService,
|
|
61
|
-
private dateAdapter: DateAdapter<NativeDateAdapter>
|
|
62
59
|
) {
|
|
63
60
|
super(jsonformsService);
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
mapAdditionalProps() {
|
|
67
|
-
const locale = getLocale(this.jsonFormsService.getState());
|
|
68
|
-
this.dateAdapter.setLocale(locale);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
63
|
getEventValue = (event: any) => event.value.toISOString().substr(0, 10);
|
|
72
64
|
}
|
|
73
65
|
|