@xhsreds/reds-rn-next 0.11.1-beta202601161832 → 0.11.1-beta202601191704
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/coverage/.tmp/coverage-0.json +1 -1
- package/coverage/.tmp/coverage-1.json +1 -1
- package/coverage/.tmp/coverage-11.json +1 -1
- package/coverage/.tmp/coverage-12.json +1 -1
- package/coverage/.tmp/coverage-13.json +1 -1
- package/coverage/.tmp/coverage-14.json +1 -1
- package/coverage/.tmp/coverage-15.json +1 -1
- package/coverage/.tmp/coverage-16.json +1 -1
- package/coverage/.tmp/coverage-17.json +1 -1
- package/coverage/.tmp/coverage-18.json +1 -1
- package/coverage/.tmp/coverage-19.json +1 -1
- package/coverage/.tmp/coverage-2.json +1 -1
- package/coverage/.tmp/coverage-20.json +1 -1
- package/coverage/.tmp/coverage-25.json +1 -1
- package/coverage/.tmp/coverage-26.json +1 -1
- package/coverage/.tmp/coverage-27.json +1 -1
- package/coverage/.tmp/coverage-3.json +1 -1
- package/coverage/.tmp/coverage-30.json +1 -1
- package/coverage/.tmp/coverage-31.json +1 -1
- package/coverage/.tmp/coverage-32.json +1 -1
- package/coverage/.tmp/coverage-33.json +1 -1
- package/coverage/.tmp/coverage-34.json +1 -1
- package/coverage/.tmp/coverage-35.json +1 -1
- package/coverage/.tmp/coverage-36.json +1 -1
- package/coverage/.tmp/coverage-37.json +1 -1
- package/coverage/.tmp/coverage-38.json +1 -1
- package/coverage/.tmp/coverage-39.json +1 -1
- package/coverage/.tmp/coverage-40.json +1 -1
- package/coverage/.tmp/coverage-41.json +1 -1
- package/coverage/.tmp/coverage-42.json +1 -1
- package/coverage/.tmp/coverage-43.json +1 -1
- package/coverage/.tmp/coverage-5.json +1 -1
- package/coverage/.tmp/coverage-7.json +1 -1
- package/coverage/.tmp/coverage-9.json +1 -1
- package/lib/cjs/_chunks/{B6BxX_sn.js → D9vEt_Qk.js} +3 -2
- package/lib/cjs/_chunks/D9vEt_Qk.js.map +1 -0
- package/lib/cjs/components/Alert/Alert.js +7 -7
- package/lib/cjs/components/Alert/Alert.js.map +1 -1
- package/lib/cjs/components/Alert/hooks/alert.js +1 -1
- package/lib/cjs/components/Alert/index.js +1 -1
- package/lib/cjs/components/Alert/interface/index.js +1 -1
- package/lib/cjs/components/Alert/styles.js +13 -55
- package/lib/cjs/components/Alert/styles.js.map +1 -1
- package/lib/cjs/components/Radio/Radio.js +1 -1
- package/lib/cjs/components/Radio/index.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/esm/_chunks/{BP2FxtYY.js → CNx6YBDL.js} +3 -2
- package/lib/esm/_chunks/CNx6YBDL.js.map +1 -0
- package/lib/esm/components/Alert/Alert.js +7 -7
- package/lib/esm/components/Alert/Alert.js.map +1 -1
- package/lib/esm/components/Alert/hooks/alert.js +1 -1
- package/lib/esm/components/Alert/index.js +1 -1
- package/lib/esm/components/Alert/interface/index.js +1 -1
- package/lib/esm/components/Alert/styles.js +13 -55
- package/lib/esm/components/Alert/styles.js.map +1 -1
- package/lib/esm/components/Radio/Radio.js +1 -1
- package/lib/esm/components/Radio/index.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/src/components/Alert/interface/index.d.ts +2 -0
- package/lib/src/components/Alert/styles.d.ts +11 -43
- package/lib/types/components/Alert/interface/index.d.ts +2 -0
- package/lib/types/components/Alert/styles.d.ts +11 -43
- package/package.json +2 -2
- package/src/components/Alert/Alert.tsx +7 -78
- package/src/components/Alert/doc/index.mdx +1 -0
- package/src/components/Alert/interface/index.ts +2 -0
- package/src/components/Alert/styles.ts +12 -49
- package/src/i18n/@types/resources.d.ts +18 -18
- package/src/i18n/index.json +31 -31
- package/lib/cjs/_chunks/B6BxX_sn.js.map +0 -1
- package/lib/esm/_chunks/BP2FxtYY.js.map +0 -1
|
@@ -20,7 +20,8 @@ var AlertDefaultProps = {
|
|
|
20
20
|
confirmBtnTextStyle: {},
|
|
21
21
|
cancelBtnTextStyle: {},
|
|
22
22
|
confirmBtnProps: {},
|
|
23
|
-
cancelBtnProps: {}
|
|
23
|
+
cancelBtnProps: {},
|
|
24
|
+
style: {}
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
var index = /*#__PURE__*/Object.freeze({
|
|
@@ -30,4 +31,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
30
31
|
|
|
31
32
|
exports.AlertDefaultProps = AlertDefaultProps;
|
|
32
33
|
exports.index = index;
|
|
33
|
-
//# sourceMappingURL=
|
|
34
|
+
//# sourceMappingURL=D9vEt_Qk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"D9vEt_Qk.js","sources":["../../../src/components/Alert/interface/index.ts"],"sourcesContent":["import { GestureResponderEvent, ViewStyle, TextStyle } from \"react-native\";\nimport { lightColor } from \"@xhsreds/reds-token-next\";\n\ninterface AlertOffset {\n x: number;\n y: number;\n}\nexport interface RedsAlert {\n show?: boolean;\n title?: string;\n message?: string;\n align?: \"left\" | \"center\" | string;\n footerLayout?: \"horizontal\" | \"vertical\" | string;\n showConfirmButton?: boolean;\n showCancelButton?: boolean;\n confirmText?: string;\n cancelText?: string;\n mask?: boolean;\n footerType?: \"text\" | \"button\" | string;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n header?: React.ReactNode;\n onConfirm?: (value: GestureResponderEvent) => void;\n onCancel?: (value: GestureResponderEvent) => void;\n onOpen?: () => void;\n onClose?: () => void;\n onMask?: (value: GestureResponderEvent) => void;\n contentStyle?: ViewStyle;\n cancelBtnStyle?: ViewStyle;\n confirmBtnStyle?: ViewStyle;\n footerStyle?: ViewStyle;\n offset?: AlertOffset;\n hostName?: string;\n confirmBtnTextStyle?: TextStyle;\n cancelBtnTextStyle?: TextStyle;\n confirmBtnProps?: any;\n cancelBtnProps?: any;\n style?: any;\n}\n\nexport interface RedsAlertEvent {}\nexport const AlertDefaultProps = {\n show: false,\n align: \"center\",\n footerLayout: \"horizontal\",\n showConfirmButton: true,\n showCancelButton: true,\n mask: true,\n footerType: \"button\",\n contentStyle: {},\n cancelBtnStyle: {},\n confirmBtnStyle: {},\n footerStyle: {},\n offset: { x: 0, y: 0 },\n hostName: \"root\",\n confirmBtnTextStyle: {},\n cancelBtnTextStyle: {},\n confirmBtnProps: {},\n cancelBtnProps: {},\n style: {},\n};\n"],"names":["AlertDefaultProps","show","align","footerLayout","showConfirmButton","showCancelButton","mask","footerType","contentStyle","cancelBtnStyle","confirmBtnStyle","footerStyle","offset","x","y","hostName","confirmBtnTextStyle","cancelBtnTextStyle","confirmBtnProps","cancelBtnProps","style"],"mappings":";;AAyCO,IAAMA,iBAAoB,GAAA;AAC/BC,EAAAA,IAAM,EAAA,KAAA;AACNC,EAAAA,KAAO,EAAA,QAAA;AACPC,EAAAA,YAAc,EAAA,YAAA;AACdC,EAAAA,iBAAmB,EAAA,IAAA;AACnBC,EAAAA,gBAAkB,EAAA,IAAA;AAClBC,EAAAA,IAAM,EAAA,IAAA;AACNC,EAAAA,UAAY,EAAA,QAAA;EACZC,cAAc,EAAC;EACfC,gBAAgB,EAAC;EACjBC,iBAAiB,EAAC;EAClBC,aAAa,EAAC;AACdC,EAAAA,MAAQ,EAAA;AAAEC,IAAAA,CAAG,EAAA,CAAA;AAAGC,IAAAA,GAAG,CAAA;GAAE;AACrBC,EAAAA,QAAU,EAAA,MAAA;EACVC,qBAAqB,EAAC;EACtBC,oBAAoB,EAAC;EACrBC,iBAAiB,EAAC;EAClBC,gBAAgB,EAAC;AACjBC,EAAAA,OAAO,EAAC;AACV;;;;;;;;;;"}
|
|
@@ -8,7 +8,7 @@ var reactNative = require('react-native');
|
|
|
8
8
|
require('../ConfigProvider/hooks/ConfigCache/ConfigCache.js');
|
|
9
9
|
var pvCount_useUnmountedProcess = require('../../pvCount/useUnmountedProcess.js');
|
|
10
10
|
var components_ConfigProvider_hooks_themeToken_useThemeToken = require('../ConfigProvider/hooks/themeToken/useThemeToken.js');
|
|
11
|
-
var components_Alert_interface_index = require('../../_chunks/
|
|
11
|
+
var components_Alert_interface_index = require('../../_chunks/D9vEt_Qk.js');
|
|
12
12
|
var components_Button_Button = require('../Button/Button.js');
|
|
13
13
|
var components_Portal_core_Portal = require('../Portal/core/Portal.js');
|
|
14
14
|
require('../Portal/core/PortalHost.js');
|
|
@@ -110,7 +110,7 @@ var Alert = function Alert(props) {
|
|
|
110
110
|
}]
|
|
111
111
|
}]
|
|
112
112
|
}, /* @__PURE__ */React.createElement(reactNative.View, {
|
|
113
|
-
style: [styles.alertContainer, {
|
|
113
|
+
style: [styles.alertContainer, props.style, {
|
|
114
114
|
top: ((_props$offset = props.offset) === null || _props$offset === void 0 ? void 0 : _props$offset.y) || 0,
|
|
115
115
|
left: ((_props$offset2 = props.offset) === null || _props$offset2 === void 0 ? void 0 : _props$offset2.x) || 0
|
|
116
116
|
}]
|
|
@@ -124,11 +124,13 @@ var Alert = function Alert(props) {
|
|
|
124
124
|
}, /* @__PURE__ */React.createElement(reactNative.Text, {
|
|
125
125
|
style: [styles.messageText, align === "left" && styles.messageLeft]
|
|
126
126
|
}, message)) : children), footer ? footer : /* @__PURE__ */React.createElement(reactNative.View, {
|
|
127
|
-
style: [styles.footer, footerLayout === "vertical" ? styles.footerVertical : styles.footerHorizontal,
|
|
127
|
+
style: [styles.footer, footerLayout === "vertical" ? styles.footerVertical : styles.footerHorizontal,
|
|
128
|
+
// footerType === "text" && styles.footerText,
|
|
129
|
+
props.footerStyle]
|
|
128
130
|
}, showCancelButton && /* @__PURE__ */React.createElement(components_Button_Button.default, _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2({
|
|
129
131
|
variant: footerType === "text" ? "text" : "outline",
|
|
130
132
|
onClick: handleCancel,
|
|
131
|
-
style: _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2({},
|
|
133
|
+
style: _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2({}, styles.cancelButton), cancelBtnStyle),
|
|
132
134
|
size: footerType === "text" ? footerLayout === "vertical" ? "medium" : "large" : "medium"
|
|
133
135
|
}, props.cancelBtnProps || {}), {}, {
|
|
134
136
|
textStyle: [styles.cancelText, cancelBtnTextStyle]
|
|
@@ -136,19 +138,17 @@ var Alert = function Alert(props) {
|
|
|
136
138
|
// @ts-ignore
|
|
137
139
|
/* @__PURE__ */
|
|
138
140
|
React.createElement(reactNative.View, {
|
|
139
|
-
direction: "horizontal",
|
|
140
141
|
style: styles.horizontalLine
|
|
141
142
|
}) :
|
|
142
143
|
// @ts-ignore
|
|
143
144
|
/* @__PURE__ */
|
|
144
145
|
React.createElement(reactNative.View, {
|
|
145
|
-
direction: "vertical",
|
|
146
146
|
style: styles.verticalLine
|
|
147
147
|
})), showConfirmButton && /* @__PURE__ */React.createElement(components_Button_Button.default, _rollupPluginBabelHelpers._objectSpread2({
|
|
148
148
|
type: "primary",
|
|
149
149
|
variant: footerType === "text" ? "text" : "fill",
|
|
150
150
|
onClick: handleConfirm,
|
|
151
|
-
style: _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2(
|
|
151
|
+
style: _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2({}, styles.confirmButton), confirmBtnStyle),
|
|
152
152
|
textStyle: [styles.confirmButtonText, confirmBtnTextStyle],
|
|
153
153
|
size: footerType === "text" ? footerLayout === "vertical" ? "medium" : "large" : "medium"
|
|
154
154
|
}, props.confirmBtnProps || {}), confirmText || confirmKey)))))) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback, useRef } from \"react\";\nimport {\n View,\n Text,\n Modal,\n Image,\n ScrollView,\n TouchableWithoutFeedback,\n StyleSheet,\n GestureResponderEvent,\n Animated,\n TouchableOpacity,\n} from \"react-native\";\nimport { useThemeColor, useThemeTypography } from \"../ConfigProvider\";\nimport { RedsAlert, AlertDefaultProps } from \"./interface\";\nimport { Button } from \"../Button\";\nimport { Divider } from \"../Divider\";\nimport { Portal } from \"../Portal\";\nimport { style } from \"./styles\";\nimport useMounted from \"../../pvCount/useUnmountedProcess\";\nimport { useLanguage } from \"../LanguageProvider\";\n// const AlertView: React.FC<RedsAlert> = (props) => {\n// const finalProps = { ...AlertDefaultProps, ...props };\n// const {\n// show,\n// title,\n// message,\n// confirmText,\n// cancelText,\n// onConfirm,\n// onCancel,\n// onOpen,\n// onClose,\n// align,\n// // showScrollOverlay,\n// footerLayout,\n// showConfirmButton,\n// showCancelButton,\n// mask,\n// footerType,\n// header,\n// footer,\n// children,\n// onMask,\n// confirmBtnStyle,\n// } = finalProps;\n// const themeColor = useThemeColor(\"Alert\");\n// const cancelKey = useLanguage(\"componentKey\", \"cancelKey\");\n// const confirmKey = useLanguage(\"componentKey\", \"confirmKey\");\n// const styles = style(props);\n// // const [hasScrollToBottom, setHasScrollToBottom] = useState(true);\n// const fadeAnim = useRef(new Animated.Value(0)).current;\n\n// useEffect(() => {\n// if (show && onOpen) onOpen();\n// if (!show && onClose) onClose();\n// }, [show]);\n\n// const handleConfirm = (e: GestureResponderEvent) => {\n// if (onConfirm) onConfirm(e);\n// };\n\n// const handleCancel = (e: GestureResponderEvent) => {\n// if (onCancel) onCancel(e);\n// };\n// return show ? (\n// <>\n// <Animated.View\n// style={[\n// styles.centeredView,\n// {\n// transform: [\n// {\n// scale: fadeAnim.interpolate({\n// inputRange: [0, 1],\n// outputRange: [1, 1],\n// }),\n// },\n// ],\n// },\n// ]}\n// >\n// {mask && (\n// <TouchableOpacity onPress={() => { console.log('onMask xxxx')}} activeOpacity={1}>\n// <View style={styles.modalOverlay} />\n// </TouchableOpacity>\n// )}\n\n// </Animated.View>\n// </>\n// ) : null;\n// };\n\nconst Alert: React.FC<RedsAlert> = (props) => {\n const finalProps = { ...AlertDefaultProps, ...props };\n const typography = useThemeTypography(\"Button\");\n const {\n show,\n title,\n message,\n confirmText,\n cancelText,\n onConfirm,\n onCancel,\n onOpen,\n onClose,\n align,\n // showScrollOverlay,\n footerLayout,\n showConfirmButton,\n showCancelButton,\n mask,\n footerType,\n header,\n footer,\n children,\n confirmBtnStyle,\n cancelBtnStyle,\n confirmBtnTextStyle,\n cancelBtnTextStyle,\n hostName,\n onMask,\n } = finalProps;\n\n const styles = style(props);\n // const [hasScrollToBottom, setHasScrollToBottom] = useState(true);\n const fadeAnim = useRef(new Animated.Value(0)).current;\n\n const cancelKey = useLanguage(\"componentKey\", \"cancelKey\");\n\n const confirmKey = useLanguage(\"componentKey\", \"confirmKey\");\n\n useEffect(() => {\n if (show && onOpen) onOpen();\n if (!show && onClose) onClose();\n }, [show]);\n\n const handleConfirm = (e: GestureResponderEvent) => {\n if (onConfirm) onConfirm(e);\n };\n\n const handleCancel = (e: GestureResponderEvent) => {\n if (onCancel) onCancel(e);\n };\n useMounted(\"Alert\");\n return show ? (\n <Portal hostName={hostName}>\n <View style={styles.centeredView}>\n {mask && (\n <TouchableWithoutFeedback onPress={onMask}>\n <View style={styles.modalOverlay} />\n </TouchableWithoutFeedback>\n )}\n <Animated.View\n style={[\n {\n transform: [\n {\n scale: fadeAnim.interpolate({\n inputRange: [0, 1],\n outputRange: [1, 1],\n }),\n },\n ],\n },\n ]}\n >\n <View style={[styles.alertContainer, { top: props.offset?.y || 0, left: props.offset?.x || 0 }]}>\n {header}\n <View style={[styles.alertContent, props.contentStyle]}>\n <Text style={styles.title}>{title}</Text>\n {message ? (\n <ScrollView\n // onContentSizeChange={handleContentSizeChange}\n // onScroll={handleScrollView}\n style={[styles.message]}\n scrollEventThrottle={16}\n >\n <Text style={[styles.messageText, align === \"left\" && styles.messageLeft]}>{message}</Text>\n </ScrollView>\n ) : (\n children\n )}\n </View>\n {footer ? (\n footer\n ) : (\n <View\n style={[\n styles.footer,\n footerLayout === \"vertical\" ? styles.footerVertical : styles.footerHorizontal,\n footerType === \"text\" && styles.footerText,\n props.footerStyle,\n ]}\n >\n {showCancelButton && (\n <Button\n variant={footerType === \"text\" ? \"text\" : \"outline\"}\n onClick={handleCancel}\n style={{\n ...(footerLayout === \"vertical\" ? styles.verCancelButton : styles.cancelButton),\n ...cancelBtnStyle,\n }}\n size={footerType === \"text\" ? (footerLayout === \"vertical\" ? \"medium\" : \"large\") : \"medium\"}\n {...(props.cancelBtnProps || {})}\n textStyle={[styles.cancelText, cancelBtnTextStyle]}\n >\n {cancelText || cancelKey}\n </Button>\n )}\n {footerType === \"text\" &&\n showCancelButton &&\n (footerLayout === \"vertical\" ? (\n // @ts-ignore\n <View direction={\"horizontal\"} style={styles.horizontalLine} />\n ) : (\n // @ts-ignore\n <View direction={\"vertical\"} style={styles.verticalLine} />\n ))}\n {showConfirmButton && (\n <Button\n type=\"primary\"\n variant={footerType === \"text\" ? \"text\" : \"fill\"}\n onClick={handleConfirm}\n style={{\n ...(footerType === \"text\" ? styles.button : styles.confirmButton),\n ...(footerLayout === \"vertical\" ? styles.verButton : styles.confirmButton),\n ...confirmBtnStyle,\n }}\n textStyle={[styles.confirmButtonText, confirmBtnTextStyle]}\n size={footerType === \"text\" ? (footerLayout === \"vertical\" ? \"medium\" : \"large\") : \"medium\"}\n {...(props.confirmBtnProps || {})}\n >\n {confirmText || confirmKey}\n </Button>\n )}\n </View>\n )}\n </View>\n </Animated.View>\n </View>\n </Portal>\n ) : null;\n};\n\nexport default Alert;\n"],"names":["Alert","props","_props$offset","_props$offset2","finalProps","_objectSpread","AlertDefaultProps","useThemeTypography","show","title","message","confirmText","cancelText","onConfirm","onCancel","onOpen","onClose","align","footerLayout","showConfirmButton","showCancelButton","mask","footerType","header","footer","children","confirmBtnStyle","cancelBtnStyle","confirmBtnTextStyle","cancelBtnTextStyle","hostName","onMask","styles","style","fadeAnim","useRef","Animated","Value","current","cancelKey","useLanguage","confirmKey","useEffect","handleConfirm","e","handleCancel","useMounted","Portal","View","centeredView","TouchableWithoutFeedback","onPress","React","createElement","modalOverlay","transform","scale","interpolate","inputRange","outputRange","alertContainer","top","offset","y","left","x","alertContent","contentStyle","Text","ScrollView","scrollEventThrottle","messageText","messageLeft","footerVertical","footerHorizontal","footerText","footerStyle","Button","variant","onClick","verCancelButton","cancelButton","size","cancelBtnProps","textStyle","direction","horizontalLine","verticalLine","type","button","confirmButton","verButton","confirmButtonText","confirmBtnProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,IAAMA,KAAA,GAA6B,SAA7BA,KAAAA,CAA8BC,KAAU,EAAA;EAAA,IAAAC,aAAA,EAAAC,cAAA,CAAA;EAC5C,IAAMC,UAAa,GAAAC,wCAAA,CAAAA,wCAAA,CAAKC,EAAAA,EAAAA,kDAAA,CAAsBL,EAAAA,KAAM,CAAA,CAAA;AAC9C,EAAaM,4EAAmB,QAAQ,EAAA;AACxC,EAAA,IACJC,IAAA,GAyBEJ,UAAA,CAzBFI,IAAA;IACAC,KAAA,GAwBEL,UAAA,CAxBFK,KAAA;IACAC,OAAA,GAuBEN,UAAA,CAvBFM,OAAA;IACAC,WAAA,GAsBEP,UAAA,CAtBFO,WAAA;IACAC,UAAA,GAqBER,UAAA,CArBFQ,UAAA;IACAC,SAAA,GAoBET,UAAA,CApBFS,SAAA;IACAC,QAAA,GAmBEV,UAAA,CAnBFU,QAAA;IACAC,MAAA,GAkBEX,UAAA,CAlBFW,MAAA;IACAC,OAAA,GAiBEZ,UAAA,CAjBFY,OAAA;IACAC,KAAA,GAgBEb,UAAA,CAhBFa,KAAA;IAEAC,YAAA,GAcEd,UAAA,CAdFc,YAAA;IACAC,iBAAA,GAaEf,UAAA,CAbFe,iBAAA;IACAC,gBAAA,GAYEhB,UAAA,CAZFgB,gBAAA;IACAC,IAAA,GAWEjB,UAAA,CAXFiB,IAAA;IACAC,UAAA,GAUElB,UAAA,CAVFkB,UAAA;IACAC,MAAA,GASEnB,UAAA,CATFmB,MAAA;IACAC,MAAA,GAQEpB,UAAA,CARFoB,MAAA;IACAC,QA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ACE,GAAA,IAAA,CAAA;AACN;;;;"}
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback, useRef } from \"react\";\nimport {\n View,\n Text,\n Modal,\n Image,\n ScrollView,\n TouchableWithoutFeedback,\n StyleSheet,\n GestureResponderEvent,\n Animated,\n TouchableOpacity,\n} from \"react-native\";\nimport { useThemeColor, useThemeTypography } from \"../ConfigProvider\";\nimport { RedsAlert, AlertDefaultProps } from \"./interface\";\nimport { Button } from \"../Button\";\nimport { Divider } from \"../Divider\";\nimport { Portal } from \"../Portal\";\nimport { style } from \"./styles\";\nimport useMounted from \"../../pvCount/useUnmountedProcess\";\nimport { useLanguage } from \"../LanguageProvider\";\n\nconst Alert: React.FC<RedsAlert> = (props) => {\n const finalProps = { ...AlertDefaultProps, ...props };\n const typography = useThemeTypography(\"Button\");\n const {\n show,\n title,\n message,\n confirmText,\n cancelText,\n onConfirm,\n onCancel,\n onOpen,\n onClose,\n align,\n // showScrollOverlay,\n footerLayout,\n showConfirmButton,\n showCancelButton,\n mask,\n footerType,\n header,\n footer,\n children,\n confirmBtnStyle,\n cancelBtnStyle,\n confirmBtnTextStyle,\n cancelBtnTextStyle,\n hostName,\n onMask,\n } = finalProps;\n\n const styles = style(props);\n // const [hasScrollToBottom, setHasScrollToBottom] = useState(true);\n const fadeAnim = useRef(new Animated.Value(0)).current;\n\n const cancelKey = useLanguage(\"componentKey\", \"cancelKey\");\n\n const confirmKey = useLanguage(\"componentKey\", \"confirmKey\");\n\n useEffect(() => {\n if (show && onOpen) onOpen();\n if (!show && onClose) onClose();\n }, [show]);\n\n const handleConfirm = (e: GestureResponderEvent) => {\n if (onConfirm) onConfirm(e);\n };\n\n const handleCancel = (e: GestureResponderEvent) => {\n if (onCancel) onCancel(e);\n };\n useMounted(\"Alert\");\n\n return show ? (\n <Portal hostName={hostName}>\n <View style={styles.centeredView}>\n {mask && (\n <TouchableWithoutFeedback onPress={onMask}>\n <View style={styles.modalOverlay} />\n </TouchableWithoutFeedback>\n )}\n <Animated.View\n style={[\n {\n transform: [\n {\n scale: fadeAnim.interpolate({\n inputRange: [0, 1],\n outputRange: [1, 1],\n }),\n },\n ],\n },\n ]}\n >\n <View style={[styles.alertContainer, props.style, { top: props.offset?.y || 0, left: props.offset?.x || 0 }]}>\n {header}\n <View style={[styles.alertContent, props.contentStyle]}>\n <Text style={styles.title}>{title}</Text>\n {message ? (\n <ScrollView\n // onContentSizeChange={handleContentSizeChange}\n // onScroll={handleScrollView}\n style={[styles.message]}\n scrollEventThrottle={16}\n >\n <Text style={[styles.messageText, align === \"left\" && styles.messageLeft]}>{message}</Text>\n </ScrollView>\n ) : (\n children\n )}\n </View>\n {footer ? (\n footer\n ) : (\n <View\n style={[\n styles.footer,\n footerLayout === \"vertical\" ? styles.footerVertical : styles.footerHorizontal,\n // footerType === \"text\" && styles.footerText,\n props.footerStyle,\n ]}\n >\n {showCancelButton && (\n <Button\n variant={footerType === \"text\" ? \"text\" : \"outline\"}\n onClick={handleCancel}\n style={{\n ...styles.cancelButton,\n ...cancelBtnStyle,\n }}\n size={footerType === \"text\" ? (footerLayout === \"vertical\" ? \"medium\" : \"large\") : \"medium\"}\n {...(props.cancelBtnProps || {})}\n textStyle={[styles.cancelText, cancelBtnTextStyle]}\n >\n {cancelText || cancelKey}\n </Button>\n )}\n {footerType === \"text\" &&\n showCancelButton &&\n (footerLayout === \"vertical\" ? (\n // @ts-ignore\n <View style={styles.horizontalLine} />\n ) : (\n // @ts-ignore\n <View style={styles.verticalLine} />\n ))}\n {showConfirmButton && (\n <Button\n type=\"primary\"\n variant={footerType === \"text\" ? \"text\" : \"fill\"}\n onClick={handleConfirm}\n style={{\n ...styles.confirmButton,\n ...confirmBtnStyle,\n }}\n textStyle={[styles.confirmButtonText, confirmBtnTextStyle]}\n size={footerType === \"text\" ? (footerLayout === \"vertical\" ? \"medium\" : \"large\") : \"medium\"}\n {...(props.confirmBtnProps || {})}\n >\n {confirmText || confirmKey}\n </Button>\n )}\n </View>\n )}\n </View>\n </Animated.View>\n </View>\n </Portal>\n ) : null;\n};\n\nexport default Alert;\n"],"names":["Alert","props","_props$offset","_props$offset2","finalProps","_objectSpread","AlertDefaultProps","useThemeTypography","show","title","message","confirmText","cancelText","onConfirm","onCancel","onOpen","onClose","align","footerLayout","showConfirmButton","showCancelButton","mask","footerType","header","footer","children","confirmBtnStyle","cancelBtnStyle","confirmBtnTextStyle","cancelBtnTextStyle","hostName","onMask","styles","style","fadeAnim","useRef","Animated","Value","current","cancelKey","useLanguage","confirmKey","useEffect","handleConfirm","e","handleCancel","useMounted","Portal","View","centeredView","TouchableWithoutFeedback","onPress","React","createElement","modalOverlay","transform","scale","interpolate","inputRange","outputRange","alertContainer","top","offset","y","left","x","alertContent","contentStyle","Text","ScrollView","scrollEventThrottle","messageText","messageLeft","footerVertical","footerHorizontal","footerStyle","Button","variant","onClick","cancelButton","size","cancelBtnProps","textStyle","horizontalLine","verticalLine","type","confirmButton","confirmButtonText","confirmBtnProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAMA,KAAA,GAA6B,SAA7BA,KAAAA,CAA8BC,KAAU,EAAA;EAAA,IAAAC,aAAA,EAAAC,cAAA,CAAA;EAC5C,IAAMC,UAAa,GAAAC,wCAAA,CAAAA,wCAAA,CAAKC,EAAAA,EAAAA,kDAAA,CAAsBL,EAAAA,KAAM,CAAA,CAAA;AAC9C,EAAaM,4EAAmB,QAAQ,EAAA;AACxC,EAAA,IACJC,IAAA,GAyBEJ,UAAA,CAzBFI,IAAA;IACAC,KAAA,GAwBEL,UAAA,CAxBFK,KAAA;IACAC,OAAA,GAuBEN,UAAA,CAvBFM,OAAA;IACAC,WAAA,GAsBEP,UAAA,CAtBFO,WAAA;IACAC,UAAA,GAqBER,UAAA,CArBFQ,UAAA;IACAC,SAAA,GAoBET,UAAA,CApBFS,SAAA;I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J,YAAiB,KAAA,UAAA,GAAa,WAAW,OAAW,GAAA,QAAA;AAAA,GAAA,EAC9EjB,KAAM,CAAAuF,eAAA,IAAmB,EAAC,CAE9B7E,EAAAA,WAAe,IAAA8B,UAClB,CAEJ,CAEJ,CACF,CACF,CACF,CACE,GAAA,IAAA,CAAA;AACN;;;;"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../../_chunks/CbISStRO.js');
|
|
6
|
-
var components_Alert_interface_index = require('../../../_chunks/
|
|
6
|
+
var components_Alert_interface_index = require('../../../_chunks/D9vEt_Qk.js');
|
|
7
7
|
require('../../Portal/core/Portal.js');
|
|
8
8
|
require('../../Portal/core/PortalHost.js');
|
|
9
9
|
var components_Portal_core_PortalProvider = require('../../Portal/core/PortalProvider.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var components_Alert_Alert = require('./Alert.js');
|
|
6
|
-
var components_Alert_interface_index = require('../../_chunks/
|
|
6
|
+
var components_Alert_interface_index = require('../../_chunks/D9vEt_Qk.js');
|
|
7
7
|
var components_Alert_hooks_alert = require('./hooks/alert.js');
|
|
8
8
|
require('../../_chunks/CbISStRO.js');
|
|
9
9
|
require('react');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _rollupPluginBabelHelpers = require('../../_chunks/CbISStRO.js');
|
|
4
3
|
var reactNative = require('react-native');
|
|
5
4
|
var redsTokenNext = require('@xhsreds/reds-token-next');
|
|
6
5
|
require('../ConfigProvider/hooks/ConfigCache/ConfigCache.js');
|
|
7
6
|
require('react');
|
|
8
7
|
require('@xhs/reds-apm/src/index.native');
|
|
9
8
|
var components_ConfigProvider_hooks_themeToken_useThemeToken = require('../ConfigProvider/hooks/themeToken/useThemeToken.js');
|
|
9
|
+
require('../../_chunks/CbISStRO.js');
|
|
10
10
|
require('../ConfigProvider/hooks/ConfigContext/ConfigContext.js');
|
|
11
11
|
|
|
12
12
|
var style = function style(props) {
|
|
@@ -69,81 +69,39 @@ var style = function style(props) {
|
|
|
69
69
|
},
|
|
70
70
|
footer: {
|
|
71
71
|
width: "100%",
|
|
72
|
-
// height: 48,
|
|
73
72
|
flexDirection: "row",
|
|
74
73
|
justifyContent: "space-between",
|
|
75
74
|
paddingTop: 0
|
|
76
75
|
},
|
|
77
|
-
footerText: {
|
|
78
|
-
borderTopWidth: 0.5,
|
|
79
|
-
borderTopColor: themeColor.Fill2,
|
|
80
|
-
paddingBottom: props.footerLayout === "vertical" ? 0 : 6,
|
|
81
|
-
paddingTop: props.footerLayout === "vertical" ? 0 : 6,
|
|
82
|
-
paddingHorizontal: props.footerLayout === "vertical" ? 0 : 12
|
|
83
|
-
},
|
|
84
76
|
footerHorizontal: {
|
|
85
77
|
flexDirection: "row",
|
|
78
|
+
paddingBottom: props.footerType === "text" ? 0 : 20,
|
|
86
79
|
paddingHorizontal: 20,
|
|
87
|
-
|
|
80
|
+
gap: 12
|
|
88
81
|
},
|
|
89
82
|
footerVertical: {
|
|
90
83
|
flexDirection: "column-reverse",
|
|
91
84
|
alignItems: "center",
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
cancelButton: {
|
|
96
|
-
flex: 1,
|
|
97
|
-
width: 109,
|
|
98
|
-
margin: 0,
|
|
99
|
-
paddingHorizontal: 0
|
|
100
|
-
// height: 36,
|
|
101
|
-
},
|
|
102
|
-
button: {
|
|
103
|
-
flex: 1,
|
|
104
|
-
width: 109,
|
|
105
|
-
margin: 0,
|
|
106
|
-
paddingHorizontal: 0
|
|
107
|
-
// height: 36,
|
|
85
|
+
paddingHorizontal: 20,
|
|
86
|
+
height: props.showCancelButton && props.showConfirmButton ? props.cancelBtnProps.variant === "text" ? 82 : 100 : 56
|
|
108
87
|
},
|
|
109
88
|
dividerBox: {
|
|
110
89
|
marginTop: 5
|
|
111
90
|
},
|
|
91
|
+
cancelButton: {
|
|
92
|
+
flex: 1,
|
|
93
|
+
height: props.cancelBtnProps.variant === "text" ? 34 : props.footerType === "text" ? 52 : 36,
|
|
94
|
+
alignItems: props.cancelBtnProps.variant === "text" ? "flex-start" : "center",
|
|
95
|
+
paddingTop: props.cancelBtnProps.variant === "text" ? 12 : 0
|
|
96
|
+
},
|
|
112
97
|
confirmButton: {
|
|
113
98
|
flex: 1,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
width: 109,
|
|
117
|
-
// height: 36,
|
|
118
|
-
paddingHorizontal: 20
|
|
99
|
+
width: "100%",
|
|
100
|
+
height: props.footerType === "text" ? 52 : 36
|
|
119
101
|
},
|
|
120
102
|
confirmButtonText: {
|
|
121
103
|
fontSize: props.footerType === "text" ? typography.T2FontSize : typography.T3FontSize
|
|
122
104
|
},
|
|
123
|
-
verButton: {
|
|
124
|
-
flex: 0,
|
|
125
|
-
width: "100%",
|
|
126
|
-
margin: 0,
|
|
127
|
-
marginLeft: props.footerLayout === "vertical" ? 0 : 10,
|
|
128
|
-
marginTop: props.footerType === "text" ? 7 : props.footerLayout === "vertical" ? 7 : 10,
|
|
129
|
-
marginBottom: props.footerLayout === "vertical" ? 7 : 0,
|
|
130
|
-
// height: 36,
|
|
131
|
-
paddingHorizontal: 20
|
|
132
|
-
},
|
|
133
|
-
verCancelButton: _rollupPluginBabelHelpers._objectSpread2(_rollupPluginBabelHelpers._objectSpread2({
|
|
134
|
-
flex: 0,
|
|
135
|
-
width: "100%",
|
|
136
|
-
margin: 0,
|
|
137
|
-
marginLeft: props.footerLayout === "vertical" ? 0 : 10,
|
|
138
|
-
marginTop: props.footerType === "text" ? 7 : props.footerLayout === "vertical" ? 7 : 10,
|
|
139
|
-
marginBottom: props.footerLayout === "vertical" ? 7 : 0
|
|
140
|
-
}, props.cancelBtnProps.variant === "text" ? {
|
|
141
|
-
height: 20,
|
|
142
|
-
marginTop: 0,
|
|
143
|
-
marginBottom: 14
|
|
144
|
-
} : {}), {}, {
|
|
145
|
-
paddingHorizontal: 20
|
|
146
|
-
}),
|
|
147
105
|
cancelText: {
|
|
148
106
|
color: themeColor.Description,
|
|
149
107
|
fontSize: props.cancelBtnProps.variant === "text" ? 12 : props.footerType === "text" ? typography.T2FontSize : typography.T3FontSize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/Alert/styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport { alwaysColor } from \"@xhsreds/reds-token-next\";\nimport { useThemeColor, useThemeTypography } from \"../ConfigProvider\";\nimport { RedsAlert } from \"./interface\";\n\nexport const style = (props: RedsAlert) => {\n const themeColor = useThemeColor(\"Button\");\n const typography = useThemeTypography(\"Button\");\n\n const styles = StyleSheet.create({\n modalOverlay: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: alwaysColor.MaskBg,\n },\n centeredView: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n alertContainer: {\n width: 270,\n backgroundColor: themeColor.White,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow: \"0 2px 16px rgba(0, 0, 0, 0.1)\",\n position: \"relative\",\n top: 0,\n left: 0,\n },\n alertContent: {\n padding: 20,\n },\n title: {\n textAlign: \"center\",\n marginBottom: 8,\n fontSize: typography.T2FontSize,\n fontWeight: typography.T2FontWeight,\n lineHeight: typography.T2LineHeight,\n color: themeColor.Title,\n },\n message: {\n maxHeight: 126,\n overflow: \"hidden\",\n position: \"relative\",\n },\n messageText: {\n fontSize: typography.C2FontSize,\n color: themeColor.Paragraph,\n textAlign: \"center\",\n lineHeight: typography.C2LineHeight,\n fontWeight: typography.C2FontWeight,\n },\n messageLeft: {\n textAlign: \"left\",\n },\n footer: {\n width: \"100%\",\n // height: 48,\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: 0,\n },\n footerText: {\n borderTopWidth: 0.5,\n borderTopColor: themeColor.Fill2,\n paddingBottom: props.footerLayout === \"vertical\" ? 0 : 6,\n paddingTop: props.footerLayout === \"vertical\" ? 0 : 6,\n paddingHorizontal: props.footerLayout === \"vertical\" ? 0 : 12,\n },\n footerHorizontal: {\n flexDirection: \"row\",\n paddingHorizontal: 20,\n paddingVertical: 20,\n },\n footerVertical: {\n flexDirection: \"column-reverse\",\n alignItems: \"center\",\n // height: 100,\n paddingHorizontal: 20,\n },\n cancelButton: {\n flex: 1,\n width: 109,\n margin: 0,\n paddingHorizontal: 0,\n // height: 36,\n },\n button: {\n flex: 1,\n width: 109,\n margin: 0,\n paddingHorizontal: 0,\n // height: 36,\n },\n dividerBox: {\n marginTop: 5,\n },\n confirmButton: {\n flex: 1,\n margin: 0,\n marginLeft: props.footerLayout === \"horizontal\" && !props.showCancelButton ? 0 : 10,\n width: 109,\n // height: 36,\n paddingHorizontal: 20,\n },\n confirmButtonText: {\n fontSize: props.footerType === \"text\" ? typography.T2FontSize : typography.T3FontSize,\n },\n verButton: {\n flex: 0,\n width: \"100%\",\n margin: 0,\n marginLeft: props.footerLayout === \"vertical\" ? 0 : 10,\n marginTop: props.footerType === \"text\" ? 7 : props.footerLayout === \"vertical\" ? 7 : 10,\n marginBottom: props.footerLayout === \"vertical\" ? 7 : 0,\n // height: 36,\n paddingHorizontal: 20,\n },\n verCancelButton: {\n flex: 0,\n width: \"100%\",\n margin: 0,\n marginLeft: props.footerLayout === \"vertical\" ? 0 : 10,\n marginTop: props.footerType === \"text\" ? 7 : props.footerLayout === \"vertical\" ? 7 : 10,\n marginBottom: props.footerLayout === \"vertical\" ? 7 : 0,\n ...(props.cancelBtnProps.variant === \"text\" ? { height: 20, marginTop: 0, marginBottom: 14 } : {}),\n paddingHorizontal: 20,\n },\n cancelText: {\n color: themeColor.Description,\n fontSize:\n props.cancelBtnProps.variant === \"text\"\n ? 12\n : props.footerType === \"text\"\n ? typography.T2FontSize\n : typography.T3FontSize,\n fontWeight: typography.C2FontWeight,\n },\n horizontalLine: {\n width: \"100%\",\n height: 0.5,\n backgroundColor: themeColor.Fill2,\n },\n verticalLine: {\n width: 0.5,\n height: 24,\n marginTop: 6,\n backgroundColor: themeColor.Fill2,\n },\n });\n return styles;\n};\n"],"names":["style","props","themeColor","useThemeColor","typography","useThemeTypography","styles","StyleSheet","create","modalOverlay","position","top","left","right","bottom","backgroundColor","alwaysColor","MaskBg","centeredView","flex","justifyContent","alignItems","alertContainer","width","White","borderRadius","overflow","boxShadow","alertContent","padding","title","textAlign","marginBottom","fontSize","T2FontSize","fontWeight","T2FontWeight","lineHeight","T2LineHeight","color","Title","message","maxHeight","messageText","C2FontSize","Paragraph","C2LineHeight","C2FontWeight","messageLeft","footer","flexDirection","paddingTop","footerText","borderTopWidth","borderTopColor","Fill2","paddingBottom","footerLayout","paddingHorizontal","footerHorizontal","paddingVertical","footerVertical","cancelButton","margin","button","dividerBox","marginTop","confirmButton","marginLeft","showCancelButton","confirmButtonText","footerType","T3FontSize","verButton","verCancelButton","_objectSpread","cancelBtnProps","variant","height","cancelText","Description","horizontalLine","verticalLine"],"mappings":";;;;;;;;;;;IAKaA,KAAA,GAAQ,SAARA,KAAAA,CAASC,KAAqB,EAAA;AACnC,EAAA,IAAAC,UAAA,GAAaC,uEAAc,QAAQ,CAAA,CAAA;AACnC,EAAA,IAAAC,UAAA,GAAaC,4EAAmB,QAAQ,CAAA,CAAA;AAExC,EAAA,IAAAC,MAAA,GAASC,uBAAWC,MAAO,CAAA;AAC/BC,IAAAA,YAAc,EAAA;AACZC,MAAAA,QAAU,EAAA,UAAA;AACVC,MAAAA,GAAK,EAAA,CAAA;AACLC,MAAAA,IAAM,EAAA,CAAA;AACNC,MAAAA,KAAO,EAAA,CAAA;AACPC,MAAAA,MAAQ,EAAA,CAAA;MACRC,iBAAiBC,yBAAY,CAAAC,MAAAA;KAC/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YAAc,EAAA/B,KAAA,CAAMwD,YAAiB,KAAA,UAAA,GAAa,CAAI,GAAA,CAAA;AAAA,KAAA,EAClDxD,KAAA,CAAM2E,cAAe,CAAAC,OAAA,KAAY,MAAS,GAAA;AAAEC,MAAAA,MAAQ,EAAA,EAAA;AAAIZ,MAAAA,SAAW,EAAA,CAAA;AAAGlC,MAAAA,YAAc,EAAA,EAAA;QAAO,EAAC,CAAA,EAAA,EAAA,EAAA;AAChG0B,MAAAA,iBAAmB,EAAA,EAAA;KACrB,CAAA;AACAqB,IAAAA,UAAY,EAAA;MACVxC,OAAOrC,UAAW,CAAA8E,WAAA;MAClB/C,QAAA,EACEhC,KAAM,CAAA2E,cAAA,CAAeC,OAAY,KAAA,MAAA,GAC7B,EACA,GAAA5E,KAAA,CAAMsE,UAAe,KAAA,MAAA,GACnBnE,UAAW,CAAA8B,UAAA,GACX9B,UAAW,CAAAoE,UAAA;MACnBrC,YAAY/B,UAAW,CAAA2C,YAAAA;KACzB;AACAkC,IAAAA,cAAgB,EAAA;AACd1D,MAAAA,KAAO,EAAA,MAAA;AACPuD,MAAAA,MAAQ,EAAA,GAAA;MACR/D,iBAAiBb,UAAW,CAAAqD,KAAAA;KAC9B;AACA2B,IAAAA,YAAc,EAAA;AACZ3D,MAAAA,KAAO,EAAA,GAAA;AACPuD,MAAAA,MAAQ,EAAA,EAAA;AACRZ,MAAAA,SAAW,EAAA,CAAA;MACXnD,iBAAiBb,UAAW,CAAAqD,KAAAA;AAC9B,KAAA;AACF,GAAC,CAAA,CAAA;AACM,EAAA,OAAAjD,MAAA,CAAA;AACT;;;;"}
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../src/components/Alert/styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\nimport { alwaysColor } from \"@xhsreds/reds-token-next\";\nimport { useThemeColor, useThemeTypography } from \"../ConfigProvider\";\nimport { RedsAlert } from \"./interface\";\n\nexport const style = (props: RedsAlert) => {\n const themeColor = useThemeColor(\"Button\");\n const typography = useThemeTypography(\"Button\");\n\n const styles = StyleSheet.create({\n modalOverlay: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: alwaysColor.MaskBg,\n },\n centeredView: {\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n flex: 1,\n justifyContent: \"center\",\n alignItems: \"center\",\n },\n alertContainer: {\n width: 270,\n backgroundColor: themeColor.White,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow: \"0 2px 16px rgba(0, 0, 0, 0.1)\",\n position: \"relative\",\n top: 0,\n left: 0,\n },\n alertContent: {\n padding: 20,\n },\n title: {\n textAlign: \"center\",\n marginBottom: 8,\n fontSize: typography.T2FontSize,\n fontWeight: typography.T2FontWeight,\n lineHeight: typography.T2LineHeight,\n color: themeColor.Title,\n },\n message: {\n maxHeight: 126,\n overflow: \"hidden\",\n position: \"relative\",\n },\n messageText: {\n fontSize: typography.C2FontSize,\n color: themeColor.Paragraph,\n textAlign: \"center\",\n lineHeight: typography.C2LineHeight,\n fontWeight: typography.C2FontWeight,\n },\n messageLeft: {\n textAlign: \"left\",\n },\n footer: {\n width: \"100%\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingTop: 0,\n },\n footerHorizontal: {\n flexDirection: \"row\",\n paddingBottom: props.footerType === \"text\" ? 0 : 20,\n paddingHorizontal: 20,\n gap: 12,\n },\n footerVertical: {\n flexDirection: \"column-reverse\",\n alignItems: \"center\",\n paddingHorizontal: 20,\n height:\n props.showCancelButton && props.showConfirmButton ? (props.cancelBtnProps.variant === \"text\" ? 82 : 100) : 56,\n },\n dividerBox: {\n marginTop: 5,\n },\n cancelButton: {\n flex: 1,\n height: props.cancelBtnProps.variant === \"text\" ? 34 : props.footerType === \"text\" ? 52 : 36,\n alignItems: props.cancelBtnProps.variant === \"text\" ? \"flex-start\" : \"center\",\n paddingTop: props.cancelBtnProps.variant === \"text\" ? 12 : 0,\n },\n confirmButton: {\n flex: 1,\n width: \"100%\",\n height: props.footerType === \"text\" ? 52 : 36,\n },\n confirmButtonText: {\n fontSize: props.footerType === \"text\" ? typography.T2FontSize : typography.T3FontSize,\n },\n cancelText: {\n color: themeColor.Description,\n fontSize:\n props.cancelBtnProps.variant === \"text\"\n ? 12\n : props.footerType === \"text\"\n ? typography.T2FontSize\n : typography.T3FontSize,\n fontWeight: typography.C2FontWeight,\n },\n horizontalLine: {\n width: \"100%\",\n height: 0.5,\n backgroundColor: themeColor.Fill2,\n },\n verticalLine: {\n width: 0.5,\n height: 24,\n marginTop: 6,\n backgroundColor: themeColor.Fill2,\n },\n });\n return styles;\n};\n"],"names":["style","props","themeColor","useThemeColor","typography","useThemeTypography","styles","StyleSheet","create","modalOverlay","position","top","left","right","bottom","backgroundColor","alwaysColor","MaskBg","centeredView","flex","justifyContent","alignItems","alertContainer","width","White","borderRadius","overflow","boxShadow","alertContent","padding","title","textAlign","marginBottom","fontSize","T2FontSize","fontWeight","T2FontWeight","lineHeight","T2LineHeight","color","Title","message","maxHeight","messageText","C2FontSize","Paragraph","C2LineHeight","C2FontWeight","messageLeft","footer","flexDirection","paddingTop","footerHorizontal","paddingBottom","footerType","paddingHorizontal","gap","footerVertical","height","showCancelButton","showConfirmButton","cancelBtnProps","variant","dividerBox","marginTop","cancelButton","confirmButton","confirmButtonText","T3FontSize","cancelText","Description","horizontalLine","Fill2","verticalLine"],"mappings":";;;;;;;;;;;IAKaA,KAAA,GAAQ,SAARA,KAAAA,CAASC,KAAqB,EAAA;AACnC,EAAA,IAAAC,UAAA,GAAaC,uEAAc,QAAQ,CAAA,CAAA;AACnC,EAAA,IAAAC,UAAA,GAAaC,4EAAmB,QAAQ,CAAA,CAAA;AAExC,EAAA,IAAAC,MAAA,GAASC,uBAAWC,MAAO,CAAA;AAC/BC,IAAAA,YAAc,EAAA;AACZC,MAAAA,QAAU,EAAA,UAAA;AACVC,MAAAA,GAAK,EAAA,CAAA;AACLC,MAAAA,IAAM,EAAA,C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S,EAAK,GAAA,CAAA;KAC7D;AACAI,IAAAA,aAAe,EAAA;AACb/C,MAAAA,IAAM,EAAA,CAAA;AACNI,MAAAA,KAAO,EAAA,MAAA;MACPmC,MAAQ,EAAAzD,KAAA,CAAMqD,UAAe,KAAA,MAAA,GAAS,EAAK,GAAA,EAAA;KAC7C;AACAa,IAAAA,iBAAmB,EAAA;AACjBlC,MAAAA,UAAUhC,KAAM,CAAAqD,UAAA,KAAe,MAAS,GAAAlD,UAAA,CAAW8B,aAAa9B,UAAW,CAAAgE,UAAAA;KAC7E;AACAC,IAAAA,UAAY,EAAA;MACV9B,OAAOrC,UAAW,CAAAoE,WAAA;MAClBrC,QAAA,EACEhC,KAAM,CAAA4D,cAAA,CAAeC,OAAY,KAAA,MAAA,GAC7B,EACA,GAAA7D,KAAA,CAAMqD,UAAe,KAAA,MAAA,GACnBlD,UAAW,CAAA8B,UAAA,GACX9B,UAAW,CAAAgE,UAAA;MACnBjC,YAAY/B,UAAW,CAAA2C,YAAAA;KACzB;AACAwB,IAAAA,cAAgB,EAAA;AACdhD,MAAAA,KAAO,EAAA,MAAA;AACPmC,MAAAA,MAAQ,EAAA,GAAA;MACR3C,iBAAiBb,UAAW,CAAAsE,KAAAA;KAC9B;AACAC,IAAAA,YAAc,EAAA;AACZlD,MAAAA,KAAO,EAAA,GAAA;AACPmC,MAAAA,MAAQ,EAAA,EAAA;AACRM,MAAAA,SAAW,EAAA,CAAA;MACXjD,iBAAiBb,UAAW,CAAAsE,KAAAA;AAC9B,KAAA;AACF,GAAC,CAAA,CAAA;AACM,EAAA,OAAAlE,MAAA,CAAA;AACT;;;;"}
|
|
@@ -71,7 +71,7 @@ require('../Picker/Picker.js');
|
|
|
71
71
|
require('../../_chunks/PRipBqKL.js');
|
|
72
72
|
require('../Picker/api.js');
|
|
73
73
|
require('../Alert/Alert.js');
|
|
74
|
-
require('../../_chunks/
|
|
74
|
+
require('../../_chunks/D9vEt_Qk.js');
|
|
75
75
|
require('../Alert/hooks/alert.js');
|
|
76
76
|
require('../FAB/FAB.js');
|
|
77
77
|
require('../../_chunks/C5m2_Avu.js');
|
|
@@ -133,7 +133,7 @@ require('../Sheets/api.js');
|
|
|
133
133
|
require('../../_chunks/Br2Q0ftc.js');
|
|
134
134
|
require('../Picker/api.js');
|
|
135
135
|
require('../Alert/Alert.js');
|
|
136
|
-
require('../../_chunks/
|
|
136
|
+
require('../../_chunks/D9vEt_Qk.js');
|
|
137
137
|
require('../Alert/styles.js');
|
|
138
138
|
require('../Alert/hooks/alert.js');
|
|
139
139
|
require('../FAB/FAB.js');
|
package/lib/cjs/index.js
CHANGED
|
@@ -63,7 +63,7 @@ var components_Picker_Picker = require('./components/Picker/Picker.js');
|
|
|
63
63
|
var components_Picker_interface_index = require('./_chunks/PRipBqKL.js');
|
|
64
64
|
var components_Picker_api = require('./components/Picker/api.js');
|
|
65
65
|
var components_Alert_Alert = require('./components/Alert/Alert.js');
|
|
66
|
-
var components_Alert_interface_index = require('./_chunks/
|
|
66
|
+
var components_Alert_interface_index = require('./_chunks/D9vEt_Qk.js');
|
|
67
67
|
var components_Alert_hooks_alert = require('./components/Alert/hooks/alert.js');
|
|
68
68
|
var components_FAB_FAB = require('./components/FAB/FAB.js');
|
|
69
69
|
var components_FAB_interface_index = require('./_chunks/C5m2_Avu.js');
|
|
@@ -18,7 +18,8 @@ var AlertDefaultProps = {
|
|
|
18
18
|
confirmBtnTextStyle: {},
|
|
19
19
|
cancelBtnTextStyle: {},
|
|
20
20
|
confirmBtnProps: {},
|
|
21
|
-
cancelBtnProps: {}
|
|
21
|
+
cancelBtnProps: {},
|
|
22
|
+
style: {}
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
var index = /*#__PURE__*/Object.freeze({
|
|
@@ -27,4 +28,4 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
export { AlertDefaultProps as A, index as i };
|
|
30
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=CNx6YBDL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CNx6YBDL.js","sources":["../../../src/components/Alert/interface/index.ts"],"sourcesContent":["import { GestureResponderEvent, ViewStyle, TextStyle } from \"react-native\";\nimport { lightColor } from \"@xhsreds/reds-token-next\";\n\ninterface AlertOffset {\n x: number;\n y: number;\n}\nexport interface RedsAlert {\n show?: boolean;\n title?: string;\n message?: string;\n align?: \"left\" | \"center\" | string;\n footerLayout?: \"horizontal\" | \"vertical\" | string;\n showConfirmButton?: boolean;\n showCancelButton?: boolean;\n confirmText?: string;\n cancelText?: string;\n mask?: boolean;\n footerType?: \"text\" | \"button\" | string;\n children?: React.ReactNode;\n footer?: React.ReactNode;\n header?: React.ReactNode;\n onConfirm?: (value: GestureResponderEvent) => void;\n onCancel?: (value: GestureResponderEvent) => void;\n onOpen?: () => void;\n onClose?: () => void;\n onMask?: (value: GestureResponderEvent) => void;\n contentStyle?: ViewStyle;\n cancelBtnStyle?: ViewStyle;\n confirmBtnStyle?: ViewStyle;\n footerStyle?: ViewStyle;\n offset?: AlertOffset;\n hostName?: string;\n confirmBtnTextStyle?: TextStyle;\n cancelBtnTextStyle?: TextStyle;\n confirmBtnProps?: any;\n cancelBtnProps?: any;\n style?: any;\n}\n\nexport interface RedsAlertEvent {}\nexport const AlertDefaultProps = {\n show: false,\n align: \"center\",\n footerLayout: \"horizontal\",\n showConfirmButton: true,\n showCancelButton: true,\n mask: true,\n footerType: \"button\",\n contentStyle: {},\n cancelBtnStyle: {},\n confirmBtnStyle: {},\n footerStyle: {},\n offset: { x: 0, y: 0 },\n hostName: \"root\",\n confirmBtnTextStyle: {},\n cancelBtnTextStyle: {},\n confirmBtnProps: {},\n cancelBtnProps: {},\n style: {},\n};\n"],"names":["AlertDefaultProps","show","align","footerLayout","showConfirmButton","showCancelButton","mask","footerType","contentStyle","cancelBtnStyle","confirmBtnStyle","footerStyle","offset","x","y","hostName","confirmBtnTextStyle","cancelBtnTextStyle","confirmBtnProps","cancelBtnProps","style"],"mappings":"AAyCO,IAAMA,iBAAoB,GAAA;AAC/BC,EAAAA,IAAM,EAAA,KAAA;AACNC,EAAAA,KAAO,EAAA,QAAA;AACPC,EAAAA,YAAc,EAAA,YAAA;AACdC,EAAAA,iBAAmB,EAAA,IAAA;AACnBC,EAAAA,gBAAkB,EAAA,IAAA;AAClBC,EAAAA,IAAM,EAAA,IAAA;AACNC,EAAAA,UAAY,EAAA,QAAA;EACZC,cAAc,EAAC;EACfC,gBAAgB,EAAC;EACjBC,iBAAiB,EAAC;EAClBC,aAAa,EAAC;AACdC,EAAAA,MAAQ,EAAA;AAAEC,IAAAA,CAAG,EAAA,CAAA;AAAGC,IAAAA,GAAG,CAAA;GAAE;AACrBC,EAAAA,QAAU,EAAA,MAAA;EACVC,qBAAqB,EAAC;EACtBC,oBAAoB,EAAC;EACrBC,iBAAiB,EAAC;EAClBC,gBAAgB,EAAC;AACjBC,EAAAA,OAAO,EAAC;AACV;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ import { Animated, View, TouchableWithoutFeedback, Text, ScrollView } from 'reac
|
|
|
4
4
|
import '../ConfigProvider/hooks/ConfigCache/ConfigCache.js';
|
|
5
5
|
import useMounted from '../../pvCount/useUnmountedProcess.js';
|
|
6
6
|
import { useThemeTypography } from '../ConfigProvider/hooks/themeToken/useThemeToken.js';
|
|
7
|
-
import { A as AlertDefaultProps } from '../../_chunks/
|
|
7
|
+
import { A as AlertDefaultProps } from '../../_chunks/CNx6YBDL.js';
|
|
8
8
|
import Button from '../Button/Button.js';
|
|
9
9
|
import Portal from '../Portal/core/Portal.js';
|
|
10
10
|
import '../Portal/core/PortalHost.js';
|
|
@@ -106,7 +106,7 @@ var Alert = function Alert(props) {
|
|
|
106
106
|
}]
|
|
107
107
|
}]
|
|
108
108
|
}, /* @__PURE__ */React.createElement(View, {
|
|
109
|
-
style: [styles.alertContainer, {
|
|
109
|
+
style: [styles.alertContainer, props.style, {
|
|
110
110
|
top: ((_props$offset = props.offset) === null || _props$offset === void 0 ? void 0 : _props$offset.y) || 0,
|
|
111
111
|
left: ((_props$offset2 = props.offset) === null || _props$offset2 === void 0 ? void 0 : _props$offset2.x) || 0
|
|
112
112
|
}]
|
|
@@ -120,11 +120,13 @@ var Alert = function Alert(props) {
|
|
|
120
120
|
}, /* @__PURE__ */React.createElement(Text, {
|
|
121
121
|
style: [styles.messageText, align === "left" && styles.messageLeft]
|
|
122
122
|
}, message)) : children), footer ? footer : /* @__PURE__ */React.createElement(View, {
|
|
123
|
-
style: [styles.footer, footerLayout === "vertical" ? styles.footerVertical : styles.footerHorizontal,
|
|
123
|
+
style: [styles.footer, footerLayout === "vertical" ? styles.footerVertical : styles.footerHorizontal,
|
|
124
|
+
// footerType === "text" && styles.footerText,
|
|
125
|
+
props.footerStyle]
|
|
124
126
|
}, showCancelButton && /* @__PURE__ */React.createElement(Button, _objectSpread2(_objectSpread2({
|
|
125
127
|
variant: footerType === "text" ? "text" : "outline",
|
|
126
128
|
onClick: handleCancel,
|
|
127
|
-
style: _objectSpread2(_objectSpread2({},
|
|
129
|
+
style: _objectSpread2(_objectSpread2({}, styles.cancelButton), cancelBtnStyle),
|
|
128
130
|
size: footerType === "text" ? footerLayout === "vertical" ? "medium" : "large" : "medium"
|
|
129
131
|
}, props.cancelBtnProps || {}), {}, {
|
|
130
132
|
textStyle: [styles.cancelText, cancelBtnTextStyle]
|
|
@@ -132,19 +134,17 @@ var Alert = function Alert(props) {
|
|
|
132
134
|
// @ts-ignore
|
|
133
135
|
/* @__PURE__ */
|
|
134
136
|
React.createElement(View, {
|
|
135
|
-
direction: "horizontal",
|
|
136
137
|
style: styles.horizontalLine
|
|
137
138
|
}) :
|
|
138
139
|
// @ts-ignore
|
|
139
140
|
/* @__PURE__ */
|
|
140
141
|
React.createElement(View, {
|
|
141
|
-
direction: "vertical",
|
|
142
142
|
style: styles.verticalLine
|
|
143
143
|
})), showConfirmButton && /* @__PURE__ */React.createElement(Button, _objectSpread2({
|
|
144
144
|
type: "primary",
|
|
145
145
|
variant: footerType === "text" ? "text" : "fill",
|
|
146
146
|
onClick: handleConfirm,
|
|
147
|
-
style: _objectSpread2(_objectSpread2(
|
|
147
|
+
style: _objectSpread2(_objectSpread2({}, styles.confirmButton), confirmBtnStyle),
|
|
148
148
|
textStyle: [styles.confirmButtonText, confirmBtnTextStyle],
|
|
149
149
|
size: footerType === "text" ? footerLayout === "vertical" ? "medium" : "large" : "medium"
|
|
150
150
|
}, props.confirmBtnProps || {}), confirmText || confirmKey)))))) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback, useRef } from \"react\";\nimport {\n View,\n Text,\n Modal,\n Image,\n ScrollView,\n TouchableWithoutFeedback,\n StyleSheet,\n GestureResponderEvent,\n Animated,\n TouchableOpacity,\n} from \"react-native\";\nimport { useThemeColor, useThemeTypography } from \"../ConfigProvider\";\nimport { RedsAlert, AlertDefaultProps } from \"./interface\";\nimport { Button } from \"../Button\";\nimport { Divider } from \"../Divider\";\nimport { Portal } from \"../Portal\";\nimport { style } from \"./styles\";\nimport useMounted from \"../../pvCount/useUnmountedProcess\";\nimport { useLanguage } from \"../LanguageProvider\";\n// const AlertView: React.FC<RedsAlert> = (props) => {\n// const finalProps = { ...AlertDefaultProps, ...props };\n// const {\n// show,\n// title,\n// message,\n// confirmText,\n// cancelText,\n// onConfirm,\n// onCancel,\n// onOpen,\n// onClose,\n// align,\n// // showScrollOverlay,\n// footerLayout,\n// showConfirmButton,\n// showCancelButton,\n// mask,\n// footerType,\n// header,\n// footer,\n// children,\n// onMask,\n// confirmBtnStyle,\n// } = finalProps;\n// const themeColor = useThemeColor(\"Alert\");\n// const cancelKey = useLanguage(\"componentKey\", \"cancelKey\");\n// const confirmKey = useLanguage(\"componentKey\", \"confirmKey\");\n// const styles = style(props);\n// // const [hasScrollToBottom, setHasScrollToBottom] = useState(true);\n// const fadeAnim = useRef(new Animated.Value(0)).current;\n\n// useEffect(() => {\n// if (show && onOpen) onOpen();\n// if (!show && onClose) onClose();\n// }, [show]);\n\n// const handleConfirm = (e: GestureResponderEvent) => {\n// if (onConfirm) onConfirm(e);\n// };\n\n// const handleCancel = (e: GestureResponderEvent) => {\n// if (onCancel) onCancel(e);\n// };\n// return show ? (\n// <>\n// <Animated.View\n// style={[\n// styles.centeredView,\n// {\n// transform: [\n// {\n// scale: fadeAnim.interpolate({\n// inputRange: [0, 1],\n// outputRange: [1, 1],\n// }),\n// },\n// ],\n// },\n// ]}\n// >\n// {mask && (\n// <TouchableOpacity onPress={() => { console.log('onMask xxxx')}} activeOpacity={1}>\n// <View style={styles.modalOverlay} />\n// </TouchableOpacity>\n// )}\n\n// </Animated.View>\n// </>\n// ) : null;\n// };\n\nconst Alert: React.FC<RedsAlert> = (props) => {\n const finalProps = { ...AlertDefaultProps, ...props };\n const typography = useThemeTypography(\"Button\");\n const {\n show,\n title,\n message,\n confirmText,\n cancelText,\n onConfirm,\n onCancel,\n onOpen,\n onClose,\n align,\n // showScrollOverlay,\n footerLayout,\n showConfirmButton,\n showCancelButton,\n mask,\n footerType,\n header,\n footer,\n children,\n confirmBtnStyle,\n cancelBtnStyle,\n confirmBtnTextStyle,\n cancelBtnTextStyle,\n hostName,\n onMask,\n } = finalProps;\n\n const styles = style(props);\n // const [hasScrollToBottom, setHasScrollToBottom] = useState(true);\n const fadeAnim = useRef(new Animated.Value(0)).current;\n\n const cancelKey = useLanguage(\"componentKey\", \"cancelKey\");\n\n const confirmKey = useLanguage(\"componentKey\", \"confirmKey\");\n\n useEffect(() => {\n if (show && onOpen) onOpen();\n if (!show && onClose) onClose();\n }, [show]);\n\n const handleConfirm = (e: GestureResponderEvent) => {\n if (onConfirm) onConfirm(e);\n };\n\n const handleCancel = (e: GestureResponderEvent) => {\n if (onCancel) onCancel(e);\n };\n useMounted(\"Alert\");\n return show ? (\n <Portal hostName={hostName}>\n <View style={styles.centeredView}>\n {mask && (\n <TouchableWithoutFeedback onPress={onMask}>\n <View style={styles.modalOverlay} />\n </TouchableWithoutFeedback>\n )}\n <Animated.View\n style={[\n {\n transform: [\n {\n scale: fadeAnim.interpolate({\n inputRange: [0, 1],\n outputRange: [1, 1],\n }),\n },\n ],\n },\n ]}\n >\n <View style={[styles.alertContainer, { top: props.offset?.y || 0, left: props.offset?.x || 0 }]}>\n {header}\n <View style={[styles.alertContent, props.contentStyle]}>\n <Text style={styles.title}>{title}</Text>\n {message ? (\n <ScrollView\n // onContentSizeChange={handleContentSizeChange}\n // onScroll={handleScrollView}\n style={[styles.message]}\n scrollEventThrottle={16}\n >\n <Text style={[styles.messageText, align === \"left\" && styles.messageLeft]}>{message}</Text>\n </ScrollView>\n ) : (\n children\n )}\n </View>\n {footer ? (\n footer\n ) : (\n <View\n style={[\n styles.footer,\n footerLayout === \"vertical\" ? styles.footerVertical : styles.footerHorizontal,\n footerType === \"text\" && styles.footerText,\n props.footerStyle,\n ]}\n >\n {showCancelButton && (\n <Button\n variant={footerType === \"text\" ? \"text\" : \"outline\"}\n onClick={handleCancel}\n style={{\n ...(footerLayout === \"vertical\" ? styles.verCancelButton : styles.cancelButton),\n ...cancelBtnStyle,\n }}\n size={footerType === \"text\" ? (footerLayout === \"vertical\" ? \"medium\" : \"large\") : \"medium\"}\n {...(props.cancelBtnProps || {})}\n textStyle={[styles.cancelText, cancelBtnTextStyle]}\n >\n {cancelText || cancelKey}\n </Button>\n )}\n {footerType === \"text\" &&\n showCancelButton &&\n (footerLayout === \"vertical\" ? (\n // @ts-ignore\n <View direction={\"horizontal\"} style={styles.horizontalLine} />\n ) : (\n // @ts-ignore\n <View direction={\"vertical\"} style={styles.verticalLine} />\n ))}\n {showConfirmButton && (\n <Button\n type=\"primary\"\n variant={footerType === \"text\" ? \"text\" : \"fill\"}\n onClick={handleConfirm}\n style={{\n ...(footerType === \"text\" ? styles.button : styles.confirmButton),\n ...(footerLayout === \"vertical\" ? styles.verButton : styles.confirmButton),\n ...confirmBtnStyle,\n }}\n textStyle={[styles.confirmButtonText, confirmBtnTextStyle]}\n size={footerType === \"text\" ? (footerLayout === \"vertical\" ? \"medium\" : \"large\") : \"medium\"}\n {...(props.confirmBtnProps || {})}\n >\n {confirmText || confirmKey}\n </Button>\n )}\n </View>\n )}\n </View>\n </Animated.View>\n </View>\n </Portal>\n ) : null;\n};\n\nexport default Alert;\n"],"names":["Alert","props","_props$offset","_props$offset2","finalProps","_objectSpread","AlertDefaultProps","useThemeTypography","show","title","message","confirmText","cancelText","onConfirm","onCancel","onOpen","onClose","align","footerLayout","showConfirmButton","showCancelButton","mask","footerType","header","footer","children","confirmBtnStyle","cancelBtnStyle","confirmBtnTextStyle","cancelBtnTextStyle","hostName","onMask","styles","style","fadeAnim","useRef","Animated","Value","current","cancelKey","useLanguage","confirmKey","useEffect","handleConfirm","e","handleCancel","useMounted","Portal","View","centeredView","TouchableWithoutFeedback","onPress","React","createElement","modalOverlay","transform","scale","interpolate","inputRange","outputRange","alertContainer","top","offset","y","left","x","alertContent","contentStyle","Text","ScrollView","scrollEventThrottle","messageText","messageLeft","footerVertical","footerHorizontal","footerText","footerStyle","Button","variant","onClick","verCancelButton","cancelButton","size","cancelBtnProps","textStyle","direction","horizontalLine","verticalLine","type","button","confirmButton","verButton","confirmButtonText","confirmBtnProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,IAAMA,KAAA,GAA6B,SAA7BA,KAAAA,CAA8BC,KAAU,EAAA;EAAA,IAAAC,aAAA,EAAAC,cAAA,CAAA;EAC5C,IAAMC,UAAa,GAAAC,cAAA,CAAAA,cAAA,CAAKC,EAAAA,EAAAA,iBAAA,CAAsBL,EAAAA,KAAM,CAAA,CAAA;AAC9C,EAAaM,mBAAmB,QAAQ,EAAA;AACxC,EAAA,IACJC,IAAA,GAyBEJ,UAAA,CAzBFI,IAAA;IACAC,KAAA,GA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S,GAAA,MAAA;AAC1CyD,IAAAA,OAAS,EAAApC,aAAA;AACTV,IAAAA,KAAO,EAAA5B,cAAA,CAAAA,cAAA,CAAAA,cAAA,CAAA,EAAA,EACDiB,UAAA,KAAe,MAAS,GAAAU,MAAA,CAAOyD,SAASzD,MAAO,CAAA0D,aAAA,CAC/CxE,EAAAA,YAAA,KAAiB,UAAa,GAAAc,MAAA,CAAO2D,YAAY3D,MAAO,CAAA0D,aAAA,CAAA,EACzDhE,eAAA,CACL;AACA0D,IAAAA,SAAW,EAAA,CAACpD,MAAO,CAAA4D,iBAAA,EAAmBhE,mBAAmB,CAAA;AACzDsD,IAAAA,MAAM5D,UAAe,KAAA,MAAA,GAAUJ,YAAiB,KAAA,UAAA,GAAa,WAAW,OAAW,GAAA,QAAA;AAAA,GAAA,EAC9EjB,KAAM,CAAA4F,eAAA,IAAmB,EAAC,CAE9BlF,EAAAA,WAAe,IAAA8B,UAClB,CAEJ,CAEJ,CACF,CACF,CACF,CACE,GAAA,IAAA,CAAA;AACN;;;;"}
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import React, { useState, useEffect, useCallback, useRef } from \"react\";\nimport {\n View,\n Text,\n Modal,\n Image,\n ScrollView,\n TouchableWithoutFeedback,\n StyleSheet,\n GestureResponderEvent,\n Animated,\n TouchableOpacity,\n} from \"react-native\";\nimport { useThemeColor, useThemeTypography } from \"../ConfigProvider\";\nimport { RedsAlert, AlertDefaultProps } from \"./interface\";\nimport { Button } from \"../Button\";\nimport { Divider } from \"../Divider\";\nimport { Portal } from \"../Portal\";\nimport { style } from \"./styles\";\nimport useMounted from \"../../pvCount/useUnmountedProcess\";\nimport { useLanguage } from \"../LanguageProvider\";\n\nconst Alert: React.FC<RedsAlert> = (props) => {\n const finalProps = { ...AlertDefaultProps, ...props };\n const typography = useThemeTypography(\"Button\");\n const {\n show,\n title,\n message,\n confirmText,\n cancelText,\n onConfirm,\n onCancel,\n onOpen,\n onClose,\n align,\n // showScrollOverlay,\n footerLayout,\n showConfirmButton,\n showCancelButton,\n mask,\n footerType,\n header,\n footer,\n children,\n confirmBtnStyle,\n cancelBtnStyle,\n confirmBtnTextStyle,\n cancelBtnTextStyle,\n hostName,\n onMask,\n } = finalProps;\n\n const styles = style(props);\n // const [hasScrollToBottom, setHasScrollToBottom] = useState(true);\n const fadeAnim = useRef(new Animated.Value(0)).current;\n\n const cancelKey = useLanguage(\"componentKey\", \"cancelKey\");\n\n const confirmKey = useLanguage(\"componentKey\", \"confirmKey\");\n\n useEffect(() => {\n if (show && onOpen) onOpen();\n if (!show && onClose) onClose();\n }, [show]);\n\n const handleConfirm = (e: GestureResponderEvent) => {\n if (onConfirm) onConfirm(e);\n };\n\n const handleCancel = (e: GestureResponderEvent) => {\n if (onCancel) onCancel(e);\n };\n useMounted(\"Alert\");\n\n return show ? (\n <Portal hostName={hostName}>\n <View style={styles.centeredView}>\n {mask && (\n <TouchableWithoutFeedback onPress={onMask}>\n <View style={styles.modalOverlay} />\n </TouchableWithoutFeedback>\n )}\n <Animated.View\n style={[\n {\n transform: [\n {\n scale: fadeAnim.interpolate({\n inputRange: [0, 1],\n outputRange: [1, 1],\n }),\n },\n ],\n },\n ]}\n >\n <View style={[styles.alertContainer, props.style, { top: props.offset?.y || 0, left: props.offset?.x || 0 }]}>\n {header}\n <View style={[styles.alertContent, props.contentStyle]}>\n <Text style={styles.title}>{title}</Text>\n {message ? (\n <ScrollView\n // onContentSizeChange={handleContentSizeChange}\n // onScroll={handleScrollView}\n style={[styles.message]}\n scrollEventThrottle={16}\n >\n <Text style={[styles.messageText, align === \"left\" && styles.messageLeft]}>{message}</Text>\n </ScrollView>\n ) : (\n children\n )}\n </View>\n {footer ? (\n footer\n ) : (\n <View\n style={[\n styles.footer,\n footerLayout === \"vertical\" ? styles.footerVertical : styles.footerHorizontal,\n // footerType === \"text\" && styles.footerText,\n props.footerStyle,\n ]}\n >\n {showCancelButton && (\n <Button\n variant={footerType === \"text\" ? \"text\" : \"outline\"}\n onClick={handleCancel}\n style={{\n ...styles.cancelButton,\n ...cancelBtnStyle,\n }}\n size={footerType === \"text\" ? (footerLayout === \"vertical\" ? \"medium\" : \"large\") : \"medium\"}\n {...(props.cancelBtnProps || {})}\n textStyle={[styles.cancelText, cancelBtnTextStyle]}\n >\n {cancelText || cancelKey}\n </Button>\n )}\n {footerType === \"text\" &&\n showCancelButton &&\n (footerLayout === \"vertical\" ? (\n // @ts-ignore\n <View style={styles.horizontalLine} />\n ) : (\n // @ts-ignore\n <View style={styles.verticalLine} />\n ))}\n {showConfirmButton && (\n <Button\n type=\"primary\"\n variant={footerType === \"text\" ? \"text\" : \"fill\"}\n onClick={handleConfirm}\n style={{\n ...styles.confirmButton,\n ...confirmBtnStyle,\n }}\n textStyle={[styles.confirmButtonText, confirmBtnTextStyle]}\n size={footerType === \"text\" ? (footerLayout === \"vertical\" ? \"medium\" : \"large\") : \"medium\"}\n {...(props.confirmBtnProps || {})}\n >\n {confirmText || confirmKey}\n </Button>\n )}\n </View>\n )}\n </View>\n </Animated.View>\n </View>\n </Portal>\n ) : null;\n};\n\nexport default Alert;\n"],"names":["Alert","props","_props$offset","_props$offset2","finalProps","_objectSpread","AlertDefaultProps","useThemeTypography","show","title","message","confirmText","cancelText","onConfirm","onCancel","onOpen","onClose","align","footerLayout","showConfirmButton","showCancelButton","mask","footerType","header","footer","children","confirmBtnStyle","cancelBtnStyle","confirmBtnTextStyle","cancelBtnTextStyle","hostName","onMask","styles","style","fadeAnim","useRef","Animated","Value","current","cancelKey","useLanguage","confirmKey","useEffect","handleConfirm","e","handleCancel","useMounted","Portal","View","centeredView","TouchableWithoutFeedback","onPress","React","createElement","modalOverlay","transform","scale","interpolate","inputRange","outputRange","alertContainer","top","offset","y","left","x","alertContent","contentStyle","Text","ScrollView","scrollEventThrottle","messageText","messageLeft","footerVertical","footerHorizontal","footerStyle","Button","variant","onClick","cancelButton","size","cancelBtnProps","textStyle","horizontalLine","ver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AGpC;AAAC/B,EAAAA,KAAA,CAAAC,aAAA,CAAAL,IAAA,EAAA;IAAKf,KAAO,EAAAD,MAAA,CAAOoD,YAAAA;AAAc,GAAA,CAAA,CAAA,EAErCjE,iBACC,mBAAAiC,KAAA,CAAAC,aAAA,CAACuB,MAAA,EAAAvE,cAAA,CAAA;AACCgF,IAAAA,IAAK,EAAA,SAAA;AACLR,IAAAA,OAAA,EAASvD,UAAe,KAAA,MAAA,GAAS,MAAS,GAAA,MAAA;AAC1CwD,IAAAA,OAAS,EAAAnC,aAAA;IACTV,KAAO,EAAA5B,cAAA,CAAAA,cAAA,CAAA,EAAA,EACF2B,MAAO,CAAAsD,aAAA,CACP5D,EAAAA,eAAA,CACL;AACAwD,IAAAA,SAAW,EAAA,CAAClD,MAAO,CAAAuD,iBAAA,EAAmB3D,mBAAmB,CAAA;AACzDoD,IAAAA,MAAM1D,UAAe,KAAA,MAAA,GAAUJ,YAAiB,KAAA,UAAA,GAAa,WAAW,OAAW,GAAA,QAAA;AAAA,GAAA,EAC9EjB,KAAM,CAAAuF,eAAA,IAAmB,EAAC,CAE9B7E,EAAAA,WAAe,IAAA8B,UAClB,CAEJ,CAEJ,CACF,CACF,CACF,CACE,GAAA,IAAA,CAAA;AACN;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as _createClass, h as _classCallCheck, e as _typeof, a as _objectSpread2 } from '../../../_chunks/BcGvf0Pc.js';
|
|
2
|
-
import { A as AlertDefaultProps } from '../../../_chunks/
|
|
2
|
+
import { A as AlertDefaultProps } from '../../../_chunks/CNx6YBDL.js';
|
|
3
3
|
import '../../Portal/core/Portal.js';
|
|
4
4
|
import '../../Portal/core/PortalHost.js';
|
|
5
5
|
import { stateDispatch } from '../../Portal/core/PortalProvider.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as AlertDefaultProps } from '../../../_chunks/
|
|
1
|
+
export { A as AlertDefaultProps } from '../../../_chunks/CNx6YBDL.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|