This is in order to be able to support UPPER() and LOWER() functions in queries which are needed for case-insensitive search.
27 lines
813 B
JavaScript
27 lines
813 B
JavaScript
"use strict";
|
|
|
|
import m from "mithril";
|
|
import * as components from "../components";
|
|
import * as store from "../store";
|
|
import * as expression from "../../common/expression";
|
|
import * as funcCache from "../../common/func-cache";
|
|
|
|
const component = {
|
|
view: vnode => {
|
|
if (vnode.attrs.filter) {
|
|
const filter = funcCache.get(expression.parse, vnode.attrs.filter);
|
|
if (!store.evaluateExpression(filter, vnode.attrs.device)) return;
|
|
}
|
|
|
|
let children = Object.values(vnode.attrs.components).map(c => {
|
|
if (typeof c !== "object") return `${c}`;
|
|
const attrs = Object.assign({}, vnode.attrs, c);
|
|
return m(components.get(attrs.type), attrs);
|
|
});
|
|
if (vnode.attrs.element) return m(vnode.attrs.element, children);
|
|
else return children;
|
|
}
|
|
};
|
|
|
|
export default component;
|