UNPKG

@opendash/plugin-parse

Version:

Parse Server Plugin for open.DASH

29 lines 2.47 kB
import React from "react"; import { useTranslation } from "opendash"; import { SearchOutlined } from '@ant-design/icons'; import { Input, Button, Select } from "antd"; export default function AdminTableFilter(_a) { var setSelectedKeys = _a.setSelectedKeys, selectedKeys = _a.selectedKeys, confirm = _a.confirm, clearFilters = _a.clearFilters; var t = useTranslation(["parse", "opendash"])[0]; return (React.createElement("div", { style: { padding: 8 } }, React.createElement(Select, { placeholder: t("parse:admin.filter.select_placeholder"), style: { width: 208, marginBottom: 8, display: "block" }, onChange: function (v) { setSelectedKeys([v]); } }, React.createElement(Select.Option, { value: "contains", children: t("parse:admin.filter.contains") }), React.createElement(Select.Option, { value: "equals", children: t("parse:admin.filter.equals") }), React.createElement(Select.Option, { value: "equals_not", children: t("parse:admin.filter.equals_not") }), React.createElement(Select.Option, { value: "starts_with", children: t("parse:admin.filter.starts_with") }), React.createElement(Select.Option, { value: "ends_with", children: t("parse:admin.filter.ends_with") }), React.createElement(Select.Option, { value: "exists", children: t("parse:admin.filter.exists") }), React.createElement(Select.Option, { value: "exists_not", children: t("parse:admin.filter.exists_not") })), [ "equals", "equals_not", "starts_with", "ends_with", "contains", ].includes(selectedKeys[0]) && (React.createElement(Input, { value: selectedKeys[1], onChange: function (e) { return setSelectedKeys([selectedKeys[0], e.target.value]); }, onPressEnter: function () { return confirm(); }, placeholder: t("parse:admin.filter.input_placeholder"), style: { width: 208, marginBottom: 8, display: "block" } })), React.createElement(Button, { type: "primary", onClick: function () { return confirm(); }, icon: React.createElement(SearchOutlined, null), size: "small", style: { width: 100, marginRight: 8 } }, t("parse:admin.filter.apply")), React.createElement(Button, { onClick: function () { return clearFilters(); }, size: "small", style: { width: 100 } }, t("parse:admin.filter.reset")))); } //# sourceMappingURL=AdminTableFilter.js.map