'use strict';
import { jsxs, jsx } from 'react/jsx-runtime';
import { Select, SelectTrigger, SelectValue, SelectContent, SelectGroup, SelectItem } from '../../../../fd-component-toolbox/select/Select.js';
import { Input } from '../../../../fd-component-toolbox/input/Input.js';
import { numberFilterTypes } from '../filter-constants.js';
import { getFilterShortValue } from '../filter-display.js';
import { filterOperatorTypes } from '../../../../../fd-toolbox/enums/enums.js';
import { jsBasicTypes } from '../../../../../base-repo/constants/basic-types.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
function IntegerFilter({
  filterOperatorType,
  onOperatorTypeChange,
  rightHandResult,
  onRightHandChange,
  displayName,
  disableFilterInput,
  inputId,
  inputRef,
  onBlur
}) {
  return /* @__PURE__ */jsxs("div", {
    className: "flex",
    children: [/* @__PURE__ */jsx("div", {
      className: "mr-1 inline-block w-full max-w-9",
      children: /* @__PURE__ */jsxs(Select, {
        value: filterOperatorType,
        onValueChange: value => onOperatorTypeChange(value ?? void 0),
        children: [/* @__PURE__ */jsx(SelectTrigger, {
          variant: "float",
          className: "focus-visible:ring-primary flex justify-center gap-px outline-none focus-visible:rounded-md focus-visible:ring-1",
          size: "short",
          children: filterOperatorType !== filterOperatorTypes.none && /* @__PURE__ */jsx(SelectValue, {
            children: getFilterShortValue(numberFilterTypes, filterOperatorType)
          })
        }), /* @__PURE__ */jsx(SelectContent, {
          children: /* @__PURE__ */jsx(SelectGroup, {
            children: numberFilterTypes.map(item => /* @__PURE__ */jsx(SelectItem, {
              value: item.type,
              className: "min-h-6",
              children: item.text
            }, item.type))
          })
        })]
      })
    }), /* @__PURE__ */jsx("div", {
      className: "inline-block w-64",
      children: /* @__PURE__ */jsx(Input, {
        inputId,
        showClearIcon: true,
        value: rightHandResult !== jsBasicTypes.null ? rightHandResult : "",
        onChange: onRightHandChange,
        disabled: disableFilterInput(filterOperatorType),
        label: displayName,
        variant: "float",
        ref: inputRef,
        onBlur
      })
    })]
  });
}
__name(IntegerFilter, "IntegerFilter");

export { IntegerFilter };
