Allowing W/L Presets customization
This commit is contained in:
1 parent
4d9300f6c4
commit
e6b5a21ae2
14 files changed
+303
-173
No files matched your search
@@ -31,6 +31,7 @@ import './templates/form.html';
|
||||
import './templates/input.html';
|
||||
import './templates/link.html';
|
||||
import './templates/select.html';
|
||||
import './templates/tr.html';
|
||||
|
||||
// wrappers
|
||||
import './wrappers/label.html';
|
||||
|
||||
@@ -141,19 +141,23 @@ OHIF.mixins.schemaData = new OHIF.Mixin({
|
||||
component.parseData = value => {
|
||||
// Get the current schema data using component's key
|
||||
const { currentSchema } = getCurrentSchemaDefs(component.parent, instance.data.pathKey);
|
||||
const { dataType } = instance.data;
|
||||
|
||||
// Stop here if there's no schema data for current key
|
||||
if (!currentSchema) {
|
||||
// Stop here if there's no schema data for current key or no dataType defined
|
||||
if (!currentSchema && !dataType) {
|
||||
return value;
|
||||
}
|
||||
|
||||
// Check if the schema is a Number
|
||||
if (currentSchema.type === Number) {
|
||||
// Get the schema type
|
||||
const schemaType = currentSchema && currentSchema.type;
|
||||
|
||||
// Check if the type is Number
|
||||
if (schemaType === Number || dataType === 'Number') {
|
||||
return parseFloat(value);
|
||||
}
|
||||
|
||||
// Check if the schema is a Boolean
|
||||
if (currentSchema.type === Boolean) {
|
||||
// Check if the type is Boolean
|
||||
if (schemaType === Boolean || dataType === 'Boolean') {
|
||||
return !!value;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<template name="baseTr">
|
||||
<tr
|
||||
id="{{this.id}}"
|
||||
class="{{this.class}}"
|
||||
{{this.tagAttributes}}
|
||||
>
|
||||
{{>UI.contentBlock}}
|
||||
</tr>
|
||||
</template>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template name="group">
|
||||
{{#baseComponent (extend this
|
||||
class=(concat 'component-group ' this.class)
|
||||
base='baseDiv'
|
||||
base=(choose this.base 'baseDiv')
|
||||
mixins=(concat 'group ' this.mixins)
|
||||
)}}
|
||||
{{>UI.contentBlock}}
|
||||
|
||||
Reference in new issue
Block a user