Skip to content

Commit da1ffd5

Browse files
committed
Add time field
1 parent 86c4375 commit da1ffd5

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<template class="schema-editor-input ${showNotifications ? 'schema-editor-input--with-notifications' : ''}">
2+
<label>
3+
${schema["title"] & toolT}
4+
<span show.bind="required">
5+
<span>- </span>
6+
<span style="color: var(--q-color-error)">${'editor.required' & t}</span>
7+
</span>
8+
<input type="time" required.bind="required" value.bind="data">
9+
</label>
10+
</template>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { bindable } from "aurelia-framework";
2+
3+
export class SchemaEditorTime {
4+
@bindable
5+
data;
6+
@bindable
7+
schema;
8+
@bindable
9+
change;
10+
@bindable
11+
required;
12+
@bindable
13+
showNotifications;
14+
15+
options = {
16+
step: "any"
17+
};
18+
19+
schemaChanged() {
20+
this.applyOptions();
21+
}
22+
23+
applyOptions() {
24+
if (!this.schema) {
25+
return;
26+
}
27+
if (this.schema.hasOwnProperty("Q:options")) {
28+
this.options = Object.assign(this.options, this.schema["Q:options"]);
29+
}
30+
}
31+
}

client/src/elements/schema-editor/schema-editor-wrapper.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,17 @@
209209
></schema-editor-files>
210210
</div>
211211

212+
<div if.bind="getType(schema) === 'time'" class="schema-editor-block">
213+
<require from="./schema-editor-time"></require>
214+
<schema-editor-time
215+
schema.bind="schema"
216+
data.two-way="data"
217+
change.bind="change"
218+
required.bind="required"
219+
show-notifications.bind="showNotifications"
220+
></schema-editor-time>
221+
</div>
222+
212223
<div if.bind="getType(schema) === 'dialog'" class="schema-editor-block">
213224
<require from="./schema-editor-dialog"></require>
214225
<schema-editor-dialog

0 commit comments

Comments
 (0)