import { getText } from "../../../locales/index.js";
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import React from "react";
import { Button, InputNumber, Space } from "antd";
import FilterFunnel01 from "@pisell/icon/es/FilterFunnel01";
import FilterFunnel01Fill from "@pisell/icon/es/FilterFunnel01Fill";
import "./index.less";
//#region src/components/table/TableFilter/numberFilter.tsx
const getColumnNumberProps = ({ dataIndex }) => ({
	filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }) => {
		var _selectedKeys$, _selectedKeys$2;
		return /* @__PURE__ */ React.createElement("div", {
			onKeyDown: (e) => e.stopPropagation(),
			className: "pisell-table-filter-dropdown"
		}, /* @__PURE__ */ React.createElement(Space, {
			split: "-",
			className: "pisell-table-filter-dropdown-top"
		}, /* @__PURE__ */ React.createElement(InputNumber, {
			value: selectedKeys === null || selectedKeys === void 0 || (_selectedKeys$ = selectedKeys[0]) === null || _selectedKeys$ === void 0 ? void 0 : _selectedKeys$.min,
			onChange: (value) => {
				setSelectedKeys([_objectSpread2(_objectSpread2({}, (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys[0]) || {}), {}, { min: value })]);
			},
			placeholder: getText("table-filter-min"),
			onPressEnter: () => confirm(),
			style: { width: 105 }
		}), /* @__PURE__ */ React.createElement(InputNumber, {
			value: selectedKeys === null || selectedKeys === void 0 || (_selectedKeys$2 = selectedKeys[0]) === null || _selectedKeys$2 === void 0 ? void 0 : _selectedKeys$2.max,
			placeholder: getText("table-filter-max"),
			onChange: (value) => {
				setSelectedKeys([_objectSpread2(_objectSpread2({}, (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys[0]) || {}), {}, { max: value })]);
			},
			onPressEnter: () => confirm(),
			style: { width: 105 }
		})), /* @__PURE__ */ React.createElement(Space, {
			className: "pisell-table-filter-dropdown-bottom",
			styles: { item: { flex: 1 } }
		}, /* @__PURE__ */ React.createElement(Button, {
			onClick: () => {
				clearFilters && clearFilters();
				confirm();
			},
			block: true
		}, getText("table-filter-clear")), /* @__PURE__ */ React.createElement(Button, {
			type: "primary",
			onClick: () => confirm(),
			block: true
		}, getText("table-filter-filter"))));
	},
	filterIcon: (filtered) => filtered ? /* @__PURE__ */ React.createElement(FilterFunnel01Fill, { style: {
		color: "#7f56d9",
		fontSize: 14
	} }) : /* @__PURE__ */ React.createElement(FilterFunnel01, { style: {
		color: "#98A2B3",
		fontSize: 14
	} })
});
//#endregion
export { getColumnNumberProps as default };
