n8n-nodes-base 2.2.2 → 2.3.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 (79) hide show
  1. package/dist/nodes/Code/Code.node.d.ts.map +1 -1
  2. package/dist/nodes/Code/Code.node.js +6 -22
  3. package/dist/nodes/Code/Code.node.js.map +1 -1
  4. package/dist/nodes/Code/PythonTaskRunnerSandbox.d.ts +1 -0
  5. package/dist/nodes/Code/PythonTaskRunnerSandbox.d.ts.map +1 -1
  6. package/dist/nodes/Code/PythonTaskRunnerSandbox.js +8 -0
  7. package/dist/nodes/Code/PythonTaskRunnerSandbox.js.map +1 -1
  8. package/dist/nodes/Code/descriptions/PythonCodeDescription.d.ts.map +1 -1
  9. package/dist/nodes/Code/descriptions/PythonCodeDescription.js +3 -14
  10. package/dist/nodes/Code/descriptions/PythonCodeDescription.js.map +1 -1
  11. package/dist/nodes/DataTable/DataTable.node.d.ts.map +1 -1
  12. package/dist/nodes/DataTable/DataTable.node.js +6 -0
  13. package/dist/nodes/DataTable/DataTable.node.js.map +1 -1
  14. package/dist/nodes/DataTable/actions/router.d.ts.map +1 -1
  15. package/dist/nodes/DataTable/actions/router.js +50 -10
  16. package/dist/nodes/DataTable/actions/router.js.map +1 -1
  17. package/dist/nodes/DataTable/actions/row/Row.resource.d.ts.map +1 -1
  18. package/dist/nodes/DataTable/actions/row/Row.resource.js +4 -16
  19. package/dist/nodes/DataTable/actions/row/Row.resource.js.map +1 -1
  20. package/dist/nodes/DataTable/actions/table/Table.resource.d.ts +8 -0
  21. package/dist/nodes/DataTable/actions/table/Table.resource.d.ts.map +1 -0
  22. package/dist/nodes/DataTable/actions/table/Table.resource.js +99 -0
  23. package/dist/nodes/DataTable/actions/table/Table.resource.js.map +1 -0
  24. package/dist/nodes/DataTable/actions/table/create.operation.d.ts +5 -0
  25. package/dist/nodes/DataTable/actions/table/create.operation.d.ts.map +1 -0
  26. package/dist/nodes/DataTable/actions/table/create.operation.js +110 -0
  27. package/dist/nodes/DataTable/actions/table/create.operation.js.map +1 -0
  28. package/dist/nodes/DataTable/actions/table/delete.operation.d.ts +5 -0
  29. package/dist/nodes/DataTable/actions/table/delete.operation.d.ts.map +1 -0
  30. package/dist/nodes/DataTable/actions/table/delete.operation.js +31 -0
  31. package/dist/nodes/DataTable/actions/table/delete.operation.js.map +1 -0
  32. package/dist/nodes/DataTable/actions/table/list.operation.d.ts +5 -0
  33. package/dist/nodes/DataTable/actions/table/list.operation.d.ts.map +1 -0
  34. package/dist/nodes/DataTable/actions/table/list.operation.js +123 -0
  35. package/dist/nodes/DataTable/actions/table/list.operation.js.map +1 -0
  36. package/dist/nodes/DataTable/actions/table/update.operation.d.ts +5 -0
  37. package/dist/nodes/DataTable/actions/table/update.operation.d.ts.map +1 -0
  38. package/dist/nodes/DataTable/actions/table/update.operation.js +31 -0
  39. package/dist/nodes/DataTable/actions/table/update.operation.js.map +1 -0
  40. package/dist/nodes/DataTable/common/fields.d.ts +28 -0
  41. package/dist/nodes/DataTable/common/fields.d.ts.map +1 -1
  42. package/dist/nodes/DataTable/common/fields.js +31 -1
  43. package/dist/nodes/DataTable/common/fields.js.map +1 -1
  44. package/dist/nodes/DataTable/common/utils.d.ts.map +1 -1
  45. package/dist/nodes/DataTable/common/utils.js +26 -7
  46. package/dist/nodes/DataTable/common/utils.js.map +1 -1
  47. package/dist/nodes/Form/Form.node.d.ts.map +1 -1
  48. package/dist/nodes/Form/Form.node.js +13 -2
  49. package/dist/nodes/Form/Form.node.js.map +1 -1
  50. package/dist/nodes/Form/FormTrigger.node.d.ts.map +1 -1
  51. package/dist/nodes/Form/FormTrigger.node.js +2 -1
  52. package/dist/nodes/Form/FormTrigger.node.js.map +1 -1
  53. package/dist/nodes/Form/common.descriptions.d.ts +3 -1
  54. package/dist/nodes/Form/common.descriptions.d.ts.map +1 -1
  55. package/dist/nodes/Form/common.descriptions.js +472 -437
  56. package/dist/nodes/Form/common.descriptions.js.map +1 -1
  57. package/dist/nodes/Form/v2/FormTriggerV2.node.d.ts.map +1 -1
  58. package/dist/nodes/Form/v2/FormTriggerV2.node.js +3 -2
  59. package/dist/nodes/Form/v2/FormTriggerV2.node.js.map +1 -1
  60. package/dist/nodes/Github/Github.node.js +2 -3
  61. package/dist/nodes/Github/Github.node.js.map +1 -1
  62. package/dist/nodes/Redis/utils.d.ts.map +1 -1
  63. package/dist/nodes/Redis/utils.js +17 -4
  64. package/dist/nodes/Redis/utils.js.map +1 -1
  65. package/dist/typecheck.tsbuildinfo +1 -1
  66. package/dist/types/nodes.json +16 -16
  67. package/package.json +8 -9
  68. package/dist/nodes/Code/Pyodide.d.ts +0 -3
  69. package/dist/nodes/Code/Pyodide.d.ts.map +0 -1
  70. package/dist/nodes/Code/Pyodide.js +0 -87
  71. package/dist/nodes/Code/Pyodide.js.map +0 -1
  72. package/dist/nodes/Code/PythonSandbox.d.ts +0 -14
  73. package/dist/nodes/Code/PythonSandbox.d.ts.map +0 -1
  74. package/dist/nodes/Code/PythonSandbox.js +0 -85
  75. package/dist/nodes/Code/PythonSandbox.js.map +0 -1
  76. package/dist/nodes/Code/native-python-without-runner.error.d.ts +0 -5
  77. package/dist/nodes/Code/native-python-without-runner.error.d.ts.map +0 -1
  78. package/dist/nodes/Code/native-python-without-runner.error.js +0 -11
  79. package/dist/nodes/Code/native-python-without-runner.error.js.map +0 -1
