import React from "react";
import { Button, Input, Space } from "antd";
import SearchLg from "@pisell/icon/es/SearchLg";
import { getText } from "../../../locales";
import "./index.less";
var getColumnStringProps = function getColumnStringProps(_ref) {
  var dataIndex = _ref.dataIndex;
  return {
    filterDropdown: function filterDropdown(_ref2) {
      var setSelectedKeys = _ref2.setSelectedKeys,
        selectedKeys = _ref2.selectedKeys,
        confirm = _ref2.confirm,
        clearFilters = _ref2.clearFilters,
        close = _ref2.close;
      return /*#__PURE__*/React.createElement("div", {
        onKeyDown: function onKeyDown(e) {
          return e.stopPropagation();
        },
        className: "pisell-table-filter-dropdown"
      }, /*#__PURE__*/React.createElement("div", {
        className: "pisell-table-filter-dropdown-top"
      }, /*#__PURE__*/React.createElement(Input, {
        prefix: /*#__PURE__*/React.createElement(SearchLg, null),
        placeholder: getText("table-filter-search"),
        value: selectedKeys[0],
        onChange: function onChange(e) {
          return setSelectedKeys(e.target.value ? [e.target.value] : []);
        },
        onPressEnter: function onPressEnter() {
          return confirm();
        },
        style: {
          width: 240
        }
      })), /*#__PURE__*/React.createElement(Space, {
        className: "pisell-table-filter-dropdown-bottom",
        styles: {
          item: {
            flex: 1
          }
        }
      }, /*#__PURE__*/React.createElement(Button, {
        onClick: function onClick() {
          clearFilters && clearFilters();
          confirm();
        },
        block: true,
        style: {
          flex: 1
        }
      }, getText('table-filter-clear')), /*#__PURE__*/React.createElement(Button, {
        type: "primary",
        onClick: function onClick() {
          return confirm();
        },
        block: true,
        style: {
          flex: 1
        }
      }, getText('table-filter-filter'))));
    },
    filterIcon: function filterIcon(filtered) {
      return /*#__PURE__*/React.createElement(SearchLg, {
        style: {
          color: filtered ? "#7f56d9" : undefined,
          fontSize: 16
        }
      });
    }
  };
};
export default getColumnStringProps;