'use strict';

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

var vue = require('vue');
require('../../../../hooks/index.cjs');
var useBaseProps = require('../../../vc-select/src/hooks/useBaseProps.cjs');
var context = require('../context.cjs');
var index = require('../../../../hooks/use-state/index.cjs');

var useActive = () => {
  const baseProps = useBaseProps.default();
  const { values } = context.useInjectCascader();
  const [activeValueCells, setActiveValueCells] = index.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.cjs.map
