{"version":3,"file":"useMoreAction.mjs","sources":["../../../../components/pagination/hooks/useMoreAction.ts"],"sourcesContent":["import { computed, ref, Ref } from 'vue';\nimport { TdPaginationProps } from '../type';\n\nexport function useMoreAction(props: TdPaginationProps, pageCount: Ref<number>, innerCurrent: Ref<number>) {\n  const prevMore = ref(false);\n\n  const nextMore = ref(false);\n\n  const curPageLeftCount = computed(() => Math.ceil((props.foldedMaxPageBtn - 1) / 2));\n\n  const curPageRightCount = computed(() => Math.floor((props.foldedMaxPageBtn - 1) / 2));\n\n  const isPrevMoreShow = computed(() => 2 + curPageLeftCount.value < innerCurrent.value);\n\n  const isNextMoreShow = computed(() => pageCount.value - 1 - curPageRightCount.value > innerCurrent.value);\n\n  return {\n    prevMore,\n    nextMore,\n    curPageLeftCount,\n    curPageRightCount,\n    isPrevMoreShow,\n    isNextMoreShow,\n  };\n}\n"],"names":["useMoreAction","props","pageCount","innerCurrent","prevMore","ref","nextMore","curPageLeftCount","computed","Math","ceil","foldedMaxPageBtn","curPageRightCount","floor","isPrevMoreShow","value","isNextMoreShow"],"mappings":";;;;;;;;AAGgB,SAAAA,aAAAA,CAAcC,KAA0B,EAAAC,SAAA,EAAwBC,YAA2B,EAAA;AACnG,EAAA,IAAAC,QAAA,GAAWC,IAAI,KAAK,CAAA,CAAA;AAEpB,EAAA,IAAAC,QAAA,GAAWD,IAAI,KAAK,CAAA,CAAA;EAEpB,IAAAE,gBAAA,GAAmBC,SAAS,YAAA;AAAA,IAAA,OAAMC,IAAA,CAAKC,MAAMT,KAAM,CAAAU,gBAAA,GAAmB,CAAK,IAAA,CAAC,CAAC,CAAA;GAAA,CAAA,CAAA;EAE7E,IAAAC,iBAAA,GAAoBJ,SAAS,YAAA;AAAA,IAAA,OAAMC,IAAA,CAAKI,OAAOZ,KAAM,CAAAU,gBAAA,GAAmB,CAAK,IAAA,CAAC,CAAC,CAAA;GAAA,CAAA,CAAA;EAErF,IAAMG,iBAAiBN,QAAS,CAAA,YAAA;IAAA,OAAM,IAAID,gBAAiB,CAAAQ,KAAA,GAAQZ,aAAaY,KAAK,CAAA;GAAA,CAAA,CAAA;EAE/E,IAAAC,cAAA,GAAiBR,SAAS,YAAA;AAAA,IAAA,OAAMN,SAAA,CAAUa,QAAQ,CAAI,GAAAH,iBAAA,CAAkBG,KAAQ,GAAAZ,YAAA,CAAaY,KAAK,CAAA;GAAA,CAAA,CAAA;EAEjG,OAAA;AACLX,IAAAA,QAAA,EAAAA,QAAA;AACAE,IAAAA,QAAA,EAAAA,QAAA;AACAC,IAAAA,gBAAA,EAAAA,gBAAA;AACAK,IAAAA,iBAAA,EAAAA,iBAAA;AACAE,IAAAA,cAAA,EAAAA,cAAA;AACAE,IAAAA,cAAA,EAAAA,cAAAA;GACF,CAAA;AACF;;;;"}