-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathconfig.js
120 lines (111 loc) · 2.98 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import mi18n from 'mi18n'
/* istanbul ignore next */
const noop = () => null
// eslint-disable-next-line
mi18n.addLanguage('en-US', FB_EN_US)
export const defaultOptions = {
actionButtons: [], // additional form action buttons- save, data, clear
allowStageSort: true,
append: false, // append non-editable content to the form.
controlOrder: [
'autocomplete',
'button',
'checkbox-group',
'checkbox',
'date',
'file',
'header',
'hidden',
'number',
'paragraph',
'radio-group',
'select',
'text',
'textarea',
],
controlPosition: 'right',
dataType: 'json',
defaultFields: [],
disabledActionButtons: [], // save, data, clear
disabledAttrs: [],
disabledFieldButtons: {},
disabledSubtypes: {}, // subtypes you want disabled
disableFields: [], // Array of fields to disable
disableHTMLLabels: false, // disables html in field labels
disableInjectedStyle: false, // removes the injected style
editOnAdd: false, // opens the edit panel on added field
fields: [], // add custom control configs
fieldRemoveWarn: false,
fieldEditContainer: null, // DOM node or selector
inputSets: [], // add groups of fields at a time
notify: {
error: /* istanbul ignore next */ error => {
console.log(error)
},
success: /* istanbul ignore next */ success => {
console.log(success)
},
warning: /* istanbul ignore next */ warning => {
console.warn(warning)
},
},
onAddField: /* istanbul ignore next */ (fieldId, fieldData) => fieldData,
onAddFieldAfter: /* istanbul ignore next */ (fieldId, fieldData) => fieldData,
onAddOption: /* istanbul ignore next */ obj => obj,
onClearAll: noop,
onCloseFieldEdit: noop,
onOpenFieldEdit: noop,
/**
* @param {Object} evt
* @param {Object} formData
*/
onSave: noop,
persistDefaultFields: false,
prepend: false,
replaceFields: [],
roles: {
1: 'Administrator',
},
sanitizerOptions: {
clobberingProtection: {
document: false,
form: false,
},
backendOrder: [], //'dompurify','sanitizer','fallback'
},
scrollToFieldOnAdd: true,
showActionButtons: true,
sortableControls: false,
stickyControls: {
enable: true,
offset: {
top: 5,
bottom: 'auto',
right: 'auto',
},
},
subtypes: {},
templates: {},
typeUserAttrs: {},
typeUserDisabledAttrs: {},
typeUserEvents: {},
defaultGridColumnClass: 'col-md-12',
cancelGridModeDistance: 100,
enableColumnInsertMenu: false,
enableEnhancedBootstrapGrid: false,
}
export const styles = {
btn: ['default', 'danger', 'info', 'primary', 'success', 'warning'],
}
export const defaultI18n = {
location: 'assets/lang/',
}
export const instanceConfig = {}
export const gridClassNames = {
rowWrapperClass: 'rowWrapper',
colWrapperClass: 'colWrapper',
tmpRowPlaceholderClass: 'tempRowWrapper',
invisibleRowPlaceholderClass: 'invisibleRowPlaceholder',
}
export const defaultTimeout = 333
export const defaultFieldSelector = 'li.form-field'