@zydon/common 2.8.76 → 2.8.78

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.
Files changed (83) hide show
  1. package/dist/chunk-ANEPP6QT.js +4 -0
  2. package/dist/chunk-ANEPP6QT.js.map +1 -0
  3. package/dist/chunk-BHYLHO5P.js +4 -0
  4. package/dist/chunk-BHYLHO5P.js.map +1 -0
  5. package/dist/chunk-CBW32OUQ.js +13 -0
  6. package/dist/chunk-CBW32OUQ.js.map +1 -0
  7. package/dist/chunk-DRGARBKB.js +8 -0
  8. package/dist/chunk-DRGARBKB.js.map +1 -0
  9. package/dist/chunk-FYG3YWFZ.js +4 -0
  10. package/dist/chunk-FYG3YWFZ.js.map +1 -0
  11. package/dist/chunk-J5XGGHQ7.js +8 -0
  12. package/dist/chunk-J5XGGHQ7.js.map +1 -0
  13. package/dist/chunk-J7RPKCIN.js +9 -0
  14. package/dist/chunk-J7RPKCIN.js.map +1 -0
  15. package/dist/{chunk-NWT5TUJO.js → chunk-JM3SE72J.js} +2 -2
  16. package/dist/chunk-RMYYQLRJ.js +7 -0
  17. package/dist/chunk-RMYYQLRJ.js.map +1 -0
  18. package/dist/chunk-SP5U3DJP.js +7 -0
  19. package/dist/chunk-SP5U3DJP.js.map +1 -0
  20. package/dist/chunk-VGTQYKAC.js +8 -0
  21. package/dist/chunk-VGTQYKAC.js.map +1 -0
  22. package/dist/chunk-XAPSXJZO.js +8 -0
  23. package/dist/chunk-XAPSXJZO.js.map +1 -0
  24. package/dist/chunk-XL6SZZGI.js +6 -0
  25. package/dist/chunk-XL6SZZGI.js.map +1 -0
  26. package/dist/chunk-XQZPUMVQ.js +14 -0
  27. package/dist/chunk-XQZPUMVQ.js.map +1 -0
  28. package/dist/components/Analytics/OverviewAnalytics/index.d.ts +54 -0
  29. package/dist/components/Analytics/OverviewAnalytics/index.js +47 -0
  30. package/dist/components/Analytics/OverviewAnalytics/index.js.map +1 -0
  31. package/dist/components/Analytics/PartnerAnalysis/index.d.ts +122 -0
  32. package/dist/components/Analytics/PartnerAnalysis/index.js +28 -0
  33. package/dist/components/Analytics/PartnerAnalysis/index.js.map +1 -0
  34. package/dist/components/Analytics/index.d.ts +117 -0
  35. package/dist/components/Analytics/index.js +47 -0
  36. package/dist/components/Analytics/index.js.map +1 -0
  37. package/dist/components/Avatar/index.d.ts +1 -1
  38. package/dist/components/AvatarButton/index.js +6 -6
  39. package/dist/components/AvatarButton/index.js.map +1 -1
  40. package/dist/components/Common/index.js +2 -2
  41. package/dist/components/DataView/index.d.ts +1 -1
  42. package/dist/components/DateRangeCalendar/index.js +1 -7
  43. package/dist/components/DateRangeCalendar/index.js.map +1 -1
  44. package/dist/components/Drawer/index.js +3 -12
  45. package/dist/components/Drawer/index.js.map +1 -1
  46. package/dist/components/DynamicDataView/index.js +1 -1
  47. package/dist/components/InfoCircle/index.js +3 -7
  48. package/dist/components/InfoCircle/index.js.map +1 -1
  49. package/dist/components/SimpleCard/index.js +1 -7
  50. package/dist/components/SimpleCard/index.js.map +1 -1
  51. package/dist/components/ToggleTheme/index.js +2 -2
  52. package/dist/components/form/DateField/index.js +1 -8
  53. package/dist/components/form/DateField/index.js.map +1 -1
  54. package/dist/components/form/Form/index.js +1 -7
  55. package/dist/components/form/Form/index.js.map +1 -1
  56. package/dist/hooks/useDatagrid.js +1 -6
  57. package/dist/hooks/useDatagrid.js.map +1 -1
  58. package/dist/hooks/useSnackbar.d.ts +1 -1
  59. package/dist/hooks/useThemeToggle.js +2 -2
  60. package/dist/index.d.ts +2 -2
  61. package/dist/index.js +2 -2
  62. package/dist/theme/core/index.d.ts +1 -1
  63. package/dist/theme/styles/index.d.ts +13 -13
  64. package/dist/theme/theme-provider.js +2 -2
  65. package/dist/types/analytics.d.ts +29 -0
  66. package/dist/types/analytics.js +2 -0
  67. package/dist/types/analytics.js.map +1 -0
  68. package/dist/types/overviewAnalytics.d.ts +88 -0
  69. package/dist/types/overviewAnalytics.js +2 -0
  70. package/dist/types/overviewAnalytics.js.map +1 -0
  71. package/dist/types/partnerAnalysis.d.ts +91 -0
  72. package/dist/types/partnerAnalysis.js +2 -0
  73. package/dist/types/partnerAnalysis.js.map +1 -0
  74. package/dist/utils/buildExportPayload.js +1 -1
  75. package/dist/utils/chart.d.ts +6 -0
  76. package/dist/utils/chart.js +2 -0
  77. package/dist/utils/chart.js.map +1 -0
  78. package/dist/utils/periodDates.d.ts +20 -0
  79. package/dist/utils/periodDates.js +3 -0
  80. package/dist/utils/periodDates.js.map +1 -0
  81. package/package.json +16 -2
  82. package/dist/{chunk-NWT5TUJO.js.map → chunk-JM3SE72J.js.map} +0 -0
  83. package/dist/{index-5a5e5dc8.d.ts → index-c8f1e6e7.d.ts} +12 -12
