@draftbit/core 46.2.3 → 46.2.4-d94d1a.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/lib/commonjs/components/Accordion/AccordionItem.js +5 -25
- package/lib/commonjs/components/TextField.js +2 -1
- package/lib/commonjs/mappings/TextField.js +4 -0
- package/lib/module/components/TextField.js +2 -1
- package/lib/module/mappings/TextField.js +4 -0
- package/lib/typescript/src/components/TextField.d.ts +1 -0
- package/lib/typescript/src/mappings/TextField.d.ts +10 -0
- package/package.json +2 -2
- package/src/components/TextField.js +2 -2
- package/src/components/TextField.tsx +3 -1
- package/src/mappings/TextField.js +4 -0
- package/src/mappings/TextField.ts +4 -0
|
@@ -21,6 +21,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
25
|
+
|
|
24
26
|
const AccordionItem = _ref => {
|
|
25
27
|
let {
|
|
26
28
|
Icon,
|
|
@@ -35,10 +37,9 @@ const AccordionItem = _ref => {
|
|
|
35
37
|
textStyles,
|
|
36
38
|
viewStyles
|
|
37
39
|
} = (0, _utilities.extractStyles)(style);
|
|
38
|
-
return /*#__PURE__*/React.createElement(_reactNative.Pressable, {
|
|
39
|
-
style: [styles.container, viewStyles]
|
|
40
|
-
|
|
41
|
-
}, /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
40
|
+
return /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({
|
|
41
|
+
style: [styles.container, viewStyles]
|
|
42
|
+
}, rest), /*#__PURE__*/React.createElement(_reactNative.View, {
|
|
42
43
|
style: styles.row
|
|
43
44
|
}, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
44
45
|
name: icon,
|
|
@@ -73,25 +74,4 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
73
74
|
|
|
74
75
|
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
75
76
|
|
|
76
|
-
exports.default = _default;StyleSheet.create({
|
|
77
|
-
container: {
|
|
78
|
-
padding: 8
|
|
79
|
-
},
|
|
80
|
-
row: {
|
|
81
|
-
flexDirection: "row",
|
|
82
|
-
alignItems: "center",
|
|
83
|
-
paddingLeft: 8
|
|
84
|
-
},
|
|
85
|
-
item: {
|
|
86
|
-
marginVertical: 6,
|
|
87
|
-
paddingLeft: 8
|
|
88
|
-
},
|
|
89
|
-
content: {
|
|
90
|
-
flex: 1,
|
|
91
|
-
justifyContent: "center"
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
var _default = (0, _theming.withTheme)(AccordionItem);
|
|
96
|
-
|
|
97
77
|
exports.default = _default;
|
|
@@ -193,6 +193,7 @@ class TextField extends React.Component {
|
|
|
193
193
|
rightIconName,
|
|
194
194
|
assistiveText,
|
|
195
195
|
underlineColor: underlineColorProp,
|
|
196
|
+
activeBorderColor: activeBorderColorProp,
|
|
196
197
|
multiline = false,
|
|
197
198
|
numberOfLines = 4,
|
|
198
199
|
style,
|
|
@@ -220,7 +221,7 @@ class TextField extends React.Component {
|
|
|
220
221
|
underlineColor = "transparent";
|
|
221
222
|
backgroundColor = colors.divider;
|
|
222
223
|
} else {
|
|
223
|
-
activeColor = error ? colors.error :
|
|
224
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
224
225
|
placeholderColor = borderColor = colors.light;
|
|
225
226
|
underlineColor = underlineColorProp;
|
|
226
227
|
backgroundColor = colors.background;
|
|
@@ -290,6 +290,10 @@ const SEED_DATA = [{
|
|
|
290
290
|
label: "Underline Color",
|
|
291
291
|
defaultValue: "light"
|
|
292
292
|
}),
|
|
293
|
+
activeBorderColor: (0, _types.createColorProp)({
|
|
294
|
+
label: "Active Border Color",
|
|
295
|
+
defaultValue: "primary"
|
|
296
|
+
}),
|
|
293
297
|
secureTextEntry: {
|
|
294
298
|
group: _types.GROUPS.basic,
|
|
295
299
|
label: "Password field",
|
|
@@ -177,6 +177,7 @@ class TextField extends React.Component {
|
|
|
177
177
|
rightIconName,
|
|
178
178
|
assistiveText,
|
|
179
179
|
underlineColor: underlineColorProp,
|
|
180
|
+
activeBorderColor: activeBorderColorProp,
|
|
180
181
|
multiline = false,
|
|
181
182
|
numberOfLines = 4,
|
|
182
183
|
style,
|
|
@@ -204,7 +205,7 @@ class TextField extends React.Component {
|
|
|
204
205
|
underlineColor = "transparent";
|
|
205
206
|
backgroundColor = colors.divider;
|
|
206
207
|
} else {
|
|
207
|
-
activeColor = error ? colors.error :
|
|
208
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
208
209
|
placeholderColor = borderColor = colors.light;
|
|
209
210
|
underlineColor = underlineColorProp;
|
|
210
211
|
backgroundColor = colors.background;
|
|
@@ -282,6 +282,10 @@ export const SEED_DATA = [{
|
|
|
282
282
|
label: "Underline Color",
|
|
283
283
|
defaultValue: "light"
|
|
284
284
|
}),
|
|
285
|
+
activeBorderColor: createColorProp({
|
|
286
|
+
label: "Active Border Color",
|
|
287
|
+
defaultValue: "primary"
|
|
288
|
+
}),
|
|
285
289
|
secureTextEntry: {
|
|
286
290
|
group: GROUPS.basic,
|
|
287
291
|
label: "Password field",
|
|
@@ -28,6 +28,16 @@ export declare const SEED_DATA: ({
|
|
|
28
28
|
formType: string;
|
|
29
29
|
propType: string;
|
|
30
30
|
};
|
|
31
|
+
activeBorderColor: {
|
|
32
|
+
group: string;
|
|
33
|
+
label: string;
|
|
34
|
+
description: string;
|
|
35
|
+
editable: boolean;
|
|
36
|
+
required: boolean;
|
|
37
|
+
defaultValue: null;
|
|
38
|
+
formType: string;
|
|
39
|
+
propType: string;
|
|
40
|
+
};
|
|
31
41
|
secureTextEntry: {
|
|
32
42
|
group: string;
|
|
33
43
|
label: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.
|
|
3
|
+
"version": "46.2.4-d94d1a.0+d94d1a55",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
]
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "d94d1a55b219bfcdb12682c4d2bcf3358fcc1b61"
|
|
83
83
|
}
|
|
@@ -136,7 +136,7 @@ class TextField extends React.Component {
|
|
|
136
136
|
return this._root && this._root.blur();
|
|
137
137
|
}
|
|
138
138
|
render() {
|
|
139
|
-
const { Icon, type = "underline", disabled = false, label, error = false, leftIconName, leftIconMode, rightIconName, assistiveText, underlineColor: underlineColorProp, multiline = false, numberOfLines = 4, style, theme: { colors, typography, roundness, disabledOpacity }, render = (props) => React.createElement(NativeTextInput, { ...props }), ...rest } = this.props;
|
|
139
|
+
const { Icon, type = "underline", disabled = false, label, error = false, leftIconName, leftIconMode, rightIconName, assistiveText, underlineColor: underlineColorProp, activeBorderColor: activeBorderColorProp, multiline = false, numberOfLines = 4, style, theme: { colors, typography, roundness, disabledOpacity }, render = (props) => React.createElement(NativeTextInput, { ...props }), ...rest } = this.props;
|
|
140
140
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
141
141
|
const OUTLINE_MINIMIZED_LABEL_Y_OFFSET = -(16 * 0.5 + 4);
|
|
142
142
|
const MAXIMIZED_LABEL_FONT_SIZE = typography.subtitle1.fontSize;
|
|
@@ -152,7 +152,7 @@ class TextField extends React.Component {
|
|
|
152
152
|
backgroundColor = colors.divider;
|
|
153
153
|
}
|
|
154
154
|
else {
|
|
155
|
-
activeColor = error ? colors.error :
|
|
155
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
156
156
|
placeholderColor = borderColor = colors.light;
|
|
157
157
|
underlineColor = underlineColorProp;
|
|
158
158
|
backgroundColor = colors.background;
|
|
@@ -42,6 +42,7 @@ export type Props = {
|
|
|
42
42
|
multiline?: boolean;
|
|
43
43
|
numberOfLines: number;
|
|
44
44
|
underlineColor?: string;
|
|
45
|
+
activeBorderColor?: string;
|
|
45
46
|
style?: StyleProp<ViewStyle> & { height?: number };
|
|
46
47
|
theme: Theme;
|
|
47
48
|
render?: (
|
|
@@ -237,6 +238,7 @@ class TextField extends React.Component<Props, State> {
|
|
|
237
238
|
rightIconName,
|
|
238
239
|
assistiveText,
|
|
239
240
|
underlineColor: underlineColorProp,
|
|
241
|
+
activeBorderColor: activeBorderColorProp,
|
|
240
242
|
multiline = false,
|
|
241
243
|
numberOfLines = 4,
|
|
242
244
|
style,
|
|
@@ -269,7 +271,7 @@ class TextField extends React.Component<Props, State> {
|
|
|
269
271
|
underlineColor = "transparent";
|
|
270
272
|
backgroundColor = colors.divider;
|
|
271
273
|
} else {
|
|
272
|
-
activeColor = error ? colors.error :
|
|
274
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
273
275
|
placeholderColor = borderColor = colors.light;
|
|
274
276
|
underlineColor = underlineColorProp;
|
|
275
277
|
backgroundColor = colors.background;
|
|
@@ -312,6 +312,10 @@ export const SEED_DATA = [
|
|
|
312
312
|
label: "Underline Color",
|
|
313
313
|
defaultValue: "light",
|
|
314
314
|
}),
|
|
315
|
+
activeBorderColor: createColorProp({
|
|
316
|
+
label: "Active Border Color",
|
|
317
|
+
defaultValue: "primary",
|
|
318
|
+
}),
|
|
315
319
|
secureTextEntry: {
|
|
316
320
|
group: GROUPS.basic,
|
|
317
321
|
label: "Password field",
|
|
@@ -334,6 +334,10 @@ export const SEED_DATA = [
|
|
|
334
334
|
label: "Underline Color",
|
|
335
335
|
defaultValue: "light",
|
|
336
336
|
}),
|
|
337
|
+
activeBorderColor: createColorProp({
|
|
338
|
+
label: "Active Border Color",
|
|
339
|
+
defaultValue: "primary",
|
|
340
|
+
}),
|
|
337
341
|
secureTextEntry: {
|
|
338
342
|
group: GROUPS.basic,
|
|
339
343
|
label: "Password field",
|