{"version":3,"file":"context.cjs","sources":["../../../../../../packages/components/table/src/context.ts"],"sourcesContent":["import type { InjectionKey } from 'vue';\nimport type { SlotsContextProps, TableColumnType } from './interface';\nimport { computed, inject, provide } from 'vue';\n\nconst SlotsContextKey: InjectionKey<SlotsContextProps> = Symbol('SlotsContextProps');\n\nexport function useProvideSlots(props: SlotsContextProps) {\n  provide(SlotsContextKey, props);\n}\n\nexport function useInjectSlots() {\n  return inject(SlotsContextKey, computed(() => ({})) as SlotsContextProps);\n}\n\ninterface ContextProps {\n  onResizeColumn: (w: number, column: TableColumnType<any>) => void\n}\n\nconst ContextKey: InjectionKey<ContextProps> = Symbol('ContextProps');\n\nexport function useProvideTableContext(props: ContextProps) {\n  provide(ContextKey, props);\n}\n\nexport function useInjectTableContext() {\n  return inject(ContextKey, { onResizeColumn: () => {} } as ContextProps);\n}\n"],"names":["provide","inject","computed"],"mappings":";;;;AAIA,MAAM,eAAA,GAAmD,OAAO,mBAAmB,CAAA,CAAA;AAE5E,SAAS,gBAAgB,KAA0B,EAAA;AACxD,EAAAA,WAAA,CAAQ,iBAAiB,KAAK,CAAA,CAAA;AAChC,CAAA;AAEO,SAAS,cAAiB,GAAA;AAC/B,EAAA,OAAOC,WAAO,eAAiB,EAAAC,YAAA,CAAS,OAAO,GAAG,CAAsB,CAAA,CAAA;AAC1E,CAAA;AAMA,MAAM,UAAA,GAAyC,OAAO,cAAc,CAAA,CAAA;AAE7D,SAAS,uBAAuB,KAAqB,EAAA;AAC1D,EAAAF,WAAA,CAAQ,YAAY,KAAK,CAAA,CAAA;AAC3B,CAAA;AAEO,SAAS,qBAAwB,GAAA;AACtC,EAAA,OAAOC,UAAO,CAAA,UAAA,EAAY,EAAE,cAAA,EAAgB,MAAM;AAAA,KAAoB,CAAA,CAAA;AACxE;;;;;;;"}