@fountain-ui/core 1.17.0 → 1.18.0
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/CHANGELOG.md +8 -0
- package/build/commonjs/Modal/Modal.js +10 -1
- package/build/commonjs/Modal/Modal.js.map +1 -1
- package/build/commonjs/Modal/index.js +10 -2
- package/build/commonjs/Modal/index.js.map +1 -1
- package/build/commonjs/index.js +7 -0
- package/build/commonjs/index.js.map +1 -1
- package/build/module/Modal/Modal.js +6 -1
- package/build/module/Modal/Modal.js.map +1 -1
- package/build/module/Modal/index.js +1 -1
- package/build/module/Modal/index.js.map +1 -1
- package/build/module/index.js +1 -1
- package/build/module/index.js.map +1 -1
- package/build/typescript/Modal/Modal.d.ts +11 -0
- package/build/typescript/Modal/ModalProps.d.ts +2 -1
- package/build/typescript/Modal/index.d.ts +2 -1
- package/build/typescript/index.d.ts +2 -1
- package/package.json +2 -2
- package/src/Modal/Modal.tsx +15 -1
- package/src/Modal/ModalProps.ts +2 -1
- package/src/Modal/index.ts +3 -2
- package/src/index.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.18.0](https://github.com/tappytoon/tappytoon/compare/@fountain-ui/core@1.11.0...@fountain-ui/core@1.18.0) (2022-03-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @fountain-ui/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [1.17.0](https://github.com/tappytoon/tappytoon/compare/@fountain-ui/core@1.11.0...@fountain-ui/core@1.17.0) (2022-03-21)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @fountain-ui/core
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Modal;
|
|
7
|
+
exports.createModalCloseEvent = void 0;
|
|
7
8
|
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
|
|
@@ -21,6 +22,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
22
|
|
|
22
23
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
24
|
|
|
25
|
+
const createModalCloseEvent = reason => ({
|
|
26
|
+
metadata: {
|
|
27
|
+
reason
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
exports.createModalCloseEvent = createModalCloseEvent;
|
|
32
|
+
|
|
24
33
|
function Modal(props) {
|
|
25
34
|
const {
|
|
26
35
|
animationStyle,
|
|
@@ -36,7 +45,7 @@ function Modal(props) {
|
|
|
36
45
|
|
|
37
46
|
const handleBackdropPress = () => {
|
|
38
47
|
if (onClose) {
|
|
39
|
-
onClose();
|
|
48
|
+
onClose(createModalCloseEvent('OUTSIDE_PRESS'));
|
|
40
49
|
}
|
|
41
50
|
};
|
|
42
51
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Modal.tsx"],"names":["Modal","props","animationStyle","backdropOpacity","children","disableAnimation","hideBackdrop","onClose","style","visible","otherProps","handleBackdropPress","exited","setExited","React","useState","elevationStyle","StyleSheet","absoluteFill"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["Modal.tsx"],"names":["createModalCloseEvent","reason","metadata","Modal","props","animationStyle","backdropOpacity","children","disableAnimation","hideBackdrop","onClose","style","visible","otherProps","handleBackdropPress","exited","setExited","React","useState","elevationStyle","StyleSheet","absoluteFill"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;A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CAJ7B;AAKI,IAAA,KAAK,EAAEX;AALX,KAOKE,QAPL,CADH,GAUGA,QAzBR,CADJ;AA6BH;;AAAA","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { css, StyleSheet } from '../styles';\nimport { useElevationStyle } from '../hooks';\nimport Slide from '../Slide';\nimport SimpleBackdrop from './SimpleBackdrop';\nimport type ModalProps from './ModalProps';\n\nexport type ModalCloseReasonType = 'OUTSIDE_PRESS' | 'HARDWARE_BACK_PRESS' | 'CLOSE_BUTTON_PRESS' | 'UNKNOWN';\n\nexport interface ModalCloseEvent {\n metadata: {\n reason: ModalCloseReasonType\n };\n}\n\nexport const createModalCloseEvent = (reason: ModalCloseReasonType) => ({\n metadata: {\n reason,\n },\n});\n\nexport default function Modal(props: ModalProps) {\n const {\n animationStyle,\n backdropOpacity = 0.5,\n children,\n disableAnimation = false,\n hideBackdrop = false,\n onClose,\n style,\n visible,\n ...otherProps\n } = props;\n\n const handleBackdropPress = () => {\n if (onClose) {\n onClose(createModalCloseEvent('OUTSIDE_PRESS'));\n }\n };\n\n const [exited, setExited] = React.useState(true);\n\n const elevationStyle = useElevationStyle(6);\n\n if (!visible) {\n if (disableAnimation || exited) {\n return null;\n }\n }\n\n return (\n <View\n style={css([\n StyleSheet.absoluteFill,\n elevationStyle,\n style,\n ])}\n {...otherProps}\n >\n {(hideBackdrop || !visible) ? null : (\n <SimpleBackdrop\n onPress={handleBackdropPress}\n opacity={backdropOpacity}\n />\n )}\n\n {!disableAnimation ? (\n <Slide\n appear={visible}\n exitDuration={150}\n onEnter={() => setExited(false)}\n onExited={() => setExited(true)}\n style={animationStyle}\n >\n {children}\n </Slide>\n ) : children}\n </View>\n );\n};\n"]}
|
|
@@ -9,8 +9,16 @@ Object.defineProperty(exports, "default", {
|
|
|
9
9
|
return _Modal.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "createModalCloseEvent", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Modal.createModalCloseEvent;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _Modal = _interopRequireWildcard(require("./Modal"));
|
|
12
20
|
|
|
13
|
-
var
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
22
|
|
|
15
|
-
function
|
|
23
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default, createModalCloseEvent } from './Modal';\nexport type { ModalCloseEvent } from './Modal';\nexport type { default as ModalProps } from './ModalProps';\n"]}
|
package/build/commonjs/index.js
CHANGED
|
@@ -38,6 +38,7 @@ var _exportNames = {
|
|
|
38
38
|
Menu: true,
|
|
39
39
|
MenuItem: true,
|
|
40
40
|
Modal: true,
|
|
41
|
+
createModalCloseEvent: true,
|
|
41
42
|
Pagination: true,
|
|
42
43
|
PaginationItem: true,
|
|
43
44
|
Paper: true,
|
|
@@ -264,6 +265,12 @@ Object.defineProperty(exports, "Modal", {
|
|
|
264
265
|
return _Modal.default;
|
|
265
266
|
}
|
|
266
267
|
});
|
|
268
|
+
Object.defineProperty(exports, "createModalCloseEvent", {
|
|
269
|
+
enumerable: true,
|
|
270
|
+
get: function () {
|
|
271
|
+
return _Modal.createModalCloseEvent;
|
|
272
|
+
}
|
|
273
|
+
});
|
|
267
274
|
Object.defineProperty(exports, "Pagination", {
|
|
268
275
|
enumerable: true,
|
|
269
276
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA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AAAA;AAAA;;AAEA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './styles';\n\nexport * from './types';\n\nexport * from './hooks';\n\nexport * from './utils';\n\nexport { default as Accordion } from './Accordion';\nexport * from './Accordion';\n\nexport { default as AppBar } from './AppBar';\nexport * from './AppBar';\n\nexport { default as AspectRatio } from './AspectRatio';\nexport * from './AspectRatio';\n\nexport { default as Avatar } from './Avatar';\nexport * from './Avatar';\n\nexport { default as Badge } from './Badge';\nexport * from './Badge';\n\nexport { default as Button } from './Button';\nexport * from './Button';\n\nexport { default as ButtonBase } from './ButtonBase';\nexport * from './ButtonBase';\n\nexport { default as Card } from './Card';\nexport * from './Card';\n\nexport { default as CardActions } from './CardActions';\nexport * from './CardActions';\n\nexport { default as CardContent } from './CardContent';\nexport * from './CardContent';\n\nexport { default as CardMedia } from './CardMedia';\nexport * from './CardMedia';\n\nexport { default as Checkbox } from './Checkbox';\nexport * from './Checkbox';\n\nexport { default as Chip } from './Chip';\nexport * from './Chip';\n\nexport { default as CircularProgress } from './CircularProgress';\nexport * from './CircularProgress';\n\nexport { default as Column } from './Column';\nexport * from './Column';\n\nexport { default as Dialog } from './Dialog';\nexport * from './Dialog';\n\nexport { default as DialogActions } from './DialogActions';\nexport * from './DialogActions';\n\nexport { default as DialogContent } from './DialogContent';\nexport * from './DialogContent';\n\nexport { default as DialogMedia } from './DialogMedia';\nexport * from './DialogMedia';\n\nexport { default as DialogTitle } from './DialogTitle';\nexport * from './DialogTitle';\n\nexport { default as Divider } from './Divider';\nexport * from './Divider';\n\nexport { default as Fab } from './Fab';\nexport * from './Fab';\n\nexport { default as IconButton } from './IconButton';\nexport * from './IconButton';\n\nexport { default as Image } from './Image';\nexport * from './Image';\n\nexport { default as Link } from './Link';\nexport * from './Link';\n\nexport { default as List } from './List';\nexport * from './List';\n\nexport { default as ListItem } from './ListItem';\nexport * from './ListItem';\n\nexport { default as ListItemIcon } from './ListItemIcon';\nexport * from './ListItemIcon';\n\nexport { default as ListItemSecondaryAction } from './ListItemSecondaryAction';\nexport * from './ListItemSecondaryAction';\n\nexport { default as ListItemText } from './ListItemText';\nexport * from './ListItemText';\n\nexport { default as ListSubheader } from './ListSubheader';\nexport * from './ListSubheader';\n\nexport { default as Menu } from './Menu';\nexport * from './Menu';\n\nexport { default as MenuItem } from './MenuItem';\nexport * from './MenuItem';\n\nexport { default as Modal, createModalCloseEvent } from './Modal';\nexport type { ModalCloseEvent } from './Modal';\nexport * from './Modal';\n\nexport { default as Pagination } from './Pagination';\nexport * from './Pagination';\n\nexport { default as PaginationItem } from './PaginationItem';\nexport * from './PaginationItem';\n\nexport { default as Paper } from './Paper';\nexport * from './Paper';\n\nexport { default as Portal } from './Portal';\nexport * from './Portal';\n\nexport { default as Radio } from './Radio';\nexport * from './Radio';\n\nexport { default as RadioGroup } from './RadioGroup';\nexport * from './RadioGroup';\n\nexport { default as Row } from './Row';\nexport * from './Row';\n\nexport { default as Slide } from './Slide';\nexport * from './Slide';\n\nexport { default as Slider } from './Slider';\nexport * from './Slider';\n\nexport { default as Snackbar } from './Snackbar';\nexport * from './Snackbar';\n\nexport { default as SnackbarContent } from './SnackbarContent';\nexport * from './SnackbarContent';\n\nexport { default as Spacer } from './Spacer';\nexport * from './Spacer';\n\nexport { default as SvgIcon } from './SvgIcon';\nexport * from './SvgIcon';\n\nexport { default as Switch } from './Switch';\nexport * from './Switch';\n\nexport { default as Tab } from './Tab';\nexport * from './Tab';\n\nexport { default as TabBase } from './TabBase';\nexport * from './TabBase';\n\nexport { default as Tabs } from './Tabs';\nexport * from './Tabs';\n\nexport { default as TextField } from './TextField';\nexport * from './TextField';\n\nexport { default as Toolbar } from './Toolbar';\nexport * from './Toolbar';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as Typography } from './Typography';\nexport * from './Typography';\n\nexport * from './animated';\n"]}
|
|
@@ -6,6 +6,11 @@ import { css, StyleSheet } from '../styles';
|
|
|
6
6
|
import { useElevationStyle } from '../hooks';
|
|
7
7
|
import Slide from '../Slide';
|
|
8
8
|
import SimpleBackdrop from './SimpleBackdrop';
|
|
9
|
+
export const createModalCloseEvent = reason => ({
|
|
10
|
+
metadata: {
|
|
11
|
+
reason
|
|
12
|
+
}
|
|
13
|
+
});
|
|
9
14
|
export default function Modal(props) {
|
|
10
15
|
const {
|
|
11
16
|
animationStyle,
|
|
@@ -21,7 +26,7 @@ export default function Modal(props) {
|
|
|
21
26
|
|
|
22
27
|
const handleBackdropPress = () => {
|
|
23
28
|
if (onClose) {
|
|
24
|
-
onClose();
|
|
29
|
+
onClose(createModalCloseEvent('OUTSIDE_PRESS'));
|
|
25
30
|
}
|
|
26
31
|
};
|
|
27
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Modal.tsx"],"names":["React","View","css","StyleSheet","useElevationStyle","Slide","SimpleBackdrop","Modal","props","animationStyle","backdropOpacity","children","disableAnimation","hideBackdrop","onClose","style","visible","otherProps","handleBackdropPress","exited","setExited","useState","elevationStyle","absoluteFill"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AACA,SAASC,GAAT,EAAcC,UAAd,QAAgC,WAAhC;AACA,SAASC,iBAAT,QAAkC,UAAlC;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,cAAP,MAA2B,kBAA3B;
|
|
1
|
+
{"version":3,"sources":["Modal.tsx"],"names":["React","View","css","StyleSheet","useElevationStyle","Slide","SimpleBackdrop","createModalCloseEvent","reason","metadata","Modal","props","animationStyle","backdropOpacity","children","disableAnimation","hideBackdrop","onClose","style","visible","otherProps","handleBackdropPress","exited","setExited","useState","elevationStyle","absoluteFill"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AACA,SAASC,GAAT,EAAcC,UAAd,QAAgC,WAAhC;AACA,SAASC,iBAAT,QAAkC,UAAlC;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AAWA,OAAO,MAAMC,qBAAqB,GAAIC,MAAD,KAAmC;AACpEC,EAAAA,QAAQ,EAAE;AACND,IAAAA;AADM;AAD0D,CAAnC,CAA9B;AAMP,eAAe,SAASE,KAAT,CAAeC,KAAf,EAAkC;AAC7C,QAAM;AACFC,IAAAA,cADE;AAEFC,IAAAA,eAAe,GAAG,GAFhB;AAGFC,IAAAA,QAHE;AAIFC,IAAAA,gBAAgB,GAAG,KAJjB;AAKFC,IAAAA,YAAY,GAAG,KALb;AAMFC,IAAAA,OANE;AAOFC,IAAAA,KAPE;AAQFC,IAAAA,OARE;AASF,OAAGC;AATD,MAUFT,KAVJ;;AAYA,QAAMU,mBAAmB,GAAG,MAAM;AAC9B,QAAIJ,OAAJ,EAAa;AACTA,MAAAA,OAAO,CAACV,qBAAqB,CAAC,eAAD,CAAtB,CAAP;AACH;AACJ,GAJD;;AAMA,QAAM,CAACe,MAAD,EAASC,SAAT,IAAsBvB,KAAK,CAACwB,QAAN,CAAe,IAAf,CAA5B;AAEA,QAAMC,cAAc,GAAGrB,iBAAiB,CAAC,CAAD,CAAxC;;AAEA,MAAI,CAACe,OAAL,EAAc;AACV,QAAIJ,gBAAgB,IAAIO,MAAxB,EAAgC;AAC5B,aAAO,IAAP;AACH;AACJ;;AAED,sBACI,oBAAC,IAAD;AACI,IAAA,KAAK,EAAEpB,GAAG,CAAC,CACPC,UAAU,CAACuB,YADJ,EAEPD,cAFO,EAGPP,KAHO,CAAD;AADd,KAMQE,UANR,GAQMJ,YAAY,IAAI,CAACG,OAAlB,GAA6B,IAA7B,gBACG,oBAAC,cAAD;AACI,IAAA,OAAO,EAAEE,mBADb;AAEI,IAAA,OAAO,EAAER;AAFb,IATR,EAeK,CAACE,gBAAD,gBACG,oBAAC,KAAD;AACI,IAAA,MAAM,EAAEI,OADZ;AAEI,IAAA,YAAY,EAAE,GAFlB;AAGI,IAAA,OAAO,EAAE,MAAMI,SAAS,CAAC,KAAD,CAH5B;AAII,IAAA,QAAQ,EAAE,MAAMA,SAAS,CAAC,IAAD,CAJ7B;AAKI,IAAA,KAAK,EAAEX;AALX,KAOKE,QAPL,CADH,GAUGA,QAzBR,CADJ;AA6BH;AAAA","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { css, StyleSheet } from '../styles';\nimport { useElevationStyle } from '../hooks';\nimport Slide from '../Slide';\nimport SimpleBackdrop from './SimpleBackdrop';\nimport type ModalProps from './ModalProps';\n\nexport type ModalCloseReasonType = 'OUTSIDE_PRESS' | 'HARDWARE_BACK_PRESS' | 'CLOSE_BUTTON_PRESS' | 'UNKNOWN';\n\nexport interface ModalCloseEvent {\n metadata: {\n reason: ModalCloseReasonType\n };\n}\n\nexport const createModalCloseEvent = (reason: ModalCloseReasonType) => ({\n metadata: {\n reason,\n },\n});\n\nexport default function Modal(props: ModalProps) {\n const {\n animationStyle,\n backdropOpacity = 0.5,\n children,\n disableAnimation = false,\n hideBackdrop = false,\n onClose,\n style,\n visible,\n ...otherProps\n } = props;\n\n const handleBackdropPress = () => {\n if (onClose) {\n onClose(createModalCloseEvent('OUTSIDE_PRESS'));\n }\n };\n\n const [exited, setExited] = React.useState(true);\n\n const elevationStyle = useElevationStyle(6);\n\n if (!visible) {\n if (disableAnimation || exited) {\n return null;\n }\n }\n\n return (\n <View\n style={css([\n StyleSheet.absoluteFill,\n elevationStyle,\n style,\n ])}\n {...otherProps}\n >\n {(hideBackdrop || !visible) ? null : (\n <SimpleBackdrop\n onPress={handleBackdropPress}\n opacity={backdropOpacity}\n />\n )}\n\n {!disableAnimation ? (\n <Slide\n appear={visible}\n exitDuration={150}\n onEnter={() => setExited(false)}\n onExited={() => setExited(true)}\n style={animationStyle}\n >\n {children}\n </Slide>\n ) : children}\n </View>\n );\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './Modal';
|
|
1
|
+
export { default, createModalCloseEvent } from './Modal';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["default"],"mappings":"AAAA,SAASA,OAAT,
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["default","createModalCloseEvent"],"mappings":"AAAA,SAASA,OAAT,EAAkBC,qBAAlB,QAA+C,SAA/C","sourcesContent":["export { default, createModalCloseEvent } from './Modal';\nexport type { ModalCloseEvent } from './Modal';\nexport type { default as ModalProps } from './ModalProps';\n"]}
|
package/build/module/index.js
CHANGED
|
@@ -68,7 +68,7 @@ export { default as Menu } from './Menu';
|
|
|
68
68
|
export * from './Menu';
|
|
69
69
|
export { default as MenuItem } from './MenuItem';
|
|
70
70
|
export * from './MenuItem';
|
|
71
|
-
export { default as Modal } from './Modal';
|
|
71
|
+
export { default as Modal, createModalCloseEvent } from './Modal';
|
|
72
72
|
export * from './Modal';
|
|
73
73
|
export { default as Pagination } from './Pagination';
|
|
74
74
|
export * from './Pagination';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["default","Accordion","AppBar","AspectRatio","Avatar","Badge","Button","ButtonBase","Card","CardActions","CardContent","CardMedia","Checkbox","Chip","CircularProgress","Column","Dialog","DialogActions","DialogContent","DialogMedia","DialogTitle","Divider","Fab","IconButton","Image","Link","List","ListItem","ListItemIcon","ListItemSecondaryAction","ListItemText","ListSubheader","Menu","MenuItem","Modal","Pagination","PaginationItem","Paper","Portal","Radio","RadioGroup","Row","Slide","Slider","Snackbar","SnackbarContent","Spacer","SvgIcon","Switch","Tab","TabBase","Tabs","TextField","Toolbar","Tooltip","Typography"],"mappings":"AAAA,cAAc,UAAd;AAEA,cAAc,SAAd;AAEA,cAAc,SAAd;AAEA,cAAc,SAAd;AAEA,SAASA,OAAO,IAAIC,SAApB,QAAqC,aAArC;AACA,cAAc,aAAd;AAEA,SAASD,OAAO,IAAIE,MAApB,QAAkC,UAAlC;AACA,cAAc,UAAd;AAEA,SAASF,OAAO,IAAIG,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAASH,OAAO,IAAII,MAApB,QAAkC,UAAlC;AACA,cAAc,UAAd;AAEA,SAASJ,OAAO,IAAIK,KAApB,QAAiC,SAAjC;AACA,cAAc,SAAd;AAEA,SAASL,OAAO,IAAIM,MAApB,QAAkC,UAAlC;AACA,cAAc,UAAd;AAEA,SAASN,OAAO,IAAIO,UAApB,QAAsC,cAAtC;AACA,cAAc,cAAd;AAEA,SAASP,OAAO,IAAIQ,IAApB,QAAgC,QAAhC;AACA,cAAc,QAAd;AAEA,SAASR,OAAO,IAAIS,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAAST,OAAO,IAAIU,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAASV,OAAO,IAAIW,SAApB,QAAqC,aAArC;AACA,cAAc,aAAd;AAEA,SAASX,OAAO,IAAIY,QAApB,QAAoC,YAApC;AACA,cAAc,YAAd;AAEA,SAASZ,OAAO,IAAIa,IAApB,QAAgC,QAAhC;AACA,cAAc,QAAd;AAEA,SAASb,OAAO,IAAIc,gBAApB,QAA4C,oBAA5C;AACA,cAAc,oBAAd;AAEA,SAASd,OAAO,IAAIe,MAApB,QAAkC,UAAlC;AACA,cAAc,UAAd;AAEA,SAASf,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ources":["index.ts"],"names":["default","Accordion","AppBar","AspectRatio","Avatar","Badge","Button","ButtonBase","Card","CardActions","CardContent","CardMedia","Checkbox","Chip","CircularProgress","Column","Dialog","DialogActions","DialogContent","DialogMedia","DialogTitle","Divider","Fab","IconButton","Image","Link","List","ListItem","ListItemIcon","ListItemSecondaryAction","ListItemText","ListSubheader","Menu","MenuItem","Modal","createModalCloseEvent","Pagination","PaginationItem","Paper","Portal","Radio","RadioGroup","Row","Slide","Slider","Snackbar","SnackbarContent","Spacer","SvgIcon","Switch","Tab","TabBase","Tabs","TextField","Toolbar","Tooltip","Typography"],"mappings":"AAAA,cAAc,UAAd;AAEA,cAAc,SAAd;AAEA,cAAc,SAAd;AAEA,cAAc,SAAd;AAEA,SAASA,OAAO,IAAIC,SAApB,QAAqC,aAArC;AACA,cAAc,aAAd;AAEA,SAASD,OAAO,IAAIE,MAApB,QAAkC,UAAlC;AACA,cAAc,UAAd;AAEA,SAASF,OAAO,IAAIG,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAASH,OAAO,IAAII,MAApB,QAAkC,UAAlC;AACA,cAAc,UAAd;AAEA,SAASJ,OAAO,IAAIK,KAApB,QAAiC,SAAjC;AACA,cAAc,SAAd;AAEA,SAASL,OAAO,IAAIM,MAApB,QAAkC,UAAlC;AACA,cAAc,UAAd;AAEA,SAASN,OAAO,IAAIO,UAApB,QAAsC,cAAtC;AACA,cAAc,cAAd;AAEA,SAASP,OAAO,IAAIQ,IAApB,QAAgC,QAAhC;AACA,cAAc,QAAd;AAEA,SAASR,OAAO,IAAIS,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAAST,OAAO,IAAIU,WAApB,QAAuC,eAAvC;AACA,cAAc,eAAd;AAEA,SAASV,OAAO,IAAIW,SAApB,QAAqC,aAArC;AACA,cAAc,aAAd;AAEA,SAASX,OAAO,IAAIY,QAApB,QAAoC,YAApC;AACA,cAAc,YAAd;AAEA,SAASZ,OAAO,IAAIa,IAAp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;AACA,cAAc,WAAd;AAEA,SAASnD,OAAO,IAAIoD,IAApB,QAAgC,QAAhC;AACA,cAAc,QAAd;AAEA,SAASpD,OAAO,IAAIqD,SAApB,QAAqC,aAArC;AACA,cAAc,aAAd;AAEA,SAASrD,OAAO,IAAIsD,OAApB,QAAmC,WAAnC;AACA,cAAc,WAAd;AAEA,SAAStD,OAAO,IAAIuD,OAApB,QAAmC,WAAnC;AACA,cAAc,WAAd;AAEA,SAASvD,OAAO,IAAIwD,UAApB,QAAsC,cAAtC;AACA,cAAc,cAAd;AAEA,cAAc,YAAd","sourcesContent":["export * from './styles';\n\nexport * from './types';\n\nexport * from './hooks';\n\nexport * from './utils';\n\nexport { default as Accordion } from './Accordion';\nexport * from './Accordion';\n\nexport { default as AppBar } from './AppBar';\nexport * from './AppBar';\n\nexport { default as AspectRatio } from './AspectRatio';\nexport * from './AspectRatio';\n\nexport { default as Avatar } from './Avatar';\nexport * from './Avatar';\n\nexport { default as Badge } from './Badge';\nexport * from './Badge';\n\nexport { default as Button } from './Button';\nexport * from './Button';\n\nexport { default as ButtonBase } from './ButtonBase';\nexport * from './ButtonBase';\n\nexport { default as Card } from './Card';\nexport * from './Card';\n\nexport { default as CardActions } from './CardActions';\nexport * from './CardActions';\n\nexport { default as CardContent } from './CardContent';\nexport * from './CardContent';\n\nexport { default as CardMedia } from './CardMedia';\nexport * from './CardMedia';\n\nexport { default as Checkbox } from './Checkbox';\nexport * from './Checkbox';\n\nexport { default as Chip } from './Chip';\nexport * from './Chip';\n\nexport { default as CircularProgress } from './CircularProgress';\nexport * from './CircularProgress';\n\nexport { default as Column } from './Column';\nexport * from './Column';\n\nexport { default as Dialog } from './Dialog';\nexport * from './Dialog';\n\nexport { default as DialogActions } from './DialogActions';\nexport * from './DialogActions';\n\nexport { default as DialogContent } from './DialogContent';\nexport * from './DialogContent';\n\nexport { default as DialogMedia } from './DialogMedia';\nexport * from './DialogMedia';\n\nexport { default as DialogTitle } from './DialogTitle';\nexport * from './DialogTitle';\n\nexport { default as Divider } from './Divider';\nexport * from './Divider';\n\nexport { default as Fab } from './Fab';\nexport * from './Fab';\n\nexport { default as IconButton } from './IconButton';\nexport * from './IconButton';\n\nexport { default as Image } from './Image';\nexport * from './Image';\n\nexport { default as Link } from './Link';\nexport * from './Link';\n\nexport { default as List } from './List';\nexport * from './List';\n\nexport { default as ListItem } from './ListItem';\nexport * from './ListItem';\n\nexport { default as ListItemIcon } from './ListItemIcon';\nexport * from './ListItemIcon';\n\nexport { default as ListItemSecondaryAction } from './ListItemSecondaryAction';\nexport * from './ListItemSecondaryAction';\n\nexport { default as ListItemText } from './ListItemText';\nexport * from './ListItemText';\n\nexport { default as ListSubheader } from './ListSubheader';\nexport * from './ListSubheader';\n\nexport { default as Menu } from './Menu';\nexport * from './Menu';\n\nexport { default as MenuItem } from './MenuItem';\nexport * from './MenuItem';\n\nexport { default as Modal, createModalCloseEvent } from './Modal';\nexport type { ModalCloseEvent } from './Modal';\nexport * from './Modal';\n\nexport { default as Pagination } from './Pagination';\nexport * from './Pagination';\n\nexport { default as PaginationItem } from './PaginationItem';\nexport * from './PaginationItem';\n\nexport { default as Paper } from './Paper';\nexport * from './Paper';\n\nexport { default as Portal } from './Portal';\nexport * from './Portal';\n\nexport { default as Radio } from './Radio';\nexport * from './Radio';\n\nexport { default as RadioGroup } from './RadioGroup';\nexport * from './RadioGroup';\n\nexport { default as Row } from './Row';\nexport * from './Row';\n\nexport { default as Slide } from './Slide';\nexport * from './Slide';\n\nexport { default as Slider } from './Slider';\nexport * from './Slider';\n\nexport { default as Snackbar } from './Snackbar';\nexport * from './Snackbar';\n\nexport { default as SnackbarContent } from './SnackbarContent';\nexport * from './SnackbarContent';\n\nexport { default as Spacer } from './Spacer';\nexport * from './Spacer';\n\nexport { default as SvgIcon } from './SvgIcon';\nexport * from './SvgIcon';\n\nexport { default as Switch } from './Switch';\nexport * from './Switch';\n\nexport { default as Tab } from './Tab';\nexport * from './Tab';\n\nexport { default as TabBase } from './TabBase';\nexport * from './TabBase';\n\nexport { default as Tabs } from './Tabs';\nexport * from './Tabs';\n\nexport { default as TextField } from './TextField';\nexport * from './TextField';\n\nexport { default as Toolbar } from './Toolbar';\nexport * from './Toolbar';\n\nexport { default as Tooltip } from './Tooltip';\nexport * from './Tooltip';\n\nexport { default as Typography } from './Typography';\nexport * from './Typography';\n\nexport * from './animated';\n"]}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type ModalProps from './ModalProps';
|
|
3
|
+
export declare type ModalCloseReasonType = 'OUTSIDE_PRESS' | 'HARDWARE_BACK_PRESS' | 'CLOSE_BUTTON_PRESS' | 'UNKNOWN';
|
|
4
|
+
export interface ModalCloseEvent {
|
|
5
|
+
metadata: {
|
|
6
|
+
reason: ModalCloseReasonType;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const createModalCloseEvent: (reason: ModalCloseReasonType) => {
|
|
10
|
+
metadata: {
|
|
11
|
+
reason: ModalCloseReasonType;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
3
14
|
export default function Modal(props: ModalProps): JSX.Element | null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
3
|
import type { ComponentProps, OverridableComponentProps } from '../types';
|
|
4
|
+
import { ModalCloseEvent } from './Modal';
|
|
4
5
|
export default interface ModalProps extends OverridableComponentProps<ViewProps, {
|
|
5
6
|
/**
|
|
6
7
|
* Style object provided to animation component.
|
|
@@ -28,7 +29,7 @@ export default interface ModalProps extends OverridableComponentProps<ViewProps,
|
|
|
28
29
|
/**
|
|
29
30
|
* Callback fired when the component requests to be closed.
|
|
30
31
|
*/
|
|
31
|
-
onClose?: () => void;
|
|
32
|
+
onClose?: (event?: ModalCloseEvent) => void;
|
|
32
33
|
/**
|
|
33
34
|
* If `true`, the modal is visible.
|
|
34
35
|
*/
|
|
@@ -68,7 +68,8 @@ export { default as Menu } from './Menu';
|
|
|
68
68
|
export * from './Menu';
|
|
69
69
|
export { default as MenuItem } from './MenuItem';
|
|
70
70
|
export * from './MenuItem';
|
|
71
|
-
export { default as Modal } from './Modal';
|
|
71
|
+
export { default as Modal, createModalCloseEvent } from './Modal';
|
|
72
|
+
export type { ModalCloseEvent } from './Modal';
|
|
72
73
|
export * from './Modal';
|
|
73
74
|
export { default as Pagination } from './Pagination';
|
|
74
75
|
export * from './Pagination';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fountain-ui/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"author": "Fountain-UI Team",
|
|
5
5
|
"description": "React components that implement Tappytoon's Fountain Design.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "bd7415304a03e570da7517dbc569b18ad17d0639"
|
|
71
71
|
}
|
package/src/Modal/Modal.tsx
CHANGED
|
@@ -6,6 +6,20 @@ import Slide from '../Slide';
|
|
|
6
6
|
import SimpleBackdrop from './SimpleBackdrop';
|
|
7
7
|
import type ModalProps from './ModalProps';
|
|
8
8
|
|
|
9
|
+
export type ModalCloseReasonType = 'OUTSIDE_PRESS' | 'HARDWARE_BACK_PRESS' | 'CLOSE_BUTTON_PRESS' | 'UNKNOWN';
|
|
10
|
+
|
|
11
|
+
export interface ModalCloseEvent {
|
|
12
|
+
metadata: {
|
|
13
|
+
reason: ModalCloseReasonType
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const createModalCloseEvent = (reason: ModalCloseReasonType) => ({
|
|
18
|
+
metadata: {
|
|
19
|
+
reason,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
9
23
|
export default function Modal(props: ModalProps) {
|
|
10
24
|
const {
|
|
11
25
|
animationStyle,
|
|
@@ -21,7 +35,7 @@ export default function Modal(props: ModalProps) {
|
|
|
21
35
|
|
|
22
36
|
const handleBackdropPress = () => {
|
|
23
37
|
if (onClose) {
|
|
24
|
-
onClose();
|
|
38
|
+
onClose(createModalCloseEvent('OUTSIDE_PRESS'));
|
|
25
39
|
}
|
|
26
40
|
};
|
|
27
41
|
|
package/src/Modal/ModalProps.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
3
|
import type { ComponentProps, OverridableComponentProps } from '../types';
|
|
4
|
+
import { ModalCloseEvent } from './Modal';
|
|
4
5
|
|
|
5
6
|
export default interface ModalProps extends OverridableComponentProps<ViewProps, {
|
|
6
7
|
/**
|
|
@@ -34,7 +35,7 @@ export default interface ModalProps extends OverridableComponentProps<ViewProps,
|
|
|
34
35
|
/**
|
|
35
36
|
* Callback fired when the component requests to be closed.
|
|
36
37
|
*/
|
|
37
|
-
onClose?: () => void,
|
|
38
|
+
onClose?: (event?: ModalCloseEvent) => void,
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* If `true`, the modal is visible.
|
package/src/Modal/index.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { default } from './Modal';
|
|
2
|
-
export type {
|
|
1
|
+
export { default, createModalCloseEvent } from './Modal';
|
|
2
|
+
export type { ModalCloseEvent } from './Modal';
|
|
3
|
+
export type { default as ModalProps } from './ModalProps';
|
package/src/index.ts
CHANGED
|
@@ -105,7 +105,8 @@ export * from './Menu';
|
|
|
105
105
|
export { default as MenuItem } from './MenuItem';
|
|
106
106
|
export * from './MenuItem';
|
|
107
107
|
|
|
108
|
-
export { default as Modal } from './Modal';
|
|
108
|
+
export { default as Modal, createModalCloseEvent } from './Modal';
|
|
109
|
+
export type { ModalCloseEvent } from './Modal';
|
|
109
110
|
export * from './Modal';
|
|
110
111
|
|
|
111
112
|
export { default as Pagination } from './Pagination';
|