var __assign = this && this.__assign || function () {
  __assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return __assign.apply(this, arguments);
};

import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import find from 'lodash/find';
import { Dropmenu } from "../../dropdown";
import { FilterTypeKeys } from "./constant";
var prefixCls = 'dmc-text-filter';

var FilterTypes = function FilterTypes(_a) {
  var value = _a.value,
      locale = _a.locale,
      getPopupContainer = _a.getPopupContainer,
      onClickMenuItem = _a.onClickMenuItem;
  var fastLocale = locale.filterTypeLocale;
  var fastTypeOpts = [{
    title: fastLocale.include,
    key: FilterTypeKeys.contain
  }, {
    title: fastLocale.uninclude,
    key: FilterTypeKeys.nocontain
  }, {
    title: fastLocale.equal,
    key: FilterTypeKeys.equal
  }, {
    title: fastLocale.empty,
    key: FilterTypeKeys.empty
  }, {
    title: fastLocale.unempty,
    key: FilterTypeKeys.unempty
  }, {
    title: fastLocale.startwith,
    key: FilterTypeKeys.startwith
  }, {
    title: fastLocale.endwith,
    key: FilterTypeKeys.endwith
  }, {
    title: fastLocale.eitherof,
    key: FilterTypeKeys.eitherof
  }, {
    title: fastLocale.neitherof,
    key: FilterTypeKeys.neitherof
  }];
  var item = find(fastTypeOpts, function (t) {
    return t.key === value;
  }) || fastTypeOpts[0];
  return _jsx(Dropmenu, __assign({
    dropNoBorder: true,
    size: "compact",
    values: [item.key],
    menus: fastTypeOpts,
    type: 'menu-bg',
    className: prefixCls + "-dropmenu",
    getPopupContainer: getPopupContainer,
    onClickMenuItem: onClickMenuItem
  }, {
    children: item.title
  }), void 0);
};

FilterTypes.displayName = 'FilterTypes';
export default FilterTypes;
var FilterTypesMemo = /*#__PURE__*/React.memo(FilterTypes);
FilterTypesMemo.displayName = 'FilterTypesMemo';
export { FilterTypesMemo };

