defaults.js 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. export default {
  2. _maxTestPos: 500,
  3. placeholder: "_",
  4. optionalmarker: ["[", "]"],
  5. quantifiermarker: ["{", "}"],
  6. groupmarker: ["(", ")"],
  7. alternatormarker: "|",
  8. escapeChar: "\\",
  9. mask: null, // needs tobe null instead of undefined as the extend method does not consider props with the undefined value
  10. regex: null, // regular expression as a mask
  11. oncomplete: () => {}, // executes when the mask is complete
  12. onincomplete: () => {}, // executes when the mask is incomplete and focus is lost
  13. oncleared: () => {}, // executes when the mask is cleared
  14. repeat: 0, // repetitions of the mask: * ~ forever, otherwise specify an integer
  15. greedy: false, // true: allocated buffer for the mask and repetitions - false: allocate only if needed
  16. autoUnmask: false, // automatically unmask when retrieving the value with $.fn.val or value if the browser supports __lookupGetter__ or getOwnPropertyDescriptor
  17. removeMaskOnSubmit: false, // remove the mask before submitting the form.
  18. clearMaskOnLostFocus: true,
  19. insertMode: true, // insert the input or overwrite the input
  20. insertModeVisual: true, // show selected caret when insertmode = false
  21. clearIncomplete: false, // clear the incomplete input on blur
  22. alias: null,
  23. onKeyDown: () => {}, // callback to implement autocomplete on certain keys for example. args => event, buffer, caretPos, opts
  24. onBeforeMask: null, // executes before masking the initial value to allow preprocessing of the initial value. args => initialValue, opts => return processedValue
  25. onBeforePaste: function (pastedValue, opts) {
  26. return typeof opts.onBeforeMask === "function"
  27. ? opts.onBeforeMask.call(this, pastedValue, opts)
  28. : pastedValue;
  29. }, // executes before masking the pasted value to allow preprocessing of the pasted value. args => pastedValue, opts => return processedValue
  30. onBeforeWrite: null, // executes before writing to the masked element. args => event, opts
  31. onUnMask: null, // executes after unmasking to allow postprocessing of the unmaskedvalue. args => maskedValue, unmaskedValue, opts
  32. showMaskOnFocus: true, // show the mask-placeholder when the input has focus
  33. showMaskOnHover: true, // show the mask-placeholder when hovering the empty input
  34. onKeyValidation: () => {}, // executes on every key-press with the result of isValid. Params: key, result, opts
  35. skipOptionalPartCharacter: " ", // a character which can be used to skip an optional part of a mask
  36. numericInput: false, // numericInput input direction style (input shifts to the left while holding the caret position)
  37. rightAlign: false, // align to the right
  38. undoOnEscape: true, // pressing escape reverts the value to the value before focus
  39. // numeric basic properties
  40. radixPoint: "", // ".", // | ","
  41. _radixDance: false, // dance around the radixPoint
  42. groupSeparator: "", // ",", // | "."
  43. // numeric basic properties
  44. keepStatic: null, // try to keep the mask static while typing. Decisions to alter the mask will be posponed if possible
  45. positionCaretOnTab: true, // when enabled the caret position is set after the latest valid position on TAB
  46. tabThrough: false, // allows for tabbing through the different parts of the masked field
  47. supportsInputType: ["text", "tel", "url", "password", "search"], // list with the supported input types
  48. isComplete: null, // override for isComplete - args => buffer, opts - return true || false
  49. preValidation: null, // hook to preValidate the input. Usefull for validating regardless the definition. args => buffer, pos, char, isSelection, opts, maskset, caretPos, strict => return true/false/command object
  50. postValidation: null, // hook to postValidate the result from isValid. Usefull for validating the entry as a whole. args => buffer, pos, c, currentResult, opts, maskset, strict, fromCheckval => return true/false/json
  51. staticDefinitionSymbol: undefined, // specify a definitionSymbol for static content, used to make matches for alternators
  52. jitMasking: false, // just in time masking ~ only mask while typing, can n (number), true or false
  53. nullable: true, // return nothing instead of the buffertemplate when the user hasn't entered anything.
  54. inputEventOnly: false, // dev option - testing inputfallback behavior
  55. noValuePatching: false, // disable value property patching
  56. positionCaretOnClick: "lvp", // none, lvp (based on the last valid position (default), radixFocus (position caret to radixpoint on initial click), select (select the whole input), ignore (ignore the click and continue the mask)
  57. casing: null, // mask-level casing. Options: null, "upper", "lower" or "title" or callback args => elem, test, pos, validPositions return charValue
  58. inputmode: "text", // specify the inputmode
  59. importDataAttributes: true, // import data-inputmask attributes
  60. shiftPositions: true, // shift position of the mask entries on entry and deletion.
  61. usePrototypeDefinitions: true, // use the default defined definitions from the prototype
  62. validationEventTimeOut: 3000, // Time to show validation error on form submit
  63. substitutes: {} // define character substitutes
  64. };