@draftbit/core 46.2.4-dedb7a.0 → 46.2.4-f941fc.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.
Files changed (46) hide show
  1. package/lib/commonjs/components/Accordion/AccordionItem.js +25 -5
  2. package/lib/commonjs/components/DeprecatedButton.js +4 -22
  3. package/lib/commonjs/components/TabView/TabView.js +102 -0
  4. package/lib/commonjs/components/TabView/TabViewItem.js +26 -0
  5. package/lib/commonjs/components/TabView/index.js +23 -0
  6. package/lib/commonjs/index.js +14 -0
  7. package/lib/commonjs/mappings/NumberInput.js +149 -146
  8. package/lib/commonjs/mappings/TabView.js +79 -0
  9. package/lib/commonjs/mappings/TextArea.js +193 -188
  10. package/lib/commonjs/mappings/TextField.js +8 -3
  11. package/lib/commonjs/mappings/TextInput.js +180 -178
  12. package/lib/module/components/TabView/TabView.js +87 -0
  13. package/lib/module/components/TabView/TabViewItem.js +18 -0
  14. package/lib/module/components/TabView/index.js +2 -0
  15. package/lib/module/index.js +1 -0
  16. package/lib/module/mappings/NumberInput.js +149 -146
  17. package/lib/module/mappings/TabView.js +70 -0
  18. package/lib/module/mappings/TextArea.js +193 -188
  19. package/lib/module/mappings/TextField.js +8 -3
  20. package/lib/module/mappings/TextInput.js +180 -178
  21. package/lib/typescript/src/components/TabView/TabView.d.ts +19 -0
  22. package/lib/typescript/src/components/TabView/TabViewItem.d.ts +10 -0
  23. package/lib/typescript/src/components/TabView/index.d.ts +2 -0
  24. package/lib/typescript/src/index.d.ts +1 -0
  25. package/lib/typescript/src/mappings/TabView.d.ts +111 -0
  26. package/lib/typescript/src/mappings/TextArea.d.ts +42 -42
  27. package/lib/typescript/src/mappings/TextField.d.ts +118 -118
  28. package/package.json +4 -2
  29. package/src/components/TabView/TabView.js +34 -0
  30. package/src/components/TabView/TabView.tsx +97 -0
  31. package/src/components/TabView/TabViewItem.js +5 -0
  32. package/src/components/TabView/TabViewItem.tsx +21 -0
  33. package/src/components/TabView/index.js +2 -0
  34. package/src/components/TabView/index.ts +2 -0
  35. package/src/index.js +1 -0
  36. package/src/index.tsx +1 -0
  37. package/src/mappings/NumberInput.js +163 -160
  38. package/src/mappings/NumberInput.ts +168 -165
  39. package/src/mappings/TabView.js +73 -0
  40. package/src/mappings/TabView.ts +80 -0
  41. package/src/mappings/TextArea.js +220 -213
  42. package/src/mappings/TextArea.ts +227 -219
  43. package/src/mappings/TextField.js +9 -2
  44. package/src/mappings/TextField.ts +11 -3
  45. package/src/mappings/TextInput.js +208 -205
  46. package/src/mappings/TextInput.ts +215 -212
@@ -7,6 +7,231 @@ import {
7
7
  Triggers,
8
8
  } from "@draftbit/types";
9
9
 
