@tecsinapse/react-native-kit 1.16.1 → 1.16.2

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.
Files changed (135) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/atoms/Avatar/Avatar.js +1 -3
  3. package/dist/components/atoms/Avatar/Avatar.js.map +1 -1
  4. package/dist/components/atoms/Avatar/index.js +4 -9
  5. package/dist/components/atoms/Avatar/index.js.map +1 -1
  6. package/dist/components/atoms/Badge/Badge.js +1 -3
  7. package/dist/components/atoms/Badge/Badge.js.map +1 -1
  8. package/dist/components/atoms/Badge/index.js +5 -15
  9. package/dist/components/atoms/Badge/index.js.map +1 -1
  10. package/dist/components/atoms/BottomNavigator/BottomNavigator.js +3 -5
  11. package/dist/components/atoms/BottomNavigator/BottomNavigator.js.map +1 -1
  12. package/dist/components/atoms/BottomNavigator/Item.js +1 -3
  13. package/dist/components/atoms/BottomNavigator/Item.js.map +1 -1
  14. package/dist/components/atoms/BottomNavigator/index.js +7 -21
  15. package/dist/components/atoms/BottomNavigator/index.js.map +1 -1
  16. package/dist/components/atoms/BottomNavigator/styled.js +1 -3
  17. package/dist/components/atoms/BottomNavigator/styled.js.map +1 -1
  18. package/dist/components/atoms/Button/Button.js +2 -4
  19. package/dist/components/atoms/Button/Button.js.map +1 -1
  20. package/dist/components/atoms/Button/States/Error.js +1 -3
  21. package/dist/components/atoms/Button/States/Error.js.map +1 -1
  22. package/dist/components/atoms/Button/States/Loading.js +1 -3
  23. package/dist/components/atoms/Button/States/Loading.js.map +1 -1
  24. package/dist/components/atoms/Button/States/Success.js +1 -3
  25. package/dist/components/atoms/Button/States/Success.js.map +1 -1
  26. package/dist/components/atoms/Button/States/index.js +8 -21
  27. package/dist/components/atoms/Button/States/index.js.map +1 -1
  28. package/dist/components/atoms/Button/index.js +9 -33
  29. package/dist/components/atoms/Button/index.js.map +1 -1
  30. package/dist/components/atoms/GroupButton/GroupButtonOption.js +1 -3
  31. package/dist/components/atoms/GroupButton/GroupButtonOption.js.map +1 -1
  32. package/dist/components/atoms/GroupButton/index.js +4 -9
  33. package/dist/components/atoms/GroupButton/index.js.map +1 -1
  34. package/dist/components/atoms/Header/Header.js +9 -11
  35. package/dist/components/atoms/Header/Header.js.map +1 -1
  36. package/dist/components/atoms/Header/index.js +5 -15
  37. package/dist/components/atoms/Header/index.js.map +1 -1
  38. package/dist/components/atoms/Header/styled.js +1 -3
  39. package/dist/components/atoms/Header/styled.js.map +1 -1
  40. package/dist/components/atoms/Input/Input.js +1 -3
  41. package/dist/components/atoms/Input/Input.js.map +1 -1
  42. package/dist/components/atoms/Input/index.js +5 -15
  43. package/dist/components/atoms/Input/index.js.map +1 -1
  44. package/dist/components/atoms/Input/styled.js +1 -3
  45. package/dist/components/atoms/Input/styled.js.map +1 -1
  46. package/dist/components/atoms/Modal/ModalGroupManager.js +1 -3
  47. package/dist/components/atoms/Modal/ModalGroupManager.js.map +1 -1
  48. package/dist/components/atoms/Modal/ModalLifecycleHandler.js +20 -26
  49. package/dist/components/atoms/Modal/ModalLifecycleHandler.js.map +1 -1
  50. package/dist/components/atoms/Modal/index.js +7 -39
  51. package/dist/components/atoms/Modal/index.js.map +1 -1
  52. package/dist/components/atoms/Modal/ui/BaseModalView.js +1 -3
  53. package/dist/components/atoms/Modal/ui/BaseModalView.js.map +1 -1
  54. package/dist/components/atoms/Modal/ui/styled.js +1 -3
  55. package/dist/components/atoms/Modal/ui/styled.js.map +1 -1
  56. package/dist/components/atoms/Modal/ui/types.js +1 -3
  57. package/dist/components/atoms/Modal/useLazyModalManager.js +1 -3
  58. package/dist/components/atoms/Modal/useLazyModalManager.js.map +1 -1
  59. package/dist/components/atoms/Modal/useModalManager.js +1 -3
  60. package/dist/components/atoms/Modal/useModalManager.js.map +1 -1
  61. package/dist/components/atoms/Skeleton/Pulse.js +1 -3
  62. package/dist/components/atoms/Skeleton/Pulse.js.map +1 -1
  63. package/dist/components/atoms/Skeleton/Skeleton.js +3 -5
  64. package/dist/components/atoms/Skeleton/Skeleton.js.map +1 -1
  65. package/dist/components/atoms/Skeleton/Wave.js +1 -3
  66. package/dist/components/atoms/Skeleton/Wave.js.map +1 -1
  67. package/dist/components/atoms/Skeleton/animation.js +1 -3
  68. package/dist/components/atoms/Skeleton/animation.js.map +1 -1
  69. package/dist/components/atoms/Skeleton/index.js +5 -15
  70. package/dist/components/atoms/Skeleton/index.js.map +1 -1
  71. package/dist/components/atoms/Skeleton/styled.js +1 -3
  72. package/dist/components/atoms/Skeleton/styled.js.map +1 -1
  73. package/dist/components/atoms/Skeleton/types.js +1 -3
  74. package/dist/components/atoms/SnappingSlider/SnappingSlider.js +1 -3
  75. package/dist/components/atoms/SnappingSlider/SnappingSlider.js.map +1 -1
  76. package/dist/components/atoms/SnappingSlider/index.js +5 -15
  77. package/dist/components/atoms/SnappingSlider/index.js.map +1 -1
  78. package/dist/components/atoms/Tag/Tag.js +1 -3
  79. package/dist/components/atoms/Tag/Tag.js.map +1 -1
  80. package/dist/components/atoms/Tag/index.js +5 -15
  81. package/dist/components/atoms/Tag/index.js.map +1 -1
  82. package/dist/components/atoms/Text/Text.js +1 -3
  83. package/dist/components/atoms/Text/Text.js.map +1 -1
  84. package/dist/components/atoms/Text/index.js +5 -15
  85. package/dist/components/atoms/Text/index.js.map +1 -1
  86. package/dist/components/atoms/Text/styled.js +4 -6
  87. package/dist/components/atoms/Text/styled.js.map +1 -1
  88. package/dist/components/atoms/TextArea/TextArea.js +1 -3
  89. package/dist/components/atoms/TextArea/TextArea.js.map +1 -1
  90. package/dist/components/atoms/TextArea/index.js +5 -15
  91. package/dist/components/atoms/TextArea/index.js.map +1 -1
  92. package/dist/components/atoms/TextArea/styled.js +1 -3
  93. package/dist/components/atoms/TextArea/styled.js.map +1 -1
  94. package/dist/components/molecules/Calendar/Calendar.js +1 -3
  95. package/dist/components/molecules/Calendar/Calendar.js.map +1 -1
  96. package/dist/components/molecules/Calendar/index.js +4 -9
  97. package/dist/components/molecules/Calendar/index.js.map +1 -1
  98. package/dist/components/molecules/DatePicker/DatePicker.js +2 -4
  99. package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
  100. package/dist/components/molecules/DatePicker/index.js +5 -15
  101. package/dist/components/molecules/DatePicker/index.js.map +1 -1
  102. package/dist/components/molecules/DatePicker/styled.js +1 -3
  103. package/dist/components/molecules/DatePicker/styled.js.map +1 -1
  104. package/dist/components/molecules/DateTimePicker/DateTimePicker.js +1 -3
  105. package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
  106. package/dist/components/molecules/DateTimePicker/index.js +5 -15
  107. package/dist/components/molecules/DateTimePicker/index.js.map +1 -1
  108. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js +1 -3
  109. package/dist/components/molecules/DateTimeSelector/DateTimeSelector.js.map +1 -1
  110. package/dist/components/molecules/DateTimeSelector/index.js +4 -9
  111. package/dist/components/molecules/DateTimeSelector/index.js.map +1 -1
  112. package/dist/components/molecules/InputPassword/InputPassword.js +1 -3
  113. package/dist/components/molecules/InputPassword/InputPassword.js.map +1 -1
  114. package/dist/components/molecules/InputPassword/index.js +5 -15
  115. package/dist/components/molecules/InputPassword/index.js.map +1 -1
  116. package/dist/components/molecules/Select/Modal.js +3 -5
  117. package/dist/components/molecules/Select/Modal.js.map +1 -1
  118. package/dist/components/molecules/Select/Select.js +3 -5
  119. package/dist/components/molecules/Select/Select.js.map +1 -1
  120. package/dist/components/molecules/Select/index.js +5 -15
  121. package/dist/components/molecules/Select/index.js.map +1 -1
  122. package/dist/components/molecules/Select/styled.js +2 -4
  123. package/dist/components/molecules/Select/styled.js.map +1 -1
  124. package/dist/components/molecules/Snackbar/Snackbar.js +1 -3
  125. package/dist/components/molecules/Snackbar/Snackbar.js.map +1 -1
  126. package/dist/components/molecules/Snackbar/index.js +5 -15
  127. package/dist/components/molecules/Snackbar/index.js.map +1 -1
  128. package/dist/components/molecules/Snackbar/styled.js +1 -3
  129. package/dist/components/molecules/Snackbar/styled.js.map +1 -1
  130. package/dist/index.js +66 -267
  131. package/dist/index.js.map +1 -1
  132. package/dist/utils/date.js +1 -3
  133. package/dist/utils/date.js.map +1 -1
  134. package/package.json +2 -2
  135. package/src/components/atoms/Skeleton/Skeleton.tsx +6 -0
