@draftbit/core 46.2.0 → 46.2.1-327d47.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/lib/commonjs/components/CardBlock.js +15 -5
  2. package/lib/commonjs/components/CardBlock.js.map +1 -1
  3. package/lib/commonjs/components/Checkbox/Checkbox.js +2 -4
  4. package/lib/commonjs/components/Checkbox/Checkbox.js.map +1 -1
  5. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js +23 -6
  6. package/lib/commonjs/components/Checkbox/CheckboxGroupRow.js.map +1 -1
  7. package/lib/commonjs/components/Checkbox/context.js +1 -1
  8. package/lib/commonjs/components/Checkbox/context.js.map +1 -1
  9. package/lib/commonjs/components/CircleImage.js +17 -3
  10. package/lib/commonjs/components/CircleImage.js.map +1 -1
  11. package/lib/commonjs/components/Config.js.map +1 -1
  12. package/lib/commonjs/components/DatePicker/DatePicker.js +7 -8
  13. package/lib/commonjs/components/DatePicker/DatePicker.js.map +1 -1
  14. package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
  15. package/lib/commonjs/components/DatePicker/DatePickerComponentType.js.map +1 -1
  16. package/lib/commonjs/components/DeprecatedButton.js +4 -20
  17. package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
  18. package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -14
  19. package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
  20. package/lib/commonjs/components/DeprecatedFAB.js +21 -4
  21. package/lib/commonjs/components/DeprecatedFAB.js.map +1 -1
  22. package/lib/commonjs/components/HeaderLarge.js.map +1 -1
  23. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +17 -5
  24. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
  25. package/lib/commonjs/components/Swiper/SwiperItem.js.map +1 -1
  26. package/lib/commonjs/components/Text.js +38 -11
  27. package/lib/commonjs/components/Text.js.map +1 -1
  28. package/lib/commonjs/mappings/ActionSheetItem.js.map +1 -1
  29. package/lib/commonjs/mappings/BlurView.js.map +1 -1
  30. package/lib/commonjs/mappings/CardContainerRating.js.map +1 -1
  31. package/lib/commonjs/mappings/Checkbox.js.map +1 -1
  32. package/lib/commonjs/mappings/NumberInput.js +241 -0
  33. package/lib/commonjs/mappings/NumberInput.js.map +1 -0
  34. package/lib/commonjs/mappings/RadioButtonRow.js.map +1 -1
  35. package/lib/commonjs/mappings/Text.js +33 -26
  36. package/lib/commonjs/mappings/Text.js.map +1 -1
  37. package/lib/commonjs/mappings/TextArea.js +192 -2
  38. package/lib/commonjs/mappings/TextArea.js.map +1 -1
  39. package/lib/commonjs/mappings/TextField.js +191 -2
  40. package/lib/commonjs/mappings/TextField.js.map +1 -1
  41. package/lib/commonjs/mappings/TextInput.js +180 -29
  42. package/lib/commonjs/mappings/TextInput.js.map +1 -1
  43. package/lib/commonjs/mappings/Video.js.map +1 -1
  44. package/lib/commonjs/styles/DarkTheme.js.map +1 -1
  45. package/lib/module/components/DatePicker/DatePickerComponent.js.map +1 -1
  46. package/lib/module/mappings/NumberInput.js +231 -0
  47. package/lib/module/mappings/NumberInput.js.map +1 -0
  48. package/lib/module/mappings/Surface.js.map +1 -1
  49. package/lib/module/mappings/Text.js +33 -26
  50. package/lib/module/mappings/Text.js.map +1 -1
  51. package/lib/module/mappings/TextArea.js +193 -3
  52. package/lib/module/mappings/TextArea.js.map +1 -1
  53. package/lib/module/mappings/TextField.js +192 -3
  54. package/lib/module/mappings/TextField.js.map +1 -1
  55. package/lib/module/mappings/TextInput.js +180 -29
  56. package/lib/module/mappings/TextInput.js.map +1 -1
  57. package/lib/typescript/src/mappings/NumberInput.d.ts +297 -0
  58. package/lib/typescript/src/mappings/Text.d.ts +24 -10
  59. package/lib/typescript/src/mappings/TextArea.d.ts +12 -11
  60. package/lib/typescript/src/mappings/TextField.d.ts +4 -4
  61. package/lib/typescript/src/mappings/TextInput.d.ts +3 -254
  62. package/package.json +2 -2
  63. package/src/mappings/NumberInput.js +248 -0
  64. package/src/mappings/NumberInput.ts +267 -0
  65. package/src/mappings/Text.js +33 -26
  66. package/src/mappings/Text.ts +34 -27
  67. package/src/mappings/TextArea.js +221 -3
  68. package/src/mappings/TextArea.ts +227 -3
  69. package/src/mappings/TextField.js +220 -3
  70. package/src/mappings/TextField.ts +227 -3
  71. package/src/mappings/TextInput.js +208 -31
  72. package/src/mappings/TextInput.ts +214 -34
