@tecsinapse/react-core 1.12.7 → 1.13.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 +35 -0
- package/dist/components/atoms/Input/hooks/useCurrencyMask.js +2 -2
- package/dist/components/atoms/Input/hooks/useCurrencyMask.js.map +1 -1
- package/dist/components/atoms/Input/hooks/useMask.js +2 -2
- package/dist/components/atoms/Input/hooks/useMask.js.map +1 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/atoms/ProgressBar/ProgressBar.js +6 -6
- package/dist/components/atoms/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/molecules/Calendar/components/MonthWeek.js +5 -10
- package/dist/components/molecules/Calendar/components/MonthWeek.js.map +1 -1
- package/dist/components/molecules/Calendar/index.d.ts +1 -1
- package/dist/components/molecules/Calendar/index.js +6 -0
- package/dist/components/molecules/Calendar/index.js.map +1 -1
- package/dist/components/molecules/Calendar/styled.js +0 -17
- package/dist/components/molecules/Calendar/styled.js.map +1 -1
- package/dist/components/molecules/DatePicker/DatePicker.d.ts +6 -5
- package/dist/components/molecules/DatePicker/DatePicker.js +22 -32
- package/dist/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/molecules/DatePicker/styled.d.ts +0 -14
- package/dist/components/molecules/DatePicker/styled.js +1 -46
- package/dist/components/molecules/DatePicker/styled.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/DateTimePicker.d.ts +5 -4
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js +35 -37
- package/dist/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/molecules/DateTimePicker/styled.d.ts +0 -21
- package/dist/components/molecules/DateTimePicker/styled.js +3 -51
- package/dist/components/molecules/DateTimePicker/styled.js.map +1 -1
- package/dist/components/molecules/Grid/Item/Item.d.ts +1 -1
- package/dist/components/molecules/Grid/Item/Item.js +7 -5
- package/dist/components/molecules/Grid/Item/Item.js.map +1 -1
- package/dist/components/molecules/HintInputContainer/HintInputContainer.d.ts +3 -2
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js +4 -4
- package/dist/components/molecules/HintInputContainer/HintInputContainer.js.map +1 -1
- package/dist/components/molecules/TextArea/TextArea.d.ts +3 -1
- package/dist/components/molecules/TextArea/TextArea.js +4 -4
- package/dist/components/molecules/TextArea/TextArea.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/ResponsiveFontSize.js +1 -1
- package/dist/utils/ResponsiveFontSize.js.map +1 -1
- package/dist/utils/extractNumbersFromString.js +1 -1
- package/dist/utils/extractNumbersFromString.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/Input/hooks/useCurrencyMask.ts +2 -2
- package/src/components/atoms/Input/hooks/useMask.ts +1 -1
- package/src/components/atoms/ProgressBar/ProgressBar.tsx +5 -5
- package/src/components/molecules/Calendar/components/MonthWeek.tsx +5 -10
- package/src/components/molecules/Calendar/index.ts +1 -0
- package/src/components/molecules/Calendar/styled.ts +0 -22
- package/src/components/molecules/DatePicker/DatePicker.tsx +32 -41
- package/src/components/molecules/DatePicker/styled.ts +0 -40
- package/src/components/molecules/DateTimePicker/DateTimePicker.tsx +46 -52
- package/src/components/molecules/DateTimePicker/styled.ts +1 -49
- package/src/components/molecules/Grid/Item/Item.tsx +3 -5
- package/src/components/molecules/HintInputContainer/HintInputContainer.tsx +3 -8
- package/src/components/molecules/TextArea/TextArea.tsx +3 -9
- package/src/index.ts +1 -0
- package/src/utils/ResponsiveFontSize.ts +2 -2
- package/src/utils/extractNumbersFromString.ts +4 -5
- package/dist/components/molecules/DatePicker/Modal.d.ts +0 -8
- package/dist/components/molecules/DatePicker/Modal.js +0 -60
- package/dist/components/molecules/DatePicker/Modal.js.map +0 -1
- package/dist/components/molecules/DateTimePicker/Modal.d.ts +0 -7
- package/dist/components/molecules/DateTimePicker/Modal.js +0 -89
- package/dist/components/molecules/DateTimePicker/Modal.js.map +0 -1
- package/src/components/molecules/DatePicker/DatePicker.stories.tsx +0 -44
- package/src/components/molecules/DatePicker/Modal.tsx +0 -51
- package/src/components/molecules/DateTimePicker/DateTimePicker.stories.tsx +0 -26
- package/src/components/molecules/DateTimePicker/Modal.tsx +0 -84
|
@@ -3,63 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.CalendarIcon = exports.getStyledTextComponent =
|
|
6
|
+
exports.CalendarIcon = exports.getStyledTextComponent = void 0;
|
|
7
7
|
|
|
8
8
|
var _native = _interopRequireWildcard(require("@emotion/native"));
|
|
9
9
|
|
|
10
|
-
var _reactNative = require("react-native");
|
|
11
|
-
|
|
12
|
-
var _definitions = require("../../../styles/definitions");
|
|
13
|
-
|
|
14
|
-
var _utils = require("../../../utils");
|
|
15
|
-
|
|
16
10
|
var _Icon = require("../../atoms/Icon");
|
|
17
11
|
|
|
18
12
|
var _Input = require("../../atoms/Input");
|
|
19
13
|
|
|
20
|
-
var _PressableSurface = require("../../atoms/PressableSurface");
|
|
21
|
-
|
|
22
14
|
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); }
|
|
23
15
|
|
|
24
16
|
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; }
|
|
25
17
|
|
|
26
|
-
const isWeb = _reactNative.Platform.OS === 'web';
|
|
27
|
-
const Backdrop = (0, _native.default)(_PressableSurface.PressableSurface)`
|
|
28
|
-
${({
|
|
29
|
-
theme
|
|
30
|
-
}) => isWeb ? (0, _native.css)`
|
|
31
|
-
justify-content: center;
|
|
32
|
-
align-items: center;
|
|
33
|
-
background-color: ${(0, _definitions.hex2rgba)(theme.miscellaneous.overlay, 0.5)};
|
|
34
|
-
height: 100vh;
|
|
35
|
-
` : (0, _native.css)`
|
|
36
|
-
justify-content: flex-end;
|
|
37
|
-
background-color: ${(0, _definitions.hex2rgba)(theme.miscellaneous.overlay, 0.5)};
|
|
38
|
-
height: 100%;
|
|
39
|
-
`}
|
|
40
|
-
`;
|
|
41
|
-
exports.Backdrop = Backdrop;
|
|
42
|
-
const ModalContent = _native.default.View`
|
|
43
|
-
background-color: transparent;
|
|
44
|
-
padding-bottom: ${({
|
|
45
|
-
offset
|
|
46
|
-
}) => `${(0, _utils.RFValue)(offset)}px`};
|
|
47
|
-
${({
|
|
48
|
-
theme: {
|
|
49
|
-
borderRadius
|
|
50
|
-
}
|
|
51
|
-
}) => (0, _native.css)`
|
|
52
|
-
${isWeb ? `
|
|
53
|
-
border-radius: ${borderRadius.micro};
|
|
54
|
-
` : `
|
|
55
|
-
border-top-left-radius: ${borderRadius.deca};
|
|
56
|
-
border-top-right-radius: ${borderRadius.deca};
|
|
57
|
-
`}
|
|
58
|
-
`}
|
|
59
|
-
overflow: hidden;
|
|
60
|
-
`;
|
|
61
|
-
exports.ModalContent = ModalContent;
|
|
62
|
-
|
|
63
18
|
const getStyledTextComponent = component => {
|
|
64
19
|
return (0, _native.default)(component)(props => {
|
|
65
20
|
var _props$theme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/DatePicker/styled.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/DatePicker/styled.ts"],"names":["getStyledTextComponent","component","props","theme","typography","h5","lineHeight","CalendarIcon","Icon","spacing","centi","color","secondary","medium"],"mappings":";;;;;;;AAAA;;AAGA;;AACA;;;;;;AAGO,MAAMA,sBAAsB,GAAIC,SAAD,IAA8B;AAClE,SAAO,qBAAOA,SAAP,EACJC,KAAD;AAAA;;AAAA,WAA+D,gBAAI;AACvE,qBADsE,gBACjDA,KAAK,CAACC,KAD2C,iDACjD,aAAaC,UAAb,CAAwBC,EAAxB,CAA2BC,UAAW;AAC3D,QAAQ,gCAAoBJ,KAApB,CAA2B;AACnC,KAHI;AAAA,GADK,CAAP;AAMD,CAPM;;;AASA,MAAMK,YAAY,GAAG,qBAAOC,UAAP,CAAkC;AAC9D,aAAa,CAAC;AAAEL,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACM,OAAN,CAAcC,KAAM;AAChD,WAAW,CAAC;AAAEP,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACQ,KAAN,CAAYC,SAAZ,CAAsBC,MAAO;AACvD,CAHO","sourcesContent":["import styled, { css } from '@emotion/native';\nimport { FC } from 'react';\nimport { StyleProps } from '../../../types/defaults';\nimport { Icon } from '../../atoms/Icon';\nimport { disabledInputStyles, InputContainerProps } from '../../atoms/Input';\nimport { TextProps } from '../../atoms/Text';\n\nexport const getStyledTextComponent = (component: FC<TextProps>) => {\n return styled(component)(\n (props: Partial<InputContainerProps> & Partial<StyleProps>) => css`\n line-height: ${props.theme?.typography.h5.lineHeight};\n ${disabledInputStyles(props)}\n `\n );\n};\n\nexport const CalendarIcon = styled(Icon)<Partial<StyleProps>>`\n padding: ${({ theme }) => theme.spacing.centi};\n color: ${({ theme }) => theme.color.secondary.medium};\n`;\n"],"file":"styled.js"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ModalBaseProps } from 'react-native';
|
|
3
2
|
import { InputContainerProps } from '../../atoms/Input';
|
|
4
3
|
import { TextProps } from '../../atoms/Text';
|
|
5
4
|
import { DateTimeSelectorProps } from '../DateTimeSelector';
|
|
6
|
-
|
|
7
|
-
export interface DateTimePickerProps extends InputContainerProps, DateTimePickerModalProps, Omit<DateTimeSelectorProps, 'style'> {
|
|
5
|
+
export interface DateTimePickerProps extends InputContainerProps, Omit<DateTimeSelectorProps, 'style'> {
|
|
8
6
|
controlComponent?: (onPress: () => void, displayValue?: string) => JSX.Element;
|
|
9
7
|
TextComponent?: React.FC<TextProps>;
|
|
10
|
-
|
|
8
|
+
DateTimeSelectorComponent: React.FC<DateTimeSelectorProps>;
|
|
11
9
|
placeholder?: string;
|
|
12
10
|
onFocus?: () => void | never;
|
|
13
11
|
onBlur?: () => void | never;
|
|
12
|
+
renderSelector: (selector: React.ReactElement, blur?: () => void) => JSX.Element | null;
|
|
13
|
+
requestShowSelector: () => void;
|
|
14
|
+
requestCloseSelector: () => void;
|
|
14
15
|
}
|
|
15
16
|
declare const DateTimePicker: React.FC<DateTimePickerProps>;
|
|
16
17
|
export default DateTimePicker;
|
|
@@ -15,10 +15,12 @@ var _Text = require("../../atoms/Text");
|
|
|
15
15
|
|
|
16
16
|
var _styled = require("../DatePicker/styled");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _DateTimeSelector = require("../DateTimeSelector");
|
|
19
19
|
|
|
20
20
|
var _HintInputContainer = require("../HintInputContainer");
|
|
21
21
|
|
|
22
|
+
var _styled2 = require("./styled");
|
|
23
|
+
|
|
22
24
|
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); }
|
|
23
25
|
|
|
24
26
|
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; }
|
|
@@ -54,11 +56,12 @@ const DateTimePicker = ({
|
|
|
54
56
|
hint,
|
|
55
57
|
variant = 'default',
|
|
56
58
|
TextComponent = _Text.Text,
|
|
57
|
-
DateTimeSelectorComponent,
|
|
58
|
-
bottomOffset,
|
|
59
|
+
DateTimeSelectorComponent = _DateTimeSelector.DateTimeSelector,
|
|
59
60
|
rightComponent,
|
|
60
|
-
animationType = 'fade',
|
|
61
61
|
style,
|
|
62
|
+
renderSelector,
|
|
63
|
+
requestShowSelector,
|
|
64
|
+
requestCloseSelector,
|
|
62
65
|
...rest
|
|
63
66
|
}) => {
|
|
64
67
|
const {
|
|
@@ -66,47 +69,23 @@ const DateTimePicker = ({
|
|
|
66
69
|
handleBlur,
|
|
67
70
|
handleFocus
|
|
68
71
|
} = (0, _Input.useInputFocus)(onFocus, onBlur, !disabled);
|
|
69
|
-
const [modalVisible, setModalVisible] = React.useState(false);
|
|
70
72
|
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
+
const handleShowSelector = () => {
|
|
74
|
+
requestShowSelector();
|
|
73
75
|
handleFocus();
|
|
74
76
|
};
|
|
75
77
|
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
const handleChoosing = value => {
|
|
79
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
80
|
+
requestCloseSelector();
|
|
79
81
|
};
|
|
80
82
|
|
|
81
83
|
const StyledText = (0, _styled.getStyledTextComponent)(TextComponent);
|
|
82
84
|
const displayValue = (value ? (0, _dateFns.format)(value, format, {
|
|
83
85
|
locale: locale
|
|
84
86
|
}) : placeholder) || ' ';
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
viewStyle: style,
|
|
88
|
-
onPress: handlePressInput,
|
|
89
|
-
disabled: disabled,
|
|
90
|
-
LabelComponent: TextComponent,
|
|
91
|
-
variant: variant,
|
|
92
|
-
hint: hint,
|
|
93
|
-
hintComponent: hintComponent,
|
|
94
|
-
rightComponent: React.createElement(React.Fragment, null, React.createElement(_styled.CalendarIcon, {
|
|
95
|
-
name: "calendar-sharp",
|
|
96
|
-
type: "ionicon",
|
|
97
|
-
size: "centi"
|
|
98
|
-
}), rightComponent)
|
|
99
|
-
}, rest), React.createElement(StyledText, {
|
|
100
|
-
fontWeight: "bold",
|
|
101
|
-
disabled: disabled
|
|
102
|
-
}, displayValue)), React.createElement(_Modal.Modal, {
|
|
103
|
-
DateTimeSelectorComponent: DateTimeSelectorComponent,
|
|
104
|
-
bottomOffset: bottomOffset,
|
|
105
|
-
visible: modalVisible,
|
|
106
|
-
onRequestClose: handleCloseModal,
|
|
107
|
-
animated: true,
|
|
108
|
-
animationType: animationType,
|
|
109
|
-
onChange: onChange,
|
|
87
|
+
const StyledDateTimeSelector = (0, _styled2.getStyledDateTimeSelector)(DateTimeSelectorComponent);
|
|
88
|
+
const dateTimeSelector = React.createElement(StyledDateTimeSelector, {
|
|
110
89
|
value: value,
|
|
111
90
|
mode: mode,
|
|
112
91
|
format: format,
|
|
@@ -124,8 +103,27 @@ const DateTimePicker = ({
|
|
|
124
103
|
monthLabel: monthLabel,
|
|
125
104
|
yearLabel: yearLabel,
|
|
126
105
|
hourLabel: hourLabel,
|
|
127
|
-
minuteLabel: minuteLabel
|
|
128
|
-
|
|
106
|
+
minuteLabel: minuteLabel,
|
|
107
|
+
onChange: handleChoosing
|
|
108
|
+
});
|
|
109
|
+
return React.createElement(React.Fragment, null, controlComponent ? controlComponent(handleShowSelector, displayValue) : React.createElement(_HintInputContainer.HintInputContainer, _extends({
|
|
110
|
+
focused: focused,
|
|
111
|
+
viewStyle: style,
|
|
112
|
+
onPress: handleShowSelector,
|
|
113
|
+
disabled: disabled,
|
|
114
|
+
LabelComponent: TextComponent,
|
|
115
|
+
variant: variant,
|
|
116
|
+
hint: hint,
|
|
117
|
+
hintComponent: hintComponent,
|
|
118
|
+
rightComponent: React.createElement(React.Fragment, null, React.createElement(_styled.CalendarIcon, {
|
|
119
|
+
name: "calendar-sharp",
|
|
120
|
+
type: "ionicon",
|
|
121
|
+
size: "centi"
|
|
122
|
+
}), rightComponent)
|
|
123
|
+
}, rest), React.createElement(StyledText, {
|
|
124
|
+
fontWeight: "bold",
|
|
125
|
+
disabled: disabled
|
|
126
|
+
}, displayValue)), renderSelector(dateTimeSelector, handleBlur));
|
|
129
127
|
};
|
|
130
128
|
|
|
131
129
|
var _default = DateTimePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/DateTimePicker/DateTimePicker.tsx"],"names":["DateTimePicker","onChange","value","mode","format","locale","upperDateThreshold","lowerDateThreshold","offsetThreshold","upperOffsetThreshold","lowerOffsetThreshold","dateModalTitle","timeModalTitle","dateConfirmButtonText","timeConfirmButtonText","dayLabel","monthLabel","yearLabel","hourLabel","minuteLabel","placeholder","onFocus","onBlur","disabled","controlComponent","hintComponent","hint","variant","TextComponent","Text","DateTimeSelectorComponent","
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/DateTimePicker/DateTimePicker.tsx"],"names":["DateTimePicker","onChange","value","mode","format","locale","upperDateThreshold","lowerDateThreshold","offsetThreshold","upperOffsetThreshold","lowerOffsetThreshold","dateModalTitle","timeModalTitle","dateConfirmButtonText","timeConfirmButtonText","dayLabel","monthLabel","yearLabel","hourLabel","minuteLabel","placeholder","onFocus","onBlur","disabled","controlComponent","hintComponent","hint","variant","TextComponent","Text","DateTimeSelectorComponent","DateTimeSelector","rightComponent","style","renderSelector","requestShowSelector","requestCloseSelector","rest","focused","handleBlur","handleFocus","handleShowSelector","handleChoosing","StyledText","displayValue","StyledDateTimeSelector","dateTimeSelector"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAiBA,MAAMA,cAA6C,GAAG,CAAC;AACrDC,EAAAA,QADqD;AAErDC,EAAAA,KAFqD;AAGrDC,EAAAA,IAAI,GAAG,MAH8C;AAIrDC,EAAAA,MAAM,GAAG,qBAJ4C;AAKrDC,EAAAA,MALqD;AAMrDC,EAAAA,kBANqD;AAOrDC,EAAAA,kBAPqD;AAQrDC,EAAAA,eARqD;AASrDC,EAAAA,oBATqD;AAUrDC,EAAAA,oBAVqD;AAWrDC,EAAAA,cAXqD;AAYrDC,EAAAA,cAZqD;AAarDC,EAAAA,qBAbqD;AAcrDC,EAAAA,qBAdqD;AAerDC,EAAAA,QAfqD;AAgBrDC,EAAAA,UAhBqD;AAiBrDC,EAAAA,SAjBqD;AAkBrDC,EAAAA,SAlBqD;AAmBrDC,EAAAA,WAnBqD;AAoBrDC,EAAAA,WApBqD;AAqBrDC,EAAAA,OArBqD;AAsBrDC,EAAAA,MAtBqD;AAuBrDC,EAAAA,QAvBqD;AAwBrDC,EAAAA,gBAxBqD;AAyBrDC,EAAAA,aAzBqD;AA0BrDC,EAAAA,IA1BqD;AA2BrDC,EAAAA,OAAO,GAAG,SA3B2C;AA4BrDC,EAAAA,aAAa,GAAGC,UA5BqC;AA6BrDC,EAAAA,yBAAyB,GAAGC,kCA7ByB;AA8BrDC,EAAAA,cA9BqD;AA+BrDC,EAAAA,KA/BqD;AAgCrDC,EAAAA,cAhCqD;AAiCrDC,EAAAA,mBAjCqD;AAkCrDC,EAAAA,oBAlCqD;AAmCrD,KAAGC;AAnCkD,CAAD,KAoChD;AAEJ,QAAM;AAAEC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,EAAEC,SAjBb;AAkBE,IAAA,WAAW,EAAEC,WAlBf;AAmBE,IAAA,QAAQ,EAAEuB;AAnBZ,IADF;AAwBA,SACE,0CACGlB,gBAAgB,GACfA,gBAAgB,CAACiB,kBAAD,EAAqBG,YAArB,CADD,GAGf,oBAAC,sCAAD;AACE,IAAA,OAAO,EAAEN,OADX;AAEE,IAAA,SAAS,EAAEL,KAFb;AAGE,IAAA,OAAO,EAAEQ,kBAHX;AAIE,IAAA,QAAQ,EAAElB,QAJZ;AAKE,IAAA,cAAc,EAAEK,aALlB;AAME,IAAA,OAAO,EAAED,OANX;AAOE,IAAA,IAAI,EAAED,IAPR;AAQE,IAAA,aAAa,EAAED,aARjB;AASE,IAAA,cAAc,EACZ,0CACE,oBAAC,oBAAD;AAAc,MAAA,IAAI,EAAC,gBAAnB;AAAoC,MAAA,IAAI,EAAC,SAAzC;AAAmD,MAAA,IAAI,EAAC;AAAxD,MADF,EAEGO,cAFH;AAVJ,KAeMK,IAfN,GAiBE,oBAAC,UAAD;AAAY,IAAA,UAAU,EAAC,MAAvB;AAA8B,IAAA,QAAQ,EAAEd;AAAxC,KACGqB,YADH,CAjBF,CAJJ,EA0BGV,cAAc,CAACY,gBAAD,EAAmBP,UAAnB,CA1BjB,CADF;AA8BD,CAhHD;;eAkHevC,c","sourcesContent":["import { format as formatDate } from 'date-fns';\nimport * as React from 'react';\nimport { InputContainerProps, useInputFocus } from '../../atoms/Input';\nimport { Text, TextProps } from '../../atoms/Text';\nimport { CalendarIcon, getStyledTextComponent } from '../DatePicker/styled';\nimport { DateTimeSelector, DateTimeSelectorProps } from '../DateTimeSelector';\nimport { HintInputContainer } from '../HintInputContainer';\nimport { getStyledDateTimeSelector } from './styled';\n\nexport interface DateTimePickerProps extends InputContainerProps, Omit<DateTimeSelectorProps, 'style'> {\n controlComponent?: (\n onPress: () => void,\n displayValue?: string\n ) => JSX.Element;\n TextComponent?: React.FC<TextProps>;\n DateTimeSelectorComponent: React.FC<DateTimeSelectorProps>;\n placeholder?: string;\n onFocus?: () => void | never;\n onBlur?: () => void | never;\n renderSelector: (selector: React.ReactElement, blur?: () => void) => JSX.Element|null\n requestShowSelector: () => void\n requestCloseSelector: () => void\n}\n\nconst DateTimePicker: React.FC<DateTimePickerProps> = ({\n onChange,\n value,\n mode = 'date',\n format = 'yyyy-MM-dd hh:mm:ss',\n locale,\n upperDateThreshold,\n lowerDateThreshold,\n offsetThreshold,\n upperOffsetThreshold,\n lowerOffsetThreshold,\n dateModalTitle,\n timeModalTitle,\n dateConfirmButtonText,\n timeConfirmButtonText,\n dayLabel,\n monthLabel,\n yearLabel,\n hourLabel,\n minuteLabel,\n placeholder,\n onFocus,\n onBlur,\n disabled,\n controlComponent,\n hintComponent,\n hint,\n variant = 'default',\n TextComponent = Text,\n DateTimeSelectorComponent = DateTimeSelector,\n rightComponent,\n style,\n renderSelector,\n requestShowSelector,\n requestCloseSelector,\n ...rest\n}) => {\n \n const { focused, handleBlur, handleFocus } = useInputFocus(\n onFocus,\n onBlur,\n !disabled\n );\n\n const handleShowSelector = () => {\n requestShowSelector()\n handleFocus();\n };\n\n const handleChoosing = (value: Date) => {\n onChange?.(value)\n requestCloseSelector()\n };\n\n const StyledText = getStyledTextComponent(TextComponent);\n const displayValue = (value ? formatDate(value, format, { locale: locale }) : placeholder) || ' ';\n const StyledDateTimeSelector = getStyledDateTimeSelector(DateTimeSelectorComponent)\n\n const dateTimeSelector = (\n <StyledDateTimeSelector\n value={value}\n mode={mode}\n format={format}\n locale={locale}\n upperDateThreshold={upperDateThreshold}\n lowerDateThreshold={lowerDateThreshold}\n offsetThreshold={offsetThreshold}\n upperOffsetThreshold={upperOffsetThreshold}\n lowerOffsetThreshold={lowerOffsetThreshold}\n dateModalTitle={dateModalTitle}\n timeModalTitle={timeModalTitle}\n dateConfirmButtonText={dateConfirmButtonText}\n timeConfirmButtonText={timeConfirmButtonText}\n dayLabel={dayLabel}\n monthLabel={monthLabel}\n yearLabel={yearLabel}\n hourLabel={hourLabel}\n minuteLabel={minuteLabel}\n onChange={handleChoosing}\n />\n )\n\n return (\n <>\n {controlComponent ? (\n controlComponent(handleShowSelector, displayValue)\n ) : (\n <HintInputContainer\n focused={focused}\n viewStyle={style}\n onPress={handleShowSelector}\n disabled={disabled}\n LabelComponent={TextComponent}\n variant={variant}\n hint={hint}\n hintComponent={hintComponent}\n rightComponent={\n <>\n <CalendarIcon name=\"calendar-sharp\" type=\"ionicon\" size=\"centi\" />\n {rightComponent}\n </>\n }\n {...rest}\n >\n <StyledText fontWeight=\"bold\" disabled={disabled}>\n {displayValue}\n </StyledText>\n </HintInputContainer>\n )}\n {renderSelector(dateTimeSelector, handleBlur)}\n </>\n );\n};\n\nexport default DateTimePicker;\n"],"file":"DateTimePicker.js"}
|
|
@@ -1,26 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { PressableSurfaceProps } from '../../atoms/PressableSurface';
|
|
3
2
|
import { DateTimeSelectorProps } from '../DateTimeSelector';
|
|
4
|
-
export declare const StyledPressableSurface: import("@emotion/native").StyledComponent<PressableSurfaceProps & {
|
|
5
|
-
children?: import("react").ReactNode;
|
|
6
|
-
} & {
|
|
7
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
as?: import("react").ElementType<any> | undefined;
|
|
9
|
-
}, {}, {}>;
|
|
10
|
-
export declare const Backdrop: import("@emotion/native").StyledComponent<PressableSurfaceProps & {
|
|
11
|
-
children?: import("react").ReactNode;
|
|
12
|
-
} & {
|
|
13
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
14
|
-
as?: import("react").ElementType<any> | undefined;
|
|
15
|
-
} & Partial<import("../../../types/defaults").ThemeProviderProps>, {}, {}>;
|
|
16
|
-
export declare const ModalContent: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
17
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
-
as?: import("react").ElementType<any> | undefined;
|
|
19
|
-
} & {
|
|
20
|
-
offset: number;
|
|
21
|
-
} & Partial<import("../../../types/defaults").ThemeProviderProps>, {}, {
|
|
22
|
-
ref?: import("react").Ref<import("react-native").View> | undefined;
|
|
23
|
-
}>;
|
|
24
3
|
export declare const getStyledDateTimeSelector: (component: FC<DateTimeSelectorProps>) => import("@emotion/native").StyledComponent<DateTimeSelectorProps & {
|
|
25
4
|
children?: import("react").ReactNode;
|
|
26
5
|
} & {
|
|
@@ -3,59 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getStyledDateTimeSelector =
|
|
6
|
+
exports.getStyledDateTimeSelector = void 0;
|
|
7
7
|
|
|
8
|
-
var _native =
|
|
8
|
+
var _native = _interopRequireDefault(require("@emotion/native"));
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _utils = require("../../../utils");
|
|
13
|
-
|
|
14
|
-
var _PressableSurface = require("../../atoms/PressableSurface");
|
|
15
|
-
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
20
|
-
const isWeb = _reactNative.Platform.OS === 'web';
|
|
21
|
-
const StyledPressableSurface = (0, _native.default)(_PressableSurface.PressableSurface)`
|
|
22
|
-
width: 100%;
|
|
23
|
-
`;
|
|
24
|
-
exports.StyledPressableSurface = StyledPressableSurface;
|
|
25
|
-
const Backdrop = (0, _native.default)(_PressableSurface.PressableSurface)`
|
|
26
|
-
${isWeb ? (0, _native.css)`
|
|
27
|
-
justify-content: center;
|
|
28
|
-
align-items: center;
|
|
29
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
30
|
-
height: 100vh;
|
|
31
|
-
` : (0, _native.css)`
|
|
32
|
-
justify-content: flex-end;
|
|
33
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
34
|
-
height: 100%;
|
|
35
|
-
`}
|
|
36
|
-
`;
|
|
37
|
-
exports.Backdrop = Backdrop;
|
|
38
|
-
const ModalContent = _native.default.View`
|
|
39
|
-
background-color: transparent;
|
|
40
|
-
padding-bottom: ${({
|
|
41
|
-
offset
|
|
42
|
-
}) => `${(0, _utils.RFValue)(offset)}px`};
|
|
43
|
-
${({
|
|
44
|
-
theme: {
|
|
45
|
-
borderRadius
|
|
46
|
-
}
|
|
47
|
-
}) => (0, _native.css)`
|
|
48
|
-
${isWeb ? `
|
|
49
|
-
width: ${(0, _utils.RFValueStr)('375px')};
|
|
50
|
-
border-radius: ${borderRadius.micro};
|
|
51
|
-
` : `
|
|
52
|
-
border-top-left-radius: ${borderRadius.deca};
|
|
53
|
-
border-top-right-radius: ${borderRadius.deca};
|
|
54
|
-
`}
|
|
55
|
-
`}
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
`;
|
|
58
|
-
exports.ModalContent = ModalContent;
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
59
11
|
|
|
60
12
|
const getStyledDateTimeSelector = component => {
|
|
61
13
|
return (0, _native.default)(component)`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/DateTimePicker/styled.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/DateTimePicker/styled.ts"],"names":["getStyledDateTimeSelector","component","theme","spacing","deca"],"mappings":";;;;;;;AAAA;;;;AAKO,MAAMA,yBAAyB,GACpCC,SADuC,IAEpC;AACH,SAAO,qBAAOA,SAAP,CAAuC;AAChD,eAAe,CAAC;AAAEC,IAAAA;AAAF,GAAD,KAAeA,KAAK,CAACC,OAAN,CAAcC,IAAK;AACjD,GAFE;AAGD,CANM","sourcesContent":["import styled from '@emotion/native';\nimport { FC } from 'react';\nimport { StyleProps } from '../../../types/defaults';\nimport { DateTimeSelectorProps } from '../DateTimeSelector';\n\nexport const getStyledDateTimeSelector = (\n component: FC<DateTimeSelectorProps>\n) => {\n return styled(component)<Partial<StyleProps>>`\n padding: ${({ theme }) => theme.spacing.deca};\n `;\n};\n"],"file":"styled.js"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SpacingType } from '
|
|
2
|
+
import { SpacingType } from '../../../../types/defaults';
|
|
3
3
|
declare type FlexPositioning = 'flex-start' | 'flex-end' | 'center';
|
|
4
4
|
declare type FlexAlignBase = FlexPositioning | 'stretch';
|
|
5
5
|
declare type FlexAlignType = FlexAlignBase | 'baseline';
|
|
@@ -7,10 +7,12 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _reactCore = require("@tecsinapse/react-core");
|
|
11
|
-
|
|
12
10
|
var _reactNative = require("react-native");
|
|
13
11
|
|
|
12
|
+
var _hooks = require("../../../../hooks");
|
|
13
|
+
|
|
14
|
+
var _utils = require("../../../../utils");
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
const GridItem = ({
|
|
@@ -25,7 +27,7 @@ const GridItem = ({
|
|
|
25
27
|
}) => {
|
|
26
28
|
const {
|
|
27
29
|
spacing
|
|
28
|
-
} = (0,
|
|
30
|
+
} = (0, _hooks.useTheme)();
|
|
29
31
|
|
|
30
32
|
if (!_react.default.Children.only(children)) {
|
|
31
33
|
throw new Error('The number of children in GridItem should be one');
|
|
@@ -37,8 +39,8 @@ const GridItem = ({
|
|
|
37
39
|
|
|
38
40
|
const getPadding = pos => {
|
|
39
41
|
if (_spacing) {
|
|
40
|
-
if (typeof _spacing === 'string') return (0,
|
|
41
|
-
return (0,
|
|
42
|
+
if (typeof _spacing === 'string') return (0, _utils.extractNumbersFromString)(spacing[_spacing]);else if (typeof _spacing === 'object' && _spacing[pos]) {
|
|
43
|
+
return (0, _utils.extractNumbersFromString)(spacing[_spacing[pos]]);
|
|
42
44
|
} else return undefined;
|
|
43
45
|
} else return undefined;
|
|
44
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/molecules/Grid/Item/Item.tsx"],"names":["GridItem","children","span","columns","loadingComponent","loading","spacing","_spacing","wrapper","rest","React","Children","only","Error","getPadding","pos","undefined","style","boxSizing","flexBasis","paddingTop","paddingBottom","paddingRight","paddingLeft","clone","cloneElement","props"],"mappings":";;;;;;;AAAA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/molecules/Grid/Item/Item.tsx"],"names":["GridItem","children","span","columns","loadingComponent","loading","spacing","_spacing","wrapper","rest","React","Children","only","Error","getPadding","pos","undefined","style","boxSizing","flexBasis","paddingTop","paddingBottom","paddingRight","paddingLeft","clone","cloneElement","props"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;;;AAwCA,MAAMA,QAAQ,GAAG,CAAC;AAChBC,EAAAA,QADgB;AAEhBC,EAAAA,IAFgB;AAGhBC,EAAAA,OAAO,GAAG,EAHM;AAIhBC,EAAAA,gBAJgB;AAKhBC,EAAAA,OAAO,GA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zCT,IAAAA,KAAK,EAAET,OAAO,GACVP,QADU,aACVA,QADU,uBACVA,QAAQ,CAAEyB,KAAV,CAAgBT,KADN,GAEV,EAAE,GAAGA,KAAL;AAAY,UAAGhB,QAAH,aAAGA,QAAH,uBAAGA,QAAQ,CAAEyB,KAAV,CAAgBT,KAAnB;AAAZ;AAJqC,GAA7B,CAAd;;AAOA,SAAOT,OAAO,GAAG,6BAAC,iBAAD;AAAM,IAAA,KAAK,EAAES;AAAb,KAAqBO,KAArB,CAAH,GAAwCA,KAAtD;AACD,CA9CD;;eAgDexB,Q","sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { useTheme } from '../../../../hooks';\nimport { SpacingType } from '../../../../types/defaults';\nimport { extractNumbersFromString } from '../../../../utils';\n\ntype FlexPositioning = 'flex-start' | 'flex-end' | 'center';\ntype FlexAlignBase = FlexPositioning | 'stretch';\ntype FlexAlignType = FlexAlignBase | 'baseline';\ntype FlexSpacing = 'space-between' | 'space-around';\n\ntype PaddingPosition = 'top' | 'right' | 'bottom' | 'left';\n\nexport interface IGridItem {\n children: React.ReactElement;\n /** Number of columns to fill */\n span: number;\n /** You don't have to give this property since is inherited from Grid */\n columns?: number;\n loading?: boolean;\n /** If your GridItem has a loading state, specify the component here (Skeleton) */\n loadingComponent?: React.ReactElement;\n /** Flex properties below */\n alignContent?: FlexAlignBase | FlexSpacing;\n alignItems?: FlexAlignType;\n alignSelf?: 'auto' | FlexAlignType;\n flex?: number;\n flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse';\n flexGrow?: number;\n flexShrink?: number;\n justifyContent?: FlexPositioning | FlexSpacing | 'space-evenly';\n /** You don't have to give this property since is inherited from Grid */\n spacing?:\n | SpacingType\n | {\n top?: SpacingType;\n right?: SpacingType;\n bottom?: SpacingType;\n left?: SpacingType;\n };\n /** Used to wrap children in a View when its style extrapolates the dimensions*/\n wrapper?: boolean;\n}\n\nconst GridItem = ({\n children,\n span,\n columns = 12,\n loadingComponent,\n loading = false,\n spacing: _spacing,\n wrapper = false,\n ...rest\n}: IGridItem) => {\n const { spacing } = useTheme();\n if (!React.Children.only(children)) {\n throw new Error('The number of children in GridItem should be one');\n }\n if (loadingComponent && loading) {\n return loadingComponent;\n }\n\n const getPadding = (pos: PaddingPosition) => {\n if (_spacing) {\n if (typeof _spacing === 'string')\n return extractNumbersFromString(spacing[_spacing]);\n else if (typeof _spacing === 'object' && _spacing[pos]) {\n return extractNumbersFromString(spacing[_spacing[pos]!]);\n } else return undefined;\n } else return undefined;\n };\n\n const style = {\n ...rest,\n boxSizing: 'border-box',\n flexBasis: `${100 / (columns / span)}%`,\n paddingTop: getPadding('top'),\n paddingBottom: getPadding('bottom'),\n paddingRight: getPadding('right'),\n paddingLeft: getPadding('left'),\n };\n\n const clone = React.cloneElement(children, {\n ...children?.props,\n style: wrapper\n ? children?.props.style\n : { ...style, ...children?.props.style },\n });\n\n return wrapper ? <View style={style}>{clone}</View> : clone;\n};\n\nexport default GridItem;\n"],"file":"Item.js"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { InputVariantType, PressableInputContainerProps, TextProps } from '@tecsinapse/react-core';
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
1
|
import * as React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { InputVariantType, PressableInputContainerProps } from '../../atoms/Input';
|
|
4
|
+
import { TextProps } from '../../atoms/Text';
|
|
4
5
|
export interface HintInputContainerProps extends PressableInputContainerProps {
|
|
5
6
|
viewStyle?: StyleProp<ViewStyle>;
|
|
6
7
|
focused: boolean;
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _Input = require("../../atoms/Input");
|
|
13
13
|
|
|
14
14
|
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); }
|
|
15
15
|
|
|
@@ -30,7 +30,7 @@ const HintInputContainer = ({
|
|
|
30
30
|
hintComponent,
|
|
31
31
|
...rest
|
|
32
32
|
}) => {
|
|
33
|
-
const _hint = hintComponent || React.createElement(
|
|
33
|
+
const _hint = hintComponent || React.createElement(_Input.Hint, {
|
|
34
34
|
TextComponent: LabelComponent,
|
|
35
35
|
text: hint,
|
|
36
36
|
variant: variant
|
|
@@ -38,7 +38,7 @@ const HintInputContainer = ({
|
|
|
38
38
|
|
|
39
39
|
return React.createElement(_reactNative.View, {
|
|
40
40
|
style: viewStyle
|
|
41
|
-
}, React.createElement(
|
|
41
|
+
}, React.createElement(_Input.PressableInputContainer, _extends({
|
|
42
42
|
onPress: onPress,
|
|
43
43
|
focused: focused,
|
|
44
44
|
disabled: disabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/HintInputContainer/HintInputContainer.tsx"],"names":["HintInputContainer","viewStyle","onPress","focused","disabled","LabelComponent","variant","rightComponent","children","hint","hintComponent","rest","_hint"],"mappings":";;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/HintInputContainer/HintInputContainer.tsx"],"names":["HintInputContainer","viewStyle","onPress","focused","disabled","LabelComponent","variant","rightComponent","children","hint","hintComponent","rest","_hint"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;;;AAeA,MAAMA,kBAAqD,GAAG,CAAC;AAC7DC,EAAAA,SAD6D;AAE7DC,EAAAA,OAF6D;AAG7DC,EAAAA,OAH6D;AAI7DC,EAAAA,QAJ6D;AAK7DC,EAAAA,cAL6D;AAM7DC,EAAAA,OAAO,GAAG,SANmD;AAO7DC,EAAAA,cAP6D;AAQ7DC,EAAAA,QAR6D;AAS7DC,EAAAA,IAT6D;AAU7DC,EAAAA,aAV6D;AAW7D,KAAGC;AAX0D,CAAD,KAYxD;AACJ,QAAMC,KAAK,GAAGF,aAAa,IACzB,oBAAC,WAAD;AAAM,IAAA,aAAa,EAAEL,cAArB;AAAqC,IAAA,IAAI,EAAEI,IAA3C;AAAiD,IAAA,OAAO,EAAEH;AAA1D,IADF;;AAIA,SACE,oBAAC,iBAAD;AAAM,IAAA,KAAK,EAAEL;AAAb,KACE,oBAAC,8BAAD;AACE,IAAA,OAAO,EAAEC,OADX;AAEE,IAAA,OAAO,EAAEC,OAFX;AAGE,IAAA,QAAQ,EAAEC,QAHZ;AAIE,IAAA,cAAc,EAAEC,cAJlB;AAKE,IAAA,OAAO,EAAEC,OALX;AAME,IAAA,cAAc,EAAEC;AANlB,KAOMI,IAPN,GASGH,QATH,CADF,EAYGC,IAAI,IAAIG,KAZX,CADF;AAgBD,CAjCD;;eAmCeZ,kB","sourcesContent":["import * as React from 'react';\nimport { StyleProp, View, ViewStyle } from 'react-native';\nimport { Hint, InputVariantType, PressableInputContainer, PressableInputContainerProps } from '../../atoms/Input';\nimport { TextProps } from '../../atoms/Text';\n\nexport interface HintInputContainerProps extends PressableInputContainerProps {\n viewStyle?: StyleProp<ViewStyle>;\n focused: boolean;\n LabelComponent?: React.FC<TextProps>;\n onPress?: () => void | never;\n disabled?: boolean;\n hint?: string;\n hintComponent?: JSX.Element;\n variant?: InputVariantType;\n rightComponent?: JSX.Element;\n}\n\nconst HintInputContainer: React.FC<HintInputContainerProps> = ({\n viewStyle,\n onPress,\n focused,\n disabled,\n LabelComponent,\n variant = 'default',\n rightComponent,\n children,\n hint,\n hintComponent,\n ...rest\n}) => {\n const _hint = hintComponent || (\n <Hint TextComponent={LabelComponent} text={hint} variant={variant} />\n );\n\n return (\n <View style={viewStyle}>\n <PressableInputContainer\n onPress={onPress}\n focused={focused}\n disabled={disabled}\n LabelComponent={LabelComponent}\n variant={variant}\n rightComponent={rightComponent}\n {...rest}\n >\n {children}\n </PressableInputContainer>\n {hint && _hint}\n </View>\n );\n};\n\nexport default HintInputContainer;\n"],"file":"HintInputContainer.js"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { FontStackType, FontWeightType
|
|
2
|
+
import { FontStackType, FontWeightType } from '../../../types/defaults';
|
|
3
|
+
import { InputContainerProps, InputElementProps } from '../../atoms/Input';
|
|
4
|
+
import { TextProps } from '../../atoms/Text';
|
|
3
5
|
export interface TextAreaProps extends Omit<InputElementProps, 'style' | 'multiline' | 'value'>, InputContainerProps {
|
|
4
6
|
inputFontStack?: FontStackType;
|
|
5
7
|
inputFontWeight?: FontWeightType;
|
|
@@ -7,14 +7,14 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
-
var _reactCore = require("@tecsinapse/react-core");
|
|
11
|
-
|
|
12
10
|
var _reactNative = require("react-native");
|
|
13
11
|
|
|
14
|
-
var
|
|
12
|
+
var _Input = require("../../atoms/Input");
|
|
15
13
|
|
|
16
14
|
var _Text = require("../../atoms/Text");
|
|
17
15
|
|
|
16
|
+
var _styled = require("./styled");
|
|
17
|
+
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
20
|
const TextArea = ({
|
|
@@ -48,7 +48,7 @@ const TextArea = ({
|
|
|
48
48
|
length = maxLength;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
const _hint = hintComponent || _react.default.createElement(
|
|
51
|
+
const _hint = hintComponent || _react.default.createElement(_Input.Hint, {
|
|
52
52
|
TextComponent: TextComponent,
|
|
53
53
|
text: hint,
|
|
54
54
|
variant: variant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/TextArea/TextArea.tsx"],"names":["TextArea","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputContainerStyle","variant","hintComponent","hint","TextComponent","Text","focused","children","maxLength","_maxLenght","value","_value","length","_hint","textAlign"],"mappings":";;;;;;;AAAA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/TextArea/TextArea.tsx"],"names":["TextArea","label","labelColor","labelColorVariant","labelColorTone","labelTypography","labelStack","labelWeight","leftComponent","rightComponent","disabled","style","borderColor","borderColorGradation","inputContainerStyle","variant","hintComponent","hint","TextComponent","Text","focused","children","maxLength","_maxLenght","value","_value","length","_hint","textAlign"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;AAcA,MAAMA,QAA2B,GAAG,CAAC;AACnCC,EAAAA,KADmC;AAEnCC,EAAAA,UAFmC;AAGnCC,EAAAA,iBAHmC;AAInCC,EAAAA,cAJmC;AAKnCC,EAAAA,eALmC;AAMnCC,EAAAA,UANmC;AAOnCC,EAAAA,WAPmC;AAQnCC,EAAAA,aARmC;AASnCC,EAAAA,cATmC;AAUnCC,EAAAA,QAVmC;AAWnCC,EAAAA,KAXmC;AAYnCC,EAAAA,WAZmC;AAanCC,EAAAA,oBAbmC;AAcnCC,EAAAA,mBAdmC;AAenCC,EAAAA,OAAO,GAAG,SAfyB;AAgBnCC,EAAAA,aAhBmC;AAiBnCC,EAAAA,IAjBmC;AAkBnCC,EAAAA,aAAa,GAAGC,UAlBmB;AAmBnCC,EAAAA,OAnBmC;AAoBnCC,EAAAA,QApBmC;AAqBnCC,EAAAA,SAAS,EAAEC,UArBwB;AAsBnCC,EAAAA,KAAK,EAAEC;AAtB4B,CAAD,KAuB9B;AACJ,MAAIC,MAAM,GAAGD,MAAM,CAACC,MAApB;AACA,QAAMJ,SAAS,GAAGC,UAAlB;;AACA,MAAID,SAAS,IAAII,MAAM,GAAGJ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eightType } from '../../../types/defaults';\nimport { Hint, InputContainerProps, InputElementProps } from '../../atoms/Input';\nimport { Text, TextProps } from '../../atoms/Text';\nimport { StyledInputContainer } from './styled';\n\nexport interface TextAreaProps\n extends Omit<InputElementProps, 'style' | 'multiline' | 'value'>,\n InputContainerProps {\n inputFontStack?: FontStackType;\n inputFontWeight?: FontWeightType;\n maxCharCount?: number;\n value: string;\n // Omit below\n TextComponent?: FC<TextProps>;\n focused?: boolean;\n}\n\nconst TextArea: FC<TextAreaProps> = ({\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 inputContainerStyle,\n variant = 'default',\n hintComponent,\n hint,\n TextComponent = Text,\n focused,\n children,\n maxLength: _maxLenght,\n value: _value,\n}) => {\n let length = _value.length;\n const maxLength = _maxLenght;\n if (maxLength && length > maxLength) {\n length = maxLength;\n }\n\n const _hint = hintComponent || (\n <Hint TextComponent={TextComponent} text={hint} variant={variant} />\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={TextComponent}\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 {children}\n {maxLength && (\n <TextComponent\n colorVariant={'secondary'}\n colorTone={'medium'}\n typography={'label'}\n fontStack={'default'}\n fontWeight={'bold'}\n style={{ textAlign: 'right' }}\n >\n {`${length}/${maxLength}`}\n </TextComponent>\n )}\n </StyledInputContainer>\n {hint && _hint}\n </View>\n );\n};\n\nexport default TextArea;\n"],"file":"TextArea.js"}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { RadioButton, RadioButtonProps } from './components/atoms/RadioButton';
|
|
|
17
17
|
export { Switch, SwitchProps } from './components/atoms/Switch';
|
|
18
18
|
export { Tag, TagProps } from './components/atoms/Tag';
|
|
19
19
|
export { Text, TextProps } from './components/atoms/Text';
|
|
20
|
-
export { Calendar, CalendarProps, DateRange, SelectionType, } from './components/molecules/Calendar';
|
|
20
|
+
export { Calendar, CalendarProps, DateRange, SelectionType, Value } from './components/molecules/Calendar';
|
|
21
21
|
export { DatePicker, DatePickerProps } from './components/molecules/DatePicker';
|
|
22
22
|
export { DateTimePicker, DateTimePickerProps, } from './components/molecules/DateTimePicker';
|
|
23
23
|
export { DateTimeSelector, DateTimeSelectorMode, DateTimeSelectorProps, } from './components/molecules/DateTimeSelector';
|
package/dist/index.js
CHANGED
|
@@ -69,6 +69,7 @@ var _exportNames = {
|
|
|
69
69
|
CalendarProps: true,
|
|
70
70
|
DateRange: true,
|
|
71
71
|
SelectionType: true,
|
|
72
|
+
Value: true,
|
|
72
73
|
DatePicker: true,
|
|
73
74
|
DatePickerProps: true,
|
|
74
75
|
DateTimePicker: true,
|
|
@@ -480,6 +481,12 @@ Object.defineProperty(exports, "SelectionType", {
|
|
|
480
481
|
return _Calendar.SelectionType;
|
|
481
482
|
}
|
|
482
483
|
});
|
|
484
|
+
Object.defineProperty(exports, "Value", {
|
|
485
|
+
enumerable: true,
|
|
486
|
+
get: function () {
|
|
487
|
+
return _Calendar.Value;
|
|
488
|
+
}
|
|
489
|
+
});
|
|
483
490
|
Object.defineProperty(exports, "DatePicker", {
|
|
484
491
|
enumerable: true,
|
|
485
492
|
get: function () {
|