@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
@@ -1,4 +1,194 @@
1
1
  import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, FIELD_NAME, Triggers } from "@draftbit/types";
2
+ const TEXT_AREA_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
+ editable: {
65
+ group: GROUPS.advanced,
66
+ label: "Editable",
67
+ description: "If false, the text is not editable",
68
+ editable: true,
69
+ required: false,
70
+ defaultValue: true,
71
+ formType: FORM_TYPES.boolean,
72
+ propType: PROP_TYPES.BOOLEAN
73
+ },
74
+ keyboardAppearance: {
75
+ group: GROUPS.advanced,
76
+ label: "Keyboard Appearance",
77
+ description: "Determines the color of the keyboard.(iOS Only)",
78
+ editable: true,
79
+ required: false,
80
+ defaultValue: null,
81
+ options: ["default", "light", "dark"],
82
+ formType: FORM_TYPES.flatArray,
83
+ propType: PROP_TYPES.STRING
84
+ },
85
+ keyboardType: {
86
+ group: GROUPS.advanced,
87
+ label: "Keyboard Type",
88
+ description: "Determines what keyboard is given to the user.",
89
+ editable: true,
90
+ required: false,
91
+ defaultValue: null,
92
+ options: ["default", "email-address", "numeric", "phone-pad", "ascii-capable", "numbers-and-punctuation", "url", "number-pad", "name-phone-pad", "decimal-pad", "twitter", "web-search", "visible-password"],
93
+ formType: FORM_TYPES.flatArray,
94
+ propType: PROP_TYPES.STRING
95
+ },
96
+ maxLength: {
97
+ group: GROUPS.basic,
98
+ label: "Max Length",
99
+ description: "Limits the input to a set number of characters.",
100
+ editable: true,
101
+ required: false,
102
+ defaultValue: null,
103
+ min: 0,
104
+ step: 1,
105
+ precision: 0,
106
+ formType: FORM_TYPES.number,
107
+ propType: PROP_TYPES.NUMBER
108
+ },
109
+ placeholder: {
110
+ group: GROUPS.data,
111
+ label: "Placeholder Text",
112
+ description: "The text that is shown on load when no value is available.",
113
+ editable: true,
114
+ required: false,
115
+ defaultValue: "Enter a value...",
116
+ formType: FORM_TYPES.string,
117
+ propType: PROP_TYPES.STRING
118
+ },
119
+ placeholderTextColor: {
120
+ group: GROUPS.basic,
121
+ label: "Placeholder Text Color",
122
+ description: "The color of the placeholder text.",
123
+ editable: true,
124
+ required: false,
125
+ defaultValue: null,
126
+ formType: FORM_TYPES.color,
127
+ propType: PROP_TYPES.STRING
128
+ },
129
+ returnKeyLabel: {
130
+ group: GROUPS.advanced,
131
+ label: "Return Key Label",
132
+ description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
133
+ editable: true,
134
+ required: false,
135
+ defaultValue: null,
136
+ formType: FORM_TYPES.string,
137
+ propType: PROP_TYPES.STRING
138
+ },
139
+ returnKeyType: {
140
+ group: GROUPS.advanced,
141
+ label: "Return Key Type",
142
+ description: "Determines how the return key should look like",
143
+ editable: true,
144
+ required: false,
145
+ defaultValue: null,
146
+ options: ["done", "go", "next", "search", "send", "none", "previous", "default", "emergency-call", "google", "join", "route", "yahoo"],
147
+ formType: FORM_TYPES.flatArray,
148
+ propType: PROP_TYPES.STRING
149
+ },
150
+ secureTextEntry: {
151
+ group: GROUPS.basic,
152
+ label: "Password Input?",
153
+ description: "Hides the characters with a *, useful for passwords and other sensitive information.",
154
+ editable: true,
155
+ required: false,
156
+ defaultValue: null,
157
+ formType: FORM_TYPES.boolean,
158
+ propType: PROP_TYPES.BOOLEAN
159
+ },
160
+ selectionColor: {
161
+ group: GROUPS.advanced,
162
+ label: "Selection Color",
163
+ description: "Color of the highlighted portion when selecting.",
164
+ editable: true,
165
+ required: false,
166
+ defaultValue: null,
167
+ formType: FORM_TYPES.color,
168
+ propType: PROP_TYPES.STRING
169
+ },
170
+ selectTextOnFocus: {
171
+ group: GROUPS.advanced,
172
+ label: "Select Text on Focus",
173
+ description: "If true, all the text will automatically be selected on focus",
174
+ editable: true,
175
+ required: false,
176
+ defaultValue: null,
177
+ formType: FORM_TYPES.boolean,
178
+ propType: PROP_TYPES.BOOLEAN
179
+ },
180
+ textAlignVertical: {
181
+ group: GROUPS.advanced,
182
+ label: "Aligns text on the vertical axis",
183
+ description: "Move the text around in the given component.",
184
+ options: ["auto", "top", "bottom", "center"],
185
+ editable: true,
186
+ required: false,
187
+ defaultValue: "top",
188
+ formType: FORM_TYPES.flatArray,
189
+ propType: PROP_TYPES.STRING
190
+ }
191
+ };
2
192
  export const SEED_DATA = {
3
193
  name: "Text Area",
4
194
  tag: "TextInput",
@@ -17,194 +207,9 @@ export const SEED_DATA = {
17
207
  borderRadius: 8
18
208
  },
19
209
  triggers: [Triggers.OnChangeText],
20
- props: {
21
- allowFontScaling: {
22
- group: GROUPS.advanced,
23
- label: "Allow Font Scaling",
24
- description: "Whether fonts should scale to respect Text Size in the user's accessibility settings. (Default: true)",
25
- editable: true,
26
- required: false,
27
- defaultValue: null,
28
- formType: FORM_TYPES.boolean,
29
- propType: PROP_TYPES.BOOLEAN
30
- },
31
- autoCapitalize: {
32
- group: GROUPS.advanced,
33
- label: "Auto Capitalize",
34
- description: "Can automatically capitalize sentences, words, and characters (Default: none).",
35
- editable: true,
36
- required: false,
37
- defaultValue: null,
38
- options: ["none", "sentences", "words", "characters"],
39
- formType: FORM_TYPES.flatArray,
40
- propType: PROP_TYPES.STRING
41
- },
42
- autoCorrect: {
43
- group: GROUPS.advanced,
44
- label: "Auto Correct",
45
- description: "Enables auto correction",
46
- editable: true,
47
- required: false,
48
- defaultValue: null,
49
- formType: FORM_TYPES.boolean,
50
- propType: PROP_TYPES.BOOLEAN
51
- },
52
- autoFocus: {
53
- group: GROUPS.basic,
54
- label: "Auto Focus",
55
- description: "Focuses the input on load in and brings up the keyboard",
56
- editable: true,
57
- required: false,
58
- defaultValue: null,
59
- formType: FORM_TYPES.boolean,
60
- propType: PROP_TYPES.BOOLEAN
61
- },
62
- caretHidden: {
63
- group: GROUPS.advanced,
64
- label: "Hide Caret",
65
- description: "Hides the caret(the line small line underneath each showing where you're editing/typing",
66
- editable: true,
67
- required: false,
68
- defaultValue: null,
69
- formType: FORM_TYPES.boolean,
70
- propType: PROP_TYPES.BOOLEAN
71
- },
72
- contextMenuHidden: {
73
- group: GROUPS.advanced,
74
- label: "Hide Context Menu",
75
- description: "Hides the system context menu (Default: false)",
76
- editable: true,
77
- required: false,
78
- defaultValue: null,
79
- formType: FORM_TYPES.boolean,
80
- propType: PROP_TYPES.BOOLEAN
81
- },
82
- editable: {
83
- group: GROUPS.advanced,
84
- label: "Editable",
85
- description: "If false, the text is not editable",
86
- editable: true,
87
- required: false,
88
- defaultValue: true,
89
- formType: FORM_TYPES.boolean,
90
- propType: PROP_TYPES.BOOLEAN
91
- },
92
- keyboardAppearance: {
93
- group: GROUPS.advanced,
94
- label: "Keyboard Appearance",
95
- description: "Determines the color of the keyboard.(iOS Only)",
96
- editable: true,
97
- required: false,
98
- defaultValue: null,
99
- options: ["default", "light", "dark"],
100
- formType: FORM_TYPES.flatArray,
101
- propType: PROP_TYPES.STRING
102
- },
103
- keyboardType: {
104
- group: GROUPS.advanced,
105
- label: "Keyboard Type",
106
- description: "Determines what keyboard is given to the user.",
107
- editable: true,
108
- required: false,
109
- defaultValue: null,
110
- options: ["default", "email-address", "numeric", "phone-pad", "ascii-capable", "numbers-and-punctuation", "url", "number-pad", "name-phone-pad", "decimal-pad", "twitter", "web-search", "visible-password"],
111
- formType: FORM_TYPES.flatArray,
112
- propType: PROP_TYPES.STRING
113
- },
114
- maxLength: {
115
- group: GROUPS.basic,
116
- label: "Max Length",
117
- description: "Limits the input to a set number of characters.",
118
- editable: true,
119
- required: false,
120
- defaultValue: null,
121
- min: 0,
122
- step: 1,
123
- precision: 0,
124
- formType: FORM_TYPES.number,
125
- propType: PROP_TYPES.NUMBER
126
- },
127
- placeholder: {
128
- group: GROUPS.data,
129
- label: "Placeholder Text",
130
- description: "The text that is shown on load when no value is available.",
131
- editable: true,
132
- required: false,
133
- 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.",
134
- formType: FORM_TYPES.string,
135
- propType: PROP_TYPES.STRING
136
- },
137
- placeholderTextColor: {
138
- group: GROUPS.basic,
139
- label: "Placeholder Text Color",
140
- description: "The color of the placeholder text.",
141
- editable: true,
142
- required: false,
143
- defaultValue: null,
144
- formType: FORM_TYPES.color,
145
- propType: PROP_TYPES.STRING
146
- },
147
- returnKeyLabel: {
148
- group: GROUPS.advanced,
149
- label: "Return Key Label",
150
- description: "(Android Only) Sets the label on the return key (use this instead of rewturnKeyType)",
151
- editable: true,
152
- required: false,
153
- defaultValue: null,
154
- formType: FORM_TYPES.string,
155
- propType: PROP_TYPES.STRING
156
- },
157
- returnKeyType: {
158
- group: GROUPS.advanced,
159
- label: "Return Key Type",
160
- description: "Determines how the return key should look like",
161
- editable: true,
162
- required: false,
163
- defaultValue: null,
164
- options: ["done", "go", "next", "search", "send", "none", "previous", "default", "emergency-call", "google", "join", "route", "yahoo"],
165
- formType: FORM_TYPES.flatArray,
166
- propType: PROP_TYPES.STRING
167
- },
168
- secureTextEntry: {
169
- group: GROUPS.basic,
170
- label: "Password Input?",
171
- description: "Hides the characters with a *, useful for passwords and other sensitive information.",
172
- editable: true,
173
- required: false,
174
- defaultValue: null,
175
- formType: FORM_TYPES.boolean,
176
- propType: PROP_TYPES.BOOLEAN
177
- },
178
- selectionColor: {
179
- group: GROUPS.advanced,
180
- label: "Selection Color",
181
- description: "Color of the highlighted portion when selecting.",
182
- editable: true,
183
- required: false,
184
- defaultValue: null,
185
- formType: FORM_TYPES.color,
186
- propType: PROP_TYPES.STRING
187
- },
188
- selectTextOnFocus: {
189
- group: GROUPS.advanced,
190
- label: "Select Text on Focus",
191
- description: "If true, all the text will automatically be selected on focus",
192
- editable: true,
193
- required: false,
194
- defaultValue: null,
195
- formType: FORM_TYPES.boolean,
196
- propType: PROP_TYPES.BOOLEAN
197
- },
198
- textAlignVertical: {
199
- group: GROUPS.advanced,
200
- label: "Aligns text on the vertical axis",
201
- description: "Move the text around in the given component.",
202
- options: ["auto", "top", "bottom", "center"],
203
- editable: true,
204
- required: false,
205
- defaultValue: "top",
206
- formType: FORM_TYPES.flatArray,
207
- propType: PROP_TYPES.STRING
210
+ props: { ...TEXT_AREA_PROPS,
211
+ placeholder: { ...TEXT_AREA_PROPS.placeholder,
212
+ 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."
208
213
  },
209
214
  multiline: {
210
215
  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",
@@ -122,7 +122,7 @@ const SEED_DATA_PROPS = {
122
122
  description: "The text that is shown on load when no value is available.",
123
123
  editable: true,
124
124
  required: false,
125
- 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.",
125
+ defaultValue: "Enter a value...",
126
126
  formType: FORM_TYPES.string,
127
127
  propType: PROP_TYPES.STRING
128
128
  },
@@ -186,7 +186,9 @@ const SEED_DATA_PROPS = {
186
186
  defaultValue: null,
187
187
  formType: FORM_TYPES.boolean,
188
188
  propType: PROP_TYPES.BOOLEAN
189
- },
189
+ }
190
+ };
191
+ const SEED_DATA_PROPS = { ...TEXT_FIELD_PROPS,
190
192
  label: {
191
193
  group: GROUPS.data,
192
194
  label: "Label",
@@ -302,6 +304,9 @@ export const SEED_DATA = [{
302
304
  supports_list_render: false,
303
305
  triggers: SEED_DATA_TRIGGERS,
304
306
  props: { ...SEED_DATA_PROPS,
307
+ placeholder: { ...TEXT_FIELD_PROPS.placeholder,
308
+ 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."
309
+ },
305
310
  type: {
306
311
  label: "Appearance",
307
312
  description: "Type of Datepicker",