'use strict';

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

var vue = require('vue');
var context = require('../context.js');
require('../../vc-select/index.js');
require('../../hooks/index.js');
var useBaseProps = require('../../vc-select/hooks/useBaseProps.js');
var useState = require('../../hooks/useState.js');

var useActive = () => {
  const baseProps = useBaseProps.default();
  const { values } = context.useInjectCascader();
  const [activeValueCells, setActiveValueCells] = useState.useState([]);
  vue.watch(
    () => baseProps.open,
    () => {
      if (baseProps.open && !baseProps.multiple) {
        const firstValueCells = values.value[0];
        setActiveValueCells(firstValueCells || []);
      }
    },
    { immediate: true }
  );
  return [activeValueCells, setActiveValueCells];
};

exports.default = useActive;
//# sourceMappingURL=useActive.js.map