@@ -1,6 +1,223 @@
1
- import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, TEXT_INPUT_PROPS, Triggers, createColorProp, createNumberProp, createFieldNameProp, } from "@draftbit/types";
1
+ import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, Triggers, createColorProp, createNumberProp, createFieldNameProp, } from "@draftbit/types";
2
+ const TEXT_FIELD_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
+ autoCapitalize: {
14
+ group: GROUPS.advanced,
15
+ label: "Auto Capitalize",
16
+ description: "Can automatically capitalize sentences, words, and characters (Default: none).",
17
+ editable: true,
18
+ required: false,
19
+ defaultValue: null,
20
+ options: ["none", "sentences", "words", "characters"],
21
+ formType: FORM_TYPES.flatArray,
22
+ propType: PROP_TYPES.STRING,
23
+ },
24
+ autoCorrect: {
25
+ group: GROUPS.advanced,
26
+ label: "Auto Correct",
27
+ description: "Enables auto correction",
28
+ editable: true,
29
+ required: false,
30
+ defaultValue: null,
31
+ formType: FORM_TYPES.boolean,
32
+ propType: PROP_TYPES.BOOLEAN,
33
+ },
34
+ autoFocus: {
35
+ group: GROUPS.basic,
36
+ label: "Auto Focus",
37
+ description: "Focuses the input on load in and brings up the keyboard",
38
+ editable: true,
39
+ required: false,
40
+ defaultValue: null,
41
+ formType: FORM_TYPES.boolean,
42
+ propType: PROP_TYPES.BOOLEAN,
43
+ },
44
+ caretHidden: {
45
+ group: GROUPS.advanced,
46
+ label: "Hide Caret",
47
+ description: "Hides the caret(the line small line underneath each showing where you're editing/typing",
48
+ editable: true,
49
+ required: false,
50
+ defaultValue: null,
51
+ formType: FORM_TYPES.boolean,
52
+ propType: PROP_TYPES.BOOLEAN,
53
+ },
54
+ contextMenuHidden: {
55
+ group: GROUPS.advanced,
56
+ label: "Hide Context Menu",
57
+ description: "Hides the system context menu (Default: false)",
58
+ editable: true,
59
+ required: false,
60
+ defaultValue: null,
61
+ formType: FORM_TYPES.boolean,
62
+ propType: PROP_TYPES.BOOLEAN,
63
+ },
64
+ disabled: {
65
+ group: GROUPS.basic,
66
+ label: "Disabled",
67
+ description: "Whether the input should be disabled. Will prevent input and show a greyed out state.",
68
+ formType: FORM_TYPES.boolean,
69
+ propType: PROP_TYPES.BOOLEAN,
70
+ defaultValue: false,
71
+ editable: true,
72
+ required: false,
73
+ },
74
+ editable: {
75
+ group: GROUPS.advanced,
76
+ label: "Editable",
77
+ description: "If false, the text is not editable",
78
+ editable: true,
79
+ required: false,
80
+ defaultValue: true,
81
+ formType: FORM_TYPES.boolean,
82
+ propType: PROP_TYPES.BOOLEAN,
83
+ },
84
+ keyboardAppearance: {
85
+ group: GROUPS.advanced,
86
+ label: "Keyboard Appearance",
87
+ description: "Determines the color of the keyboard.(iOS Only)",
88
+ editable: true,
89
+ required: false,
90
+ defaultValue: null,
91
+ options: ["default", "light", "dark"],
92
+ formType: FORM_TYPES.flatArray,
93
+ propType: PROP_TYPES.STRING,
94
+ },
95
+ keyboardType: {
96
+ group: GROUPS.advanced,
97
+ label: "Keyboard Type",
98
+ description: "Determines what keyboard is given to the user.",
99
+ editable: true,
100
+ required: false,
101
+ defaultValue: null,
102
+ options: [
103
+ "default",
104
+ "email-address",
105
+ "numeric",
106
+ "phone-pad",
107
+ "ascii-capable",
108
+ "numbers-and-punctuation",
109
+ "url",
110
+ "number-pad",
111
+ "name-phone-pad",
112
+ "decimal-pad",
113
+ "twitter",
114
+ "web-search",
115
+ "visible-password",
116
+ ],
117
+ formType: FORM_TYPES.flatArray,
118
+ propType: PROP_TYPES.STRING,
119
+ },
120
+ maxLength: {
121
+ group: GROUPS.basic,
122
+ label: "Max Length",
123
+ description: "Limits the input to a set number of characters.",
124
+ editable: true,
125
+ required: false,
126
+ defaultValue: null,
127
+ min: 0,
128
+ step: 1,
129
+ precision: 0,
130
+ formType: FORM_TYPES.number,
131
+ propType: PROP_TYPES.NUMBER,
132
+ },
133
+ placeholder: {
134
+ group: GROUPS.data,
135
+ label: "Placeholder Text",
136
+ description: "The text that is shown on load when no value is available.",
137
+ editable: true,
138
+ required: false,
139
+ defaultValue: "Enter a value...",
140
+ formType: FORM_TYPES.string,
141
+ propType: PROP_TYPES.STRING,
142
+ },
143
+ placeholderTextColor: {
144
+ group: GROUPS.basic,
145
+ label: "Placeholder Text Color",
146
+ description: "The color of the placeholder text.",
147
+ editable: true,
148
+ required: false,
149
+ defaultValue: null,
150
+ formType: FORM_TYPES.color,
151
+ propType: PROP_TYPES.STRING,
152
+ },
153
+ returnKeyLabel: {
154
+ group: GROUPS.advanced,
155
+ label: "Return Key Label",
156
+ description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
157
+ editable: true,
158
+ required: false,
159
+ defaultValue: null,
160
+ formType: FORM_TYPES.string,
161
+ propType: PROP_TYPES.STRING,
162
+ },
163
+ returnKeyType: {
164
+ group: GROUPS.advanced,
165
+ label: "Return Key Type",
166
+ description: "Determines how the return key should look like",
167
+ editable: true,
168
+ required: false,
169
+ defaultValue: null,
170
+ options: [
171
+ "done",
172
+ "go",
173
+ "next",
174
+ "search",
175
+ "send",
176
+ "none",
177
+ "previous",
178
+ "default",
179
+ "emergency-call",
180
+ "google",
181
+ "join",
182
+ "route",
183
+ "yahoo",
184
+ ],
185
+ formType: FORM_TYPES.flatArray,
186
+ propType: PROP_TYPES.STRING,
187
+ },
188
+ secureTextEntry: {
189
+ group: GROUPS.basic,
190
+ label: "Password Input?",
191
+ description: "Hides the characters with a *, useful for passwords and other sensitive information.",
192
+ editable: true,
193
+ required: false,
194
+ defaultValue: null,
195
+ formType: FORM_TYPES.boolean,
196
+ propType: PROP_TYPES.BOOLEAN,
197
+ },
198
+ selectionColor: {
199
+ group: GROUPS.advanced,
200
+ label: "Selection Color",
201
+ description: "Color of the highlighted portion when selecting.",
202
+ editable: true,
203
+ required: false,
204
+ defaultValue: null,
205
+ formType: FORM_TYPES.color,
206
+ propType: PROP_TYPES.STRING,
207
+ },
208
+ selectTextOnFocus: {
209
+ group: GROUPS.advanced,
210
+ label: "Select Text on Focus",
211
+ description: "If true, all the text will automatically be selected on focus",
212
+ editable: true,
213
+ required: false,
214
+ defaultValue: null,
215
+ formType: FORM_TYPES.boolean,
216
+ propType: PROP_TYPES.BOOLEAN,
217
+ },
218
+ };
2
219
  const SEED_DATA_PROPS = {
3
- ...TEXT_INPUT_PROPS,
220
+ ...TEXT_FIELD_PROPS,
4
221
  label: {
5
222
  group: GROUPS.data,
6
223
  label: "Label",
@@ -119,7 +336,7 @@ export const SEED_DATA = [
119
336
  props: {
120
337
  ...SEED_DATA_PROPS,
121
338
  placeholder: {
122
- ...TEXT_INPUT_PROPS.placeholder,
339
+ ...TEXT_FIELD_PROPS.placeholder,
123
340
  defaultValue: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
124
341
  },
125
342
  type: {
@@ -4,15 +4,239 @@ import {
4
4
  FORM_TYPES,
5
5
  PROP_TYPES,
6
6
  FIELD_NAME,
7
- TEXT_INPUT_PROPS,
8
7
  Triggers,
9
8
  createColorProp,
10
9
  createNumberProp,
11
10
  createFieldNameProp,
12
11
  } from "@draftbit/types";
13
12
 
13
+ const TEXT_FIELD_PROPS = {
14
+ allowFontScaling: {
15
+ group: GROUPS.advanced,
16
+ label: "Allow Font Scaling",
17
+ description:
18
+ "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
19
+ editable: true,
20
+ required: false,
21
+ defaultValue: null,
22
+ formType: FORM_TYPES.boolean,
23
+ propType: PROP_TYPES.BOOLEAN,
24
+ },
25
+ autoCapitalize: {
26
+ group: GROUPS.advanced,
27
+ label: "Auto Capitalize",
28
+ description:
29
+ "Can automatically capitalize sentences, words, and characters (Default: none).",
30
+ editable: true,
31
+ required: false,
32
+ defaultValue: null,
33
+ options: ["none", "sentences", "words", "characters"],
34
+ formType: FORM_TYPES.flatArray,
35
+ propType: PROP_TYPES.STRING,
36
+ },
37
+ autoCorrect: {
38
+ group: GROUPS.advanced,
39
+ label: "Auto Correct",
40
+ description: "Enables auto correction",
41
+ editable: true,
42
+ required: false,
43
+ defaultValue: null,
44
+ formType: FORM_TYPES.boolean,
45
+ propType: PROP_TYPES.BOOLEAN,
46
+ },
47
+ autoFocus: {
48
+ group: GROUPS.basic,
49
+ label: "Auto Focus",
50
+ description: "Focuses the input on load in and brings up the keyboard",
51
+ editable: true,
52
+ required: false,
53
+ defaultValue: null,
54
+ formType: FORM_TYPES.boolean,
55
+ propType: PROP_TYPES.BOOLEAN,
56
+ },
57
+ caretHidden: {
58
+ group: GROUPS.advanced,
59
+ label: "Hide Caret",
60
+ description:
61
+ "Hides the caret(the line small line underneath each showing where you're editing/typing",
62
+ editable: true,
63
+ required: false,
64
+ defaultValue: null,
65
+ formType: FORM_TYPES.boolean,
66
+ propType: PROP_TYPES.BOOLEAN,
67
+ },
68
+ contextMenuHidden: {
69
+ group: GROUPS.advanced,
70
+ label: "Hide Context Menu",
71
+ description: "Hides the system context menu (Default: false)",
72
+ editable: true,
73
+ required: false,
74
+ defaultValue: null,
75
+ formType: FORM_TYPES.boolean,
76
+ propType: PROP_TYPES.BOOLEAN,
77
+ },
78
+ disabled: {
79
+ group: GROUPS.basic,
80
+ label: "Disabled",
81
+ description:
82
+ "Whether the input should be disabled. Will prevent input and show a greyed out state.",
83
+ formType: FORM_TYPES.boolean,
84
+ propType: PROP_TYPES.BOOLEAN,
85
+ defaultValue: false,
86
+ editable: true,
87
+ required: false,
88
+ },
89
+ editable: {
90
+ group: GROUPS.advanced,
91
+ label: "Editable",
92
+ description: "If false, the text is not editable",
93
+ editable: true,
94
+ required: false,
95
+ defaultValue: true,
96
+ formType: FORM_TYPES.boolean,
97
+ propType: PROP_TYPES.BOOLEAN,
98
+ },
99
+ keyboardAppearance: {
100
+ group: GROUPS.advanced,
101
+ label: "Keyboard Appearance",
102
+ description: "Determines the color of the keyboard.(iOS Only)",
103
+ editable: true,
104
+ required: false,
105
+ defaultValue: null,
106
+ options: ["default", "light", "dark"],
107
+ formType: FORM_TYPES.flatArray,
108
+ propType: PROP_TYPES.STRING,
109
+ },
110
+ keyboardType: {
111
+ group: GROUPS.advanced,
112
+ label: "Keyboard Type",
113
+ description: "Determines what keyboard is given to the user.",
114
+ editable: true,
115
+ required: false,
116
+ defaultValue: null,
117
+ options: [
118
+ "default",
119
+ "email-address",
120
+ "numeric",
121
+ "phone-pad",
122
+ "ascii-capable",
123
+ "numbers-and-punctuation",
124
+ "url",
125
+ "number-pad",
126
+ "name-phone-pad",
127
+ "decimal-pad",
128
+ "twitter",
129
+ "web-search",
130
+ "visible-password",
131
+ ],
132
+ formType: FORM_TYPES.flatArray,
133
+ propType: PROP_TYPES.STRING,
134
+ },
135
+ maxLength: {
136
+ group: GROUPS.basic,
137
+ label: "Max Length",
138
+ description: "Limits the input to a set number of characters.",
139
+ editable: true,
140
+ required: false,
141
+ defaultValue: null,
142
+ min: 0,
143
+ step: 1,
144
+ precision: 0,
145
+ formType: FORM_TYPES.number,
146
+ propType: PROP_TYPES.NUMBER,
147
+ },
148
+ placeholder: {
149
+ group: GROUPS.data,
150
+ label: "Placeholder Text",
151
+ description: "The text that is shown on load when no value is available.",
152
+ editable: true,
153
+ required: false,
154
+ defaultValue: "Enter a value...",
155
+ formType: FORM_TYPES.string,
156
+ propType: PROP_TYPES.STRING,
157
+ },
158
+ placeholderTextColor: {
159
+ group: GROUPS.basic,
160
+ label: "Placeholder Text Color",
161
+ description: "The color of the placeholder text.",
162
+ editable: true,
163
+ required: false,
164
+ defaultValue: null,
165
+ formType: FORM_TYPES.color,
166
+ propType: PROP_TYPES.STRING,
167
+ },
168
+ returnKeyLabel: {
169
+ group: GROUPS.advanced,
170
+ label: "Return Key Label",
171
+ description:
172
+ "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
173
+ editable: true,
174
+ required: false,
175
+ defaultValue: null,
176
+ formType: FORM_TYPES.string,
177
+ propType: PROP_TYPES.STRING,
178
+ },
179
+ returnKeyType: {
180
+ group: GROUPS.advanced,
181
+ label: "Return Key Type",
182
+ description: "Determines how the return key should look like",
183
+ editable: true,
184
+ required: false,
185
+ defaultValue: null,
186
+ options: [
187
+ "done",
188
+ "go",
189
+ "next",
190
+ "search",
191
+ "send",
192
+ "none",
193
+ "previous",
194
+ "default",
195
+ "emergency-call",
196
+ "google",
197
+ "join",
198
+ "route",
199
+ "yahoo",
200
+ ],
201
+ formType: FORM_TYPES.flatArray,
202
+ propType: PROP_TYPES.STRING,
203
+ },
204
+ secureTextEntry: {
205
+ group: GROUPS.basic,
206
+ label: "Password Input?",
207
+ description:
208
+ "Hides the characters with a *, useful for passwords and other sensitive information.",
209
+ editable: true,
210
+ required: false,
211
+ defaultValue: null,
212
+ formType: FORM_TYPES.boolean,
213
+ propType: PROP_TYPES.BOOLEAN,
214
+ },
215
+ selectionColor: {
216
+ group: GROUPS.advanced,
217
+ label: "Selection Color",
218
+ description: "Color of the highlighted portion when selecting.",
219
+ editable: true,
220
+ required: false,
221
+ defaultValue: null,
222
+ formType: FORM_TYPES.color,
223
+ propType: PROP_TYPES.STRING,
224
+ },
225
+ selectTextOnFocus: {
226
+ group: GROUPS.advanced,
227
+ label: "Select Text on Focus",
228
+ description:
229
+ "If true, all the text will automatically be selected on focus",
230
+ editable: true,
231
+ required: false,
232
+ defaultValue: null,
233
+ formType: FORM_TYPES.boolean,
234
+ propType: PROP_TYPES.BOOLEAN,
235
+ },
236
+ };
237
+
14
238
  const SEED_DATA_PROPS = {
15
- ...TEXT_INPUT_PROPS,
239
+ ...TEXT_FIELD_PROPS,
16
240
  label: {
17
241
  group: GROUPS.data,
18
242
  label: "Label",
@@ -134,7 +358,7 @@ export const SEED_DATA = [
134
358
  props: {
135
359
  ...SEED_DATA_PROPS,
136
360
  placeholder: {
137
- ...TEXT_INPUT_PROPS.placeholder,
361
+ ...TEXT_FIELD_PROPS.placeholder,
138
362
  defaultValue:
139
363
  "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
140
364
  },