10
+ const TEXT_AREA_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
+ autoCapitalize: {
23
+ group: GROUPS.advanced,
24
+ label: "Auto Capitalize",
25
+ description:
26
+ "Can automatically capitalize sentences, words, and characters (Default: none).",
27
+ editable: true,
28
+ required: false,
29
+ defaultValue: null,
30
+ options: ["none", "sentences", "words", "characters"],
31
+ formType: FORM_TYPES.flatArray,
32
+ propType: PROP_TYPES.STRING,
33
+ },
34
+ autoCorrect: {
35
+ group: GROUPS.advanced,
36
+ label: "Auto Correct",
37
+ description: "Enables auto correction",
38
+ editable: true,
39
+ required: false,
40
+ defaultValue: null,
41
+ formType: FORM_TYPES.boolean,
42
+ propType: PROP_TYPES.BOOLEAN,
43
+ },
44
+ autoFocus: {
45
+ group: GROUPS.basic,
46
+ label: "Auto Focus",
47
+ description: "Focuses the input on load in and brings up the keyboard",
48
+ editable: true,
49
+ required: false,
50
+ defaultValue: null,
51
+ formType: FORM_TYPES.boolean,
52
+ propType: PROP_TYPES.BOOLEAN,
53
+ },
54
+ caretHidden: {
55
+ group: GROUPS.advanced,
56
+ label: "Hide Caret",
57
+ description:
58
+ "Hides the caret(the line small line underneath each showing where you're editing/typing",
59
+ editable: true,
60
+ required: false,
61
+ defaultValue: null,
62
+ formType: FORM_TYPES.boolean,
63
+ propType: PROP_TYPES.BOOLEAN,
64
+ },
65
+ contextMenuHidden: {
66
+ group: GROUPS.advanced,
67
+ label: "Hide Context Menu",
68
+ description: "Hides the system context menu (Default: false)",
69
+ editable: true,
70
+ required: false,
71
+ defaultValue: null,
72
+ formType: FORM_TYPES.boolean,
73
+ propType: PROP_TYPES.BOOLEAN,
74
+ },
75
+ editable: {
76
+ group: GROUPS.advanced,
77
+ label: "Editable",
78
+ description: "If false, the text is not editable",
79
+ editable: true,
80
+ required: false,
81
+ defaultValue: true,
82
+ formType: FORM_TYPES.boolean,
83
+ propType: PROP_TYPES.BOOLEAN,
84
+ },
85
+ keyboardAppearance: {
86
+ group: GROUPS.advanced,
87
+ label: "Keyboard Appearance",
88
+ description: "Determines the color of the keyboard.(iOS Only)",
89
+ editable: true,
90
+ required: false,
91
+ defaultValue: null,
92
+ options: ["default", "light", "dark"],
93
+ formType: FORM_TYPES.flatArray,
94
+ propType: PROP_TYPES.STRING,
95
+ },
96
+ keyboardType: {
97
+ group: GROUPS.advanced,
98
+ label: "Keyboard Type",
99
+ description: "Determines what keyboard is given to the user.",
100
+ editable: true,
101
+ required: false,
102
+ defaultValue: null,
103
+ options: [
104
+ "default",
105
+ "email-address",
106
+ "numeric",
107
+ "phone-pad",
108
+ "ascii-capable",
109
+ "numbers-and-punctuation",
110
+ "url",
111
+ "number-pad",
112
+ "name-phone-pad",
113
+ "decimal-pad",
114
+ "twitter",
115
+ "web-search",
116
+ "visible-password",
117
+ ],
118
+ formType: FORM_TYPES.flatArray,
119
+ propType: PROP_TYPES.STRING,
120
+ },
121
+ maxLength: {
122
+ group: GROUPS.basic,
123
+ label: "Max Length",
124
+ description: "Limits the input to a set number of characters.",
125
+ editable: true,
126
+ required: false,
127
+ defaultValue: null,
128
+ min: 0,
129
+ step: 1,
130
+ precision: 0,
131
+ formType: FORM_TYPES.number,
132
+ propType: PROP_TYPES.NUMBER,
133
+ },
134
+ placeholder: {
135
+ group: GROUPS.data,
136
+ label: "Placeholder Text",
137
+ description: "The text that is shown on load when no value is available.",
138
+ editable: true,
139
+ required: false,
140
+ defaultValue: "Enter a value...",
141
+ formType: FORM_TYPES.string,
142
+ propType: PROP_TYPES.STRING,
143
+ },
144
+ placeholderTextColor: {
145
+ group: GROUPS.basic,
146
+ label: "Placeholder Text Color",
147
+ description: "The color of the placeholder text.",
148
+ editable: true,
149
+ required: false,
150
+ defaultValue: null,
151
+ formType: FORM_TYPES.color,
152
+ propType: PROP_TYPES.STRING,
153
+ },
154
+ returnKeyLabel: {
155
+ group: GROUPS.advanced,
156
+ label: "Return Key Label",
157
+ description:
158
+ "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
159
+ editable: true,
160
+ required: false,
161
+ defaultValue: null,
162
+ formType: FORM_TYPES.string,
163
+ propType: PROP_TYPES.STRING,
164
+ },
165
+ returnKeyType: {
166
+ group: GROUPS.advanced,
167
+ label: "Return Key Type",
168
+ description: "Determines how the return key should look like",
169
+ editable: true,
170
+ required: false,
171
+ defaultValue: null,
172
+ options: [
173
+ "done",
174
+ "go",
175
+ "next",
176
+ "search",
177
+ "send",
178
+ "none",
179
+ "previous",
180
+ "default",
181
+ "emergency-call",
182
+ "google",
183
+ "join",
184
+ "route",
185
+ "yahoo",
186
+ ],
187
+ formType: FORM_TYPES.flatArray,
188
+ propType: PROP_TYPES.STRING,
189
+ },
190
+ secureTextEntry: {
191
+ group: GROUPS.basic,
192
+ label: "Password Input?",
193
+ description:
194
+ "Hides the characters with a *, useful for passwords and other sensitive information.",
195
+ editable: true,
196
+ required: false,
197
+ defaultValue: null,
198
+ formType: FORM_TYPES.boolean,
199
+ propType: PROP_TYPES.BOOLEAN,
200
+ },
201
+ selectionColor: {
202
+ group: GROUPS.advanced,
203
+ label: "Selection Color",
204
+ description: "Color of the highlighted portion when selecting.",
205
+ editable: true,
206
+ required: false,
207
+ defaultValue: null,
208
+ formType: FORM_TYPES.color,
209
+ propType: PROP_TYPES.STRING,
210
+ },
211
+ selectTextOnFocus: {
212
+ group: GROUPS.advanced,
213
+ label: "Select Text on Focus",
214
+ description:
215
+ "If true, all the text will automatically be selected on focus",
216
+ editable: true,
217
+ required: false,
218
+ defaultValue: null,
219
+ formType: FORM_TYPES.boolean,
220
+ propType: PROP_TYPES.BOOLEAN,
221
+ },
222
+ textAlignVertical: {
223
+ group: GROUPS.advanced,
224
+ label: "Aligns text on the vertical axis",
225
+ description: "Move the text around in the given component.",
226
+ options: ["auto", "top", "bottom", "center"],
227
+ editable: true,
228
+ required: false,
229
+ defaultValue: "top",
230
+ formType: FORM_TYPES.flatArray,
231
+ propType: PROP_TYPES.STRING,
232
+ },
233
+ };
234
+
10
235
  export const SEED_DATA = {
11
236
  name: "Text Area",
12
237
  tag: "TextInput",
@@ -26,228 +251,11 @@ export const SEED_DATA = {
26
251
  },
27
252
  triggers: [Triggers.OnChangeText],
28
253
  props: {
29
- allowFontScaling: {
30
- group: GROUPS.advanced,
31
- label: "Allow Font Scaling",
32
- description:
33
- "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
34
- editable: true,
35
- required: false,
36
- defaultValue: null,
37
- formType: FORM_TYPES.boolean,
38
- propType: PROP_TYPES.BOOLEAN,
39
- },
40
- autoCapitalize: {
41
- group: GROUPS.advanced,
42
- label: "Auto Capitalize",
43
- description:
44
- "Can automatically capitalize sentences, words, and characters (Default: none).",
45
- editable: true,
46
- required: false,
47
- defaultValue: null,
48
- options: ["none", "sentences", "words", "characters"],
49
- formType: FORM_TYPES.flatArray,
50
- propType: PROP_TYPES.STRING,
51
- },
52
- autoCorrect: {
53
- group: GROUPS.advanced,
54
- label: "Auto Correct",
55
- description: "Enables auto correction",
56
- editable: true,
57
- required: false,
58
- defaultValue: null,
59
- formType: FORM_TYPES.boolean,
60
- propType: PROP_TYPES.BOOLEAN,
61
- },
62
- autoFocus: {
63
- group: GROUPS.basic,
64
- label: "Auto Focus",
65
- description: "Focuses the input on load in and brings up the keyboard",
66
- editable: true,
67
- required: false,
68
- defaultValue: null,
69
- formType: FORM_TYPES.boolean,
70
- propType: PROP_TYPES.BOOLEAN,
71
- },
72
- caretHidden: {
73
- group: GROUPS.advanced,
74
- label: "Hide Caret",
75
- description:
76
- "Hides the caret(the line small line underneath each showing where you're editing/typing",
77
- editable: true,
78
- required: false,
79
- defaultValue: null,
80
- formType: FORM_TYPES.boolean,
81
- propType: PROP_TYPES.BOOLEAN,
82
- },
83
- contextMenuHidden: {
84
- group: GROUPS.advanced,
85
- label: "Hide Context Menu",
86
- description: "Hides the system context menu (Default: false)",
87
- editable: true,
88
- required: false,
89
- defaultValue: null,
90
- formType: FORM_TYPES.boolean,
91
- propType: PROP_TYPES.BOOLEAN,
92
- },
93
- editable: {
94
- group: GROUPS.advanced,
95
- label: "Editable",
96
- description: "If false, the text is not editable",
97
- editable: true,
98
- required: false,
99
- defaultValue: true,
100
- formType: FORM_TYPES.boolean,
101
- propType: PROP_TYPES.BOOLEAN,
102
- },
103
- keyboardAppearance: {
104
- group: GROUPS.advanced,
105
- label: "Keyboard Appearance",
106
- description: "Determines the color of the keyboard.(iOS Only)",
107
- editable: true,
108
- required: false,
109
- defaultValue: null,
110
- options: ["default", "light", "dark"],
111
- formType: FORM_TYPES.flatArray,
112
- propType: PROP_TYPES.STRING,
113
- },
114
- keyboardType: {
115
- group: GROUPS.advanced,
116
- label: "Keyboard Type",
117
- description: "Determines what keyboard is given to the user.",
118
- editable: true,
119
- required: false,
120
- defaultValue: null,
121
- options: [
122
- "default",
123
- "email-address",
124
- "numeric",
125
- "phone-pad",
126
- "ascii-capable",
127
- "numbers-and-punctuation",
128
- "url",
129
- "number-pad",
130
- "name-phone-pad",
131
- "decimal-pad",
132
- "twitter",
133
- "web-search",
134
- "visible-password",
135
- ],
136
- formType: FORM_TYPES.flatArray,
137
- propType: PROP_TYPES.STRING,
138
- },
139
- maxLength: {
140
- group: GROUPS.basic,
141
- label: "Max Length",
142
- description: "Limits the input to a set number of characters.",
143
- editable: true,
144
- required: false,
145
- defaultValue: null,
146
- min: 0,
147
- step: 1,
148
- precision: 0,
149
- formType: FORM_TYPES.number,
150
- propType: PROP_TYPES.NUMBER,
151
- },
254
+ ...TEXT_AREA_PROPS,
152
255
  placeholder: {
153
- group: GROUPS.data,
154
- label: "Placeholder Text",
155
- description: "The text that is shown on load when no value is available.",
156
- editable: true,
157
- required: false,
256
+ ...TEXT_AREA_PROPS.placeholder,
158
257
  defaultValue:
159
258
  "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.",
160
- formType: FORM_TYPES.string,
161
- propType: PROP_TYPES.STRING,
162
- },
163
- placeholderTextColor: {
164
- group: GROUPS.basic,
165
- label: "Placeholder Text Color",
166
- description: "The color of the placeholder text.",
167
- editable: true,
168
- required: false,
169
- defaultValue: null,
170
- formType: FORM_TYPES.color,
171
- propType: PROP_TYPES.STRING,
172
- },
173
- returnKeyLabel: {
174
- group: GROUPS.advanced,
175
- label: "Return Key Label",
176
- description:
177
- "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
178
- editable: true,
179
- required: false,
180
- defaultValue: null,
181
- formType: FORM_TYPES.string,
182
- propType: PROP_TYPES.STRING,
183
- },
184
- returnKeyType: {
185
- group: GROUPS.advanced,
186
- label: "Return Key Type",
187
- description: "Determines how the return key should look like",
188
- editable: true,
189
- required: false,
190
- defaultValue: null,
191
- options: [
192
- "done",
193
- "go",
194
- "next",
195
- "search",
196
- "send",
197
- "none",
198
- "previous",
199
- "default",
200
- "emergency-call",
201
- "google",
202
- "join",
203
- "route",
204
- "yahoo",
205
- ],
206
- formType: FORM_TYPES.flatArray,
207
- propType: PROP_TYPES.STRING,
208
- },
209
- secureTextEntry: {
210
- group: GROUPS.basic,
211
- label: "Password Input?",
212
- description:
213
- "Hides the characters with a *, useful for passwords and other sensitive information.",
214
- editable: true,
215
- required: false,
216
- defaultValue: null,
217
- formType: FORM_TYPES.boolean,
218
- propType: PROP_TYPES.BOOLEAN,
219
- },
220
- selectionColor: {
221
- group: GROUPS.advanced,
222
- label: "Selection Color",
223
- description: "Color of the highlighted portion when selecting.",
224
- editable: true,
225
- required: false,
226
- defaultValue: null,
227
- formType: FORM_TYPES.color,
228
- propType: PROP_TYPES.STRING,
229
- },
230
- selectTextOnFocus: {
231
- group: GROUPS.advanced,
232
- label: "Select Text on Focus",
233
- description:
234
- "If true, all the text will automatically be selected on focus",
235
- editable: true,
236
- required: false,
237
- defaultValue: null,
238
- formType: FORM_TYPES.boolean,
239
- propType: PROP_TYPES.BOOLEAN,
240
- },
241
- textAlignVertical: {
242
- group: GROUPS.advanced,
243
- label: "Aligns text on the vertical axis",
244
- description: "Move the text around in the given component.",
245
- options: ["auto", "top", "bottom", "center"],
246
- editable: true,
247
- required: false,
248
- defaultValue: "top",
249
- formType: FORM_TYPES.flatArray,
250
- propType: PROP_TYPES.STRING,
251
259
  },
252
260
  multiline: {
253
261
  label: "Multiline",
@@ -1,5 +1,5 @@
1
1
  import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, Triggers, createColorProp, createNumberProp, createFieldNameProp, StylesPanelSections, } from "@draftbit/types";
2
- const SEED_DATA_PROPS = {
2
+ const TEXT_FIELD_PROPS = {
3
3
  allowFontScaling: {
4
4
  group: GROUPS.advanced,
5
5
  label: "Allow Font Scaling",
@@ -136,7 +136,7 @@ const SEED_DATA_PROPS = {
136
136
  description: "The text that is shown on load when no value is available.",
137
137
  editable: true,
138
138
  required: false,
139
- 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.",
139
+ defaultValue: "Enter a value...",
140
140
  formType: FORM_TYPES.string,
141
141
  propType: PROP_TYPES.STRING,
142
142
  },
@@ -215,6 +215,9 @@ const SEED_DATA_PROPS = {
215
215
  formType: FORM_TYPES.boolean,
216
216
  propType: PROP_TYPES.BOOLEAN,
217
217
  },
218
+ };
219
+ const SEED_DATA_PROPS = {
220
+ ...TEXT_FIELD_PROPS,
218
221
  label: {
219
222
  group: GROUPS.data,
220
223
  label: "Label",
@@ -341,6 +344,10 @@ export const SEED_DATA = [
341
344
  triggers: SEED_DATA_TRIGGERS,
342
345
  props: {
343
346
  ...SEED_DATA_PROPS,
347
+ placeholder: {
348
+ ...TEXT_FIELD_PROPS.placeholder,
349
+ 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.",
350
+ },
344
351
  type: {
345
352
  label: "Appearance",
346
353
  description: "Type of Datepicker",
@@ -11,7 +11,7 @@ import {
11
11
  StylesPanelSections,
12
12
  } from "@draftbit/types";
13
13
 
14
- const SEED_DATA_PROPS = {
14
+ const TEXT_FIELD_PROPS = {
15
15
  allowFontScaling: {
16
16
  group: GROUPS.advanced,
17
17
  label: "Allow Font Scaling",
@@ -152,8 +152,7 @@ const SEED_DATA_PROPS = {
152
152
  description: "The text that is shown on load when no value is available.",
153
153
  editable: true,
154
154
  required: false,
155
- defaultValue:
156
- "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.",
155
+ defaultValue: "Enter a value...",
157
156
  formType: FORM_TYPES.string,
158
157
  propType: PROP_TYPES.STRING,
159
158
  },
@@ -235,6 +234,10 @@ const SEED_DATA_PROPS = {
235
234
  formType: FORM_TYPES.boolean,
236
235
  propType: PROP_TYPES.BOOLEAN,
237
236
  },
237
+ };
238
+
239
+ const SEED_DATA_PROPS = {
240
+ ...TEXT_FIELD_PROPS,
238
241
  label: {
239
242
  group: GROUPS.data,
240
243
  label: "Label",
@@ -364,6 +367,11 @@ export const SEED_DATA = [
364
367
  triggers: SEED_DATA_TRIGGERS,
365
368
  props: {
366
369
  ...SEED_DATA_PROPS,
370
+ placeholder: {
371
+ ...TEXT_FIELD_PROPS.placeholder,
372
+ defaultValue:
373
+ "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.",
374
+ },
367
375
  type: {
368
376
  label: "Appearance",
369
377
  description: "Type of Datepicker",