@cleartrip/ct-design-text-field 1.1.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/dist/ct-design-text-field.browser.cjs.js +2 -0
- package/dist/ct-design-text-field.browser.cjs.js.map +1 -0
- package/dist/ct-design-text-field.browser.esm.js +2 -0
- package/dist/ct-design-text-field.browser.esm.js.map +1 -0
- package/dist/ct-design-text-field.cjs.js +249 -0
- package/dist/ct-design-text-field.cjs.js.map +1 -0
- package/dist/ct-design-text-field.esm.js +241 -0
- package/dist/ct-design-text-field.esm.js.map +1 -0
- package/dist/ct-design-text-field.umd.js +284 -0
- package/dist/ct-design-text-field.umd.js.map +1 -0
- package/dist/src/TextField.d.ts +7 -0
- package/dist/src/TextField.d.ts.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/style.d.ts +47 -0
- package/dist/src/style.d.ts.map +1 -0
- package/dist/src/type.d.ts +52 -0
- package/dist/src/type.d.ts.map +1 -0
- package/dist/stats.html +4838 -0
- package/package.json +43 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { __rest, __assign } from 'tslib';
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, useState, useRef, useImperativeHandle, useCallback } from 'react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import useTheme from '@cleartrip/ct-design-use-theme';
|
|
6
|
+
import useMergeRefs from '@cleartrip/ct-design-use-merge-refs';
|
|
7
|
+
import { Box } from '@cleartrip/ct-design-box';
|
|
8
|
+
import { getTypographyStyles, Typography, TypographyColor } from '@cleartrip/ct-design-typography';
|
|
9
|
+
import { Container } from '@cleartrip/ct-design-container';
|
|
10
|
+
|
|
11
|
+
var layout = {
|
|
12
|
+
lg: {
|
|
13
|
+
height: 0,
|
|
14
|
+
width: 0,
|
|
15
|
+
padding: 0,
|
|
16
|
+
},
|
|
17
|
+
sm: {
|
|
18
|
+
height: 10,
|
|
19
|
+
width: 36,
|
|
20
|
+
padding: 2.5,
|
|
21
|
+
},
|
|
22
|
+
md: {
|
|
23
|
+
height: 14,
|
|
24
|
+
width: 50,
|
|
25
|
+
padding: 4,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
var getTextFieldInputRootStyles = function (_a) {
|
|
29
|
+
var width = _a.width, height = _a.height, theme = _a.theme, focused = _a.focused; _a.filled; var color = _a.color, select = _a.select, _b = _a.disabled, disabled = _b === void 0 ? false : _b, isChipDropdown = _a.isChipDropdown, minWidth = _a.minWidth, focusColor = _a.focusColor, _c = _a.size, size = _c === void 0 ? 'md' : _c, rest = __rest(_a, ["width", "height", "theme", "focused", "filled", "color", "select", "disabled", "isChipDropdown", "minWidth", "focusColor", "size"]);
|
|
30
|
+
var outlineColor = color || theme.color.border.default;
|
|
31
|
+
return __assign(__assign({ position: 'relative', display: 'inline-flex', gap: '16px', background: disabled ? theme.color.background.disabled : theme.color.background.neutral, outlineStyle: 'solid', outlineColor: outlineColor, outlineWidth: disabled ? 0 : focused ? theme.border.width.md : theme.border.width.sm, borderRadius: theme.border.radius[6], cursor: disabled ? 'not-allowed' : select ? 'pointer' : 'text', alignItems: 'center', boxSizing: 'border-box', width: width, height: height, padding: "0 ".concat(theme.size[layout[size].padding]), flex: isChipDropdown ? 'auto' : undefined, minWidth: minWidth }, rest), { '&:hover': {
|
|
32
|
+
outlineColor: disabled ? theme.color.background.disabled : focusColor,
|
|
33
|
+
outlineWidth: theme.border.width.md,
|
|
34
|
+
} });
|
|
35
|
+
};
|
|
36
|
+
var getTextFieldInputBaseStyles = function (_a) {
|
|
37
|
+
var multiline = _a.multiline, theme = _a.theme, select = _a.select, _b = _a.disabled, disabled = _b === void 0 ? false : _b, isChipDropdown = _a.isChipDropdown;
|
|
38
|
+
return {
|
|
39
|
+
height: multiline ? '34px' : 'auto',
|
|
40
|
+
border: 0,
|
|
41
|
+
background: 'none',
|
|
42
|
+
outline: 0,
|
|
43
|
+
'&::-webkit-input-placeholder': {
|
|
44
|
+
opacity: 0,
|
|
45
|
+
},
|
|
46
|
+
boxSizing: 'border-box',
|
|
47
|
+
fontSize: isChipDropdown ? '4px' : theme.typography.size[16],
|
|
48
|
+
resize: 'none',
|
|
49
|
+
cursor: disabled ? 'not-allowed' : select ? 'pointer' : 'text',
|
|
50
|
+
width: isChipDropdown ? '4px' : '100%',
|
|
51
|
+
padding: 0,
|
|
52
|
+
color: disabled ? theme.color.text.tertiary : theme.color.text.primary,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
var getTextFieldLabelStyles = function (_a) {
|
|
56
|
+
var theme = _a.theme, focused = _a.focused, filled = _a.filled, multiline = _a.multiline, _b = _a.size, size = _b === void 0 ? 'md' : _b;
|
|
57
|
+
theme.size[layout[size].padding];
|
|
58
|
+
var transformFormula = !(focused || filled) ? 'translate(0px, 16px) scale(1)' : 'translate(0px, 8px) scale(0.75)';
|
|
59
|
+
if (multiline) {
|
|
60
|
+
transformFormula = 'translate(0px, 16px) scale(1)';
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
display: 'block',
|
|
64
|
+
transformOrigin: 'top left',
|
|
65
|
+
whiteSpace: 'nowrap',
|
|
66
|
+
overflow: 'hidden',
|
|
67
|
+
textOverflow: 'ellipsis',
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
left: 0,
|
|
70
|
+
top: 0,
|
|
71
|
+
zIndex: 1,
|
|
72
|
+
pointerEvents: 'none',
|
|
73
|
+
transform: transformFormula,
|
|
74
|
+
lineHeight: '22px',
|
|
75
|
+
transition: theme.transitions.create(['color', 'transform', 'max-width'], {
|
|
76
|
+
duration: theme.transitions.duration.shorter,
|
|
77
|
+
easing: theme.transitions.easing.easeOut,
|
|
78
|
+
}),
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
var getTextFieldMultiPlaceholderStyles = function (_a) {
|
|
82
|
+
_a.theme; var filled = _a.filled; _a.size; _a.multiline; var _c = _a.placeholderIndex, placeholderIndex = _c === void 0 ? 0 : _c, _d = _a.placeholderLength, placeholderLength = _d === void 0 ? 0 : _d, _e = _a.animationTime, animationTime = _e === void 0 ? 2.5 : _e, animationKey = _a.animationKey;
|
|
83
|
+
var totalDuration = animationTime * placeholderLength;
|
|
84
|
+
var totalDelay = placeholderIndex * animationTime;
|
|
85
|
+
return {
|
|
86
|
+
display: 'block',
|
|
87
|
+
visibility: filled ? 'hidden' : 'visible',
|
|
88
|
+
transformOrigin: 'top left',
|
|
89
|
+
whiteSpace: 'nowrap',
|
|
90
|
+
overflow: 'hidden',
|
|
91
|
+
textOverflow: 'ellipsis',
|
|
92
|
+
position: 'absolute',
|
|
93
|
+
transform: 'translateY(100%)',
|
|
94
|
+
animation: "".concat(animationKey, " ").concat(totalDuration, "s ").concat(totalDelay, "s infinite ease-in-out"),
|
|
95
|
+
left: 8,
|
|
96
|
+
zIndex: 1,
|
|
97
|
+
pointerEvents: 'none',
|
|
98
|
+
width: '100%',
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
var getTextFieldPlaceholderStyles = function (_a) {
|
|
102
|
+
_a.theme; var filled = _a.filled; _a.size; var multiline = _a.multiline;
|
|
103
|
+
var topValue = multiline ? '5px' : '50%';
|
|
104
|
+
var transformFormula = "translateY(".concat(multiline ? '0' : '-50%', ")");
|
|
105
|
+
return {
|
|
106
|
+
display: 'block',
|
|
107
|
+
visibility: filled ? 'hidden' : 'visible',
|
|
108
|
+
transformOrigin: 'top left',
|
|
109
|
+
whiteSpace: 'nowrap',
|
|
110
|
+
overflow: 'hidden',
|
|
111
|
+
textOverflow: 'ellipsis',
|
|
112
|
+
position: 'absolute',
|
|
113
|
+
transform: transformFormula,
|
|
114
|
+
top: topValue,
|
|
115
|
+
zIndex: 1,
|
|
116
|
+
pointerEvents: 'none',
|
|
117
|
+
width: '100%',
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
var getContainerStyles = function (_a) {
|
|
121
|
+
var height = _a.height, isChipDropdown = _a.isChipDropdown, shrinked = _a.shrinked; _a.size; _a.theme; var disabled = _a.disabled, multiline = _a.multiline;
|
|
122
|
+
var padding = multiline ? '0' : shrinked ? '24px 0px 8px 0px' : isChipDropdown ? '8px' : "0px";
|
|
123
|
+
return {
|
|
124
|
+
position: 'relative',
|
|
125
|
+
display: 'inline-flex',
|
|
126
|
+
width: isChipDropdown ? '4px' : '100%',
|
|
127
|
+
padding: padding,
|
|
128
|
+
height: height,
|
|
129
|
+
boxSizing: 'border-box',
|
|
130
|
+
cursor: disabled ? 'not-allowed' : 'text',
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var Root = styled.div(function (_a) {
|
|
135
|
+
var theme = _a.theme, focused = _a.focused, css = _a.css, select = _a.select, filled = _a.filled, disabled = _a.disabled, isChipDropdown = _a.isChipDropdown, minWidth = _a.minWidth, focusColor = _a.focusColor, rest = __rest(_a, ["theme", "focused", "css", "select", "filled", "disabled", "isChipDropdown", "minWidth", "focusColor"]);
|
|
136
|
+
return getTextFieldInputRootStyles(__assign(__assign({ theme: theme, focused: focused, select: select, filled: filled, disabled: disabled, isChipDropdown: isChipDropdown, minWidth: minWidth, focusColor: focusColor }, css), rest));
|
|
137
|
+
});
|
|
138
|
+
var Label = styled.label(function (_a) {
|
|
139
|
+
var theme = _a.theme, focused = _a.focused, filled = _a.filled, rest = __rest(_a, ["theme", "focused", "filled"]);
|
|
140
|
+
return getTextFieldLabelStyles(__assign({ theme: theme, focused: focused, filled: filled }, rest));
|
|
141
|
+
});
|
|
142
|
+
var MultiPlaceholder = styled.label(function (_a) {
|
|
143
|
+
var theme = _a.theme, focused = _a.focused, filled = _a.filled, multiline = _a.multiline, animationTime = _a.animationTime, placeholderIndex = _a.placeholderIndex, placeholderLength = _a.placeholderLength, rest = __rest(_a, ["theme", "focused", "filled", "multiline", "animationTime", "placeholderIndex", "placeholderLength"]);
|
|
144
|
+
return getTextFieldMultiPlaceholderStyles(__assign({ theme: theme, focused: focused, filled: filled, multiline: multiline, placeholderLength: placeholderLength, placeholderIndex: placeholderIndex, animationTime: animationTime }, rest));
|
|
145
|
+
});
|
|
146
|
+
var Placeholder = styled.label(function (_a) {
|
|
147
|
+
var theme = _a.theme, focused = _a.focused, filled = _a.filled, multiline = _a.multiline, rest = __rest(_a, ["theme", "focused", "filled", "multiline"]);
|
|
148
|
+
return getTextFieldPlaceholderStyles(__assign({ theme: theme, focused: focused, filled: filled, multiline: multiline }, rest));
|
|
149
|
+
});
|
|
150
|
+
var Input = styled.input(function (_a) {
|
|
151
|
+
var theme = _a.theme; _a.focused; _a.filled; var isChipDropdown = _a.isChipDropdown, select = _a.select, disabled = _a.disabled; __rest(_a, ["theme", "focused", "filled", "isChipDropdown", "select", "disabled"]);
|
|
152
|
+
return getTextFieldInputBaseStyles({ multiline: false, theme: theme, select: select, isChipDropdown: isChipDropdown, disabled: disabled });
|
|
153
|
+
});
|
|
154
|
+
var TextArea = styled.textarea(function (_a) {
|
|
155
|
+
var theme = _a.theme, isChipDropdown = _a.isChipDropdown, disabled = _a.disabled;
|
|
156
|
+
return getTextFieldInputBaseStyles({ multiline: true, theme: theme, isChipDropdown: isChipDropdown, disabled: disabled });
|
|
157
|
+
});
|
|
158
|
+
var TextField = forwardRef(function (_a, forwardedRef) {
|
|
159
|
+
var _b = _a.as, as = _b === void 0 ? 'input' : _b; _a.id; var _d = _a.multiline, multiline = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.label, label = _f === void 0 ? '' : _f, prefix = _a.prefix, suffix = _a.suffix, _g = _a.error, error = _g === void 0 ? '' : _g, _h = _a.helperText, helperText = _h === void 0 ? '' : _h; _a.maxCharacters; var width = _a.width, height = _a.height, textFieldCSS = _a.textFieldCSS, focusColor = _a.focusColor, errorColor = _a.errorColor, css = _a.css, _j = _a.type, type = _j === void 0 ? 'text' : _j, _k = _a.value, value = _k === void 0 ? '' : _k, _l = _a.name, name = _l === void 0 ? '' : _l, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, disabled = _a.disabled, rows = _a.rows, column = _a.column, ref = _a.ref, _m = _a.fullWidth, fullWidth = _m === void 0 ? false : _m, select = _a.select, nonInput = _a.nonInput, onClick = _a.onClick, isChipDropdown = _a.isChipDropdown, placeholder = _a.placeholder, minWidth = _a.minWidth; _a.prefixGap; var _p = _a.placeholderTextVariant, placeholderTextVariant = _p === void 0 ? 'B2' : _p, labelTypographyProps = _a.labelTypographyProps, textTypographyProps = _a.textTypographyProps, _q = _a.animationTime, animationTime = _q === void 0 ? 2.5 : _q, _r = _a.animationKey, animationKey = _r === void 0 ? 'verticalTicker' : _r, rest = __rest(_a, ["as", "id", "multiline", "size", "label", "prefix", "suffix", "error", "helperText", "maxCharacters", "width", "height", "textFieldCSS", "focusColor", "errorColor", "css", "type", "value", "name", "onChange", "onFocus", "onBlur", "disabled", "rows", "column", "ref", "fullWidth", "select", "nonInput", "onClick", "isChipDropdown", "placeholder", "minWidth", "prefixGap", "placeholderTextVariant", "labelTypographyProps", "textTypographyProps", "animationTime", "animationKey"]);
|
|
160
|
+
var _s = useState(false), focused = _s[0], setFocused = _s[1];
|
|
161
|
+
var _t = useState(false), showPassword = _t[0]; _t[1];
|
|
162
|
+
var theme = useTheme();
|
|
163
|
+
var inputStyles = textTypographyProps ? getTypographyStyles(__assign({ theme: theme }, textTypographyProps)) : {};
|
|
164
|
+
var inputRef = useRef(null);
|
|
165
|
+
var textAreaRef = useRef(null);
|
|
166
|
+
var boxRef = useRef(null);
|
|
167
|
+
var handleRef = useMergeRefs(forwardedRef, ref);
|
|
168
|
+
useImperativeHandle(handleRef, function () { return ({
|
|
169
|
+
focus: function () {
|
|
170
|
+
var _a, _b;
|
|
171
|
+
if (multiline) {
|
|
172
|
+
(_a = textAreaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
node: boxRef === null || boxRef === void 0 ? void 0 : boxRef.current,
|
|
179
|
+
}); }, []);
|
|
180
|
+
var handleChange = useCallback(function (event) {
|
|
181
|
+
if (onChange) {
|
|
182
|
+
onChange(event);
|
|
183
|
+
}
|
|
184
|
+
}, [onChange]);
|
|
185
|
+
var handleFocus = useCallback(function (event) {
|
|
186
|
+
if (onFocus) {
|
|
187
|
+
onFocus(event);
|
|
188
|
+
}
|
|
189
|
+
setFocused(true);
|
|
190
|
+
}, []);
|
|
191
|
+
var handleBlur = useCallback(function (event) {
|
|
192
|
+
if (onBlur) {
|
|
193
|
+
onBlur(event);
|
|
194
|
+
}
|
|
195
|
+
setFocused(false);
|
|
196
|
+
}, []);
|
|
197
|
+
var handleClick = function (e) {
|
|
198
|
+
if (inputRef.current) {
|
|
199
|
+
inputRef.current.focus();
|
|
200
|
+
}
|
|
201
|
+
if (onClick) {
|
|
202
|
+
onClick(e);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
var filled = value.toString().length > 0 ? true : false;
|
|
206
|
+
width = width ? width : fullWidth ? '100%' : theme.size[layout[size].width];
|
|
207
|
+
height = height ? height : as !== 'input' ? 'auto' : theme.size[layout[size].height];
|
|
208
|
+
var helperColor = '';
|
|
209
|
+
var focusOutlineColor = focusColor || theme.color.border.primary;
|
|
210
|
+
if (!disabled && focused) {
|
|
211
|
+
helperColor = focusColor || theme.color.border.primary;
|
|
212
|
+
}
|
|
213
|
+
if (!disabled && error) {
|
|
214
|
+
helperColor = errorColor || theme.color.background.warning;
|
|
215
|
+
focusOutlineColor = helperColor;
|
|
216
|
+
}
|
|
217
|
+
var getPlaceHolderText = function (value) {
|
|
218
|
+
if (typeof value === 'string') {
|
|
219
|
+
return value;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
return value[0];
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
return (jsxs(Box, __assign({ boxSize: 'micro', css: __assign(__assign({}, css), { minWidth: minWidth }) }, { children: [jsxs(Root, __assign({ theme: theme, onClick: handleClick, color: helperColor, focusColor: focusOutlineColor, width: width, minWidth: minWidth, height: height, focused: focused, filled: filled, css: textFieldCSS === null || textFieldCSS === void 0 ? void 0 : textFieldCSS.Root, select: select, disabled: disabled, ref: boxRef, isChipDropdown: isChipDropdown, columnGap: theme.spacing[2] }, { children: [prefix, jsxs(Container, __assign({ css: getContainerStyles({
|
|
226
|
+
shrinked: !!label && (focused || filled),
|
|
227
|
+
isChipDropdown: !!isChipDropdown,
|
|
228
|
+
height: height,
|
|
229
|
+
size: size,
|
|
230
|
+
theme: theme,
|
|
231
|
+
disabled: disabled,
|
|
232
|
+
multiline: multiline,
|
|
233
|
+
}) }, { children: [label ? (jsx(Label, __assign({ theme: theme, color: helperColor, focused: focused, filled: filled, multiline: multiline }, { children: jsx(Typography, __assign({ variant: 'B1', color: TypographyColor.TERTIARY }, labelTypographyProps, { children: label })) }))) : (placeholder && (jsx(Fragment, { children: typeof placeholder === 'string' || (Array.isArray(placeholder) && placeholder.length == 1) ? (jsx(Placeholder, __assign({ filled: filled, theme: theme, size: size, multiline: multiline }, { children: jsx(Typography, __assign({ variant: placeholderTextVariant, color: TypographyColor.DISABLED, className: 'tt-ellipsis' }, { children: getPlaceHolderText(placeholder) })) }))) : (jsx(Container, __assign({ width: '100%', height: '20px', position: 'absolute', css: {
|
|
234
|
+
top: "".concat(multiline ? '0' : '50%'),
|
|
235
|
+
transform: "".concat(multiline ? null : 'translateY(-50%)'),
|
|
236
|
+
overflow: 'hidden',
|
|
237
|
+
} }, { children: placeholder.map(function (txt, index) { return (jsx(MultiPlaceholder, __assign({ filled: filled, theme: theme, size: size, multiline: multiline, animationTime: animationTime, placeholderLength: placeholder.length, placeholderIndex: index, animationKey: animationKey }, { children: jsx(Typography, __assign({ variant: placeholderTextVariant, color: TypographyColor.DISABLED, className: 'tt-ellipsis' }, { children: txt })) }))); }) }))) }))), multiline ? (jsx(TextArea, __assign({ theme: theme, rows: rows, column: column, ref: textAreaRef, autoComplete: 'off', onFocus: handleFocus, onBlur: handleBlur, value: value, onChange: handleChange, filled: filled, focused: focused, name: name, isChipDropdown: isChipDropdown }, rest))) : (jsx(Input, __assign({ ref: inputRef, theme: theme, type: showPassword ? 'text' : type, readOnly: select || nonInput, autoComplete: 'off', onFocus: handleFocus, onBlur: handleBlur, value: value, onChange: handleChange, filled: filled, focused: focused, name: name, select: select, disabled: disabled, isChipDropdown: isChipDropdown, style: inputStyles }, rest)))] })), suffix] })), (helperText || error) && !disabled && (jsx(Container, __assign({ className: 'flex flex-wrap', width: width, paddingLeft: '16px' }, { children: jsx(Typography, __assign({ variant: 'B3', color: error ? TypographyColor.WARNING : TypographyColor.SUBHEADING }, { children: helperText || error })) })))] })));
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
export { TextField };
|
|
241
|
+
//# sourceMappingURL=ct-design-text-field.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ct-design-text-field.esm.js","sources":["../../packages/components/TextField/src/style.ts","../../packages/components/TextField/src/TextField.tsx"],"sourcesContent":[null,null],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;AAKO,IAAM,MAAM,GAAG;AACpB,IAAA,EAAE,EAAE;AACF,QAAA,MAAM,EAAE,CAAC;AACT,QAAA,KAAK,EAAE,CAAC;AACR,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AACD,IAAA,EAAE,EAAE;AACF,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,OAAO,EAAE,GAAG;AACb,KAAA;AACD,IAAA,EAAE,EAAE;AACF,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;CACF,CAAC;AAEK,IAAM,2BAA2B,GAAG,UAAC,EAiBzC,EAAA;IAh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ACJ,CAAC;;;;"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('styled-components'), require('@cleartrip/ct-design-use-theme'), require('@cleartrip/ct-design-use-merge-refs'), require('@cleartrip/ct-design-box'), require('@cleartrip/ct-design-typography'), require('@cleartrip/ct-design-container')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', 'styled-components', '@cleartrip/ct-design-use-theme', '@cleartrip/ct-design-use-merge-refs', '@cleartrip/ct-design-box', '@cleartrip/ct-design-typography', '@cleartrip/ct-design-container'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystemTextField = {}, global.jsxRuntime, global.React, global.styled, global.useTheme, global.useMergeRefs, global.ctDesignBox, global.ctDesignTypography, global.ctDesignContainer));
|
|
5
|
+
})(this, (function (exports, jsxRuntime, react, styled, useTheme, useMergeRefs, ctDesignBox, ctDesignTypography, ctDesignContainer) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
10
|
+
var useTheme__default = /*#__PURE__*/_interopDefault(useTheme);
|
|
11
|
+
var useMergeRefs__default = /*#__PURE__*/_interopDefault(useMergeRefs);
|
|
12
|
+
|
|
13
|
+
/******************************************************************************
|
|
14
|
+
Copyright (c) Microsoft Corporation.
|
|
15
|
+
|
|
16
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
17
|
+
purpose with or without fee is hereby granted.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
20
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
21
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
22
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
23
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
24
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
25
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
26
|
+
***************************************************************************** */
|
|
27
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
28
|
+
|
|
29
|
+
var __assign = function () {
|
|
30
|
+
__assign = Object.assign || function __assign(t) {
|
|
31
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
32
|
+
s = arguments[i];
|
|
33
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
34
|
+
}
|
|
35
|
+
return t;
|
|
36
|
+
};
|
|
37
|
+
return __assign.apply(this, arguments);
|
|
38
|
+
};
|
|
39
|
+
function __rest(s, e) {
|
|
40
|
+
var t = {};
|
|
41
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
42
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
43
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
}
|
|
47
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
48
|
+
var e = new Error(message);
|
|
49
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var layout = {
|
|
53
|
+
lg: {
|
|
54
|
+
height: 0,
|
|
55
|
+
width: 0,
|
|
56
|
+
padding: 0,
|
|
57
|
+
},
|
|
58
|
+
sm: {
|
|
59
|
+
height: 10,
|
|
60
|
+
width: 36,
|
|
61
|
+
padding: 2.5,
|
|
62
|
+
},
|
|
63
|
+
md: {
|
|
64
|
+
height: 14,
|
|
65
|
+
width: 50,
|
|
66
|
+
padding: 4,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
var getTextFieldInputRootStyles = function (_a) {
|
|
70
|
+
var width = _a.width, height = _a.height, theme = _a.theme, focused = _a.focused; _a.filled; var color = _a.color, select = _a.select, _b = _a.disabled, disabled = _b === void 0 ? false : _b, isChipDropdown = _a.isChipDropdown, minWidth = _a.minWidth, focusColor = _a.focusColor, _c = _a.size, size = _c === void 0 ? 'md' : _c, rest = __rest(_a, ["width", "height", "theme", "focused", "filled", "color", "select", "disabled", "isChipDropdown", "minWidth", "focusColor", "size"]);
|
|
71
|
+
var outlineColor = color || theme.color.border.default;
|
|
72
|
+
return __assign(__assign({ position: 'relative', display: 'inline-flex', gap: '16px', background: disabled ? theme.color.background.disabled : theme.color.background.neutral, outlineStyle: 'solid', outlineColor: outlineColor, outlineWidth: disabled ? 0 : focused ? theme.border.width.md : theme.border.width.sm, borderRadius: theme.border.radius[6], cursor: disabled ? 'not-allowed' : select ? 'pointer' : 'text', alignItems: 'center', boxSizing: 'border-box', width: width, height: height, padding: "0 ".concat(theme.size[layout[size].padding]), flex: isChipDropdown ? 'auto' : undefined, minWidth: minWidth }, rest), { '&:hover': {
|
|
73
|
+
outlineColor: disabled ? theme.color.background.disabled : focusColor,
|
|
74
|
+
outlineWidth: theme.border.width.md,
|
|
75
|
+
} });
|
|
76
|
+
};
|
|
77
|
+
var getTextFieldInputBaseStyles = function (_a) {
|
|
78
|
+
var multiline = _a.multiline, theme = _a.theme, select = _a.select, _b = _a.disabled, disabled = _b === void 0 ? false : _b, isChipDropdown = _a.isChipDropdown;
|
|
79
|
+
return {
|
|
80
|
+
height: multiline ? '34px' : 'auto',
|
|
81
|
+
border: 0,
|
|
82
|
+
background: 'none',
|
|
83
|
+
outline: 0,
|
|
84
|
+
'&::-webkit-input-placeholder': {
|
|
85
|
+
opacity: 0,
|
|
86
|
+
},
|
|
87
|
+
boxSizing: 'border-box',
|
|
88
|
+
fontSize: isChipDropdown ? '4px' : theme.typography.size[16],
|
|
89
|
+
resize: 'none',
|
|
90
|
+
cursor: disabled ? 'not-allowed' : select ? 'pointer' : 'text',
|
|
91
|
+
width: isChipDropdown ? '4px' : '100%',
|
|
92
|
+
padding: 0,
|
|
93
|
+
color: disabled ? theme.color.text.tertiary : theme.color.text.primary,
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
var getTextFieldLabelStyles = function (_a) {
|
|
97
|
+
var theme = _a.theme, focused = _a.focused, filled = _a.filled, multiline = _a.multiline, _b = _a.size, size = _b === void 0 ? 'md' : _b;
|
|
98
|
+
theme.size[layout[size].padding];
|
|
99
|
+
var transformFormula = !(focused || filled) ? 'translate(0px, 16px) scale(1)' : 'translate(0px, 8px) scale(0.75)';
|
|
100
|
+
if (multiline) {
|
|
101
|
+
transformFormula = 'translate(0px, 16px) scale(1)';
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
display: 'block',
|
|
105
|
+
transformOrigin: 'top left',
|
|
106
|
+
whiteSpace: 'nowrap',
|
|
107
|
+
overflow: 'hidden',
|
|
108
|
+
textOverflow: 'ellipsis',
|
|
109
|
+
position: 'absolute',
|
|
110
|
+
left: 0,
|
|
111
|
+
top: 0,
|
|
112
|
+
zIndex: 1,
|
|
113
|
+
pointerEvents: 'none',
|
|
114
|
+
transform: transformFormula,
|
|
115
|
+
lineHeight: '22px',
|
|
116
|
+
transition: theme.transitions.create(['color', 'transform', 'max-width'], {
|
|
117
|
+
duration: theme.transitions.duration.shorter,
|
|
118
|
+
easing: theme.transitions.easing.easeOut,
|
|
119
|
+
}),
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
var getTextFieldMultiPlaceholderStyles = function (_a) {
|
|
123
|
+
_a.theme; var filled = _a.filled; _a.size; _a.multiline; var _c = _a.placeholderIndex, placeholderIndex = _c === void 0 ? 0 : _c, _d = _a.placeholderLength, placeholderLength = _d === void 0 ? 0 : _d, _e = _a.animationTime, animationTime = _e === void 0 ? 2.5 : _e, animationKey = _a.animationKey;
|
|
124
|
+
var totalDuration = animationTime * placeholderLength;
|
|
125
|
+
var totalDelay = placeholderIndex * animationTime;
|
|
126
|
+
return {
|
|
127
|
+
display: 'block',
|
|
128
|
+
visibility: filled ? 'hidden' : 'visible',
|
|
129
|
+
transformOrigin: 'top left',
|
|
130
|
+
whiteSpace: 'nowrap',
|
|
131
|
+
overflow: 'hidden',
|
|
132
|
+
textOverflow: 'ellipsis',
|
|
133
|
+
position: 'absolute',
|
|
134
|
+
transform: 'translateY(100%)',
|
|
135
|
+
animation: "".concat(animationKey, " ").concat(totalDuration, "s ").concat(totalDelay, "s infinite ease-in-out"),
|
|
136
|
+
left: 8,
|
|
137
|
+
zIndex: 1,
|
|
138
|
+
pointerEvents: 'none',
|
|
139
|
+
width: '100%',
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
var getTextFieldPlaceholderStyles = function (_a) {
|
|
143
|
+
_a.theme; var filled = _a.filled; _a.size; var multiline = _a.multiline;
|
|
144
|
+
var topValue = multiline ? '5px' : '50%';
|
|
145
|
+
var transformFormula = "translateY(".concat(multiline ? '0' : '-50%', ")");
|
|
146
|
+
return {
|
|
147
|
+
display: 'block',
|
|
148
|
+
visibility: filled ? 'hidden' : 'visible',
|
|
149
|
+
transformOrigin: 'top left',
|
|
150
|
+
whiteSpace: 'nowrap',
|
|
151
|
+
overflow: 'hidden',
|
|
152
|
+
textOverflow: 'ellipsis',
|
|
153
|
+
position: 'absolute',
|
|
154
|
+
transform: transformFormula,
|
|
155
|
+
top: topValue,
|
|
156
|
+
zIndex: 1,
|
|
157
|
+
pointerEvents: 'none',
|
|
158
|
+
width: '100%',
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
var getContainerStyles = function (_a) {
|
|
162
|
+
var height = _a.height, isChipDropdown = _a.isChipDropdown, shrinked = _a.shrinked; _a.size; _a.theme; var disabled = _a.disabled, multiline = _a.multiline;
|
|
163
|
+
var padding = multiline ? '0' : shrinked ? '24px 0px 8px 0px' : isChipDropdown ? '8px' : "0px";
|
|
164
|
+
return {
|
|
165
|
+
position: 'relative',
|
|
166
|
+
display: 'inline-flex',
|
|
167
|
+
width: isChipDropdown ? '4px' : '100%',
|
|
168
|
+
padding: padding,
|
|
169
|
+
height: height,
|
|
170
|
+
boxSizing: 'border-box',
|
|
171
|
+
cursor: disabled ? 'not-allowed' : 'text',
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
var Root = styled__default.default.div(function (_a) {
|
|
176
|
+
var theme = _a.theme, focused = _a.focused, css = _a.css, select = _a.select, filled = _a.filled, disabled = _a.disabled, isChipDropdown = _a.isChipDropdown, minWidth = _a.minWidth, focusColor = _a.focusColor, rest = __rest(_a, ["theme", "focused", "css", "select", "filled", "disabled", "isChipDropdown", "minWidth", "focusColor"]);
|
|
177
|
+
return getTextFieldInputRootStyles(__assign(__assign({ theme: theme, focused: focused, select: select, filled: filled, disabled: disabled, isChipDropdown: isChipDropdown, minWidth: minWidth, focusColor: focusColor }, css), rest));
|
|
178
|
+
});
|
|
179
|
+
var Label = styled__default.default.label(function (_a) {
|
|
180
|
+
var theme = _a.theme, focused = _a.focused, filled = _a.filled, rest = __rest(_a, ["theme", "focused", "filled"]);
|
|
181
|
+
return getTextFieldLabelStyles(__assign({ theme: theme, focused: focused, filled: filled }, rest));
|
|
182
|
+
});
|
|
183
|
+
var MultiPlaceholder = styled__default.default.label(function (_a) {
|
|
184
|
+
var theme = _a.theme, focused = _a.focused, filled = _a.filled, multiline = _a.multiline, animationTime = _a.animationTime, placeholderIndex = _a.placeholderIndex, placeholderLength = _a.placeholderLength, rest = __rest(_a, ["theme", "focused", "filled", "multiline", "animationTime", "placeholderIndex", "placeholderLength"]);
|
|
185
|
+
return getTextFieldMultiPlaceholderStyles(__assign({ theme: theme, focused: focused, filled: filled, multiline: multiline, placeholderLength: placeholderLength, placeholderIndex: placeholderIndex, animationTime: animationTime }, rest));
|
|
186
|
+
});
|
|
187
|
+
var Placeholder = styled__default.default.label(function (_a) {
|
|
188
|
+
var theme = _a.theme, focused = _a.focused, filled = _a.filled, multiline = _a.multiline, rest = __rest(_a, ["theme", "focused", "filled", "multiline"]);
|
|
189
|
+
return getTextFieldPlaceholderStyles(__assign({ theme: theme, focused: focused, filled: filled, multiline: multiline }, rest));
|
|
190
|
+
});
|
|
191
|
+
var Input = styled__default.default.input(function (_a) {
|
|
192
|
+
var theme = _a.theme; _a.focused; _a.filled; var isChipDropdown = _a.isChipDropdown, select = _a.select, disabled = _a.disabled; __rest(_a, ["theme", "focused", "filled", "isChipDropdown", "select", "disabled"]);
|
|
193
|
+
return getTextFieldInputBaseStyles({ multiline: false, theme: theme, select: select, isChipDropdown: isChipDropdown, disabled: disabled });
|
|
194
|
+
});
|
|
195
|
+
var TextArea = styled__default.default.textarea(function (_a) {
|
|
196
|
+
var theme = _a.theme, isChipDropdown = _a.isChipDropdown, disabled = _a.disabled;
|
|
197
|
+
return getTextFieldInputBaseStyles({ multiline: true, theme: theme, isChipDropdown: isChipDropdown, disabled: disabled });
|
|
198
|
+
});
|
|
199
|
+
var TextField = react.forwardRef(function (_a, forwardedRef) {
|
|
200
|
+
var _b = _a.as, as = _b === void 0 ? 'input' : _b; _a.id; var _d = _a.multiline, multiline = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.label, label = _f === void 0 ? '' : _f, prefix = _a.prefix, suffix = _a.suffix, _g = _a.error, error = _g === void 0 ? '' : _g, _h = _a.helperText, helperText = _h === void 0 ? '' : _h; _a.maxCharacters; var width = _a.width, height = _a.height, textFieldCSS = _a.textFieldCSS, focusColor = _a.focusColor, errorColor = _a.errorColor, css = _a.css, _j = _a.type, type = _j === void 0 ? 'text' : _j, _k = _a.value, value = _k === void 0 ? '' : _k, _l = _a.name, name = _l === void 0 ? '' : _l, onChange = _a.onChange, onFocus = _a.onFocus, onBlur = _a.onBlur, disabled = _a.disabled, rows = _a.rows, column = _a.column, ref = _a.ref, _m = _a.fullWidth, fullWidth = _m === void 0 ? false : _m, select = _a.select, nonInput = _a.nonInput, onClick = _a.onClick, isChipDropdown = _a.isChipDropdown, placeholder = _a.placeholder, minWidth = _a.minWidth; _a.prefixGap; var _p = _a.placeholderTextVariant, placeholderTextVariant = _p === void 0 ? 'B2' : _p, labelTypographyProps = _a.labelTypographyProps, textTypographyProps = _a.textTypographyProps, _q = _a.animationTime, animationTime = _q === void 0 ? 2.5 : _q, _r = _a.animationKey, animationKey = _r === void 0 ? 'verticalTicker' : _r, rest = __rest(_a, ["as", "id", "multiline", "size", "label", "prefix", "suffix", "error", "helperText", "maxCharacters", "width", "height", "textFieldCSS", "focusColor", "errorColor", "css", "type", "value", "name", "onChange", "onFocus", "onBlur", "disabled", "rows", "column", "ref", "fullWidth", "select", "nonInput", "onClick", "isChipDropdown", "placeholder", "minWidth", "prefixGap", "placeholderTextVariant", "labelTypographyProps", "textTypographyProps", "animationTime", "animationKey"]);
|
|
201
|
+
var _s = react.useState(false), focused = _s[0], setFocused = _s[1];
|
|
202
|
+
var _t = react.useState(false), showPassword = _t[0]; _t[1];
|
|
203
|
+
var theme = useTheme__default.default();
|
|
204
|
+
var inputStyles = textTypographyProps ? ctDesignTypography.getTypographyStyles(__assign({ theme: theme }, textTypographyProps)) : {};
|
|
205
|
+
var inputRef = react.useRef(null);
|
|
206
|
+
var textAreaRef = react.useRef(null);
|
|
207
|
+
var boxRef = react.useRef(null);
|
|
208
|
+
var handleRef = useMergeRefs__default.default(forwardedRef, ref);
|
|
209
|
+
react.useImperativeHandle(handleRef, function () { return ({
|
|
210
|
+
focus: function () {
|
|
211
|
+
var _a, _b;
|
|
212
|
+
if (multiline) {
|
|
213
|
+
(_a = textAreaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
node: boxRef === null || boxRef === void 0 ? void 0 : boxRef.current,
|
|
220
|
+
}); }, []);
|
|
221
|
+
var handleChange = react.useCallback(function (event) {
|
|
222
|
+
if (onChange) {
|
|
223
|
+
onChange(event);
|
|
224
|
+
}
|
|
225
|
+
}, [onChange]);
|
|
226
|
+
var handleFocus = react.useCallback(function (event) {
|
|
227
|
+
if (onFocus) {
|
|
228
|
+
onFocus(event);
|
|
229
|
+
}
|
|
230
|
+
setFocused(true);
|
|
231
|
+
}, []);
|
|
232
|
+
var handleBlur = react.useCallback(function (event) {
|
|
233
|
+
if (onBlur) {
|
|
234
|
+
onBlur(event);
|
|
235
|
+
}
|
|
236
|
+
setFocused(false);
|
|
237
|
+
}, []);
|
|
238
|
+
var handleClick = function (e) {
|
|
239
|
+
if (inputRef.current) {
|
|
240
|
+
inputRef.current.focus();
|
|
241
|
+
}
|
|
242
|
+
if (onClick) {
|
|
243
|
+
onClick(e);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var filled = value.toString().length > 0 ? true : false;
|
|
247
|
+
width = width ? width : fullWidth ? '100%' : theme.size[layout[size].width];
|
|
248
|
+
height = height ? height : as !== 'input' ? 'auto' : theme.size[layout[size].height];
|
|
249
|
+
var helperColor = '';
|
|
250
|
+
var focusOutlineColor = focusColor || theme.color.border.primary;
|
|
251
|
+
if (!disabled && focused) {
|
|
252
|
+
helperColor = focusColor || theme.color.border.primary;
|
|
253
|
+
}
|
|
254
|
+
if (!disabled && error) {
|
|
255
|
+
helperColor = errorColor || theme.color.background.warning;
|
|
256
|
+
focusOutlineColor = helperColor;
|
|
257
|
+
}
|
|
258
|
+
var getPlaceHolderText = function (value) {
|
|
259
|
+
if (typeof value === 'string') {
|
|
260
|
+
return value;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
return value[0];
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
return (jsxRuntime.jsxs(ctDesignBox.Box, __assign({ boxSize: 'micro', css: __assign(__assign({}, css), { minWidth: minWidth }) }, { children: [jsxRuntime.jsxs(Root, __assign({ theme: theme, onClick: handleClick, color: helperColor, focusColor: focusOutlineColor, width: width, minWidth: minWidth, height: height, focused: focused, filled: filled, css: textFieldCSS === null || textFieldCSS === void 0 ? void 0 : textFieldCSS.Root, select: select, disabled: disabled, ref: boxRef, isChipDropdown: isChipDropdown, columnGap: theme.spacing[2] }, { children: [prefix, jsxRuntime.jsxs(ctDesignContainer.Container, __assign({ css: getContainerStyles({
|
|
267
|
+
shrinked: !!label && (focused || filled),
|
|
268
|
+
isChipDropdown: !!isChipDropdown,
|
|
269
|
+
height: height,
|
|
270
|
+
size: size,
|
|
271
|
+
theme: theme,
|
|
272
|
+
disabled: disabled,
|
|
273
|
+
multiline: multiline,
|
|
274
|
+
}) }, { children: [label ? (jsxRuntime.jsx(Label, __assign({ theme: theme, color: helperColor, focused: focused, filled: filled, multiline: multiline }, { children: jsxRuntime.jsx(ctDesignTypography.Typography, __assign({ variant: 'B1', color: ctDesignTypography.TypographyColor.TERTIARY }, labelTypographyProps, { children: label })) }))) : (placeholder && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: typeof placeholder === 'string' || (Array.isArray(placeholder) && placeholder.length == 1) ? (jsxRuntime.jsx(Placeholder, __assign({ filled: filled, theme: theme, size: size, multiline: multiline }, { children: jsxRuntime.jsx(ctDesignTypography.Typography, __assign({ variant: placeholderTextVariant, color: ctDesignTypography.TypographyColor.DISABLED, className: 'tt-ellipsis' }, { children: getPlaceHolderText(placeholder) })) }))) : (jsxRuntime.jsx(ctDesignContainer.Container, __assign({ width: '100%', height: '20px', position: 'absolute', css: {
|
|
275
|
+
top: "".concat(multiline ? '0' : '50%'),
|
|
276
|
+
transform: "".concat(multiline ? null : 'translateY(-50%)'),
|
|
277
|
+
overflow: 'hidden',
|
|
278
|
+
} }, { children: placeholder.map(function (txt, index) { return (jsxRuntime.jsx(MultiPlaceholder, __assign({ filled: filled, theme: theme, size: size, multiline: multiline, animationTime: animationTime, placeholderLength: placeholder.length, placeholderIndex: index, animationKey: animationKey }, { children: jsxRuntime.jsx(ctDesignTypography.Typography, __assign({ variant: placeholderTextVariant, color: ctDesignTypography.TypographyColor.DISABLED, className: 'tt-ellipsis' }, { children: txt })) }))); }) }))) }))), multiline ? (jsxRuntime.jsx(TextArea, __assign({ theme: theme, rows: rows, column: column, ref: textAreaRef, autoComplete: 'off', onFocus: handleFocus, onBlur: handleBlur, value: value, onChange: handleChange, filled: filled, focused: focused, name: name, isChipDropdown: isChipDropdown }, rest))) : (jsxRuntime.jsx(Input, __assign({ ref: inputRef, theme: theme, type: showPassword ? 'text' : type, readOnly: select || nonInput, autoComplete: 'off', onFocus: handleFocus, onBlur: handleBlur, value: value, onChange: handleChange, filled: filled, focused: focused, name: name, select: select, disabled: disabled, isChipDropdown: isChipDropdown, style: inputStyles }, rest)))] })), suffix] })), (helperText || error) && !disabled && (jsxRuntime.jsx(ctDesignContainer.Container, __assign({ className: 'flex flex-wrap', width: width, paddingLeft: '16px' }, { children: jsxRuntime.jsx(ctDesignTypography.Typography, __assign({ variant: 'B3', color: error ? ctDesignTypography.TypographyColor.WARNING : ctDesignTypography.TypographyColor.SUBHEADING }, { children: helperText || error })) })))] })));
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
exports.TextField = TextField;
|
|
282
|
+
|
|
283
|
+
}));
|
|
284
|
+
//# sourceMappingURL=ct-design-text-field.umd.js.map
|