@tecsinapse/react-native-kit 1.16.0 → 1.17.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 +34 -0
- package/dist/components/atoms/Avatar/Avatar.js +1 -3
- package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
- package/dist/components/atoms/Avatar/index.js +4 -9
- package/dist/components/atoms/Avatar/index.js.map +1 -1
- package/dist/components/atoms/Badge/Badge.js +1 -3
- package/dist/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/components/atoms/Badge/index.js +5 -15
- package/dist/components/atoms/Badge/index.js.map +1 -1
- package/dist/components/atoms/BottomNavigator/BottomNavigator.js +3 -5
- package/dist/components/atoms/BottomNavigator/BottomNavigator.js.map +1 -1
- package/dist/components/atoms/BottomNavigator/Item.js +1 -3
- package/dist/components/atoms/BottomNavigator/Item.js.map +1 -1
- package/dist/components/atoms/BottomNavigator/index.js +7 -21
- package/dist/components/atoms/BottomNavigator/index.js.map +1 -1
- package/dist/components/atoms/BottomNavigator/styled.js +1 -3
- package/dist/components/atoms/BottomNavigator/styled.js.map +1 -1
- package/dist/components/atoms/Button/Button.js +2 -4
- package/dist/components/atoms/Button/Button.js.map +1 -1
- package/dist/components/atoms/Button/States/Error.js +1 -3
- package/dist/components/atoms/Button/States/Error.js.map +1 -1
- package/dist/components/atoms/Button/States/Loading.js +1 -3
- package/dist/components/atoms/Button/States/Loading.js.map +1 -1
- package/dist/components/atoms/Button/States/Success.js +1 -3
- package/dist/components/atoms/Button/States/Success.js.map +1 -1
- package/dist/components/atoms/Button/States/index.js +8 -21
- package/dist/components/atoms/Button/States/index.js.map +1 -1
- package/dist/components/atoms/Button/index.js +9 -33
- package/dist/components/atoms/Button/index.js.map +1 -1
- package/dist/components/atoms/GroupButton/GroupButtonOption.js +1 -3
- package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
- package/dist/components/atoms/GroupButton/index.js +4 -9
- package/dist/components/atoms/GroupButton/index.js.map +1 -1
- package/dist/components/atoms/Header/Header.js +9 -11
- package/dist/components/atoms/Header/Header.js.map +1 -1
- package/dist/components/atoms/Header/index.js +5 -15
- package/dist/components/atoms/Header/index.js.map +1 -1
- package/dist/components/atoms/Header/styled.js +1 -3
- package/dist/components/atoms/Header/styled.js.map +1 -1
- package/dist/components/atoms/Input/Input.js +1 -3
- package/dist/components/atoms/Input/Input.js.map +1 -1
- package/dist/components/atoms/Input/index.js +5 -15
- package/dist/components/atoms/Input/index.js.map +1 -1
- package/dist/components/atoms/Input/styled.js +1 -3
- package/dist/components/atoms/Input/styled.js.map +1 -1
- package/dist/components/atoms/InputMask/InputMask.d.ts +8 -0
- package/dist/components/atoms/InputMask/InputMask.js +87 -0
- package/dist/components/atoms/InputMask/InputMask.js.map +1 -0
- package/dist/components/atoms/InputMask/index.d.ts +1 -0
- package/dist/components/atoms/InputMask/index.js +14 -0
- package/dist/components/atoms/InputMask/index.js.map +1 -0
- package/dist/components/atoms/InputMask/styled.d.ts +5 -0
- package/dist/components/atoms/InputMask/styled.js +27 -0
- package/dist/components/atoms/InputMask/styled.js.map +1 -0
- package/dist/components/atoms/Modal/ModalGroupManager.js +1 -3
- package/dist/components/atoms/Modal/ModalGroupManager.js.map +1 -1
- package/dist/components/atoms/Modal/ModalLifecycleHandler.d.ts +1 -0
- package/dist/components/atoms/Modal/ModalLifecycleHandler.js +30 -30
- package/dist/components/atoms/Modal/ModalLifecycleHandler.js.map +1 -1
- package/dist/components/atoms/Modal/index.d.ts +1 -0
- package/dist/components/atoms/Modal/index.js +15 -39
- package/dist/components/atoms/Modal/index.js.map +1 -1
- package/dist/components/atoms/Modal/ui/BaseModalView.js +1 -3
- package/dist/components/atoms/Modal/ui/BaseModalView.js.map +1 -1
- package/dist/components/atoms/Modal/ui/styled.js +1 -3
- package/dist/components/atoms/Modal/ui/styled.js.map +1 -1
- package/dist/components/atoms/Modal/ui/types.js +1 -3
- package/dist/components/atoms/Modal/useLazyModalManager.d.ts +1 -1
- package/dist/components/atoms/Modal/useLazyModalManager.js +3 -5
- package/dist/components/atoms/Modal/useLazyModalManager.js.map +1 -1
- package/dist/components/atoms/Modal/useModalManager.d.ts +1 -1
- package/dist/components/atoms/Modal/useModalManager.js +3 -5
- package/dist/components/atoms/Modal/useModalManager.js.map +1 -1
- package/dist/components/atoms/Modal/useModalRemoteControl.d.ts +4 -0
- package/dist/components/atoms/Modal/useModalRemoteControl.js +24 -0
- package/dist/components/atoms/Modal/useModalRemoteControl.js.map +1 -0
- package/dist/components/atoms/Skeleton/Pulse.js +1 -3
- package/dist/components/atoms/Skeleton/Pulse.js.map +1 -1
- package/dist/components/atoms/Skeleton/Skeleton.js +3 -5
- package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/atoms/Skeleton/Wave.js +1 -3
- package/dist/components/atoms/Skeleton/Wave.js.map +1 -1
- package/dist/components/atoms/Skeleton/animation.js +1 -3
- package/dist/components/atoms/Skeleton/animation.js.map +1 -1
- package/dist/components/atoms/Skeleton/index.js +5 -15
- package/dist/components/atoms/Skeleton/index.js.map +1 -1
- package/dist/components/atoms/Skeleton/styled.js +1 -3
- package/dist/components/atoms/Skeleton/styled.js.map +1 -1
- package/dist/components/atoms/Skeleton/types.js +1 -3
- package/dist/components/atoms/SnappingSlider/SnappingSlider.js +1 -3
- package/dist/components/atoms/SnappingSlider/SnappingSlider.js.map +1 -1
- package/dist/components/atoms/SnappingSlider/index.js +5 -15
- package/dist/components/atoms/SnappingSlider/index.js.map +1 -1
- package/dist/components/atoms/Tag/Tag.js +1 -3
- package/dist/components/atoms/Tag/Tag.js.map +1 -1
- package/dist/components/atoms/Tag/index.js +5 -15
- package/dist/components/atoms/Tag/index.js.map +1 -1
- package/dist/components/atoms/Text/Text.js +1 -3
- package/dist/components/atoms/Text/Text.js.map +1 -1
- package/dist/components/atoms/Text/index.js +5 -15
- package/dist/components/atoms/Text/index.js.map +1 -1
- package/dist/components/atoms/Text/styled.js +4 -6
- package/dist/components/atoms/Text/styled.js.map +1 -1
- package/dist/components/atoms/TextArea/TextArea.js +1 -3
- package/dist/components/atoms/TextArea/TextArea.js.map +1 -1
- package/dist/components/atoms/TextArea/index.js +5 -15
- package/dist/components/atoms/TextArea/index.js.map +1 -1
- package/dist/components/atoms/TextArea/styled.js +1 -3
- package/dist/components/atoms/TextArea/styled.js.map +1 -1
- package/dist/components/molecules/Calendar/Calendar.js +1 -3
- package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
- package/dist/components/molecules/Calendar/index.js +4 -9
- package/dist/components/molecules/Calendar/index.js.map +1 -1
- package/dist/components/molecules/DatePicker/DatePicker.js +2 -4
- package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/molecules/DatePicker/index.js +5 -15
- package/dist/components/molecules/DatePicker/index.js.map +1 -1
- package/dist/components/molecules/DatePicker/styled.js +1 -3
- package/dist/components/molecules/DatePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js +1 -3
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/index.js +5 -15
- package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +1 -3
- package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
- package/dist/components/molecules/DateTimeSelector/index.js +4 -9
- package/dist/components/molecules/DateTimeSelector/index.js.map +1 -1
- package/dist/components/molecules/InputPassword/InputPassword.js +1 -3
- package/dist/components/molecules/InputPassword/InputPassword.js.map +1 -1
- package/dist/components/molecules/InputPassword/index.js +5 -15
- package/dist/components/molecules/InputPassword/index.js.map +1 -1
- package/dist/components/molecules/Select/Modal.js +3 -5
- package/dist/components/molecules/Select/Modal.js.map +1 -1
- package/dist/components/molecules/Select/Select.js +3 -5
- package/dist/components/molecules/Select/Select.js.map +1 -1
- package/dist/components/molecules/Select/index.js +5 -15
- package/dist/components/molecules/Select/index.js.map +1 -1
- package/dist/components/molecules/Select/styled.js +2 -4
- package/dist/components/molecules/Select/styled.js.map +1 -1
- package/dist/components/molecules/Snackbar/Snackbar.js +1 -3
- package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
- package/dist/components/molecules/Snackbar/index.js +5 -15
- package/dist/components/molecules/Snackbar/index.js.map +1 -1
- package/dist/components/molecules/Snackbar/styled.js +1 -3
- package/dist/components/molecules/Snackbar/styled.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +75 -267
- package/dist/index.js.map +1 -1
- package/dist/utils/date.js +1 -3
- package/dist/utils/date.js.map +1 -1
- package/package.json +6 -6
- package/src/components/atoms/InputMask/InputMask.tsx +96 -0
- package/src/components/atoms/InputMask/index.ts +1 -0
- package/src/components/atoms/InputMask/styled.ts +25 -0
- package/src/components/atoms/Modal/ModalLifecycleHandler.ts +15 -4
- package/src/components/atoms/Modal/index.ts +2 -1
- package/src/components/atoms/Modal/useLazyModalManager.ts +2 -2
- package/src/components/atoms/Modal/useModalManager.ts +2 -2
- package/src/components/atoms/Modal/useModalRemoteControl.ts +26 -0
- package/src/components/atoms/Skeleton/Skeleton.tsx +6 -0
- package/src/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Header/styled.ts"],"names":["StyledView","styled","View","theme","spacing","deca","FloatingButton","Button","Dummy"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Header/styled.ts"],"names":["StyledView","styled","View","theme","spacing","deca","FloatingButton","Button","Dummy"],"mappings":";;;;;AAAA;;AACA;;;;AAEO,MAAMA,UAAU,GAAGC,gBAAOC,IAA0B;AAC3D;AACA;AACA;AACA,aAAa,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AAC/C;AACA,CANO;;AAQA,MAAMC,cAAc,GAAG,qBAAOC,iBAAP,CAAkD;AAChF;AACA,CAFO;;AAIA,MAAMC,KAAK,GAAG,qBAAOF,cAAP,CAAuB;AAC5C;AACA,CAFO","sourcesContent":["import styled from '@emotion/native';\nimport { Button, ButtonProps, StyleProps } from '@tecsinapse/react-core';\n\nexport const StyledView = styled.View<Partial<StyleProps>>`\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: ${({ theme }) => theme.spacing.deca};\n width: 100%;\n`;\n\nexport const FloatingButton = styled(Button)<ButtonProps & Partial<StyleProps>>`\n aspect-ratio: 1;\n`;\n\nexport const Dummy = styled(FloatingButton)`\n background-color: rgba(0, 0, 0, 0);\n`;\n"],"file":"styled.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Input/Input.tsx"],"names":["Input","React","forwardRef","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputFontStack","inputFontWeight","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","rest","ref","_hint","Text","focused","handleBlur","handleFocus","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Input/Input.tsx"],"names":["Input","React","forwardRef","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputFontStack","inputFontWeight","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","rest","ref","_hint","Text","focused","handleBlur","handleFocus","displayName"],"mappings":";;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;;;;;AASA,MAAMA,KAA2B,GAAGC,eAAMC,UAAN,CAClC,CACE;AACEC,EAAAA,KADF;AAEEC,EAAAA,UAFF;AAGEC,EAAAA,iBAHF;AAIEC,EAAAA,cAJF;AAKEC,EAAAA,eALF;AAMEC,EAAAA,UANF;AAOEC,EAAAA,WAPF;AAQEC,EAAAA,aARF;AASEC,EAAAA,cATF;AAUEC,EAAAA,QAVF;AAWEC,EAA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eACMK,IADN;AAEE,IAAA,GAAG,EAAEC,GAFP;AAGE,IAAA,SAAS,EAAET,cAHb;AAIE,IAAA,UAAU,EAAEC,eAJd;AAKE,IAAA,QAAQ,EAAEL,QALZ;AAME,IAAA,OAAO,EAAEkB,WANX;AAOE,IAAA,MAAM,EAAED;AAPV,KAlBF,CADF,EA6BGR,IAAI,IAAIK,KA7BX,CADF;AAiCD,CAtEiC,CAApC;;AAyEA1B,KAAK,CAAC+B,WAAN,GAAoB,OAApB;eAEe/B,K","sourcesContent":["import {\n FontStackType,\n FontWeightType,\n Hint,\n InputContainerProps,\n InputElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { Text } from '../Text';\nimport { StyledInputContainer, StyledNativeInput } from './styled';\n\nexport interface InputNativeProps\n extends Omit<InputElementProps, 'style'>,\n InputContainerProps {\n inputFontStack?: FontStackType;\n inputFontWeight?: FontWeightType;\n}\n\nconst Input: FC<InputNativeProps> = React.forwardRef(\n (\n {\n label,\n labelColor,\n labelColorVariant,\n labelColorTone,\n labelTypography,\n labelStack,\n labelWeight,\n leftComponent,\n rightComponent,\n disabled,\n style,\n borderColor,\n borderColorGradation,\n inputFontStack = 'default',\n inputFontWeight = 'bold',\n inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || (\n <Hint TextComponent={Text} text={hint} variant={variant} />\n );\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n return (\n <View style={style}>\n <StyledInputContainer\n label={label}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\n LabelComponent={Text}\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n borderColor={borderColor}\n borderColorGradation={borderColorGradation}\n inputContainerStyle={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n variant={variant}\n >\n <StyledNativeInput\n {...rest}\n ref={ref}\n fontStack={inputFontStack}\n fontWeight={inputFontWeight}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </StyledInputContainer>\n {hint && _hint}\n </View>\n );\n }\n);\n\nInput.displayName = 'Input';\n\nexport default Input;\n"],"file":"Input.js"}
|
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Input", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Input.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "InputNativeProps", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _Input.InputNativeProps;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.InputNativeProps = exports.Input = void 0;
|
|
18
5
|
|
|
19
6
|
var _Input = _interopRequireWildcard(require("./Input"));
|
|
20
7
|
|
|
8
|
+
exports.Input = _Input.default;
|
|
9
|
+
exports.InputNativeProps = _Input.InputNativeProps;
|
|
10
|
+
|
|
21
11
|
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); }
|
|
22
12
|
|
|
23
13
|
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; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Input/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Input/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as Input, InputNativeProps } from './Input';\n"],"file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Input/styled.ts"],"names":["StyledInputContainer","InputContainer","StyledNativeInputBase","InputElement","theme","typography","h5","lineHeight","StyledNativeInput","fontStyles"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Input/styled.ts"],"names":["StyledInputContainer","InputContainer","StyledNativeInputBase","InputElement","theme","typography","h5","lineHeight","StyledNativeInput","fontStyles"],"mappings":";;;;;AAAA;;AACA;;AAMA;;;;AAGO,MAAMA,oBAAoB,GAAG,qBAAOC,yBAAP,CAA4C;AAChF,gBAAgB,2BAAW,MAAX,CAAmB;AACnC,CAFO;;AAIP,MAAMC,qBAAqB,GAAG,qBAAOC,uBAAP,CAE5B;AACF,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,UAAN,CAAiBC,EAAjB,CAAoBC,UAAW;AAC1D;AACA;AACA,CANA;AAQO,MAAMC,iBAAiB,GAAG,qBAAON,qBAAP,EAE/BO,kBAF+B,CAA1B","sourcesContent":["import styled from '@emotion/native';\nimport {\n InputContainer,\n InputElement,\n RFValueStr,\n StyleProps\n} from '@tecsinapse/react-core';\nimport { Font, fontStyles } from '../Text/styled';\nimport { InputNativeProps } from './Input';\n\nexport const StyledInputContainer = styled(InputContainer)<Partial<StyleProps>>`\n min-height: ${RFValueStr('50px')};\n`;\n\nconst StyledNativeInputBase = styled(InputElement)<\n Partial<InputNativeProps> & Partial<StyleProps>\n>`\n height: ${({ theme }) => theme.typography.h5.lineHeight};\n width: 100%;\n padding: 0;\n`;\n\nexport const StyledNativeInput = styled(StyledNativeInputBase)<\n Font & Partial<InputNativeProps> & Partial<StyleProps>\n>(fontStyles);\n"],"file":"styled.js"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FontStackType, FontWeightType, InputContainerProps, InputMaskElementProps } from '@tecsinapse/react-core';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
export interface InputMaskNativeProps extends Omit<InputMaskElementProps, 'style'>, InputContainerProps {
|
|
4
|
+
inputFontStack?: FontStackType;
|
|
5
|
+
inputFontWeight?: FontWeightType;
|
|
6
|
+
}
|
|
7
|
+
declare const InputMask: FC<InputMaskNativeProps>;
|
|
8
|
+
export default InputMask;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
|
|
6
|
+
var _reactCore = require("@tecsinapse/react-core");
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _styled = require("./styled");
|
|
13
|
+
|
|
14
|
+
var _Text = require("../Text");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
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); }
|
|
19
|
+
|
|
20
|
+
const InputMask = _react.default.forwardRef(({
|
|
21
|
+
label,
|
|
22
|
+
labelColor,
|
|
23
|
+
labelColorVariant,
|
|
24
|
+
labelColorTone,
|
|
25
|
+
labelTypography,
|
|
26
|
+
labelStack,
|
|
27
|
+
labelWeight,
|
|
28
|
+
leftComponent,
|
|
29
|
+
rightComponent,
|
|
30
|
+
disabled,
|
|
31
|
+
style,
|
|
32
|
+
borderColor,
|
|
33
|
+
borderColorGradation,
|
|
34
|
+
inputFontStack = 'default',
|
|
35
|
+
inputFontWeight = 'bold',
|
|
36
|
+
inputContainerStyle,
|
|
37
|
+
variant = 'default',
|
|
38
|
+
hintComponent,
|
|
39
|
+
hint,
|
|
40
|
+
onFocus,
|
|
41
|
+
onBlur,
|
|
42
|
+
...rest
|
|
43
|
+
}, ref) => {
|
|
44
|
+
const _hint = hintComponent || _react.default.createElement(_reactCore.Hint, {
|
|
45
|
+
TextComponent: _Text.Text,
|
|
46
|
+
text: hint,
|
|
47
|
+
variant: variant
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const {
|
|
51
|
+
focused,
|
|
52
|
+
handleBlur,
|
|
53
|
+
handleFocus
|
|
54
|
+
} = (0, _reactCore.useInputFocus)(onFocus, onBlur, !disabled);
|
|
55
|
+
return _react.default.createElement(_reactNative.View, {
|
|
56
|
+
style: style
|
|
57
|
+
}, _react.default.createElement(_styled.StyledInputContainer, {
|
|
58
|
+
label: label,
|
|
59
|
+
labelColor: labelColor,
|
|
60
|
+
labelColorVariant: labelColorVariant,
|
|
61
|
+
labelColorTone: labelColorTone,
|
|
62
|
+
labelTypography: labelTypography,
|
|
63
|
+
labelStack: labelStack,
|
|
64
|
+
labelWeight: labelWeight,
|
|
65
|
+
LabelComponent: _Text.Text,
|
|
66
|
+
leftComponent: leftComponent,
|
|
67
|
+
rightComponent: rightComponent,
|
|
68
|
+
borderColor: borderColor,
|
|
69
|
+
borderColorGradation: borderColorGradation,
|
|
70
|
+
inputContainerStyle: inputContainerStyle,
|
|
71
|
+
focused: focused,
|
|
72
|
+
disabled: disabled,
|
|
73
|
+
variant: variant
|
|
74
|
+
}, _react.default.createElement(_styled.StyledNativeInputMask, _extends({}, rest, {
|
|
75
|
+
ref: ref,
|
|
76
|
+
fontStack: inputFontStack,
|
|
77
|
+
fontWeight: inputFontWeight,
|
|
78
|
+
disabled: disabled,
|
|
79
|
+
onFocus: handleFocus,
|
|
80
|
+
onBlur: handleBlur
|
|
81
|
+
}))), hint && _hint);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
InputMask.displayName = 'InputMask';
|
|
85
|
+
var _default = InputMask;
|
|
86
|
+
exports.default = _default;
|
|
87
|
+
//# sourceMappingURL=InputMask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/InputMask/InputMask.tsx"],"names":["InputMask","React","forwardRef","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputFontStack","inputFontWeight","inputContainerStyle","variant","hintComponent","hint","onFocus","onBlur","rest","ref","_hint","Text","focused","handleBlur","handleFocus","displayName"],"mappings":";;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;;;;;AASA,MAAMA,SAAmC,GAAGC,eAAMC,UAAN,CAC1C,CACE;AACEC,EAAAA,KADF;AAEEC,EAAAA,UAFF;AAGEC,EAAAA,iBAHF;AAIEC,EAAAA,cAJF;AAKEC,EAAAA,eALF;AAMEC,EAAAA,UANF;AAOEC,EAAAA,WAPF;AAQEC,EAAAA,aARF;AASEC,EAAAA,cATF;AAUEC,EAAAA,QAVF;AAWEC,EAAAA,KAXF;AAYEC,EAAAA,WAZF;AAaEC,EAAAA,oBAbF;AAcEC,EAAAA,cAAc,GAAG,SAdnB;AAeEC,EAAAA,eAAe,GAAG,MAfpB;AAgBEC,EAAAA,mBAhBF;AAiBEC,EAAAA,OAAO,GAAG,SAjBZ;AAkBEC,EAAAA,aAlBF;AAmBEC,EAAAA,IAnBF;AAoBEC,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BX,CADF;AAiCD,CAtEyC,CAA5C;;AAyEA1B,SAAS,CAAC+B,WAAV,GAAwB,WAAxB;eAEe/B,S","sourcesContent":["import {\n FontStackType,\n FontWeightType,\n Hint,\n InputContainerProps,\n InputMaskElementProps,\n useInputFocus,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { View } from 'react-native';\nimport { StyledInputContainer, StyledNativeInputMask } from './styled';\nimport { Text } from '../Text';\n\nexport interface InputMaskNativeProps\n extends Omit<InputMaskElementProps, 'style'>,\n InputContainerProps {\n inputFontStack?: FontStackType;\n inputFontWeight?: FontWeightType;\n}\n\nconst InputMask: FC<InputMaskNativeProps> = React.forwardRef(\n (\n {\n label,\n labelColor,\n labelColorVariant,\n labelColorTone,\n labelTypography,\n labelStack,\n labelWeight,\n leftComponent,\n rightComponent,\n disabled,\n style,\n borderColor,\n borderColorGradation,\n inputFontStack = 'default',\n inputFontWeight = 'bold',\n inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n onFocus,\n onBlur,\n ...rest\n },\n ref\n ) => {\n const _hint = hintComponent || (\n <Hint TextComponent={Text} text={hint} variant={variant} />\n );\n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n return (\n <View style={style}>\n <StyledInputContainer\n label={label}\n labelColor={labelColor}\n labelColorVariant={labelColorVariant}\n labelColorTone={labelColorTone}\n labelTypography={labelTypography}\n labelStack={labelStack}\n labelWeight={labelWeight}\n LabelComponent={Text}\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n borderColor={borderColor}\n borderColorGradation={borderColorGradation}\n inputContainerStyle={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n variant={variant}\n >\n <StyledNativeInputMask\n {...rest}\n ref={ref}\n fontStack={inputFontStack}\n fontWeight={inputFontWeight}\n disabled={disabled}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </StyledInputContainer>\n {hint && _hint}\n </View>\n );\n }\n);\n\nInputMask.displayName = 'InputMask';\n\nexport default InputMask;\n"],"file":"InputMask.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as InputMask, InputMaskNativeProps } from './InputMask';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.InputMaskNativeProps = exports.InputMask = void 0;
|
|
5
|
+
|
|
6
|
+
var _InputMask = _interopRequireWildcard(require("./InputMask"));
|
|
7
|
+
|
|
8
|
+
exports.InputMask = _InputMask.default;
|
|
9
|
+
exports.InputMaskNativeProps = _InputMask.InputMaskNativeProps;
|
|
10
|
+
|
|
11
|
+
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); }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/InputMask/index.ts"],"names":[],"mappings":";;;;;AAAA","sourcesContent":["export { default as InputMask, InputMaskNativeProps } from './InputMask';\n"],"file":"index.js"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledInputContainer: import("@emotion/native").StyledComponent<any, {}, {
|
|
3
|
+
ref?: import("react").Ref<any> | undefined;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const StyledNativeInputMask: import("@emotion/native").StyledComponent<any, {}, {}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.StyledNativeInputMask = exports.StyledInputContainer = void 0;
|
|
5
|
+
|
|
6
|
+
var _native = _interopRequireDefault(require("@emotion/native"));
|
|
7
|
+
|
|
8
|
+
var _reactCore = require("@tecsinapse/react-core");
|
|
9
|
+
|
|
10
|
+
var _styled = require("../Text/styled");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const StyledInputContainer = (0, _native.default)(_reactCore.InputContainer)`
|
|
15
|
+
min-height: ${(0, _reactCore.RFValueStr)('50px')};
|
|
16
|
+
`;
|
|
17
|
+
exports.StyledInputContainer = StyledInputContainer;
|
|
18
|
+
const StyledNativeInputMaskBase = (0, _native.default)(_reactCore.InputMaskElement)`
|
|
19
|
+
height: ${({
|
|
20
|
+
theme
|
|
21
|
+
}) => theme.typography.h5.lineHeight};
|
|
22
|
+
width: 100%;
|
|
23
|
+
padding: 0;
|
|
24
|
+
`;
|
|
25
|
+
const StyledNativeInputMask = (0, _native.default)(StyledNativeInputMaskBase)(_styled.fontStyles);
|
|
26
|
+
exports.StyledNativeInputMask = StyledNativeInputMask;
|
|
27
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/InputMask/styled.ts"],"names":["StyledInputContainer","InputContainer","StyledNativeInputMaskBase","InputMaskElement","theme","typography","h5","lineHeight","StyledNativeInputMask","fontStyles"],"mappings":";;;;;AAAA;;AACA;;AAMA;;;;AAGO,MAAMA,oBAAoB,GAAG,qBAAOC,yBAAP,CAA4C;AAChF,gBAAgB,2BAAW,MAAX,CAAmB;AACnC,CAFO;;AAIP,MAAMC,yBAAyB,GAAG,qBAAOC,2BAAP,CAEhC;AACF,YAAY,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,UAAN,CAAiBC,EAAjB,CAAoBC,UAAW;AAC1D;AACA;AACA,CANA;AAQO,MAAMC,qBAAqB,GAAG,qBAAON,yBAAP,EAEnCO,kBAFmC,CAA9B","sourcesContent":["import styled from '@emotion/native';\nimport {\n InputContainer,\n InputMaskElement,\n RFValueStr,\n StyleProps,\n} from '@tecsinapse/react-core';\nimport { Font, fontStyles } from '../Text/styled';\nimport { InputMaskNativeProps } from './InputMask';\n\nexport const StyledInputContainer = styled(InputContainer)<Partial<StyleProps>>`\n min-height: ${RFValueStr('50px')};\n`;\n\nconst StyledNativeInputMaskBase = styled(InputMaskElement)<\n Partial<InputMaskNativeProps> & Partial<StyleProps>\n>`\n height: ${({ theme }) => theme.typography.h5.lineHeight};\n width: 100%;\n padding: 0;\n`;\n\nexport const StyledNativeInputMask = styled(StyledNativeInputMaskBase)<\n Font & Partial<InputMaskNativeProps> & Partial<StyleProps>\n>(fontStyles);\n"],"file":"styled.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Modal/ModalGroupManager.tsx"],"names":["modalLifecycle","ModalGroupManager","children","others","attach","_render","render","hasModals","length"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Modal/ModalGroupManager.tsx"],"names":["modalLifecycle","ModalGroupManager","children","others","attach","_render","render","hasModals","length"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;;;AAGO,MAAMA,cAAc,GAAG,yDAAvB;;;AAQA,MAAMC,iBAAiC,GAAG,CAAC;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAD,KAA6B;AAE1EH,EAAAA,cAAc,CAACI,MAAf,CAAsB,qBAAqC,EAArC,CAAtB;;AACA,QAAMC,OAAO,GAAGL,cAAc,CAACM,MAAf,EAAhB;;AACA,QAAMC,SAAS,GAAGF,OAAO,CAACG,MAAR,GAAiB,CAAnC;AAEA,SACI,4DACKN,QADL,EAEI,6BAAC,kBAAD;AAAS,IAAA,WAAW,MAApB;AAAqB,IAAA,oBAAoB,MAAzC;AAA0C,IAAA,aAAa,EAAC,MAAxD;AAA+D,IAAA,OAAO,EAAEK;AAAxE,KAAuFJ,MAAvF,GACKE,OADL,CAFJ,CADJ;AAQH,CAdM","sourcesContent":["import React, { FC, ReactElement, useState } from 'react';\nimport { Modal as RNModal, ModalProps } from 'react-native';\nimport { createModalLifecycleHandler } from './ModalLifecycleHandler';\nimport { IBaseModal } from './ui/types';\n\nexport const modalLifecycle = createModalLifecycleHandler()\n\n/**\n * It's responsable for rendering all the modal components.\n * \n * @param param0 \n * @returns \n */\nexport const ModalGroupManager: FC<ModalProps> = ({ children, ...others }) => {\n\n modalLifecycle.attach(useState<ReactElement<IBaseModal>[]>([]))\n const _render = modalLifecycle.render()\n const hasModals = _render.length > 0\n \n return (\n <>\n {children}\n <RNModal transparent statusBarTranslucent animationType='none' visible={hasModals} {...others}>\n {_render}\n </RNModal>\n </>\n )\n}\n"],"file":"ModalGroupManager.js"}
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
exports.createModalLifecycleHandler = exports.ModalLifecycleHandler = void 0;
|
|
7
5
|
|
|
8
6
|
var _react = _interopRequireDefault(require("react"));
|
|
9
7
|
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
9
|
|
|
12
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
|
|
14
10
|
class ModalLifecycleHandler {
|
|
15
11
|
constructor() {
|
|
16
|
-
|
|
12
|
+
this.attach = state => {
|
|
17
13
|
this.state = state;
|
|
18
|
-
}
|
|
14
|
+
};
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
this.update = () => {
|
|
21
17
|
requestAnimationFrame(() => {
|
|
22
18
|
const nodes = Array.from(this.nodeGroup.values()).filter(node => node.visible || !!node.lastVisualization).sort((nodeA, nodeB) => {
|
|
23
19
|
var _nodeA$lastVisualizat, _nodeB$lastVisualizat;
|
|
24
20
|
|
|
25
|
-
return (((_nodeA$lastVisualizat = nodeA.lastVisualization)
|
|
21
|
+
return (((_nodeA$lastVisualizat = nodeA.lastVisualization) == null ? void 0 : _nodeA$lastVisualizat.getTime()) || 0) - (((_nodeB$lastVisualizat = nodeB.lastVisualization) == null ? void 0 : _nodeB$lastVisualizat.getTime()) || 0);
|
|
26
22
|
}).map((node, index, filteredNodes) => {
|
|
27
23
|
let modalElement = node.modal();
|
|
28
24
|
let {
|
|
@@ -34,26 +30,24 @@ class ModalLifecycleHandler {
|
|
|
34
30
|
isLastShown: filteredNodes.length - 1 === index,
|
|
35
31
|
close: () => this.close(node.id),
|
|
36
32
|
onClose: () => {
|
|
37
|
-
var _props$onClose;
|
|
38
|
-
|
|
39
33
|
this.remove(node.id);
|
|
40
|
-
|
|
34
|
+
props.onClose == null ? void 0 : props.onClose();
|
|
41
35
|
}
|
|
42
36
|
});
|
|
43
37
|
});
|
|
44
38
|
const [, updateState] = this.state || [];
|
|
45
|
-
updateState
|
|
39
|
+
updateState == null ? void 0 : updateState(nodes);
|
|
46
40
|
});
|
|
47
|
-
}
|
|
41
|
+
};
|
|
48
42
|
|
|
49
|
-
|
|
43
|
+
this.render = () => {
|
|
50
44
|
const [modals] = this.state || [];
|
|
51
45
|
return modals || [];
|
|
52
|
-
}
|
|
46
|
+
};
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
this.sync = (id, modal) => {
|
|
55
49
|
if (this.nodeGroup.has(id)) {
|
|
56
|
-
const savedNode = this.
|
|
50
|
+
const savedNode = this.findNode(id);
|
|
57
51
|
savedNode && this.nodeGroup.set(id, { ...savedNode,
|
|
58
52
|
modal
|
|
59
53
|
});
|
|
@@ -64,37 +58,43 @@ class ModalLifecycleHandler {
|
|
|
64
58
|
id,
|
|
65
59
|
modal
|
|
66
60
|
});
|
|
67
|
-
}
|
|
61
|
+
};
|
|
68
62
|
|
|
69
|
-
|
|
63
|
+
this.destroy = id => {
|
|
70
64
|
this.nodeGroup.delete(id);
|
|
71
65
|
this.update();
|
|
72
|
-
}
|
|
66
|
+
};
|
|
73
67
|
|
|
74
|
-
|
|
75
|
-
const savedNode = this.
|
|
68
|
+
this.remove = id => {
|
|
69
|
+
const savedNode = this.findNode(id);
|
|
76
70
|
savedNode && this.nodeGroup.set(id, { ...savedNode,
|
|
77
71
|
lastVisualization: undefined
|
|
78
72
|
});
|
|
79
73
|
this.update();
|
|
80
|
-
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
this.findNode = id => {
|
|
77
|
+
const node = this.nodeGroup.get(id);
|
|
78
|
+
!node && console.warn(`No modal was found with the id "${id}"`);
|
|
79
|
+
return node;
|
|
80
|
+
};
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
const savedNode = this.
|
|
82
|
+
this.show = id => {
|
|
83
|
+
const savedNode = this.findNode(id);
|
|
84
84
|
savedNode && this.nodeGroup.set(id, { ...savedNode,
|
|
85
85
|
visible: true,
|
|
86
86
|
lastVisualization: new Date()
|
|
87
87
|
});
|
|
88
88
|
this.update();
|
|
89
|
-
}
|
|
89
|
+
};
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
const savedNode = this.
|
|
91
|
+
this.close = id => {
|
|
92
|
+
const savedNode = this.findNode(id);
|
|
93
93
|
savedNode && this.nodeGroup.set(id, { ...savedNode,
|
|
94
94
|
visible: false
|
|
95
95
|
});
|
|
96
96
|
this.update();
|
|
97
|
-
}
|
|
97
|
+
};
|
|
98
98
|
|
|
99
99
|
this.nodeGroup = new Map();
|
|
100
100
|
this.state = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Modal/ModalLifecycleHandler.ts"],"names":["ModalLifecycleHandler","constructor","state","requestAnimationFrame","nodes","Array","from","nodeGroup","values","filter","node","visible","lastVisualization","sort","nodeA","nodeB","getTime","map","index","filteredNodes","modalElement","modal","props","React","cloneElement","key","id","isLastShown","length","close","onClose","remove","updateState","modals","has","savedNode","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Modal/ModalLifecycleHandler.ts"],"names":["ModalLifecycleHandler","constructor","attach","state","update","requestAnimationFrame","nodes","Array","from","nodeGroup","values","filter","node","visible","lastVisualization","sort","nodeA","nodeB","getTime","map","index","filteredNodes","modalElement","modal","props","React","cloneElement","key","id","isLastShown","length","close","onClose","remove","updateState","render","modals","sync","has","savedNode","findNode","set","destroy","delete","undefined","get","console","warn","show","Date","Map","createModalLifecycleHandler"],"mappings":";;;;;AAAA;;;;AAgBO,MAAMA,qBAAN,CAA4B;AAK/BC,EAAAA,WAAW,GAAG;AAAA,SAUPC,MAVO,GAUGC,KAAD,IAA+E;AAC3F,WAAKA,KAAL,GAAaA,KAAb;AACH,KAZa;;AAAA,SAiBPC,MAjBO,GAiBE,MAAM;AAClBC,MAAAA,qBAAqB,CAAC,MAAM;AACxB,cAAMC,KAAK,GAAGC,KAAK,CAACC,IAAN,CAAW,KAAKC,SAAL,CAAeC,MAAf,EAAX,EACTC,MADS,CACFC,IAAI,IAAIA,IAAI,CAACC,OAAL,IAAgB,CAAC,CAACD,IAAI,CAACE,iBAD7B,EAETC,IAFS,CAEJ,CAACC,KAAD,EAAQC,KAAR;AAAA;;AAAA,iBAAkB,CAAC,0BAAAD,KAAK,CAACF,iBAAN,2CAAyBI,OAAzB,OAAs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AAb;AACA,WAAK7C,MAAL;AACH,KA/Ga;;AAAA,SAsHP2B,KAtHO,GAsHEH,EAAD,IAAgB;AAC3B,YAAMW,SAAS,GAAG,KAAKC,QAAL,CAAcZ,EAAd,CAAlB;AACAW,MAAAA,SAAS,IAAI,KAAK9B,SAAL,CAAegC,GAAf,CAAmBb,EAAnB,EAAuB,EAAE,GAAGW,SAAL;AAAgB1B,QAAAA,OAAO,EAAE;AAAzB,OAAvB,CAAb;AACA,WAAKT,MAAL;AACH,KA1Ha;;AACV,SAAKK,SAAL,GAAiB,IAAIyC,GAAJ,EAAjB;AACA,SAAK/C,KAAL,GAAayC,SAAb;AACH;;AAR8B;;;;AAuI5B,MAAMO,2BAA2B,GAAG,MAAM;AAC7C,SAAO,IAAInD,qBAAJ,EAAP;AACH,CAFM","sourcesContent":["import React, { Dispatch, ReactElement } from \"react\"\nimport { IBaseModal } from \"./ui/types\"\n\n/**\n * It Represents a node (usually a modal component) in the modal's lifecycle handler.\n */\ninterface ModalNode {\n id: string\n visible?: boolean\n lastVisualization?: Date\n modal: () => ReactElement<IBaseModal>\n}\n\n/**\n * Manage all modal's lifecycle.\n */\nexport class ModalLifecycleHandler {\n \n nodeGroup: Map<string, ModalNode>\n state: [ReactElement<IBaseModal>[], Dispatch<ReactElement<IBaseModal>[]>] | undefined\n\n constructor() {\n this.nodeGroup = new Map()\n this.state = undefined\n }\n\n /**\n * Holds the ModalGroupManager state.\n * \n * @param state \n */\n public attach = (state: [ReactElement<IBaseModal>[], Dispatch<ReactElement<IBaseModal>[]>]) => {\n this.state = state\n }\n\n /**\n * Updates all the modal components.\n */\n public update = () => {\n requestAnimationFrame(() => {\n const nodes = Array.from(this.nodeGroup.values())\n .filter(node => node.visible || !!node.lastVisualization)\n .sort((nodeA, nodeB) => (nodeA.lastVisualization?.getTime() || 0) - (nodeB.lastVisualization?.getTime() || 0))\n .map((node, index, filteredNodes) => {\n let modalElement = node.modal()\n let { props } = modalElement\n return React.cloneElement(modalElement, {\n ...props,\n key: node.id,\n visible: node.visible,\n isLastShown: filteredNodes.length - 1 === index,\n close: () => this.close(node.id),\n onClose: () => {\n this.remove(node.id)\n props.onClose?.()\n }\n })\n })\n \n const [, updateState ] = this.state || []\n updateState?.(nodes)\n })\n }\n\n /**\n * Renders all selected modals.\n * \n * @returns \n */\n public render = (): ReactElement<IBaseModal>[] => {\n const [ modals ] = this.state || []\n return modals || []\n }\n\n /**\n * Tells to the lifecycle handler that a modal component needs to be handled.\n * \n * @param id \n * @param modal \n * @returns \n */\n public sync = (id: string, modal: () => ReactElement<IBaseModal>) => {\n if (this.nodeGroup.has(id)) {\n const savedNode = this.findNode(id)\n savedNode && this.nodeGroup.set(id, { ...savedNode, modal })\n return\n }\n this.nodeGroup.set(id, { id, modal })\n }\n\n /**\n * Destroy a modal from the lifecycle handler.\n * \n * @param id \n */\n public destroy = (id: string) => {\n this.nodeGroup.delete(id)\n this.update()\n }\n\n /**\n * Removes a modal from the rendering stack. It tells to the lifecycle handler that a modal \n * component is no longer used by the application.\n * \n * @param id \n */\n private remove = (id: string) => {\n const savedNode = this.findNode(id)\n savedNode && this.nodeGroup.set(id, { ...savedNode, lastVisualization: undefined })\n this.update()\n }\n\n /**\n * Find a modal node by id.\n * \n * @param id \n */\n private findNode = (id: string) => {\n const node = this.nodeGroup.get(id)\n !node && console.warn(`No modal was found with the id \"${id}\"`)\n return node\n }\n\n /**\n * Makes a modal appears.\n * \n * @param id \n */\n public show = (id: string) => {\n const savedNode = this.findNode(id)\n savedNode && this.nodeGroup.set(id, { ...savedNode, visible: true, lastVisualization: new Date() })\n this.update()\n }\n\n /**\n * Makes a modal disappears.\n * \n * @param id \n */\n public close = (id: string) => {\n const savedNode = this.findNode(id)\n savedNode && this.nodeGroup.set(id, { ...savedNode, visible: false })\n this.update()\n }\n}\n\n/**\n * Creates a new ModalLifecycleHandlere instance.\n * \n * @returns \n */\nexport const createModalLifecycleHandler = () => {\n return new ModalLifecycleHandler()\n}\n"],"file":"ModalLifecycleHandler.js"}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
6
4
|
|
|
7
5
|
var _ModalGroupManager = require("./ModalGroupManager");
|
|
8
6
|
|
|
9
7
|
Object.keys(_ModalGroupManager).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _ModalGroupManager[key]) return;
|
|
12
|
-
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _ModalGroupManager[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
10
|
+
exports[key] = _ModalGroupManager[key];
|
|
18
11
|
});
|
|
19
12
|
|
|
20
13
|
var _ModalLifecycleHandler = require("./ModalLifecycleHandler");
|
|
@@ -22,12 +15,7 @@ var _ModalLifecycleHandler = require("./ModalLifecycleHandler");
|
|
|
22
15
|
Object.keys(_ModalLifecycleHandler).forEach(function (key) {
|
|
23
16
|
if (key === "default" || key === "__esModule") return;
|
|
24
17
|
if (key in exports && exports[key] === _ModalLifecycleHandler[key]) return;
|
|
25
|
-
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _ModalLifecycleHandler[key];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
18
|
+
exports[key] = _ModalLifecycleHandler[key];
|
|
31
19
|
});
|
|
32
20
|
|
|
33
21
|
var _BaseModalView = require("./ui/BaseModalView");
|
|
@@ -35,12 +23,7 @@ var _BaseModalView = require("./ui/BaseModalView");
|
|
|
35
23
|
Object.keys(_BaseModalView).forEach(function (key) {
|
|
36
24
|
if (key === "default" || key === "__esModule") return;
|
|
37
25
|
if (key in exports && exports[key] === _BaseModalView[key]) return;
|
|
38
|
-
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function () {
|
|
41
|
-
return _BaseModalView[key];
|
|
42
|
-
}
|
|
43
|
-
});
|
|
26
|
+
exports[key] = _BaseModalView[key];
|
|
44
27
|
});
|
|
45
28
|
|
|
46
29
|
var _types = require("./ui/types");
|
|
@@ -48,12 +31,7 @@ var _types = require("./ui/types");
|
|
|
48
31
|
Object.keys(_types).forEach(function (key) {
|
|
49
32
|
if (key === "default" || key === "__esModule") return;
|
|
50
33
|
if (key in exports && exports[key] === _types[key]) return;
|
|
51
|
-
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function () {
|
|
54
|
-
return _types[key];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
34
|
+
exports[key] = _types[key];
|
|
57
35
|
});
|
|
58
36
|
|
|
59
37
|
var _useModalManager = require("./useModalManager");
|
|
@@ -61,12 +39,7 @@ var _useModalManager = require("./useModalManager");
|
|
|
61
39
|
Object.keys(_useModalManager).forEach(function (key) {
|
|
62
40
|
if (key === "default" || key === "__esModule") return;
|
|
63
41
|
if (key in exports && exports[key] === _useModalManager[key]) return;
|
|
64
|
-
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function () {
|
|
67
|
-
return _useModalManager[key];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
42
|
+
exports[key] = _useModalManager[key];
|
|
70
43
|
});
|
|
71
44
|
|
|
72
45
|
var _useLazyModalManager = require("./useLazyModalManager");
|
|
@@ -74,11 +47,14 @@ var _useLazyModalManager = require("./useLazyModalManager");
|
|
|
74
47
|
Object.keys(_useLazyModalManager).forEach(function (key) {
|
|
75
48
|
if (key === "default" || key === "__esModule") return;
|
|
76
49
|
if (key in exports && exports[key] === _useLazyModalManager[key]) return;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
50
|
+
exports[key] = _useLazyModalManager[key];
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
var _useModalRemoteControl = require("./useModalRemoteControl");
|
|
54
|
+
|
|
55
|
+
Object.keys(_useModalRemoteControl).forEach(function (key) {
|
|
56
|
+
if (key === "default" || key === "__esModule") return;
|
|
57
|
+
if (key in exports && exports[key] === _useModalRemoteControl[key]) return;
|
|
58
|
+
exports[key] = _useModalRemoteControl[key];
|
|
83
59
|
});
|
|
84
60
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Modal/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Modal/index.ts"],"names":[],"mappings":";;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './ModalGroupManager'\nexport * from './ModalLifecycleHandler'\nexport * from './ui/BaseModalView'\nexport * from './ui/types'\nexport * from './useModalManager'\nexport * from './useLazyModalManager'\nexport * from './useModalRemoteControl'"],"file":"index.js"}
|