var _excluded = ["renderMode"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import { ColorPicker as AntColorPicker } from 'antd';
import { red, volcano, orange, gold, yellow, lime, green, cyan, blue, geekblue, purple, magenta } from '@ant-design/colors';
import { getText } from "../../../../locales";
import ReadPretty from "./ReadPretty";
import { withMode } from "../../dataSourceForm/utils";
var ColorPicker = function ColorPicker(props) {
  var presets = [{
    label: getText('pisell-color-picker-default'),
    colors: [red.primary || red[5], volcano.primary || volcano[5], orange.primary || orange[5], gold.primary || gold[5], yellow.primary || yellow[5], lime.primary || lime[5], green.primary || green[5], cyan.primary || cyan[5], blue.primary || blue[5], geekblue.primary || geekblue[5], purple.primary || purple[5], magenta.primary || magenta[5]]
  }];
  var renderMode = props.renderMode,
    restProps = _objectWithoutProperties(props, _excluded);
  return /*#__PURE__*/React.createElement(AntColorPicker, _extends({}, restProps, {
    presets: presets
  }));
};
var ColorPickerWithMode = withMode(ColorPicker, ReadPretty);
export default ColorPickerWithMode;