'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var warning = require('../../vc-util/warning.js');
var valueUtil = require('./valueUtil.js');

function warningProps(props) {
  const { searchPlaceholder, treeCheckStrictly, treeCheckable, labelInValue, value, multiple } = props;
  warning.warning(
    !searchPlaceholder,
    "`searchPlaceholder` has been removed, please use `placeholder` instead"
  );
  if (treeCheckStrictly && labelInValue === false)
    warning.warning(false, "`treeCheckStrictly` will force set `labelInValue` to `true`.");
  if (labelInValue || treeCheckStrictly) {
    warning.warning(
      valueUtil.toArray(value).every((val) => val && typeof val === "object" && "value" in val),
      "Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."
    );
  }
  if (treeCheckStrictly || multiple || treeCheckable) {
    warning.warning(
      !value || Array.isArray(value),
      "`value` should be an array when `TreeSelect` is checkable or multiple."
    );
  } else {
    warning.warning(!Array.isArray(value), "`value` should not be array when `TreeSelect` is single mode.");
  }
}

exports.default = warningProps;
//# sourceMappingURL=warningPropsUtil.js.map