@@ -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":";;;;;;;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,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,EAAAA,OApBF;AAqBEC,EAAAA,MArBF;AAsBE,KAAGC;AAtBL,CADF,EAyBEC,GAzBF,KA0BK;AACH,QAAMC,KAAK,GAAGN,aAAa,IACzB,6BAAC,eAAD;AAAM,IAAA,aAAa,EAAEO,UAArB;AAA2B,IAAA,IAAI,EAAEN,IAAjC;AAAuC,IAAA,OAAO,EAAEF;AAAhD,IADF;;AAGA,QAAM;AAAES,IAAAA,OAAF;AAAWC,IAAAA,UAAX;AAAuBC,IAAAA;AAAvB,MAAuC,8BAC3CR,OAD2C,EAE3CC,MAF2C,EAG3C,CAACX,QAH0C,CAA7C;AAMA,SACE,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAEC;AAAb,KACE,6BAAC,4BAAD;AACE,IAAA,KAAK,EAAEV,KADT;AAEE,IAAA,UAAU,EAAEC,UAFd;AAGE,IAAA,iBAAiB,EAAEC,iBAHrB;AAIE,IAAA,cAAc,EAAEC,cAJlB;AAKE,IAAA,eAAe,EAAEC,eALnB;AAME,IAAA,UAAU,EAAEC,UANd;AAOE,IAAA,WAAW,EAAEC,WAPf;AAQE,IAAA,cAAc,EAAEkB,UARlB;AASE,IAAA,aAAa,EAAEjB,aATjB;AAUE,IAAA,cAAc,EAAEC,cAVlB;AAWE,IAAA,WAAW,EAAEG,WAXf;AAYE,IAAA,oBAAoB,EAAEC,oBAZxB;AAaE,IAAA,mBAAmB,EAAEG,mBAbvB;AAcE,IAAA,OAAO,EAAEU,OAdX;AAeE,IAAA,QAAQ,EAAEhB,QAfZ;AAgBE,IAAA,OAAO,EAAEO;AAhBX,KAkBE,6BAAC,yBAAD,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
+ {"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":";;;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kB,UARlB;AASE,IAAA,aAAa,EAAEjB,aATjB;AAUE,IAAA,cAAc,EAAEC,cAVlB;AAWE,IAAA,WAAW,EAAEG,WAXf;AAYE,IAAA,oBAAoB,EAAEC,oBAZxB;AAaE,IAAA,mBAAmB,EAAEG,mBAbvB;AAcE,IAAA,OAAO,EAAEU,OAdX;AAeE,IAAA,QAAQ,EAAEhB,QAfZ;AAgBE,IAAA,OAAO,EAAEO;AAhBX,KAkBE,6BAAC,yBAAD,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
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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":";;;;;;;;;;;;;;;;;;AAAA","sourcesContent":["export { default as Input, InputNativeProps } from './Input';\n"],"file":"index.js"}
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,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.StyledNativeInput = exports.StyledInputContainer = void 0;
7
5
 
8
6
  var _native = _interopRequireDefault(require("@emotion/native"));
@@ -1 +1 @@
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"}
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"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.ModalGroupManager = exports.modalLifecycle = void 0;
7
5
 
8
6
  var _react = _interopRequireWildcard(require("react"));
@@ -1 +1 @@
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
+ {"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
- Object.defineProperty(exports, "__esModule", {
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
- _defineProperty(this, "attach", state => {
12
+ this.attach = state => {
17
13
  this.state = state;
18
- });
14
+ };
19
15
 
20
- _defineProperty(this, "update", () => {
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) === null || _nodeA$lastVisualizat === void 0 ? void 0 : _nodeA$lastVisualizat.getTime()) || 0) - (((_nodeB$lastVisualizat = nodeB.lastVisualization) === null || _nodeB$lastVisualizat === void 0 ? void 0 : _nodeB$lastVisualizat.getTime()) || 0);
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,24 +30,22 @@ 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
- (_props$onClose = props.onClose) === null || _props$onClose === void 0 ? void 0 : _props$onClose.call(props);
34
+ props.onClose == null ? void 0 : props.onClose();
41
35
  }
42
36
  });
43
37
  });
44
38
  const [, updateState] = this.state || [];
45
- updateState === null || updateState === void 0 ? void 0 : updateState(nodes);
39
+ updateState == null ? void 0 : updateState(nodes);
46
40
  });
47
- });
41
+ };
48
42
 
49
- _defineProperty(this, "render", () => {
43
+ this.render = () => {
50
44
  const [modals] = this.state || [];
51
45
  return modals || [];
52
- });
46
+ };
53
47
 
