@@ -4,56 +4,56 @@ export const CrmDashboard = {
44 widgets : [
55 // --- KPI Row ---
66 {
7- type : 'metric' ,
7+ type : 'metric' as const ,
88 layout : { x : 0 , y : 0 , w : 1 , h : 1 } ,
99 options : {
1010 label : 'Total Revenue' ,
1111 value : '$652,000' ,
12- trend : { value : 12.5 , direction : 'up' , label : 'vs last month' } ,
12+ trend : { value : 12.5 , direction : 'up' as const , label : 'vs last month' } ,
1313 icon : 'DollarSign'
1414 }
1515 } ,
1616 {
17- type : 'metric' ,
17+ type : 'metric' as const ,
1818 layout : { x : 1 , y : 0 , w : 1 , h : 1 } ,
1919 options : {
2020 label : 'Active Deals' ,
2121 value : '5' ,
22- trend : { value : 2.1 , direction : 'down' , label : 'vs last month' } ,
22+ trend : { value : 2.1 , direction : 'down' as const , label : 'vs last month' } ,
2323 icon : 'Briefcase'
2424 }
2525 } ,
2626 {
27- type : 'metric' ,
27+ type : 'metric' as const ,
2828 layout : { x : 2 , y : 0 , w : 1 , h : 1 } ,
2929 options : {
3030 label : 'Win Rate' ,
3131 value : '42%' ,
32- trend : { value : 4.3 , direction : 'up' , label : 'vs last month' } ,
32+ trend : { value : 4.3 , direction : 'up' as const , label : 'vs last month' } ,
3333 icon : 'Trophy'
3434 }
3535 } ,
3636 {
37- type : 'metric' ,
37+ type : 'metric' as const ,
3838 layout : { x : 3 , y : 0 , w : 1 , h : 1 } ,
3939 options : {
4040 label : 'Avg Deal Size' ,
4141 value : '$93,000' ,
42- trend : { value : 1.2 , direction : 'up' , label : 'vs last month' } ,
42+ trend : { value : 1.2 , direction : 'up' as const , label : 'vs last month' } ,
4343 icon : 'BarChart3'
4444 }
4545 } ,
4646
4747 // --- Row 2: Charts ---
4848 {
4949 title : 'Revenue Trends' ,
50- type : 'area' ,
50+ type : 'area' as const ,
5151 layout : { x : 0 , y : 1 , w : 3 , h : 2 } ,
5252 options : {
5353 xField : 'month' ,
5454 yField : 'revenue' ,
5555 data : {
56- provider : 'value' ,
56+ provider : 'value' as const ,
5757 items : [
5858 { month : 'Jan' , revenue : 155000 } ,
5959 { month : 'Feb' , revenue : 87000 } ,
@@ -68,13 +68,13 @@ export const CrmDashboard = {
6868 } ,
6969 {
7070 title : 'Lead Source' ,
71- type : 'donut' ,
71+ type : 'donut' as const ,
7272 layout : { x : 3 , y : 1 , w : 1 , h : 2 } ,
7373 options : {
7474 xField : 'source' ,
7575 yField : 'value' ,
7676 data : {
77- provider : 'value' ,
77+ provider : 'value' as const ,
7878 items : [
7979 { source : 'Web' , value : 2 } ,
8080 { source : 'Referral' , value : 1 } ,
@@ -88,13 +88,13 @@ export const CrmDashboard = {
8888 // --- Row 3: More Charts ---
8989 {
9090 title : 'Pipeline by Stage' ,
91- type : 'bar' ,
91+ type : 'bar' as const ,
9292 layout : { x : 0 , y : 3 , w : 2 , h : 2 } ,
9393 options : {
9494 xField : 'stage' ,
9595 yField : 'amount' ,
9696 data : {
97- provider : 'value' ,
97+ provider : 'value' as const ,
9898 items : [
9999 { stage : 'Prospecting' , amount : 250000 } ,
100100 { stage : 'Qualification' , amount : 35000 } ,
@@ -107,13 +107,13 @@ export const CrmDashboard = {
107107 } ,
108108 {
109109 title : 'Top Products' ,
110- type : 'bar' ,
110+ type : 'bar' as const ,
111111 layout : { x : 2 , y : 3 , w : 2 , h : 2 } ,
112112 options : {
113113 xField : 'name' ,
114114 yField : 'sales' ,
115115 data : {
116- provider : 'value' ,
116+ provider : 'value' as const ,
117117 items : [
118118 { name : 'Workstation Pro Laptop' , sales : 45000 } ,
119119 { name : 'Implementation Service' , sales : 32000 } ,
@@ -127,7 +127,7 @@ export const CrmDashboard = {
127127 // --- Row 4: Table ---
128128 {
129129 title : 'Recent Opportunities' ,
130- type : 'table' ,
130+ type : 'table' as const ,
131131 layout : { x : 0 , y : 5 , w : 4 , h : 2 } ,
132132 options : {
133133 columns : [
@@ -137,7 +137,7 @@ export const CrmDashboard = {
137137 { header : 'Close Date' , accessorKey : 'date' }
138138 ] ,
139139 data : {
140- provider : 'value' ,
140+ provider : 'value' as const ,
141141 items : [
142142 { name : 'Berlin Automation Project' , amount : '$250,000' , stage : 'Prospecting' , date : '2024-09-01' } ,
143143 { name : 'ObjectStack Enterprise License' , amount : '$150,000' , stage : 'Closed Won' , date : '2024-01-15' } ,
@@ -152,15 +152,15 @@ export const CrmDashboard = {
152152 // --- Row 5: Dynamic KPI from Object Data ---
153153 {
154154 title : 'Revenue by Account' ,
155- type : 'bar' ,
155+ type : 'bar' as const ,
156156 layout : { x : 0 , y : 7 , w : 4 , h : 2 } ,
157157 options : {
158158 xField : 'account' ,
159159 yField : 'total' ,
160160 data : {
161- provider : 'object' ,
161+ provider : 'object' as const ,
162162 object : 'opportunity' ,
163- aggregate : { field : 'amount' , function : 'sum' , groupBy : 'account' }
163+ aggregate : { field : 'amount' , function : 'sum' as const , groupBy : 'account' }
164164 }
165165 } ,
166166 }
0 commit comments