andoncloud-dashboard-toolkit 1.5.19 → 1.5.21
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/components/ConfirmTooltip/index.d.ts +2 -0
- package/dist/cypress/support/component.d.ts +9 -0
- package/dist/cypress.config.d.ts +2 -0
- package/dist/helpers/sdk.d.ts +3 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/locales/index.d.ts +4 -0
- package/dist/src/components/ConfirmTooltip/ConfirmTooltip.cy.d.ts +1 -0
- package/dist/src/components/ConfirmTooltip/index.d.ts +13 -0
- package/dist/src/components/ConfirmTooltip/styles.d.ts +3 -0
- package/dist/src/components/DashboardFilters/AccessDeniedModal/AccessDeniedModal.cy.d.ts +1 -0
- package/dist/src/components/DashboardFilters/AccessDeniedModal/index.d.ts +14 -0
- package/dist/src/components/DashboardFilters/AccessDeniedModal/styles.d.ts +3 -0
- package/dist/src/components/DashboardFilters/DateRangePicker/DateRangePicker.cy.d.ts +1 -0
- package/dist/src/components/DashboardFilters/DateRangePicker/index.d.ts +18 -0
- package/dist/src/components/DashboardFilters/DateRangePicker/styles.d.ts +3 -0
- package/dist/src/components/DashboardFilters/DayTypeSelector/DayTypeSelector.cy.d.ts +1 -0
- package/dist/src/components/DashboardFilters/DayTypeSelector/index.d.ts +8 -0
- package/dist/src/components/DashboardFilters/DayTypeSelector/styles.d.ts +3 -0
- package/dist/src/components/DashboardFilters/PeriodList/PeriodList.cy.d.ts +1 -0
- package/dist/src/components/DashboardFilters/PeriodList/index.d.ts +13 -0
- package/dist/src/components/DashboardFilters/PeriodList/styles.d.ts +3 -0
- package/dist/src/components/DashboardFilters/ShiftSelector/ShiftSelector.cy.d.ts +1 -0
- package/dist/src/components/DashboardFilters/ShiftSelector/index.d.ts +9 -0
- package/dist/src/components/DashboardFilters/ShiftSelector/styles.d.ts +3 -0
- package/dist/src/components/DashboardFilters/index.d.ts +4 -0
- package/dist/src/components/DashboardFilters/periods.cy.d.ts +1 -0
- package/dist/src/components/DashboardFilters/periods.test.d.ts +1 -0
- package/dist/src/components/DashboardFilters/styles.d.ts +3 -0
- package/dist/src/components/DashboardFilters/types.d.ts +36 -0
- package/dist/src/components/MetricCard/index.d.ts +14 -0
- package/dist/src/components/MetricCard/styles.d.ts +15 -0
- package/dist/src/components/SortableSelect/index.d.ts +14 -0
- package/dist/src/components/WidgetCard/index.d.ts +7 -0
- package/dist/src/components/WidgetCard/styles.d.ts +3 -0
- package/dist/src/components/index.d.ts +6 -0
- package/dist/src/graphql-request.d.ts +7856 -0
- package/dist/src/graphql-ws.d.ts +2 -0
- package/dist/src/helpers/periods.d.ts +7 -0
- package/dist/src/helpers/sdk.d.ts +74 -0
- package/dist/src/helpers/shifts.cy.d.ts +1 -0
- package/dist/src/helpers/shifts.d.ts +10 -0
- package/dist/src/helpers/shifts.test.d.ts +1 -0
- package/dist/src/helpers/time.cy.d.ts +1 -0
- package/dist/src/helpers/time.d.ts +2 -0
- package/dist/src/helpers/time.test.d.ts +1 -0
- package/dist/src/hooks/useGqlClients.d.ts +8 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/locales/index.d.ts +95 -0
- package/dist/src/operations/generated/index.d.ts +3 -0
- package/dist/src/operations/generated/mutations/index.d.ts +29 -0
- package/dist/src/operations/generated/queries/index.d.ts +33 -0
- package/dist/src/operations/generated/subscriptions/index.d.ts +1 -0
- package/dist/src/types.d.ts +51 -0
- package/dist/src/utils/actioncable-client.d.ts +14 -0
- package/dist/src/utils/graphql-ws-client.d.ts +7 -0
- package/dist/src/version.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +22 -24
package/dist/locales/index.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ declare const resources: {
|
|
|
15
15
|
"filters.search.placeholder": string;
|
|
16
16
|
"filters.search.noResults": string;
|
|
17
17
|
"filters.premium.indicator": string;
|
|
18
|
+
"filters.periods.currentShift": string;
|
|
19
|
+
"filters.periods.lastShift": string;
|
|
18
20
|
"filters.periods.today": string;
|
|
19
21
|
"filters.periods.yesterday": string;
|
|
20
22
|
"filters.periods.last7Days": string;
|
|
@@ -59,6 +61,8 @@ declare const resources: {
|
|
|
59
61
|
"filters.search.placeholder": string;
|
|
60
62
|
"filters.search.noResults": string;
|
|
61
63
|
"filters.premium.indicator": string;
|
|
64
|
+
"filters.periods.currentShift": string;
|
|
65
|
+
"filters.periods.lastShift": string;
|
|
62
66
|
"filters.periods.today": string;
|
|
63
67
|
"filters.periods.yesterday": string;
|
|
64
68
|
"filters.periods.last7Days": string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipProps } from '@mui/material';
|
|
3
|
+
interface ConfirmTooltipProps extends Omit<TooltipProps, 'title'> {
|
|
4
|
+
confirmMessage: string;
|
|
5
|
+
confirmButtonText: string;
|
|
6
|
+
cancelButtonText: string;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
onConfirm: () => void;
|
|
9
|
+
confirmButtonTestId?: string;
|
|
10
|
+
cancelButtonTestId?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ConfirmTooltip: React.FC<ConfirmTooltipProps>;
|
|
13
|
+
export default ConfirmTooltip;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AccessButton, AccessState, CooldownInfo, FeatureRequestPayload } from 'andoncloud-sdk';
|
|
3
|
+
export type AccessDeniedModalProps = {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
accessState: AccessState;
|
|
7
|
+
buttons: AccessButton[];
|
|
8
|
+
daysSinceExpiry: number | null;
|
|
9
|
+
cooldownInfo: CooldownInfo;
|
|
10
|
+
workplaceId?: string;
|
|
11
|
+
onFeatureRequest?: (payload: FeatureRequestPayload) => Promise<boolean>;
|
|
12
|
+
};
|
|
13
|
+
declare const AccessDeniedModal: React.FC<AccessDeniedModalProps>;
|
|
14
|
+
export default AccessDeniedModal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import 'dayjs/locale/pl';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { DayType, Shift } from '../../../graphql-request';
|
|
4
|
+
import type { DateRange, PeriodDefinition, PeriodId } from '../types';
|
|
5
|
+
export type DateRangePickerProps = {
|
|
6
|
+
dateRange: DateRange;
|
|
7
|
+
dayType: DayType;
|
|
8
|
+
shifts: Shift[];
|
|
9
|
+
selectedShiftIds: string[];
|
|
10
|
+
hasAccess: boolean;
|
|
11
|
+
selectedPeriodId?: PeriodId;
|
|
12
|
+
onDayTypeChange: (dayType: DayType) => void;
|
|
13
|
+
onDateRangeChange: (dateRange: DateRange) => void;
|
|
14
|
+
onPeriodSelect: (period: PeriodDefinition, dateRange: DateRange) => void;
|
|
15
|
+
onAccessDenied: () => void;
|
|
16
|
+
};
|
|
17
|
+
declare const DateRangePicker: React.FC<DateRangePickerProps>;
|
|
18
|
+
export default DateRangePicker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DayType } from '../../../graphql-request';
|
|
3
|
+
export type DayTypeSelectorProps = {
|
|
4
|
+
value: DayType;
|
|
5
|
+
onChange: (value: DayType) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const DayTypeSelector: React.FC<DayTypeSelectorProps>;
|
|
8
|
+
export default DayTypeSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DayType, Shift } from '../../../graphql-request';
|
|
3
|
+
import type { DateRange, PeriodDefinition, PeriodId } from '../types';
|
|
4
|
+
export type PeriodListProps = {
|
|
5
|
+
dayType: DayType;
|
|
6
|
+
shifts: Shift[];
|
|
7
|
+
selectedShiftIds: string[];
|
|
8
|
+
selectedPeriodId?: PeriodId;
|
|
9
|
+
hasAccess: boolean;
|
|
10
|
+
onPeriodSelect: (period: PeriodDefinition, dateRange: DateRange) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const PeriodList: React.FC<PeriodListProps>;
|
|
13
|
+
export default PeriodList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Shift } from '../../../graphql-request';
|
|
3
|
+
export type ShiftSelectorProps = {
|
|
4
|
+
shifts: Shift[];
|
|
5
|
+
selectedShiftIds: string[];
|
|
6
|
+
onChange: (shiftIds: string[]) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const ShiftSelector: React.FC<ShiftSelectorProps>;
|
|
9
|
+
export default ShiftSelector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { FeatureRequestPayload } from 'andoncloud-sdk';
|
|
2
|
+
import type { DayType, Shift } from '../../graphql-request';
|
|
3
|
+
export type DateRange = {
|
|
4
|
+
from: string;
|
|
5
|
+
to: string;
|
|
6
|
+
};
|
|
7
|
+
export type CalendarPeriodId = 'today' | 'yesterday' | 'last_7_days' | 'last_14_days' | 'last_30_days' | 'last_90_days' | 'last_180_days' | 'last_365_days' | 'current_week' | 'current_month' | 'current_quarter' | 'current_year' | 'previous_week' | 'previous_month' | 'previous_quarter' | 'previous_year' | 'last_2_weeks' | 'last_4_weeks' | 'last_8_weeks' | 'last_12_weeks' | 'last_3_months' | 'last_6_months' | 'last_12_months';
|
|
8
|
+
export type ShiftPeriodId = 'current_shift' | 'last_shift';
|
|
9
|
+
export type WeekPeriodId = `week_${number}`;
|
|
10
|
+
export type PeriodId = CalendarPeriodId | ShiftPeriodId | WeekPeriodId;
|
|
11
|
+
export type FilterValues = {
|
|
12
|
+
dayType: DayType;
|
|
13
|
+
dateRange: DateRange;
|
|
14
|
+
shiftIds: string[];
|
|
15
|
+
selectedPeriodId?: PeriodId;
|
|
16
|
+
};
|
|
17
|
+
export type DashboardFiltersProps = {
|
|
18
|
+
initialValues?: FilterValues;
|
|
19
|
+
onChange: (values: FilterValues) => void;
|
|
20
|
+
shifts: Shift[];
|
|
21
|
+
onFeatureRequest?: (payload: FeatureRequestPayload) => Promise<boolean>;
|
|
22
|
+
};
|
|
23
|
+
export type PeriodCategory = 'shift_based' | 'rolling' | 'relative_days' | 'previous' | 'current' | 'calendar_weeks' | 'fiscal' | 'weeks';
|
|
24
|
+
export type CalculateContext = {
|
|
25
|
+
dayType: DayType;
|
|
26
|
+
shifts: Shift[];
|
|
27
|
+
selectedShiftIds: string[];
|
|
28
|
+
};
|
|
29
|
+
export type PeriodDefinition = {
|
|
30
|
+
id: PeriodId;
|
|
31
|
+
labelKey: string;
|
|
32
|
+
labelParams?: Record<string, string | number>;
|
|
33
|
+
needAccess: boolean;
|
|
34
|
+
category: PeriodCategory;
|
|
35
|
+
calculate: (ctx: CalculateContext) => DateRange;
|
|
36
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CardProps } from '@mui/material';
|
|
3
|
+
import { MetricValue } from '@/graphql-request';
|
|
4
|
+
interface MetricCardProps extends CardProps {
|
|
5
|
+
title: string;
|
|
6
|
+
metricLabel: React.ReactNode;
|
|
7
|
+
metricValue?: MetricValue;
|
|
8
|
+
progressValue?: MetricValue;
|
|
9
|
+
extraValue?: React.ReactNode;
|
|
10
|
+
animateBackgroundColor?: boolean;
|
|
11
|
+
rounded?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const MetricCard: React.FC<MetricCardProps>;
|
|
14
|
+
export default MetricCard;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/system';
|
|
2
|
+
interface StylesProps {
|
|
3
|
+
card: {
|
|
4
|
+
rounded?: boolean;
|
|
5
|
+
};
|
|
6
|
+
cardOverlay: {
|
|
7
|
+
background: string;
|
|
8
|
+
};
|
|
9
|
+
showBgPattern: boolean;
|
|
10
|
+
backgroundColor: string;
|
|
11
|
+
animateBackgroundColor?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const hexToRgba: (hex: string, alpha?: number) => string;
|
|
14
|
+
declare const makeStyles: (props: StylesProps) => Record<string, SxProps<Theme>>;
|
|
15
|
+
export default makeStyles;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OnChangeValue, Options } from 'react-select';
|
|
3
|
+
export interface Option {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
interface SortableSelectProps {
|
|
8
|
+
placeholder: string;
|
|
9
|
+
options: Options<Option>;
|
|
10
|
+
selected: Array<Option['value']>;
|
|
11
|
+
onChange: (selected: OnChangeValue<Option['value'], true>) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const SortableSelect: React.FC<SortableSelectProps>;
|
|
14
|
+
export default SortableSelect;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WidgetCardProps as BaseWidgetCardProps } from '@/types';
|
|
3
|
+
type WidgetCardProps = Omit<BaseWidgetCardProps, 'ref'> & {
|
|
4
|
+
ref?: React.LegacyRef<HTMLDivElement>;
|
|
5
|
+
};
|
|
6
|
+
declare const WidgetCard: React.FC<WidgetCardProps>;
|
|
7
|
+
export default WidgetCard;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ConfirmTooltip } from './ConfirmTooltip';
|
|
2
|
+
export { default as DashboardFilters } from './DashboardFilters';
|
|
3
|
+
export { default as MetricCard } from './MetricCard';
|
|
4
|
+
export { default as SortableSelect } from './SortableSelect';
|
|
5
|
+
export { default as WidgetCard } from './WidgetCard';
|
|
6
|
+
export type { DateRange, FilterValues, DashboardFiltersProps, PeriodDefinition, PeriodCategory, PeriodId, CalendarPeriodId, ShiftPeriodId, WeekPeriodId, CalculateContext, } from './DashboardFilters/types';
|