ncore-ui-kit 1.0.0-pre-alpha.1 → 1.0.0-pre-alpha.50
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 +103 -103
- package/lib/module/components/mainHeader/index.js +19 -4
- package/lib/module/components/mainHeader/index.js.map +1 -1
- package/lib/module/components/mainHeader/type.js.map +1 -1
- package/lib/module/components/menu/index.js +28 -27
- package/lib/module/components/menu/index.js.map +1 -1
- package/lib/module/components/pageContainer/index.js +4 -2
- package/lib/module/components/pageContainer/index.js.map +1 -1
- package/lib/module/package.json +1 -1
- package/lib/package.json +1 -1
- package/lib/src/components/mainHeader/index.js +15 -5
- package/lib/src/components/menu/index.js +34 -34
- package/lib/src/components/pageContainer/index.js +5 -3
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/typescript/package.json +1 -1
- package/lib/typescript/src/components/mainHeader/index.d.ts +1 -1
- package/lib/typescript/src/components/mainHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/mainHeader/type.d.ts +2 -0
- package/lib/typescript/src/components/mainHeader/type.d.ts.map +1 -1
- package/lib/typescript/src/components/menu/index.d.ts.map +1 -1
- package/lib/typescript/src/components/pageContainer/index.d.ts.map +1 -1
- package/lib/typescript/src/components/pageContainer/type.d.ts +1 -0
- package/lib/typescript/src/components/pageContainer/type.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/assets/svg/cayCoreIcon/index.tsx +274 -274
- package/src/assets/svg/index.ts +15 -15
- package/src/assets/svg/nibgatCommunityIcon/index.tsx +60 -60
- package/src/assets/svg/nibgatIcon/index.tsx +96 -96
- package/src/components/avatar/index.tsx +255 -255
- package/src/components/avatar/stylesheet.ts +184 -184
- package/src/components/avatar/type.ts +88 -88
- package/src/components/avatarGroup/index.tsx +172 -172
- package/src/components/avatarGroup/stylesheet.ts +138 -138
- package/src/components/avatarGroup/type.ts +74 -74
- package/src/components/embeddedMenu/components/menuButton/index.tsx +279 -279
- package/src/components/embeddedMenu/components/menuButton/type.ts +36 -36
- package/src/components/embeddedMenu/index.tsx +433 -433
- package/src/components/embeddedMenu/stylesheet.ts +77 -77
- package/src/components/embeddedMenu/type.ts +96 -96
- package/src/components/mainHeader/index.tsx +118 -96
- package/src/components/mainHeader/stylesheet.ts +46 -46
- package/src/components/mainHeader/type.ts +28 -26
- package/src/components/menu/components/menuButton/index.tsx +261 -261
- package/src/components/menu/components/menuButton/type.ts +34 -34
- package/src/components/menu/index.tsx +391 -388
- package/src/components/menu/stylesheet.ts +72 -72
- package/src/components/menu/type.ts +89 -89
- package/src/components/pageContainer/index.tsx +5 -2
- package/src/components/pageContainer/type.ts +1 -0
- package/src/components/seperator/stylesheet.ts +70 -70
- package/src/components/seperator/type.ts +28 -28
- package/src/components/siteLogo/index.tsx +250 -250
- package/src/components/siteLogo/stylesheet.ts +191 -191
- package/src/components/siteLogo/type.ts +88 -88
package/README.md
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
# NİBGAT® | NCore - Mobile
|
|
2
|
-
The NCore, NİBGAT® UI - Kit. The NİBGAT®'s UI / Component Library.
|
|
3
|
-
|
|
4
|
-
```typescript
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
NCoreUIKitMenu.load({
|
|
7
|
-
siteLogoProps: {
|
|
8
|
-
imageUrl: "https://www.nibgat.com/assets/images/logo.png",
|
|
9
|
-
onPress: () => {
|
|
10
|
-
navigation.navigate("Home");
|
|
11
|
-
},
|
|
12
|
-
imageProps: {
|
|
13
|
-
resizeMode: "stretch"
|
|
14
|
-
},
|
|
15
|
-
imageSpace: "spacingLg",
|
|
16
|
-
isWorkWithAction: true,
|
|
17
|
-
subTitle: "Core Tech",
|
|
18
|
-
title: "NİBGAT®"
|
|
19
|
-
},
|
|
20
|
-
renderFooter: () => {
|
|
21
|
-
return <View
|
|
22
|
-
style={{
|
|
23
|
-
padding: spaces.spacingMd,
|
|
24
|
-
flexDirection: "row",
|
|
25
|
-
alignItems: "center"
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
<View
|
|
29
|
-
style={{
|
|
30
|
-
marginRight: spaces.spacingSm,
|
|
31
|
-
justifyContent: "center",
|
|
32
|
-
flexDirection: "row",
|
|
33
|
-
alignItems: "center"
|
|
34
|
-
}}
|
|
35
|
-
>
|
|
36
|
-
<Text
|
|
37
|
-
variant="labelLargeSize"
|
|
38
|
-
>
|
|
39
|
-
Palet:
|
|
40
|
-
</Text>
|
|
41
|
-
<PaletteSwitcher/>
|
|
42
|
-
</View>
|
|
43
|
-
<View
|
|
44
|
-
style={{
|
|
45
|
-
justifyContent: "center",
|
|
46
|
-
flexDirection: "row",
|
|
47
|
-
alignItems: "center"
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
<Text
|
|
51
|
-
variant="labelLargeSize"
|
|
52
|
-
>
|
|
53
|
-
Tema:
|
|
54
|
-
</Text>
|
|
55
|
-
<ThemeSwitcher/>
|
|
56
|
-
</View>
|
|
57
|
-
</View>;
|
|
58
|
-
},
|
|
59
|
-
isAutoClosed: true,
|
|
60
|
-
buttons: [
|
|
61
|
-
{
|
|
62
|
-
redirectMain: "Home",
|
|
63
|
-
isCollapsible: true,
|
|
64
|
-
title: "Ana Sayfa",
|
|
65
|
-
icon: ({
|
|
66
|
-
color
|
|
67
|
-
}) => <HomeIcon
|
|
68
|
-
color={colors.content.icon[color]}
|
|
69
|
-
/>,
|
|
70
|
-
subButtons: [
|
|
71
|
-
{
|
|
72
|
-
title: "Text",
|
|
73
|
-
redirectMain: "TextPage"
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
redirectMain: "Text",
|
|
79
|
-
isCollapsible: true,
|
|
80
|
-
title: "Deneme",
|
|
81
|
-
icon: ({
|
|
82
|
-
color
|
|
83
|
-
}) => <HomeIcon
|
|
84
|
-
color={colors.content.icon[color]}
|
|
85
|
-
/>,
|
|
86
|
-
subButtons: [
|
|
87
|
-
{
|
|
88
|
-
title: "Noliii",
|
|
89
|
-
redirectMain: "Home"
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
title: "Text",
|
|
95
|
-
redirectMain: "TextPage"
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
navigation: navigation as unknown as NCoreUIKit.Navigation,
|
|
99
|
-
id: "test"
|
|
100
|
-
});
|
|
101
|
-
}, []);
|
|
102
|
-
|
|
103
|
-
```
|
|
1
|
+
# NİBGAT® | NCore - Mobile
|
|
2
|
+
The NCore, NİBGAT® UI - Kit. The NİBGAT®'s UI / Component Library.
|
|
3
|
+
|
|
4
|
+
```typescript
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
NCoreUIKitMenu.load({
|
|
7
|
+
siteLogoProps: {
|
|
8
|
+
imageUrl: "https://www.nibgat.com/assets/images/logo.png",
|
|
9
|
+
onPress: () => {
|
|
10
|
+
navigation.navigate("Home");
|
|
11
|
+
},
|
|
12
|
+
imageProps: {
|
|
13
|
+
resizeMode: "stretch"
|
|
14
|
+
},
|
|
15
|
+
imageSpace: "spacingLg",
|
|
16
|
+
isWorkWithAction: true,
|
|
17
|
+
subTitle: "Core Tech",
|
|
18
|
+
title: "NİBGAT®"
|
|
19
|
+
},
|
|
20
|
+
renderFooter: () => {
|
|
21
|
+
return <View
|
|
22
|
+
style={{
|
|
23
|
+
padding: spaces.spacingMd,
|
|
24
|
+
flexDirection: "row",
|
|
25
|
+
alignItems: "center"
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<View
|
|
29
|
+
style={{
|
|
30
|
+
marginRight: spaces.spacingSm,
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
flexDirection: "row",
|
|
33
|
+
alignItems: "center"
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<Text
|
|
37
|
+
variant="labelLargeSize"
|
|
38
|
+
>
|
|
39
|
+
Palet:
|
|
40
|
+
</Text>
|
|
41
|
+
<PaletteSwitcher/>
|
|
42
|
+
</View>
|
|
43
|
+
<View
|
|
44
|
+
style={{
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
flexDirection: "row",
|
|
47
|
+
alignItems: "center"
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
<Text
|
|
51
|
+
variant="labelLargeSize"
|
|
52
|
+
>
|
|
53
|
+
Tema:
|
|
54
|
+
</Text>
|
|
55
|
+
<ThemeSwitcher/>
|
|
56
|
+
</View>
|
|
57
|
+
</View>;
|
|
58
|
+
},
|
|
59
|
+
isAutoClosed: true,
|
|
60
|
+
buttons: [
|
|
61
|
+
{
|
|
62
|
+
redirectMain: "Home",
|
|
63
|
+
isCollapsible: true,
|
|
64
|
+
title: "Ana Sayfa",
|
|
65
|
+
icon: ({
|
|
66
|
+
color
|
|
67
|
+
}) => <HomeIcon
|
|
68
|
+
color={colors.content.icon[color]}
|
|
69
|
+
/>,
|
|
70
|
+
subButtons: [
|
|
71
|
+
{
|
|
72
|
+
title: "Text",
|
|
73
|
+
redirectMain: "TextPage"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
redirectMain: "Text",
|
|
79
|
+
isCollapsible: true,
|
|
80
|
+
title: "Deneme",
|
|
81
|
+
icon: ({
|
|
82
|
+
color
|
|
83
|
+
}) => <HomeIcon
|
|
84
|
+
color={colors.content.icon[color]}
|
|
85
|
+
/>,
|
|
86
|
+
subButtons: [
|
|
87
|
+
{
|
|
88
|
+
title: "Noliii",
|
|
89
|
+
redirectMain: "Home"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
title: "Text",
|
|
95
|
+
redirectMain: "TextPage"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
navigation: navigation as unknown as NCoreUIKit.Navigation,
|
|
99
|
+
id: "test"
|
|
100
|
+
});
|
|
101
|
+
}, []);
|
|
102
|
+
|
|
103
|
+
```
|
|
@@ -5,11 +5,14 @@ import stylesheet, { useStyles } from "./stylesheet.js";
|
|
|
5
5
|
import { NCoreUIKitTheme } from "../../core/hooks.js";
|
|
6
6
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
7
7
|
import SiteLogo from "../siteLogo/index.js";
|
|
8
|
+
import { Portal } from "../../helpers/portalize/index.js";
|
|
8
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
const MainHeader = ({
|
|
10
11
|
isWorkWithSafeAreaView = true,
|
|
11
12
|
isWorkWithSeperator = false,
|
|
12
13
|
backgroundColor = "default",
|
|
14
|
+
portalName = "main-header",
|
|
15
|
+
isWorkWithPortal = false,
|
|
13
16
|
renderRight: RenderRight,
|
|
14
17
|
renderLeft: RenderLeft,
|
|
15
18
|
siteLogoProps,
|
|
@@ -51,19 +54,31 @@ const MainHeader = ({
|
|
|
51
54
|
children: [renderLeft(), renderRight()]
|
|
52
55
|
});
|
|
53
56
|
};
|
|
57
|
+
const renderContentContainer = () => {
|
|
58
|
+
if (isWorkWithPortal) {
|
|
59
|
+
return /*#__PURE__*/_jsx(Portal, {
|
|
60
|
+
name: portalName,
|
|
61
|
+
children: renderContent()
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return renderContent();
|
|
65
|
+
};
|
|
54
66
|
const renderSafeAreaView = () => {
|
|
55
67
|
return /*#__PURE__*/_jsx(SafeAreaView, {
|
|
56
68
|
edges: ["top"],
|
|
57
|
-
children:
|
|
69
|
+
children: renderContentContainer()
|
|
58
70
|
});
|
|
59
71
|
};
|
|
60
|
-
|
|
72
|
+
const renderWithChildren = () => {
|
|
61
73
|
return /*#__PURE__*/_jsxs(View, {
|
|
62
74
|
style: [stylesheet.baseContainer],
|
|
63
|
-
children: [isWorkWithSafeAreaView ? renderSafeAreaView() :
|
|
75
|
+
children: [isWorkWithPortal ? children : null, isWorkWithSafeAreaView ? renderSafeAreaView() : renderContentContainer(), isWorkWithPortal ? null : children]
|
|
64
76
|
});
|
|
77
|
+
};
|
|
78
|
+
if (children) {
|
|
79
|
+
return renderWithChildren();
|
|
65
80
|
}
|
|
66
|
-
return
|
|
81
|
+
return isWorkWithSafeAreaView ? renderSafeAreaView() : renderContentContainer();
|
|
67
82
|
};
|
|
68
83
|
export default MainHeader;
|
|
69
84
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","stylesheet","useStyles","NCoreUIKitTheme","SafeAreaView","SiteLogo","jsx","_jsx","jsxs","_jsxs","MainHeader","isWorkWithSafeAreaView","isWorkWithSeperator","backgroundColor","renderRight","RenderRight","renderLeft","RenderLeft","siteLogoProps","children","borders","spaces","colors","useContext","container","containerDynamicStyle","size","isWorkWithFlex1","renderContent","style","renderSafeAreaView","edges","baseContainer"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/mainHeader/index.tsx"],"mappings":";;AAAA,SACIA,IAAI,QACD,cAAc;AAErB,OAAOC,UAAU,IACbC,SAAS,QACN,iBAAc;AACrB,SACIC,eAAe,QACZ,qBAAkB;AACzB,SACIC,YAAY,QACT,gCAAgC;AACvC,OAAOC,QAAQ,MAAM,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;
|
|
1
|
+
{"version":3,"names":["View","stylesheet","useStyles","NCoreUIKitTheme","SafeAreaView","SiteLogo","Portal","jsx","_jsx","jsxs","_jsxs","MainHeader","isWorkWithSafeAreaView","isWorkWithSeperator","backgroundColor","portalName","isWorkWithPortal","renderRight","RenderRight","renderLeft","RenderLeft","siteLogoProps","children","borders","spaces","colors","useContext","container","containerDynamicStyle","size","isWorkWithFlex1","renderContent","style","renderContentContainer","name","renderSafeAreaView","edges","renderWithChildren","baseContainer"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/mainHeader/index.tsx"],"mappings":";;AAAA,SACIA,IAAI,QACD,cAAc;AAErB,OAAOC,UAAU,IACbC,SAAS,QACN,iB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CACvB;MAAAN,QAAA,GAEDH,UAAU,CAAC,CAAC,EACZF,WAAW,CAAC,CAAC;IAAA,CACZ,CAAC;EACX,CAAC;EAED,MAAMgB,sBAAsB,GAAGA,CAAA,KAAM;IACjC,IAAGjB,gBAAgB,EAAE;MACjB,oBAAOR,IAAA,CAACF,MAAM;QACV4B,IAAI,EAAEnB,UAAW;QAAAO,QAAA,EAEhBS,aAAa,CAAC;MAAC,CACZ,CAAC;IACb;IAEA,OAAOA,aAAa,CAAC,CAAC;EAC1B,CAAC;EAED,MAAMI,kBAAkB,GAAGA,CAAA,KAAM;IAC7B,oBAAO3B,IAAA,CAACJ,YAAY;MAChBgC,KAAK,EAAE,CACH,KAAK,CACP;MAAAd,QAAA,EAEDW,sBAAsB,CAAC;IAAC,CACf,CAAC;EACnB,CAAC;EAED,MAAMI,kBAAkB,GAAGA,CAAA,KAAM;IAC7B,oBAAO3B,KAAA,CAACV,IAAI;MACRgC,KAAK,EAAE,CACH/B,UAAU,CAACqC,aAAa,CAC1B;MAAAhB,QAAA,GAEDN,gBAAgB,GAAGM,QAAQ,GAAG,IAAI,EAClCV,sBAAsB,GAAGuB,kBAAkB,CAAC,CAAC,GAAGF,sBAAsB,CAAC,CAAC,EACxEjB,gBAAgB,GAAG,IAAI,GAAGM,QAAQ;IAAA,CACjC,CAAC;EACX,CAAC;EAED,IAAGA,QAAQ,EAAE;IACT,OAAOe,kBAAkB,CAAC,CAAC;EAC/B;EAEA,OAAOzB,sBAAsB,GAAGuB,kBAAkB,CAAC,CAAC,GAAGF,sBAAsB,CAAC,CAAC;AACnF,CAAC;AACD,eAAetB,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/mainHeader/type.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/mainHeader/type.ts"],"mappings":";;AAuBC;AAAC","ignoreList":[]}
|
|
@@ -4,12 +4,12 @@ import { useImperativeHandle, useLayoutEffect, forwardRef, useEffect, useState,
|
|
|
4
4
|
import { Platform, Animated, Easing, View } from "react-native";
|
|
5
5
|
import stylesheet, { useStyles } from "./stylesheet.js";
|
|
6
6
|
import MenuButton from "./components/menuButton/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { NCoreUIKitTheme, NCoreUIKitMenu } from "../../core/hooks.js";
|
|
8
8
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
9
9
|
import { Portal } from "../../helpers/portalize/index.js";
|
|
10
|
-
import Modal from "../modal/index.js";
|
|
11
10
|
import Seperator from "../seperator/index.js";
|
|
12
11
|
import SiteLogo from "../siteLogo/index.js";
|
|
12
|
+
import Modal from "../modal/index.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const Menu = ({
|
|
15
15
|
isWorkWithSafeAreaView = true,
|
|
@@ -62,7 +62,24 @@ const Menu = ({
|
|
|
62
62
|
}
|
|
63
63
|
}, [measures]);
|
|
64
64
|
useEffect(() => {
|
|
65
|
-
if (isCollapse !== undefined)
|
|
65
|
+
if (isCollapse !== undefined) {
|
|
66
|
+
if (isCollapse) {
|
|
67
|
+
setIsActive(isCollapse);
|
|
68
|
+
} else {
|
|
69
|
+
if (onClose) onClose({
|
|
70
|
+
id
|
|
71
|
+
});
|
|
72
|
+
if (isWorkWithAnimation) {
|
|
73
|
+
closeAnimation(() => setIsActive(isCollapse));
|
|
74
|
+
} else {
|
|
75
|
+
animatedX.setValue(measures * -1);
|
|
76
|
+
setIsActive(isCollapse);
|
|
77
|
+
if (onClosed) onClosed({
|
|
78
|
+
id
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
66
83
|
}, [isCollapse]);
|
|
67
84
|
useLayoutEffect(() => {
|
|
68
85
|
if (isActive && isOpacityVisible) {
|
|
@@ -77,20 +94,6 @@ const Menu = ({
|
|
|
77
94
|
id
|
|
78
95
|
});
|
|
79
96
|
}
|
|
80
|
-
} else {
|
|
81
|
-
if (onClose) onClose({
|
|
82
|
-
id
|
|
83
|
-
});
|
|
84
|
-
if (!isWorkWithModal) {
|
|
85
|
-
if (isWorkWithAnimation) {
|
|
86
|
-
closeAnimation();
|
|
87
|
-
} else {
|
|
88
|
-
animatedX.setValue(measures * -1);
|
|
89
|
-
if (onClosed) onClosed({
|
|
90
|
-
id
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
97
|
}
|
|
95
98
|
}, [isOpacityVisible, isActive]);
|
|
96
99
|
const open = () => {
|
|
@@ -100,17 +103,14 @@ const Menu = ({
|
|
|
100
103
|
if (onClose) onClose({
|
|
101
104
|
id
|
|
102
105
|
});
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
closeAnimation();
|
|
106
|
-
} else {
|
|
107
|
-
animatedX.setValue(measures * -1);
|
|
108
|
-
if (onClosed) onClosed({
|
|
109
|
-
id
|
|
110
|
-
});
|
|
111
|
-
}
|
|
106
|
+
if (isWorkWithAnimation) {
|
|
107
|
+
closeAnimation(() => setIsActive(false));
|
|
112
108
|
} else {
|
|
109
|
+
animatedX.setValue(measures * -1);
|
|
113
110
|
setIsActive(false);
|
|
111
|
+
if (onClosed) onClosed({
|
|
112
|
+
id
|
|
113
|
+
});
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
const openAnimation = () => {
|
|
@@ -129,7 +129,7 @@ const Menu = ({
|
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
131
|
};
|
|
132
|
-
const closeAnimation =
|
|
132
|
+
const closeAnimation = callback => {
|
|
133
133
|
Animated.timing(animatedX, {
|
|
134
134
|
useNativeDriver: Platform.OS !== "web",
|
|
135
135
|
toValue: measures * -1,
|
|
@@ -139,6 +139,7 @@ const Menu = ({
|
|
|
139
139
|
finished
|
|
140
140
|
}) => {
|
|
141
141
|
if (finished) {
|
|
142
|
+
if (callback) callback();
|
|
142
143
|
if (onClosed) onClosed({
|
|
143
144
|
id
|
|
144
145
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useImperativeHandle","useLayoutEffect","forwardRef","useEffect","useState","Fragment","useRef","Platform","Animated","Easing","View","stylesheet","useStyles","MenuButton","
|
|
1
|
+
{"version":3,"names":["useImperativeHandle","useLayoutEffect","forwardRef","useEffect","useState","Fragment","useRef","Platform","Animated","Easing","View","stylesheet","useStyles","MenuButton","NCoreUIKitTheme","NCoreUIKitMenu","SafeAreaView","Portal","Seperator","SiteLogo","Modal","jsx","_jsx","jsxs","_jsxs","Menu","isWorkWithSafeAreaView","isWorkWithAnimation","renderHeader","RenderHeader","renderFooter","RenderFooter","portalName","isWorkWithPortal","isWorkWithModal","close","closeAction","siteLogoProps","customTheme","navigation","modalProps","isCollapse","onClosed","onOpened","buttons","onClose","onOpen","style","id","props","ref","colors","spaces","useContext","headerContainer","headerContainerDynamicStyle","seperator","seperatorDynamicStyle","container","containerDynamicStyle","isOpacityVisible","setIsOpacityVisible","measures","setMeasures","isActive","setIsActive","animatedX","Value","current","open","setValue","undefined","closeAnimation","openAnimation","timing","useNativeDriver","OS","easing","linear","duration","toValue","start","finished","callback","updateMenuButtonCollabs","depthMap","status","state","get","recursivelyCatch","item","index","tIndex","map","c_item","c_index","length","subButtons","newButtons","update","menuData","children","renderButtons","buttonItem","buttonIndex","renderSafeAreaContext","safeAreaView","content","renderContent","opacity","transform","translateX","onLayout","event","width","nativeEvent","layout","isOverlayVisible","onOverlayPress","name"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/menu/index.tsx"],"mappings":";;AAAA,SACIA,mBAAmB,EACnBC,eAAe,EACfC,UAAU,EACVC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,MAAM,QACH,OAAO;AACd,SACIC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACNC,IAAI,QACD,cAAc;AAQrB,OAAOC,UAAU,IACbC,SAAS,QACN,iBAAc;AACr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D,QAAA,EAEdO,aAAa,CAAC;IAAC,CACb,CAAC;EACZ;EAEA,IAAG3E,gBAAgB,IAAI6B,QAAQ,KAAK,IAAI,EAAE;IACtC,oBAAOxC,IAAA,CAACL,MAAM;MACVsG,IAAI,EAAEvF,UAAW;MAAAqE,QAAA,EAEhBO,aAAa,CAAC;IAAC,CACZ,CAAC;EACb;EAEA,OAAOA,aAAa,CAAC,CAAC;AAC1B,CAAC;AACD,4BAAe1G,UAAU,CAACuB,IAAI,CAAC","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ const PageContainer = ({
|
|
|
10
10
|
backgroundColor = "default",
|
|
11
11
|
isWrapSafeareaContext = false,
|
|
12
12
|
safeAreaViewBackgroundColor,
|
|
13
|
+
isCustomPadding = false,
|
|
13
14
|
isScrollable = false,
|
|
14
15
|
safeAreaViewStyle,
|
|
15
16
|
scrollViewStyle,
|
|
@@ -34,7 +35,7 @@ const PageContainer = ({
|
|
|
34
35
|
return /*#__PURE__*/_jsx(ScrollView, {
|
|
35
36
|
keyboardShouldPersistTaps: "handled",
|
|
36
37
|
...scrollViewProps,
|
|
37
|
-
contentContainerStyle: [{
|
|
38
|
+
contentContainerStyle: [isCustomPadding ? null : {
|
|
38
39
|
padding: spaces.spacingMd
|
|
39
40
|
}, scrollViewProps?.contentContainerStyle],
|
|
40
41
|
style: [{
|
|
@@ -53,7 +54,8 @@ const PageContainer = ({
|
|
|
53
54
|
return /*#__PURE__*/_jsx(View, {
|
|
54
55
|
...props,
|
|
55
56
|
style: [{
|
|
56
|
-
backgroundColor: colors.content.container[backgroundColor]
|
|
57
|
+
backgroundColor: colors.content.container[backgroundColor]
|
|
58
|
+
}, isCustomPadding ? null : {
|
|
57
59
|
padding: spaces.spacingMd
|
|
58
60
|
}, stylesheet.container, style],
|
|
59
61
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Fragment","ScrollView","View","stylesheet","NCoreUIKitTheme","SafeAreaView","jsx","_jsx","jsxs","_jsxs","PageContainer","backgroundColor","isWrapSafeareaContext","safeAreaViewBackgroundColor","isScrollable","safeAreaViewStyle","scrollViewStyle","scrollViewProps","renderOverlays","customTheme","children","style","props","colors","spaces","useContext","renderScrollview","console","error","Object","keys","length","keyboardShouldPersistTaps","contentContainerStyle","padding","spacingMd","content","container","renderView","renderWithSafeareaView","safeAreaViewContainer","renderWithoutSafeareaView","renderSafeareaContext"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/pageContainer/index.tsx"],"mappings":";;AAAA,SACIA,QAAQ,QAEL,OAAO;AACd,SACIC,UAAU,EACVC,IAAI,QACD,cAAc;AAErB,OAAOC,UAAU,MAAM,iBAAc;AACrC,SACIC,eAAe,QACZ,qBAAkB;AACzB,SACIC,YAAY,QACT,gCAAgC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAExC,MAAMC,aAAsC,GAAGA,CAAC;EAC5CC,eAAe,GAAG,SAAoD;EACtEC,qBAAqB,GAAG,KAAK;EAC7BC,2BAA2B;EAC3BC,YAAY,GAAG,KAAK;EACpBC,iBAAiB;EACjBC,eAAe;EACfC,eAAe;EACfC,cAAc;EACdC,WAAW;EACXC,QAAQ;EACRC,KAAK;EACL,GAAGC;AACP,CAAC,KAAK;EACF,MAAM;IACFC,MAAM;IACNC;EACJ,CAAC,
|
|
1
|
+
{"version":3,"names":["Fragment","ScrollView","View","stylesheet","NCoreUIKitTheme","SafeAreaView","jsx","_jsx","jsxs","_jsxs","PageContainer","backgroundColor","isWrapSafeareaContext","safeAreaViewBackgroundColor","isCustomPadding","isScrollable","safeAreaViewStyle","scrollViewStyle","scrollViewProps","renderOverlays","customTheme","children","style","props","colors","spaces","useContext","renderScrollview","console","error","Object","keys","length","keyboardShouldPersistTaps","contentContainerStyle","padding","spacingMd","content","container","renderView","renderWithSafeareaView","safeAreaViewContainer","renderWithoutSafeareaView","renderSafeareaContext"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/pageContainer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CAAC,gBAAG/B,KAAA,CAACT,QAAQ;MAAAqB,QAAA,GAC9DqB,yBAAyB,CAAC,CAAC,EAC3BvB,cAAc,GAAGA,cAAc,CAAC,CAAC,GAAG,IAAI;IAAA,CACnC,CAAC;EACf,CAAC;EAED,OAAOwB,qBAAqB,CAAC,CAAC;AAClC,CAAC;AACD,eAAejC,aAAa","ignoreList":[]}
|
package/lib/module/package.json
CHANGED
package/lib/package.json
CHANGED
|
@@ -4,7 +4,8 @@ import stylesheet, { useStyles } from "./stylesheet";
|
|
|
4
4
|
import { NCoreUIKitTheme } from "../../core/hooks";
|
|
5
5
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
6
6
|
import SiteLogo from "../siteLogo";
|
|
7
|
-
|
|
7
|
+
import { Portal } from "../../helpers/portalize";
|
|
8
|
+
const MainHeader = ({ isWorkWithSafeAreaView = true, isWorkWithSeperator = false, backgroundColor = "default", portalName = "main-header", isWorkWithPortal = false, renderRight: RenderRight, renderLeft: RenderLeft, siteLogoProps, children }) => {
|
|
8
9
|
const { borders, spaces, colors } = NCoreUIKitTheme.useContext();
|
|
9
10
|
const { container: containerDynamicStyle } = useStyles({
|
|
10
11
|
isWorkWithSeperator,
|
|
@@ -31,16 +32,25 @@ const MainHeader = ({ isWorkWithSafeAreaView = true, isWorkWithSeperator = false
|
|
|
31
32
|
containerDynamicStyle
|
|
32
33
|
], children: [renderLeft(), renderRight()] });
|
|
33
34
|
};
|
|
35
|
+
const renderContentContainer = () => {
|
|
36
|
+
if (isWorkWithPortal) {
|
|
37
|
+
return _jsx(Portal, { name: portalName, children: renderContent() });
|
|
38
|
+
}
|
|
39
|
+
return renderContent();
|
|
40
|
+
};
|
|
34
41
|
const renderSafeAreaView = () => {
|
|
35
42
|
return _jsx(SafeAreaView, { edges: [
|
|
36
43
|
"top"
|
|
37
|
-
], children:
|
|
44
|
+
], children: renderContentContainer() });
|
|
38
45
|
};
|
|
39
|
-
|
|
46
|
+
const renderWithChildren = () => {
|
|
40
47
|
return _jsxs(View, { style: [
|
|
41
48
|
stylesheet.baseContainer
|
|
42
|
-
], children: [isWorkWithSafeAreaView ? renderSafeAreaView() :
|
|
49
|
+
], children: [isWorkWithPortal ? children : null, isWorkWithSafeAreaView ? renderSafeAreaView() : renderContentContainer(), isWorkWithPortal ? null : children] });
|
|
50
|
+
};
|
|
51
|
+
if (children) {
|
|
52
|
+
return renderWithChildren();
|
|
43
53
|
}
|
|
44
|
-
return
|
|
54
|
+
return isWorkWithSafeAreaView ? renderSafeAreaView() : renderContentContainer();
|
|
45
55
|
};
|
|
46
56
|
export default MainHeader;
|
|
@@ -5,12 +5,12 @@ import {} from "./components/menuButton/type";
|
|
|
5
5
|
import {} from "./type";
|
|
6
6
|
import stylesheet, { useStyles } from "./stylesheet";
|
|
7
7
|
import MenuButton from "./components/menuButton";
|
|
8
|
-
import {
|
|
8
|
+
import { NCoreUIKitTheme, NCoreUIKitMenu } from "../../core/hooks";
|
|
9
9
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
10
10
|
import { Portal } from "../../helpers/portalize";
|
|
11
|
-
import Modal from "../modal";
|
|
12
11
|
import Seperator from "../seperator";
|
|
13
12
|
import SiteLogo from "../siteLogo";
|
|
13
|
+
import Modal from "../modal";
|
|
14
14
|
const Menu = ({ isWorkWithSafeAreaView = true, isWorkWithAnimation = true, renderHeader: RenderHeader, renderFooter: RenderFooter, portalName = "menu-system", isWorkWithPortal = true, isWorkWithModal = true, close: closeAction, siteLogoProps, customTheme, navigation, modalProps, isCollapse, onClosed, onOpened, buttons, onClose, onOpen, style, id, ...props }, ref) => {
|
|
15
15
|
const { colors, spaces } = NCoreUIKitTheme.useContext(customTheme);
|
|
16
16
|
const { headerContainer: headerContainerDynamicStyle, seperator: seperatorDynamicStyle, container: containerDynamicStyle } = useStyles({
|
|
@@ -35,8 +35,28 @@ const Menu = ({ isWorkWithSafeAreaView = true, isWorkWithAnimation = true, rende
|
|
|
35
35
|
}
|
|
36
36
|
}, [measures]);
|
|
37
37
|
useEffect(() => {
|
|
38
|
-
if (isCollapse !== undefined)
|
|
39
|
-
|
|
38
|
+
if (isCollapse !== undefined) {
|
|
39
|
+
if (isCollapse) {
|
|
40
|
+
setIsActive(isCollapse);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
if (onClose)
|
|
44
|
+
onClose({
|
|
45
|
+
id
|
|
46
|
+
});
|
|
47
|
+
if (isWorkWithAnimation) {
|
|
48
|
+
closeAnimation(() => setIsActive(isCollapse));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
animatedX.setValue(measures * -1);
|
|
52
|
+
setIsActive(isCollapse);
|
|
53
|
+
if (onClosed)
|
|
54
|
+
onClosed({
|
|
55
|
+
id
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
40
60
|
}, [isCollapse]);
|
|
41
61
|
useLayoutEffect(() => {
|
|
42
62
|
if (isActive && isOpacityVisible) {
|
|
@@ -55,24 +75,6 @@ const Menu = ({ isWorkWithSafeAreaView = true, isWorkWithAnimation = true, rende
|
|
|
55
75
|
});
|
|
56
76
|
}
|
|
57
77
|
}
|
|
58
|
-
else {
|
|
59
|
-
if (onClose)
|
|
60
|
-
onClose({
|
|
61
|
-
id
|
|
62
|
-
});
|
|
63
|
-
if (!isWorkWithModal) {
|
|
64
|
-
if (isWorkWithAnimation) {
|
|
65
|
-
closeAnimation();
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
animatedX.setValue(measures * -1);
|
|
69
|
-
if (onClosed)
|
|
70
|
-
onClosed({
|
|
71
|
-
id
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
78
|
}, [
|
|
77
79
|
isOpacityVisible,
|
|
78
80
|
isActive
|
|
@@ -85,20 +87,16 @@ const Menu = ({ isWorkWithSafeAreaView = true, isWorkWithAnimation = true, rende
|
|
|
85
87
|
onClose({
|
|
86
88
|
id
|
|
87
89
|
});
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
closeAnimation();
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
animatedX.setValue(measures * -1);
|
|
94
|
-
if (onClosed)
|
|
95
|
-
onClosed({
|
|
96
|
-
id
|
|
97
|
-
});
|
|
98
|
-
}
|
|
90
|
+
if (isWorkWithAnimation) {
|
|
91
|
+
closeAnimation(() => setIsActive(false));
|
|
99
92
|
}
|
|
100
93
|
else {
|
|
94
|
+
animatedX.setValue(measures * -1);
|
|
101
95
|
setIsActive(false);
|
|
96
|
+
if (onClosed)
|
|
97
|
+
onClosed({
|
|
98
|
+
id
|
|
99
|
+
});
|
|
102
100
|
}
|
|
103
101
|
};
|
|
104
102
|
const openAnimation = () => {
|
|
@@ -116,7 +114,7 @@ const Menu = ({ isWorkWithSafeAreaView = true, isWorkWithAnimation = true, rende
|
|
|
116
114
|
}
|
|
117
115
|
});
|
|
118
116
|
};
|
|
119
|
-
const closeAnimation = () => {
|
|
117
|
+
const closeAnimation = (callback) => {
|
|
120
118
|
Animated.timing(animatedX, {
|
|
121
119
|
useNativeDriver: Platform.OS !== "web",
|
|
122
120
|
toValue: measures * -1,
|
|
@@ -124,6 +122,8 @@ const Menu = ({ isWorkWithSafeAreaView = true, isWorkWithAnimation = true, rende
|
|
|
124
122
|
duration: 300
|
|
125
123
|
}).start(({ finished }) => {
|
|
126
124
|
if (finished) {
|
|
125
|
+
if (callback)
|
|
126
|
+
callback();
|
|
127
127
|
if (onClosed)
|
|
128
128
|
onClosed({
|
|
129
129
|
id
|