import { computed } from 'vue';
import '../../../../utils/index.mjs';
import '../../../../hooks/index.mjs';
import { formatValue } from '../utils/dateUtil.mjs';
import { useMemo } from '../../../../hooks/use-memo/index.mjs';
import { shallowEqual } from '../../../../utils/lang/shallowEqual.mjs';

function useValueTexts(value, { formatList, generateConfig, locale }) {
  const texts = useMemo(
    () => {
      if (!value.value)
        return [[""], ""];
      let firstValueText2 = "";
      const fullValueTexts2 = [];
      for (let i = 0; i < formatList.value.length; i += 1) {
        const format = formatList.value[i];
        const formatStr = formatValue(value.value, {
          generateConfig: generateConfig.value,
          locale: locale.value,
          format
        });
        fullValueTexts2.push(formatStr);
        if (i === 0)
          firstValueText2 = formatStr;
      }
      return [fullValueTexts2, firstValueText2];
    },
    [value, formatList],
    (next, prev) => prev[0] !== next[0] || !shallowEqual(prev[1], next[1])
  );
  const fullValueTexts = computed(() => texts.value[0]);
  const firstValueText = computed(() => texts.value[1]);
  return [fullValueTexts, firstValueText];
}

export { useValueTexts as default };
//# sourceMappingURL=useValueTexts.mjs.map
