@herca/rn-kit 0.1.9 → 0.1.11
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/README.md +1 -1
- package/lib/module/CheckBox/CheckBox.js +21 -1
- package/lib/module/CheckBox/CheckBox.js.map +1 -1
- package/lib/module/Chip/Chip.js +10 -5
- package/lib/module/Chip/Chip.js.map +1 -1
- package/lib/module/Drawing/Drawing.js +104 -14
- package/lib/module/Drawing/Drawing.js.map +1 -1
- package/lib/module/Drawing/README.md +31 -0
- package/lib/module/Drawing/type.js +2 -0
- package/lib/module/Drawing/type.js.map +1 -0
- package/lib/module/FileView/PdfView.js +12 -19
- package/lib/module/FileView/PdfView.js.map +1 -1
- package/lib/module/Modal/Modal.js +19 -8
- package/lib/module/Modal/Modal.js.map +1 -1
- package/lib/module/Provider/FooterProvider.js +4 -1
- package/lib/module/Provider/FooterProvider.js.map +1 -1
- package/lib/module/Select/Select.js +20 -13
- package/lib/module/Select/Select.js.map +1 -1
- package/lib/module/Tab/TabItem.js +1 -5
- package/lib/module/Tab/TabItem.js.map +1 -1
- package/lib/module/Ui/Footer.js +11 -9
- package/lib/module/Ui/Footer.js.map +1 -1
- package/lib/module/hooks/useOptionalFocusEffect.js +19 -0
- package/lib/module/hooks/useOptionalFocusEffect.js.map +1 -0
- package/lib/typescript/src/CheckBox/CheckBox.d.ts.map +1 -1
- package/lib/typescript/src/Chip/Chip.d.ts.map +1 -1
- package/lib/typescript/src/Chip/type.d.ts +2 -0
- package/lib/typescript/src/Chip/type.d.ts.map +1 -1
- package/lib/typescript/src/Drawing/Drawing.d.ts +7 -1
- package/lib/typescript/src/Drawing/Drawing.d.ts.map +1 -1
- package/lib/typescript/src/Drawing/type.d.ts +1 -0
- package/lib/typescript/src/Drawing/type.d.ts.map +1 -0
- package/lib/typescript/src/FileView/PdfView.d.ts +11 -1
- package/lib/typescript/src/FileView/PdfView.d.ts.map +1 -1
- package/lib/typescript/src/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/src/Provider/FooterProvider.d.ts.map +1 -1
- package/lib/typescript/src/Select/Select.d.ts +1 -1
- package/lib/typescript/src/Select/Select.d.ts.map +1 -1
- package/lib/typescript/src/Select/type.d.ts +2 -0
- package/lib/typescript/src/Select/type.d.ts.map +1 -1
- package/lib/typescript/src/Tab/TabItem.d.ts +3 -1
- package/lib/typescript/src/Tab/TabItem.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Footer.d.ts +1 -1
- package/lib/typescript/src/Ui/Footer.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useOptionalFocusEffect.d.ts +2 -0
- package/lib/typescript/src/hooks/useOptionalFocusEffect.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/CheckBox/CheckBox.tsx +21 -1
- package/src/Chip/Chip.tsx +9 -3
- package/src/Chip/type.tsx +2 -0
- package/src/Drawing/Drawing.tsx +114 -13
- package/src/Drawing/README.md +31 -0
- package/src/Drawing/type.tsx +0 -0
- package/src/FileView/PdfView.tsx +22 -19
- package/src/Modal/Modal.tsx +16 -7
- package/src/Provider/FooterProvider.tsx +2 -1
- package/src/Select/Select.tsx +20 -11
- package/src/Select/type.tsx +2 -0
- package/src/Tab/TabItem.tsx +3 -4
- package/src/Ui/Footer.tsx +14 -9
- package/src/hooks/useOptionalFocusEffect.ts +18 -0
package/lib/module/Ui/Footer.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
// Footer.tsx
|
|
4
|
+
import React, { useMemo } from 'react';
|
|
5
|
+
import { SafeAreaView, StyleSheet } from 'react-native';
|
|
6
6
|
import { useFooter } from "../Provider/Provider.js";
|
|
7
|
+
import Color from "../Color/Color.js";
|
|
8
|
+
import { useOptionalFocusEffect } from "../hooks/useOptionalFocusEffect.js";
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
const Footer = ({
|
|
9
11
|
children,
|
|
@@ -12,14 +14,14 @@ const Footer = ({
|
|
|
12
14
|
const {
|
|
13
15
|
setFooter
|
|
14
16
|
} = useFooter();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const footerElement = useMemo(() => /*#__PURE__*/_jsx(SafeAreaView, {
|
|
18
|
+
style: [styles.container, style],
|
|
19
|
+
children: children
|
|
20
|
+
}), [children, style]);
|
|
21
|
+
useOptionalFocusEffect(() => {
|
|
20
22
|
setFooter(footerElement);
|
|
21
23
|
return () => setFooter(null);
|
|
22
|
-
}
|
|
24
|
+
});
|
|
23
25
|
return null;
|
|
24
26
|
};
|
|
25
27
|
export default Footer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","useMemo","SafeAreaView","StyleSheet","useFooter","Color","useOptionalFocusEffect","jsx","_jsx","Footer","children","style","setFooter","footerElement","styles","container","create","backgroundColor","base","white100","position","bottom","left","right","zIndex"],"sourceRoot":"../../../src","sources":["Ui/Footer.tsx"],"mappings":";;AAAA;AACA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,YAAY,EAAEC,UAAU,QAAwB,cAAc;AACvE,SAASC,SAAS,QAAQ,yBAAsB;AAChD,OAAOC,KAAK,MAAM,mBAAgB;AAClC,SAASC,sBAAsB,QAAQ,oCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOzE,MAAMC,MAA6B,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC7D,MAAM;IAAEC;EAAU,CAAC,GAAGR,SAAS,CAAC,CAAC;EAEjC,MAAMS,aAAa,GAAGZ,OAAO,CAC3B,mBACEO,IAAA,CAACN,YAAY;IAACS,KAAK,EAAE,CAACG,MAAM,CAACC,SAAS,EAAEJ,KAAK,CAAE;IAAAD,QAAA,EAAEA;EAAQ,CAAe,CACzE,EACD,CAACA,QAAQ,EAAEC,KAAK,CAClB,CAAC;EAEDL,sBAAsB,CAAC,MAAM;IAC3BM,SAAS,CAACC,aAAa,CAAC;IACxB,OAAO,MAAMD,SAAS,CAAC,IAAI,CAAC;EAC9B,CAAC,CAAC;EAEF,OAAO,IAAI;AACb,CAAC;AAED,eAAeH,MAAM;AAErB,MAAMK,MAAM,GAAGX,UAAU,CAACa,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,eAAe,EAAEZ,KAAK,CAACa,IAAI,CAACC,QAAQ;IACpCC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// src/hooks/useOptionalFocusEffect.ts
|
|
4
|
+
import { useContext, useEffect, useCallback } from 'react';
|
|
5
|
+
import { NavigationContext, useFocusEffect } from '@react-navigation/native';
|
|
6
|
+
export function useOptionalFocusEffect(callback) {
|
|
7
|
+
const navigation = useContext(NavigationContext);
|
|
8
|
+
const effect = useCallback(callback, [callback]);
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
11
|
+
if (navigation) {
|
|
12
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
13
|
+
useFocusEffect(effect);
|
|
14
|
+
} else {
|
|
15
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
16
|
+
useEffect(() => effect(), [effect]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=useOptionalFocusEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useContext","useEffect","useCallback","NavigationContext","useFocusEffect","useOptionalFocusEffect","callback","navigation","effect"],"sourceRoot":"../../../src","sources":["hooks/useOptionalFocusEffect.ts"],"mappings":";;AAAA;AACA,SAASA,UAAU,EAAEC,SAAS,EAAEC,WAAW,QAAQ,OAAO;AAC1D,SAASC,iBAAiB,EAAEC,cAAc,QAAQ,0BAA0B;AAE5E,OAAO,SAASC,sBAAsBA,CAACC,QAAmC,EAAE;EAC1E,MAAMC,UAAU,GAAGP,UAAU,CAACG,iBAAiB,CAAC;EAEhD,MAAMK,MAAM,GAAGN,WAAW,CAACI,QAAQ,EAAE,CAACA,QAAQ,CAAC,CAAC;;EAEhD;EACA,IAAIC,UAAU,EAAE;IACd;IACAH,cAAc,CAACI,MAAM,CAAC;EACxB,CAAC,MAAM;IACL;IACAP,SAAS,CAAC,MAAMO,MAAM,CAAC,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EACrC;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckBox.d.ts","sourceRoot":"","sources":["../../../../src/CheckBox/CheckBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckBox.d.ts","sourceRoot":"","sources":["../../../../src/CheckBox/CheckBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAErC;AAkBD,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAuCrC,CAAC;AA8BF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../src/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAEL,KAAK,SAAS,EAGf,MAAM,QAAQ,CAAC;AAGhB,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../src/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAEL,KAAK,SAAS,EAGf,MAAM,QAAQ,CAAC;AAGhB,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAgG7B,CAAC;AAiCF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Chip/type.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,gBAAgB,EAChB;IACE,eAAe,EAAE,UAAU,CAAC;IAC5B,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,EAAE,UAAU,CAAC;IACxB,uBAAuB,EAAE,UAAU,CAAC;IACpC,mBAAmB,EAAE,UAAU,CAAC;IAChC,iBAAiB,EAAE,UAAU,CAAC;IAC9B,uBAAuB,EAAE,UAAU,CAAC;IACpC,mBAAmB,EAAE,UAAU,CAAC;IAChC,iBAAiB,EAAE,UAAU,CAAC;CAC/B,CA0FF,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,E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IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAC7B"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
interface DrawingProps {
|
|
2
|
+
onChange?: (value?: string | undefined | null) => void;
|
|
3
|
+
onStart?: () => void;
|
|
4
|
+
onEnd?: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const Drawing: ({ onChange, onEnd, onStart }: DrawingProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default Drawing;
|
|
2
8
|
//# sourceMappingURL=Drawing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawing.d.ts","sourceRoot":"","sources":["../../../../src/Drawing/Drawing.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Drawing.d.ts","sourceRoot":"","sources":["../../../../src/Drawing/Drawing.tsx"],"names":[],"mappings":"AASA,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,QAAA,MAAM,OAAO,GAAI,8BAA8B,YAAY,4CAgG1D,CAAC;AA0BF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Drawing/type.tsx"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
type Source = {
|
|
2
|
+
uri?: string;
|
|
3
|
+
headers?: {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
cache?: boolean;
|
|
7
|
+
cacheFileName?: string;
|
|
8
|
+
expiration?: number;
|
|
9
|
+
method?: string;
|
|
10
|
+
};
|
|
1
11
|
declare const PdfView: ({ source }: {
|
|
2
|
-
source
|
|
12
|
+
source: Source;
|
|
3
13
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
14
|
export default PdfView;
|
|
5
15
|
//# sourceMappingURL=PdfView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfView.d.ts","sourceRoot":"","sources":["../../../../src/FileView/PdfView.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,OAAO,GAAI
|
|
1
|
+
{"version":3,"file":"PdfView.d.ts","sourceRoot":"","sources":["../../../../src/FileView/PdfView.tsx"],"names":[],"mappings":"AAGA,KAAK,MAAM,GAAG;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,OAAO,GAAI,YAAY;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,4CAc9C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EAML,KAAK,cAAc,EAGnB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EAML,KAAK,cAAc,EAGnB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,UAAU,eAAe;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgGzC,CAAC;AA8DF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterProvider.d.ts","sourceRoot":"","sources":["../../../../src/Provider/FooterProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FooterProvider.d.ts","sourceRoot":"","sources":["../../../../src/Provider/FooterProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5E,UAAU,iBAAiB;IACzB,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;CAC/C;AAID,eAAO,MAAM,cAAc,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAQnE,CAAC;AAEF,eAAO,MAAM,SAAS,yBAMrB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type SelectProps } from './type';
|
|
2
|
-
export default function Select({ isOpen, data, renderItem, onClose, onSubmit, multiple, onSearch, required, loading, delaySearch, height, onRefresh, refreshing, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Select({ isOpen, data, renderItem, onClose, onSubmit, multiple, onSearch, required, loading, delaySearch, height, onRefresh, refreshing, footer, onEndReached, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/Select/Select.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAQ1C,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,MAAM,EACN,IAAI,EACJ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,OAAe,EACf,WAAiB,EACjB,MAAM,EACN,SAAS,EACT,UAAU,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/Select/Select.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAQ1C,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,MAAM,EACN,IAAI,EACJ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,OAAe,EACf,WAAiB,EACjB,MAAM,EACN,SAAS,EACT,UAAU,EACV,MAAM,EACN,YAAY,GACb,EAAE,WAAW,2CAkFb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Select/type.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EA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AAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,qBAAqB,GAAG,CAClC,IAAI,EAAE,eAAe,EACrB,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,KACd,KAAK,CAAC,SAAS,CAAC;AAErB,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabItem.d.ts","sourceRoot":"","sources":["../../../../src/Tab/TabItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TabItem.d.ts","sourceRoot":"","sources":["../../../../src/Tab/TabItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAoB,CAAC;AACzD,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../src/Ui/Footer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../src/Ui/Footer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKxE,UAAU,WAAW;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAgBjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOptionalFocusEffect.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useOptionalFocusEffect.ts"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,QAazE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { Pressable, View, Text, StyleSheet } from 'react-native';
|
|
3
|
-
import { Color, Icon } from '@herca/rn-kit';
|
|
3
|
+
import { Color, Icon } from '@herca/rn-kit';
|
|
4
|
+
// import type { ColorVariantType } from '../Color/type';
|
|
4
5
|
|
|
5
6
|
interface CheckBoxProps {
|
|
6
7
|
checked?: boolean;
|
|
@@ -8,16 +9,35 @@ interface CheckBoxProps {
|
|
|
8
9
|
label?: string | React.ReactNode;
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
renderLabel?: () => React.ReactNode;
|
|
12
|
+
// color?: ColorVariantType;
|
|
11
13
|
}
|
|
12
14
|
|
|
15
|
+
// const COLOR_MAP: Record<
|
|
16
|
+
// ColorVariantType,
|
|
17
|
+
// {
|
|
18
|
+
// backgroundColor: ColorValue;
|
|
19
|
+
// backgroundColorDisabled: ColorValue;
|
|
20
|
+
// }
|
|
21
|
+
// > = {
|
|
22
|
+
// primary : {
|
|
23
|
+
// backgroundColor : Color.primary[1000],
|
|
24
|
+
// backgroundColorDisabled : Color.primary[100],
|
|
25
|
+
// },
|
|
26
|
+
// danger: {
|
|
27
|
+
// backgroundColor : Color.danger[500],
|
|
28
|
+
// backgroundColorDisabled : Color.danger[100],
|
|
29
|
+
// },
|
|
30
|
+
// }
|
|
13
31
|
const CheckBox: React.FC<CheckBoxProps> = ({
|
|
14
32
|
checked = false,
|
|
15
33
|
onChange,
|
|
16
34
|
label,
|
|
17
35
|
disabled = false,
|
|
18
36
|
renderLabel,
|
|
37
|
+
// color= 'primary'
|
|
19
38
|
}) => {
|
|
20
39
|
const [value, setValue] = useState<boolean>(false);
|
|
40
|
+
// const _selectedColor = COLOR_MAP[color];
|
|
21
41
|
|
|
22
42
|
const handlePress = () => {
|
|
23
43
|
const newValue = !value;
|
package/src/Chip/Chip.tsx
CHANGED
|
@@ -22,6 +22,8 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
22
22
|
size = 'medium',
|
|
23
23
|
onRefresh,
|
|
24
24
|
refreshing = false,
|
|
25
|
+
onEndReached,
|
|
26
|
+
footer,
|
|
25
27
|
}) => {
|
|
26
28
|
const isHorizontal = direction === 'horizontal';
|
|
27
29
|
|
|
@@ -85,6 +87,7 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
85
87
|
)}
|
|
86
88
|
keyExtractor={(item) => String(item.value)}
|
|
87
89
|
horizontal={isHorizontal}
|
|
90
|
+
onEndReached={onEndReached}
|
|
88
91
|
onRefresh={onRefresh}
|
|
89
92
|
refreshing={refreshing}
|
|
90
93
|
scrollEnabled={scrollable}
|
|
@@ -97,9 +100,8 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
97
100
|
alignItems: block ? 'stretch' : 'flex-start',
|
|
98
101
|
},
|
|
99
102
|
]}
|
|
100
|
-
columnWrapperStyle={
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
+
columnWrapperStyle={numColumns > 1 ? styles.wrapperStyle : undefined}
|
|
104
|
+
ListFooterComponent={footer}
|
|
103
105
|
/>
|
|
104
106
|
);
|
|
105
107
|
};
|
|
@@ -108,6 +110,10 @@ const styles = StyleSheet.create({
|
|
|
108
110
|
container: {
|
|
109
111
|
gap: 8,
|
|
110
112
|
},
|
|
113
|
+
wrapperStyle: {
|
|
114
|
+
gap: 8,
|
|
115
|
+
flexWrap: 'wrap',
|
|
116
|
+
},
|
|
111
117
|
chip: {
|
|
112
118
|
borderRadius: 8,
|
|
113
119
|
borderWidth: 1,
|
package/src/Chip/type.tsx
CHANGED
package/src/Drawing/Drawing.tsx
CHANGED
|
@@ -1,30 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
3
|
+
import SignatureCanvas, {
|
|
4
|
+
type SignatureViewRef,
|
|
5
|
+
} from 'react-native-signature-canvas';
|
|
6
|
+
import Icon from '../Icon';
|
|
7
|
+
import Button from '../Button/Button';
|
|
8
|
+
import Color from '../Color/Color';
|
|
3
9
|
|
|
4
|
-
|
|
10
|
+
interface DrawingProps {
|
|
11
|
+
onChange?: (value?: string | undefined | null) => void;
|
|
12
|
+
onStart?: () => void;
|
|
13
|
+
onEnd?: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const Drawing = ({ onChange, onEnd, onStart }: DrawingProps) => {
|
|
17
|
+
const ref = useRef<SignatureViewRef | null>(null);
|
|
18
|
+
|
|
19
|
+
const handleSignature = (signature: string) => {
|
|
20
|
+
if (signature && onChange) {
|
|
21
|
+
onChange(signature);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const refreshSignature = () =>
|
|
26
|
+
requestAnimationFrame(() => ref.current?.readSignature());
|
|
27
|
+
|
|
28
|
+
const handleEmpty = () => {
|
|
29
|
+
if (onChange) {
|
|
30
|
+
onChange(null);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const handleError = (error: Error) => {
|
|
35
|
+
console.error('Signature pad error:', error);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const handleEnd = () => {
|
|
39
|
+
refreshSignature();
|
|
40
|
+
if (onEnd) {
|
|
41
|
+
onEnd();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const handleBegin = () => {
|
|
46
|
+
if (onStart) {
|
|
47
|
+
onStart();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const undo = () => {
|
|
52
|
+
ref.current?.undo();
|
|
53
|
+
refreshSignature();
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const redo = () => {
|
|
57
|
+
ref.current?.redo();
|
|
58
|
+
refreshSignature();
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const clear = () => {
|
|
62
|
+
ref.current?.clearSignature();
|
|
63
|
+
if (onChange) {
|
|
64
|
+
onChange(null);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
5
67
|
|
|
6
68
|
return (
|
|
7
69
|
<View style={styles.container}>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
70
|
+
<SignatureCanvas
|
|
71
|
+
ref={ref}
|
|
72
|
+
onEnd={handleEnd}
|
|
73
|
+
onBegin={handleBegin}
|
|
74
|
+
onOK={handleSignature}
|
|
75
|
+
onEmpty={handleEmpty}
|
|
76
|
+
onError={handleError}
|
|
77
|
+
descriptionText=" "
|
|
78
|
+
webStyle={`
|
|
79
|
+
.m-signature-pad {box-shadow: none; border-color:${Color.gray[200]}; border-radius: 12px;}
|
|
80
|
+
.m-signature-pad--body {border-color:${Color.gray[200]}; border-radius:12px;}
|
|
81
|
+
.m-signature-pad--footer{
|
|
82
|
+
display: none; margin: 0,
|
|
83
|
+
}
|
|
84
|
+
`}
|
|
85
|
+
clearText={'Clear'}
|
|
86
|
+
penColor={Color.gray[900]}
|
|
87
|
+
backgroundColor={Color.base.white100}
|
|
16
88
|
webviewProps={{
|
|
17
89
|
cacheEnabled: true,
|
|
18
90
|
androidLayerType: 'hardware',
|
|
19
91
|
}}
|
|
20
92
|
/>
|
|
93
|
+
<View style={styles.footerConteiner}>
|
|
94
|
+
<View style={styles.actionButtonContainer}>
|
|
95
|
+
<TouchableOpacity onPress={undo}>
|
|
96
|
+
<Icon name="ArrowBackAlt" />
|
|
97
|
+
</TouchableOpacity>
|
|
98
|
+
<TouchableOpacity onPress={redo}>
|
|
99
|
+
<Icon name="ArrowForwardAlt" />
|
|
100
|
+
</TouchableOpacity>
|
|
101
|
+
</View>
|
|
102
|
+
<Button
|
|
103
|
+
variant="outline"
|
|
104
|
+
color="primary"
|
|
105
|
+
title="Clear"
|
|
106
|
+
size="small"
|
|
107
|
+
onPress={clear}
|
|
108
|
+
/>
|
|
109
|
+
</View>
|
|
21
110
|
</View>
|
|
22
111
|
);
|
|
23
|
-
}
|
|
112
|
+
};
|
|
24
113
|
|
|
25
114
|
const styles = StyleSheet.create({
|
|
26
115
|
container: {
|
|
27
|
-
|
|
116
|
+
height: 350,
|
|
117
|
+
},
|
|
118
|
+
footerConteiner: {
|
|
119
|
+
flexDirection: 'row',
|
|
120
|
+
justifyContent: 'space-between',
|
|
121
|
+
alignContent: 'center',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
},
|
|
124
|
+
actionButtonContainer: {
|
|
125
|
+
flexDirection: 'row',
|
|
126
|
+
gap: 10,
|
|
28
127
|
},
|
|
29
128
|
preview: {
|
|
30
129
|
width: 335,
|
|
@@ -35,3 +134,5 @@ const styles = StyleSheet.create({
|
|
|
35
134
|
marginTop: 15,
|
|
36
135
|
},
|
|
37
136
|
});
|
|
137
|
+
|
|
138
|
+
export default Drawing;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
## Contoh
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import React, { useState } from 'react';
|
|
5
|
+
import { View, Image } from 'react-native';
|
|
6
|
+
import Drawing from './components/Drawing/Drawing';
|
|
7
|
+
|
|
8
|
+
export default function SignatureForm() {
|
|
9
|
+
const [result, setResult] = useState<string | undefined>();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<View style={{ flex: 1, padding: 16 }}>
|
|
13
|
+
<Drawing onDraw={setResult} />
|
|
14
|
+
|
|
15
|
+
{result && (
|
|
16
|
+
<Image
|
|
17
|
+
source={{ uri: result }}
|
|
18
|
+
style={{ width: 300, height: 100, marginTop: 24 }}
|
|
19
|
+
resizeMode="contain"
|
|
20
|
+
/>
|
|
21
|
+
)}
|
|
22
|
+
</View>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## props
|
|
28
|
+
|
|
29
|
+
| Prop | Tipe | Default | Deskripsi |
|
|
30
|
+
| -------- | -------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
31
|
+
| `onDraw` | `(value?: string \| undefined) ⇒ void` | `undefined` | Callback berisi tanda tangan **base64** saat pengguna menggambar (dipicu otomatis di `onDraw`). |
|
|
File without changes
|
package/src/FileView/PdfView.tsx
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { View,
|
|
1
|
+
import { View, StyleSheet } from 'react-native';
|
|
2
2
|
import Pdf from 'react-native-pdf';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
type Source = {
|
|
5
|
+
uri?: string;
|
|
6
|
+
headers?: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
cache?: boolean;
|
|
10
|
+
cacheFileName?: string;
|
|
11
|
+
expiration?: number;
|
|
12
|
+
method?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const PdfView = ({ source }: { source: Source }) => {
|
|
16
|
+
if (!source) return <View />;
|
|
17
|
+
|
|
8
18
|
return (
|
|
9
|
-
<View style={styles.
|
|
19
|
+
<View style={styles.container}>
|
|
10
20
|
<Pdf
|
|
11
21
|
source={source}
|
|
12
|
-
onLoadComplete={(
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
console.log(`current page: ${page}`);
|
|
17
|
-
}}
|
|
18
|
-
onError={(error) => {
|
|
19
|
-
console.log(error);
|
|
20
|
-
}}
|
|
21
|
-
style={[styles.flex, { width: Dimensions.get('window').width }]}
|
|
22
|
+
onLoadComplete={(pages) => console.log('number of pages:', pages)}
|
|
23
|
+
onPageChanged={(page) => console.log('current page:', page)}
|
|
24
|
+
onError={(err) => console.error(err)}
|
|
25
|
+
style={styles.pdf}
|
|
22
26
|
/>
|
|
23
27
|
</View>
|
|
24
28
|
);
|
|
@@ -27,7 +31,6 @@ const PdfView = ({ source = null }) => {
|
|
|
27
31
|
export default PdfView;
|
|
28
32
|
|
|
29
33
|
const styles = StyleSheet.create({
|
|
30
|
-
flex:
|
|
31
|
-
|
|
32
|
-
},
|
|
34
|
+
container: { flex: 1 },
|
|
35
|
+
pdf: { flex: 1 },
|
|
33
36
|
});
|
package/src/Modal/Modal.tsx
CHANGED
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
Platform,
|
|
11
11
|
type ViewStyle,
|
|
12
12
|
} from 'react-native';
|
|
13
|
+
import Icon from '../Icon';
|
|
14
|
+
import Color from '../Color/Color';
|
|
13
15
|
|
|
14
16
|
interface ModalPopUpProps {
|
|
15
17
|
isOpen: boolean;
|
|
@@ -45,8 +47,8 @@ const ModalPopUp: React.FC<ModalPopUpProps> = ({
|
|
|
45
47
|
Animated.spring(scaleAnim, {
|
|
46
48
|
toValue: 1,
|
|
47
49
|
useNativeDriver: true,
|
|
48
|
-
damping:
|
|
49
|
-
stiffness:
|
|
50
|
+
damping: 20,
|
|
51
|
+
stiffness: 200,
|
|
50
52
|
}).start();
|
|
51
53
|
}, [scaleAnim]);
|
|
52
54
|
|
|
@@ -107,11 +109,11 @@ const ModalPopUp: React.FC<ModalPopUpProps> = ({
|
|
|
107
109
|
<Animated.View style={[styles.modalContent, modalContentStyle]}>
|
|
108
110
|
{closable && (
|
|
109
111
|
<View style={styles.closeButtonContainer}>
|
|
110
|
-
<TouchableOpacity
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
<TouchableOpacity onPress={hideModal} style={styles.closeButton}>
|
|
113
|
+
<View style={styles.iconButtonClose}>
|
|
114
|
+
<Icon name="Times" size={13} color={Color.gray[900]} />
|
|
115
|
+
</View>
|
|
116
|
+
</TouchableOpacity>
|
|
115
117
|
</View>
|
|
116
118
|
)}
|
|
117
119
|
<SafeAreaView style={styles.contentContainer}>
|
|
@@ -165,6 +167,13 @@ const styles = StyleSheet.create({
|
|
|
165
167
|
right: 10,
|
|
166
168
|
zIndex: 1,
|
|
167
169
|
},
|
|
170
|
+
iconButtonClose: {
|
|
171
|
+
justifyContent: 'center',
|
|
172
|
+
alignContent: 'center',
|
|
173
|
+
alignItems: 'center',
|
|
174
|
+
top: 'auto',
|
|
175
|
+
flex: 1,
|
|
176
|
+
},
|
|
168
177
|
closeButton: {
|
|
169
178
|
width: 24,
|
|
170
179
|
height: 24,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext, useState, type ReactNode } from 'react';
|
|
2
|
+
import LayoutWithFooter from './LayoutWithFooter';
|
|
2
3
|
|
|
3
4
|
interface FooterContextType {
|
|
4
5
|
footer: ReactNode | null;
|
|
@@ -12,7 +13,7 @@ export const FooterProvider = ({ children }: { children: ReactNode }) => {
|
|
|
12
13
|
|
|
13
14
|
return (
|
|
14
15
|
<FooterContext.Provider value={{ footer, setFooter }}>
|
|
15
|
-
{children}
|
|
16
|
+
<LayoutWithFooter>{children}</LayoutWithFooter>
|
|
16
17
|
</FooterContext.Provider>
|
|
17
18
|
);
|
|
18
19
|
};
|