{"version":3,"file":"useLoading2.mjs","sources":["../../../../../../../../packages/components/table/src/hooks/useLoading.ts"],"sourcesContent":["import { computed, ref, unref, watch } from 'vue'\nimport type { ComputedRef } from 'vue'\nimport type { BasicTableProps } from '../types/table'\n\nexport function useLoading(props: ComputedRef<BasicTableProps>) {\n  const loadingRef = ref(unref(props).loading)\n\n  watch(\n    () => unref(props).loading,\n    (loading) => {\n      loadingRef.value = loading\n    }\n  )\n\n  const getLoading = computed(() => unref(loadingRef))\n\n  function setLoading(loading: boolean) {\n    loadingRef.value = loading\n  }\n\n  return { getLoading, setLoading }\n}\n"],"names":[],"mappings":";;AACO,SAAS,UAAU,CAAC,KAAK,EAAE;AAClC,EAAE,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;AAC/C,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,KAAK;AACjD,IAAI,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC;AAC/B,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;AACvD,EAAE,SAAS,UAAU,CAAC,OAAO,EAAE;AAC/B,IAAI,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC;AAC/B,GAAG;AACH,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AACpC;;;;"}