\r\n });\r\n \r\n im.mask(this.element);\r\n }\r\n}\r\n\r\nexport class CleanInputMaskValueConverter {\r\n fromView(val) {\r\n if (typeof val === 'string' && val.includes('
)) {\r\n \u002F\u002F Strip out $, _ and , as well as whitespace\r\n \u002F\u002F Then parse it as a floating number to account for decimals\r\n const parsedValue = parseFloat(val.replace('
, '').replace(\u002F_\u002Fg, '').replace(\u002F,\u002Fg, '').trim());\r\n\r\n \u002F\u002F The number is valid return it\r\n if (!isNaN(parsedValue)) {\r\n return parsedValue;\r\n }\r\n }\r\n\r\n \u002F\u002F Our parsed value was not a valid number, just return the passed in value\r\n return val;\r\n }\r\n}\r\n\r\nexport class PrecisionValueConverter {\r\n toView(val, prefix = null) {\r\n const parsedValue = parseFloat(val);\r\n\r\n if (!isNaN(parsedValue)) {\r\n if (prefix) {\r\n return `${prefix}${parsedValue.toFixed(2)}`;\r\n } else {\r\n return parsedValue.toFixed(2);\r\n }\r\n }\r\n\r\n return val;\r\n }\r\n}","id":"b5ff4be4-b24f-4147-8ff0-33ca4edff211","is_binary":false,"title":"input-mask.ts","sha":null,"inserted_at":"2019-04-29T10:03:26","updated_at":"2019-04-29T10:04:02","upload_id":null,"shortid":"k8Byx","source_id":"4514069e-1457-4384-90f8-37e0f3b998db","directory_shortid":"GwjlJ"}],"forked_template":null,"description":"An example of masked inputs in Aurelia.","settings":{"ai_consent":null}};