'use strict';

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

require('../../../../utils/index.cjs');
var valueUtil = require('./valueUtil.cjs');
var log = require('../../../../utils/log.cjs');

function warningProps(props) {
  const { searchPlaceholder, treeCheckStrictly, treeCheckable, labelInValue, value, multiple } = props;
  log.warning(
    !searchPlaceholder,
    "`searchPlaceholder` has been removed, please use `placeholder` instead"
  );
  if (treeCheckStrictly && labelInValue === false)
    log.warning(false, "`treeCheckStrictly` will force set `labelInValue` to `true`.");
  if (labelInValue || treeCheckStrictly) {
    log.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) {
    log.warning(
      !value || Array.isArray(value),
      "`value` should be an array when `TreeSelect` is checkable or multiple."
    );
  } else {
    log.warning(!Array.isArray(value), "`value` should not be array when `TreeSelect` is single mode.");
  }
}

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