@draftbit/core 46.2.0 → 46.2.1-45f2e3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Accordion/AccordionItem.js +24 -5
- package/lib/commonjs/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponentType.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -14
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/StarRating.js +24 -5
- package/lib/commonjs/components/StarRating.js.map +1 -1
- package/lib/commonjs/mappings/ActionSheetItem.js.map +1 -1
- package/lib/commonjs/mappings/BlurView.js.map +1 -1
- package/lib/commonjs/mappings/FlatList.js +4 -0
- package/lib/commonjs/mappings/FlatList.js.map +1 -1
- package/lib/commonjs/mappings/NumberInput.js +241 -0
- package/lib/commonjs/mappings/NumberInput.js.map +1 -0
- package/lib/commonjs/mappings/RadioButton.js.map +1 -1
- package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
- package/lib/commonjs/mappings/Text.js +33 -26
- package/lib/commonjs/mappings/Text.js.map +1 -1
- package/lib/commonjs/mappings/TextArea.js +181 -2
- package/lib/commonjs/mappings/TextArea.js.map +1 -1
- package/lib/commonjs/mappings/TextField.js +191 -2
- package/lib/commonjs/mappings/TextField.js.map +1 -1
- package/lib/commonjs/mappings/TextInput.js +180 -29
- package/lib/commonjs/mappings/TextInput.js.map +1 -1
- package/lib/module/components/AvatarEdit.js +16 -5
- package/lib/module/components/AvatarEdit.js.map +1 -1
- package/lib/module/components/CardBlock.js +15 -5
- package/lib/module/components/CardBlock.js.map +1 -1
- package/lib/module/components/Checkbox/CheckboxRow.js +23 -6
- package/lib/module/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/module/mappings/FlatList.js +4 -0
- package/lib/module/mappings/FlatList.js.map +1 -1
- package/lib/module/mappings/NumberInput.js +231 -0
- package/lib/module/mappings/NumberInput.js.map +1 -0
- package/lib/module/mappings/Text.js +33 -26
- package/lib/module/mappings/Text.js.map +1 -1
- package/lib/module/mappings/TextArea.js +182 -3
- package/lib/module/mappings/TextArea.js.map +1 -1
- package/lib/module/mappings/TextField.js +192 -3
- package/lib/module/mappings/TextField.js.map +1 -1
- package/lib/module/mappings/TextInput.js +180 -29
- package/lib/module/mappings/TextInput.js.map +1 -1
- package/lib/typescript/src/mappings/FlatList.d.ts +10 -0
- package/lib/typescript/src/mappings/NumberInput.d.ts +297 -0
- package/lib/typescript/src/mappings/Text.d.ts +24 -10
- package/lib/typescript/src/mappings/TextArea.d.ts +1 -11
- package/lib/typescript/src/mappings/TextField.d.ts +4 -4
- package/lib/typescript/src/mappings/TextInput.d.ts +3 -254
- package/package.json +2 -2
- package/src/mappings/FlatList.js +4 -0
- package/src/mappings/FlatList.ts +4 -0
- package/src/mappings/NumberInput.js +248 -0
- package/src/mappings/NumberInput.ts +267 -0
- package/src/mappings/Text.js +33 -26
- package/src/mappings/Text.ts +34 -27
- package/src/mappings/TextArea.js +210 -3
- package/src/mappings/TextArea.ts +216 -3
- package/src/mappings/TextField.js +220 -3
- package/src/mappings/TextField.ts +227 -3
- package/src/mappings/TextInput.js +208 -31
- package/src/mappings/TextInput.ts +214 -34
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.
|
|
3
|
+
"version": "46.2.1-45f2e3.2+45f2e37a",
|
|
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": "45f2e37aeec4facacdf0aa6d3359267207a9a9cd"
|
|
83
83
|
}
|
package/src/mappings/FlatList.js
CHANGED
|
@@ -12,6 +12,10 @@ export const SEED_DATA = {
|
|
|
12
12
|
label: "Horizontal",
|
|
13
13
|
description: "Render list horizontally",
|
|
14
14
|
}),
|
|
15
|
+
inverted: createStaticBoolProp({
|
|
16
|
+
label: "Inverted",
|
|
17
|
+
description: "If true, reverses the direction.",
|
|
18
|
+
}),
|
|
15
19
|
numColumns: createNumColumnsType({
|
|
16
20
|
editable: true,
|
|
17
21
|
}),
|
package/src/mappings/FlatList.ts
CHANGED
|
@@ -17,6 +17,10 @@ export const SEED_DATA = {
|
|
|
17
17
|
label: "Horizontal",
|
|
18
18
|
description: "Render list horizontally",
|
|
19
19
|
}),
|
|
20
|
+
inverted: createStaticBoolProp({
|
|
21
|
+
label: "Inverted",
|
|
22
|
+
description: "If true, reverses the direction.",
|
|
23
|
+
}),
|
|
20
24
|
numColumns: createNumColumnsType({
|
|
21
25
|
editable: true,
|
|
22
26
|
}),
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, Triggers, } from "@draftbit/types";
|
|
2
|
+
const NUMBER_INPUT_PROPS = {
|
|
3
|
+
allowFontScaling: {
|
|
4
|
+
group: GROUPS.advanced,
|
|
5
|
+
label: "Allow Font Scaling",
|
|
6
|
+
description: "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
|
|
7
|
+
editable: true,
|
|
8
|
+
required: false,
|
|
9
|
+
defaultValue: null,
|
|
10
|
+
formType: FORM_TYPES.boolean,
|
|
11
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
12
|
+
},
|
|
13
|
+
autoFocus: {
|
|
14
|
+
group: GROUPS.basic,
|
|
15
|
+
label: "Auto Focus",
|
|
16
|
+
description: "Focuses the input on load in and brings up the keyboard",
|
|
17
|
+
editable: true,
|
|
18
|
+
required: false,
|
|
19
|
+
defaultValue: null,
|
|
20
|
+
formType: FORM_TYPES.boolean,
|
|
21
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
22
|
+
},
|
|
23
|
+
caretHidden: {
|
|
24
|
+
group: GROUPS.advanced,
|
|
25
|
+
label: "Hide Caret",
|
|
26
|
+
description: "Hides the caret(the line small line underneath each showing where you're editing/typing",
|
|
27
|
+
editable: true,
|
|
28
|
+
required: false,
|
|
29
|
+
defaultValue: null,
|
|
30
|
+
formType: FORM_TYPES.boolean,
|
|
31
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
32
|
+
},
|
|
33
|
+
contextMenuHidden: {
|
|
34
|
+
group: GROUPS.advanced,
|
|
35
|
+
label: "Hide Context Menu",
|
|
36
|
+
description: "Hides the system context menu (Default: false)",
|
|
37
|
+
editable: true,
|
|
38
|
+
required: false,
|
|
39
|
+
defaultValue: null,
|
|
40
|
+
formType: FORM_TYPES.boolean,
|
|
41
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
42
|
+
},
|
|
43
|
+
editable: {
|
|
44
|
+
group: GROUPS.advanced,
|
|
45
|
+
label: "Editable",
|
|
46
|
+
description: "If false, the text is not editable",
|
|
47
|
+
editable: true,
|
|
48
|
+
required: false,
|
|
49
|
+
defaultValue: true,
|
|
50
|
+
formType: FORM_TYPES.boolean,
|
|
51
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
52
|
+
},
|
|
53
|
+
keyboardAppearance: {
|
|
54
|
+
group: GROUPS.advanced,
|
|
55
|
+
label: "Keyboard Appearance",
|
|
56
|
+
description: "Determines the color of the keyboard.(iOS Only)",
|
|
57
|
+
editable: true,
|
|
58
|
+
required: false,
|
|
59
|
+
defaultValue: null,
|
|
60
|
+
options: ["default", "light", "dark"],
|
|
61
|
+
formType: FORM_TYPES.flatArray,
|
|
62
|
+
propType: PROP_TYPES.STRING,
|
|
63
|
+
},
|
|
64
|
+
keyboardType: {
|
|
65
|
+
group: GROUPS.advanced,
|
|
66
|
+
label: "Keyboard Type",
|
|
67
|
+
description: "Determines what keyboard is given to the user.",
|
|
68
|
+
editable: true,
|
|
69
|
+
required: false,
|
|
70
|
+
defaultValue: null,
|
|
71
|
+
options: ["numeric", "numbers-and-punctuation", "number-pad"],
|
|
72
|
+
formType: FORM_TYPES.flatArray,
|
|
73
|
+
propType: PROP_TYPES.STRING,
|
|
74
|
+
},
|
|
75
|
+
maxLength: {
|
|
76
|
+
group: GROUPS.basic,
|
|
77
|
+
label: "Max Length",
|
|
78
|
+
description: "Limits the input to a set number of characters.",
|
|
79
|
+
editable: true,
|
|
80
|
+
required: false,
|
|
81
|
+
defaultValue: null,
|
|
82
|
+
min: 0,
|
|
83
|
+
step: 1,
|
|
84
|
+
precision: 0,
|
|
85
|
+
formType: FORM_TYPES.number,
|
|
86
|
+
propType: PROP_TYPES.NUMBER,
|
|
87
|
+
},
|
|
88
|
+
placeholder: {
|
|
89
|
+
group: GROUPS.basic,
|
|
90
|
+
label: "Placeholder Text",
|
|
91
|
+
description: "The text that is shown on load when no value is available.",
|
|
92
|
+
editable: true,
|
|
93
|
+
required: false,
|
|
94
|
+
defaultValue: "Enter a number...",
|
|
95
|
+
formType: FORM_TYPES.string,
|
|
96
|
+
propType: PROP_TYPES.STRING,
|
|
97
|
+
},
|
|
98
|
+
placeholderTextColor: {
|
|
99
|
+
group: GROUPS.basic,
|
|
100
|
+
label: "Placeholder Text Color",
|
|
101
|
+
description: "The color of the placeholder text.",
|
|
102
|
+
editable: true,
|
|
103
|
+
required: false,
|
|
104
|
+
defaultValue: null,
|
|
105
|
+
formType: FORM_TYPES.color,
|
|
106
|
+
propType: PROP_TYPES.STRING,
|
|
107
|
+
},
|
|
108
|
+
returnKeyLabel: {
|
|
109
|
+
group: GROUPS.advanced,
|
|
110
|
+
label: "Return Key Label",
|
|
111
|
+
description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
|
|
112
|
+
editable: true,
|
|
113
|
+
required: false,
|
|
114
|
+
defaultValue: null,
|
|
115
|
+
formType: FORM_TYPES.string,
|
|
116
|
+
propType: PROP_TYPES.STRING,
|
|
117
|
+
},
|
|
118
|
+
returnKeyType: {
|
|
119
|
+
group: GROUPS.advanced,
|
|
120
|
+
label: "Return Key Type",
|
|
121
|
+
description: "Determines how the return key should look like",
|
|
122
|
+
editable: true,
|
|
123
|
+
required: false,
|
|
124
|
+
defaultValue: null,
|
|
125
|
+
options: [
|
|
126
|
+
"done",
|
|
127
|
+
"go",
|
|
128
|
+
"next",
|
|
129
|
+
"search",
|
|
130
|
+
"send",
|
|
131
|
+
"none",
|
|
132
|
+
"previous",
|
|
133
|
+
"default",
|
|
134
|
+
"emergency-call",
|
|
135
|
+
"google",
|
|
136
|
+
"join",
|
|
137
|
+
"route",
|
|
138
|
+
"yahoo",
|
|
139
|
+
],
|
|
140
|
+
formType: FORM_TYPES.flatArray,
|
|
141
|
+
propType: PROP_TYPES.STRING,
|
|
142
|
+
},
|
|
143
|
+
selectionColor: {
|
|
144
|
+
group: GROUPS.advanced,
|
|
145
|
+
label: "Selection Color",
|
|
146
|
+
description: "Color of the highlighted portion when selecting.",
|
|
147
|
+
editable: true,
|
|
148
|
+
required: false,
|
|
149
|
+
defaultValue: null,
|
|
150
|
+
formType: FORM_TYPES.color,
|
|
151
|
+
propType: PROP_TYPES.STRING,
|
|
152
|
+
},
|
|
153
|
+
selectTextOnFocus: {
|
|
154
|
+
group: GROUPS.advanced,
|
|
155
|
+
label: "Select Text on Focus",
|
|
156
|
+
description: "If true, all the text will automatically be selected on focus",
|
|
157
|
+
editable: true,
|
|
158
|
+
required: false,
|
|
159
|
+
defaultValue: null,
|
|
160
|
+
formType: FORM_TYPES.boolean,
|
|
161
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
export const SEED_DATA_PROPS = {
|
|
165
|
+
style: {
|
|
166
|
+
group: GROUPS.basic,
|
|
167
|
+
label: "Style",
|
|
168
|
+
description: "Text Style",
|
|
169
|
+
editable: false,
|
|
170
|
+
required: false,
|
|
171
|
+
formType: FORM_TYPES.typeStyle,
|
|
172
|
+
propType: PROP_TYPES.THEME,
|
|
173
|
+
defaultValue: null,
|
|
174
|
+
},
|
|
175
|
+
clearButtonMode: {
|
|
176
|
+
group: GROUPS.basic,
|
|
177
|
+
label: "Clear Button Mode",
|
|
178
|
+
description: "Enables a button within the textInput to clear the data entered",
|
|
179
|
+
editable: true,
|
|
180
|
+
required: false,
|
|
181
|
+
options: ["never", "while-editing", "unless-editing", "always"],
|
|
182
|
+
defaultValue: null,
|
|
183
|
+
formType: FORM_TYPES.flatArray,
|
|
184
|
+
propType: PROP_TYPES.STRING,
|
|
185
|
+
},
|
|
186
|
+
clearTextOnFocus: {
|
|
187
|
+
group: GROUPS.basic,
|
|
188
|
+
label: "Clear Text on Focus",
|
|
189
|
+
description: "If true, clears the text field automatically when its focused.",
|
|
190
|
+
editable: true,
|
|
191
|
+
required: false,
|
|
192
|
+
defaultValue: null,
|
|
193
|
+
formType: FORM_TYPES.boolean,
|
|
194
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
195
|
+
},
|
|
196
|
+
enablesReturnKeyAutomatically: {
|
|
197
|
+
group: GROUPS.basic,
|
|
198
|
+
label: "Enables Return Key Automatically",
|
|
199
|
+
description: "If true, the keyboard disables the return key when there is no text and automatically enables it when there is (Default: false)",
|
|
200
|
+
editable: true,
|
|
201
|
+
required: false,
|
|
202
|
+
defaultValue: null,
|
|
203
|
+
formType: FORM_TYPES.boolean,
|
|
204
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
205
|
+
},
|
|
206
|
+
underlineColorAndroid: {
|
|
207
|
+
group: GROUPS.basic,
|
|
208
|
+
label: "Underline color",
|
|
209
|
+
description: "(Android Only) The color of the underline(the line underneath the text when finished typing.",
|
|
210
|
+
editable: true,
|
|
211
|
+
required: false,
|
|
212
|
+
defaultValue: null,
|
|
213
|
+
formType: FORM_TYPES.color,
|
|
214
|
+
propType: PROP_TYPES.THEME,
|
|
215
|
+
},
|
|
216
|
+
fieldName: {
|
|
217
|
+
...FIELD_NAME,
|
|
218
|
+
defaultValue: "numberInputValue",
|
|
219
|
+
handlerPropName: "onChangeText",
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
export const SEED_DATA = [
|
|
223
|
+
{
|
|
224
|
+
name: "Number Input",
|
|
225
|
+
tag: "NumberInput",
|
|
226
|
+
description: "An input field that allows users to type in data.",
|
|
227
|
+
category: COMPONENT_TYPES.input,
|
|
228
|
+
preview_image_url: "https://res.cloudinary.com/altos/image/upload/draftbit/Jigsaw/TextInput.png",
|
|
229
|
+
supports_list_render: false,
|
|
230
|
+
layout: {
|
|
231
|
+
borderLeftWidth: 1,
|
|
232
|
+
borderRightWidth: 1,
|
|
233
|
+
borderTopWidth: 1,
|
|
234
|
+
borderBottomWidth: 1,
|
|
235
|
+
borderColor: "divider",
|
|
236
|
+
paddingLeft: 8,
|
|
237
|
+
paddingRight: 8,
|
|
238
|
+
paddingTop: 8,
|
|
239
|
+
paddingBottom: 8,
|
|
240
|
+
borderRadius: 8,
|
|
241
|
+
},
|
|
242
|
+
triggers: [Triggers.OnChangeText],
|
|
243
|
+
props: {
|
|
244
|
+
...SEED_DATA_PROPS,
|
|
245
|
+
...NUMBER_INPUT_PROPS,
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
];
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GROUPS,
|
|
3
|
+
COMPONENT_TYPES,
|
|
4
|
+
FORM_TYPES,
|
|
5
|
+
PROP_TYPES,
|
|
6
|
+
FIELD_NAME,
|
|
7
|
+
Triggers,
|
|
8
|
+
} from "@draftbit/types";
|
|
9
|
+
|
|
10
|
+
const NUMBER_INPUT_PROPS = {
|
|
11
|
+
allowFontScaling: {
|
|
12
|
+
group: GROUPS.advanced,
|
|
13
|
+
label: "Allow Font Scaling",
|
|
14
|
+
description:
|
|
15
|
+
"Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
|
|
16
|
+
editable: true,
|
|
17
|
+
required: false,
|
|
18
|
+
defaultValue: null,
|
|
19
|
+
formType: FORM_TYPES.boolean,
|
|
20
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
21
|
+
},
|
|
22
|
+
autoFocus: {
|
|
23
|
+
group: GROUPS.basic,
|
|
24
|
+
label: "Auto Focus",
|
|
25
|
+
description: "Focuses the input on load in and brings up the keyboard",
|
|
26
|
+
editable: true,
|
|
27
|
+
required: false,
|
|
28
|
+
defaultValue: null,
|
|
29
|
+
formType: FORM_TYPES.boolean,
|
|
30
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
31
|
+
},
|
|
32
|
+
caretHidden: {
|
|
33
|
+
group: GROUPS.advanced,
|
|
34
|
+
label: "Hide Caret",
|
|
35
|
+
description:
|
|
36
|
+
"Hides the caret(the line small line underneath each showing where you're editing/typing",
|
|
37
|
+
editable: true,
|
|
38
|
+
required: false,
|
|
39
|
+
defaultValue: null,
|
|
40
|
+
formType: FORM_TYPES.boolean,
|
|
41
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
42
|
+
},
|
|
43
|
+
contextMenuHidden: {
|
|
44
|
+
group: GROUPS.advanced,
|
|
45
|
+
label: "Hide Context Menu",
|
|
46
|
+
description: "Hides the system context menu (Default: false)",
|
|
47
|
+
editable: true,
|
|
48
|
+
required: false,
|
|
49
|
+
defaultValue: null,
|
|
50
|
+
formType: FORM_TYPES.boolean,
|
|
51
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
52
|
+
},
|
|
53
|
+
editable: {
|
|
54
|
+
group: GROUPS.advanced,
|
|
55
|
+
label: "Editable",
|
|
56
|
+
description: "If false, the text is not editable",
|
|
57
|
+
editable: true,
|
|
58
|
+
required: false,
|
|
59
|
+
defaultValue: true,
|
|
60
|
+
formType: FORM_TYPES.boolean,
|
|
61
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
62
|
+
},
|
|
63
|
+
keyboardAppearance: {
|
|
64
|
+
group: GROUPS.advanced,
|
|
65
|
+
label: "Keyboard Appearance",
|
|
66
|
+
description: "Determines the color of the keyboard.(iOS Only)",
|
|
67
|
+
editable: true,
|
|
68
|
+
required: false,
|
|
69
|
+
defaultValue: null,
|
|
70
|
+
options: ["default", "light", "dark"],
|
|
71
|
+
formType: FORM_TYPES.flatArray,
|
|
72
|
+
propType: PROP_TYPES.STRING,
|
|
73
|
+
},
|
|
74
|
+
keyboardType: {
|
|
75
|
+
group: GROUPS.advanced,
|
|
76
|
+
label: "Keyboard Type",
|
|
77
|
+
description: "Determines what keyboard is given to the user.",
|
|
78
|
+
editable: true,
|
|
79
|
+
required: false,
|
|
80
|
+
defaultValue: null,
|
|
81
|
+
options: ["numeric", "numbers-and-punctuation", "number-pad"],
|
|
82
|
+
formType: FORM_TYPES.flatArray,
|
|
83
|
+
propType: PROP_TYPES.STRING,
|
|
84
|
+
},
|
|
85
|
+
maxLength: {
|
|
86
|
+
group: GROUPS.basic,
|
|
87
|
+
label: "Max Length",
|
|
88
|
+
description: "Limits the input to a set number of characters.",
|
|
89
|
+
editable: true,
|
|
90
|
+
required: false,
|
|
91
|
+
defaultValue: null,
|
|
92
|
+
min: 0,
|
|
93
|
+
step: 1,
|
|
94
|
+
precision: 0,
|
|
95
|
+
formType: FORM_TYPES.number,
|
|
96
|
+
propType: PROP_TYPES.NUMBER,
|
|
97
|
+
},
|
|
98
|
+
placeholder: {
|
|
99
|
+
group: GROUPS.basic,
|
|
100
|
+
label: "Placeholder Text",
|
|
101
|
+
description: "The text that is shown on load when no value is available.",
|
|
102
|
+
editable: true,
|
|
103
|
+
required: false,
|
|
104
|
+
defaultValue: "Enter a number...",
|
|
105
|
+
formType: FORM_TYPES.string,
|
|
106
|
+
propType: PROP_TYPES.STRING,
|
|
107
|
+
},
|
|
108
|
+
placeholderTextColor: {
|
|
109
|
+
group: GROUPS.basic,
|
|
110
|
+
label: "Placeholder Text Color",
|
|
111
|
+
description: "The color of the placeholder text.",
|
|
112
|
+
editable: true,
|
|
113
|
+
required: false,
|
|
114
|
+
defaultValue: null,
|
|
115
|
+
formType: FORM_TYPES.color,
|
|
116
|
+
propType: PROP_TYPES.STRING,
|
|
117
|
+
},
|
|
118
|
+
returnKeyLabel: {
|
|
119
|
+
group: GROUPS.advanced,
|
|
120
|
+
label: "Return Key Label",
|
|
121
|
+
description:
|
|
122
|
+
"(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
|
|
123
|
+
editable: true,
|
|
124
|
+
required: false,
|
|
125
|
+
defaultValue: null,
|
|
126
|
+
formType: FORM_TYPES.string,
|
|
127
|
+
propType: PROP_TYPES.STRING,
|
|
128
|
+
},
|
|
129
|
+
returnKeyType: {
|
|
130
|
+
group: GROUPS.advanced,
|
|
131
|
+
label: "Return Key Type",
|
|
132
|
+
description: "Determines how the return key should look like",
|
|
133
|
+
editable: true,
|
|
134
|
+
required: false,
|
|
135
|
+
defaultValue: null,
|
|
136
|
+
options: [
|
|
137
|
+
"done",
|
|
138
|
+
"go",
|
|
139
|
+
"next",
|
|
140
|
+
"search",
|
|
141
|
+
"send",
|
|
142
|
+
"none",
|
|
143
|
+
"previous",
|
|
144
|
+
"default",
|
|
145
|
+
"emergency-call",
|
|
146
|
+
"google",
|
|
147
|
+
"join",
|
|
148
|
+
"route",
|
|
149
|
+
"yahoo",
|
|
150
|
+
],
|
|
151
|
+
formType: FORM_TYPES.flatArray,
|
|
152
|
+
propType: PROP_TYPES.STRING,
|
|
153
|
+
},
|
|
154
|
+
selectionColor: {
|
|
155
|
+
group: GROUPS.advanced,
|
|
156
|
+
label: "Selection Color",
|
|
157
|
+
description: "Color of the highlighted portion when selecting.",
|
|
158
|
+
editable: true,
|
|
159
|
+
required: false,
|
|
160
|
+
defaultValue: null,
|
|
161
|
+
formType: FORM_TYPES.color,
|
|
162
|
+
propType: PROP_TYPES.STRING,
|
|
163
|
+
},
|
|
164
|
+
selectTextOnFocus: {
|
|
165
|
+
group: GROUPS.advanced,
|
|
166
|
+
label: "Select Text on Focus",
|
|
167
|
+
description:
|
|
168
|
+
"If true, all the text will automatically be selected on focus",
|
|
169
|
+
editable: true,
|
|
170
|
+
required: false,
|
|
171
|
+
defaultValue: null,
|
|
172
|
+
formType: FORM_TYPES.boolean,
|
|
173
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const SEED_DATA_PROPS = {
|
|
178
|
+
style: {
|
|
179
|
+
group: GROUPS.basic,
|
|
180
|
+
label: "Style",
|
|
181
|
+
description: "Text Style",
|
|
182
|
+
editable: false,
|
|
183
|
+
required: false,
|
|
184
|
+
formType: FORM_TYPES.typeStyle,
|
|
185
|
+
propType: PROP_TYPES.THEME,
|
|
186
|
+
defaultValue: null,
|
|
187
|
+
},
|
|
188
|
+
clearButtonMode: {
|
|
189
|
+
group: GROUPS.basic,
|
|
190
|
+
label: "Clear Button Mode",
|
|
191
|
+
description:
|
|
192
|
+
"Enables a button within the textInput to clear the data entered",
|
|
193
|
+
editable: true,
|
|
194
|
+
required: false,
|
|
195
|
+
options: ["never", "while-editing", "unless-editing", "always"],
|
|
196
|
+
defaultValue: null,
|
|
197
|
+
formType: FORM_TYPES.flatArray,
|
|
198
|
+
propType: PROP_TYPES.STRING,
|
|
199
|
+
},
|
|
200
|
+
clearTextOnFocus: {
|
|
201
|
+
group: GROUPS.basic,
|
|
202
|
+
label: "Clear Text on Focus",
|
|
203
|
+
description:
|
|
204
|
+
"If true, clears the text field automatically when its focused.",
|
|
205
|
+
editable: true,
|
|
206
|
+
required: false,
|
|
207
|
+
defaultValue: null,
|
|
208
|
+
formType: FORM_TYPES.boolean,
|
|
209
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
210
|
+
},
|
|
211
|
+
enablesReturnKeyAutomatically: {
|
|
212
|
+
group: GROUPS.basic,
|
|
213
|
+
label: "Enables Return Key Automatically",
|
|
214
|
+
description:
|
|
215
|
+
"If true, the keyboard disables the return key when there is no text and automatically enables it when there is (Default: false)",
|
|
216
|
+
editable: true,
|
|
217
|
+
required: false,
|
|
218
|
+
defaultValue: null,
|
|
219
|
+
formType: FORM_TYPES.boolean,
|
|
220
|
+
propType: PROP_TYPES.BOOLEAN,
|
|
221
|
+
},
|
|
222
|
+
underlineColorAndroid: {
|
|
223
|
+
group: GROUPS.basic,
|
|
224
|
+
label: "Underline color",
|
|
225
|
+
description:
|
|
226
|
+
"(Android Only) The color of the underline(the line underneath the text when finished typing.",
|
|
227
|
+
editable: true,
|
|
228
|
+
required: false,
|
|
229
|
+
defaultValue: null,
|
|
230
|
+
formType: FORM_TYPES.color,
|
|
231
|
+
propType: PROP_TYPES.THEME,
|
|
232
|
+
},
|
|
233
|
+
fieldName: {
|
|
234
|
+
...FIELD_NAME,
|
|
235
|
+
defaultValue: "numberInputValue",
|
|
236
|
+
handlerPropName: "onChangeText",
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export const SEED_DATA = [
|
|
241
|
+
{
|
|
242
|
+
name: "Number Input",
|
|
243
|
+
tag: "NumberInput",
|
|
244
|
+
description: "An input field that allows users to type in data.",
|
|
245
|
+
category: COMPONENT_TYPES.input,
|
|
246
|
+
preview_image_url:
|
|
247
|
+
"https://res.cloudinary.com/altos/image/upload/draftbit/Jigsaw/TextInput.png",
|
|
248
|
+
supports_list_render: false,
|
|
249
|
+
layout: {
|
|
250
|
+
borderLeftWidth: 1,
|
|
251
|
+
borderRightWidth: 1,
|
|
252
|
+
borderTopWidth: 1,
|
|
253
|
+
borderBottomWidth: 1,
|
|
254
|
+
borderColor: "divider",
|
|
255
|
+
paddingLeft: 8,
|
|
256
|
+
paddingRight: 8,
|
|
257
|
+
paddingTop: 8,
|
|
258
|
+
paddingBottom: 8,
|
|
259
|
+
borderRadius: 8,
|
|
260
|
+
},
|
|
261
|
+
triggers: [Triggers.OnChangeText],
|
|
262
|
+
props: {
|
|
263
|
+
...SEED_DATA_PROPS,
|
|
264
|
+
...NUMBER_INPUT_PROPS,
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
];
|
package/src/mappings/Text.js
CHANGED
|
@@ -5,7 +5,18 @@ const SEED_DATA_PROPS = {
|
|
|
5
5
|
name: "accessibilityLabel",
|
|
6
6
|
label: "accessibilityLabel",
|
|
7
7
|
description: "Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space.",
|
|
8
|
-
editable:
|
|
8
|
+
editable: true,
|
|
9
|
+
required: false,
|
|
10
|
+
formType: FORM_TYPES.string,
|
|
11
|
+
propType: PROP_TYPES.STRING,
|
|
12
|
+
defaultValue: null,
|
|
13
|
+
},
|
|
14
|
+
accessibilityHint: {
|
|
15
|
+
group: GROUPS.accessibility,
|
|
16
|
+
name: "accessibilityHint",
|
|
17
|
+
label: "accessibilityHint",
|
|
18
|
+
description: "An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.",
|
|
19
|
+
editable: true,
|
|
9
20
|
required: false,
|
|
10
21
|
formType: FORM_TYPES.string,
|
|
11
22
|
propType: PROP_TYPES.STRING,
|
|
@@ -29,7 +40,7 @@ const SEED_DATA_PROPS = {
|
|
|
29
40
|
"imagebutton",
|
|
30
41
|
"adjustable",
|
|
31
42
|
],
|
|
32
|
-
editable:
|
|
43
|
+
editable: true,
|
|
33
44
|
required: false,
|
|
34
45
|
formType: FORM_TYPES.flatArray,
|
|
35
46
|
propType: PROP_TYPES.STRING,
|
|
@@ -39,8 +50,8 @@ const SEED_DATA_PROPS = {
|
|
|
39
50
|
group: GROUPS.accessibility,
|
|
40
51
|
name: "accessible",
|
|
41
52
|
label: "accessible",
|
|
42
|
-
description: "When set to true, indicates that the view is an accessibility element. The default value for a Text element is true.See the Accessibility guide for more information.",
|
|
43
|
-
editable:
|
|
53
|
+
description: "When set to true, indicates that the view is an accessibility element. The default value for a Text element is true. See the Accessibility guide for more information.",
|
|
54
|
+
editable: true,
|
|
44
55
|
required: false,
|
|
45
56
|
formType: FORM_TYPES.boolean,
|
|
46
57
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -51,7 +62,7 @@ const SEED_DATA_PROPS = {
|
|
|
51
62
|
name: "adjustsFontSizeToFit",
|
|
52
63
|
label: "adjustsFontSizeToFit",
|
|
53
64
|
description: "Specifies whether fonts should be scaled down automatically to fit given style constraints.",
|
|
54
|
-
editable:
|
|
65
|
+
editable: true,
|
|
55
66
|
required: false,
|
|
56
67
|
formType: FORM_TYPES.boolean,
|
|
57
68
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -62,7 +73,7 @@ const SEED_DATA_PROPS = {
|
|
|
62
73
|
name: "allowFontScaling",
|
|
63
74
|
label: "allowFontScaling",
|
|
64
75
|
description: "Specifies whether fonts should scale to respect Text Size accessibility settings. The default is true.",
|
|
65
|
-
editable:
|
|
76
|
+
editable: true,
|
|
66
77
|
required: false,
|
|
67
78
|
formType: FORM_TYPES.boolean,
|
|
68
79
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -72,9 +83,9 @@ const SEED_DATA_PROPS = {
|
|
|
72
83
|
group: GROUPS.advanced,
|
|
73
84
|
name: "dataDetectorType",
|
|
74
85
|
label: "dataDetectorType",
|
|
75
|
-
description: "Determines the types of data converted to clickable URLs in the text element. By default no data types are detected.You can provide only one type.Possible values for dataDetectorType are:\n'phoneNumber'\n'link'\n'email'\n'none'\n'all'\n",
|
|
86
|
+
description: "Determines the types of data converted to clickable URLs in the text element. By default no data types are detected. You can provide only one type. Possible values for dataDetectorType are:\n'phoneNumber'\n'link'\n'email'\n'none'\n'all'\n",
|
|
76
87
|
options: ["phoneNumber", "link", "email", "none", "all"],
|
|
77
|
-
editable:
|
|
88
|
+
editable: true,
|
|
78
89
|
required: false,
|
|
79
90
|
formType: FORM_TYPES.flatArray,
|
|
80
91
|
propType: PROP_TYPES.STRING,
|
|
@@ -85,7 +96,7 @@ const SEED_DATA_PROPS = {
|
|
|
85
96
|
name: "disabled",
|
|
86
97
|
label: "disabled",
|
|
87
98
|
description: "Specifies the disabled state of the text view for testing purposes",
|
|
88
|
-
editable:
|
|
99
|
+
editable: true,
|
|
89
100
|
required: false,
|
|
90
101
|
formType: FORM_TYPES.boolean,
|
|
91
102
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -108,25 +119,21 @@ const SEED_DATA_PROPS = {
|
|
|
108
119
|
name: "maxFontSizeMultiplier",
|
|
109
120
|
label: "maxFontSizeMultiplier",
|
|
110
121
|
description: "Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values:\nnull/undefined (default): inherit from the parent node or the global default (0)\n0: no max, ignore parent/global default\n>= 1: sets the maxFontSizeMultiplier of this node to this value\n",
|
|
111
|
-
editable:
|
|
122
|
+
editable: true,
|
|
112
123
|
required: false,
|
|
113
124
|
formType: FORM_TYPES.number,
|
|
114
125
|
propType: PROP_TYPES.NUMBER,
|
|
115
126
|
defaultValue: null,
|
|
116
127
|
},
|
|
117
|
-
|
|
118
|
-
group: GROUPS.
|
|
119
|
-
name: "
|
|
120
|
-
label: "
|
|
121
|
-
description: "
|
|
122
|
-
editable:
|
|
128
|
+
nativeID: {
|
|
129
|
+
group: GROUPS.accessibility,
|
|
130
|
+
name: "nativeID",
|
|
131
|
+
label: "nativeID",
|
|
132
|
+
description: "Used to locate this view from native code.",
|
|
133
|
+
editable: true,
|
|
123
134
|
required: false,
|
|
124
|
-
formType: FORM_TYPES.
|
|
125
|
-
propType: PROP_TYPES.
|
|
126
|
-
min: 0.01,
|
|
127
|
-
step: 0.01,
|
|
128
|
-
precision: 2,
|
|
129
|
-
max: 1.0,
|
|
135
|
+
formType: FORM_TYPES.string,
|
|
136
|
+
propType: PROP_TYPES.STRING,
|
|
130
137
|
defaultValue: null,
|
|
131
138
|
},
|
|
132
139
|
numberOfLines: {
|
|
@@ -147,7 +154,7 @@ const SEED_DATA_PROPS = {
|
|
|
147
154
|
name: "selectable",
|
|
148
155
|
label: "selectable",
|
|
149
156
|
description: "Lets the user select text, to use the native copy and paste functionality.",
|
|
150
|
-
editable:
|
|
157
|
+
editable: true,
|
|
151
158
|
required: false,
|
|
152
159
|
formType: FORM_TYPES.boolean,
|
|
153
160
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -158,7 +165,7 @@ const SEED_DATA_PROPS = {
|
|
|
158
165
|
name: "selectionColor",
|
|
159
166
|
label: "selectionColor",
|
|
160
167
|
description: "The highlight color of the text.",
|
|
161
|
-
editable:
|
|
168
|
+
editable: true,
|
|
162
169
|
required: false,
|
|
163
170
|
formType: FORM_TYPES.color,
|
|
164
171
|
propType: PROP_TYPES.THEME,
|
|
@@ -169,7 +176,7 @@ const SEED_DATA_PROPS = {
|
|
|
169
176
|
name: "suppressHighlighting",
|
|
170
177
|
label: "suppressHighlighting",
|
|
171
178
|
description: "When true, no visual change is made when text is pressed down. By default, a gray oval highlights the text on press down.",
|
|
172
|
-
editable:
|
|
179
|
+
editable: true,
|
|
173
180
|
required: false,
|
|
174
181
|
formType: FORM_TYPES.boolean,
|
|
175
182
|
propType: PROP_TYPES.BOOLEAN,
|
|
@@ -181,7 +188,7 @@ const SEED_DATA_PROPS = {
|
|
|
181
188
|
label: "textBreakStrategy",
|
|
182
189
|
description: "Set text break strategy on Android API Level 23+, possible values are simple, highQuality, balanced The default value is highQuality.",
|
|
183
190
|
options: ["simple", "highQuality", "balanced"],
|
|
184
|
-
editable:
|
|
191
|
+
editable: true,
|
|
185
192
|
required: false,
|
|
186
193
|
formType: FORM_TYPES.flatArray,
|
|
187
194
|
propType: PROP_TYPES.STRING,
|