react-native-boxes 1.3.15 → 1.3.17
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/package.json +1 -1
- package/src/Button.tsx +2 -2
- package/src/Input.tsx +29 -18
- package/sample-app/babel.config.js +0 -6
- package/src/Bar.d.ts +0 -29
- package/src/Bar.js +0 -178
- package/src/Bar.js.map +0 -1
- package/src/Box.d.ts +0 -15
- package/src/Box.js +0 -123
- package/src/Box.js.map +0 -1
- package/src/Button.d.ts +0 -22
- package/src/Button.js +0 -245
- package/src/Button.js.map +0 -1
- package/src/I18n.d.ts +0 -4
- package/src/I18n.js +0 -7
- package/src/I18n.js.map +0 -1
- package/src/Image.d.ts +0 -31
- package/src/Image.js +0 -129
- package/src/Image.js.map +0 -1
- package/src/Input.d.ts +0 -29
- package/src/Input.js +0 -190
- package/src/Input.js.map +0 -1
- package/src/List.d.ts +0 -17
- package/src/List.js +0 -92
- package/src/List.js.map +0 -1
- package/src/Message.d.ts +0 -7
- package/src/Message.js +0 -97
- package/src/Message.js.map +0 -1
- package/src/Modal.d.ts +0 -52
- package/src/Modal.js +0 -344
- package/src/Modal.js.map +0 -1
- package/src/Styles.d.ts +0 -126
- package/src/Styles.js +0 -117
- package/src/Styles.js.map +0 -1
- package/src/Text.d.ts +0 -8
- package/src/Text.js +0 -57
- package/src/Text.js.map +0 -1
- package/src/ThemeContext.d.ts +0 -119
- package/src/ThemeContext.js +0 -33
- package/src/ThemeContext.js.map +0 -1
- package/src/demo.d.ts +0 -5
- package/src/demo.js +0 -385
- package/src/demo.js.map +0 -1
- package/src/index.d.ts +0 -14
- package/src/index.js.map +0 -1
- package/src/utils.d.ts +0 -5
- package/src/utils.js +0 -45
- package/src/utils.js.map +0 -1
package/src/Input.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["Input.tsx"],"names":[],"mappings":";;;AAAA,iCAAmE;AACnE,+CA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AA,EAAE,+BAAgB,CACtB,CAEJ;;QAAA,EAAE,UAAI,CAAE,CACX,CAAA;AACL,CAAC;AA7JD,wDA6JC"}
|
package/src/List.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ViewProps } from "react-native";
|
|
2
|
-
export type DatatableViewProps = {
|
|
3
|
-
items: any[];
|
|
4
|
-
itemAdapter: (item: any, idx: number, list: any) => SimpleDatatableViewItemProps;
|
|
5
|
-
loading?: boolean;
|
|
6
|
-
} & ViewProps;
|
|
7
|
-
export declare function SimpleDatalistView(props: DatatableViewProps): import("react").JSX.Element;
|
|
8
|
-
export type SimpleDatatableViewItemProps = {
|
|
9
|
-
title?: string;
|
|
10
|
-
icon?: string | any;
|
|
11
|
-
subtitle?: string | React.ReactNode;
|
|
12
|
-
body?: string | React.ReactNode;
|
|
13
|
-
action?: React.ReactNode;
|
|
14
|
-
onPress?: () => void;
|
|
15
|
-
flexRatio?: [number, number, number];
|
|
16
|
-
};
|
|
17
|
-
export declare function SimpleDatatlistViewItem(props: SimpleDatatableViewItemProps & ViewProps): import("react").JSX.Element;
|
package/src/List.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SimpleDatatlistViewItem = exports.SimpleDatalistView = void 0;
|
|
4
|
-
const react_native_1 = require("react-native");
|
|
5
|
-
const Box_1 = require("./Box");
|
|
6
|
-
const Image_1 = require("./Image");
|
|
7
|
-
const Text_1 = require("./Text");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const ThemeContext_1 = require("./ThemeContext");
|
|
10
|
-
const Button_1 = require("./Button");
|
|
11
|
-
function SimpleDatalistView(props) {
|
|
12
|
-
const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
|
|
13
|
-
return props.loading ?
|
|
14
|
-
<Box_1.Center style={{
|
|
15
|
-
padding: theme.dimens.space.xl * 2
|
|
16
|
-
}}>
|
|
17
|
-
<react_native_1.ActivityIndicator size={theme.dimens.icon.xl} color={theme.colors.accent}/>
|
|
18
|
-
</Box_1.Center> :
|
|
19
|
-
<Box_1.VBox style={[props.style]}>
|
|
20
|
-
{props.items.map((item, idx) => {
|
|
21
|
-
let data = props.itemAdapter(item, idx, props.items);
|
|
22
|
-
return (<SimpleDatatlistViewItem key={idx} {...data}/>);
|
|
23
|
-
})}
|
|
24
|
-
</Box_1.VBox>;
|
|
25
|
-
}
|
|
26
|
-
exports.SimpleDatalistView = SimpleDatalistView;
|
|
27
|
-
function SimpleDatatlistViewItem(props) {
|
|
28
|
-
const RightIcon = (0, Image_1.getIcon)(props.icon, true);
|
|
29
|
-
const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
|
|
30
|
-
let flexRatio = props.flexRatio || [1, 8, 1];
|
|
31
|
-
let [left, middle, right] = flexRatio;
|
|
32
|
-
const ttl = left + right + middle;
|
|
33
|
-
const percentages = {
|
|
34
|
-
left: (left * 100) / ttl,
|
|
35
|
-
right: (right * 100) / ttl,
|
|
36
|
-
middle: (middle * 100) / ttl
|
|
37
|
-
};
|
|
38
|
-
return (<Button_1.PressableView {...props} onPress={props.onPress}>
|
|
39
|
-
<Box_1.CardView style={[{
|
|
40
|
-
margin: 0,
|
|
41
|
-
marginBottom: theme.dimens.space.sm,
|
|
42
|
-
padding: theme.dimens.space.md,
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
flexDirection: 'row',
|
|
45
|
-
justifyContent: 'space-evenly'
|
|
46
|
-
}, props.style]}>
|
|
47
|
-
|
|
48
|
-
<Box_1.Box style={{
|
|
49
|
-
justifyContent: 'center',
|
|
50
|
-
alignContent: 'center',
|
|
51
|
-
alignItems: 'center',
|
|
52
|
-
alignSelf: 'center',
|
|
53
|
-
width: `${percentages.left}%`,
|
|
54
|
-
maxWidth: 30
|
|
55
|
-
}}>
|
|
56
|
-
{RightIcon && <RightIcon style={{
|
|
57
|
-
padding: theme.dimens.space.md,
|
|
58
|
-
paddingStart: 0,
|
|
59
|
-
}}/>}
|
|
60
|
-
</Box_1.Box>
|
|
61
|
-
<Box_1.VBox style={{
|
|
62
|
-
//@ts-ignore
|
|
63
|
-
paddingStart: flexRatio.left > 1 ? theme.dimens.space.md : 0,
|
|
64
|
-
width: `${percentages.middle}%`,
|
|
65
|
-
flexShrink: 1,
|
|
66
|
-
flexWrap: 'wrap',
|
|
67
|
-
alignItems: 'flex-start',
|
|
68
|
-
justifyContent: 'flex-start',
|
|
69
|
-
alignContent: 'flex-start',
|
|
70
|
-
}}>
|
|
71
|
-
{props.title && (<Text_1.Subtitle style={{
|
|
72
|
-
marginBottom: 0,
|
|
73
|
-
paddingBottom: 0,
|
|
74
|
-
}}>{props.title}</Text_1.Subtitle>)}
|
|
75
|
-
{props.subtitle && (<Text_1.TextView style={{
|
|
76
|
-
marginTop: 0,
|
|
77
|
-
paddingTop: theme.dimens.space.sm,
|
|
78
|
-
}}>{props.subtitle}</Text_1.TextView>)}
|
|
79
|
-
{props.body && (<Text_1.Caption>{props.body}</Text_1.Caption>)}
|
|
80
|
-
</Box_1.VBox>
|
|
81
|
-
<Box_1.Box style={{
|
|
82
|
-
alignItems: 'flex-end',
|
|
83
|
-
width: `${percentages.right}%`,
|
|
84
|
-
padding: 0
|
|
85
|
-
}}>
|
|
86
|
-
{props.action}
|
|
87
|
-
</Box_1.Box>
|
|
88
|
-
</Box_1.CardView>
|
|
89
|
-
</Button_1.PressableView>);
|
|
90
|
-
}
|
|
91
|
-
exports.SimpleDatatlistViewItem = SimpleDatatlistViewItem;
|
|
92
|
-
//# sourceMappingURL=List.js.map
|
package/src/List.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sourceRoot":"","sources":["List.tsx"],"names":[],"mappings":";;;AAAA,+CAAuE;AACvE,+BAAyD;AACzD,mCAAiC;AAEjC,iCAAoD;AACpD,iCAAkC;AAClC,iDAA6C;AAC7C,qCAAwC;AAQxC,SAAg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AkEC"}
|
package/src/Message.d.ts
DELETED
package/src/Message.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.AlertMessage = void 0;
|
|
30
|
-
const Box_1 = require("./Box");
|
|
31
|
-
const React = __importStar(require("react"));
|
|
32
|
-
const react_1 = require("react");
|
|
33
|
-
const ThemeContext_1 = require("./ThemeContext");
|
|
34
|
-
const FontAwesome_1 = __importDefault(require("@expo/vector-icons/FontAwesome"));
|
|
35
|
-
const react_native_1 = require("react-native");
|
|
36
|
-
const Text_1 = require("./Text");
|
|
37
|
-
function AlertMessage(props) {
|
|
38
|
-
const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
|
|
39
|
-
const type = props.type || 'info';
|
|
40
|
-
//@ts-ignore
|
|
41
|
-
let icon = {
|
|
42
|
-
'info': 'info-circle',
|
|
43
|
-
'success': 'check-circle',
|
|
44
|
-
'warning': 'info-circle',
|
|
45
|
-
'critical': 'warning'
|
|
46
|
-
}[type];
|
|
47
|
-
let color = {
|
|
48
|
-
'info': '#2196F3',
|
|
49
|
-
'success': '#4CAF50',
|
|
50
|
-
'warning': '#FFC107',
|
|
51
|
-
'critical': '#F44336'
|
|
52
|
-
}[type];
|
|
53
|
-
if (!props.text || props.text.length < 1) {
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
return (<Box_1.HBox style={[{
|
|
57
|
-
flex: 1,
|
|
58
|
-
margin: theme.dimens.space.sm,
|
|
59
|
-
backgroundColor: theme.colors[type] || color,
|
|
60
|
-
alignItems: 'center',
|
|
61
|
-
justifyContent: 'space-between',
|
|
62
|
-
flexDirection: 'row',
|
|
63
|
-
paddingStart: theme.dimens.space.md,
|
|
64
|
-
paddingEnd: theme.dimens.space.md,
|
|
65
|
-
paddingBottom: props.text.length > 40 && react_native_1.Platform.OS == 'web' ?
|
|
66
|
-
theme.dimens.space.lg : theme.dimens.space.md,
|
|
67
|
-
paddingTop: props.text.length > 40 && react_native_1.Platform.OS == 'web' ?
|
|
68
|
-
theme.dimens.space.lg : theme.dimens.space.md,
|
|
69
|
-
borderRadius: theme.dimens.space.sm,
|
|
70
|
-
}, props.style]}>
|
|
71
|
-
|
|
72
|
-
<Box_1.HBox style={{
|
|
73
|
-
flex: 0.93,
|
|
74
|
-
alignItems: 'center',
|
|
75
|
-
}}>
|
|
76
|
-
<FontAwesome_1.default style={{
|
|
77
|
-
marginRight: theme.dimens.space.md
|
|
78
|
-
}} name={icon} size={theme.dimens.icon.md} color={theme.colors.invert.text}/>
|
|
79
|
-
<Text_1.TextView style={{
|
|
80
|
-
flexShrink: 1,
|
|
81
|
-
padding: 0,
|
|
82
|
-
color: theme.colors.invert.text,
|
|
83
|
-
}}>{props.text}
|
|
84
|
-
</Text_1.TextView>
|
|
85
|
-
</Box_1.HBox>
|
|
86
|
-
{props.onDismiss && <react_native_1.Pressable style={{
|
|
87
|
-
flexDirection: 'row-reverse',
|
|
88
|
-
flex: 0.06,
|
|
89
|
-
}} onPress={() => {
|
|
90
|
-
props.onDismiss && props.onDismiss();
|
|
91
|
-
}}>
|
|
92
|
-
<FontAwesome_1.default name={'close'} size={theme.dimens.icon.md} color={theme.colors.invert.text}/>
|
|
93
|
-
</react_native_1.Pressable>}
|
|
94
|
-
</Box_1.HBox>);
|
|
95
|
-
}
|
|
96
|
-
exports.AlertMessage = AlertMessage;
|
|
97
|
-
//# sourceMappingURL=Message.js.map
|
package/src/Message.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","sourceRoot":"","sources":["Message.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA6B;AAC7B,6CAA+B;AAC/B,iCAAkC;AAClC,iDAA8C;AAC9C,iFAAyD;AACzD,+CAAoE;AACpE,iCAAkC;AAIlC,SAAgB,YAAY,CAAC,KAMxB;IACD,MAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,2BAAY,CAAC,CAAA;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,MAAM,CAAA;IACjC,YAAY;IACZ,IAAI,IAAI,GAA8B;QAClC,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,cAAc;QACzB,SAAS,EAAE,aAAa;QACxB,UAAU,EAAE,SAAS;KACxB,CAAC,IAAI,CAAC,CAAA;IAEP,IAAI,KAAK,GAAG;QACR,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,SA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
|
-
import { StyleProp, TextStyle, ViewProps } from 'react-native';
|
|
3
|
-
import { IconProps } from './Image';
|
|
4
|
-
export type BottomSheetProps = {
|
|
5
|
-
visible: boolean;
|
|
6
|
-
title?: string | React.Component;
|
|
7
|
-
cancellable?: boolean;
|
|
8
|
-
children: any;
|
|
9
|
-
onDismiss?: Function;
|
|
10
|
-
};
|
|
11
|
-
export declare const BottomSheet: (props: BottomSheetProps) => React.JSX.Element;
|
|
12
|
-
export declare function Expand(props: ViewProps & {
|
|
13
|
-
title?: string;
|
|
14
|
-
iconName?: string;
|
|
15
|
-
iconPosition?: 'left' | 'right';
|
|
16
|
-
titleStyle?: StyleProp<TextStyle>;
|
|
17
|
-
titleBackgroundColor?: string;
|
|
18
|
-
iconStyle?: IconProps;
|
|
19
|
-
initialExpand?: boolean;
|
|
20
|
-
duration?: number;
|
|
21
|
-
onExpand?: (isExpanded: boolean) => void;
|
|
22
|
-
onChange?: (isExpanded: boolean) => void;
|
|
23
|
-
}): React.JSX.Element;
|
|
24
|
-
export type DropDownViewOption = {
|
|
25
|
-
id: string;
|
|
26
|
-
value: any;
|
|
27
|
-
title?: string;
|
|
28
|
-
};
|
|
29
|
-
export type DropDownViewProps = {
|
|
30
|
-
options: DropDownViewOption[];
|
|
31
|
-
selectedId: string;
|
|
32
|
-
onSelect: (selectedId: string, opt: DropDownViewOption) => void;
|
|
33
|
-
initialVisile?: Boolean;
|
|
34
|
-
title?: string;
|
|
35
|
-
displayType?: 'button' | 'input';
|
|
36
|
-
onRenderOption?: (opt: DropDownViewOption) => any;
|
|
37
|
-
forceDialogSelectOnWeb?: Boolean;
|
|
38
|
-
} & ViewProps;
|
|
39
|
-
export declare const DropDownView: (props: DropDownViewProps) => React.JSX.Element;
|
|
40
|
-
export type ConfirmationDialogProps = {
|
|
41
|
-
visible: boolean;
|
|
42
|
-
title?: string | React.Component;
|
|
43
|
-
cancellable?: boolean;
|
|
44
|
-
onDismiss?: Function;
|
|
45
|
-
onConfirm: () => void;
|
|
46
|
-
onCancel?: () => void;
|
|
47
|
-
message?: string;
|
|
48
|
-
confirmText?: String;
|
|
49
|
-
cancelText?: String;
|
|
50
|
-
children?: any;
|
|
51
|
-
};
|
|
52
|
-
export declare function ConfirmationDialog(props: ConfirmationDialogProps): React.JSX.Element;
|
package/src/Modal.js
DELETED
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ConfirmationDialog = exports.DropDownView = exports.Expand = exports.BottomSheet = void 0;
|
|
27
|
-
//@ts-nocheck
|
|
28
|
-
const React = __importStar(require("react"));
|
|
29
|
-
const react_1 = require("react");
|
|
30
|
-
const react_native_1 = require("react-native");
|
|
31
|
-
const Image_1 = require("./Image");
|
|
32
|
-
const utils_1 = require("./utils");
|
|
33
|
-
const ThemeContext_1 = require("./ThemeContext");
|
|
34
|
-
const Box_1 = require("./Box");
|
|
35
|
-
const Text_1 = require("./Text");
|
|
36
|
-
const Button_1 = require("./Button");
|
|
37
|
-
const Input_1 = require("./Input");
|
|
38
|
-
const BottomSheet = (props) => {
|
|
39
|
-
const [modalVisible, setModalVisible] = (0, react_1.useState)(false);
|
|
40
|
-
const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
|
|
41
|
-
let cancellable = props.cancellable != undefined ?
|
|
42
|
-
props.cancellable : true;
|
|
43
|
-
(0, react_1.useEffect)(() => {
|
|
44
|
-
setModalVisible(props.visible);
|
|
45
|
-
}, [props.visible]);
|
|
46
|
-
function cancel() {
|
|
47
|
-
setModalVisible(false);
|
|
48
|
-
if (props.onDismiss) {
|
|
49
|
-
props.onDismiss();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return (<react_native_1.View style={styles.container}>
|
|
53
|
-
<react_native_1.Modal onDismiss={() => {
|
|
54
|
-
}} animationType="fade" transparent={true} visible={modalVisible} onRequestClose={() => {
|
|
55
|
-
cancel();
|
|
56
|
-
}}>
|
|
57
|
-
<react_native_1.TouchableHighlight onPress={() => {
|
|
58
|
-
cancel();
|
|
59
|
-
}} style={{
|
|
60
|
-
flex: 1,
|
|
61
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)'
|
|
62
|
-
}}>
|
|
63
|
-
<react_native_1.View />
|
|
64
|
-
</react_native_1.TouchableHighlight>
|
|
65
|
-
|
|
66
|
-
</react_native_1.Modal>
|
|
67
|
-
|
|
68
|
-
<react_native_1.Modal onDismiss={() => {
|
|
69
|
-
cancel();
|
|
70
|
-
}} style={{
|
|
71
|
-
flex: 1
|
|
72
|
-
}} animationType="slide" transparent={true} visible={modalVisible} onRequestClose={() => cancel()}>
|
|
73
|
-
<react_native_1.View style={[styles.modalContainer, {
|
|
74
|
-
backgroundColor: theme.colors.forground
|
|
75
|
-
}]}>
|
|
76
|
-
<react_native_1.View style={[{
|
|
77
|
-
paddingTop: theme.dimens.space.md,
|
|
78
|
-
paddingStart: theme.dimens.space.lg,
|
|
79
|
-
paddingEnd: theme.dimens.space.lg,
|
|
80
|
-
}]}>
|
|
81
|
-
<Box_1.HBox style={{
|
|
82
|
-
justifyContent: 'space-between',
|
|
83
|
-
width: '100%'
|
|
84
|
-
}}>
|
|
85
|
-
<react_native_1.View style={{ width: theme.dimens.icon.md }}/>
|
|
86
|
-
{typeof props.title == 'string' ? (<Text_1.Subtitle style={{
|
|
87
|
-
fontFamily: theme.fonts.Bold
|
|
88
|
-
}}>{props.title.toString()}</Text_1.Subtitle>) : <>{props.title}</>}
|
|
89
|
-
{cancellable ? (<react_native_1.TouchableOpacity style={{
|
|
90
|
-
padding: theme.dimens.space.sm
|
|
91
|
-
}} onPress={() => {
|
|
92
|
-
cancel();
|
|
93
|
-
}}>
|
|
94
|
-
<Image_1.Icon color={theme.colors.caption} name="close"/>
|
|
95
|
-
</react_native_1.TouchableOpacity>) : (<react_native_1.View style={{ width: theme.dimens.icon.md }}/>)}
|
|
96
|
-
</Box_1.HBox>
|
|
97
|
-
<Box_1.VBox style={{
|
|
98
|
-
width: '100%'
|
|
99
|
-
}}>
|
|
100
|
-
<react_native_1.ScrollView nestedScrollEnabled={true} showsVerticalScrollIndicator={false} style={{
|
|
101
|
-
flex: 1,
|
|
102
|
-
maxHeight: 500,
|
|
103
|
-
}}>
|
|
104
|
-
{props.children}
|
|
105
|
-
</react_native_1.ScrollView>
|
|
106
|
-
</Box_1.VBox>
|
|
107
|
-
</react_native_1.View>
|
|
108
|
-
</react_native_1.View>
|
|
109
|
-
</react_native_1.Modal>
|
|
110
|
-
</react_native_1.View>);
|
|
111
|
-
};
|
|
112
|
-
exports.BottomSheet = BottomSheet;
|
|
113
|
-
const styles = react_native_1.StyleSheet.create({
|
|
114
|
-
container: {
|
|
115
|
-
flex: 1,
|
|
116
|
-
justifyContent: 'center',
|
|
117
|
-
alignItems: 'center',
|
|
118
|
-
},
|
|
119
|
-
modalContainer: (0, utils_1.isDesktop)() ? {
|
|
120
|
-
marginLeft: '20%',
|
|
121
|
-
marginRight: '20%',
|
|
122
|
-
marginBottom: '1%',
|
|
123
|
-
width: '60%',
|
|
124
|
-
overflow: 'hidden',
|
|
125
|
-
borderBottomRightRadius: 20,
|
|
126
|
-
borderBottomLeftRadius: 20,
|
|
127
|
-
borderTopLeftRadius: 20,
|
|
128
|
-
borderTopRightRadius: 20,
|
|
129
|
-
position: 'absolute',
|
|
130
|
-
left: 0,
|
|
131
|
-
right: 0,
|
|
132
|
-
bottom: 0,
|
|
133
|
-
} : {
|
|
134
|
-
position: 'absolute',
|
|
135
|
-
left: 0,
|
|
136
|
-
right: 0,
|
|
137
|
-
bottom: 0,
|
|
138
|
-
borderTopLeftRadius: 20,
|
|
139
|
-
borderTopRightRadius: 20,
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
function Expand(props) {
|
|
143
|
-
const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
|
|
144
|
-
const [expanded, setExpanded] = (0, react_1.useState)(props.initialExpand != undefined ? props.initialExpand : false);
|
|
145
|
-
const [contentHeight, setContentHeight] = (0, react_1.useState)(null);
|
|
146
|
-
const spinValue = (0, react_1.useRef)(new react_native_1.Animated.Value(expanded ? 1 : 0)).current;
|
|
147
|
-
const [initDone, setInitDone] = (0, react_1.useState)(false);
|
|
148
|
-
const [fadeAnim] = (0, react_1.useState)(new react_native_1.Animated.Value(0));
|
|
149
|
-
(0, react_1.useEffect)(() => {
|
|
150
|
-
react_native_1.Animated.timing(spinValue, {
|
|
151
|
-
toValue: expanded ? 1 : 0,
|
|
152
|
-
duration: props.duration || 200,
|
|
153
|
-
easing: react_native_1.Easing.ease,
|
|
154
|
-
useNativeDriver: false
|
|
155
|
-
}).start();
|
|
156
|
-
react_native_1.Animated.timing(fadeAnim, {
|
|
157
|
-
toValue: expanded ? 0 : -20,
|
|
158
|
-
duration: props.duration || 200, // Animation duration in milliseconds
|
|
159
|
-
useNativeDriver: true // Add this line for better performance
|
|
160
|
-
}).start();
|
|
161
|
-
if (props.onChange) {
|
|
162
|
-
props.onChange(expanded);
|
|
163
|
-
}
|
|
164
|
-
expanded && props.onExpand && props.onExpand(expanded);
|
|
165
|
-
}, [expanded]);
|
|
166
|
-
(0, react_1.useEffect)(() => {
|
|
167
|
-
setInitDone(true);
|
|
168
|
-
}, []);
|
|
169
|
-
const toggleExpand = () => {
|
|
170
|
-
let newValue = !expanded;
|
|
171
|
-
setExpanded(newValue);
|
|
172
|
-
};
|
|
173
|
-
var onLayoutContent = (event) => {
|
|
174
|
-
if (!contentHeight) {
|
|
175
|
-
setContentHeight(event.nativeEvent.layout.height);
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
if (react_native_1.Platform.OS == "web") {
|
|
179
|
-
const [initalLayoutWait, setinitalLayoutWait] = (0, react_1.useState)(false);
|
|
180
|
-
(0, react_1.useEffect)(() => {
|
|
181
|
-
setTimeout(() => {
|
|
182
|
-
setinitalLayoutWait(true);
|
|
183
|
-
}, 2000);
|
|
184
|
-
}, []);
|
|
185
|
-
onLayoutContent = (event) => {
|
|
186
|
-
if (!contentHeight && initalLayoutWait) {
|
|
187
|
-
setContentHeight(event.nativeEvent.layout.height);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
const spinInterpolated = spinValue.interpolate({
|
|
192
|
-
easing: react_native_1.Easing.ease,
|
|
193
|
-
inputRange: [0, 1],
|
|
194
|
-
outputRange: ['0deg', '90deg']
|
|
195
|
-
});
|
|
196
|
-
const ExpandIcon = () => {
|
|
197
|
-
return (<react_native_1.Pressable style={[{
|
|
198
|
-
borderRadius: theme.dimens.space.md,
|
|
199
|
-
padding: theme.dimens.space.md,
|
|
200
|
-
}, {
|
|
201
|
-
backgroundColor: props.titleBackgroundColor
|
|
202
|
-
}]} onPress={toggleExpand}>
|
|
203
|
-
<Box_1.Center style={props.iconPosition == 'right' ? {
|
|
204
|
-
paddingLeft: theme.dimens.space.sm,
|
|
205
|
-
justifyContent: 'space-between',
|
|
206
|
-
flexDirection: 'row-reverse',
|
|
207
|
-
} : {
|
|
208
|
-
justifyContent: 'flex-start',
|
|
209
|
-
flexDirection: 'row',
|
|
210
|
-
}}>
|
|
211
|
-
<react_native_1.Animated.View style={{
|
|
212
|
-
transform: [{ rotate: spinInterpolated }],
|
|
213
|
-
}}>
|
|
214
|
-
<Image_1.Icon color={theme.colors.text} {...props.iconStyle} name={props.iconName || 'chevron-right'}/>
|
|
215
|
-
</react_native_1.Animated.View>
|
|
216
|
-
<Box_1.HBox style={{
|
|
217
|
-
width: theme.dimens.space.sm
|
|
218
|
-
}}/>
|
|
219
|
-
<Text_1.Title style={[{
|
|
220
|
-
padding: 0,
|
|
221
|
-
paddingLeft: props.iconPosition == 'right' ? 0 :
|
|
222
|
-
theme.dimens.space.sm,
|
|
223
|
-
margin: 0,
|
|
224
|
-
fontSize: theme.dimens.font.md
|
|
225
|
-
}, props.titleStyle]}>{props.title}</Text_1.Title>
|
|
226
|
-
</Box_1.Center>
|
|
227
|
-
</react_native_1.Pressable>);
|
|
228
|
-
};
|
|
229
|
-
return (<Box_1.VBox style={[{
|
|
230
|
-
padding: 0,
|
|
231
|
-
borderRadius: theme.dimens.space.md,
|
|
232
|
-
margin: theme.dimens.space.sm
|
|
233
|
-
}, {
|
|
234
|
-
justifyContent: (props.iconPosition) == 'right' ? 'space-between' : 'flex-start'
|
|
235
|
-
}, props.style]}>
|
|
236
|
-
<ExpandIcon />
|
|
237
|
-
<react_native_1.Animated.View style={{
|
|
238
|
-
zIndex: -1,
|
|
239
|
-
transform: [{ translateY: fadeAnim }],
|
|
240
|
-
height: expanded ? 'auto' : 0,
|
|
241
|
-
overflow: 'hidden'
|
|
242
|
-
}} onLayout={onLayoutContent}>
|
|
243
|
-
{(expanded || initDone) && (<Box_1.VBox onLayout={onLayoutContent}>
|
|
244
|
-
{props.children}
|
|
245
|
-
</Box_1.VBox>)}
|
|
246
|
-
</react_native_1.Animated.View>
|
|
247
|
-
</Box_1.VBox>);
|
|
248
|
-
}
|
|
249
|
-
exports.Expand = Expand;
|
|
250
|
-
const DropDownView = (props) => {
|
|
251
|
-
const displayType = props.displayType || 'input';
|
|
252
|
-
const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
|
|
253
|
-
const [visible, setVisible] = (0, react_1.useState)(props.initialVisile || false);
|
|
254
|
-
const getSelected = () => {
|
|
255
|
-
let se = props.options.find(op => op.id == props.selectedId);
|
|
256
|
-
return se;
|
|
257
|
-
};
|
|
258
|
-
if (react_native_1.Platform.OS == 'web' && !props.forceDialogSelectOnWeb) {
|
|
259
|
-
return (<select defaultValue={props.selectedId} onChange={(e) => {
|
|
260
|
-
props.onSelect(e.target.value, props.options.find(o => o.id == e.target.value)?.value);
|
|
261
|
-
}}
|
|
262
|
-
//@ts-ignore
|
|
263
|
-
style={Object.assign({
|
|
264
|
-
width: '100%',
|
|
265
|
-
padding: theme.dimens.space.md,
|
|
266
|
-
margin: theme.dimens.space.md
|
|
267
|
-
}, props.style || {})}>
|
|
268
|
-
{props.options.map(opt => {
|
|
269
|
-
if (props.onRenderOption) {
|
|
270
|
-
return props.onRenderOption(opt);
|
|
271
|
-
}
|
|
272
|
-
return (<option style={{
|
|
273
|
-
padding: theme.dimens.space.md,
|
|
274
|
-
}} key={opt.id} id={opt.id} value={opt.id}>{opt.title || opt.value}</option>);
|
|
275
|
-
})}
|
|
276
|
-
</select>);
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
return (<Box_1.VBox style={props.style}>
|
|
280
|
-
<exports.BottomSheet visible={visible} onDismiss={() => {
|
|
281
|
-
setVisible(false);
|
|
282
|
-
}} title={props.title || ''}>
|
|
283
|
-
{props.options.map((opt, idx) => {
|
|
284
|
-
if (props.onRenderOption) {
|
|
285
|
-
return props.onRenderOption(opt);
|
|
286
|
-
}
|
|
287
|
-
return (<Button_1.TertiaryButtonView onPress={() => {
|
|
288
|
-
setVisible(false);
|
|
289
|
-
props.onSelect(opt.id, opt);
|
|
290
|
-
}} style={{
|
|
291
|
-
padding: 0,
|
|
292
|
-
paddingBottom: idx == props.options.length - 1 ? theme.dimens.space.md : 0,
|
|
293
|
-
paddingTop: idx == 0 ? theme.dimens.space.md : 0,
|
|
294
|
-
}} key={opt.id}>{opt.title || opt.value}</Button_1.TertiaryButtonView>);
|
|
295
|
-
})}
|
|
296
|
-
</exports.BottomSheet>
|
|
297
|
-
|
|
298
|
-
{displayType == 'button' ? (
|
|
299
|
-
//@ts-ignore
|
|
300
|
-
<Button_1.ButtonView {...props} onPress={() => {
|
|
301
|
-
setVisible(true);
|
|
302
|
-
}} text={getSelected()?.title || getSelected()?.id || 'select'} style={props.style}>
|
|
303
|
-
</Button_1.ButtonView>) : (
|
|
304
|
-
//@ts-ignore
|
|
305
|
-
<Button_1.PressableView {...props} onPress={() => {
|
|
306
|
-
setVisible(true);
|
|
307
|
-
}}>
|
|
308
|
-
<Input_1.CompositeTextInputView placeholder={props.title} {...props} value={getSelected()?.title || getSelected()?.id} onIconPress={() => { setVisible(true); }} icon={"caret-down"} pointerEvents="none" _textInputProps={{
|
|
309
|
-
caretHidden: true,
|
|
310
|
-
placeholder: props.title || 'select',
|
|
311
|
-
editable: false,
|
|
312
|
-
selectTextOnFocus: false
|
|
313
|
-
}} hint={props.title || 'select'} initialText={getSelected()?.title || getSelected()?.id}/>
|
|
314
|
-
</Button_1.PressableView>)}
|
|
315
|
-
</Box_1.VBox>);
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
exports.DropDownView = DropDownView;
|
|
319
|
-
function ConfirmationDialog(props) {
|
|
320
|
-
const confirmText = props.confirmText || 'Confirm';
|
|
321
|
-
const cancelText = props.cancelText || 'Cancel';
|
|
322
|
-
const theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
|
|
323
|
-
return (<exports.BottomSheet onDismiss={() => {
|
|
324
|
-
props.onDismiss && props.onDismiss();
|
|
325
|
-
}} {...props}>
|
|
326
|
-
<Box_1.VBox>
|
|
327
|
-
{props.message && <Text_1.TextView style={{
|
|
328
|
-
padding: theme.dimens.space.lg,
|
|
329
|
-
textAlign: 'center'
|
|
330
|
-
}}>{props.message}</Text_1.TextView>}
|
|
331
|
-
<Button_1.ButtonView text={confirmText} onPress={() => {
|
|
332
|
-
props.onDismiss && props.onDismiss();
|
|
333
|
-
props.onConfirm && props.onConfirm();
|
|
334
|
-
}}/>
|
|
335
|
-
<Button_1.TertiaryButtonView text={cancelText} onPress={() => {
|
|
336
|
-
props.onDismiss && props.onDismiss();
|
|
337
|
-
props.onCancel && props.onCancel();
|
|
338
|
-
}}/>
|
|
339
|
-
</Box_1.VBox>
|
|
340
|
-
|
|
341
|
-
</exports.BottomSheet>);
|
|
342
|
-
}
|
|
343
|
-
exports.ConfirmationDialog = ConfirmationDialog;
|
|
344
|
-
//# sourceMappingURL=Modal.js.map
|