-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaskConfig.js
73 lines (64 loc) · 1.95 KB
/
maskConfig.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
export const maskPropertiesOrder = ['maskType', 'pattern', 'options', 'placeholderVisible', 'placeholderChar'];
/* wwEditor:start */
const patternHelp = `Pattern mask is just a string: \`'{#}000[aaa]/NIC-\`\`*[**]'\`
Where definitions are:
- 0 - any digit
- a - any letter
- * - any char
- [] - make input optional
- {} - include fixed part in unmasked value
Examples:
US phone: \`'{(000)} 000-0000'\` <br/>
French phone: \`'+{33} 000 000 000'\` <br/>
Bank card: \`'0000 0000 0000 0000'\` <br/>
International Bank Account Number (IBAN): \`'0000 0000 0000 0000 0000 00'\` <br/>
IP: \`'000.000.000.000'\`
US Social security number: \`'000-00-0000'\` <br/>
French Social security number: \`'00 00 00 000 000'\` <br/>
iMask documentation: <a href="https://imask.js.org/guide.html#masked-pattern" target="_blank">https://imask.js.org/guide.html#masked-pattern</a>
`;
/* wwEditor:end */
export const maskProperties = {
pattern: {
label: {
en: 'Pattern',
},
type: 'Text',
section: 'settings',
bindable: true,
defaultValue: '{8}000000',
/* wwEditor:start */
bindingValidation: {
type: 'string',
tooltip: patternHelp,
},
propertyHelp: {
tooltip: patternHelp,
},
/* wwEditor:end */
},
placeholderVisible: {
label: {
en: 'Mask placeholder',
},
type: 'OnOff',
section: 'settings',
defaultValue: false,
},
placeholderChar: {
label: {
en: 'Placeholder character',
},
type: 'Text',
section: 'settings',
bindable: true,
defaultValue: '_',
/* wwEditor:start */
bindingValidation: {
type: 'string',
tooltip: 'A string that represents the placeholder: `"0"`, `"X"` or `"#"`',
},
/* wwEditor:end */
hidden: content => content.placeholderVisible !== true,
},
};