@hisptz/dhis2-analytics 2.0.26 → 2.0.27
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/Scorecard/schemas/config.js +11 -11
- package/dist/components/Scorecard/schemas/config.js.map +1 -1
- package/dist/esm/components/Scorecard/schemas/config.js +11 -11
- package/dist/esm/components/Scorecard/schemas/config.js.map +1 -1
- package/dist/types/components/Scorecard/components/ConfigProvider.d.ts +11 -11
- package/dist/types/components/Scorecard/components/StateProvider.d.ts +11 -11
- package/dist/types/components/Scorecard/schemas/config.d.ts +143 -143
- package/dist/types/components/Scorecard/schemas/config.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -29,17 +29,17 @@ const legendDefinitionSchema = zod.z.object({
|
|
|
29
29
|
isDefault: zod.z.boolean().optional()
|
|
30
30
|
});
|
|
31
31
|
const scorecardViewOptionsSchema = zod.z.object({
|
|
32
|
-
averageColumn: zod.z.boolean(),
|
|
33
|
-
averageDisplayType: zod.z.enum(["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]),
|
|
34
|
-
averageRow: zod.z.boolean(),
|
|
35
|
-
emptyRows: zod.z.boolean(),
|
|
36
|
-
highlightedIndicators: zod.z.boolean(),
|
|
37
|
-
itemNumber: zod.z.boolean(),
|
|
38
|
-
legend: zod.z.boolean(),
|
|
39
|
-
showHierarchy: zod.z.boolean(),
|
|
40
|
-
title: zod.z.boolean(),
|
|
41
|
-
arrows: zod.z.boolean(),
|
|
42
|
-
showDataInRows: zod.z.boolean(),
|
|
32
|
+
averageColumn: zod.z.boolean().optional(),
|
|
33
|
+
averageDisplayType: zod.z.enum(["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]).optional(),
|
|
34
|
+
averageRow: zod.z.boolean().optional(),
|
|
35
|
+
emptyRows: zod.z.boolean().optional(),
|
|
36
|
+
highlightedIndicators: zod.z.boolean().optional(),
|
|
37
|
+
itemNumber: zod.z.boolean().optional(),
|
|
38
|
+
legend: zod.z.boolean().optional(),
|
|
39
|
+
showHierarchy: zod.z.boolean().optional(),
|
|
40
|
+
title: zod.z.boolean().optional(),
|
|
41
|
+
arrows: zod.z.boolean().optional(),
|
|
42
|
+
showDataInRows: zod.z.boolean().optional(),
|
|
43
43
|
disableExpanding: zod.z.boolean().optional()
|
|
44
44
|
});
|
|
45
45
|
const organisationUnitSelectionSchema = zod.z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/Scorecard/schemas/config.ts"],"names":["ScorecardTableOrientation","ScorecardTableDimension","ScorecardDraggableItems"],"mappings":"AAAA,SAAS,SAAS;AAGX,MAAM,uBAAuB,EAAE,KAAK;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAEM,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACxC,OAAO,EAAE,OAAO;AAAA,EAChB,UAAU,EAAE,QAAQ;AAAA,EACpB,OAAO,EAAE;AAAA,IACR,EAAE,OAAO;AAAA,IACT,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC;AAAA,EAChD;AAAA,EACA,YAAY,EAAE;AAAA,IACb,EAAE,OAAO;AAAA,IACT,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC;AAAA,EAChD;AACD,CAAC;AAMM,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC9C,IAAI,EAAE,OAAO;AAAA,EACb,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AAAA,EACf,WAAW,EAAE,QAAQ,EAAE,SAAS;AACjC,CAAC;AAIM,MAAM,6BAA6B,EAAE,OAAO;AAAA,EAClD,eAAe,EAAE,QAAQ;AAAA,EACzB,oBAAoB,EAAE,KAAK,CAAC,OAAO,iBAAiB,eAAe,CAAC;AAAA,EACpE,YAAY,E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EAC9C,aAAa,EAAE;AAAA,IACd,iBAAiB,OAAO;AAAA,MACvB,MAAM,EAAE,OAAO;AAAA,QACd,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,QAC9B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,MAC9B,CAAC;AAAA,IACF,CAAC;AAAA,EACF;AAAA,EACA,SAAS,EAAE,OAAO;AAAA,IACjB,KAAK,EAAE,OAAO;AAAA,IACd,MAAM,EAAE,OAAO;AAAA,IACf,WAAW,EAAE,OAAO;AAAA,EACrB,CAAC;AAAA,EACD,QAAQ,EAAE,OAAO;AAClB,CAAC;AAMM,IAAK,4BAAL,kBAAKA,+BAAL;AACN,EAAAA,2BAAA,sBAAmB;AACnB,EAAAA,2BAAA,sBAAmB;AAFR,SAAAA;AAAA,GAAA;AAKL,IAAK,0BAAL,kBAAKC,6BAAL;AACN,EAAAA,yBAAA,WAAQ;AACR,EAAAA,yBAAA,eAAY;AACZ,EAAAA,yBAAA,aAAU;AACV,EAAAA,yBAAA,UAAO;AAJI,SAAAA;AAAA,GAAA;AAOL,IAAK,0BAAL,kBAAKC,6BAAL;AACN,EAAAA,yBAAA,QAAK;AACL,EAAAA,yBAAA,UAAO;AAFI,SAAAA;AAAA,GAAA","sourcesContent":["import { z } from \"zod\";\nimport type { RowData } from \"@tanstack/react-table\";\n\nexport const supportedDataSources = z.enum([\n\t\"indicator\",\n\t\"programIndicator\",\n\t\"dataSet\",\n\t\"dataElement\",\n\t\"customFunction\",\n\t\"sqlView\",\n]);\n\nexport const scorecardSharing = z.object({\n\towner: z.string(),\n\texternal: z.boolean(),\n\tusers: z.record(\n\t\tz.string(),\n\t\tz.object({ access: z.string(), id: z.string() }),\n\t),\n\tuserGroups: z.record(\n\t\tz.string(),\n\t\tz.object({ access: z.string(), id: z.string() }),\n\t),\n});\n\nexport type ScorecardSharing = z.infer<typeof scorecardSharing>;\n\nexport type SupportedDataSources = z.infer<typeof supportedDataSources>;\n\nexport const legendDefinitionSchema = z.object({\n\tid: z.string(),\n\tcolor: z.string(),\n\tname: z.string(),\n\tisDefault: z.boolean().optional(),\n});\n\nexport type LegendDefinition = z.infer<typeof legendDefinitionSchema>;\n\nexport const scorecardViewOptionsSchema = z.object({\n\taverageColumn: z.boolean(),\n\taverageDisplayType: z.enum([\"ALL\", \"ABOVE_AVERAGE\", \"BELOW_AVERAGE\"]),\n\taverageRow: z.boolean(),\n\temptyRows: z.boolean(),\n\thighlightedIndicators: z.boolean(),\n\titemNumber: z.boolean(),\n\tlegend: z.boolean(),\n\tshowHierarchy: z.boolean(),\n\ttitle: z.boolean(),\n\tarrows: z.boolean(),\n\tshowDataInRows: z.boolean(),\n\tdisableExpanding: z.boolean().optional(),\n});\n\nexport type ScorecardViewOptions = z.infer<typeof scorecardViewOptionsSchema>;\n\nexport const organisationUnitSelectionSchema = z.object({\n\tuserOrgUnit: z.boolean().optional(),\n\tuserSubUnit: z.boolean().optional(),\n\tuserSubX2Unit: z.boolean().optional(),\n\torgUnits: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t}),\n\t),\n\tgroups: z.array(z.string()).optional(),\n\tlevels: z.array(z.string()).optional(),\n});\n\nexport type OrgUnitSelection = z.infer<typeof organisationUnitSelectionSchema>;\n\nexport const periodSelectionSchema = z.object({\n\tperiods: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t}),\n\t),\n\ttype: z.string().optional(),\n});\n\nexport type PeriodSelection = z.infer<typeof periodSelectionSchema>;\n\nexport const legendSchema = z.object({\n\tlegendDefinitionId: z.string(),\n\tid: z.string(),\n\tstartValue: z.union([z.string(), z.number()]),\n\tendValue: z.union([z.string(), z.number()]),\n});\n\nexport type ScorecardLegend = z.infer<typeof legendSchema>;\n\nexport const specificTargetSchema = z.object({\n\ttype: z.enum([\"periods\", \"orgUnit\"]),\n\titems: z.array(z.string()),\n\tlegends: z.array(legendSchema),\n});\n\nexport type SpecificTarget = z.infer<typeof specificTargetSchema>;\n\nexport const orgUnitLevelLegendSchema = z.record(\n\tz.string(),\n\tz.array(legendSchema),\n);\n\nexport type OrgUnitLevelLegend = z.infer<typeof orgUnitLevelLegendSchema>;\n\nexport const dataSourceSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tlabel: z.string().optional(),\n\ttype: supportedDataSources,\n\tdisplayArrows: z.boolean(),\n\thighIsGood: z.boolean(),\n\teffectiveGap: z.number(),\n\tshowColors: z.boolean(),\n\tweight: z.number(),\n\tlegends: z.union([z.array(legendSchema), orgUnitLevelLegendSchema]),\n\tspecificTargets: z.array(specificTargetSchema).optional(),\n\tspecificTargetsSet: z.boolean().optional(),\n\tdescription: z.string().optional(),\n});\n\nexport type ScorecardDataSource = z.infer<typeof dataSourceSchema>;\n\nexport const dataHolderSchema = z.object({\n\tid: z.union([z.number(), z.string()]),\n\tdataSources: z.array(dataSourceSchema),\n});\n\nexport type ScorecardDataHolder = z.infer<typeof dataHolderSchema>;\n\nexport const dataGroupSchema = z.object({\n\tid: z.union([z.number(), z.string()]),\n\tdataHolders: z.array(dataHolderSchema),\n\tstyle: z.object({}),\n\ttitle: z.string(),\n});\n\nexport type ScorecardDataGroup = z.infer<typeof dataGroupSchema>;\n\nconst scorecardConfig = z.object({\n\tid: z.string(),\n\ttitle: z.string(),\n\tsubtitle: z.string().optional(),\n\tcustomHeader: z.string().optional(),\n\tdescription: z.string().optional(),\n\tlegendDefinitions: z.array(legendDefinitionSchema),\n\toptions: scorecardViewOptionsSchema,\n\torgUnitSelection: organisationUnitSelectionSchema,\n\tperiodSelection: periodSelectionSchema,\n\tdataSelection: z.object({\n\t\tdataGroups: z.array(dataGroupSchema),\n\t}),\n\thighlightedIndicators: z.array(dataSourceSchema),\n\tadditionalLabels: z.array(z.string()).optional(),\n\tsharing: scorecardSharing,\n});\n\nexport type ScorecardConfig = z.infer<typeof scorecardConfig>;\n\nconst scorecardStateSchema = z.object({\n\torgUnitSelection: organisationUnitSelectionSchema,\n\tperiodSelection: periodSelectionSchema,\n\toptions: scorecardViewOptionsSchema,\n\tnested: z.boolean().optional(),\n\thasOnePeriod: z.boolean().optional(),\n});\n\nexport type ScorecardState = z.infer<typeof scorecardStateSchema>;\n\nexport const scorecardAnalyticsData = z.object({\n\tdx: z.string().optional(),\n\tpe: z.string().optional(),\n\tou: z.string().optional(),\n\tvalue: z.string().optional(),\n});\n\nexport type ScorecardAnalyticsData = z.infer<typeof scorecardAnalyticsData>;\n\nexport const scorecardTableData = z.object({\n\tlabel: z.string(),\n\tdataValues: z.array(scorecardAnalyticsData),\n\tdataHolder: dataHolderSchema.optional(),\n\torgUnit: z\n\t\t.object({\n\t\t\tuid: z.string(),\n\t\t\tname: z.string(),\n\t\t\thierarchy: z.string(),\n\t\t})\n\t\t.optional(),\n\texpand: z.boolean().optional(),\n});\n\nexport type ScorecardTableData = z.infer<typeof scorecardTableData> & RowData;\n\nexport const scorecardTableCellData = z.object({\n\tdataSources: z.array(\n\t\tdataSourceSchema.extend({\n\t\t\tdata: z.object({\n\t\t\t\tprevious: z.number().optional(),\n\t\t\t\tcurrent: z.number().optional(),\n\t\t\t}),\n\t\t}),\n\t),\n\torgUnit: z.object({\n\t\tuid: z.string(),\n\t\tname: z.string(),\n\t\thierarchy: z.string(),\n\t}),\n\tperiod: z.string(),\n});\n\nexport type ScorecardTableCellData = z.infer<typeof scorecardTableCellData>;\n\nexport type SanitizedScorecardTableData = z.infer<typeof scorecardTableData>;\n\nexport enum ScorecardTableOrientation {\n\tORG_UNIT_VS_DATA = \"orgUnitsVsData\",\n\tDATA_VS_ORG_UNIT = \"dataVsOrgUnits\",\n}\n\nexport enum ScorecardTableDimension {\n\tGROUP = \"group\",\n\tORG_UNITS = \"orgUnits\",\n\tPERIODS = \"periods\",\n\tDATA = \"data\",\n}\n\nexport enum ScorecardDraggableItems {\n\tou = \"ou\",\n\tdata = \"data\",\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/Scorecard/schemas/config.ts"],"names":["ScorecardTableOrientation","ScorecardTableDimension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OAAO;AAAA,IACjB,KAAK,EAAE,OAAO;AAAA,IACd,MAAM,EAAE,OAAO;AAAA,IACf,WAAW,EAAE,OAAO;AAAA,EACrB,CAAC;AAAA,EACD,QAAQ,EAAE,OAAO;AAClB,CAAC;AAMM,IAAK,4BAAL,kBAAKA,+BAAL;AACN,EAAAA,2BAAA,sBAAmB;AACnB,EAAAA,2BAAA,sBAAmB;AAFR,SAAAA;AAAA,GAAA;AAKL,IAAK,0BAAL,kBAAKC,6BAAL;AACN,EAAAA,yBAAA,WAAQ;AACR,EAAAA,yBAAA,eAAY;AACZ,EAAAA,yBAAA,aAAU;AACV,EAAAA,yBAAA,UAAO;AAJI,SAAAA;AAAA,GAAA;AAOL,IAAK,0BAAL,kBAAKC,6BAAL;AACN,EAAAA,yBAAA,QAAK;AACL,EAAAA,yBAAA,UAAO;AAFI,SAAAA;AAAA,GAAA","sourcesContent":["import { z } from \"zod\";\nimport type { RowData } from \"@tanstack/react-table\";\n\nexport const supportedDataSources = z.enum([\n\t\"indicator\",\n\t\"programIndicator\",\n\t\"dataSet\",\n\t\"dataElement\",\n\t\"customFunction\",\n\t\"sqlView\",\n]);\n\nexport const scorecardSharing = z.object({\n\towner: z.string(),\n\texternal: z.boolean(),\n\tusers: z.record(\n\t\tz.string(),\n\t\tz.object({ access: z.string(), id: z.string() }),\n\t),\n\tuserGroups: z.record(\n\t\tz.string(),\n\t\tz.object({ access: z.string(), id: z.string() }),\n\t),\n});\n\nexport type ScorecardSharing = z.infer<typeof scorecardSharing>;\n\nexport type SupportedDataSources = z.infer<typeof supportedDataSources>;\n\nexport const legendDefinitionSchema = z.object({\n\tid: z.string(),\n\tcolor: z.string(),\n\tname: z.string(),\n\tisDefault: z.boolean().optional(),\n});\n\nexport type LegendDefinition = z.infer<typeof legendDefinitionSchema>;\n\nexport const scorecardViewOptionsSchema = z.object({\n\taverageColumn: z.boolean().optional(),\n\taverageDisplayType: z\n\t\t.enum([\"ALL\", \"ABOVE_AVERAGE\", \"BELOW_AVERAGE\"])\n\t\t.optional(),\n\taverageRow: z.boolean().optional(),\n\temptyRows: z.boolean().optional(),\n\thighlightedIndicators: z.boolean().optional(),\n\titemNumber: z.boolean().optional(),\n\tlegend: z.boolean().optional(),\n\tshowHierarchy: z.boolean().optional(),\n\ttitle: z.boolean().optional(),\n\tarrows: z.boolean().optional(),\n\tshowDataInRows: z.boolean().optional(),\n\tdisableExpanding: z.boolean().optional(),\n});\n\nexport type ScorecardViewOptions = z.infer<typeof scorecardViewOptionsSchema>;\n\nexport const organisationUnitSelectionSchema = z.object({\n\tuserOrgUnit: z.boolean().optional(),\n\tuserSubUnit: z.boolean().optional(),\n\tuserSubX2Unit: z.boolean().optional(),\n\torgUnits: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t}),\n\t),\n\tgroups: z.array(z.string()).optional(),\n\tlevels: z.array(z.string()).optional(),\n});\n\nexport type OrgUnitSelection = z.infer<typeof organisationUnitSelectionSchema>;\n\nexport const periodSelectionSchema = z.object({\n\tperiods: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t}),\n\t),\n\ttype: z.string().optional(),\n});\n\nexport type PeriodSelection = z.infer<typeof periodSelectionSchema>;\n\nexport const legendSchema = z.object({\n\tlegendDefinitionId: z.string(),\n\tid: z.string(),\n\tstartValue: z.union([z.string(), z.number()]),\n\tendValue: z.union([z.string(), z.number()]),\n});\n\nexport type ScorecardLegend = z.infer<typeof legendSchema>;\n\nexport const specificTargetSchema = z.object({\n\ttype: z.enum([\"periods\", \"orgUnit\"]),\n\titems: z.array(z.string()),\n\tlegends: z.array(legendSchema),\n});\n\nexport type SpecificTarget = z.infer<typeof specificTargetSchema>;\n\nexport const orgUnitLevelLegendSchema = z.record(\n\tz.string(),\n\tz.array(legendSchema),\n);\n\nexport type OrgUnitLevelLegend = z.infer<typeof orgUnitLevelLegendSchema>;\n\nexport const dataSourceSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tlabel: z.string().optional(),\n\ttype: supportedDataSources,\n\tdisplayArrows: z.boolean(),\n\thighIsGood: z.boolean(),\n\teffectiveGap: z.number(),\n\tshowColors: z.boolean(),\n\tweight: z.number(),\n\tlegends: z.union([z.array(legendSchema), orgUnitLevelLegendSchema]),\n\tspecificTargets: z.array(specificTargetSchema).optional(),\n\tspecificTargetsSet: z.boolean().optional(),\n\tdescription: z.string().optional(),\n});\n\nexport type ScorecardDataSource = z.infer<typeof dataSourceSchema>;\n\nexport const dataHolderSchema = z.object({\n\tid: z.union([z.number(), z.string()]),\n\tdataSources: z.array(dataSourceSchema),\n});\n\nexport type ScorecardDataHolder = z.infer<typeof dataHolderSchema>;\n\nexport const dataGroupSchema = z.object({\n\tid: z.union([z.number(), z.string()]),\n\tdataHolders: z.array(dataHolderSchema),\n\tstyle: z.object({}),\n\ttitle: z.string(),\n});\n\nexport type ScorecardDataGroup = z.infer<typeof dataGroupSchema>;\n\nconst scorecardConfig = z.object({\n\tid: z.string(),\n\ttitle: z.string(),\n\tsubtitle: z.string().optional(),\n\tcustomHeader: z.string().optional(),\n\tdescription: z.string().optional(),\n\tlegendDefinitions: z.array(legendDefinitionSchema),\n\toptions: scorecardViewOptionsSchema,\n\torgUnitSelection: organisationUnitSelectionSchema,\n\tperiodSelection: periodSelectionSchema,\n\tdataSelection: z.object({\n\t\tdataGroups: z.array(dataGroupSchema),\n\t}),\n\thighlightedIndicators: z.array(dataSourceSchema),\n\tadditionalLabels: z.array(z.string()).optional(),\n\tsharing: scorecardSharing,\n});\n\nexport type ScorecardConfig = z.infer<typeof scorecardConfig>;\n\nconst scorecardStateSchema = z.object({\n\torgUnitSelection: organisationUnitSelectionSchema,\n\tperiodSelection: periodSelectionSchema,\n\toptions: scorecardViewOptionsSchema,\n\tnested: z.boolean().optional(),\n\thasOnePeriod: z.boolean().optional(),\n});\n\nexport type ScorecardState = z.infer<typeof scorecardStateSchema>;\n\nexport const scorecardAnalyticsData = z.object({\n\tdx: z.string().optional(),\n\tpe: z.string().optional(),\n\tou: z.string().optional(),\n\tvalue: z.string().optional(),\n});\n\nexport type ScorecardAnalyticsData = z.infer<typeof scorecardAnalyticsData>;\n\nexport const scorecardTableData = z.object({\n\tlabel: z.string(),\n\tdataValues: z.array(scorecardAnalyticsData),\n\tdataHolder: dataHolderSchema.optional(),\n\torgUnit: z\n\t\t.object({\n\t\t\tuid: z.string(),\n\t\t\tname: z.string(),\n\t\t\thierarchy: z.string(),\n\t\t})\n\t\t.optional(),\n\texpand: z.boolean().optional(),\n});\n\nexport type ScorecardTableData = z.infer<typeof scorecardTableData> & RowData;\n\nexport const scorecardTableCellData = z.object({\n\tdataSources: z.array(\n\t\tdataSourceSchema.extend({\n\t\t\tdata: z.object({\n\t\t\t\tprevious: z.number().optional(),\n\t\t\t\tcurrent: z.number().optional(),\n\t\t\t}),\n\t\t}),\n\t),\n\torgUnit: z.object({\n\t\tuid: z.string(),\n\t\tname: z.string(),\n\t\thierarchy: z.string(),\n\t}),\n\tperiod: z.string(),\n});\n\nexport type ScorecardTableCellData = z.infer<typeof scorecardTableCellData>;\n\nexport type SanitizedScorecardTableData = z.infer<typeof scorecardTableData>;\n\nexport enum ScorecardTableOrientation {\n\tORG_UNIT_VS_DATA = \"orgUnitsVsData\",\n\tDATA_VS_ORG_UNIT = \"dataVsOrgUnits\",\n}\n\nexport enum ScorecardTableDimension {\n\tGROUP = \"group\",\n\tORG_UNITS = \"orgUnits\",\n\tPERIODS = \"periods\",\n\tDATA = \"data\",\n}\n\nexport enum ScorecardDraggableItems {\n\tou = \"ou\",\n\tdata = \"data\",\n}\n"]}
|
|
@@ -27,17 +27,17 @@ const legendDefinitionSchema = z.object({
|
|
|
27
27
|
isDefault: z.boolean().optional()
|
|
28
28
|
});
|
|
29
29
|
const scorecardViewOptionsSchema = z.object({
|
|
30
|
-
averageColumn: z.boolean(),
|
|
31
|
-
averageDisplayType: z.enum(["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]),
|
|
32
|
-
averageRow: z.boolean(),
|
|
33
|
-
emptyRows: z.boolean(),
|
|
34
|
-
highlightedIndicators: z.boolean(),
|
|
35
|
-
itemNumber: z.boolean(),
|
|
36
|
-
legend: z.boolean(),
|
|
37
|
-
showHierarchy: z.boolean(),
|
|
38
|
-
title: z.boolean(),
|
|
39
|
-
arrows: z.boolean(),
|
|
40
|
-
showDataInRows: z.boolean(),
|
|
30
|
+
averageColumn: z.boolean().optional(),
|
|
31
|
+
averageDisplayType: z.enum(["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]).optional(),
|
|
32
|
+
averageRow: z.boolean().optional(),
|
|
33
|
+
emptyRows: z.boolean().optional(),
|
|
34
|
+
highlightedIndicators: z.boolean().optional(),
|
|
35
|
+
itemNumber: z.boolean().optional(),
|
|
36
|
+
legend: z.boolean().optional(),
|
|
37
|
+
showHierarchy: z.boolean().optional(),
|
|
38
|
+
title: z.boolean().optional(),
|
|
39
|
+
arrows: z.boolean().optional(),
|
|
40
|
+
showDataInRows: z.boolean().optional(),
|
|
41
41
|
disableExpanding: z.boolean().optional()
|
|
42
42
|
});
|
|
43
43
|
const organisationUnitSelectionSchema = z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/Scorecard/schemas/config.ts"],"names":["ScorecardTableOrientation","ScorecardTableDimension","ScorecardDraggableItems"],"mappings":"AAAA,SAAS,SAAS;AAGX,MAAM,uBAAuB,EAAE,KAAK;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAEM,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACxC,OAAO,EAAE,OAAO;AAAA,EAChB,UAAU,EAAE,QAAQ;AAAA,EACpB,OAAO,EAAE;AAAA,IACR,EAAE,OAAO;AAAA,IACT,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC;AAAA,EAChD;AAAA,EACA,YAAY,EAAE;AAAA,IACb,EA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"zod\";\nimport type { RowData } from \"@tanstack/react-table\";\n\nexport const supportedDataSources = z.enum([\n\t\"indicator\",\n\t\"programIndicator\",\n\t\"dataSet\",\n\t\"dataElement\",\n\t\"customFunction\",\n\t\"sqlView\",\n]);\n\nexport const scorecardSharing = z.object({\n\towner: z.string(),\n\texternal: z.boolean(),\n\tusers: z.record(\n\t\tz.string(),\n\t\tz.object({ access: z.string(), id: z.string() }),\n\t),\n\tuserGroups: z.record(\n\t\tz.string(),\n\t\tz.object({ access: z.string(), id: z.string() }),\n\t),\n});\n\nexport type ScorecardSharing = z.infer<typeof scorecardSharing>;\n\nexport type SupportedDataSources = z.infer<typeof supportedDataSources>;\n\nexport const legendDefinitionSchema = z.object({\n\tid: z.string(),\n\tcolor: z.string(),\n\tname: z.string(),\n\tisDefault: z.boolean().optional(),\n});\n\nexport type LegendDefinition = z.infer<typeof legendDefinitionSchema>;\n\nexport const scorecardViewOptionsSchema = z.object({\n\taverageColumn: z.boolean(),\n\taverageDisplayType: z.enum([\"ALL\", \"ABOVE_AVERAGE\", \"BELOW_AVERAGE\"]),\n\taverageRow: z.boolean(),\n\temptyRows: z.boolean(),\n\thighlightedIndicators: z.boolean(),\n\titemNumber: z.boolean(),\n\tlegend: z.boolean(),\n\tshowHierarchy: z.boolean(),\n\ttitle: z.boolean(),\n\tarrows: z.boolean(),\n\tshowDataInRows: z.boolean(),\n\tdisableExpanding: z.boolean().optional(),\n});\n\nexport type ScorecardViewOptions = z.infer<typeof scorecardViewOptionsSchema>;\n\nexport const organisationUnitSelectionSchema = z.object({\n\tuserOrgUnit: z.boolean().optional(),\n\tuserSubUnit: z.boolean().optional(),\n\tuserSubX2Unit: z.boolean().optional(),\n\torgUnits: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t}),\n\t),\n\tgroups: z.array(z.string()).optional(),\n\tlevels: z.array(z.string()).optional(),\n});\n\nexport type OrgUnitSelection = z.infer<typeof organisationUnitSelectionSchema>;\n\nexport const periodSelectionSchema = z.object({\n\tperiods: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t}),\n\t),\n\ttype: z.string().optional(),\n});\n\nexport type PeriodSelection = z.infer<typeof periodSelectionSchema>;\n\nexport const legendSchema = z.object({\n\tlegendDefinitionId: z.string(),\n\tid: z.string(),\n\tstartValue: z.union([z.string(), z.number()]),\n\tendValue: z.union([z.string(), z.number()]),\n});\n\nexport type ScorecardLegend = z.infer<typeof legendSchema>;\n\nexport const specificTargetSchema = z.object({\n\ttype: z.enum([\"periods\", \"orgUnit\"]),\n\titems: z.array(z.string()),\n\tlegends: z.array(legendSchema),\n});\n\nexport type SpecificTarget = z.infer<typeof specificTargetSchema>;\n\nexport const orgUnitLevelLegendSchema = z.record(\n\tz.string(),\n\tz.array(legendSchema),\n);\n\nexport type OrgUnitLevelLegend = z.infer<typeof orgUnitLevelLegendSchema>;\n\nexport const dataSourceSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tlabel: z.string().optional(),\n\ttype: supportedDataSources,\n\tdisplayArrows: z.boolean(),\n\thighIsGood: z.boolean(),\n\teffectiveGap: z.number(),\n\tshowColors: z.boolean(),\n\tweight: z.number(),\n\tlegends: z.union([z.array(legendSchema), orgUnitLevelLegendSchema]),\n\tspecificTargets: z.array(specificTargetSchema).optional(),\n\tspecificTargetsSet: z.boolean().optional(),\n\tdescription: z.string().optional(),\n});\n\nexport type ScorecardDataSource = z.infer<typeof dataSourceSchema>;\n\nexport const dataHolderSchema = z.object({\n\tid: z.union([z.number(), z.string()]),\n\tdataSources: z.array(dataSourceSchema),\n});\n\nexport type ScorecardDataHolder = z.infer<typeof dataHolderSchema>;\n\nexport const dataGroupSchema = z.object({\n\tid: z.union([z.number(), z.string()]),\n\tdataHolders: z.array(dataHolderSchema),\n\tstyle: z.object({}),\n\ttitle: z.string(),\n});\n\nexport type ScorecardDataGroup = z.infer<typeof dataGroupSchema>;\n\nconst scorecardConfig = z.object({\n\tid: z.string(),\n\ttitle: z.string(),\n\tsubtitle: z.string().optional(),\n\tcustomHeader: z.string().optional(),\n\tdescription: z.string().optional(),\n\tlegendDefinitions: z.array(legendDefinitionSchema),\n\toptions: scorecardViewOptionsSchema,\n\torgUnitSelection: organisationUnitSelectionSchema,\n\tperiodSelection: periodSelectionSchema,\n\tdataSelection: z.object({\n\t\tdataGroups: z.array(dataGroupSchema),\n\t}),\n\thighlightedIndicators: z.array(dataSourceSchema),\n\tadditionalLabels: z.array(z.string()).optional(),\n\tsharing: scorecardSharing,\n});\n\nexport type ScorecardConfig = z.infer<typeof scorecardConfig>;\n\nconst scorecardStateSchema = z.object({\n\torgUnitSelection: organisationUnitSelectionSchema,\n\tperiodSelection: periodSelectionSchema,\n\toptions: scorecardViewOptionsSchema,\n\tnested: z.boolean().optional(),\n\thasOnePeriod: z.boolean().optional(),\n});\n\nexport type ScorecardState = z.infer<typeof scorecardStateSchema>;\n\nexport const scorecardAnalyticsData = z.object({\n\tdx: z.string().optional(),\n\tpe: z.string().optional(),\n\tou: z.string().optional(),\n\tvalue: z.string().optional(),\n});\n\nexport type ScorecardAnalyticsData = z.infer<typeof scorecardAnalyticsData>;\n\nexport const scorecardTableData = z.object({\n\tlabel: z.string(),\n\tdataValues: z.array(scorecardAnalyticsData),\n\tdataHolder: dataHolderSchema.optional(),\n\torgUnit: z\n\t\t.object({\n\t\t\tuid: z.string(),\n\t\t\tname: z.string(),\n\t\t\thierarchy: z.string(),\n\t\t})\n\t\t.optional(),\n\texpand: z.boolean().optional(),\n});\n\nexport type ScorecardTableData = z.infer<typeof scorecardTableData> & RowData;\n\nexport const scorecardTableCellData = z.object({\n\tdataSources: z.array(\n\t\tdataSourceSchema.extend({\n\t\t\tdata: z.object({\n\t\t\t\tprevious: z.number().optional(),\n\t\t\t\tcurrent: z.number().optional(),\n\t\t\t}),\n\t\t}),\n\t),\n\torgUnit: z.object({\n\t\tuid: z.string(),\n\t\tname: z.string(),\n\t\thierarchy: z.string(),\n\t}),\n\tperiod: z.string(),\n});\n\nexport type ScorecardTableCellData = z.infer<typeof scorecardTableCellData>;\n\nexport type SanitizedScorecardTableData = z.infer<typeof scorecardTableData>;\n\nexport enum ScorecardTableOrientation {\n\tORG_UNIT_VS_DATA = \"orgUnitsVsData\",\n\tDATA_VS_ORG_UNIT = \"dataVsOrgUnits\",\n}\n\nexport enum ScorecardTableDimension {\n\tGROUP = \"group\",\n\tORG_UNITS = \"orgUnits\",\n\tPERIODS = \"periods\",\n\tDATA = \"data\",\n}\n\nexport enum ScorecardDraggableItems {\n\tou = \"ou\",\n\tdata = \"data\",\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/Scorecard/schemas/config.ts"],"names":["ScorecardTableOrientation","ScorecardTableDimension","ScorecardDraggableItems"],"mappings":"AAAA,SAAS,SAAS;AAGX,MAAM,uBAAuB,EAAE,KAAK;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAEM,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACxC,OAAO,EAAE,OAAO;AAAA,EAChB,UAAU,EAAE,QAAQ;AAAA,EACpB,OAAO,EAAE;AAAA,IACR,EAAE,OAAO;AAAA,IACT,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC;AAAA,EAChD;AAAA,EACA,YAAY,EAAE;AAAA,IACb,EAAE,OAAO;AAAA,IACT,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC;AAAA,EAChD;AACD,CAAC;AAMM,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC9C,IAAI,EAAE,OAAO;AAAA,EACb,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AAAA,EACf,WAAW,EAAE,QAAQ,EAAE,SAAS;AACjC,CAAC;AAIM,MAAM,6BAA6B,EAAE,OAAO;AAAA,EAClD,eAAe,EAAE,QAAQ,EAAE,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AO;AAAA,IACP,KAAK,EAAE,OAAO;AAAA,IACd,MAAM,EAAE,OAAO;AAAA,IACf,WAAW,EAAE,OAAO;AAAA,EACrB,CAAC,EACA,SAAS;AAAA,EACX,QAAQ,EAAE,QAAQ,EAAE,SAAS;AAC9B,CAAC;AAIM,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC9C,aAAa,EAAE;AAAA,IACd,iBAAiB,OAAO;AAAA,MACvB,MAAM,EAAE,OAAO;AAAA,QACd,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,QAC9B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,MAC9B,CAAC;AAAA,IACF,CAAC;AAAA,EACF;AAAA,EACA,SAAS,EAAE,OAAO;AAAA,IACjB,KAAK,EAAE,OAAO;AAAA,IACd,MAAM,EAAE,OAAO;AAAA,IACf,WAAW,EAAE,OAAO;AAAA,EACrB,CAAC;AAAA,EACD,QAAQ,EAAE,OAAO;AAClB,CAAC;AAMM,IAAK,4BAAL,kBAAKA,+BAAL;AACN,EAAAA,2BAAA,sBAAmB;AACnB,EAAAA,2BAAA,sBAAmB;AAFR,SAAAA;AAAA,GAAA;AAKL,IAAK,0BAAL,kBAAKC,6BAAL;AACN,EAAAA,yBAAA,WAAQ;AACR,EAAAA,yBAAA,eAAY;AACZ,EAAAA,yBAAA,aAAU;AACV,EAAAA,yBAAA,UAAO;AAJI,SAAAA;AAAA,GAAA;AAOL,IAAK,0BAAL,kBAAKC,6BAAL;AACN,EAAAA,yBAAA,QAAK;AACL,EAAAA,yBAAA,UAAO;AAFI,SAAAA;AAAA,GAAA","sourcesContent":["import { z } from \"zod\";\nimport type { RowData } from \"@tanstack/react-table\";\n\nexport const supportedDataSources = z.enum([\n\t\"indicator\",\n\t\"programIndicator\",\n\t\"dataSet\",\n\t\"dataElement\",\n\t\"customFunction\",\n\t\"sqlView\",\n]);\n\nexport const scorecardSharing = z.object({\n\towner: z.string(),\n\texternal: z.boolean(),\n\tusers: z.record(\n\t\tz.string(),\n\t\tz.object({ access: z.string(), id: z.string() }),\n\t),\n\tuserGroups: z.record(\n\t\tz.string(),\n\t\tz.object({ access: z.string(), id: z.string() }),\n\t),\n});\n\nexport type ScorecardSharing = z.infer<typeof scorecardSharing>;\n\nexport type SupportedDataSources = z.infer<typeof supportedDataSources>;\n\nexport const legendDefinitionSchema = z.object({\n\tid: z.string(),\n\tcolor: z.string(),\n\tname: z.string(),\n\tisDefault: z.boolean().optional(),\n});\n\nexport type LegendDefinition = z.infer<typeof legendDefinitionSchema>;\n\nexport const scorecardViewOptionsSchema = z.object({\n\taverageColumn: z.boolean().optional(),\n\taverageDisplayType: z\n\t\t.enum([\"ALL\", \"ABOVE_AVERAGE\", \"BELOW_AVERAGE\"])\n\t\t.optional(),\n\taverageRow: z.boolean().optional(),\n\temptyRows: z.boolean().optional(),\n\thighlightedIndicators: z.boolean().optional(),\n\titemNumber: z.boolean().optional(),\n\tlegend: z.boolean().optional(),\n\tshowHierarchy: z.boolean().optional(),\n\ttitle: z.boolean().optional(),\n\tarrows: z.boolean().optional(),\n\tshowDataInRows: z.boolean().optional(),\n\tdisableExpanding: z.boolean().optional(),\n});\n\nexport type ScorecardViewOptions = z.infer<typeof scorecardViewOptionsSchema>;\n\nexport const organisationUnitSelectionSchema = z.object({\n\tuserOrgUnit: z.boolean().optional(),\n\tuserSubUnit: z.boolean().optional(),\n\tuserSubX2Unit: z.boolean().optional(),\n\torgUnits: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t}),\n\t),\n\tgroups: z.array(z.string()).optional(),\n\tlevels: z.array(z.string()).optional(),\n});\n\nexport type OrgUnitSelection = z.infer<typeof organisationUnitSelectionSchema>;\n\nexport const periodSelectionSchema = z.object({\n\tperiods: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t}),\n\t),\n\ttype: z.string().optional(),\n});\n\nexport type PeriodSelection = z.infer<typeof periodSelectionSchema>;\n\nexport const legendSchema = z.object({\n\tlegendDefinitionId: z.string(),\n\tid: z.string(),\n\tstartValue: z.union([z.string(), z.number()]),\n\tendValue: z.union([z.string(), z.number()]),\n});\n\nexport type ScorecardLegend = z.infer<typeof legendSchema>;\n\nexport const specificTargetSchema = z.object({\n\ttype: z.enum([\"periods\", \"orgUnit\"]),\n\titems: z.array(z.string()),\n\tlegends: z.array(legendSchema),\n});\n\nexport type SpecificTarget = z.infer<typeof specificTargetSchema>;\n\nexport const orgUnitLevelLegendSchema = z.record(\n\tz.string(),\n\tz.array(legendSchema),\n);\n\nexport type OrgUnitLevelLegend = z.infer<typeof orgUnitLevelLegendSchema>;\n\nexport const dataSourceSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tlabel: z.string().optional(),\n\ttype: supportedDataSources,\n\tdisplayArrows: z.boolean(),\n\thighIsGood: z.boolean(),\n\teffectiveGap: z.number(),\n\tshowColors: z.boolean(),\n\tweight: z.number(),\n\tlegends: z.union([z.array(legendSchema), orgUnitLevelLegendSchema]),\n\tspecificTargets: z.array(specificTargetSchema).optional(),\n\tspecificTargetsSet: z.boolean().optional(),\n\tdescription: z.string().optional(),\n});\n\nexport type ScorecardDataSource = z.infer<typeof dataSourceSchema>;\n\nexport const dataHolderSchema = z.object({\n\tid: z.union([z.number(), z.string()]),\n\tdataSources: z.array(dataSourceSchema),\n});\n\nexport type ScorecardDataHolder = z.infer<typeof dataHolderSchema>;\n\nexport const dataGroupSchema = z.object({\n\tid: z.union([z.number(), z.string()]),\n\tdataHolders: z.array(dataHolderSchema),\n\tstyle: z.object({}),\n\ttitle: z.string(),\n});\n\nexport type ScorecardDataGroup = z.infer<typeof dataGroupSchema>;\n\nconst scorecardConfig = z.object({\n\tid: z.string(),\n\ttitle: z.string(),\n\tsubtitle: z.string().optional(),\n\tcustomHeader: z.string().optional(),\n\tdescription: z.string().optional(),\n\tlegendDefinitions: z.array(legendDefinitionSchema),\n\toptions: scorecardViewOptionsSchema,\n\torgUnitSelection: organisationUnitSelectionSchema,\n\tperiodSelection: periodSelectionSchema,\n\tdataSelection: z.object({\n\t\tdataGroups: z.array(dataGroupSchema),\n\t}),\n\thighlightedIndicators: z.array(dataSourceSchema),\n\tadditionalLabels: z.array(z.string()).optional(),\n\tsharing: scorecardSharing,\n});\n\nexport type ScorecardConfig = z.infer<typeof scorecardConfig>;\n\nconst scorecardStateSchema = z.object({\n\torgUnitSelection: organisationUnitSelectionSchema,\n\tperiodSelection: periodSelectionSchema,\n\toptions: scorecardViewOptionsSchema,\n\tnested: z.boolean().optional(),\n\thasOnePeriod: z.boolean().optional(),\n});\n\nexport type ScorecardState = z.infer<typeof scorecardStateSchema>;\n\nexport const scorecardAnalyticsData = z.object({\n\tdx: z.string().optional(),\n\tpe: z.string().optional(),\n\tou: z.string().optional(),\n\tvalue: z.string().optional(),\n});\n\nexport type ScorecardAnalyticsData = z.infer<typeof scorecardAnalyticsData>;\n\nexport const scorecardTableData = z.object({\n\tlabel: z.string(),\n\tdataValues: z.array(scorecardAnalyticsData),\n\tdataHolder: dataHolderSchema.optional(),\n\torgUnit: z\n\t\t.object({\n\t\t\tuid: z.string(),\n\t\t\tname: z.string(),\n\t\t\thierarchy: z.string(),\n\t\t})\n\t\t.optional(),\n\texpand: z.boolean().optional(),\n});\n\nexport type ScorecardTableData = z.infer<typeof scorecardTableData> & RowData;\n\nexport const scorecardTableCellData = z.object({\n\tdataSources: z.array(\n\t\tdataSourceSchema.extend({\n\t\t\tdata: z.object({\n\t\t\t\tprevious: z.number().optional(),\n\t\t\t\tcurrent: z.number().optional(),\n\t\t\t}),\n\t\t}),\n\t),\n\torgUnit: z.object({\n\t\tuid: z.string(),\n\t\tname: z.string(),\n\t\thierarchy: z.string(),\n\t}),\n\tperiod: z.string(),\n});\n\nexport type ScorecardTableCellData = z.infer<typeof scorecardTableCellData>;\n\nexport type SanitizedScorecardTableData = z.infer<typeof scorecardTableData>;\n\nexport enum ScorecardTableOrientation {\n\tORG_UNIT_VS_DATA = \"orgUnitsVsData\",\n\tDATA_VS_ORG_UNIT = \"dataVsOrgUnits\",\n}\n\nexport enum ScorecardTableDimension {\n\tGROUP = \"group\",\n\tORG_UNITS = \"orgUnits\",\n\tPERIODS = \"periods\",\n\tDATA = \"data\",\n}\n\nexport enum ScorecardDraggableItems {\n\tou = \"ou\",\n\tdata = \"data\",\n}\n"]}
|
|
@@ -3,17 +3,17 @@ import type { ScorecardConfig } from "../schemas/config";
|
|
|
3
3
|
export declare function useScorecardConfig(): {
|
|
4
4
|
id: string;
|
|
5
5
|
options: {
|
|
6
|
-
legend
|
|
7
|
-
title
|
|
8
|
-
averageColumn
|
|
9
|
-
averageDisplayType
|
|
10
|
-
averageRow
|
|
11
|
-
emptyRows
|
|
12
|
-
highlightedIndicators
|
|
13
|
-
itemNumber
|
|
14
|
-
showHierarchy
|
|
15
|
-
arrows
|
|
16
|
-
showDataInRows
|
|
6
|
+
legend?: boolean | undefined;
|
|
7
|
+
title?: boolean | undefined;
|
|
8
|
+
averageColumn?: boolean | undefined;
|
|
9
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
10
|
+
averageRow?: boolean | undefined;
|
|
11
|
+
emptyRows?: boolean | undefined;
|
|
12
|
+
highlightedIndicators?: boolean | undefined;
|
|
13
|
+
itemNumber?: boolean | undefined;
|
|
14
|
+
showHierarchy?: boolean | undefined;
|
|
15
|
+
arrows?: boolean | undefined;
|
|
16
|
+
showDataInRows?: boolean | undefined;
|
|
17
17
|
disableExpanding?: boolean | undefined;
|
|
18
18
|
};
|
|
19
19
|
title: string;
|
|
@@ -3,17 +3,17 @@ import type { ScorecardState } from "../schemas/config";
|
|
|
3
3
|
export type ScorecardSetState = Dispatch<SetStateAction<ScorecardState>>;
|
|
4
4
|
export declare function useScorecardState(): {
|
|
5
5
|
options: {
|
|
6
|
-
legend
|
|
7
|
-
title
|
|
8
|
-
averageColumn
|
|
9
|
-
averageDisplayType
|
|
10
|
-
averageRow
|
|
11
|
-
emptyRows
|
|
12
|
-
highlightedIndicators
|
|
13
|
-
itemNumber
|
|
14
|
-
showHierarchy
|
|
15
|
-
arrows
|
|
16
|
-
showDataInRows
|
|
6
|
+
legend?: boolean | undefined;
|
|
7
|
+
title?: boolean | undefined;
|
|
8
|
+
averageColumn?: boolean | undefined;
|
|
9
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
10
|
+
averageRow?: boolean | undefined;
|
|
11
|
+
emptyRows?: boolean | undefined;
|
|
12
|
+
highlightedIndicators?: boolean | undefined;
|
|
13
|
+
itemNumber?: boolean | undefined;
|
|
14
|
+
showHierarchy?: boolean | undefined;
|
|
15
|
+
arrows?: boolean | undefined;
|
|
16
|
+
showDataInRows?: boolean | undefined;
|
|
17
17
|
disableExpanding?: boolean | undefined;
|
|
18
18
|
};
|
|
19
19
|
orgUnitSelection: {
|
|
@@ -67,43 +67,43 @@ export declare const legendDefinitionSchema: z.ZodObject<{
|
|
|
67
67
|
}>;
|
|
68
68
|
export type LegendDefinition = z.infer<typeof legendDefinitionSchema>;
|
|
69
69
|
export declare const scorecardViewOptionsSchema: z.ZodObject<{
|
|
70
|
-
averageColumn: z.ZodBoolean
|
|
71
|
-
averageDisplayType: z.ZodEnum<["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]
|
|
72
|
-
averageRow: z.ZodBoolean
|
|
73
|
-
emptyRows: z.ZodBoolean
|
|
74
|
-
highlightedIndicators: z.ZodBoolean
|
|
75
|
-
itemNumber: z.ZodBoolean
|
|
76
|
-
legend: z.ZodBoolean
|
|
77
|
-
showHierarchy: z.ZodBoolean
|
|
78
|
-
title: z.ZodBoolean
|
|
79
|
-
arrows: z.ZodBoolean
|
|
80
|
-
showDataInRows: z.ZodBoolean
|
|
70
|
+
averageColumn: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
averageDisplayType: z.ZodOptional<z.ZodEnum<["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]>>;
|
|
72
|
+
averageRow: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
emptyRows: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
highlightedIndicators: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
itemNumber: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
legend: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
showHierarchy: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
title: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
arrows: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
showDataInRows: z.ZodOptional<z.ZodBoolean>;
|
|
81
81
|
disableExpanding: z.ZodOptional<z.ZodBoolean>;
|
|
82
82
|
}, "strip", z.ZodTypeAny, {
|
|
83
|
-
legend
|
|
84
|
-
title
|
|
85
|
-
averageColumn
|
|
86
|
-
averageDisplayType
|
|
87
|
-
averageRow
|
|
88
|
-
emptyRows
|
|
89
|
-
highlightedIndicators
|
|
90
|
-
itemNumber
|
|
91
|
-
showHierarchy
|
|
92
|
-
arrows
|
|
93
|
-
showDataInRows
|
|
83
|
+
legend?: boolean | undefined;
|
|
84
|
+
title?: boolean | undefined;
|
|
85
|
+
averageColumn?: boolean | undefined;
|
|
86
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
87
|
+
averageRow?: boolean | undefined;
|
|
88
|
+
emptyRows?: boolean | undefined;
|
|
89
|
+
highlightedIndicators?: boolean | undefined;
|
|
90
|
+
itemNumber?: boolean | undefined;
|
|
91
|
+
showHierarchy?: boolean | undefined;
|
|
92
|
+
arrows?: boolean | undefined;
|
|
93
|
+
showDataInRows?: boolean | undefined;
|
|
94
94
|
disableExpanding?: boolean | undefined;
|
|
95
95
|
}, {
|
|
96
|
-
legend
|
|
97
|
-
title
|
|
98
|
-
averageColumn
|
|
99
|
-
averageDisplayType
|
|
100
|
-
averageRow
|
|
101
|
-
emptyRows
|
|
102
|
-
highlightedIndicators
|
|
103
|
-
itemNumber
|
|
104
|
-
showHierarchy
|
|
105
|
-
arrows
|
|
106
|
-
showDataInRows
|
|
96
|
+
legend?: boolean | undefined;
|
|
97
|
+
title?: boolean | undefined;
|
|
98
|
+
averageColumn?: boolean | undefined;
|
|
99
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
100
|
+
averageRow?: boolean | undefined;
|
|
101
|
+
emptyRows?: boolean | undefined;
|
|
102
|
+
highlightedIndicators?: boolean | undefined;
|
|
103
|
+
itemNumber?: boolean | undefined;
|
|
104
|
+
showHierarchy?: boolean | undefined;
|
|
105
|
+
arrows?: boolean | undefined;
|
|
106
|
+
showDataInRows?: boolean | undefined;
|
|
107
107
|
disableExpanding?: boolean | undefined;
|
|
108
108
|
}>;
|
|
109
109
|
export type ScorecardViewOptions = z.infer<typeof scorecardViewOptionsSchema>;
|
|
@@ -941,43 +941,43 @@ declare const scorecardConfig: z.ZodObject<{
|
|
|
941
941
|
isDefault?: boolean | undefined;
|
|
942
942
|
}>, "many">;
|
|
943
943
|
options: z.ZodObject<{
|
|
944
|
-
averageColumn: z.ZodBoolean
|
|
945
|
-
averageDisplayType: z.ZodEnum<["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]
|
|
946
|
-
averageRow: z.ZodBoolean
|
|
947
|
-
emptyRows: z.ZodBoolean
|
|
948
|
-
highlightedIndicators: z.ZodBoolean
|
|
949
|
-
itemNumber: z.ZodBoolean
|
|
950
|
-
legend: z.ZodBoolean
|
|
951
|
-
showHierarchy: z.ZodBoolean
|
|
952
|
-
title: z.ZodBoolean
|
|
953
|
-
arrows: z.ZodBoolean
|
|
954
|
-
showDataInRows: z.ZodBoolean
|
|
944
|
+
averageColumn: z.ZodOptional<z.ZodBoolean>;
|
|
945
|
+
averageDisplayType: z.ZodOptional<z.ZodEnum<["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]>>;
|
|
946
|
+
averageRow: z.ZodOptional<z.ZodBoolean>;
|
|
947
|
+
emptyRows: z.ZodOptional<z.ZodBoolean>;
|
|
948
|
+
highlightedIndicators: z.ZodOptional<z.ZodBoolean>;
|
|
949
|
+
itemNumber: z.ZodOptional<z.ZodBoolean>;
|
|
950
|
+
legend: z.ZodOptional<z.ZodBoolean>;
|
|
951
|
+
showHierarchy: z.ZodOptional<z.ZodBoolean>;
|
|
952
|
+
title: z.ZodOptional<z.ZodBoolean>;
|
|
953
|
+
arrows: z.ZodOptional<z.ZodBoolean>;
|
|
954
|
+
showDataInRows: z.ZodOptional<z.ZodBoolean>;
|
|
955
955
|
disableExpanding: z.ZodOptional<z.ZodBoolean>;
|
|
956
956
|
}, "strip", z.ZodTypeAny, {
|
|
957
|
-
legend
|
|
958
|
-
title
|
|
959
|
-
averageColumn
|
|
960
|
-
averageDisplayType
|
|
961
|
-
averageRow
|
|
962
|
-
emptyRows
|
|
963
|
-
highlightedIndicators
|
|
964
|
-
itemNumber
|
|
965
|
-
showHierarchy
|
|
966
|
-
arrows
|
|
967
|
-
showDataInRows
|
|
957
|
+
legend?: boolean | undefined;
|
|
958
|
+
title?: boolean | undefined;
|
|
959
|
+
averageColumn?: boolean | undefined;
|
|
960
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
961
|
+
averageRow?: boolean | undefined;
|
|
962
|
+
emptyRows?: boolean | undefined;
|
|
963
|
+
highlightedIndicators?: boolean | undefined;
|
|
964
|
+
itemNumber?: boolean | undefined;
|
|
965
|
+
showHierarchy?: boolean | undefined;
|
|
966
|
+
arrows?: boolean | undefined;
|
|
967
|
+
showDataInRows?: boolean | undefined;
|
|
968
968
|
disableExpanding?: boolean | undefined;
|
|
969
969
|
}, {
|
|
970
|
-
legend
|
|
971
|
-
title
|
|
972
|
-
averageColumn
|
|
973
|
-
averageDisplayType
|
|
974
|
-
averageRow
|
|
975
|
-
emptyRows
|
|
976
|
-
highlightedIndicators
|
|
977
|
-
itemNumber
|
|
978
|
-
showHierarchy
|
|
979
|
-
arrows
|
|
980
|
-
showDataInRows
|
|
970
|
+
legend?: boolean | undefined;
|
|
971
|
+
title?: boolean | undefined;
|
|
972
|
+
averageColumn?: boolean | undefined;
|
|
973
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
974
|
+
averageRow?: boolean | undefined;
|
|
975
|
+
emptyRows?: boolean | undefined;
|
|
976
|
+
highlightedIndicators?: boolean | undefined;
|
|
977
|
+
itemNumber?: boolean | undefined;
|
|
978
|
+
showHierarchy?: boolean | undefined;
|
|
979
|
+
arrows?: boolean | undefined;
|
|
980
|
+
showDataInRows?: boolean | undefined;
|
|
981
981
|
disableExpanding?: boolean | undefined;
|
|
982
982
|
}>;
|
|
983
983
|
orgUnitSelection: z.ZodObject<{
|
|
@@ -1628,17 +1628,17 @@ declare const scorecardConfig: z.ZodObject<{
|
|
|
1628
1628
|
}, "strip", z.ZodTypeAny, {
|
|
1629
1629
|
id: string;
|
|
1630
1630
|
options: {
|
|
1631
|
-
legend
|
|
1632
|
-
title
|
|
1633
|
-
averageColumn
|
|
1634
|
-
averageDisplayType
|
|
1635
|
-
averageRow
|
|
1636
|
-
emptyRows
|
|
1637
|
-
highlightedIndicators
|
|
1638
|
-
itemNumber
|
|
1639
|
-
showHierarchy
|
|
1640
|
-
arrows
|
|
1641
|
-
showDataInRows
|
|
1631
|
+
legend?: boolean | undefined;
|
|
1632
|
+
title?: boolean | undefined;
|
|
1633
|
+
averageColumn?: boolean | undefined;
|
|
1634
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
1635
|
+
averageRow?: boolean | undefined;
|
|
1636
|
+
emptyRows?: boolean | undefined;
|
|
1637
|
+
highlightedIndicators?: boolean | undefined;
|
|
1638
|
+
itemNumber?: boolean | undefined;
|
|
1639
|
+
showHierarchy?: boolean | undefined;
|
|
1640
|
+
arrows?: boolean | undefined;
|
|
1641
|
+
showDataInRows?: boolean | undefined;
|
|
1642
1642
|
disableExpanding?: boolean | undefined;
|
|
1643
1643
|
};
|
|
1644
1644
|
title: string;
|
|
@@ -1761,17 +1761,17 @@ declare const scorecardConfig: z.ZodObject<{
|
|
|
1761
1761
|
}, {
|
|
1762
1762
|
id: string;
|
|
1763
1763
|
options: {
|
|
1764
|
-
legend
|
|
1765
|
-
title
|
|
1766
|
-
averageColumn
|
|
1767
|
-
averageDisplayType
|
|
1768
|
-
averageRow
|
|
1769
|
-
emptyRows
|
|
1770
|
-
highlightedIndicators
|
|
1771
|
-
itemNumber
|
|
1772
|
-
showHierarchy
|
|
1773
|
-
arrows
|
|
1774
|
-
showDataInRows
|
|
1764
|
+
legend?: boolean | undefined;
|
|
1765
|
+
title?: boolean | undefined;
|
|
1766
|
+
averageColumn?: boolean | undefined;
|
|
1767
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
1768
|
+
averageRow?: boolean | undefined;
|
|
1769
|
+
emptyRows?: boolean | undefined;
|
|
1770
|
+
highlightedIndicators?: boolean | undefined;
|
|
1771
|
+
itemNumber?: boolean | undefined;
|
|
1772
|
+
showHierarchy?: boolean | undefined;
|
|
1773
|
+
arrows?: boolean | undefined;
|
|
1774
|
+
showDataInRows?: boolean | undefined;
|
|
1775
1775
|
disableExpanding?: boolean | undefined;
|
|
1776
1776
|
};
|
|
1777
1777
|
title: string;
|
|
@@ -1947,60 +1947,60 @@ declare const scorecardStateSchema: z.ZodObject<{
|
|
|
1947
1947
|
type?: string | undefined;
|
|
1948
1948
|
}>;
|
|
1949
1949
|
options: z.ZodObject<{
|
|
1950
|
-
averageColumn: z.ZodBoolean
|
|
1951
|
-
averageDisplayType: z.ZodEnum<["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]
|
|
1952
|
-
averageRow: z.ZodBoolean
|
|
1953
|
-
emptyRows: z.ZodBoolean
|
|
1954
|
-
highlightedIndicators: z.ZodBoolean
|
|
1955
|
-
itemNumber: z.ZodBoolean
|
|
1956
|
-
legend: z.ZodBoolean
|
|
1957
|
-
showHierarchy: z.ZodBoolean
|
|
1958
|
-
title: z.ZodBoolean
|
|
1959
|
-
arrows: z.ZodBoolean
|
|
1960
|
-
showDataInRows: z.ZodBoolean
|
|
1950
|
+
averageColumn: z.ZodOptional<z.ZodBoolean>;
|
|
1951
|
+
averageDisplayType: z.ZodOptional<z.ZodEnum<["ALL", "ABOVE_AVERAGE", "BELOW_AVERAGE"]>>;
|
|
1952
|
+
averageRow: z.ZodOptional<z.ZodBoolean>;
|
|
1953
|
+
emptyRows: z.ZodOptional<z.ZodBoolean>;
|
|
1954
|
+
highlightedIndicators: z.ZodOptional<z.ZodBoolean>;
|
|
1955
|
+
itemNumber: z.ZodOptional<z.ZodBoolean>;
|
|
1956
|
+
legend: z.ZodOptional<z.ZodBoolean>;
|
|
1957
|
+
showHierarchy: z.ZodOptional<z.ZodBoolean>;
|
|
1958
|
+
title: z.ZodOptional<z.ZodBoolean>;
|
|
1959
|
+
arrows: z.ZodOptional<z.ZodBoolean>;
|
|
1960
|
+
showDataInRows: z.ZodOptional<z.ZodBoolean>;
|
|
1961
1961
|
disableExpanding: z.ZodOptional<z.ZodBoolean>;
|
|
1962
1962
|
}, "strip", z.ZodTypeAny, {
|
|
1963
|
-
legend
|
|
1964
|
-
title
|
|
1965
|
-
averageColumn
|
|
1966
|
-
averageDisplayType
|
|
1967
|
-
averageRow
|
|
1968
|
-
emptyRows
|
|
1969
|
-
highlightedIndicators
|
|
1970
|
-
itemNumber
|
|
1971
|
-
showHierarchy
|
|
1972
|
-
arrows
|
|
1973
|
-
showDataInRows
|
|
1963
|
+
legend?: boolean | undefined;
|
|
1964
|
+
title?: boolean | undefined;
|
|
1965
|
+
averageColumn?: boolean | undefined;
|
|
1966
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
1967
|
+
averageRow?: boolean | undefined;
|
|
1968
|
+
emptyRows?: boolean | undefined;
|
|
1969
|
+
highlightedIndicators?: boolean | undefined;
|
|
1970
|
+
itemNumber?: boolean | undefined;
|
|
1971
|
+
showHierarchy?: boolean | undefined;
|
|
1972
|
+
arrows?: boolean | undefined;
|
|
1973
|
+
showDataInRows?: boolean | undefined;
|
|
1974
1974
|
disableExpanding?: boolean | undefined;
|
|
1975
1975
|
}, {
|
|
1976
|
-
legend
|
|
1977
|
-
title
|
|
1978
|
-
averageColumn
|
|
1979
|
-
averageDisplayType
|
|
1980
|
-
averageRow
|
|
1981
|
-
emptyRows
|
|
1982
|
-
highlightedIndicators
|
|
1983
|
-
itemNumber
|
|
1984
|
-
showHierarchy
|
|
1985
|
-
arrows
|
|
1986
|
-
showDataInRows
|
|
1976
|
+
legend?: boolean | undefined;
|
|
1977
|
+
title?: boolean | undefined;
|
|
1978
|
+
averageColumn?: boolean | undefined;
|
|
1979
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
1980
|
+
averageRow?: boolean | undefined;
|
|
1981
|
+
emptyRows?: boolean | undefined;
|
|
1982
|
+
highlightedIndicators?: boolean | undefined;
|
|
1983
|
+
itemNumber?: boolean | undefined;
|
|
1984
|
+
showHierarchy?: boolean | undefined;
|
|
1985
|
+
arrows?: boolean | undefined;
|
|
1986
|
+
showDataInRows?: boolean | undefined;
|
|
1987
1987
|
disableExpanding?: boolean | undefined;
|
|
1988
1988
|
}>;
|
|
1989
1989
|
nested: z.ZodOptional<z.ZodBoolean>;
|
|
1990
1990
|
hasOnePeriod: z.ZodOptional<z.ZodBoolean>;
|
|
1991
1991
|
}, "strip", z.ZodTypeAny, {
|
|
1992
1992
|
options: {
|
|
1993
|
-
legend
|
|
1994
|
-
title
|
|
1995
|
-
averageColumn
|
|
1996
|
-
averageDisplayType
|
|
1997
|
-
averageRow
|
|
1998
|
-
emptyRows
|
|
1999
|
-
highlightedIndicators
|
|
2000
|
-
itemNumber
|
|
2001
|
-
showHierarchy
|
|
2002
|
-
arrows
|
|
2003
|
-
showDataInRows
|
|
1993
|
+
legend?: boolean | undefined;
|
|
1994
|
+
title?: boolean | undefined;
|
|
1995
|
+
averageColumn?: boolean | undefined;
|
|
1996
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
1997
|
+
averageRow?: boolean | undefined;
|
|
1998
|
+
emptyRows?: boolean | undefined;
|
|
1999
|
+
highlightedIndicators?: boolean | undefined;
|
|
2000
|
+
itemNumber?: boolean | undefined;
|
|
2001
|
+
showHierarchy?: boolean | undefined;
|
|
2002
|
+
arrows?: boolean | undefined;
|
|
2003
|
+
showDataInRows?: boolean | undefined;
|
|
2004
2004
|
disableExpanding?: boolean | undefined;
|
|
2005
2005
|
};
|
|
2006
2006
|
orgUnitSelection: {
|
|
@@ -2023,17 +2023,17 @@ declare const scorecardStateSchema: z.ZodObject<{
|
|
|
2023
2023
|
hasOnePeriod?: boolean | undefined;
|
|
2024
2024
|
}, {
|
|
2025
2025
|
options: {
|
|
2026
|
-
legend
|
|
2027
|
-
title
|
|
2028
|
-
averageColumn
|
|
2029
|
-
averageDisplayType
|
|
2030
|
-
averageRow
|
|
2031
|
-
emptyRows
|
|
2032
|
-
highlightedIndicators
|
|
2033
|
-
itemNumber
|
|
2034
|
-
showHierarchy
|
|
2035
|
-
arrows
|
|
2036
|
-
showDataInRows
|
|
2026
|
+
legend?: boolean | undefined;
|
|
2027
|
+
title?: boolean | undefined;
|
|
2028
|
+
averageColumn?: boolean | undefined;
|
|
2029
|
+
averageDisplayType?: "ALL" | "ABOVE_AVERAGE" | "BELOW_AVERAGE" | undefined;
|
|
2030
|
+
averageRow?: boolean | undefined;
|
|
2031
|
+
emptyRows?: boolean | undefined;
|
|
2032
|
+
highlightedIndicators?: boolean | undefined;
|
|
2033
|
+
itemNumber?: boolean | undefined;
|
|
2034
|
+
showHierarchy?: boolean | undefined;
|
|
2035
|
+
arrows?: boolean | undefined;
|
|
2036
|
+
showDataInRows?: boolean | undefined;
|
|
2037
2037
|
disableExpanding?: boolean | undefined;
|
|
2038
2038
|
};
|
|
2039
2039
|
orgUnitSelection: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/components/Scorecard/schemas/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,eAAO,MAAM,oBAAoB,qGAO/B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAKjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/components/Scorecard/schemas/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,eAAO,MAAM,oBAAoB,qGAO/B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW3B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAejC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7E,oBAAY,yBAAyB;IACpC,gBAAgB,mBAAmB;IACnC,gBAAgB,mBAAmB;CACnC;AAED,oBAAY,uBAAuB;IAClC,KAAK,UAAU;IACf,SAAS,aAAa;IACtB,OAAO,YAAY;IACnB,IAAI,SAAS;CACb;AAED,oBAAY,uBAAuB;IAClC,EAAE,OAAO;IACT,IAAI,SAAS;CACb"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hisptz/dhis2-analytics",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.27",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"tsup": "^8.0.1",
|
|
45
45
|
"typescript": "^5.3.3",
|
|
46
46
|
"usehooks-ts": "^2.9.2",
|
|
47
|
-
"@repo/
|
|
48
|
-
"@repo/
|
|
47
|
+
"@repo/typescript-config": "0.0.0",
|
|
48
|
+
"@repo/eslint-config": "0.0.0"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"react-spring": "^9.6.1",
|
|
70
70
|
"screenfull": "^6.0.2",
|
|
71
71
|
"zod": "^3.23.8",
|
|
72
|
-
"@hisptz/dhis2-ui": "2.0.
|
|
72
|
+
"@hisptz/dhis2-ui": "2.0.21",
|
|
73
73
|
"@hisptz/dhis2-utils": "2.0.7"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|