@@ -0,0 +1,88 @@
1
+ import { ReactNode } from 'react';
2
+ import { ViewMode } from './analytics.js';
3
+
4
+ interface RevenueGoalDashboardSeriesItem {
5
+ label: string;
6
+ realized: number;
7
+ forecast: number;
8
+ goal: number;
9
+ }
10
+ interface RevenueGoalDashboardKpis {
11
+ forecast: number;
12
+ realized: number;
13
+ goal: number;
14
+ achievement: number;
15
+ gap: number;
16
+ }
17
+ interface RevenueGoalDashboard {
18
+ kpis: RevenueGoalDashboardKpis;
19
+ series: RevenueGoalDashboardSeriesItem[];
20
+ }
21
+ interface RevenueGoalAiSummary {
22
+ brief: string;
23
+ detail: string;
24
+ }
25
+ interface QuotationDashboardSeriesItem {
26
+ label: string;
27
+ quotation_value: number;
28
+ quotation_count: number;
29
+ quotation_percentage: number;
30
+ order_value: number;
31
+ order_count: number;
32
+ order_percentage: number;
33
+ }
34
+ interface QuotationDashboard {
35
+ series: QuotationDashboardSeriesItem[];
36
+ }
37
+ interface SalesForecastDashboardSeriesItem {
38
+ label: string;
39
+ realized_value: number;
40
+ realized_count: number;
41
+ realized_percentage: number;
42
+ forecast_value: number;
43
+ forecast_count: number;
44
+ forecast_percentage: number;
45
+ }
46
+ interface SalesForecastDashboard {
47
+ series: SalesForecastDashboardSeriesItem[];
48
+ }
49
+ interface OverviewDetailOrder {
50
+ id: string;
51
+ partner?: {
52
+ id: string;
53
+ name: string;
54
+ };
55
+ total_value: number;
56
+ negotiation_date?: Date | string;
57
+ status?: string;
58
+ }
59
+ interface OverviewDetailBaseProps {
60
+ open: boolean;
61
+ onClose: VoidFunction;
62
+ label: string;
63
+ viewMode: ViewMode;
64
+ selectedYear: number;
65
+ totalValue: number;
66
+ }
67
+ interface OverviewDetailProps {
68
+ open: boolean;
69
+ onClose: VoidFunction;
70
+ title: string;
71
+ viewMode: ViewMode;
72
+ selectedYear: number;
73
+ totalValue: number;
74
+ periodLabel: string;
75
+ suffix: string;
76
+ rows: OverviewDetailOrder[];
77
+ total: number;
78
+ isLoading: boolean;
79
+ isFetching: boolean;
80
+ page: number;
81
+ perPage: number;
82
+ onSearch: (value: string) => void;
83
+ onPaginationChange: (page: number, pageSize: number) => void;
84
+ buildPartnerLink?: (partnerId: string) => string;
85
+ mobileItemSlot?: (row: OverviewDetailOrder) => ReactNode;
86
+ }
87
+
88
+ export { OverviewDetailBaseProps, OverviewDetailOrder, OverviewDetailProps, QuotationDashboard, QuotationDashboardSeriesItem, RevenueGoalAiSummary, RevenueGoalDashboard, RevenueGoalDashboardKpis, RevenueGoalDashboardSeriesItem, SalesForecastDashboard, SalesForecastDashboardSeriesItem };
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=overviewAnalytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,91 @@
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
+ interface RankingItem {
16
+ partner_external_id: string;
17
+ partner_name: string;
18
+ total_value_by_customer: number;
19
+ total_sale_value: number;
20
+ }
21
+ interface Ranking {
22
+ items: RankingItem[];
23
+ }
24
+ interface PortfolioBreakdownItem {
25
+ status: string;
26
+ count: number;
27
+ percentage: number;
28
+ }
29
+ interface PortfolioBreakdown {
30
+ total: number;
31
+ breakdown: PortfolioBreakdownItem[];
32
+ }
33
+ interface AbcCurveBreakdownItem {
34
+ curve: AbcCurve;
35
+ count: number;
36
+ percentage: number;
37
+ }
38
+ interface AbcCurveBreakdown {
39
+ total: number;
40
+ breakdown: AbcCurveBreakdownItem[];
41
+ }
42
+ interface SellerPortfolioBreakdownEntry {
43
+ count: number;
44
+ percentage: number;
45
+ }
46
+ interface SellerPortfolioItem {
47
+ seller_external_id: string;
48
+ seller_name: string;
49
+ breakdown: Record<string, SellerPortfolioBreakdownEntry>;
50
+ }
51
+ interface SellerPortfolio {
52
+ items: SellerPortfolioItem[];
53
+ }
54
+ interface ByProfileItem {
55
+ profile: string;
56
+ count: number;
57
+ percentage: number;
58
+ }
59
+ interface ByProfile {
60
+ items: ByProfileItem[];
61
+ }
62
+ interface DashboardPartnerSaleAnalysis {
63
+ last_sale_external_id: string;
64
+ sale_count: number;
65
+ last_sale_negotiation_date: string;
66
+ total_sale_value: number;
67
+ }
68
+ interface DashboardPartner {
69
+ external_id: string;
70
+ name: string;
71
+ tax_id: string;
72
+ main_seller_external_id: string;
73
+ classification: string;
74
+ abc_curve: string;
75
+ sale_analysis: DashboardPartnerSaleAnalysis;
76
+ state: string;
77
+ }
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
+
91
+ export { AbcCurve, AbcCurveBreakdown, AbcCurveBreakdownItem, ByProfile, ByProfileItem, DashboardPartner, DashboardPartnerSaleAnalysis, PortfolioBreakdown, PortfolioBreakdownItem, Ranking, RankingItem, RankingType, STATUS_OPTIONS, SellerPortfolio, SellerPortfolioBreakdownEntry, SellerPortfolioItem, SellerPortfolioQueryType, Status };
@@ -0,0 +1,2 @@
1
+ export { b as AbcCurve, a as RankingType, e as STATUS_OPTIONS, c as SellerPortfolioQueryType, d as Status } from '../chunk-BHYLHO5P.js';
2
+ //# sourceMappingURL=partnerAnalysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
- import '../chunk-M62EJMQ6.js';
2
1
  import '../chunk-4P2L7UJA.js';
