loader.mjs.map 2.5 KB

1
  1. {"version":3,"file":"loader.mjs","names":["VProgressLinear","computed","getCurrentInstanceName","propsFactory","makeLoaderProps","loading","Boolean","String","useLoader","props","name","arguments","length","undefined","loaderClasses","LoaderSlot","_ref","slots","_createVNode","default","color","isActive","active"],"sources":["../../src/composables/loader.tsx"],"sourcesContent":["// Components\nimport { VProgressLinear } from '@/components/VProgressLinear'\n\n// Utilities\nimport { computed } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nimport type { ExtractPropTypes, SetupContext } from 'vue'\nimport type { SlotsToProps } from '@/util'\n\nexport interface LoaderSlotProps {\n color: string | undefined\n isActive: boolean\n}\n\nexport interface LoaderProps {\n loading?: boolean | string\n}\n\n// Composables\nexport const makeLoaderProps = propsFactory({\n loading: [Boolean, String],\n}, 'loader')\n\nexport function useLoader (\n props: LoaderProps,\n name = getCurrentInstanceName(),\n) {\n const loaderClasses = computed(() => ({\n [`${name}--loading`]: props.loading,\n }))\n\n return { loaderClasses }\n}\n\nexport function LoaderSlot (\n props: {\n active: boolean\n name: string\n color?: string\n } & ExtractPropTypes<SlotsToProps<{\n default: LoaderSlotProps\n }>>,\n { slots }: SetupContext,\n) {\n return (\n <div class={ `${props.name}__loader` }>\n { slots.default?.({\n color: props.color,\n isActive: props.active,\n } as LoaderSlotProps) || (\n <VProgressLinear\n active={ props.active }\n color={ props.color }\n height=\"2\"\n indeterminate\n />\n )}\n </div>\n )\n}\n"],"mappings":";AAAA;AAAA,SACSA,eAAe,mDAExB;AACA,SAASC,QAAQ,QAAQ,KAAK;AAAA,SACrBC,sBAAsB,EAAEC,YAAY,6BAE7C;AAaA;AACA,OAAO,MAAMC,eAAe,GAAGD,YAAY,CAAC;EAC1CE,OAAO,EAAE,CAACC,OAAO,EAAEC,MAAM;AAC3B,CAAC,EAAE,QAAQ,CAAC;AAEZ,OAAO,SAASC,SAASA,CACvBC,KAAkB,EAElB;EAAA,IADAC,IAAI,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGT,sBAAsB,EAAE;EAE/B,MAAMY,aAAa,GAAGb,QAAQ,CAAC,OAAO;IACpC,CAAE,GAAES,IAAK,WAAU,GAAGD,KAAK,CAACJ;EAC9B,CAAC,CAAC,CAAC;EAEH,OAAO;IAAES;EAAc,CAAC;AAC1B;AAEA,OAAO,SAASC,UAAUA,CACxBN,KAMG,EAAAO,IAAA,EAEH;EAAA,IADA;IAAEC;EAAoB,CAAC,GAAAD,IAAA;EAEvB,OAAAE,YAAA;IAAA,SACgB,GAAET,KAAK,CAACC,IAAK;EAAS,IAChCO,KAAK,CAACE,OAAO,GAAG;IAChBC,KAAK,EAAEX,KAAK,CAACW,KAAK;IAClBC,QAAQ,EAAEZ,KAAK,CAACa;EAClB,CAAC,CAAoB,IAAAJ,YAAA,CAAAlB,eAAA;IAAA,UAERS,KAAK,CAACa,MAAM;IAAA,SACbb,KAAK,CAACW,KAAK;IAAA,UACZ,GAAG;IAAA;EAAA,QAGb;AAGP"}