@zydon/common 2.8.78 → 2.8.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ANEPP6QT.js → chunk-ERLI5GAP.js} +3 -3
- package/dist/{chunk-ANEPP6QT.js.map → chunk-ERLI5GAP.js.map} +1 -1
- package/dist/chunk-K2PWIYEM.js +4 -0
- package/dist/chunk-K2PWIYEM.js.map +1 -0
- package/dist/{chunk-SP5U3DJP.js → chunk-UWTX4JMW.js} +4 -4
- package/dist/chunk-UWTX4JMW.js.map +1 -0
- package/dist/components/Analytics/OverviewAnalytics/index.d.ts +1 -1
- package/dist/components/Analytics/OverviewAnalytics/index.js +1 -1
- package/dist/components/Analytics/OverviewAnalytics/index.js.map +1 -1
- package/dist/components/Analytics/PartnerAnalysis/index.d.ts +2 -1
- package/dist/components/Analytics/PartnerAnalysis/index.js +1 -1
- package/dist/components/Analytics/PartnerAnalysis/index.js.map +1 -1
- package/dist/components/Analytics/index.d.ts +2 -1
- package/dist/components/Analytics/index.js +2 -2
- package/dist/components/Analytics/index.js.map +1 -1
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/DataView/index.d.ts +1 -1
- package/dist/hooks/useSnackbar.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/theme/core/index.d.ts +1 -1
- package/dist/theme/styles/index.d.ts +13 -13
- package/dist/types/analytics.d.ts +3 -23
- package/dist/types/analytics.js +1 -1
- package/dist/types/overviewAnalytics.d.ts +1 -1
- package/dist/types/partnerAnalysis.d.ts +4 -27
- package/dist/types/partnerAnalysis.js +1 -1
- package/dist/utils/analytics.d.ts +24 -0
- package/dist/utils/analytics.js +2 -0
- package/dist/utils/analytics.js.map +1 -0
- package/dist/utils/partnerAnalysis.d.ts +28 -0
- package/dist/utils/partnerAnalysis.js +2 -0
- package/dist/utils/partnerAnalysis.js.map +1 -0
- package/dist/utils/periodDates.d.ts +2 -1
- package/dist/utils/periodDates.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-BHYLHO5P.js +0 -4
- package/dist/chunk-BHYLHO5P.js.map +0 -1
- package/dist/chunk-SP5U3DJP.js.map +0 -1
- package/dist/{index-c8f1e6e7.d.ts → index-5a5e5dc8.d.ts} +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Analytics/AiSummary/index.tsx","../../../src/components/Analytics/AiSummary/Skeleton.tsx","../../../src/components/Analytics/AiSummary/styles.ts","../../../src/components/Analytics/AiSummary/Summary.tsx","../../../src/components/Analytics/AiSummary/Header.tsx","../../../src/components/Analytics/ExportButton/styles.ts","../../../src/components/Analytics/ExportButton/index.tsx","../../../src/components/Analytics/FilterDate/index.tsx","../../../src/components/Analytics/FilterDate/styles.ts"],"names":["AlertTitle","Button","Typography","Stack","MuiAlert","alpha","keyframes","styled","gradientAnimation","Alert","theme","primaryMain","primaryLight","LoadingAlert","jsx","jsxs","AiSummarySkeleton","Icon_default","Skeleton_default","memo","Header","Header_default","defaultFormatContent","text","SummaryContent","detail","formatContent","format","isHtml","Summary","open","toggleOpen","useResponsive_default","Drawer_default","Modal_default","Summary_default","Fragment","AiSummary","brief","isLoading","useToggle_default","Result_default","AiSummary_default","LoadingButton","MuiButton","ItemButton","ExportButton","onExport","isExporting","onOpen","onClose","usePopover_default","handleExport","MenuPopover_default","ExportFormat","index","ExportButton_default","useCallback","useState","useForm","Divider","FormControlLabel","Radio","RadioGroup","dayjs","DateRangeCalendar","DateRangeCalendar_default","daysOfWeek","FilterDate","value","onSave","isMobile","methods","handleSubmit","setValue","getValues","selectedPeriod","setSelectedPeriod","dateRange","setDateRange","handlePeriodChange","period","dates","getPeriodDates","handleCalendarChange","newRange","matchingPeriod","findMatchingPeriod","handleStartDateChange","date","endDate","handleEndDateChange","startDate","handleAutocompletePeriodChange","newValue","onSubmit","formData","toFilterDateState","Form_default","DateField_default","SimpleCard_default","Autocomplete_default","periodOptions","_","FilterPeriod","o","day","FilterDate_default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AU,CAAC2B,EAAGT,IACZd,EAAmBc,CAAwB,EAG5C,gBAAO,OAAOU,CAAY,EAAE,IAAIvB,GAC/BnE,EAAC+C,GAAA,CAEC,MAAOoB,EACP,QAASnE,EAACgD,GAAA,CAAM,KAAK,QAAQ,EAC7B,MAAOwC,EAAc,KAAKG,GAAKA,EAAE,QAAUxB,CAAM,GAAG,OAH/CA,CAIP,CACD,EACH,EAaFnE,EAAC8C,GAAA,CACC,YAAY,WACZ,SAAQ,GACR,GAAI,CAAE,QAAS,CAAE,GAAI,OAAQ,GAAI,OAAQ,CAAE,EAC7C,EAEA9C,EAACmD,GAAA,CACC,MAAOa,GACP,SAAUM,GACV,UAAW,EACX,4BAA2B,GAC3B,gBAAiB,EACjB,cAAa,GACb,mBAAoBsB,GACXvC,GAAWuC,EAAI,IAAI,CAAC,EAE/B,GACF,EAEA5F,EAACX,EAAA,CAAM,WAAW,WAChB,SAAAY,EAACZ,EAAA,CAAM,UAAU,MAAM,WAAW,SAAS,IAAK,IAC9C,UAAAW,EAACb,GAAA,CAAO,QAAQ,WAAW,MAAM,UAAU,QAASiD,EAAS,oBAE7D,EAEApC,EAACb,GAAA,CAAO,QAAQ,YAAY,KAAK,SAAS,kBAE1C,GACF,EACF,GACF,CAEJ,EAEO0G,GAAQvC","sourcesContent":["import AlertTitle from '@mui/material/AlertTitle';\nimport Button from '@mui/material/Button';\nimport Typography from '@mui/material/Typography';\n\nimport Icon from 'components/Icon';\nimport Result from 'components/Result';\nimport useToggle from 'hooks/useToggle';\n\nimport { AiSummaryProps } from './props';\nimport AiSummarySkeleton from './Skeleton';\nimport { Alert } from './styles';\nimport Summary from './Summary';\n\nconst AiSummary = ({\n brief,\n detail,\n isLoading = false,\n formatContent,\n}: AiSummaryProps) => {\n const [open, toggleOpen] = useToggle(false);\n\n const hasSummary = !!brief && !!detail;\n\n if (!hasSummary && !isLoading) return null;\n\n return (\n <>\n <Result isLoading={isLoading} loading={<AiSummarySkeleton />}>\n <Alert\n icon={<Icon icon=\"AI_08_SOLID_ROUND\" color=\"primary.main\" />}\n action={\n <Button\n variant={isLoading ? 'contained' : 'text'}\n color=\"primary\"\n size=\"small\"\n onClick={toggleOpen}\n >\n Ver mais\n </Button>\n }\n >\n <AlertTitle variant=\"subtitle1\" color=\"text.primary\">\n Resumo inteligente\n </AlertTitle>\n\n <Typography variant=\"body2\" color=\"text.secondary\">\n {brief}\n </Typography>\n </Alert>\n </Result>\n\n <Summary\n open={open}\n toggleOpen={toggleOpen}\n detail={detail ?? ''}\n formatContent={formatContent}\n />\n </>\n );\n};\n\nexport default AiSummary;\n","import AlertTitle from '@mui/material/AlertTitle';\nimport Stack from '@mui/material/Stack';\n\nimport Icon from 'components/Icon';\nimport Skeleton from 'components/Skeleton';\n\nimport { LoadingAlert } from './styles';\n\nconst AiSummarySkeleton = () => (\n <LoadingAlert\n icon={<Icon icon=\"AI_08_SOLID_ROUND\" color=\"primary.main\" />}\n action={<Skeleton variant=\"text\" width={100} height={30} />}\n >\n <AlertTitle variant=\"subtitle1\" color=\"text.primary\">\n Resumo inteligente\n </AlertTitle>\n\n <Stack gap={0.5}>\n <Skeleton variant=\"text\" width=\"100%\" height={30} />\n <Skeleton variant=\"text\" width=\"80%\" height={30} />\n </Stack>\n </LoadingAlert>\n);\n\nexport default AiSummarySkeleton;\n","import MuiAlert from '@mui/material/Alert';\nimport { alpha, keyframes, styled } from '@mui/material/styles';\n\nconst gradientAnimation = keyframes`\n 0% {\n background-position: 0% 50%;\n }\n 100% {\n background-position: 200% 50%;\n }\n`;\n\nexport const Alert = styled(MuiAlert)(({ theme }) => {\n const primaryMain = theme.palette.primary.main;\n const primaryLight = alpha(primaryMain, 0.1);\n\n return {\n position: 'relative',\n\n backgroundColor: alpha(theme.palette.primary.main, 0.01),\n border: '1px solid transparent',\n\n borderRadius: 8,\n\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n borderRadius: 'inherit',\n padding: '1px',\n background: `linear-gradient(90deg, ${primaryMain} 0%, ${primaryLight} 50%, ${primaryMain} 100%)`,\n WebkitMask:\n 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n WebkitMaskComposite: 'xor',\n mask: 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n maskComposite: 'exclude',\n pointerEvents: 'none',\n },\n\n overflow: 'hidden',\n\n '& .MuiAlert-message': {\n width: '100%',\n },\n };\n});\n\nexport const LoadingAlert = styled(Alert)({\n border: '1px solid transparent',\n\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n borderRadius: 'inherit',\n padding: '1px',\n background: 'linear-gradient(90deg, #e01cd5 0%, #1CB5E0 50%, #e01cd5 100%)',\n backgroundSize: '200% auto',\n WebkitMask:\n 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n WebkitMaskComposite: 'xor',\n mask: 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n maskComposite: 'exclude',\n pointerEvents: 'none',\n animation: `${gradientAnimation} 2s linear infinite`,\n },\n});\n","import { memo } from 'react';\nimport Typography from '@mui/material/Typography';\n\nimport Drawer from 'components/Drawer';\nimport Modal from 'components/Modal';\nimport useResponsive from 'hooks/useResponsive';\n\nimport Header from './Header';\nimport { SummaryContentProps, SummaryProps } from './props';\n\nconst defaultFormatContent = (text: string) => text;\n\nconst SummaryContent = ({ detail, formatContent }: SummaryContentProps) => {\n const format = formatContent ?? defaultFormatContent;\n const isHtml = formatContent != null;\n\n return (\n <Typography variant=\"body2\" color=\"text.primary\">\n {isHtml ? (\n <span dangerouslySetInnerHTML={{ __html: format(detail) }} />\n ) : (\n detail\n )}\n </Typography>\n );\n};\n\nconst Summary = ({ open, toggleOpen, detail, formatContent }: SummaryProps) => {\n const isMobile = useResponsive('down', 'sm');\n\n if (isMobile) {\n return (\n <Drawer\n open={open}\n onClose={toggleOpen}\n headerTitle={<Header />}\n headerProps={{\n direction: 'row-reverse',\n sx: { '& > :last-child': { minWidth: 0, overflow: 'hidden' } },\n }}\n >\n <SummaryContent detail={detail} formatContent={formatContent} />\n </Drawer>\n );\n }\n\n return (\n <Modal\n open={open}\n onClose={toggleOpen}\n dialogTitle={<Header />}\n dialogTitleProps={{ sx: { flex: 1, overflow: 'hidden' } }}\n maxWidth=\"md\"\n fullWidth\n scroll=\"paper\"\n >\n <SummaryContent detail={detail} formatContent={formatContent} />\n </Modal>\n );\n};\n\nexport default memo(Summary);\n","import Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport Icon from 'components/Icon';\n\nconst Header = () => (\n <Stack direction=\"row\" alignItems=\"center\" gap={1.5}>\n <Icon icon=\"AI_08_SOLID_ROUND\" color=\"primary.main\" sx={{ flexGrow: 0 }} />\n\n <Stack>\n <Typography variant=\"subtitle1\" color=\"text.primary\">\n Resumo inteligente\n </Typography>\n\n <Typography variant=\"body2\" color=\"text.secondary\">\n Gerado com base nos dados consolidados da página.\n </Typography>\n </Stack>\n </Stack>\n);\n\nexport default Header;\n","import LoadingButton from '@mui/lab/LoadingButton';\nimport MuiButton from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nexport const Button = styled(MuiButton)(({ theme }) => ({\n color: theme.palette.text.secondary,\n\n '&:hover': {\n background: theme.palette.action.hover,\n },\n}));\n\nexport const ItemButton = styled(LoadingButton)(({ theme }) => ({\n justifyContent: 'flex-start',\n\n color: theme.palette.text.secondary,\n fontWeight: 400,\n\n '&:hover': {\n background: theme.palette.action.hover,\n },\n}));\n","import Icon from 'components/Icon';\nimport MenuPopover from 'components/MenuPopover';\nimport usePopover from 'hooks/usePopover';\nimport { ExportFormat } from 'types/analytics';\n\nimport { ExportButtonProps } from './props';\nimport { Button, ItemButton } from './styles';\n\nconst ExportButton = ({ onExport, isExporting }: ExportButtonProps) => {\n const { open, onOpen, onClose } = usePopover();\n\n const handleExport = (format: ExportFormat) => {\n onExport(format);\n onClose();\n };\n\n return (\n <>\n <Button\n variant=\"text\"\n startIcon={<Icon icon=\"DOWNLOAD\" />}\n color=\"primary\"\n size=\"small\"\n onClick={onOpen}\n disabled={isExporting}\n >\n {isExporting ? 'Exportando...' : 'Exportar'}\n </Button>\n\n <MenuPopover\n open={open}\n onClose={onClose}\n disabledArrow\n sx={{ p: 1, width: 180 }}\n >\n {Object.values(ExportFormat).map((format, index) => (\n <ItemButton\n key={index}\n variant=\"text\"\n onClick={() => handleExport(format)}\n loading={isExporting}\n fullWidth\n data-testid={`export-button-${index}`}\n >\n {format}\n </ItemButton>\n ))}\n </MenuPopover>\n </>\n );\n};\n\nexport default ExportButton;\n","import { useCallback, useState } from 'react';\nimport { useForm } from 'react-hook-form';\nimport Button from '@mui/material/Button';\nimport Divider from '@mui/material/Divider';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Radio from '@mui/material/Radio';\nimport RadioGroup from '@mui/material/RadioGroup';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\nimport dayjs from 'dayjs';\n\nimport Autocomplete from 'components/Autocomplete';\nimport DateField from 'components/form/DateField';\nimport Form from 'components/form/Form';\nimport SimpleCard from 'components/SimpleCard';\nimport useResponsive from 'hooks/useResponsive';\nimport { FilterPeriod } from 'types/analytics';\nimport {\n findMatchingPeriod,\n getPeriodDates,\n periodOptions,\n toFilterDateState,\n} from 'utils/periodDates';\n\nimport { FilterDateForm, FilterDateProps } from './props';\nimport { DateRangeCalendar } from './styles';\n\nconst daysOfWeek = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];\n\nconst FilterDate = ({ value, onSave, onClose }: FilterDateProps) => {\n const isMobile = useResponsive('down', 'sm');\n\n const methods = useForm<FilterDateForm>({\n defaultValues: {\n period: value.period,\n start_date: value.start_date ? dayjs(value.start_date).toDate() : null,\n end_date: value.end_date ? dayjs(value.end_date).toDate() : null,\n },\n });\n\n const { handleSubmit, setValue, getValues } = methods;\n\n const [selectedPeriod, setSelectedPeriod] = useState<FilterPeriod>(\n value.period,\n );\n\n const [dateRange, setDateRange] = useState<[Date | null, Date | null]>(() => [\n value.start_date ? dayjs(value.start_date).toDate() : null,\n value.end_date ? dayjs(value.end_date).toDate() : null,\n ]);\n\n const handlePeriodChange = useCallback(\n (period: FilterPeriod) => {\n const dates = getPeriodDates(period);\n\n setSelectedPeriod(period);\n setDateRange([dates.start_date, dates.end_date]);\n\n setValue('period', period);\n setValue('start_date', dates.start_date);\n setValue('end_date', dates.end_date);\n },\n [setValue],\n );\n\n const handleCalendarChange = useCallback(\n (newRange: [Date | null, Date | null]) => {\n setDateRange(newRange);\n\n if (newRange[0]) setValue('start_date', newRange[0]);\n if (newRange[1]) setValue('end_date', newRange[1]);\n\n if (newRange[0] && newRange[1]) {\n const matchingPeriod = findMatchingPeriod(newRange[0], newRange[1]);\n setSelectedPeriod(matchingPeriod);\n setValue('period', matchingPeriod);\n }\n },\n [setValue],\n );\n\n const handleStartDateChange = useCallback(\n (date: Date) => {\n setValue('start_date', date);\n\n const endDate = getValues('end_date');\n\n if (date && endDate) {\n const newRange: [Date, Date] = [date, endDate];\n setDateRange(newRange);\n const matchingPeriod = findMatchingPeriod(newRange[0], newRange[1]);\n setSelectedPeriod(matchingPeriod);\n setValue('period', matchingPeriod);\n }\n },\n [getValues, setValue],\n );\n\n const handleEndDateChange = useCallback(\n (date: Date) => {\n setValue('end_date', date);\n\n const startDate = getValues('start_date');\n\n if (startDate && date) {\n const newRange: [Date, Date] = [startDate, date];\n setDateRange(newRange);\n const matchingPeriod = findMatchingPeriod(newRange[0], newRange[1]);\n setSelectedPeriod(matchingPeriod);\n setValue('period', matchingPeriod);\n }\n },\n [getValues, setValue],\n );\n\n const handleAutocompletePeriodChange = useCallback(\n (newValue: string | string[] | null) => {\n if (newValue && typeof newValue === 'string') {\n handlePeriodChange(newValue as FilterPeriod);\n }\n },\n [handlePeriodChange],\n );\n\n const onSubmit = useCallback(\n (formData: FilterDateForm) => {\n onSave(toFilterDateState(formData));\n },\n [onSave],\n );\n\n return (\n <Form methods={methods} onSubmit={handleSubmit(onSubmit)} gap={3}>\n <Typography variant=\"overline\" color=\"text.secondary\">\n Defina o período\n </Typography>\n\n <Stack\n display=\"grid\"\n gridTemplateColumns=\"1fr 1fr\"\n alignItems=\"center\"\n gap={1.5}\n >\n <DateField\n name=\"start_date\"\n label=\"Data inicial\"\n size=\"small\"\n onChange={handleStartDateChange}\n />\n <DateField\n name=\"end_date\"\n label=\"Data final\"\n size=\"small\"\n onChange={handleEndDateChange}\n />\n </Stack>\n\n <SimpleCard\n direction={{ xs: 'column', sm: 'row' }}\n alignItems=\"center\"\n justifyContent={{ xs: 'center', sm: 'space-between' }}\n gap={{ xs: 3, sm: 0 }}\n overflow=\"hidden\"\n >\n {!isMobile ? (\n <RadioGroup\n value={selectedPeriod}\n onChange={(_, newValue) =>\n handlePeriodChange(newValue as FilterPeriod)\n }\n >\n {Object.values(FilterPeriod).map(period => (\n <FormControlLabel\n key={period}\n value={period}\n control={<Radio size=\"small\" />}\n label={periodOptions.find(o => o.value === period)?.label}\n />\n ))}\n </RadioGroup>\n ) : (\n <Autocomplete\n name=\"period\"\n value={selectedPeriod}\n onChange={handleAutocompletePeriodChange}\n options={periodOptions}\n size=\"small\"\n disableClearable\n fullWidth\n />\n )}\n\n <Divider\n orientation=\"vertical\"\n flexItem\n sx={{ display: { xs: 'none', sm: 'block' } }}\n />\n\n <DateRangeCalendar\n value={dateRange}\n onChange={handleCalendarChange}\n calendars={1}\n showDaysOutsideCurrentMonth\n fixedWeekNumber={6}\n disableFuture\n dayOfWeekFormatter={day => {\n return daysOfWeek[day.day()];\n }}\n />\n </SimpleCard>\n\n <Stack alignItems=\"flex-end\">\n <Stack direction=\"row\" alignItems=\"center\" gap={1.5}>\n <Button variant=\"outlined\" color=\"inherit\" onClick={onClose}>\n Cancelar\n </Button>\n\n <Button variant=\"contained\" type=\"submit\">\n Salvar\n </Button>\n </Stack>\n </Stack>\n </Form>\n );\n};\n\nexport default FilterDate;\n","import { styled } from '@mui/material/styles';\nimport CommonDateRangeCalendar from 'components/DateRangeCalendar';\n\nexport const DateRangeCalendar = styled(CommonDateRangeCalendar)(\n ({ theme }) => ({\n '&.MuiDateRangeCalendar-root': {\n margin: -24,\n },\n\n '& .MuiPickersCalendarHeader-label': {\n textTransform: 'capitalize',\n },\n\n [theme.breakpoints.down(400)]: {\n '& .MuiPickersCalendarHeader-root': {\n padding: theme.spacing(0, 7),\n },\n\n '& .MuiDayCalendar-header, & .MuiDayCalendar-weekContainer': {\n gap: 0,\n },\n\n '& .MuiPickersDay-root, & .MuiDateRangePickerDay-root': {\n width: 32,\n height: 32,\n },\n\n '& .MuiDayCalendar-weekDayLabel': {\n width: 32,\n height: 32,\n },\n\n '& .MuiDayCalendar-slideTransition': {\n minHeight: 210,\n },\n },\n\n [theme.breakpoints.down(350)]: {\n '& .MuiPickersDay-root, & .MuiDateRangePickerDay-root': {\n width: 28,\n height: 28,\n },\n\n '& .MuiDayCalendar-weekDayLabel': {\n width: 28,\n height: 28,\n },\n\n '& .MuiDayCalendar-slideTransition': {\n minHeight: 196,\n },\n },\n }),\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Analytics/AiSummary/index.tsx","../../../src/components/Analytics/AiSummary/Skeleton.tsx","../../../src/components/Analytics/AiSummary/styles.ts","../../../src/components/Analytics/AiSummary/Summary.tsx","../../../src/components/Analytics/AiSummary/Header.tsx","../../../src/components/Analytics/ExportButton/styles.ts","../../../src/components/Analytics/ExportButton/index.tsx","../../../src/components/Analytics/FilterDate/index.tsx","../../../src/components/Analytics/FilterDate/styles.ts"],"names":["AlertTitle","Button","Typography","Stack","MuiAlert","alpha","keyframes","styled","gradientAnimation","Alert","theme","primaryMain","primaryLight","LoadingAlert","jsx","jsxs","AiSummarySkeleton","Icon_default","Skeleton_default","memo","Header","Header_default","defaultFormatContent","text","SummaryContent","detail","formatContent","format","isHtml","Summary","open","toggleOpen","useResponsive_default","Drawer_default","Modal_default","Summary_default","Fragment","AiSummary","brief","isLoading","useToggle_default","Result_default","AiSummary_default","LoadingButton","MuiButton","ItemButton","ExportButton","onExport","isExporting","onOpen","onClose","usePopover_default","handleExport","MenuPopover_default","ExportFormat","index","ExportButton_default","useCallback","useState","useForm","Divider","FormControlLabel","Radio","RadioGroup","dayjs","DateRangeCalendar","DateRangeCalendar_default","daysOfWeek","FilterDate","value","onSave","isMobile","methods","handleSubmit","setValue","getValues","selectedPeriod","setSelectedPeriod","dateRange","setDateRange","handlePeriodChange","period","dates","getPeriodDates","handleCalendarChange","newRange","matchingPeriod","findMatchingPeriod","handleStartDateChange","date","endDate","handleEndDateChange","startDate","handleAutocompletePeriodChange","newValue","onSubmit","formData","toFilterDateState","Form_default","DateField_default","SimpleCard_default","Autocomplete_default","periodOptions","_","FilterPeriod","o","day","FilterDate_default"],"mappings":"s+BAAA,OAAOA,OAAgB,2BACvB,OAAOC,OAAY,uBACnB,OAAOC,OAAgB,2BCFvB,OAAOF,OAAgB,2BACvB,OAAOG,OAAW,sBCDlB,OAAOC,OAAc,sBACrB,OAAS,SAAAC,EAAO,aAAAC,GAAW,UAAAC,MAAc,uBAEzC,IAAMC,GAAoBF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASbG,EAAQF,EAAOH,EAAQ,EAAE,CAAC,CAAE,MAAAM,CAAM,IAAM,CACnD,IAAMC,EAAcD,EAAM,QAAQ,QAAQ,KACpCE,EAAeP,EAAMM,EAAa,EAAG,EAE3C,MAAO,CACL,SAAU,WAEV,gBAAiBN,EAAMK,EAAM,QAAQ,QAAQ,KAAM,GAAI,EACvD,OAAQ,wBAER,aAAc,EAEd,YAAa,CACX,QAAS,KACT,SAAU,WACV,MAAO,EACP,aAAc,UACd,QAAS,MACT,WAAY,0BAA0BC,SAAmBC,UAAqBD,UAC9E,WACE,mEACF,oBAAqB,MACrB,KAAM,mEACN,cAAe,UACf,cAAe,MACjB,EAEA,SAAU,SAEV,sBAAuB,CACrB,MAAO,MACT,CACF,CACF,CAAC,EAEYE,EAAeN,EAAOE,CAAK,E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ACF,EACF,GACF,CAEJ,EAEO0G,GAAQvC","sourcesContent":["import AlertTitle from '@mui/material/AlertTitle';\nimport Button from '@mui/material/Button';\nimport Typography from '@mui/material/Typography';\n\nimport Icon from 'components/Icon';\nimport Result from 'components/Result';\nimport useToggle from 'hooks/useToggle';\n\nimport { AiSummaryProps } from './props';\nimport AiSummarySkeleton from './Skeleton';\nimport { Alert } from './styles';\nimport Summary from './Summary';\n\nconst AiSummary = ({\n brief,\n detail,\n isLoading = false,\n formatContent,\n}: AiSummaryProps) => {\n const [open, toggleOpen] = useToggle(false);\n\n const hasSummary = !!brief && !!detail;\n\n if (!hasSummary && !isLoading) return null;\n\n return (\n <>\n <Result isLoading={isLoading} loading={<AiSummarySkeleton />}>\n <Alert\n icon={<Icon icon=\"AI_08_SOLID_ROUND\" color=\"primary.main\" />}\n action={\n <Button\n variant={isLoading ? 'contained' : 'text'}\n color=\"primary\"\n size=\"small\"\n onClick={toggleOpen}\n >\n Ver mais\n </Button>\n }\n >\n <AlertTitle variant=\"subtitle1\" color=\"text.primary\">\n Resumo inteligente\n </AlertTitle>\n\n <Typography variant=\"body2\" color=\"text.secondary\">\n {brief}\n </Typography>\n </Alert>\n </Result>\n\n <Summary\n open={open}\n toggleOpen={toggleOpen}\n detail={detail ?? ''}\n formatContent={formatContent}\n />\n </>\n );\n};\n\nexport default AiSummary;\n","import AlertTitle from '@mui/material/AlertTitle';\nimport Stack from '@mui/material/Stack';\n\nimport Icon from 'components/Icon';\nimport Skeleton from 'components/Skeleton';\n\nimport { LoadingAlert } from './styles';\n\nconst AiSummarySkeleton = () => (\n <LoadingAlert\n icon={<Icon icon=\"AI_08_SOLID_ROUND\" color=\"primary.main\" />}\n action={<Skeleton variant=\"text\" width={100} height={30} />}\n >\n <AlertTitle variant=\"subtitle1\" color=\"text.primary\">\n Resumo inteligente\n </AlertTitle>\n\n <Stack gap={0.5}>\n <Skeleton variant=\"text\" width=\"100%\" height={30} />\n <Skeleton variant=\"text\" width=\"80%\" height={30} />\n </Stack>\n </LoadingAlert>\n);\n\nexport default AiSummarySkeleton;\n","import MuiAlert from '@mui/material/Alert';\nimport { alpha, keyframes, styled } from '@mui/material/styles';\n\nconst gradientAnimation = keyframes`\n 0% {\n background-position: 0% 50%;\n }\n 100% {\n background-position: 200% 50%;\n }\n`;\n\nexport const Alert = styled(MuiAlert)(({ theme }) => {\n const primaryMain = theme.palette.primary.main;\n const primaryLight = alpha(primaryMain, 0.1);\n\n return {\n position: 'relative',\n\n backgroundColor: alpha(theme.palette.primary.main, 0.01),\n border: '1px solid transparent',\n\n borderRadius: 8,\n\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n borderRadius: 'inherit',\n padding: '1px',\n background: `linear-gradient(90deg, ${primaryMain} 0%, ${primaryLight} 50%, ${primaryMain} 100%)`,\n WebkitMask:\n 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n WebkitMaskComposite: 'xor',\n mask: 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n maskComposite: 'exclude',\n pointerEvents: 'none',\n },\n\n overflow: 'hidden',\n\n '& .MuiAlert-message': {\n width: '100%',\n },\n };\n});\n\nexport const LoadingAlert = styled(Alert)({\n border: '1px solid transparent',\n\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n inset: 0,\n borderRadius: 'inherit',\n padding: '1px',\n background: 'linear-gradient(90deg, #e01cd5 0%, #1CB5E0 50%, #e01cd5 100%)',\n backgroundSize: '200% auto',\n WebkitMask:\n 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n WebkitMaskComposite: 'xor',\n mask: 'linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)',\n maskComposite: 'exclude',\n pointerEvents: 'none',\n animation: `${gradientAnimation} 2s linear infinite`,\n },\n});\n","import { memo } from 'react';\nimport Typography from '@mui/material/Typography';\n\nimport Drawer from 'components/Drawer';\nimport Modal from 'components/Modal';\nimport useResponsive from 'hooks/useResponsive';\n\nimport Header from './Header';\nimport { SummaryContentProps, SummaryProps } from './props';\n\nconst defaultFormatContent = (text: string) => text;\n\nconst SummaryContent = ({ detail, formatContent }: SummaryContentProps) => {\n const format = formatContent ?? defaultFormatContent;\n const isHtml = formatContent != null;\n\n return (\n <Typography variant=\"body2\" color=\"text.primary\">\n {isHtml ? (\n <span dangerouslySetInnerHTML={{ __html: format(detail) }} />\n ) : (\n detail\n )}\n </Typography>\n );\n};\n\nconst Summary = ({ open, toggleOpen, detail, formatContent }: SummaryProps) => {\n const isMobile = useResponsive('down', 'sm');\n\n if (isMobile) {\n return (\n <Drawer\n open={open}\n onClose={toggleOpen}\n headerTitle={<Header />}\n headerProps={{\n direction: 'row-reverse',\n sx: { '& > :last-child': { minWidth: 0, overflow: 'hidden' } },\n }}\n >\n <SummaryContent detail={detail} formatContent={formatContent} />\n </Drawer>\n );\n }\n\n return (\n <Modal\n open={open}\n onClose={toggleOpen}\n dialogTitle={<Header />}\n dialogTitleProps={{ sx: { flex: 1, overflow: 'hidden' } }}\n maxWidth=\"md\"\n fullWidth\n scroll=\"paper\"\n >\n <SummaryContent detail={detail} formatContent={formatContent} />\n </Modal>\n );\n};\n\nexport default memo(Summary);\n","import Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\n\nimport Icon from 'components/Icon';\n\nconst Header = () => (\n <Stack direction=\"row\" alignItems=\"center\" gap={1.5}>\n <Icon icon=\"AI_08_SOLID_ROUND\" color=\"primary.main\" sx={{ flexGrow: 0 }} />\n\n <Stack>\n <Typography variant=\"subtitle1\" color=\"text.primary\">\n Resumo inteligente\n </Typography>\n\n <Typography variant=\"body2\" color=\"text.secondary\">\n Gerado com base nos dados consolidados da página.\n </Typography>\n </Stack>\n </Stack>\n);\n\nexport default Header;\n","import LoadingButton from '@mui/lab/LoadingButton';\nimport MuiButton from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nexport const Button = styled(MuiButton)(({ theme }) => ({\n color: theme.palette.text.secondary,\n\n '&:hover': {\n background: theme.palette.action.hover,\n },\n}));\n\nexport const ItemButton = styled(LoadingButton)(({ theme }) => ({\n justifyContent: 'flex-start',\n\n color: theme.palette.text.secondary,\n fontWeight: 400,\n\n '&:hover': {\n background: theme.palette.action.hover,\n },\n}));\n","import Icon from 'components/Icon';\nimport MenuPopover from 'components/MenuPopover';\nimport usePopover from 'hooks/usePopover';\nimport { ExportFormat } from 'utils/analytics';\n\nimport { ExportButtonProps } from './props';\nimport { Button, ItemButton } from './styles';\n\nconst ExportButton = ({ onExport, isExporting }: ExportButtonProps) => {\n const { open, onOpen, onClose } = usePopover();\n\n const handleExport = (format: ExportFormat) => {\n onExport(format);\n onClose();\n };\n\n return (\n <>\n <Button\n variant=\"text\"\n startIcon={<Icon icon=\"DOWNLOAD\" />}\n color=\"primary\"\n size=\"small\"\n onClick={onOpen}\n disabled={isExporting}\n >\n {isExporting ? 'Exportando...' : 'Exportar'}\n </Button>\n\n <MenuPopover\n open={open}\n onClose={onClose}\n disabledArrow\n sx={{ p: 1, width: 180 }}\n >\n {Object.values(ExportFormat).map((format, index) => (\n <ItemButton\n key={index}\n variant=\"text\"\n onClick={() => handleExport(format)}\n loading={isExporting}\n fullWidth\n data-testid={`export-button-${index}`}\n >\n {format}\n </ItemButton>\n ))}\n </MenuPopover>\n </>\n );\n};\n\nexport default ExportButton;\n","import { useCallback, useState } from 'react';\nimport { useForm } from 'react-hook-form';\nimport Button from '@mui/material/Button';\nimport Divider from '@mui/material/Divider';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Radio from '@mui/material/Radio';\nimport RadioGroup from '@mui/material/RadioGroup';\nimport Stack from '@mui/material/Stack';\nimport Typography from '@mui/material/Typography';\nimport dayjs from 'dayjs';\n\nimport Autocomplete from 'components/Autocomplete';\nimport DateField from 'components/form/DateField';\nimport Form from 'components/form/Form';\nimport SimpleCard from 'components/SimpleCard';\nimport useResponsive from 'hooks/useResponsive';\nimport { FilterPeriod } from 'utils/analytics';\nimport {\n findMatchingPeriod,\n getPeriodDates,\n periodOptions,\n toFilterDateState,\n} from 'utils/periodDates';\n\nimport { FilterDateForm, FilterDateProps } from './props';\nimport { DateRangeCalendar } from './styles';\n\nconst daysOfWeek = ['D', 'S', 'T', 'Q', 'Q', 'S', 'S'];\n\nconst FilterDate = ({ value, onSave, onClose }: FilterDateProps) => {\n const isMobile = useResponsive('down', 'sm');\n\n const methods = useForm<FilterDateForm>({\n defaultValues: {\n period: value.period,\n start_date: value.start_date ? dayjs(value.start_date).toDate() : null,\n end_date: value.end_date ? dayjs(value.end_date).toDate() : null,\n },\n });\n\n const { handleSubmit, setValue, getValues } = methods;\n\n const [selectedPeriod, setSelectedPeriod] = useState<FilterPeriod>(\n value.period,\n );\n\n const [dateRange, setDateRange] = useState<[Date | null, Date | null]>(() => [\n value.start_date ? dayjs(value.start_date).toDate() : null,\n value.end_date ? dayjs(value.end_date).toDate() : null,\n ]);\n\n const handlePeriodChange = useCallback(\n (period: FilterPeriod) => {\n const dates = getPeriodDates(period);\n\n setSelectedPeriod(period);\n setDateRange([dates.start_date, dates.end_date]);\n\n setValue('period', period);\n setValue('start_date', dates.start_date);\n setValue('end_date', dates.end_date);\n },\n [setValue],\n );\n\n const handleCalendarChange = useCallback(\n (newRange: [Date | null, Date | null]) => {\n setDateRange(newRange);\n\n if (newRange[0]) setValue('start_date', newRange[0]);\n if (newRange[1]) setValue('end_date', newRange[1]);\n\n if (newRange[0] && newRange[1]) {\n const matchingPeriod = findMatchingPeriod(newRange[0], newRange[1]);\n setSelectedPeriod(matchingPeriod);\n setValue('period', matchingPeriod);\n }\n },\n [setValue],\n );\n\n const handleStartDateChange = useCallback(\n (date: Date) => {\n setValue('start_date', date);\n\n const endDate = getValues('end_date');\n\n if (date && endDate) {\n const newRange: [Date, Date] = [date, endDate];\n setDateRange(newRange);\n const matchingPeriod = findMatchingPeriod(newRange[0], newRange[1]);\n setSelectedPeriod(matchingPeriod);\n setValue('period', matchingPeriod);\n }\n },\n [getValues, setValue],\n );\n\n const handleEndDateChange = useCallback(\n (date: Date) => {\n setValue('end_date', date);\n\n const startDate = getValues('start_date');\n\n if (startDate && date) {\n const newRange: [Date, Date] = [startDate, date];\n setDateRange(newRange);\n const matchingPeriod = findMatchingPeriod(newRange[0], newRange[1]);\n setSelectedPeriod(matchingPeriod);\n setValue('period', matchingPeriod);\n }\n },\n [getValues, setValue],\n );\n\n const handleAutocompletePeriodChange = useCallback(\n (newValue: string | string[] | null) => {\n if (newValue && typeof newValue === 'string') {\n handlePeriodChange(newValue as FilterPeriod);\n }\n },\n [handlePeriodChange],\n );\n\n const onSubmit = useCallback(\n (formData: FilterDateForm) => {\n onSave(toFilterDateState(formData));\n },\n [onSave],\n );\n\n return (\n <Form methods={methods} onSubmit={handleSubmit(onSubmit)} gap={3}>\n <Typography variant=\"overline\" color=\"text.secondary\">\n Defina o período\n </Typography>\n\n <Stack\n display=\"grid\"\n gridTemplateColumns=\"1fr 1fr\"\n alignItems=\"center\"\n gap={1.5}\n >\n <DateField\n name=\"start_date\"\n label=\"Data inicial\"\n size=\"small\"\n onChange={handleStartDateChange}\n />\n <DateField\n name=\"end_date\"\n label=\"Data final\"\n size=\"small\"\n onChange={handleEndDateChange}\n />\n </Stack>\n\n <SimpleCard\n direction={{ xs: 'column', sm: 'row' }}\n alignItems=\"center\"\n justifyContent={{ xs: 'center', sm: 'space-between' }}\n gap={{ xs: 3, sm: 0 }}\n overflow=\"hidden\"\n >\n {!isMobile ? (\n <RadioGroup\n value={selectedPeriod}\n onChange={(_, newValue) =>\n handlePeriodChange(newValue as FilterPeriod)\n }\n >\n {Object.values(FilterPeriod).map(period => (\n <FormControlLabel\n key={period}\n value={period}\n control={<Radio size=\"small\" />}\n label={periodOptions.find(o => o.value === period)?.label}\n />\n ))}\n </RadioGroup>\n ) : (\n <Autocomplete\n name=\"period\"\n value={selectedPeriod}\n onChange={handleAutocompletePeriodChange}\n options={periodOptions}\n size=\"small\"\n disableClearable\n fullWidth\n />\n )}\n\n <Divider\n orientation=\"vertical\"\n flexItem\n sx={{ display: { xs: 'none', sm: 'block' } }}\n />\n\n <DateRangeCalendar\n value={dateRange}\n onChange={handleCalendarChange}\n calendars={1}\n showDaysOutsideCurrentMonth\n fixedWeekNumber={6}\n disableFuture\n dayOfWeekFormatter={day => {\n return daysOfWeek[day.day()];\n }}\n />\n </SimpleCard>\n\n <Stack alignItems=\"flex-end\">\n <Stack direction=\"row\" alignItems=\"center\" gap={1.5}>\n <Button variant=\"outlined\" color=\"inherit\" onClick={onClose}>\n Cancelar\n </Button>\n\n <Button variant=\"contained\" type=\"submit\">\n Salvar\n </Button>\n </Stack>\n </Stack>\n </Form>\n );\n};\n\nexport default FilterDate;\n","import { styled } from '@mui/material/styles';\nimport CommonDateRangeCalendar from 'components/DateRangeCalendar';\n\nexport const DateRangeCalendar = styled(CommonDateRangeCalendar)(\n ({ theme }) => ({\n '&.MuiDateRangeCalendar-root': {\n margin: -24,\n },\n\n '& .MuiPickersCalendarHeader-label': {\n textTransform: 'capitalize',\n },\n\n [theme.breakpoints.down(400)]: {\n '& .MuiPickersCalendarHeader-root': {\n padding: theme.spacing(0, 7),\n },\n\n '& .MuiDayCalendar-header, & .MuiDayCalendar-weekContainer': {\n gap: 0,\n },\n\n '& .MuiPickersDay-root, & .MuiDateRangePickerDay-root': {\n width: 32,\n height: 32,\n },\n\n '& .MuiDayCalendar-weekDayLabel': {\n width: 32,\n height: 32,\n },\n\n '& .MuiDayCalendar-slideTransition': {\n minHeight: 210,\n },\n },\n\n [theme.breakpoints.down(350)]: {\n '& .MuiPickersDay-root, & .MuiDateRangePickerDay-root': {\n width: 28,\n height: 28,\n },\n\n '& .MuiDayCalendar-weekDayLabel': {\n width: 28,\n height: 28,\n },\n\n '& .MuiDayCalendar-slideTransition': {\n minHeight: 196,\n },\n },\n }),\n);\n"]}
|
|
@@ -11,7 +11,7 @@ interface ImageContainerProps {
|
|
|
11
11
|
|
|
12
12
|
declare const Avatar: react.MemoExoticComponent<react.ForwardRefExoticComponent<Omit<PropsWithChildren<ImageContainerProps & _mui_material_Avatar.AvatarOwnProps & _mui_material_Avatar.AvatarSlotsAndSlotProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
13
|
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
|
|
14
|
-
}, "children" | "className" | "style" | "classes" | "sx" | "variant" | "slots" | "slotProps" | "
|
|
14
|
+
}, "children" | "className" | "style" | "classes" | "sx" | "variant" | "slots" | "slotProps" | "sizes" | "alt" | "src" | "srcSet" | "imgProps"> & {
|
|
15
15
|
component?: react.ElementType<any, keyof react.JSX.IntrinsicElements> | undefined;
|
|
16
16
|
}>, "ref"> & react.RefAttributes<HTMLDivElement>>>;
|
|
17
17
|
|
|
@@ -90,7 +90,7 @@ declare const SelectionOverlay: _emotion_styled.StyledComponent<_mui_material_St
|
|
|
90
90
|
}, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_material_Stack.StackOwnProps> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
|
|
91
91
|
declare const SelectionCount: _emotion_styled.StyledComponent<_mui_material_Typography.TypographyOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
92
92
|
ref?: ((instance: HTMLSpanElement | null) => void) | react.RefObject<HTMLSpanElement> | null | undefined;
|
|
93
|
-
}, "fontFamily" | "children" | "pt" | "className" | "style" | "classes" | "sx" | "variant" | "border" | "boxShadow" | "
|
|
93
|
+
}, "typography" | "zIndex" | "fontFamily" | "fontWeight" | "children" | "pt" | "className" | "style" | "classes" | "sx" | "variant" | "border" | "boxShadow" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "p" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
|
|
94
94
|
declare const SelectionActions: _emotion_styled.StyledComponent<_mui_material_Stack.StackOwnProps & _mui_material_OverridableComponent.CommonProps & Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
95
95
|
ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
|
|
96
96
|
}, keyof _mui_material_OverridableComponent.CommonProps | keyof _mui_material_Stack.StackOwnProps> & _mui_system.MUIStyledCommonProps<_mui_material_styles.Theme>, {}, {}>;
|
|
@@ -12,7 +12,6 @@ declare const useSnackbar: () => {
|
|
|
12
12
|
custom: (jsx: (id: string | number) => react.ReactElement<any, string | react.JSXElementConstructor<any>>, data?: ExternalToast | undefined) => string | number;
|
|
13
13
|
message: (message: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | react.ReactPortal | (() => ReactNode) | null | undefined, data?: ExternalToast | undefined) => string | number;
|
|
14
14
|
promise: <ToastData>(promise: Promise<ToastData> | (() => Promise<ToastData>), data?: ({
|
|
15
|
-
cancel?: ReactNode | sonner.Action;
|
|
16
15
|
className?: string | undefined;
|
|
17
16
|
style?: react.CSSProperties | undefined;
|
|
18
17
|
position?: ("top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right") | undefined;
|
|
@@ -21,6 +20,7 @@ declare const useSnackbar: () => {
|
|
|
21
20
|
icon?: ReactNode;
|
|
22
21
|
duration?: number | undefined;
|
|
23
22
|
onDismiss?: ((toast: sonner.ToastT) => void) | undefined;
|
|
23
|
+
cancel?: ReactNode | sonner.Action;
|
|
24
24
|
richColors?: boolean | undefined;
|
|
25
25
|
invert?: boolean | undefined;
|
|
26
26
|
closeButton?: boolean | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CustomShadows } from './index-
|
|
2
|
-
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-
|
|
1
|
+
import { C as CustomShadows } from './index-5a5e5dc8.js';
|
|
2
|
+
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from './index-5a5e5dc8.js';
|
|
3
3
|
export { S as SettingsContextValue, _ as SettingsProvider, T as ThemeProviderProps, u as useSettingsContext } from './settings-provider-38d09283.js';
|
|
4
4
|
export { THEME_CONFIG, default as ThemeProvider } from './theme/theme-provider.js';
|
|
5
5
|
import { S as SettingsState } from './settings-583c107c.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-
|
|
1
|
+
export { d as ColorType, k as action, j as background, l as basePalette, o as colorSchemes, h as common, c as components, a as createShadowColor, b as customShadows, n as darkPalette, r as defaultFont, f as error, g as grey, i as info, m as lightPalette, p as primary, u as primaryFont, s as secondary, v as secondaryFont, q as shadows, e as success, t as text, x as typography, w as warning } from '../../index-5a5e5dc8.js';
|
|
2
2
|
import '@mui/lab/TimelineConnector';
|
|
3
3
|
import '@mui/system';
|
|
4
4
|
import '@mui/lab/TimelineDot';
|
|
@@ -173,7 +173,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
173
173
|
float?: csstype.Property.Float | readonly NonNullable<csstype.Property.Float | undefined>[] | readonly csstype.Property.Float[] | undefined;
|
|
174
174
|
floodColor?: readonly string[] | csstype.Property.FloodColor | readonly csstype.Property.FloodColor[] | undefined;
|
|
175
175
|
floodOpacity?: readonly ((string & {}) | csstype.Globals)[] | csstype.Property.FloodOpacity | readonly NonNullable<csstype.Property.FloodOpacity | undefined>[] | undefined;
|
|
176
|
-
fontFamily?:
|
|
176
|
+
fontFamily?: csstype.Property.FontFamily | readonly string[] | readonly csstype.Property.FontFamily[] | undefined;
|
|
177
177
|
fontFeatureSettings?: readonly string[] | csstype.Property.FontFeatureSettings | readonly csstype.Property.FontFeatureSettings[] | undefined;
|
|
178
178
|
fontKerning?: csstype.Property.FontKerning | readonly NonNullable<csstype.Property.FontKerning | undefined>[] | readonly csstype.Property.FontKerning[] | undefined;
|
|
179
179
|
fontLanguageOverride?: readonly string[] | csstype.Property.FontLanguageOverride | readonly csstype.Property.FontLanguageOverride[] | undefined;
|
|
@@ -197,7 +197,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
197
197
|
fontVariantNumeric?: readonly string[] | csstype.Property.FontVariantNumeric | readonly csstype.Property.FontVariantNumeric[] | undefined;
|
|
198
198
|
fontVariantPosition?: csstype.Property.FontVariantPosition | readonly NonNullable<csstype.Property.FontVariantPosition | undefined>[] | readonly csstype.Property.FontVariantPosition[] | undefined;
|
|
199
199
|
fontVariationSettings?: readonly string[] | csstype.Property.FontVariationSettings | readonly csstype.Property.FontVariationSettings[] | undefined;
|
|
200
|
-
fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly (
|
|
200
|
+
fontWeight?: csstype.Property.FontWeight | readonly NonNullable<csstype.Property.FontWeight | undefined>[] | readonly ((string & {}) | csstype.Globals | "bold" | "normal" | "bolder" | "lighter")[] | undefined;
|
|
201
201
|
fontWidth?: readonly string[] | csstype.Property.FontWidth | readonly csstype.Property.FontWidth[] | undefined;
|
|
202
202
|
forcedColorAdjust?: csstype.Property.ForcedColorAdjust | readonly NonNullable<csstype.Property.ForcedColorAdjust | undefined>[] | readonly csstype.Property.ForcedColorAdjust[] | undefined;
|
|
203
203
|
gridAutoColumns?: readonly (string | (string & {}))[] | csstype.Property.GridAutoColumns<string | number> | readonly NonNullable<csstype.Property.GridAutoColumns<string | number> | undefined>[] | undefined;
|
|
@@ -460,9 +460,9 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
460
460
|
x?: readonly (string | (string & {}))[] | csstype.Property.X<string | number> | readonly NonNullable<csstype.Property.X<string | number> | undefined>[] | undefined;
|
|
461
461
|
y?: readonly (string | (string & {}))[] | csstype.Property.Y<string | number> | readonly NonNullable<csstype.Property.Y<string | number> | undefined>[] | undefined;
|
|
462
462
|
zIndex?: readonly ((string & {}) | csstype.Globals | "auto")[] | csstype.Property.ZIndex | readonly NonNullable<csstype.Property.ZIndex | undefined>[] | undefined;
|
|
463
|
-
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly (
|
|
463
|
+
zoom?: csstype.Property.Zoom | readonly NonNullable<csstype.Property.Zoom | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reset")[] | undefined;
|
|
464
464
|
all?: csstype.Globals | readonly NonNullable<csstype.Globals | undefined>[] | readonly csstype.Globals[] | undefined;
|
|
465
|
-
animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly (
|
|
465
|
+
animation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
466
466
|
animationRange?: readonly (string | (string & {}))[] | csstype.Property.AnimationRange<string | number> | readonly NonNullable<csstype.Property.AnimationRange<string | number> | undefined>[] | undefined;
|
|
467
467
|
background?: readonly (string | (string & {}))[] | csstype.Property.Background<string | number> | readonly NonNullable<csstype.Property.Background<string | number> | undefined>[] | undefined;
|
|
468
468
|
border?: readonly (string | (string & {}))[] | csstype.Property.Border<string | number> | readonly NonNullable<csstype.Property.Border<string | number> | undefined>[] | undefined;
|
|
@@ -474,7 +474,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
474
474
|
borderBlockWidth?: readonly (string | (string & {}))[] | csstype.Property.BorderBlockWidth<string | number> | readonly NonNullable<csstype.Property.BorderBlockWidth<string | number> | undefined>[] | undefined;
|
|
475
475
|
borderBottom?: readonly (string | (string & {}))[] | csstype.Property.BorderBottom<string | number> | readonly NonNullable<csstype.Property.BorderBottom<string | number> | undefined>[] | undefined;
|
|
476
476
|
borderColor?: readonly string[] | csstype.Property.BorderColor | readonly csstype.Property.BorderColor[] | undefined;
|
|
477
|
-
borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly (
|
|
477
|
+
borderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
478
478
|
borderInline?: readonly (string | (string & {}))[] | csstype.Property.BorderInline<string | number> | readonly NonNullable<csstype.Property.BorderInline<string | number> | undefined>[] | undefined;
|
|
479
479
|
borderInlineColor?: readonly string[] | csstype.Property.BorderInlineColor | readonly csstype.Property.BorderInlineColor[] | undefined;
|
|
480
480
|
borderInlineEnd?: readonly (string | (string & {}))[] | csstype.Property.BorderInlineEnd<string | number> | readonly NonNullable<csstype.Property.BorderInlineEnd<string | number> | undefined>[] | undefined;
|
|
@@ -509,7 +509,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
509
509
|
marginBlock?: readonly (string | (string & {}))[] | csstype.Property.MarginBlock<string | number> | readonly NonNullable<csstype.Property.MarginBlock<string | number> | undefined>[] | undefined;
|
|
510
510
|
marginInline?: readonly (string | (string & {}))[] | csstype.Property.MarginInline<string | number> | readonly NonNullable<csstype.Property.MarginInline<string | number> | undefined>[] | undefined;
|
|
511
511
|
mask?: readonly (string | (string & {}))[] | csstype.Property.Mask<string | number> | readonly NonNullable<csstype.Property.Mask<string | number> | undefined>[] | undefined;
|
|
512
|
-
maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly (
|
|
512
|
+
maskBorder?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
|
|
513
513
|
motion?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
|
|
514
514
|
offset?: readonly (string | (string & {}))[] | csstype.Property.Offset<string | number> | readonly NonNullable<csstype.Property.Offset<string | number> | undefined>[] | undefined;
|
|
515
515
|
outline?: readonly (string | (string & {}))[] | csstype.Property.Outline<string | number> | readonly NonNullable<csstype.Property.Outline<string | number> | undefined>[] | undefined;
|
|
@@ -758,8 +758,8 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
758
758
|
WebkitUserModify?: csstype.Property.WebkitUserModify | readonly NonNullable<csstype.Property.WebkitUserModify | undefined>[] | readonly csstype.Property.WebkitUserModify[] | undefined;
|
|
759
759
|
WebkitUserSelect?: csstype.Property.WebkitUserSelect | readonly NonNullable<csstype.Property.WebkitUserSelect | undefined>[] | readonly csstype.Property.WebkitUserSelect[] | undefined;
|
|
760
760
|
WebkitWritingMode?: csstype.Property.WritingMode | readonly NonNullable<csstype.Property.WritingMode | undefined>[] | readonly csstype.Property.WritingMode[] | undefined;
|
|
761
|
-
MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly (
|
|
762
|
-
MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly (
|
|
761
|
+
MozAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
762
|
+
MozBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
763
763
|
MozColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
|
|
764
764
|
MozColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
|
|
765
765
|
MozOutlineRadius?: readonly (string | (string & {}))[] | csstype.Property.MozOutlineRadius<string | number> | readonly NonNullable<csstype.Property.MozOutlineRadius<string | number> | undefined>[] | undefined;
|
|
@@ -771,16 +771,16 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
771
771
|
msScrollSnapX?: readonly string[] | csstype.Property.MsScrollSnapX | readonly csstype.Property.MsScrollSnapX[] | undefined;
|
|
772
772
|
msScrollSnapY?: readonly string[] | csstype.Property.MsScrollSnapY | readonly csstype.Property.MsScrollSnapY[] | undefined;
|
|
773
773
|
msTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
|
|
774
|
-
WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly (
|
|
774
|
+
WebkitAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
775
775
|
WebkitBorderBefore?: readonly (string | (string & {}))[] | csstype.Property.WebkitBorderBefore<string | number> | readonly NonNullable<csstype.Property.WebkitBorderBefore<string | number> | undefined>[] | undefined;
|
|
776
|
-
WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly (
|
|
776
|
+
WebkitBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
777
777
|
WebkitBorderRadius?: readonly (string | (string & {}))[] | csstype.Property.BorderRadius<string | number> | readonly NonNullable<csstype.Property.BorderRadius<string | number> | undefined>[] | undefined;
|
|
778
778
|
WebkitColumnRule?: readonly (string | (string & {}))[] | csstype.Property.ColumnRule<string | number> | readonly NonNullable<csstype.Property.ColumnRule<string | number> | undefined>[] | undefined;
|
|
779
779
|
WebkitColumns?: readonly (string | (string & {}))[] | csstype.Property.Columns<string | number> | readonly NonNullable<csstype.Property.Columns<string | number> | undefined>[] | undefined;
|
|
780
780
|
WebkitFlex?: readonly (string | (string & {}))[] | csstype.Property.Flex<string | number> | readonly NonNullable<csstype.Property.Flex<string | number> | undefined>[] | undefined;
|
|
781
781
|
WebkitFlexFlow?: readonly string[] | csstype.Property.FlexFlow | readonly csstype.Property.FlexFlow[] | undefined;
|
|
782
782
|
WebkitMask?: readonly (string | (string & {}))[] | csstype.Property.WebkitMask<string | number> | readonly NonNullable<csstype.Property.WebkitMask<string | number> | undefined>[] | undefined;
|
|
783
|
-
WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly (
|
|
783
|
+
WebkitMaskBoxImage?: csstype.Property.MaskBorder | readonly NonNullable<csstype.Property.MaskBorder | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "alpha" | "luminance" | "stretch")[] | undefined;
|
|
784
784
|
WebkitTextEmphasis?: readonly string[] | csstype.Property.TextEmphasis | readonly csstype.Property.TextEmphasis[] | undefined;
|
|
785
785
|
WebkitTextStroke?: readonly (string | (string & {}))[] | csstype.Property.WebkitTextStroke<string | number> | readonly NonNullable<csstype.Property.WebkitTextStroke<string | number> | undefined>[] | undefined;
|
|
786
786
|
WebkitTransition?: readonly string[] | csstype.Property.Transition<string & {}> | readonly csstype.Property.Transition<string & {}>[] | undefined;
|
|
@@ -861,7 +861,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
861
861
|
MozUserFocus?: csstype.Property.MozUserFocus | readonly NonNullable<csstype.Property.MozUserFocus | undefined>[] | readonly csstype.Property.MozUserFocus[] | undefined;
|
|
862
862
|
MozUserInput?: csstype.Property.MozUserInput | readonly NonNullable<csstype.Property.MozUserInput | undefined>[] | readonly csstype.Property.MozUserInput[] | undefined;
|
|
863
863
|
msImeMode?: csstype.Property.ImeMode | readonly NonNullable<csstype.Property.ImeMode | undefined>[] | readonly csstype.Property.ImeMode[] | undefined;
|
|
864
|
-
OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly (
|
|
864
|
+
OAnimation?: csstype.Property.Animation<string & {}> | readonly NonNullable<csstype.Property.Animation<string & {}> | undefined>[] | readonly ((string & {}) | csstype.Globals | "normal" | "reverse" | "none" | "auto" | "alternate" | "alternate-reverse" | "backwards" | "both" | "forwards" | "infinite" | "paused" | "running" | "ease" | "ease-in" | "ease-in-out" | "ease-out" | "step-end" | "step-start" | "linear")[] | undefined;
|
|
865
865
|
OAnimationDelay?: readonly string[] | csstype.Property.AnimationDelay<string & {}> | readonly csstype.Property.AnimationDelay<string & {}>[] | undefined;
|
|
866
866
|
OAnimationDirection?: readonly string[] | csstype.Property.AnimationDirection | readonly csstype.Property.AnimationDirection[] | undefined;
|
|
867
867
|
OAnimationDuration?: readonly string[] | csstype.Property.AnimationDuration<string & {}> | readonly csstype.Property.AnimationDuration<string & {}>[] | undefined;
|
|
@@ -871,7 +871,7 @@ declare function paper({ theme, color, dropdown }: PaperProps): {
|
|
|
871
871
|
OAnimationPlayState?: readonly string[] | csstype.Property.AnimationPlayState | readonly csstype.Property.AnimationPlayState[] | undefined;
|
|
872
872
|
OAnimationTimingFunction?: readonly string[] | csstype.Property.AnimationTimingFunction | readonly csstype.Property.AnimationTimingFunction[] | undefined;
|
|
873
873
|
OBackgroundSize?: readonly (string | (string & {}))[] | csstype.Property.BackgroundSize<string | number> | readonly NonNullable<csstype.Property.BackgroundSize<string | number> | undefined>[] | undefined;
|
|
874
|
-
OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly (
|
|
874
|
+
OBorderImage?: csstype.Property.BorderImage | readonly NonNullable<csstype.Property.BorderImage | undefined>[] | readonly ((string & {}) | csstype.Globals | "repeat" | "none" | "round" | "space" | "stretch")[] | undefined;
|
|
875
875
|
OObjectFit?: csstype.Property.ObjectFit | readonly NonNullable<csstype.Property.ObjectFit | undefined>[] | readonly csstype.Property.ObjectFit[] | undefined;
|
|
876
876
|
OObjectPosition?: readonly (string | (string & {}))[] | csstype.Property.ObjectPosition<string | number> | readonly NonNullable<csstype.Property.ObjectPosition<string | number> | undefined>[] | undefined;
|
|
877
877
|
OTabSize?: readonly (string | (string & {}))[] | csstype.Property.TabSize<string | number> | readonly NonNullable<csstype.Property.TabSize<string | number> | undefined>[] | undefined;
|
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
DAILY = "DAILY"
|
|
4
|
-
}
|
|
5
|
-
declare const VIEW_MODE_LABELS: Record<ViewMode, string>;
|
|
6
|
-
declare enum ExportFormat {
|
|
7
|
-
XLSX = "XLSX",
|
|
8
|
-
PDF = "PDF"
|
|
9
|
-
}
|
|
10
|
-
declare enum FilterPeriod {
|
|
11
|
-
TODAY = "TODAY",
|
|
12
|
-
YESTERDAY = "YESTERDAY",
|
|
13
|
-
LAST_7_DAYS = "LAST_7_DAYS",
|
|
14
|
-
LAST_28_DAYS = "LAST_28_DAYS",
|
|
15
|
-
LAST_90_DAYS = "LAST_90_DAYS",
|
|
16
|
-
LAST_WEEK = "LAST_WEEK",
|
|
17
|
-
LAST_MONTH = "LAST_MONTH",
|
|
18
|
-
THIS_MONTH = "THIS_MONTH",
|
|
19
|
-
THIS_YEAR = "THIS_YEAR",
|
|
20
|
-
OTHER = "OTHER"
|
|
21
|
-
}
|
|
22
|
-
declare const FILTER_PERIOD_LABELS: Record<FilterPeriod, string>;
|
|
1
|
+
import { FilterPeriod } from '../utils/analytics.js';
|
|
2
|
+
|
|
23
3
|
interface FilterDateState {
|
|
24
4
|
period: FilterPeriod;
|
|
25
5
|
start_date: string;
|
|
26
6
|
end_date: string;
|
|
27
7
|
}
|
|
28
8
|
|
|
29
|
-
export {
|
|
9
|
+
export { FilterDateState };
|
package/dist/types/analytics.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
//# sourceMappingURL=analytics.js.map
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
SALE_COUNT = "SALE_COUNT",
|
|
4
|
-
SALE_AVERAGE_VALUE = "SALE_AVERAGE_VALUE"
|
|
5
|
-
}
|
|
6
|
-
declare enum AbcCurve {
|
|
7
|
-
A = "A",
|
|
8
|
-
B = "B",
|
|
9
|
-
C = "C"
|
|
10
|
-
}
|
|
11
|
-
declare enum SellerPortfolioQueryType {
|
|
12
|
-
CLASSIFICATION = "CLASSIFICATION",
|
|
13
|
-
ABC_CURVE = "ABC_CURVE"
|
|
14
|
-
}
|
|
1
|
+
import { AbcCurve } from '../utils/partnerAnalysis.js';
|
|
2
|
+
|
|
15
3
|
interface RankingItem {
|
|
16
4
|
partner_external_id: string;
|
|
17
5
|
partner_name: string;
|
|
@@ -72,20 +60,9 @@ interface DashboardPartner {
|
|
|
72
60
|
main_seller_external_id: string;
|
|
73
61
|
classification: string;
|
|
74
62
|
abc_curve: string;
|
|
63
|
+
recurrence?: Record<string, unknown>;
|
|
75
64
|
sale_analysis: DashboardPartnerSaleAnalysis;
|
|
76
65
|
state: string;
|
|
77
66
|
}
|
|
78
|
-
declare enum Status {
|
|
79
|
-
ACTIVE = "ACTIVE",
|
|
80
|
-
AT_RISK = "AT_RISK",
|
|
81
|
-
INACTIVE = "INACTIVE",
|
|
82
|
-
LOST = "LOST",
|
|
83
|
-
NEW_CLIENT = "NEW_CLIENT",
|
|
84
|
-
PROSPECT = "PROSPECT"
|
|
85
|
-
}
|
|
86
|
-
declare const STATUS_OPTIONS: Record<Status, {
|
|
87
|
-
label: string;
|
|
88
|
-
color: string;
|
|
89
|
-
}>;
|
|
90
67
|
|
|
91
|
-
export {
|
|
68
|
+
export { AbcCurveBreakdown, AbcCurveBreakdownItem, ByProfile, ByProfileItem, DashboardPartner, DashboardPartnerSaleAnalysis, PortfolioBreakdown, PortfolioBreakdownItem, Ranking, RankingItem, SellerPortfolio, SellerPortfolioBreakdownEntry, SellerPortfolioItem };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
//# sourceMappingURL=partnerAnalysis.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare enum ViewMode {
|
|
2
|
+
MONTHLY = "MONTHLY",
|
|
3
|
+
DAILY = "DAILY"
|
|
4
|
+
}
|
|
5
|
+
declare const VIEW_MODE_LABELS: Record<ViewMode, string>;
|
|
6
|
+
declare enum ExportFormat {
|
|
7
|
+
XLSX = "XLSX",
|
|
8
|
+
PDF = "PDF"
|
|
9
|
+
}
|
|
10
|
+
declare enum FilterPeriod {
|
|
11
|
+
TODAY = "TODAY",
|
|
12
|
+
YESTERDAY = "YESTERDAY",
|
|
13
|
+
LAST_7_DAYS = "LAST_7_DAYS",
|
|
14
|
+
LAST_28_DAYS = "LAST_28_DAYS",
|
|
15
|
+
LAST_90_DAYS = "LAST_90_DAYS",
|
|
16
|
+
LAST_WEEK = "LAST_WEEK",
|
|
17
|
+
LAST_MONTH = "LAST_MONTH",
|
|
18
|
+
THIS_MONTH = "THIS_MONTH",
|
|
19
|
+
THIS_YEAR = "THIS_YEAR",
|
|
20
|
+
OTHER = "OTHER"
|
|
21
|
+
}
|
|
22
|
+
declare const FILTER_PERIOD_LABELS: Record<FilterPeriod, string>;
|
|
23
|
+
|
|
24
|
+
export { ExportFormat, FILTER_PERIOD_LABELS, FilterPeriod, VIEW_MODE_LABELS, ViewMode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare enum RankingType {
|
|
2
|
+
SALE_TOTAL_VALUE = "SALE_TOTAL_VALUE",
|
|
3
|
+
SALE_COUNT = "SALE_COUNT",
|
|
4
|
+
SALE_AVERAGE_VALUE = "SALE_AVERAGE_VALUE"
|
|
5
|
+
}
|
|
6
|
+
declare enum AbcCurve {
|
|
7
|
+
A = "A",
|
|
8
|
+
B = "B",
|
|
9
|
+
C = "C"
|
|
10
|
+
}
|
|
11
|
+
declare enum SellerPortfolioQueryType {
|
|
12
|
+
CLASSIFICATION = "CLASSIFICATION",
|
|
13
|
+
ABC_CURVE = "ABC_CURVE"
|
|
14
|
+
}
|
|
15
|
+
declare enum Status {
|
|
16
|
+
ACTIVE = "ACTIVE",
|
|
17
|
+
AT_RISK = "AT_RISK",
|
|
18
|
+
INACTIVE = "INACTIVE",
|
|
19
|
+
LOST = "LOST",
|
|
20
|
+
NEW_CLIENT = "NEW_CLIENT",
|
|
21
|
+
PROSPECT = "PROSPECT"
|
|
22
|
+
}
|
|
23
|
+
declare const STATUS_OPTIONS: Record<Status, {
|
|
24
|
+
label: string;
|
|
25
|
+
color: string;
|
|
26
|
+
}>;
|
|
27
|
+
|
|
28
|
+
export { AbcCurve, RankingType, STATUS_OPTIONS, SellerPortfolioQueryType, Status };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { e as findMatchingPeriod, c as getDefaultFilterDateState, d as getFilterDateStateFor, b as getPeriodDates, a as periodOptions, f as toFilterDateState } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { e as findMatchingPeriod, c as getDefaultFilterDateState, d as getFilterDateStateFor, b as getPeriodDates, a as periodOptions, f as toFilterDateState } from '../chunk-UWTX4JMW.js';
|
|
2
|
+
import '../chunk-ERLI5GAP.js';
|
|
3
3
|
//# sourceMappingURL=periodDates.js.map
|
package/package.json
CHANGED
package/dist/chunk-BHYLHO5P.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var n=(e=>(e.SALE_TOTAL_VALUE="SALE_TOTAL_VALUE",e.SALE_COUNT="SALE_COUNT",e.SALE_AVERAGE_VALUE="SALE_AVERAGE_VALUE",e))(n||{}),o=(e=>(e.A="A",e.B="B",e.C="C",e))(o||{}),a=(t=>(t.CLASSIFICATION="CLASSIFICATION",t.ABC_CURVE="ABC_CURVE",t))(a||{}),l=(r=>(r.ACTIVE="ACTIVE",r.AT_RISK="AT_RISK",r.INACTIVE="INACTIVE",r.LOST="LOST",r.NEW_CLIENT="NEW_CLIENT",r.PROSPECT="PROSPECT",r))(l||{}),i={["ACTIVE"]:{label:"Ativo",color:"#22C55E"},["AT_RISK"]:{label:"Em risco",color:"#FFAB00"},["INACTIVE"]:{label:"Inativo",color:"#FF5630"},["LOST"]:{label:"Perdido",color:"#C4CDD5"},["NEW_CLIENT"]:{label:"Novo cliente",color:"#8E33FF"},["PROSPECT"]:{label:"Prospect",color:"#00B8D9"}};
|
|
2
|
-
|
|
3
|
-
export { n as a, o as b, a as c, l as d, i as e };
|
|
4
|
-
//# sourceMappingURL=chunk-BHYLHO5P.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/partnerAnalysis.ts"],"names":["RankingType","AbcCurve","SellerPortfolioQueryType","Status","STATUS_OPTIONS"],"mappings":"AAAO,IAAKA,OACVA,EAAA,iBAAmB,mBACnBA,EAAA,WAAa,aACbA,EAAA,mBAAqB,qBAHXA,OAAA,IAMAC,OACVA,EAAA,EAAI,IACJA,EAAA,EAAI,IACJA,EAAA,EAAI,IAHMA,OAAA,IAMAC,OACVA,EAAA,eAAiB,iBACjBA,EAAA,UAAY,YAFFA,OAAA,IAiFAC,OACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,KAAO,OACPA,EAAA,WAAa,aACbA,EAAA,SAAW,WANDA,OAAA,IASCC,EACX,CACE,CAAC,QAAa,EAAG,CACf,MAAO,QACP,MAAO,SACT,EACA,CAAC,SAAc,EAAG,CAChB,MAAO,WACP,MAAO,SACT,EACA,CAAC,UAAe,EAAG,CACjB,MAAO,UACP,MAAO,SACT,EACA,CAAC,MAAW,EAAG,CACb,MAAO,UACP,MAAO,SACT,EACA,CAAC,YAAiB,EAAG,CACnB,MAAO,eACP,MAAO,SACT,EACA,CAAC,UAAe,EAAG,CACjB,MAAO,WACP,MAAO,SACT,CACF","sourcesContent":["export enum RankingType {\n SALE_TOTAL_VALUE = 'SALE_TOTAL_VALUE',\n SALE_COUNT = 'SALE_COUNT',\n SALE_AVERAGE_VALUE = 'SALE_AVERAGE_VALUE',\n}\n\nexport enum AbcCurve {\n A = 'A',\n B = 'B',\n C = 'C',\n}\n\nexport enum SellerPortfolioQueryType {\n CLASSIFICATION = 'CLASSIFICATION',\n ABC_CURVE = 'ABC_CURVE',\n}\n\nexport interface RankingItem {\n partner_external_id: string;\n partner_name: string;\n total_value_by_customer: number;\n total_sale_value: number;\n}\n\nexport interface Ranking {\n items: RankingItem[];\n}\n\nexport interface PortfolioBreakdownItem {\n status: string;\n count: number;\n percentage: number;\n}\n\nexport interface PortfolioBreakdown {\n total: number;\n breakdown: PortfolioBreakdownItem[];\n}\n\nexport interface AbcCurveBreakdownItem {\n curve: AbcCurve;\n count: number;\n percentage: number;\n}\n\nexport interface AbcCurveBreakdown {\n total: number;\n breakdown: AbcCurveBreakdownItem[];\n}\n\nexport interface SellerPortfolioBreakdownEntry {\n count: number;\n percentage: number;\n}\n\nexport interface SellerPortfolioItem {\n seller_external_id: string;\n seller_name: string;\n breakdown: Record<string, SellerPortfolioBreakdownEntry>;\n}\n\nexport interface SellerPortfolio {\n items: SellerPortfolioItem[];\n}\n\nexport interface ByProfileItem {\n profile: string;\n count: number;\n percentage: number;\n}\n\nexport interface ByProfile {\n items: ByProfileItem[];\n}\n\nexport interface DashboardPartnerSaleAnalysis {\n last_sale_external_id: string;\n sale_count: number;\n last_sale_negotiation_date: string;\n total_sale_value: number;\n}\n\nexport interface DashboardPartner {\n external_id: string;\n name: string;\n tax_id: string;\n main_seller_external_id: string;\n classification: string;\n abc_curve: string;\n sale_analysis: DashboardPartnerSaleAnalysis;\n state: string;\n}\n\nexport enum Status {\n ACTIVE = 'ACTIVE',\n AT_RISK = 'AT_RISK',\n INACTIVE = 'INACTIVE',\n LOST = 'LOST',\n NEW_CLIENT = 'NEW_CLIENT',\n PROSPECT = 'PROSPECT',\n}\n\nexport const STATUS_OPTIONS: Record<Status, { label: string; color: string }> =\n {\n [Status.ACTIVE]: {\n label: 'Ativo',\n color: '#22C55E',\n },\n [Status.AT_RISK]: {\n label: 'Em risco',\n color: '#FFAB00',\n },\n [Status.INACTIVE]: {\n label: 'Inativo',\n color: '#FF5630',\n },\n [Status.LOST]: {\n label: 'Perdido',\n color: '#C4CDD5',\n },\n [Status.NEW_CLIENT]: {\n label: 'Novo cliente',\n color: '#8E33FF',\n },\n [Status.PROSPECT]: {\n label: 'Prospect',\n color: '#00B8D9',\n },\n };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/periodDates.ts"],"names":["dayjs","DATE_FORMAT","periodOptions","FilterPeriod","period","FILTER_PERIOD_LABELS","getPeriodDates","today","yesterday","lastWeekStart","lastWeekEnd","lastMonthStart","lastMonthEnd","getDefaultFilterDateState","dates","getFilterDateStateFor","findMatchingPeriod","startDate","endDate","match","value","toFilterDateState","form"],"mappings":"+CAAA,OAAOA,MAAW,QAQlB,IAAMC,EAAc,aAEPC,EAAgB,OAAO,OAAOC,CAAY,EAAE,IAAIC,IAAW,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ACA,QACE,MAAO,CACL,WAAYA,EAAM,SAAS,EAAG,KAAK,EAAE,OAAO,EAC5C,SAAUA,EAAM,OAAO,CACzB,CACJ,CACF,CAEO,SAASM,GAA6C,CAC3D,IAAMC,EAAQR,eAAuC,EACrD,MAAO,CACL,qBACA,WAAYN,EAAMc,EAAM,UAAU,EAAE,OAAOb,CAAW,EACtD,SAAUD,EAAMc,EAAM,QAAQ,EAAE,OAAOb,CAAW,CACpD,CACF,CAEO,SAASc,EAAsBX,EAAuC,CAC3E,IAAMU,EAAQR,EAAeF,CAAM,EACnC,MAAO,CACL,OAAAA,EACA,WAAYJ,EAAMc,EAAM,UAAU,EAAE,OAAOb,CAAW,EACtD,SAAUD,EAAMc,EAAM,QAAQ,EAAE,OAAOb,CAAW,CACpD,CACF,CAEO,SAASe,EACdC,EACAC,EACc,CACd,GAAI,CAACD,GAAa,CAACC,EAAS,cAE5B,IAAMC,EAAQjB,EAAc,KAAK,CAAC,CAAE,MAAAkB,CAAM,IAAM,CAC9C,GAAIA,YAA8B,MAAO,GAEzC,IAAMN,EAAQR,EAAec,CAAK,EAElC,OACEH,EAAU,aAAa,IAAMH,EAAM,WAAW,aAAa,GAC3DI,EAAQ,aAAa,IAAMJ,EAAM,SAAS,aAAa,CAE3D,CAAC,EAED,OAAOK,EAASA,EAAM,aACxB,CAEO,SAASE,EAAkBC,EAId,CAClB,MAAO,CACL,OAAQA,EAAK,OACb,WAAYA,EAAK,WACbtB,EAAMsB,EAAK,UAAU,EAAE,OAAOrB,CAAW,EACzC,GACJ,SAAUqB,EAAK,SAAWtB,EAAMsB,EAAK,QAAQ,EAAE,OAAOrB,CAAW,EAAI,EACvE,CACF","sourcesContent":["import dayjs from 'dayjs';\n\nimport {\n FILTER_PERIOD_LABELS,\n FilterDateState,\n FilterPeriod,\n} from 'types/analytics';\n\nconst DATE_FORMAT = 'YYYY-MM-DD';\n\nexport const periodOptions = Object.values(FilterPeriod).map(period => ({\n label: FILTER_PERIOD_LABELS[period],\n value: period,\n}));\n\nexport function getPeriodDates(period: FilterPeriod): {\n start_date: Date;\n end_date: Date;\n} {\n const today = dayjs().startOf('day');\n\n switch (period) {\n case FilterPeriod.TODAY:\n return {\n start_date: today.toDate(),\n end_date: today.toDate(),\n };\n\n case FilterPeriod.YESTERDAY: {\n const yesterday = today.subtract(1, 'day');\n return {\n start_date: yesterday.toDate(),\n end_date: yesterday.toDate(),\n };\n }\n\n case FilterPeriod.LAST_7_DAYS:\n return {\n start_date: today.subtract(6, 'day').toDate(),\n end_date: today.toDate(),\n };\n\n case FilterPeriod.LAST_28_DAYS:\n return {\n start_date: today.subtract(27, 'day').toDate(),\n end_date: today.toDate(),\n };\n\n case FilterPeriod.LAST_90_DAYS:\n return {\n start_date: today.subtract(89, 'day').toDate(),\n end_date: today.toDate(),\n };\n\n case FilterPeriod.LAST_WEEK: {\n const lastWeekStart = today.subtract(1, 'week').startOf('week');\n const lastWeekEnd = lastWeekStart.endOf('week');\n return {\n start_date: lastWeekStart.toDate(),\n end_date: lastWeekEnd.toDate(),\n };\n }\n\n case FilterPeriod.LAST_MONTH: {\n const lastMonthStart = today.subtract(1, 'month').startOf('month');\n const lastMonthEnd = lastMonthStart.endOf('month');\n return {\n start_date: lastMonthStart.toDate(),\n end_date: lastMonthEnd.toDate(),\n };\n }\n\n case FilterPeriod.THIS_MONTH:\n return {\n start_date: today.startOf('month').toDate(),\n end_date: today.toDate(),\n };\n\n case FilterPeriod.THIS_YEAR:\n return {\n start_date: today.startOf('year').toDate(),\n end_date: today.endOf('year').toDate(),\n };\n\n case FilterPeriod.OTHER:\n default:\n return {\n start_date: today.subtract(6, 'day').toDate(),\n end_date: today.toDate(),\n };\n }\n}\n\nexport function getDefaultFilterDateState(): FilterDateState {\n const dates = getPeriodDates(FilterPeriod.LAST_7_DAYS);\n return {\n period: FilterPeriod.LAST_7_DAYS,\n start_date: dayjs(dates.start_date).format(DATE_FORMAT),\n end_date: dayjs(dates.end_date).format(DATE_FORMAT),\n };\n}\n\nexport function getFilterDateStateFor(period: FilterPeriod): FilterDateState {\n const dates = getPeriodDates(period);\n return {\n period,\n start_date: dayjs(dates.start_date).format(DATE_FORMAT),\n end_date: dayjs(dates.end_date).format(DATE_FORMAT),\n };\n}\n\nexport function findMatchingPeriod(\n startDate: Date | null,\n endDate: Date | null,\n): FilterPeriod {\n if (!startDate || !endDate) return FilterPeriod.OTHER;\n\n const match = periodOptions.find(({ value }) => {\n if (value === FilterPeriod.OTHER) return false;\n\n const dates = getPeriodDates(value);\n\n return (\n startDate.toDateString() === dates.start_date.toDateString() &&\n endDate.toDateString() === dates.end_date.toDateString()\n );\n });\n\n return match ? (match.value as FilterPeriod) : FilterPeriod.OTHER;\n}\n\nexport function toFilterDateState(form: {\n period: FilterPeriod;\n start_date: Date | null;\n end_date: Date | null;\n}): FilterDateState {\n return {\n period: form.period,\n start_date: form.start_date\n ? dayjs(form.start_date).format(DATE_FORMAT)\n : '',\n end_date: form.end_date ? dayjs(form.end_date).format(DATE_FORMAT) : '',\n };\n}\n"]}
|