2
+ import '../chunk-M62EJMQ6.js';
3
3
 
4
4
  var u=(t,e)=>{if(!(!t?.fields||!e))return t.fields.find(r=>r.name===e||r.filter_field_name===e)},i=(t,e)=>{if(!e)return;let r=u(t,e);return t?.fields?r?.filter_field_name||r?.name:e},f=(t,e)=>{if(!(!t?.fields||!e||e.length===0))return e.filter(r=>r!=="ACTIONS")},l=(t,e)=>{let r=e?.trim();if(!r)return;let n=i(t,t?.description_field_name)||i(t,"name");if(n)return {operator:"AND",groups:[{operator:"AND",conditionals:[{fieldName:n,conditional:"LIKE",value:[r]}]}]}},p=(t,e,r)=>{if(!e||!r)return;let n=i(t,e);if(n)return {fieldName:n,sortType:r==="desc"?"DESC":"ASC"}},c=({metadata:t,visibleFieldNames:e,search:r,sort:n,dir:s})=>{let o=f(t,e),d=l(t,r),a=p(t,n,s);return {...o&&{criteria:o},...d&&{filter:d},...a&&{sort:a}}},y=c;
5
5
 
@@ -0,0 +1,6 @@
1
+ declare const MONTH_SHORT_LABELS: string[];
2
+ declare const MONTH_FULL_LABELS: string[];
3
+ declare const formatMonthLabel: (label: string) => string;
4
+ declare const formatDayLabel: (label: string) => string;
5
+
6
+ export { MONTH_FULL_LABELS, MONTH_SHORT_LABELS, formatDayLabel, formatMonthLabel };
@@ -0,0 +1,2 @@
1
+ export { b as MONTH_FULL_LABELS, a as MONTH_SHORT_LABELS, d as formatDayLabel, c as formatMonthLabel } from '../chunk-FYG3YWFZ.js';
2
+ //# sourceMappingURL=chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { FilterPeriod, FilterDateState } from '../types/analytics.js';
2
+
3
+ declare const periodOptions: {
4
+ label: string;
5
+ value: FilterPeriod;
6
+ }[];
7
+ declare function getPeriodDates(period: FilterPeriod): {
8
+ start_date: Date;
9
+ end_date: Date;
10
+ };
11
+ declare function getDefaultFilterDateState(): FilterDateState;
12
+ declare function getFilterDateStateFor(period: FilterPeriod): FilterDateState;
13
+ declare function findMatchingPeriod(startDate: Date | null, endDate: Date | null): FilterPeriod;
14
+ declare function toFilterDateState(form: {
15
+ period: FilterPeriod;
16
+ start_date: Date | null;
17
+ end_date: Date | null;
18
+ }): FilterDateState;
19
+
20
+ export { findMatchingPeriod, getDefaultFilterDateState, getFilterDateStateFor, getPeriodDates, periodOptions, toFilterDateState };
@@ -0,0 +1,3 @@
1
+ export { e as findMatchingPeriod, c as getDefaultFilterDateState, d as getFilterDateStateFor, b as getPeriodDates, a as periodOptions, f as toFilterDateState } from '../chunk-SP5U3DJP.js';
2
+ import '../chunk-ANEPP6QT.js';
3
+ //# sourceMappingURL=periodDates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.8.76",
3
+ "version": "2.8.78",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -42,6 +42,18 @@
42
42
  "import": "./dist/components/*/index.js",