54
- _defineProperty(this, "sync", (id, modal) => {
48
+ this.sync = (id, modal) => {
55
49
  if (this.nodeGroup.has(id)) {
56
50
  const savedNode = this.nodeGroup.get(id);
57
51
  savedNode && this.nodeGroup.set(id, { ...savedNode,
@@ -64,37 +58,37 @@ class ModalLifecycleHandler {
64
58
  id,
65
59
  modal
66
60
  });
67
- });
61
+ };
68
62
 
69
- _defineProperty(this, "destroy", id => {
63
+ this.destroy = id => {
70
64
  this.nodeGroup.delete(id);
71
65
  this.update();
72
- });
66
+ };
73
67
 
74
- _defineProperty(this, "remove", id => {
68
+ this.remove = id => {
75
69
  const savedNode = this.nodeGroup.get(id);
76
70
  savedNode && this.nodeGroup.set(id, { ...savedNode,
77
71
  lastVisualization: undefined
78
72
  });
79
73
  this.update();
80
- });
74
+ };
81
75
 
82
- _defineProperty(this, "show", id => {
76
+ this.show = id => {
83
77
  const savedNode = this.nodeGroup.get(id);
84
78
  savedNode && this.nodeGroup.set(id, { ...savedNode,
85
79
  visible: true,
86
80
  lastVisualization: new Date()
87
81
  });
88
82
  this.update();
89
- });
83
+ };
90
84
 
91
- _defineProperty(this, "close", id => {
85
+ this.close = id => {
92
86
  const savedNode = this.nodeGroup.get(id);
93
87
  savedNode && this.nodeGroup.set(id, { ...savedNode,
94
88
  visible: false
95
89
  });
96
90
  this.update();
97
- });
91
+ };
98
92
 
99
93
  this.nodeGroup = new Map();
100
94
  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","get","set","delete","update","undefined","Date","Map","createModalLifecycleHandler"],"mappings":";;;;;;;AAAA;;;;;;AAgBO,MAAMA,qBAAN,CAA4B;AAK/BC,EAAAA,WAAW,GAAG;AAAA,oCAUGC,KAAD,IAA+E;AAC3F,WAAKA,KAAL,GAAaA,KAAb;AACH,KAZa;;AAAA,oCAiBE,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,gFAAyBI,OAAzB,OAAsC,CAAvC,KAA6C,0BAAAD,KAAK,CAACH,iBAAN,gFAAyBI,OAAzB,OAAsC,CAAnF,CAAlB;AAAA,SAFI,EAGTC,GAHS,CAGL,CAACP,IAAD,EAAOQ,KAAP,EAAcC,aAAd,KAAgC;AACjC,cAAIC,YAAY,GAAGV,IAAI,CAACW,KAAL,EAAnB;AACA,cAAI;AAAEC,YAAAA;AAAF,cAAYF,YAAhB;AACA,iBAAOG,eAAMC,YAAN,CAAmBJ,YAAnB,EAAiC,EACpC,GAAGE,KADiC;AAEpCG,YAAAA,GAAG,EA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CAAsBZ,EAAtB;AACA,WAAKa,MAAL;AACH,KA7Ea;;AAAA,oCAqFIb,EAAD,IAAgB;AAC7B,YAAMS,SAAS,GAAG,KAAK5B,SAAL,CAAe6B,GAAf,CAAmBV,EAAnB,CAAlB;AACAS,MAAAA,SAAS,IAAI,KAAK5B,SAAL,CAAe8B,GAAf,CAAmBX,EAAnB,EAAuB,EAAE,GAAGS,SAAL;AAAgBvB,QAAAA,iBAAiB,EAAE4B;AAAnC,OAAvB,CAAb;AACA,WAAKD,MAAL;AACH,KAzFa;;AAAA,kCAgGCb,EAAD,IAAgB;AAC1B,YAAMS,SAAS,GAAG,KAAK5B,SAAL,CAAe6B,GAAf,CAAmBV,EAAnB,CAAlB;AACAS,MAAAA,SAAS,IAAI,KAAK5B,SAAL,CAAe8B,GAAf,CAAmBX,EAAnB,EAAuB,EAAE,GAAGS,SAAL;AAAgBxB,QAAAA,OAAO,EAAE,IAAzB;AAA+BC,QAAAA,iBAAiB,EAAE,IAAI6B,IAAJ;AAAlD,OAAvB,CAAb;AACA,WAAKF,MAAL;AACH,KApGa;;AAAA,mCA2GEb,EAAD,IAAgB;AAC3B,YAAMS,SAAS,GAAG,KAAK5B,SAAL,CAAe6B,GAAf,CAAmBV,EAAnB,CAAlB;AACAS,MAAAA,SAAS,IAAI,KAAK5B,SAAL,CAAe8B,GAAf,CAAmBX,EAAnB,EAAuB,EAAE,GAAGS,SAAL;AAAgBxB,QAAAA,OAAO,EAAE;AAAzB,OAAvB,CAAb;AACA,WAAK4B,MAAL;AACH,KA/Ga;;AACV,SAAKhC,SAAL,GAAiB,IAAImC,GAAJ,EAAjB;AACA,SAAKxC,KAAL,GAAasC,SAAb;AACH;;AAR8B;;;;AA4H5B,MAAMG,2BAA2B,GAAG,MAAM;AAC7C,SAAO,IAAI3C,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.nodeGroup.get(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.nodeGroup.get(id)\n savedNode && this.nodeGroup.set(id, { ...savedNode, lastVisualization: undefined })\n this.update()\n }\n\n /**\n * Makes a modal appears.\n * \n * @param id \n */\n public show = (id: string) => {\n const savedNode = this.nodeGroup.get(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.nodeGroup.get(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
+ {"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","get","set","destroy","delete","undefined","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,I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AA,SA2GP2B,KA3GO,GA2GEH,EAAD,IAAgB;AAC3B,YAAMW,SAAS,GAAG,KAAK9B,SAAL,CAAe+B,GAAf,CAAmBZ,EAAnB,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,KA/Ga;;AACV,SAAKK,SAAL,GAAiB,IAAIsC,GAAJ,EAAjB;AACA,SAAK5C,KAAL,GAAayC,SAAb;AACH;;AAR8B;;;;AA4H5B,MAAMI,2BAA2B,GAAG,MAAM;AAC7C,SAAO,IAAIhD,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.nodeGroup.get(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.nodeGroup.get(id)\n savedNode && this.nodeGroup.set(id, { ...savedNode, lastVisualization: undefined })\n this.update()\n }\n\n /**\n * Makes a modal appears.\n * \n * @param id \n */\n public show = (id: string) => {\n const savedNode = this.nodeGroup.get(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.nodeGroup.get(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
- Object.defineProperty(exports, "__esModule", {
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
- Object.defineProperty(exports, key, {
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
- Object.defineProperty(exports, key, {
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
- Object.defineProperty(exports, key, {
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
- Object.defineProperty(exports, key, {
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
- Object.defineProperty(exports, key, {
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,6 @@ 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
- Object.defineProperty(exports, key, {
78
- enumerable: true,
79
- get: function () {
80
- return _useLazyModalManager[key];
81
- }
82
- });
50
+ exports[key] = _useLazyModalManager[key];
83
51
  });
84
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Modal/index.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;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'"],"file":"index.js"}
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","sourcesContent":["export * from './ModalGroupManager'\nexport * from './ModalLifecycleHandler'\nexport * from './ui/BaseModalView'\nexport * from './ui/types'\nexport * from './useModalManager'\nexport * from './useLazyModalManager'"],"file":"index.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.ModalView = void 0;
7
5
 
8
6
  var _reactCore = require("@tecsinapse/react-core");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/atoms/Modal/ui/BaseModalView.tsx"],"names":["BACKDROP_ALPHA","INTERPOLATION_STEPS","INTERPOLATION_DURATION","OPACITY_DURATION","ModalView","children","visible","BoxComponent","BoxContent","frozen","isLastShown","showCloseBar","close","onClose","bottom","ready","setReady","keyboardOpened","setKeyboardOpened","boxHeight","setBoxHeight","backgroundCarrier","Animated","Value","current","translationCarrier","opacityCarrier","offset","getKeyboardHeight","keyboard","wHeight","Math","ceil","Dimensions","get","height","sHeight","StatusBar","currentHeight","show","sequence","timing","toValue","duration","easing","Easing","out","circle","useNativeDriver","start","hide","to","parallel","backgroundInterpolation","interpolate","inputRange","outputRange","handleBoxLayoutChanges","lce","boxHeightEvent","nativeEvent","layout","setValue","requestAnimationFrame","Keyboard","dismiss","showEvent","addListener","e","endCoordinates","hideEvent","remove","undefined","backgroundColor","paddingBottom","opacity","transform","translateY"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAGA,MAAMA,cAAc,GAAG,GAAvB;AACA,MAAMC,mBAAmB,GAAG,EAA5B;AACA,MAAMC,sBAAsB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EiB,MAAAA,aAAa,EAAE/C;AAAjB,KAAvD;AAAkF,IAAA,OAAO,EAAC;AAA1F,KACKhB,YAAY,IAAI,6BAAC,gBAAD,OADrB,EAEKN,QAFL,CADJ,CALJ,CADJ,CADJ,CADJ;AAkBH,CAhIM","sourcesContent":["import { BoxContent } from \"@tecsinapse/react-core\";\nimport React, { FC, useCallback, useEffect, useRef, useState } from \"react\";\nimport { Animated, Dimensions, Easing, Keyboard, LayoutChangeEvent, Pressable, StatusBar } from \"react-native\";\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { BackDropView, CloseBar, StyledPressableBackDrop } from \"./styled\";\nimport { IBaseModal } from \"./types\";\n\nconst BACKDROP_ALPHA = .65\nconst INTERPOLATION_STEPS = 10\nconst INTERPOLATION_DURATION = 195 //ms\nconst OPACITY_DURATION = 25 //ms\n\nexport const ModalView: FC<IBaseModal> = ({\n children,\n visible,\n BoxComponent = BoxContent,\n frozen,\n isLastShown,\n showCloseBar = true,\n close,\n onClose\n}) => {\n \n const { bottom } = useSafeAreaInsets()\n const [ ready, setReady ] = useState(false)\n const [ keyboardOpened, setKeyboardOpened ] = useState(0)\n const [ boxHeight, setBoxHeight ] = useState(0)\n const backgroundCarrier = useRef(new Animated.Value(0)).current\n const translationCarrier = useRef(new Animated.Value(0)).current\n const opacityCarrier = useRef(new Animated.Value(0)).current\n const offset = isLastShown && keyboardOpened > 0 ? 0 : bottom\n\n const getKeyboardHeight = (keyboard: number) => {\n if (keyboard === 0) return 0\n \n let wHeight = Math.ceil(Dimensions.get('window').height)\n let sHeight = Math.ceil(Dimensions.get('screen').height)\n if (wHeight !== sHeight) {\n return keyboard + (sHeight - wHeight - (StatusBar.currentHeight || 0))\n }\n return keyboard\n }\n\n const show = useCallback(() => {\n Animated.sequence([\n Animated.timing(backgroundCarrier, {\n toValue: INTERPOLATION_STEPS,\n duration: INTERPOLATION_DURATION,\n easing: Easing.out(Easing.circle),\n useNativeDriver: false\n }),\n Animated.timing(opacityCarrier, {\n toValue: 1,\n duration: OPACITY_DURATION,\n useNativeDriver: true\n }),\n Animated.timing(translationCarrier, {\n toValue: 0,\n duration: INTERPOLATION_DURATION,\n easing: Easing.out(Easing.circle),\n useNativeDriver: true\n })\n ]).start()\n }, [])\n\n const hide = useCallback((to: number) => {\n Animated.sequence([\n Animated.parallel([\n Animated.timing(translationCarrier, {\n toValue: to,\n duration: INTERPOLATION_DURATION,\n easing: Easing.out(Easing.circle),\n useNativeDriver: true\n }),\n Animated.timing(opacityCarrier, {\n toValue: 0,\n duration: INTERPOLATION_DURATION,\n useNativeDriver: true\n }) \n ]),\n Animated.timing(backgroundCarrier, {\n toValue: 0,\n duration: INTERPOLATION_DURATION,\n easing: Easing.out(Easing.circle),\n useNativeDriver: false\n }),\n ]).start(onClose)\n }, [onClose])\n\n const backgroundInterpolation = backgroundCarrier.interpolate({\n inputRange: [0, INTERPOLATION_STEPS],\n outputRange: ['rgba(0, 0, 0, 0)', `rgba(0, 0, 0, ${BACKDROP_ALPHA})`]\n })\n\n const handleBoxLayoutChanges = useCallback((lce: LayoutChangeEvent) => {\n let boxHeightEvent = lce.nativeEvent.layout.height\n setBoxHeight(boxHeightEvent)\n \n if (visible && !ready) {\n translationCarrier.setValue(boxHeightEvent)\n setReady(true)\n }\n }, [show, ready, visible, setReady])\n\n useEffect(() => {\n if (visible && ready) requestAnimationFrame(() => show())\n if (!visible && !ready) {\n Keyboard.dismiss()\n requestAnimationFrame(() => hide(boxHeight))\n }\n if (!visible && ready) setReady(false)\n }, [ready, visible])\n\n useEffect(() => {\n const showEvent = Keyboard.addListener('keyboardDidShow', (e) => setKeyboardOpened(e.endCoordinates.height))\n const hideEvent = Keyboard.addListener('keyboardDidHide', () => setKeyboardOpened(0))\n return () => {\n showEvent.remove()\n hideEvent.remove()\n }\n }, [])\n\n return (\n <StyledPressableBackDrop onPress={!frozen ? close : undefined}>\n <BackDropView style={{ backgroundColor: backgroundInterpolation }}>\n <Animated.View style={{ \n paddingBottom: isLastShown ? getKeyboardHeight(keyboardOpened) : 0, \n opacity: opacityCarrier, \n transform: [{ translateY: translationCarrier }]\n }}>\n <Pressable>\n <BoxComponent onLayout={handleBoxLayoutChanges} style={{ paddingBottom: offset }} variant=\"bottom\">\n {showCloseBar && <CloseBar/>}\n {children}\n </BoxComponent>\n </Pressable>\n </Animated.View>\n </BackDropView>\n </StyledPressableBackDrop>\n )\n}"],"file":"BaseModalView.js"}
1
+ {"version":3,"sources":["../../../../../src/components/atoms/Modal/ui/BaseModalView.tsx"],"names":["BACKDROP_ALPHA","INTERPOLATION_STEPS","INTERPOLATION_DURATION","OPACITY_DURATION","ModalView","children","visible","BoxComponent","BoxContent","frozen","isLastShown","showCloseBar","close","onClose","bottom","ready","setReady","keyboardOpened","setKeyboardOpened","boxHeight","setBoxHeight","backgroundCarrier","Animated","Value","current","translationCarrier","opacityCarrier","offset","getKeyboardHeight","keyboard","wHeight","Math","ceil","Dimensions","get","height","sHeight","StatusBar","currentHeight","show","sequence","timing","toValue","duration","easing","Easing","out","circle","useNativeDriver","start","hide","to","parallel","backgroundInterpolation","interpolate","inputRange","outputRange","handleBoxLayoutChanges","lce","boxHeightEvent","nativeEvent","layout","setValue","requestAnimationFrame","Keyboard","dismiss","showEvent","addListener","e","endCoordinates","hideEvent","remove","undefined","backgroundColor","paddingBottom","opacity","transform","translateY"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAGA,MAAMA,cAAc,GAAG,GAAvB;AACA,MAAMC,mBAAmB,GAAG,EAA5B;AACA,MAAMC,sBAAsB,GAAG,GAA/B;AACA,MAAMC,gBAAgB,GAAG,EAAzB;;AAEO,MAAMC,SAAyB,GAAG,CAAC;AACtCC,EAAAA,QADsC;AAEtCC,EAAAA,OAFsC;AAGtCC,EAAAA,YAAY,GAAGC,qBAHuB;AAItCC,EAAAA,MAJsC;AAKtCC,EAAAA,WALsC;AAMtCC,EAAAA,YAAY,GAAG,IANuB;AAOtCC,EAAAA,KAPsC;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APD,EAOG,CAACD,KAAD,EAAQT,OAAR,CAPH;AASA,wBAAU,MAAM;AACZ,UAAM4D,SAAS,GAAGF,sBAASG,WAAT,CAAqB,iBAArB,EAAyCC,CAAD,IAAOlD,iBAAiB,CAACkD,CAAC,CAACC,cAAF,CAAiBlC,MAAlB,CAAhE,CAAlB;;AACA,UAAMmC,SAAS,GAAGN,sBAASG,WAAT,CAAqB,iBAArB,EAAwC,MAAMjD,iBAAiB,CAAC,CAAD,CAA/D,CAAlB;;AACA,WAAO,MAAM;AACTgD,MAAAA,SAAS,CAACK,MAAV;AACAD,MAAAA,SAAS,CAACC,MAAV;AACH,KAHD;AAIH,GAPD,EAOG,EAPH;AASA,SACI,6BAAC,+BAAD;AAAyB,IAAA,OAAO,EAAE,CAAC9D,MAAD,GAAUG,KAAV,GAAkB4D;AAApD,KACI,6BAAC,oBAAD;AAAc,IAAA,KAAK,EAAE;AAAEC,MAAAA,eAAe,EAAEpB;AAAnB;AAArB,KACI,6BAAC,qBAAD,CAAU,IAAV;AAAe,IAAA,KAAK,EAAE;AACdqB,MAAAA,aAAa,EAAEhE,WAAW,GAAGkB,iBAAiB,CAACX,cAAD,CAApB,GAAuC,CADnD;AAEd0D,MAAAA,OAAO,EAAEjD,cAFK;AAGdkD,MAAAA,SAAS,EAAE,CAAC;AAAEC,QAAAA,UAAU,EAAEpD;AAAd,OAAD;AAHG;AAAtB,KAKI,6BAAC,sBAAD,QACI,6BAAC,YAAD;AAAc,IAAA,QAAQ,EAAEgC,sBAAxB;AAAgD,IAAA,KAAK,EAAE;AAAEiB,MAAAA,aAAa,EAAE/C;AAAjB,KAAvD;AAAkF,IAAA,OAAO,EAAC;AAA1F,KACKhB,YAAY,IAAI,6BAAC,gBAAD,OADrB,EAEKN,QAFL,CADJ,CALJ,CADJ,CADJ,CADJ;AAkBH,CAhIM","sourcesContent":["import { BoxContent } from \"@tecsinapse/react-core\";\nimport React, { FC, useCallback, useEffect, useRef, useState } from \"react\";\nimport { Animated, Dimensions, Easing, Keyboard, LayoutChangeEvent, Pressable, StatusBar } from \"react-native\";\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { BackDropView, CloseBar, StyledPressableBackDrop } from \"./styled\";\nimport { IBaseModal } from \"./types\";\n\nconst BACKDROP_ALPHA = .65\nconst INTERPOLATION_STEPS = 10\nconst INTERPOLATION_DURATION = 195 //ms\nconst OPACITY_DURATION = 25 //ms\n\nexport const ModalView: FC<IBaseModal> = ({\n children,\n visible,\n BoxComponent = BoxContent,\n frozen,\n isLastShown,\n showCloseBar = true,\n close,\n onClose\n}) => {\n \n const { bottom } = useSafeAreaInsets()\n const [ ready, setReady ] = useState(false)\n const [ keyboardOpened, setKeyboardOpened ] = useState(0)\n const [ boxHeight, setBoxHeight ] = useState(0)\n const backgroundCarrier = useRef(new Animated.Value(0)).current\n const translationCarrier = useRef(new Animated.Value(0)).current\n const opacityCarrier = useRef(new Animated.Value(0)).current\n const offset = isLastShown && keyboardOpened > 0 ? 0 : bottom\n\n const getKeyboardHeight = (keyboard: number) => {\n if (keyboard === 0) return 0\n \n let wHeight = Math.ceil(Dimensions.get('window').height)\n let sHeight = Math.ceil(Dimensions.get('screen').height)\n if (wHeight !== sHeight) {\n return keyboard + (sHeight - wHeight - (StatusBar.currentHeight || 0))\n }\n return keyboard\n }\n\n const show = useCallback(() => {\n Animated.sequence([\n Animated.timing(backgroundCarrier, {\n toValue: INTERPOLATION_STEPS,\n duration: INTERPOLATION_DURATION,\n easing: Easing.out(Easing.circle),\n useNativeDriver: false\n }),\n Animated.timing(opacityCarrier, {\n toValue: 1,\n duration: OPACITY_DURATION,\n useNativeDriver: true\n }),\n Animated.timing(translationCarrier, {\n toValue: 0,\n duration: INTERPOLATION_DURATION,\n easing: Easing.out(Easing.circle),\n useNativeDriver: true\n })\n ]).start()\n }, [])\n\n const hide = useCallback((to: number) => {\n Animated.sequence([\n Animated.parallel([\n Animated.timing(translationCarrier, {\n toValue: to,\n duration: INTERPOLATION_DURATION,\n easing: Easing.out(Easing.circle),\n useNativeDriver: true\n }),\n Animated.timing(opacityCarrier, {\n toValue: 0,\n duration: INTERPOLATION_DURATION,\n useNativeDriver: true\n }) \n ]),\n Animated.timing(backgroundCarrier, {\n toValue: 0,\n duration: INTERPOLATION_DURATION,\n easing: Easing.out(Easing.circle),\n useNativeDriver: false\n }),\n ]).start(onClose)\n }, [onClose])\n\n const backgroundInterpolation = backgroundCarrier.interpolate({\n inputRange: [0, INTERPOLATION_STEPS],\n outputRange: ['rgba(0, 0, 0, 0)', `rgba(0, 0, 0, ${BACKDROP_ALPHA})`]\n })\n\n const handleBoxLayoutChanges = useCallback((lce: LayoutChangeEvent) => {\n let boxHeightEvent = lce.nativeEvent.layout.height\n setBoxHeight(boxHeightEvent)\n \n if (visible && !ready) {\n translationCarrier.setValue(boxHeightEvent)\n setReady(true)\n }\n }, [show, ready, visible, setReady])\n\n useEffect(() => {\n if (visible && ready) requestAnimationFrame(() => show())\n if (!visible && !ready) {\n Keyboard.dismiss()\n requestAnimationFrame(() => hide(boxHeight))\n }\n if (!visible && ready) setReady(false)\n }, [ready, visible])\n\n useEffect(() => {\n const showEvent = Keyboard.addListener('keyboardDidShow', (e) => setKeyboardOpened(e.endCoordinates.height))\n const hideEvent = Keyboard.addListener('keyboardDidHide', () => setKeyboardOpened(0))\n return () => {\n showEvent.remove()\n hideEvent.remove()\n }\n }, [])\n\n return (\n <StyledPressableBackDrop onPress={!frozen ? close : undefined}>\n <BackDropView style={{ backgroundColor: backgroundInterpolation }}>\n <Animated.View style={{ \n paddingBottom: isLastShown ? getKeyboardHeight(keyboardOpened) : 0, \n opacity: opacityCarrier, \n transform: [{ translateY: translationCarrier }]\n }}>\n <Pressable>\n <BoxComponent onLayout={handleBoxLayoutChanges} style={{ paddingBottom: offset }} variant=\"bottom\">\n {showCloseBar && <CloseBar/>}\n {children}\n </BoxComponent>\n </Pressable>\n </Animated.View>\n </BackDropView>\n </StyledPressableBackDrop>\n )\n}"],"file":"BaseModalView.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.CloseBar = exports.BackDropView = exports.StyledPressableBackDrop = void 0;
7
5
 
8
6
  var _native = _interopRequireDefault(require("@emotion/native"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/atoms/Modal/ui/styled.ts"],"names":["StyledPressableBackDrop","styled","Pressable","BackDropView","Animated","View","CloseBar","theme","color","secondary","light"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEO,MAAMA,uBAAuB,GAAGC,gBAAOC,SAA+B;AAC7E;AACA;AACA;AACA;AACA,CALO;;AAOA,MAAMC,YAAY,GAAG,qBAAOC,sBAASC,IAAhB,CAA2C;AACvE;AACA;AACA,CAHO;;AAKA,MAAMC,QAAQ,GAAGL,gBAAOI,IAA0B;AACzD,wBAAwB,CAAC;AAAEE,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,KAAN,CAAYC,SAAZ,CAAsBC,KAAM;AACnE,qBAAqB,2BAAW,MAAX,CAAmB;AACxC,cAAe,GAAE,2BAAW,KAAX,CAAkB,OAAO;AAC1C,aAAa,2BAAW,MAAX,CAAmB;AAChC,cAAc,2BAAW,KAAX,CAAkB;AAChC,CANO","sourcesContent":["import styled from \"@emotion/native\";\nimport { RFValueStr, StyleProps } from \"@tecsinapse/react-core\";\nimport { Animated } from \"react-native\";\n\nexport const StyledPressableBackDrop = styled.Pressable<Partial<StyleProps>>`\n flex: 1;\n position: absolute;\n width: 100%;\n height: 100%;\n`\n\nexport const BackDropView = styled(Animated.View)<Partial<StyleProps>>`\n justify-content: flex-end;\n flex: 1;\n`\n\nexport const CloseBar = styled.View<Partial<StyleProps>>`\n background-color: ${({ theme }) => theme.color.secondary.light};\n border-radius: ${RFValueStr('10px')};\n margin: ${`${RFValueStr('5px')} auto`};\n width: ${RFValueStr('42px')};\n height: ${RFValueStr('5px')};\n`"],"file":"styled.js"}
1
+ {"version":3,"sources":["../../../../../src/components/atoms/Modal/ui/styled.ts"],"names":["StyledPressableBackDrop","styled","Pressable","BackDropView","Animated","View","CloseBar","theme","color","secondary","light"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;AAEO,MAAMA,uBAAuB,GAAGC,gBAAOC,SAA+B;AAC7E;AACA;AACA;AACA;AACA,CALO;;AAOA,MAAMC,YAAY,GAAG,qBAAOC,sBAASC,IAAhB,CAA2C;AACvE;AACA;AACA,CAHO;;AAKA,MAAMC,QAAQ,GAAGL,gBAAOI,IAA0B;AACzD,wBAAwB,CAAC;AAAEE,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACC,KAAN,CAAYC,SAAZ,CAAsBC,KAAM;AACnE,qBAAqB,2BAAW,MAAX,CAAmB;AACxC,cAAe,GAAE,2BAAW,KAAX,CAAkB,OAAO;AAC1C,aAAa,2BAAW,MAAX,CAAmB;AAChC,cAAc,2BAAW,KAAX,CAAkB;AAChC,CANO","sourcesContent":["import styled from \"@emotion/native\";\nimport { RFValueStr, StyleProps } from \"@tecsinapse/react-core\";\nimport { Animated } from \"react-native\";\n\nexport const StyledPressableBackDrop = styled.Pressable<Partial<StyleProps>>`\n flex: 1;\n position: absolute;\n width: 100%;\n height: 100%;\n`\n\nexport const BackDropView = styled(Animated.View)<Partial<StyleProps>>`\n justify-content: flex-end;\n flex: 1;\n`\n\nexport const CloseBar = styled.View<Partial<StyleProps>>`\n background-color: ${({ theme }) => theme.color.secondary.light};\n border-radius: ${RFValueStr('10px')};\n margin: ${`${RFValueStr('5px')} auto`};\n width: ${RFValueStr('42px')};\n height: ${RFValueStr('5px')};\n`"],"file":"styled.js"}
@@ -1,6 +1,4 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  //# sourceMappingURL=types.js.map
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.useLazyModalManager = void 0;
7
5
 
8
6
  var _react = require("react");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Modal/useLazyModalManager.ts"],"names":["useLazyModalManager","id","requestUpdate","modalLifecycle","update","sync","modal","show","close","destroy"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAWO,MAAMA,mBAAmB,GAAG,MAAM;AAErC,QAAM,CAACC,EAAD,IAAO,qBAAS,eAAT,CAAb;AAEA,QAAMC,aAAa,GAAG,wBAAY,MAAMC,kCAAeC,MAAf,EAAlB,EAA2C,EAA3C,CAAtB;AAEA,QAAMC,IAAI,GAAG,wBAAaC,KAAD,IAAqC;AAC1DH,sCAAeE,IAAf,CAAoBJ,EAApB,EAAwB,MAAMK,KAA9B;;AACA,WAAO,IAAP;AACH,GAHY,EAGV,CAACL,EAAD,CAHU,CAAb;AAKA,QAAMM,IAAI,GAAG,wBAAY,MAAM;AAC3BJ,sCAAeI,IAAf,CAAoBN,EAApB;AACH,GAFY,EAEV,CAACA,EAAD,CAFU,CAAb;AAIA,QAAMO,KAAK,GAAG,wBAAY,MAAM;AAC5BL,sCAAeK,KAAf,CAAqBP,EAArB;AACH,GAFa,EAEX,CAACA,EAAD,CAFW,CAAd;AAIA,wBAAU,MAAM;AACZ,WAAO,MAAME,kCAAeM,OAAf,CAAuBR,EAAvB,CAAb;AACH,GAFD,EAEG,EAFH;AAIA,SAAO;AACHC,IAAAA,aADG;AAEHG,IAAAA,IAFG;AAGHE,IAAAA,IAHG;AAIHC,IAAAA;AAJG,GAAP;AAMH,CA7BM","sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from \"react\"\nimport { v4 as uuidv4 } from 'uuid'\nimport { modalLifecycle } from \"./ModalGroupManager\"\nimport { IBaseModal } from \"./ui/types\"\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component. \n * \n * @param id \n * @param modal \n * @returns\n */\nexport const useLazyModalManager = () => {\n\n const [id] = useState(uuidv4())\n\n const requestUpdate = useCallback(() => modalLifecycle.update(), [])\n\n const sync = useCallback((modal: ReactElement<IBaseModal>) => {\n modalLifecycle.sync(id, () => modal)\n return null\n }, [id])\n\n const show = useCallback(() => {\n modalLifecycle.show(id)\n }, [id])\n\n const close = useCallback(() => {\n modalLifecycle.close(id)\n }, [id])\n \n useEffect(() => {\n return () => modalLifecycle.destroy(id)\n }, [])\n\n return {\n requestUpdate,\n sync,\n show,\n close\n }\n}"],"file":"useLazyModalManager.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Modal/useLazyModalManager.ts"],"names":["useLazyModalManager","id","requestUpdate","modalLifecycle","update","sync","modal","show","close","destroy"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAWO,MAAMA,mBAAmB,GAAG,MAAM;AAErC,QAAM,CAACC,EAAD,IAAO,qBAAS,eAAT,CAAb;AAEA,QAAMC,aAAa,GAAG,wBAAY,MAAMC,kCAAeC,MAAf,EAAlB,EAA2C,EAA3C,CAAtB;AAEA,QAAMC,IAAI,GAAG,wBAAaC,KAAD,IAAqC;AAC1DH,sCAAeE,IAAf,CAAoBJ,EAApB,EAAwB,MAAMK,KAA9B;;AACA,WAAO,IAAP;AACH,GAHY,EAGV,CAACL,EAAD,CAHU,CAAb;AAKA,QAAMM,IAAI,GAAG,wBAAY,MAAM;AAC3BJ,sCAAeI,IAAf,CAAoBN,EAApB;AACH,GAFY,EAEV,CAACA,EAAD,CAFU,CAAb;AAIA,QAAMO,KAAK,GAAG,wBAAY,MAAM;AAC5BL,sCAAeK,KAAf,CAAqBP,EAArB;AACH,GAFa,EAEX,CAACA,EAAD,CAFW,CAAd;AAIA,wBAAU,MAAM;AACZ,WAAO,MAAME,kCAAeM,OAAf,CAAuBR,EAAvB,CAAb;AACH,GAFD,EAEG,EAFH;AAIA,SAAO;AACHC,IAAAA,aADG;AAEHG,IAAAA,IAFG;AAGHE,IAAAA,IAHG;AAIHC,IAAAA;AAJG,GAAP;AAMH,CA7BM","sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from \"react\"\nimport { v4 as uuidv4 } from 'uuid'\nimport { modalLifecycle } from \"./ModalGroupManager\"\nimport { IBaseModal } from \"./ui/types\"\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component. \n * \n * @param id \n * @param modal \n * @returns\n */\nexport const useLazyModalManager = () => {\n\n const [id] = useState(uuidv4())\n\n const requestUpdate = useCallback(() => modalLifecycle.update(), [])\n\n const sync = useCallback((modal: ReactElement<IBaseModal>) => {\n modalLifecycle.sync(id, () => modal)\n return null\n }, [id])\n\n const show = useCallback(() => {\n modalLifecycle.show(id)\n }, [id])\n\n const close = useCallback(() => {\n modalLifecycle.close(id)\n }, [id])\n \n useEffect(() => {\n return () => modalLifecycle.destroy(id)\n }, [])\n\n return {\n requestUpdate,\n sync,\n show,\n close\n }\n}"],"file":"useLazyModalManager.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.useModalManager = void 0;
7
5
 
8
6
  var _react = require("react");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Modal/useModalManager.ts"],"names":["useModalManager","modal","id","modalLifecycle","sync","show","close","destroy"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAWO,MAAMA,eAAe,GAAIC,KAAD,IAA2C;AAEtE,QAAM,CAACC,EAAD,IAAO,qBAAS,eAAT,CAAb;;AACAC,oCAAeC,IAAf,CAAoBF,EAApB,EAAwBD,KAAxB;;AAEA,QAAMI,IAAI,GAAG,wBAAY,MAAM;AAC3BF,sCAAeE,IAAf,CAAoBH,EAApB;AACH,GAFY,EAEV,CAACA,EAAD,CAFU,CAAb;AAIA,QAAMI,KAAK,GAAG,wBAAY,MAAM;AAC5BH,sCAAeG,KAAf,CAAqBJ,EAArB;AACH,GAFa,EAEX,CAACA,EAAD,CAFW,CAAd;AAIA,wBAAU,MAAM;AACZ,WAAO,MAAMC,kCAAeI,OAAf,CAAuBL,EAAvB,CAAb;AACH,GAFD,EAEG,EAFH;AAIA,SAAO;AACHG,IAAAA,IADG;AAEHC,IAAAA;AAFG,GAAP;AAIH,CArBM","sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from \"react\"\nimport { v4 as uuidv4 } from 'uuid'\nimport { modalLifecycle } from \"./ModalGroupManager\"\nimport { IBaseModal } from \"./ui/types\"\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component. \n * \n * @param id \n * @param modal \n * @returns\n */\nexport const useModalManager = (modal: () => ReactElement<IBaseModal>) => {\n\n const [id] = useState(uuidv4())\n modalLifecycle.sync(id, modal)\n\n const show = useCallback(() => {\n modalLifecycle.show(id)\n }, [id])\n\n const close = useCallback(() => {\n modalLifecycle.close(id)\n }, [id])\n \n useEffect(() => {\n return () => modalLifecycle.destroy(id)\n }, [])\n\n return {\n show,\n close\n }\n}"],"file":"useModalManager.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Modal/useModalManager.ts"],"names":["useModalManager","modal","id","modalLifecycle","sync","show","close","destroy"],"mappings":";;;;;AAAA;;AACA;;AACA;;AAWO,MAAMA,eAAe,GAAIC,KAAD,IAA2C;AAEtE,QAAM,CAACC,EAAD,IAAO,qBAAS,eAAT,CAAb;;AACAC,oCAAeC,IAAf,CAAoBF,EAApB,EAAwBD,KAAxB;;AAEA,QAAMI,IAAI,GAAG,wBAAY,MAAM;AAC3BF,sCAAeE,IAAf,CAAoBH,EAApB;AACH,GAFY,EAEV,CAACA,EAAD,CAFU,CAAb;AAIA,QAAMI,KAAK,GAAG,wBAAY,MAAM;AAC5BH,sCAAeG,KAAf,CAAqBJ,EAArB;AACH,GAFa,EAEX,CAACA,EAAD,CAFW,CAAd;AAIA,wBAAU,MAAM;AACZ,WAAO,MAAMC,kCAAeI,OAAf,CAAuBL,EAAvB,CAAb;AACH,GAFD,EAEG,EAFH;AAIA,SAAO;AACHG,IAAAA,IADG;AAEHC,IAAAA;AAFG,GAAP;AAIH,CArBM","sourcesContent":["import { ReactElement, useCallback, useEffect, useState } from \"react\"\nimport { v4 as uuidv4 } from 'uuid'\nimport { modalLifecycle } from \"./ModalGroupManager\"\nimport { IBaseModal } from \"./ui/types\"\n\n/**\n * Use this hook to tell the modal lifecycle handler that you want to add\n * a new modal component. \n * \n * @param id \n * @param modal \n * @returns\n */\nexport const useModalManager = (modal: () => ReactElement<IBaseModal>) => {\n\n const [id] = useState(uuidv4())\n modalLifecycle.sync(id, modal)\n\n const show = useCallback(() => {\n modalLifecycle.show(id)\n }, [id])\n\n const close = useCallback(() => {\n modalLifecycle.close(id)\n }, [id])\n \n useEffect(() => {\n return () => modalLifecycle.destroy(id)\n }, [])\n\n return {\n show,\n close\n }\n}"],"file":"useModalManager.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.Pulse = void 0;
7
5
 
8
6
  var _reactNative = require("react-native");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Pulse.tsx"],"names":["Pulse","active","width","height","childrenLayout","animatedValue","Animated","Value","current","backgroundColor","position","top","x","left","y","zIndex","overflow","opacity"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAGO,MAAMA,KAAK,GAAG,CAAC;AACpBC,EAAAA,MAAM,GAAG,IADW;AAEpBC,EAAAA,KAFoB;AAGpBC,EAAAA,MAHoB;AAIpBC,EAAAA;AAJoB,CAAD,KAKM;AACzB,QAAMC,aAAa,GAAG,mBAAO,IAAIC,sBAASC,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAApD;AAEA,wBAAU,MAAM;AACd,mCAAeP,MAAf,EAAuBI,aAAvB;AACD,GAFD,EAEG,CAACJ,MAAD,CAFH;AAIA,SACE,6BAAC,qBAAD,CAAU,IAAV;AACE,IAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAEA,KAAK,IAAIE,cAAc,CAACF,KAD1B;AAELC,MAAAA,MAAM,EAAEA,MAAM,IAAIC,cAAc,CAACD,MAF5B;AAGLM,MAAAA,eAAe,EAAE,kBAHZ;AAILC,MAAAA,QAAQ,EAAE,UAJL;AAKLC,MAAAA,GAAG,EAAEP,cAAc,CAACQ,CAAf,IAAoB,CALpB;AAMLC,MAAAA,IAAI,EAAET,cAAc,CAACU,CAAf,IAAoB,CANrB;AAOLC,MAAAA,MAAM,EAAE,CAPH;AAQLC,MAAAA,QAAQ,EAAE,QARL;AASLC,MAAAA,OAAO,EAAEZ;AATJ;AADT,IADF;AAeD,CA3BM","sourcesContent":["import { Animated } from 'react-native';\nimport React, { useEffect, useRef } from 'react';\nimport { pulseAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nexport const Pulse = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n useEffect(() => {\n pulseAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <Animated.View\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n backgroundColor: 'rgba(0,0,0,0.05)',\n position: 'absolute',\n top: childrenLayout.x ?? 0,\n left: childrenLayout.y ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n opacity: animatedValue,\n }}\n />\n );\n};\n"],"file":"Pulse.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Pulse.tsx"],"names":["Pulse","active","width","height","childrenLayout","animatedValue","Animated","Value","current","backgroundColor","position","top","x","left","y","zIndex","overflow","opacity"],"mappings":";;;;;AAAA;;AACA;;AACA;;;;;;AAGO,MAAMA,KAAK,GAAG,CAAC;AACpBC,EAAAA,MAAM,GAAG,IADW;AAEpBC,EAAAA,KAFoB;AAGpBC,EAAAA,MAHoB;AAIpBC,EAAAA;AAJoB,CAAD,KAKM;AACzB,QAAMC,aAAa,GAAG,mBAAO,IAAIC,sBAASC,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAApD;AAEA,wBAAU,MAAM;AACd,mCAAeP,MAAf,EAAuBI,aAAvB;AACD,GAFD,EAEG,CAACJ,MAAD,CAFH;AAIA,SACE,6BAAC,qBAAD,CAAU,IAAV;AACE,IAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAEA,KAAK,IAAIE,cAAc,CAACF,KAD1B;AAELC,MAAAA,MAAM,EAAEA,MAAM,IAAIC,cAAc,CAACD,MAF5B;AAGLM,MAAAA,eAAe,EAAE,kBAHZ;AAILC,MAAAA,QAAQ,EAAE,UAJL;AAKLC,MAAAA,GAAG,EAAEP,cAAc,CAACQ,CAAf,IAAoB,CALpB;AAMLC,MAAAA,IAAI,EAAET,cAAc,CAACU,CAAf,IAAoB,CANrB;AAOLC,MAAAA,MAAM,EAAE,CAPH;AAQLC,MAAAA,QAAQ,EAAE,QARL;AASLC,MAAAA,OAAO,EAAEZ;AATJ;AADT,IADF;AAeD,CA3BM","sourcesContent":["import { Animated } from 'react-native';\nimport React, { useEffect, useRef } from 'react';\nimport { pulseAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nexport const Pulse = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n useEffect(() => {\n pulseAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <Animated.View\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n backgroundColor: 'rgba(0,0,0,0.05)',\n position: 'absolute',\n top: childrenLayout.x ?? 0,\n left: childrenLayout.y ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n opacity: animatedValue,\n }}\n />\n );\n};\n"],"file":"Pulse.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
6
  var _react = _interopRequireWildcard(require("react"));
@@ -54,12 +52,12 @@ const Skeleton = ({
54
52
  width: width,
55
53
  height: height,
56
54
  childrenLayout: childrenLayout
57
- }) : _react.default.createElement(_Pulse.Pulse, {
55
+ }) : _react.default.createElement(_react.default.Fragment, null), active && animation === 'pulse' ? _react.default.createElement(_Pulse.Pulse, {
58
56
  active: active,
59
57
  width: width,
60
58
  height: height,
61
59
  childrenLayout: childrenLayout
62
- }), _react.default.createElement(_reactNative.View, {
60
+ }) : _react.default.createElement(_react.default.Fragment, null), _react.default.createElement(_reactNative.View, {
63
61
  onLayout: event => getChildrenLayout(event),
64
62
  style: {
65
63
  opacity: active ? 0 : 1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"names":["Skeleton","children","width","height","radius","active","animation","rest","childrenLayout","setChildrenLayout","y","x","Error","getChildrenLayout","event","nativeEvent","layout","opacity"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAWA,MAAMA,QAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,KAFyC;AAGzCC,EAAAA,MAHyC;AAIzCC,EAAAA,MAJyC;AAKzCC,EAAAA,MAAM,GAAG,IALgC;AAMzCC,EAAAA,SAAS,GAAG,MAN6B;AAOzC,KAAGC;AAPsC,CAAD,KAQpC;AACJ,QAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsC,qBAAyB;AACnEP,IAAAA,KAAK,EAAE,CAD4D;AAEnEC,IAAAA,MAAM,EAAE,CAF2D;AAGnEO,IAAAA,CAAC,EAAE,CAHgE;AAInEC,IAAAA,CAAC,EAAE;AAJgE,GAAzB,CAA5C;;AAOA,MAAI,CAACT,KAAD,IAAU,CAACC,MAAX,IAAqB,CAACF,QAA1B,EAAoC;AAClC,UAAM,IAAIW,KAAJ,CACJ,oEADI,CAAN;AAGD;;AAED,QAAMC,iBAAiB,GAAIC,KAAD,IAA8B;AACtDL,IAAAA,iBAAiB,CAACK,KAAK,CAACC,WAAN,CAAkBC,MAAnB,CAAjB;AACD,GAFD;;AAIA,SACE,6BAAC,eAAD;AAAS,IAAA,KAAK,EAAEd,KAAhB;AAAuB,IAAA,MAAM,EAAEC,MAA/B;AAAuC,IAAA,MAAM,EAAEC;AAA/C,KAA2DG,IAA3D,GACGF,MAAM,IAAIC,SAAS,KAAK,MAAxB,GACC,6BAAC,UAAD;AACE,IAAA,MAAM,EAAED,MADV;AAEE,IAAA,KAAK,EAAEH,KAFT;AAGE,IAAA,MAAM,EAAEC,MAHV;AAIE,IAAA,cAAc,EAAEK;AAJlB,IADD,GAQC,6BAAC,YAAD;AACE,IAAA,MAAM,EAAEH,MADV;AAEE,IAAA,KAAK,EAAEH,KAFT;AAGE,IAAA,MAAM,EAAEC,MAHV;AAIE,IAAA,cAAc,EAAEK;AAJlB,IATJ,EAgBE,6BAAC,iBAAD;AACE,IAAA,QAAQ,EAAEM,KAAK,IAAID,iBAAiB,CAACC,KAAD,CADtC;AAEE,IAAA,KAAK,EAAE;AAAEG,MAAAA,OAAO,EAAEZ,MAAM,GAAG,CAAH,GAAO;AAAxB,KAFT;AAGE,IAAA,aAAa,EAAEA,MAAM,GAAG,MAAH,GAAY;AAHnC,KAKGJ,QALH,CAhBF,CADF;AA0BD,CApDD;;eAsDeD,Q","sourcesContent":["import React, { useState } from 'react';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\nimport { LayoutChangeEvent, View, ViewProps } from 'react-native';\nimport { Wrapper } from './styled';\nimport { Wave } from './Wave';\nimport { Pulse } from './Pulse';\nimport { ChildrenLayout } from './types';\n\nexport interface SkeletonProps extends ViewProps {\n width?: number;\n height?: number;\n radius?: BorderRadiusType;\n active?: boolean;\n animation?: 'wave' | 'pulse';\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n radius,\n active = true,\n animation = 'wave',\n ...rest\n}) => {\n const [childrenLayout, setChildrenLayout] = useState<ChildrenLayout>({\n width: 0,\n height: 0,\n y: 0,\n x: 0,\n });\n\n if (!width && !height && !children) {\n throw new Error(\n '[Skeleton] You should provide children or specify width and height'\n );\n }\n\n const getChildrenLayout = (event: LayoutChangeEvent) => {\n setChildrenLayout(event.nativeEvent.layout);\n };\n\n return (\n <Wrapper width={width} height={height} radius={radius} {...rest}>\n {active && animation === 'wave' ? (\n <Wave\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <Pulse\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n )}\n <View\n onLayout={event => getChildrenLayout(event)}\n style={{ opacity: active ? 0 : 1 }}\n pointerEvents={active ? 'none' : 'auto'}\n >\n {children}\n </View>\n </Wrapper>\n );\n};\n\nexport default Skeleton;\n"],"file":"Skeleton.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Skeleton.tsx"],"names":["Skeleton","children","width","height","radius","active","animation","rest","childrenLayout","setChildrenLayout","y","x","Error","getChildrenLayout","event","nativeEvent","layout","opacity"],"mappings":";;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAWA,MAAMA,QAAiC,GAAG,CAAC;AACzCC,EAAAA,QADyC;AAEzCC,EAAAA,KAFyC;AAGzCC,EAAAA,MAHyC;AAIzCC,EAAAA,MAJyC;AAKzCC,EAAAA,MAAM,GAAG,IALgC;AAMzCC,EAAAA,SAAS,GAAG,MAN6B;AAOzC,KAAGC;AAPsC,CAAD,KAQpC;AACJ,QAAM,CAACC,cAAD,EAAiBC,iBAAjB,IAAsC,qBAAyB;AACnEP,IAAAA,KAAK,EAAE,CAD4D;AAEnEC,IAAAA,MAAM,EAAE,CAF2D;AAGnEO,IAAAA,CAAC,EAAE,CAHgE;AAInEC,IAAAA,CAAC,EAAE;AAJgE,GAAzB,CAA5C;;AAOA,MAAI,CAACT,KAAD,IAAU,CAACC,MAAX,IAAqB,CAACF,QAA1B,EAAoC;AAClC,UAAM,IAAIW,KAAJ,CACJ,oEADI,CAAN;AAGD;;AAED,QAAMC,iBAAiB,GAAIC,KAAD,IAA8B;AACtDL,IAAAA,iBAAiB,CAACK,KAAK,CAACC,WAAN,CAAkBC,MAAnB,CAAjB;AACD,GAFD;;AAIA,SACE,6BAAC,eAAD;AAAS,IAAA,KAAK,EAAEd,KAAhB;AAAuB,IAAA,MAAM,EAAEC,MAA/B;AAAuC,IAAA,MAAM,EAAEC;AAA/C,KAA2DG,IAA3D,GACGF,MAAM,IAAIC,SAAS,KAAK,MAAxB,GACC,6BAAC,UAAD;AACE,IAAA,MAAM,EAAED,MADV;AAEE,IAAA,KAAK,EAAEH,KAFT;AAGE,IAAA,MAAM,EAAEC,MAHV;AAIE,IAAA,cAAc,EAAEK;AAJlB,IADD,GAQC,2DATJ,EAYGH,MAAM,IAAIC,SAAS,KAAK,OAAxB,GACC,6BAAC,YAAD;AACE,IAAA,MAAM,EAAED,MADV;AAEE,IAAA,KAAK,EAAEH,KAFT;AAGE,IAAA,MAAM,EAAEC,MAHV;AAIE,IAAA,cAAc,EAAEK;AAJlB,IADD,GAQC,2DApBJ,EAsBE,6BAAC,iBAAD;AACE,IAAA,QAAQ,EAAEM,KAAK,IAAID,iBAAiB,CAACC,KAAD,CADtC;AAEE,IAAA,KAAK,EAAE;AAAEG,MAAAA,OAAO,EAAEZ,MAAM,GAAG,CAAH,GAAO;AAAxB,KAFT;AAGE,IAAA,aAAa,EAAEA,MAAM,GAAG,MAAH,GAAY;AAHnC,KAKGJ,QALH,CAtBF,CADF;AAgCD,CA1DD;;eA4DeD,Q","sourcesContent":["import React, { useState } from 'react';\nimport { BorderRadiusType } from '@tecsinapse/react-core';\nimport { LayoutChangeEvent, View, ViewProps } from 'react-native';\nimport { Wrapper } from './styled';\nimport { Wave } from './Wave';\nimport { Pulse } from './Pulse';\nimport { ChildrenLayout } from './types';\n\nexport interface SkeletonProps extends ViewProps {\n width?: number;\n height?: number;\n radius?: BorderRadiusType;\n active?: boolean;\n animation?: 'wave' | 'pulse';\n}\n\nconst Skeleton: React.FC<SkeletonProps> = ({\n children,\n width,\n height,\n radius,\n active = true,\n animation = 'wave',\n ...rest\n}) => {\n const [childrenLayout, setChildrenLayout] = useState<ChildrenLayout>({\n width: 0,\n height: 0,\n y: 0,\n x: 0,\n });\n\n if (!width && !height && !children) {\n throw new Error(\n '[Skeleton] You should provide children or specify width and height'\n );\n }\n\n const getChildrenLayout = (event: LayoutChangeEvent) => {\n setChildrenLayout(event.nativeEvent.layout);\n };\n\n return (\n <Wrapper width={width} height={height} radius={radius} {...rest}>\n {active && animation === 'wave' ? (\n <Wave\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n\n {active && animation === 'pulse' ? (\n <Pulse\n active={active}\n width={width}\n height={height}\n childrenLayout={childrenLayout}\n />\n ) : (\n <></>\n )}\n <View\n onLayout={event => getChildrenLayout(event)}\n style={{ opacity: active ? 0 : 1 }}\n pointerEvents={active ? 'none' : 'auto'}\n >\n {children}\n </View>\n </Wrapper>\n );\n};\n\nexport default Skeleton;\n"],"file":"Skeleton.js"}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ exports.__esModule = true;
6
4
  exports.Wave = void 0;
7
5
 
8
6
  var _react = _interopRequireWildcard(require("react"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Wave.tsx"],"names":["AnimatedLinearGradient","Animated","createAnimatedComponent","LinearGradient","Wave","active","width","height","childrenLayout","range","animatedValue","Value","current","translateX","interpolate","inputRange","outputRange","x","y","position","top","left","zIndex","overflow","transform"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,sBAAsB,GAAGC,sBAASC,uBAAT,CAAiCC,kCAAjC,CAA/B;;AAEO,MAAMC,IAAI,GAAG,CAAC;AACnBC,EAAAA,MAAM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S;AARN;AATT,IADF;AA0BD,CA5CM","sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Animated } from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport { waveAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nconst AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);\n\nexport const Wave = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const range = width ?? childrenLayout.width;\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n const translateX = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [-range, range],\n });\n\n useEffect(() => {\n waveAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <AnimatedLinearGradient\n colors={[\n 'transparent',\n 'rgba(0,0,0,0.05)',\n 'rgba(0,0,0,0.1)',\n 'transparent',\n ]}\n start={{ x: 0, y: 0 }}\n end={{ x: 1, y: 0 }}\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n position: 'absolute',\n top: childrenLayout.y ?? 0,\n left: childrenLayout.x ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n transform: [\n {\n translateX: translateX,\n },\n ],\n }}\n />\n );\n};\n"],"file":"Wave.js"}
1
+ {"version":3,"sources":["../../../../src/components/atoms/Skeleton/Wave.tsx"],"names":["AnimatedLinearGradient","Animated","createAnimatedComponent","LinearGradient","Wave","active","width","height","childrenLayout","range","animatedValue","Value","current","translateX","interpolate","inputRange","outputRange","x","y","position","top","left","zIndex","overflow","transform"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAGA,MAAMA,sBAAsB,GAAGC,sBAASC,uBAAT,CAAiCC,kCAAjC,CAA/B;;AAEO,MAAMC,IAAI,GAAG,CAAC;AACnBC,EAAAA,MAAM,GAAG,IADU;AAEnBC,EAAAA,KAFmB;AAGnBC,EAAAA,MAHmB;AAInBC,EAAAA;AAJmB,CAAD,KAKO;AACzB,QAAMC,KAAK,GAAGH,KAAK,IAAIE,cAAc,CAACF,KAAtC;AACA,QAAMI,aAAa,GAAG,mBAAO,IAAIT,sBAASU,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAApD;AAEA,QAAMC,UAAU,GAAGH,aAAa,CAACI,WAAd,CAA0B;AAC3CC,IAAAA,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CAD+B;AAE3CC,IAAAA,WAAW,EAAE,CAAC,CAACP,KAAF,EAASA,KAAT;AAF8B,GAA1B,CAAnB;AAKA,wBAAU,MAAM;AACd,kCAAcJ,MAAd,EAAsBK,aAAtB;AACD,GAFD,EAEG,CAACL,MAAD,CAFH;AAIA,SACE,6BAAC,sBAAD;AACE,IAAA,MAAM,EAAE,CACN,aADM,EAEN,kBAFM,EAGN,iBAHM,EAIN,aAJM,CADV;AAOE,IAAA,KAAK,EAAE;AAAEY,MAAAA,CAAC,EAAE,CAAL;AAAQC,MAAAA,CAAC,EAAE;AAAX,KAPT;AAQE,IAAA,GAAG,EAAE;AAAED,MAAAA,CAAC,EAAE,CAAL;AAAQC,MAAAA,CAAC,EAAE;AAAX,KARP;AASE,IAAA,KAAK,EAAE;AACLZ,MAAAA,KAAK,EAAEA,KAAK,IAAIE,cAAc,CAACF,KAD1B;AAELC,MAAAA,MAAM,EAAEA,MAAM,IAAIC,cAAc,CAACD,MAF5B;AAGLY,MAAAA,QAAQ,EAAE,UAHL;AAILC,MAAAA,GAAG,EAAEZ,cAAc,CAACU,CAAf,IAAoB,CAJpB;AAKLG,MAAAA,IAAI,EAAEb,cAAc,CAACS,CAAf,IAAoB,CALrB;AAMLK,MAAAA,MAAM,EAAE,CANH;AAOLC,MAAAA,QAAQ,EAAE,QAPL;AAQLC,MAAAA,SAAS,EAAE,CACT;AACEX,QAAAA,UAAU,EAAEA;AADd,OADS;AARN;AATT,IADF;AA0BD,CA5CM","sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Animated } from 'react-native';\nimport LinearGradient from 'react-native-linear-gradient';\nimport { waveAnimation } from './animation';\nimport { IAnimationComponent } from './types';\n\nconst AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);\n\nexport const Wave = ({\n active = true,\n width,\n height,\n childrenLayout,\n}: IAnimationComponent) => {\n const range = width ?? childrenLayout.width;\n const animatedValue = useRef(new Animated.Value(0)).current;\n\n const translateX = animatedValue.interpolate({\n inputRange: [0, 1],\n outputRange: [-range, range],\n });\n\n useEffect(() => {\n waveAnimation(active, animatedValue);\n }, [active]);\n\n return (\n <AnimatedLinearGradient\n colors={[\n 'transparent',\n 'rgba(0,0,0,0.05)',\n 'rgba(0,0,0,0.1)',\n 'transparent',\n ]}\n start={{ x: 0, y: 0 }}\n end={{ x: 1, y: 0 }}\n style={{\n width: width ?? childrenLayout.width,\n height: height ?? childrenLayout.height,\n position: 'absolute',\n top: childrenLayout.y ?? 0,\n left: childrenLayout.x ?? 0,\n zIndex: 2,\n overflow: 'hidden',\n transform: [\n {\n translateX: translateX,\n },\n ],\n }}\n />\n );\n};\n"],"file":"Wave.js"}