@@ -1,7 +1,58 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appendAttributionToForm = exports.respondWithOptions = exports.formTriggerPanel = exports.formRespondMode = exports.formFields = exports.formDescription = exports.formTitle = exports.webhookPath = exports.placeholder = void 0;
3
+ exports.appendAttributionToForm = exports.respondWithOptions = exports.formTriggerPanel = exports.formRespondMode = exports.formFieldsDynamic = exports.formFields = exports.formDescription = exports.formTitle = exports.webhookPath = exports.placeholder = exports.formElementTypes = void 0;
4
4
  const descriptions_1 = require("../../utils/descriptions");
5
+ // Shared form element types used in both formFields and formFieldsDynamic
6
+ exports.formElementTypes = [
7
+ {
8
+ name: 'Checkboxes',
9
+ value: 'checkbox',
10
+ },
11
+ {
12
+ name: 'Custom HTML',
13
+ value: 'html',
14
+ },
15
+ {
16
+ name: 'Date',
17
+ value: 'date',
18
+ },
19
+ {
20
+ name: 'Dropdown',
21
+ value: 'dropdown',
22
+ },
23
+ {
24
+ name: 'Email',
25
+ value: 'email',
26
+ },
27
+ {
28
+ name: 'File',
29
+ value: 'file',
30
+ },
31
+ {
32
+ name: 'Hidden Field',
33
+ value: 'hiddenField',
34
+ },
35
+ {
36
+ name: 'Number',
37
+ value: 'number',
38
+ },
39
+ {
40
+ name: 'Password',
41
+ value: 'password',
42
+ },
43
+ {
44
+ name: 'Radio Buttons',
45
+ value: 'radio',
46
+ },
47
+ {
48
+ name: 'Text',
49
+ value: 'text',
50
+ },
51
+ {
52
+ name: 'Textarea',
53
+ value: 'textarea',
54
+ },
55
+ ];
5
56
  exports.placeholder = `
6
57
  <!-- Your custom HTML here --->
7
58
 
@@ -36,493 +87,477 @@ exports.formDescription = {
36
87
  rows: 2,
37
88
  },
38
89
  };
39
- exports.formFields = {
40
- displayName: 'Form Elements',
41
- name: 'formFields',
42
- placeholder: 'Add Form Element',
43
- type: 'fixedCollection',
44
- default: {},
45
- typeOptions: {
46
- multipleValues: true,
47
- sortable: true,
48
- },
49
- options: [
50
- {
51
- displayName: 'Values',
52
- name: 'values',
53
- values: [
54
- {
55
- displayName: 'Field Name',
56
- name: 'fieldName',
57
- description: 'The name of the field, used in input attributes and referenced by the workflow',
58
- required: true,
59
- type: 'string',
60
- default: '',
61
- displayOptions: {
62
- hide: {
63
- fieldType: ['html'],
64
- },
65
- show: {
66
- '@version': [{ _cnd: { gte: 2.4 } }],
67
- },
90
+ const formOptions = [
91
+ {
92
+ displayName: 'Values',
93
+ name: 'values',
94
+ values: [
95
+ {
96
+ displayName: 'Field Name',
97
+ name: 'fieldName',
98
+ description: 'The name of the field, used in input attributes and referenced by the workflow',
99
+ required: true,
100
+ type: 'string',
101
+ default: '',
102
+ displayOptions: {
103
+ hide: {
104
+ fieldType: ['html'],
105
+ },
106
+ show: {
107
+ '@version': [2.4],
68
108
  },
69
109
  },
70
- {
71
- displayName: 'Label',
72
- name: 'fieldLabel',
73
- type: 'string',
74
- default: '',
75
- placeholder: 'e.g. What is your name?',
76
- description: 'Label that appears above the input field',
77
- required: true,
78
- displayOptions: {
79
- hide: {
80
- fieldType: ['hiddenField', 'html'],
81
- },
82
- show: {
83
- '@version': [{ _cnd: { gte: 2.4 } }],
84
- },
110
+ },
111
+ {
112
+ displayName: 'Label',
113
+ name: 'fieldLabel',
114
+ type: 'string',
115
+ default: '',
116
+ placeholder: 'e.g. What is your name?',
117
+ description: 'Label that appears above the input field',
118
+ required: true,
119
+ displayOptions: {
120
+ hide: {
121
+ fieldType: ['hiddenField', 'html'],
122
+ },
123
+ show: {
124
+ '@version': [{ _cnd: { gte: 2.4 } }],
85
125
  },
86
126
  },
87
- {
88
- displayName: 'Field Name',
89
- name: 'fieldLabel',
90
- type: 'string',
91
- default: '',
92
- placeholder: 'e.g. What is your name?',
93
- description: 'Label that appears above the input field',
94
- required: true,
95
- displayOptions: {
96
- hide: {
97
- fieldType: ['hiddenField', 'html'],
98
- },
99
- show: {
100
- '@version': [{ _cnd: { lt: 2.4 } }],
101
- },
127
+ },
128
+ {
129
+ displayName: 'Field Name',
130
+ name: 'fieldLabel',
131
+ type: 'string',
132
+ default: '',
133
+ placeholder: 'e.g. What is your name?',
134
+ description: 'Label that appears above the input field',
135
+ required: true,
136
+ displayOptions: {
137
+ hide: {
138
+ fieldType: ['hiddenField', 'html'],
139
+ },
140
+ show: {
141
+ '@version': [{ _cnd: { lt: 2.4 } }],
102
142
  },
103
143
  },
104
- {
105
- displayName: 'Field Name',
106
- name: 'fieldName',
107
- description: 'The name of the field, used in input attributes and referenced by the workflow',
108
- type: 'string',
109
- default: '',
110
- displayOptions: {
111
- show: {
112
- fieldType: ['hiddenField'],
113
- '@version': [{ _cnd: { lt: 2.4 } }],
114
- },
144
+ },
145
+ {
146
+ displayName: 'Field Name',
147
+ name: 'fieldName',
148
+ description: 'The name of the field, used in input attributes and referenced by the workflow',
149
+ type: 'string',
150
+ default: '',
151
+ displayOptions: {
152
+ show: {
153
+ fieldType: ['hiddenField'],
154
+ '@version': [{ _cnd: { lt: 2.4 } }],
115
155
  },
116
156
  },
117
- {
118
- displayName: 'Element Type',
119
- name: 'fieldType',
120
- type: 'options',
121
- default: 'text',
122
- description: 'The type of field to add to the form',
123
- // Update ALLOWED_FIELD_TYPES in packages/workflow/src/type-validation.ts when adding new field types
124
- options: [
125
- {
126
- name: 'Checkboxes',
127
- value: 'checkbox',
128
- },
129
- {
130
- name: 'Custom HTML',
131
- value: 'html',
132
- },
133
- {
134
- name: 'Date',
135
- value: 'date',
136
- },
137
- {
138
- name: 'Dropdown',
139
- value: 'dropdown',
140
- },
141
- {
142
- name: 'Email',
143
- value: 'email',
144
- },
145
- {
146
- name: 'File',
147
- value: 'file',
148
- },
149
- {
150
- name: 'Hidden Field',
151
- value: 'hiddenField',
152
- },
153
- {
154
- name: 'Number',
155
- value: 'number',
156
- },
157
- {
158
- name: 'Password',
159
- value: 'password',
160
- },
161
- {
162
- name: 'Radio Buttons',
163
- value: 'radio',
164
- },
165
- {
166
- name: 'Text',
167
- value: 'text',
168
- },
169
- {
170
- name: 'Textarea',
171
- value: 'textarea',
172
- },
173
- ],
174
- required: true,
175
- },
176
- {
177
- displayName: 'Element Name',
178
- name: 'elementName',
179
- type: 'string',
180
- default: '',
181
- placeholder: 'e.g. content-section',
182
- description: 'Optional field. It can be used to include the html in the output.',
183
- displayOptions: {
184
- show: {
185
- fieldType: ['html'],
186
- },
157
+ },
158
+ {
159
+ displayName: 'Element Type',
160
+ name: 'fieldType',
161
+ type: 'options',
162
+ default: 'text',
163
+ description: 'The type of field to add to the form',
164
+ // Update ALLOWED_FIELD_TYPES in packages/workflow/src/type-validation.ts when adding new field types
165
+ options: exports.formElementTypes,
166
+ required: true,
167
+ },
168
+ {
169
+ displayName: 'Element Name',
170
+ name: 'elementName',
171
+ type: 'string',
172
+ default: '',
173
+ placeholder: 'e.g. content-section',
174
+ description: 'Optional field. It can be used to include the html in the output.',
175
+ displayOptions: {
176
+ show: {
177
+ fieldType: ['html'],
187
178
  },
188
179
  },
189
- {
190
- displayName: 'Placeholder',
191
- name: 'placeholder',
192
- description: 'Sample text to display inside the field',
193
- type: 'string',
194
- default: '',
195
- displayOptions: {
196
- hide: {
197
- fieldType: ['dropdown', 'date', 'file', 'html', 'hiddenField', 'radio', 'checkbox'],
198
- },
180
+ },
181
+ {
182
+ displayName: 'Custom Field Name',
183
+ name: 'fieldName',
184
+ description: 'The name of the field, used in input attributes and referenced by the workflow',
185
+ type: 'string',
186
+ default: '',
187
+ displayOptions: {
188
+ hide: {
189
+ fieldType: ['html'],
190
+ },
191
+ show: {
192
+ '@version': [{ _cnd: { gte: 2.5 } }],
199
193
  },
200
194
  },
201
- {
202
- displayName: 'Default Value',
203
- name: 'defaultValue',
204
- description: 'Default value that will be pre-filled in the form field',
205
- type: 'string',
206
- default: '',
207
- displayOptions: {
208
- show: {
209
- fieldType: ['text', 'number', 'email', 'textarea'],
210
- },
195
+ },
196
+ {
197
+ displayName: 'Placeholder',
198
+ name: 'placeholder',
199
+ description: 'Sample text to display inside the field',
200
+ type: 'string',
201
+ default: '',
202
+ displayOptions: {
203
+ hide: {
204
+ fieldType: ['dropdown', 'date', 'file', 'html', 'hiddenField', 'radio', 'checkbox'],
211
205
  },
212
206
  },
213
- {
214
- displayName: 'Default Value',
215
- name: 'defaultValue',
216
- description: 'Default date value that will be pre-filled in the form field (format: YYYY-MM-DD)',
217
- type: 'dateTime',
218
- typeOptions: {
219
- dateOnly: true,
220
- },
221
- default: '',
222
- displayOptions: {
223
- show: {
224
- fieldType: ['date'],
225
- },
207
+ },
208
+ {
209
+ displayName: 'Default Value',
210
+ name: 'defaultValue',
211
+ description: 'Default value that will be pre-filled in the form field',
212
+ type: 'string',
213
+ default: '',
214
+ displayOptions: {
215
+ show: {
216
+ fieldType: ['text', 'number', 'email', 'textarea'],
226
217
  },
227
218
  },
228
- {
229
- displayName: 'Default Value',
230
- name: 'defaultValue',
231
- description: 'Default value that will be pre-selected. Must match one of the option labels.',
232
- type: 'string',
233
- default: '',
234
- displayOptions: {
235
- show: {
236
- fieldType: ['dropdown', 'radio'],
237
- },
238
- },
219
+ },
220
+ {
221
+ displayName: 'Default Value',
222
+ name: 'defaultValue',
223
+ description: 'Default date value that will be pre-filled in the form field (format: YYYY-MM-DD)',
224
+ type: 'dateTime',
225
+ typeOptions: {
226
+ dateOnly: true,
239
227
  },
240
- {
241
- displayName: 'Default Value',
242
- name: 'defaultValue',
243
- description: 'Default value(s) that will be pre-selected. Must match one or multiple of the option labels. Separate multiple pre-selected options with a comma.',
244
- type: 'string',
245
- default: '',
246
- displayOptions: {
247
- show: {
248
- fieldType: ['checkbox'],
249
- },
228
+ default: '',
229
+ displayOptions: {
230
+ show: {
231
+ fieldType: ['date'],
250
232
  },
251
233
  },
252
- {
253
- displayName: 'Field Value',
254
- name: 'fieldValue',
255
- description: 'Input value can be set here or will be passed as a query parameter via Field Name if no value is set',
256
- type: 'string',
257
- default: '',
258
- displayOptions: {
259
- show: {
260
- fieldType: ['hiddenField'],
261
- },
234
+ },
235
+ {
236
+ displayName: 'Default Value',
237
+ name: 'defaultValue',
238
+ description: 'Default value that will be pre-selected. Must match one of the option labels.',
239
+ type: 'string',
240
+ default: '',
241
+ displayOptions: {
242
+ show: {
243
+ fieldType: ['dropdown', 'radio'],
262
244
  },
263
245
  },
264
- {
265
- displayName: 'Field Options',
266
- name: 'fieldOptions',
267
- placeholder: 'Add Field Option',
268
- description: 'List of options that can be selected from the dropdown',
269
- type: 'fixedCollection',
270
- default: { values: [{ option: '' }] },
271
- required: true,
272
- displayOptions: {
273
- show: {
274
- fieldType: ['dropdown'],
275
- },
246
+ },
247
+ {
248
+ displayName: 'Default Value',
249
+ name: 'defaultValue',
250
+ description: 'Default value(s) that will be pre-selected. Must match one or multiple of the option labels. Separate multiple pre-selected options with a comma.',
251
+ type: 'string',
252
+ default: '',
253
+ displayOptions: {
254
+ show: {
255
+ fieldType: ['checkbox'],
276
256
  },
277
- typeOptions: {
278
- multipleValues: true,
279
- sortable: true,
280
- },
281
- options: [
282
- {
283
- displayName: 'Values',
284
- name: 'values',
285
- values: [
286
- {
287
- displayName: 'Option',
288
- name: 'option',
289
- type: 'string',
290
- default: '',
291
- },
292
- ],
293
- },
294
- ],
295
257
  },
296
- {
297
- displayName: 'Checkboxes',
298
- name: 'fieldOptions',
299
- placeholder: 'Add Checkbox',
300
- type: 'fixedCollection',
301
- default: { values: [{ option: '' }] },
302
- required: true,
303
- displayOptions: {
304
- show: {
305
- fieldType: ['checkbox'],
306
- },
307
- },
308
- typeOptions: {
309
- multipleValues: true,
310
- sortable: true,
258
+ },
259
+ {
260
+ displayName: 'Field Value',
261
+ name: 'fieldValue',
262
+ description: 'Input value can be set here or will be passed as a query parameter via Field Name if no value is set',
263
+ type: 'string',
264
+ default: '',
265
+ displayOptions: {
266
+ show: {
267
+ fieldType: ['hiddenField'],
311
268
  },
312
- options: [
313
- {
314
- displayName: 'Values',
315
- name: 'values',
316
- values: [
317
- {
318
- displayName: 'Checkbox Label',
319
- name: 'option',
320
- type: 'string',
321
- default: '',
322
- },
323
- ],
324
- },
325
- ],
326
269
  },
327
- {
328
- displayName: 'Radio Buttons',
329
- name: 'fieldOptions',
330
- placeholder: 'Add Radio Button',
331
- type: 'fixedCollection',
332
- default: { values: [{ option: '' }] },
333
- required: true,
334
- displayOptions: {
335
- show: {
336
- fieldType: ['radio'],
337
- },
270
+ },
271
+ {
272
+ displayName: 'Field Options',
273
+ name: 'fieldOptions',
274
+ placeholder: 'Add Field Option',
275
+ description: 'List of options that can be selected from the dropdown',
276
+ type: 'fixedCollection',
277
+ default: { values: [{ option: '' }] },
278
+ required: true,
279
+ displayOptions: {
280
+ show: {
281
+ fieldType: ['dropdown'],
338
282
  },
339
- typeOptions: {
340
- multipleValues: true,
341
- sortable: true,
342
- },
343
- options: [
344
- {
345
- displayName: 'Values',
346
- name: 'values',
347
- values: [
348
- {
349
- displayName: 'Radio Button Label',
350
- name: 'option',
351
- type: 'string',
352
- default: '',
353
- },
354
- ],
355
- },
356
- ],
357
283
  },
358
- {
359
- displayName: 'Multiple Choice is a legacy option, please use Checkboxes or Radio Buttons field type instead',
360
- name: 'multiselectLegacyNotice',
361
- type: 'notice',
362
- default: '',
363
- displayOptions: {
364
- show: {
365
- multiselect: [true],
366
- fieldType: ['dropdown'],
367
- '@version': [{ _cnd: { lt: 2.3 } }],
368
- },
369
- },
284
+ typeOptions: {
285
+ multipleValues: true,
286
+ sortable: true,
370
287
  },
371
- {
372
- displayName: 'Multiple Choice',
373
- name: 'multiselect',
374
- type: 'boolean',
375
- default: false,
376
- description: 'Whether to allow the user to select multiple options from the dropdown list',
377
- displayOptions: {
378
- show: {
379
- fieldType: ['dropdown'],
380
- '@version': [{ _cnd: { lt: 2.3 } }],
381
- },
288
+ options: [
289
+ {
290
+ displayName: 'Values',
291
+ name: 'values',
292
+ values: [
293
+ {
294
+ displayName: 'Option',
295
+ name: 'option',
296
+ type: 'string',
297
+ default: '',
298
+ },
299
+ ],
300
+ },
301
+ ],
302
+ },
303
+ {
304
+ displayName: 'Checkboxes',
305
+ name: 'fieldOptions',
306
+ placeholder: 'Add Checkbox',
307
+ type: 'fixedCollection',
308
+ default: { values: [{ option: '' }] },
309
+ required: true,
310
+ displayOptions: {
311
+ show: {
312
+ fieldType: ['checkbox'],
382
313
  },
383
314
  },
384
- {
385
- displayName: 'Limit Selection',
386
- name: 'limitSelection',
387
- type: 'options',
388
- default: 'unlimited',
389
- options: [
390
- {
391
- name: 'Exact Number',
392
- value: 'exact',
393
- },
394
- {
395
- name: 'Range',
396
- value: 'range',
397
- },
398
- {
399
- name: 'Unlimited',
400
- value: 'unlimited',
401
- },
402
- ],
403
- displayOptions: {
404
- show: {
405
- fieldType: ['checkbox'],
406
- },
407
- },
315
+ typeOptions: {
316
+ multipleValues: true,
317
+ sortable: true,
408
318
  },
409
- {
410
- displayName: 'Number of Selections',
411
- name: 'numberOfSelections',
412
- type: 'number',
413
- default: 1,
414
- typeOptions: {
415
- numberPrecision: 0,
416
- minValue: 1,
319
+ options: [
320
+ {
321
+ displayName: 'Values',
322
+ name: 'values',
323
+ values: [
324
+ {
325
+ displayName: 'Checkbox Label',
326
+ name: 'option',
327
+ type: 'string',
328
+ default: '',
329
+ },
330
+ ],
331
+ },
332
+ ],
333
+ },
334
+ {
335
+ displayName: 'Radio Buttons',
336
+ name: 'fieldOptions',
337
+ placeholder: 'Add Radio Button',
338
+ type: 'fixedCollection',
339
+ default: { values: [{ option: '' }] },
340
+ required: true,
341
+ displayOptions: {
342
+ show: {
343
+ fieldType: ['radio'],
417
344
  },
418
- displayOptions: {
419
- show: {
420
- fieldType: ['checkbox'],
421
- limitSelection: ['exact'],
422
- },
345
+ },
346
+ typeOptions: {
347
+ multipleValues: true,
348
+ sortable: true,
349
+ },
350
+ options: [
351
+ {
352
+ displayName: 'Values',
353
+ name: 'values',
354
+ values: [
355
+ {
356
+ displayName: 'Radio Button Label',
357
+ name: 'option',
358
+ type: 'string',
359
+ default: '',
360
+ },
361
+ ],
362
+ },
363
+ ],
364
+ },
365
+ {
366
+ displayName: 'Multiple Choice is a legacy option, please use Checkboxes or Radio Buttons field type instead',
367
+ name: 'multiselectLegacyNotice',
368
+ type: 'notice',
369
+ default: '',
370
+ displayOptions: {
371
+ show: {
372
+ multiselect: [true],
373
+ fieldType: ['dropdown'],
374
+ '@version': [{ _cnd: { lt: 2.3 } }],
423
375
  },
424
376
  },
425
- {
426
- displayName: 'Minimum Selections',
427
- name: 'minSelections',
428
- type: 'number',
429
- default: 0,
430
- typeOptions: {
431
- numberPrecision: 0,
432
- minValue: 0,
377
+ },
378
+ {
379
+ displayName: 'Multiple Choice',
380
+ name: 'multiselect',
381
+ type: 'boolean',
382
+ default: false,
383
+ description: 'Whether to allow the user to select multiple options from the dropdown list',
384
+ displayOptions: {
385
+ show: {
386
+ fieldType: ['dropdown'],
387
+ '@version': [{ _cnd: { lt: 2.3 } }],
433
388
  },
434
- displayOptions: {
435
- show: {
436
- fieldType: ['checkbox'],
437
- limitSelection: ['range'],
438
- },
389
+ },
390
+ },
391
+ {
392
+ displayName: 'Limit Selection',
393
+ name: 'limitSelection',
394
+ type: 'options',
395
+ default: 'unlimited',
396
+ options: [
397
+ {
398
+ name: 'Exact Number',
399
+ value: 'exact',
400
+ },
401
+ {
402
+ name: 'Range',
403
+ value: 'range',
404
+ },
405
+ {
406
+ name: 'Unlimited',
407
+ value: 'unlimited',
408
+ },
409
+ ],
410
+ displayOptions: {
411
+ show: {
412
+ fieldType: ['checkbox'],
439
413
  },
440
414
  },
441
- {
442
- displayName: 'Maximum Selections',
443
- name: 'maxSelections',
444
- type: 'number',
445
- default: 1,
446
- typeOptions: {
447
- numberPrecision: 0,
448
- minValue: 1,
415
+ },
416
+ {
417
+ displayName: 'Number of Selections',
418
+ name: 'numberOfSelections',
419
+ type: 'number',
420
+ default: 1,
421
+ typeOptions: {
422
+ numberPrecision: 0,
423
+ minValue: 1,
424
+ showEvenWhenOptional: true,
425
+ },
426
+ displayOptions: {
427
+ show: {
428
+ fieldType: ['checkbox'],
429
+ limitSelection: ['exact'],
449
430
  },
450
- displayOptions: {
451
- show: {
452
- fieldType: ['checkbox'],
453
- limitSelection: ['range'],
454
- },
431
+ },
432
+ },
433
+ {
434
+ displayName: 'Minimum Selections',
435
+ name: 'minSelections',
436
+ type: 'number',
437
+ default: 0,
438
+ typeOptions: {
439
+ numberPrecision: 0,
440
+ minValue: 0,
441
+ showEvenWhenOptional: true,
442
+ },
443
+ displayOptions: {
444
+ show: {
445
+ fieldType: ['checkbox'],
446
+ limitSelection: ['range'],
455
447
  },
456
448
  },
457
- {
458
- displayName: 'HTML',
459
- name: 'html',
460
- typeOptions: {
461
- editor: 'htmlEditor',
449
+ },
450
+ {
451
+ displayName: 'Maximum Selections',
452
+ name: 'maxSelections',
453
+ type: 'number',
454
+ default: 1,
455
+ typeOptions: {
456
+ numberPrecision: 0,
457
+ minValue: 1,
458
+ showEvenWhenOptional: true,
459
+ },
460
+ displayOptions: {
461
+ show: {
462
+ fieldType: ['checkbox'],
463
+ limitSelection: ['range'],
462
464
  },
463
- type: 'string',
464
- noDataExpression: true,
465
- default: exports.placeholder,
466
- description: 'HTML elements to display on the form page',
467
- hint: 'Does not accept <code>&lt;script&gt;</code>, <code>&lt;style&gt;</code> or <code>&lt;input&gt;</code> tags',
468
- displayOptions: {
469
- show: {
470
- fieldType: ['html'],
471
- },
465
+ },
466
+ },
467
+ {
468
+ displayName: 'HTML',
469
+ name: 'html',
470
+ typeOptions: {
471
+ editor: 'htmlEditor',
472
+ },
473
+ type: 'string',
474
+ noDataExpression: true,
475
+ default: exports.placeholder,
476
+ description: 'HTML elements to display on the form page',
477
+ hint: 'Does not accept <code>&lt;script&gt;</code>, <code>&lt;style&gt;</code> or <code>&lt;input&gt;</code> tags',
478
+ displayOptions: {
479
+ show: {
480
+ fieldType: ['html'],
472
481
  },
473
482
  },
474
- {
475
- displayName: 'Multiple Files',
476
- name: 'multipleFiles',
477
- type: 'boolean',
478
- default: true,
479
- description: 'Whether to allow the user to select multiple files from the file input or just one',
480
- displayOptions: {
481
- show: {
482
- fieldType: ['file'],
483
- },
483
+ },
484
+ {
485
+ displayName: 'Multiple Files',
486
+ name: 'multipleFiles',
487
+ type: 'boolean',
488
+ default: true,
489
+ description: 'Whether to allow the user to select multiple files from the file input or just one',
490
+ displayOptions: {
491
+ show: {
492
+ fieldType: ['file'],
484
493
  },
485
494
  },
486
- {
487
- displayName: 'Accepted File Types',
488
- name: 'acceptFileTypes',
489
- type: 'string',
490
- default: '',
491
- description: 'Comma-separated list of allowed file extensions',
492
- hint: 'Leave empty to allow all file types',
493
- placeholder: 'e.g. .jpg, .png',
494
- displayOptions: {
495
- show: {
496
- fieldType: ['file'],
497
- },
495
+ },
496
+ {
497
+ displayName: 'Accepted File Types',
498
+ name: 'acceptFileTypes',
499
+ type: 'string',
500
+ default: '',
501
+ description: 'Comma-separated list of allowed file extensions',
502
+ hint: 'Leave empty to allow all file types',
503
+ placeholder: 'e.g. .jpg, .png',
504
+ displayOptions: {
505
+ show: {
506
+ fieldType: ['file'],
498
507
  },
499
508
  },
500
- {
501
- displayName: "The displayed date is formatted based on the locale of the user's browser",
502
- name: 'formatDate',
503
- type: 'notice',
504
- default: '',
505
- displayOptions: {
506
- show: {
507
- fieldType: ['date'],
508
- },
509
+ },
510
+ {
511
+ displayName: "The displayed date is formatted based on the locale of the user's browser",
512
+ name: 'formatDate',
513
+ type: 'notice',
514
+ default: '',
515
+ displayOptions: {
516
+ show: {
517
+ fieldType: ['date'],
509
518
  },
510
519
  },
511
- {
512
- displayName: 'Required Field',
513
- name: 'requiredField',
514
- type: 'boolean',
515
- default: false,
516
- description: 'Whether to require the user to enter a value for this field before submitting the form',
517
- displayOptions: {
518
- hide: {
519
- fieldType: ['html', 'hiddenField'],
520
- },
520
+ },
521
+ {
522
+ displayName: 'Required Field',
523
+ name: 'requiredField',
524
+ type: 'boolean',
525
+ default: false,
526
+ description: 'Whether to require the user to enter a value for this field before submitting the form',
527
+ displayOptions: {
528
+ hide: {
529
+ fieldType: ['html', 'hiddenField'],
521
530
  },
522
531
  },
523
- ],
524
- },
525
- ],
532
+ },
533
+ ],
534
+ },
535
+ ];
536
+ exports.formFields = {
537
+ displayName: 'Form Elements',
538
+ name: 'formFields',
539
+ placeholder: 'Add Form Element',
540
+ type: 'fixedCollection',
541
+ default: {},
542
+ typeOptions: {
543
+ multipleValues: true,
544
+ sortable: true,
545
+ },
546
+ options: formOptions,
547
+ };
548
+ exports.formFieldsDynamic = {
549
+ displayName: 'Form Elements',
550
+ name: 'formFields',
551
+ placeholder: 'Add Form Element',
552
+ type: 'fixedCollection',
553
+ default: {},
554
+ typeOptions: {
555
+ multipleValues: true,
556
+ sortable: true,
557
+ hideOptionalFields: true,
558
+ addOptionalFieldButtonText: 'Add Attributes',
559
+ },
560
+ options: formOptions,
526
561
  };
527
562
  exports.formRespondMode = {
528
563
  displayName: 'Respond When',