How to use the @finos/perspective.FILTER_OPERATORS function in @finos/perspective

To help you get started, we’ve selected a few @finos/perspective examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github finos / perspective / packages / perspective-viewer / src / js / row.js View on Github external
let val = filter_operand.value;
        const type = this.getAttribute("type");
        switch (type) {
            case "float":
                val = parseFloat(val);
                break;
            case "integer":
                val = parseInt(val);
                break;
            case "boolean":
                val = val.toLowerCase().indexOf("true") > -1;
                break;
            case "string":
            default:
        }
        if (filter_operator.value === perspective.FILTER_OPERATORS.isIn || filter_operator.value === perspective.FILTER_OPERATORS.isNotIn) {
            val = val.split(",").map(x => x.trim());
        }
        this.setAttribute("filter", JSON.stringify({operator: filter_operator.value, operand: val}));
        this.dispatchEvent(new CustomEvent("filter-selected", {detail: event}));
    }