43
43
  "types": "./dist/components/*/index.d.ts"
44
44
  },
45
+ "./components/Analytics": {
46
+ "import": "./dist/components/Analytics/index.js",
47
+ "types": "./dist/components/Analytics/index.d.ts"
48
+ },
49
+ "./components/Analytics/OverviewAnalytics": {
50
+ "import": "./dist/components/Analytics/OverviewAnalytics/index.js",
51
+ "types": "./dist/components/Analytics/OverviewAnalytics/index.d.ts"
52
+ },
53
+ "./components/Analytics/PartnerAnalysis": {
54
+ "import": "./dist/components/Analytics/PartnerAnalysis/index.js",
55
+ "types": "./dist/components/Analytics/PartnerAnalysis/index.d.ts"
56
+ },
45
57
  "./contexts/*": {
46
58
  "import": "./dist/contexts/*/index.js",
47
59
  "types": "./dist/contexts/*/index.d.ts"
@@ -148,6 +160,7 @@
148
160
  "react": "^18.3.1",
149
161
  "react-dom": "^18.3.1",
150
162
  "react-hook-form": "^7.53.0",
163
+ "recharts": "^3.8.1",
151
164
  "ts-jest": "^29.2.5",
152
165
  "tsup": "6.6.0",
153
166
  "typescript": "5.3.3",
@@ -190,7 +203,8 @@
190
203
  "@mui/x-date-pickers-pro": "^7.14.0",
191
204
  "react": "^18.3.1",
192
205
  "react-dom": "^18.3.1",
193
- "react-hook-form": "^7.53.0"
206
+ "react-hook-form": "^7.53.0",
207
+ "recharts": "^3.7.0"
194
208
  },
