@hisptz/dhis2-scorecard 1.0.9 → 1.0.10
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/Scorecard.stories.js +10 -3
- package/dist/Scorecard.stories.js.map +1 -1
- package/dist/ScorecardPrintArea.stories.js +1 -1
- package/dist/ScorecardPrintArea.stories.js.map +1 -1
- package/dist/components/ScorecardPrint/components/ScorecardDownloadButton.js +23 -25
- package/dist/components/ScorecardPrint/components/ScorecardDownloadButton.js.map +1 -1
- package/dist/components/ScorecardPrint/components/ScorecardPreviewArea.js +17 -2
- package/dist/components/ScorecardPrint/components/ScorecardPreviewArea.js.map +1 -1
- package/dist/components/ScorecardTable/components/DataFooterCell.js +3 -0
- package/dist/components/ScorecardTable/components/DataFooterCell.js.map +1 -1
- package/dist/components/StateProvider.js +18 -2
- package/dist/components/StateProvider.js.map +1 -1
- package/dist/esm/Scorecard.stories.js +10 -3
- package/dist/esm/Scorecard.stories.js.map +1 -1
- package/dist/esm/ScorecardPrintArea.stories.js +1 -1
- package/dist/esm/ScorecardPrintArea.stories.js.map +1 -1
- package/dist/esm/components/ScorecardPrint/components/ScorecardDownloadButton.js +24 -26
- package/dist/esm/components/ScorecardPrint/components/ScorecardDownloadButton.js.map +1 -1
- package/dist/esm/components/ScorecardPrint/components/ScorecardPreviewArea.js +17 -2
- package/dist/esm/components/ScorecardPrint/components/ScorecardPreviewArea.js.map +1 -1
- package/dist/esm/components/ScorecardTable/components/DataFooterCell.js +3 -0
- package/dist/esm/components/ScorecardTable/components/DataFooterCell.js.map +1 -1
- package/dist/esm/components/StateProvider.js +19 -3
- package/dist/esm/components/StateProvider.js.map +1 -1
- package/dist/types/components/ScorecardPrint/components/ScorecardDownloadButton.d.ts.map +1 -1
- package/dist/types/components/ScorecardPrint/components/ScorecardPreviewArea.d.ts.map +1 -1
- package/dist/types/components/ScorecardTable/components/DataFooterCell.d.ts.map +1 -1
- package/dist/types/components/StateProvider.d.ts +2 -1
- package/dist/types/components/StateProvider.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/StateProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/StateProvider.tsx"],"names":["initialState"],"mappings":"AA8CS;AA7CT,SAAyB,mBAAmB;AAC5C,SAA0B,YAAY,yBAAyB;AAC/D,SAAS,0BAA0B;AACnC,SAAS,iCAAiC;AASnC,SAAS,uBAAuB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAgC;AAC/B,QAAM,YAAY;AAAA,IACjB,CAAC,EAAE,IAAI,MAAuB;AAC7B;AAAA,QACC;AAAA,QACA,gBAAgB,0BAA0B,MAAM;AAAA,MACjD;AAAA,IACD;AAAA,IACA,CAAC,cAAc,MAAM;AAAA,EACtB;AACA,QAAM,+BAA+B;AAAA,IACpC,CAAC,EAAE,KAAK,SAAS,MAChB,CAACA,kBAAiC;AACjC,UACC,SAAS,YAAY,kBAAkB,EAAE,aAAa,MACrD;AACD,YAAI,oBAAoBA,aAAY;AAAA,MACrC;AAAA,IACD;AAAA,EACF;AAEA,MAAI,CAAC,gBAAgB;AACpB;AAAA,MACC,gBAAgB,0BAA0B,MAAM;AAAA,IACjD;AAAA,EACD;AAEA,MAAI,gBAAgB;AACnB,WAAO,oBAAC,cAAW,iBAAiB,WAAY,UAAS;AAAA,EAC1D;AAEA,SAAO;AACR","sourcesContent":["import type { ScorecardConfig, ScorecardState } from \"../schemas/config\";\nimport { type ReactNode, useCallback } from \"react\";\nimport { MutableSnapshot, RecoilRoot, useRecoilCallback } from \"recoil\";\nimport { scorecardStateAtom } from \"../state\";\nimport { getInitialStateFromConfig } from \"../utils\";\n\nexport interface ScorecardStateProviderProps {\n\tinitialState?: ScorecardState;\n\tconfig: ScorecardConfig;\n\tchildren: ReactNode;\n\twithRecoilRoot?: boolean;\n}\n\nexport function ScorecardStateProvider({\n\tchildren,\n\tinitialState,\n\tconfig,\n\twithRecoilRoot,\n}: ScorecardStateProviderProps) {\n\tconst initState = useCallback(\n\t\t({ set }: MutableSnapshot) => {\n\t\t\tset(\n\t\t\t\tscorecardStateAtom,\n\t\t\t\tinitialState ?? getInitialStateFromConfig(config),\n\t\t\t);\n\t\t},\n\t\t[initialState, config],\n\t);\n\tconst initializeStateWithoutRecoil = useRecoilCallback(\n\t\t({ set, snapshot }) =>\n\t\t\t(initialState: ScorecardState) => {\n\t\t\t\tif (\n\t\t\t\t\tsnapshot.getLoadable(scorecardStateAtom).contents === null\n\t\t\t\t) {\n\t\t\t\t\tset(scorecardStateAtom, initialState);\n\t\t\t\t}\n\t\t\t},\n\t);\n\n\tif (!withRecoilRoot) {\n\t\tinitializeStateWithoutRecoil(\n\t\t\tinitialState ?? getInitialStateFromConfig(config),\n\t\t);\n\t}\n\n\tif (withRecoilRoot) {\n\t\treturn <RecoilRoot initializeState={initState}>{children}</RecoilRoot>;\n\t}\n\n\treturn children;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScorecardDownloadButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScorecardPrint/components/ScorecardDownloadButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScorecardDownloadButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScorecardPrint/components/ScorecardDownloadButton.tsx"],"names":[],"mappings":"AAoFA,wBAAgB,uBAAuB,4CAgCtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScorecardPreviewArea.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScorecardPrint/components/ScorecardPreviewArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ScorecardPreviewArea.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScorecardPrint/components/ScorecardPreviewArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAQ,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAapD,eAAO,MAAM,oBAAoB;gBAGpB,UAAU,cAAc,CAAC;EA2CpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataFooterCell.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScorecardTable/components/DataFooterCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAEX,wBAAwB,EACxB,kBAAkB,EAClB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataFooterCell.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScorecardTable/components/DataFooterCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAEX,wBAAwB,EACxB,kBAAkB,EAClB,MAAM,yBAAyB,CAAC;AAmJjC,wBAAgB,cAAc,CAAC,EAC9B,KAAK,EACL,MAAM,GACN,EAAE,aAAa,CAAC,kBAAkB,EAAE,wBAAwB,CAAC,2CA0B7D"}
|
|
@@ -4,6 +4,7 @@ export interface ScorecardStateProviderProps {
|
|
|
4
4
|
initialState?: ScorecardState;
|
|
5
5
|
config: ScorecardConfig;
|
|
6
6
|
children: ReactNode;
|
|
7
|
+
withRecoilRoot?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare function ScorecardStateProvider({ children, initialState, config, }: ScorecardStateProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function ScorecardStateProvider({ children, initialState, config, withRecoilRoot, }: ScorecardStateProviderProps): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
9
10
|
//# sourceMappingURL=StateProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateProvider.d.ts","sourceRoot":"","sources":["../../../src/components/StateProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAKpD,MAAM,WAAW,2BAA2B;IAC3C,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"StateProvider.d.ts","sourceRoot":"","sources":["../../../src/components/StateProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAKpD,MAAM,WAAW,2BAA2B;IAC3C,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,sBAAsB,CAAC,EACtC,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,cAAc,GACd,EAAE,2BAA2B,gHAgC7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hisptz/dhis2-scorecard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"recoil": "^0.7.7",
|
|
63
63
|
"xlsx": "^0.18.5",
|
|
64
64
|
"zod": "^3.23.8",
|
|
65
|
+
"@hisptz/dhis2-analytics": "2.0.46",
|
|
65
66
|
"@hisptz/dhis2-ui": "2.0.27",
|
|
66
|
-
"@hisptz/dhis2-utils": "2.0.8"
|
|
67
|
-
"@hisptz/dhis2-analytics": "2.0.46"
|
|
67
|
+
"@hisptz/dhis2-utils": "2.0.8"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"@dhis2/app-runtime": "^3.10.2",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"classnames": "^2.5.1",
|
|
75
75
|
"eslint": "^8.56.0",
|
|
76
76
|
"lodash": "^4.17.21",
|
|
77
|
-
"react": "^18
|
|
77
|
+
"react": "^18",
|
|
78
78
|
"styled-jsx": "^5.1.2",
|
|
79
79
|
"tsup": "^8.0.1",
|
|
80
80
|
"typescript": "^5.3.3",
|