@openremote/or-json-forms 1.8.0-snapshot.20250818131019 → 1.8.0-snapshot.20250818162953
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.
|
@@ -69,28 +69,28 @@ var __decorate=this&&this.__decorate||function(e,t,i,a){var r,o=arguments.length
|
|
|
69
69
|
<or-mwc-input .type="${v.BUTTON}" label="addParameter" icon="plus" @or-mwc-input-changed="${()=>this._addParameter(d,s,p,t)}"></or-mwc-input>
|
|
70
70
|
</div>`}
|
|
71
71
|
</div>
|
|
72
|
-
`;return this.minimal?l`<div>${b}</div>`:l`<or-collapsible-panel .expandable="${y}">${b}</or-collapsible-panel>`}_getDynamicContentTemplate(e,t){if(!this.data)return;let i={renderers:this.renderers,uischema:p("#"),enabled:this.enabled,visible:this.visible,path:"",schema:t,minimal:!0,required:!1,label:""};return l`
|
|
72
|
+
`;return this.minimal?l`<div>${b}</div>`:l`<or-collapsible-panel .expandable="${y}">${b}</or-collapsible-panel>`}_getDynamicContentTemplate(e,t){if(!this.data)return;let i=e=>{let t=Object.assign({},this.data);delete t[e],this.handleChange(this.path,t)},a=(e,t,i)=>{if(!e.valid)return;if(void 0!==this.data[i])return void e.setCustomValidity(b.t("validation.keyAlreadyExists"));e.setCustomValidity(void 0);let a=Object.assign({},this.data),r=a[t];delete a[t],a[i]=r,this.handleChange(this.path,a)},r={renderers:this.renderers,uischema:p("#"),enabled:this.enabled,visible:this.visible,path:"",schema:t,minimal:!0,required:!1,label:""},s=(e,t)=>(r.path=o.compose(this.path,e),u(this.state,r)||l``);return l`
|
|
73
73
|
<div id="dynamic-wrapper">
|
|
74
|
-
${Object.entries(this.data).map(([t,
|
|
74
|
+
${Object.entries(this.data).map(([t,r])=>l`
|
|
75
75
|
<div class="row">
|
|
76
76
|
<div class="key-container">
|
|
77
|
-
<or-mwc-input .type="${v.TEXT}" @or-mwc-input-changed="${e=>
|
|
77
|
+
<or-mwc-input .type="${v.TEXT}" @or-mwc-input-changed="${e=>a(e.currentTarget,t,e.detail.value)}" required .pattern="${e}" .value="${t}"></or-mwc-input>
|
|
78
78
|
</div>
|
|
79
79
|
<div class="value-container">
|
|
80
|
-
${
|
|
80
|
+
${s(t,r)}
|
|
81
81
|
</div>
|
|
82
82
|
<div class="delete-container">
|
|
83
|
-
<button class="button-clear" @click="${()=>(
|
|
83
|
+
<button class="button-clear" @click="${()=>i(t)}"><or-icon icon="close-circle"></or-icon></input>
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
86
86
|
`)}
|
|
87
87
|
</div>
|
|
88
|
-
`}_showJson(e){e.stopPropagation(),y(this.title||this.schema.title||"",this.data,e=>{this.handleChange(this.path||"",e)})}_addParameter(i,a,r,o){let s,n,d,c=0===a.length,p=a.map(t=>{let i=e(t.label,!!t.required,!1);return{text:i,value:i,data:t}}),m=g(new f().setContent(()=>{let e;return s&&s.schema&&s.schema.oneOf&&(e=h(i,s.schema,s.path,"oneOf",s.label,e=>{n=e,
|
|
88
|
+
`}_showJson(e){e.stopPropagation(),y(this.title||this.schema.title||"",this.data,e=>{this.handleChange(this.path||"",e)})}_addParameter(i,a,r,o){let s,n,d,c=0===a.length,p=a.map(t=>{let i=e(t.label,!!t.required,!1);return{text:i,value:i,data:t}}),m=e=>{let t=e.currentTarget;t.setCustomValidity(void 0),d=t.currentValue;let i=t.valid;void 0!==this.data[d]&&(i=!1,t.setCustomValidity(b.t("validation.keyAlreadyExists"))),u.shadowRoot.getElementById("add-btn").disabled=!i},u=g(new f().setContent(()=>{let e;return s&&s.schema&&s.schema.oneOf&&(e=h(i,s.schema,s.path,"oneOf",s.label,e=>{n=e,u.shadowRoot.getElementById("add-btn").disabled=!n,u.shadowRoot.getElementById("schema-description").innerHTML=(n?n.description:b.t("schema.selectTypeMessage"))||b.t("schema.noDescriptionAvailable")})),l`
|
|
89
89
|
<div class="col">
|
|
90
90
|
<form id="mdc-dialog-form-add" class="row">
|
|
91
91
|
${c?"":l`
|
|
92
92
|
<div id="type-list" class="col">
|
|
93
|
-
<or-mwc-list @or-mwc-list-changed="${e=>{1===e.detail.length&&(e=>{let t=!!((s=e)&&s.schema&&s.schema.oneOf);
|
|
93
|
+
<or-mwc-list @or-mwc-list-changed="${e=>{1===e.detail.length&&(e=>{let t=!!((s=e)&&s.schema&&s.schema.oneOf);u.shadowRoot.getElementById("add-btn").disabled=t,u.requestUpdate()})(e.detail[0].data)}}" .listItems="${p}" id="parameter-list"></or-mwc-list>
|
|
94
94
|
</div>
|
|
95
95
|
`}
|
|
96
96
|
<div id="parameter-desc" class="col">
|
|
@@ -124,7 +124,7 @@ var __decorate=this&&this.__decorate||function(e,t,i,a){var r,o=arguments.length
|
|
|
124
124
|
}
|
|
125
125
|
</style>
|
|
126
126
|
<div id="dynamic-wrapper">
|
|
127
|
-
<or-mwc-input required .type="${v.TEXT}" .pattern="${r}" .label="${b.t("schema.keyInputLabel")}" @keyup="${e=>
|
|
127
|
+
<or-mwc-input required .type="${v.TEXT}" .pattern="${r}" .label="${b.t("schema.keyInputLabel")}" @keyup="${e=>m(e)}"></or-mwc-input>
|
|
128
128
|
</div>
|
|
129
129
|
`}
|
|
130
130
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openremote/or-json-forms",
|
|
3
|
-
"version": "1.8.0-snapshot.
|
|
3
|
+
"version": "1.8.0-snapshot.20250818162953",
|
|
4
4
|
"description": "Renders a JSON schema and provides instance editing",
|
|
5
5
|
"customElements": "custom-elements.json",
|
|
6
6
|
"main": "dist/umd/index.bundle.js",
|
|
@@ -13,21 +13,21 @@
|
|
|
13
13
|
"scripts": {
|
|
14
14
|
"analyze": "npx cem analyze --config ../custom-elements-manifest.config.mjs",
|
|
15
15
|
"build": "npx tsc -b",
|
|
16
|
-
"test": "
|
|
16
|
+
"test": "npx tsc -b && npx playwright test",
|
|
17
17
|
"prepack": "npx rspack"
|
|
18
18
|
},
|
|
19
19
|
"author": "OpenRemote",
|
|
20
20
|
"license": "AGPL-3.0-or-later",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@jsonforms/core": "^3.5.1",
|
|
23
|
-
"@openremote/or-components": "1.8.0-snapshot.
|
|
24
|
-
"@openremote/or-mwc-components": "1.8.0-snapshot.
|
|
23
|
+
"@openremote/or-components": "1.8.0-snapshot.20250818162953",
|
|
24
|
+
"@openremote/or-mwc-components": "1.8.0-snapshot.20250818162953",
|
|
25
25
|
"@polymer/polymer": "^3.3.1",
|
|
26
26
|
"ajv": "^8.8.2",
|
|
27
27
|
"lit": "^2.0.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@openremote/util": "1.8.0-snapshot.
|
|
30
|
+
"@openremote/util": "1.8.0-snapshot.20250818162953"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|