195
209
  "jest-junit": {
196
210
  "outputDirectory": "./reports",
@@ -286,10 +286,13 @@ declare const components: {
286
286
  MuiTimelineDot: {
287
287
  defaultProps?: Partial<_mui_lab_TimelineDot.TimelineDotProps> | undefined;
288
288
  styleOverrides?: Partial<_mui_material_styles_overrides.OverridesStyleRules<keyof _mui_lab_TimelineDot.TimelineDotClasses, "MuiTimelineDot", {
289
- transitions: _mui_material.Transitions;
289
+ cssVarPrefix: string;
290
+ zIndex: _mui_material.ZIndex;
291
+ direction: _mui_system.Direction;
292
+ opacity: _mui_material.Opacity;
293
+ typography: _mui_material.TypographyVariants;
290
294
  palette: _mui_material.Palette;
291
295
  colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
292
- cssVarPrefix: string;
293
296
  vars: _mui_material.ThemeVars;
294
297
  getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
295
298
  getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
@@ -300,16 +303,13 @@ declare const components: {
300
303
  spacing: _mui_system.Spacing;
301
304
  breakpoints: _mui_system.Breakpoints;
302
305
  shape: _mui_system.Shape;
303
- typography: _mui_material.TypographyVariants;
306
+ transitions: _mui_material.Transitions;
304
307
  shadows: _mui_material.Shadows;
305
308
  mixins: _mui_material.Mixins;
306
- zIndex: _mui_material.ZIndex;
307
- direction: _mui_system.Direction;
308
309
  shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
309
310
  unstable_sxConfig: _mui_system.SxConfig;
310
311
  unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
311
312
  applyStyles: _mui_system.ApplyStyles<"light" | "dark">;
312
- opacity: _mui_material.Opacity;
313
313
  overlays: _mui_material.Overlays;
314
314
  customShadows: CustomShadows;
315
315
  unstable_strictMode?: boolean | undefined;
@@ -326,10 +326,13 @@ declare const components: {
326
326
  MuiTimelineConnector: {
327
327
  defaultProps?: Partial<_mui_lab_TimelineConnector.TimelineConnectorProps> | undefined;
328
328
  styleOverrides?: Partial<_mui_material_styles_overrides.OverridesStyleRules<"root", "MuiTimelineConnector", {
329
- transitions: _mui_material.Transitions;
329
+ cssVarPrefix: string;
330
+ zIndex: _mui_material.ZIndex;
331
+ direction: _mui_system.Direction;
332
+ opacity: _mui_material.Opacity;
333
+ typography: _mui_material.TypographyVariants;
330
334
  palette: _mui_material.Palette;
331
335
  colorSchemes: Record<_mui_material.SupportedColorScheme, _mui_material.ColorSystem>;
332
- cssVarPrefix: string;
333
336
  vars: _mui_material.ThemeVars;
334
337
  getCssVar: (field: _mui_material.ThemeCssVar, ...vars: _mui_material.ThemeCssVar[]) => string;
335
338
  getColorSchemeSelector: (colorScheme: _mui_material.SupportedColorScheme) => string;
@@ -340,16 +343,13 @@ declare const components: {
340
343
  spacing: _mui_system.Spacing;
341
344
  breakpoints: _mui_system.Breakpoints;
342
345
  shape: _mui_system.Shape;
343
- typography: _mui_material.TypographyVariants;
346
+ transitions: _mui_material.Transitions;
344
347
  shadows: _mui_material.Shadows;
345
348
  mixins: _mui_material.Mixins;
346
- zIndex: _mui_material.ZIndex;
347
- direction: _mui_system.Direction;
348
349
  shouldSkipGeneratingVar: (keys: string[], value: string | number) => boolean;
349
350
  unstable_sxConfig: _mui_system.SxConfig;
350
351
  unstable_sx: (props: _mui_system.SxProps<_mui_material.Theme>) => _mui_styled_engine.CSSObject;
351
352
  applyStyles: _mui_system.ApplyStyles<"light" | "dark">;
352
- opacity: _mui_material.Opacity;
353
353
  overlays: _mui_material.Overlays;
354
354
  customShadows: CustomShadows;
355
355
  unstable_strictMode?: boolean | undefined;