1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"ast":null,"code":"import { DomHandler } from 'primereact/utils';\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar KeyFilter = /*#__PURE__*/function () {\n function KeyFilter() {\n _classCallCheck(this, KeyFilter);\n }\n\n _createClass(KeyFilter, null, [{\n key: \"isNavKeyPress\",\n value:\n /* eslint-disable */\n\n /* eslint-enable */\n function isNavKeyPress(e) {\n var k = e.keyCode;\n k = DomHandler.getBrowser().safari ? KeyFilter.SAFARI_KEYS[k] || k : k;\n return k >= 33 && k <= 40 || k === KeyFilter.KEYS.RETURN || k === KeyFilter.KEYS.TAB || k === KeyFilter.KEYS.ESC;\n }\n }, {\n key: \"isSpecialKey\",\n value: function isSpecialKey(e) {\n var k = e.keyCode;\n return k === 9 || k === 13 || k === 27 || k === 16 || k === 17 || k >= 18 && k <= 20 || DomHandler.getBrowser().opera && !e.shiftKey && (k === 8 || k >= 33 && k <= 35 || k >= 36 && k <= 39 || k >= 44 && k <= 45);\n }\n }, {\n key: \"getKey\",\n value: function getKey(e) {\n var k = e.keyCode || e.charCode;\n return DomHandler.getBrowser().safari ? KeyFilter.SAFARI_KEYS[k] || k : k;\n }\n }, {\n key: \"getCharCode\",\n value: function getCharCode(e) {\n return e.charCode || e.keyCode || e.which;\n }\n }, {\n key: \"onKeyPress\",\n value: function onKeyPress(e, keyfilter, validateOnly) {\n if (validateOnly) {\n return;\n }\n\n var regex = KeyFilter.DEFAULT_MASKS[keyfilter] ? KeyFilter.DEFAULT_MASKS[keyfilter] : keyfilter;\n var browser = DomHandler.getBrowser();\n\n if (e.ctrlKey || e.altKey) {\n return;\n }\n\n var k = this.getKey(e);\n\n if (browser.mozilla && (this.isNavKeyPress(e) || k === KeyFilter.KEYS.BACKSPACE || k === KeyFilter.KEYS.DELETE && e.charCode === 0)) {\n return;\n }\n\n var c = this.getCharCode(e);\n var cc = String.fromCharCode(c);\n\n if (browser.mozilla && (this.isSpecialKey(e) || !cc)) {\n return;\n }\n\n if (!regex.test(cc)) {\n e.preventDefault();\n }\n }\n }, {\n key: \"validate\",\n value: function validate(e, keyfilter) {\n var value = e.target.value,\n validatePattern = true;\n\n if (value && !keyfilter.test(value)) {\n validatePattern = false;\n }\n\n return validatePattern;\n }\n }]);\n\n return KeyFilter;\n}();\n\n_defineProperty(KeyFilter, \"DEFAULT_MASKS\", {\n pint: /[\\d]/,\n \"int\": /[\\d\\-]/,\n pnum: /[\\d\\.]/,\n money: /[\\d\\.\\s,]/,\n num: /[\\d\\-\\.]/,\n hex: /[0-9a-f]/i,\n email: /[a-z0-9_\\.\\-@]/i,\n alpha: /[a-z_]/i,\n alphanum: /[a-z0-9_]/i\n});\n\n_defineProperty(KeyFilter, \"KEYS\", {\n TAB: 9,\n RETURN: 13,\n ESC: 27,\n BACKSPACE: 8,\n DELETE: 46\n});\n\n_defineProperty(KeyFilter, \"SAFARI_KEYS\", {\n 63234: 37,\n // left\n 63235: 39,\n // right\n 63232: 38,\n // up\n 63233: 40,\n // down\n 63276: 33,\n // page up\n 63277: 34,\n // page down\n 63272: 46,\n // delete\n 63273: 36,\n // home\n 63275: 35 // end\n\n});\n\nexport { KeyFilter };","map":{"version":3,"names":["DomHandler","_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","_createClass","protoProps","staticProps","prototype","_defineProperty","obj","value","KeyFilter","isNavKeyPress","e","k","keyCode","getBrowser","safari","SAFARI_KEYS","KEYS","RETURN","TAB","ESC","isSpecialKey","opera","shiftKey","getKey","charCode","getCharCode","which","onKeyPress","keyfilter","validateOnly","regex","DEFAULT_MASKS","browser","ctrlKey","altKey","mozilla","BACKSPACE","DELETE","c","cc","String","fromCharCode","test","preventDefault","validate","validatePattern","pint","pnum","money","num","hex","email","alpha","alphanum"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/primereact/keyfilter/keyfilter.esm.js"],"sourcesContent":["import { DomHandler } from 'primereact/utils';\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar KeyFilter = /*#__PURE__*/function () {\n function KeyFilter() {\n _classCallCheck(this, KeyFilter);\n }\n\n _createClass(KeyFilter, null, [{\n key: \"isNavKeyPress\",\n value:\n /* eslint-disable */\n\n /* eslint-enable */\n function isNavKeyPress(e) {\n var k = e.keyCode;\n k = DomHandler.getBrowser().safari ? KeyFilter.SAFARI_KEYS[k] || k : k;\n return k >= 33 && k <= 40 || k === KeyFilter.KEYS.RETURN || k === KeyFilter.KEYS.TAB || k === KeyFilter.KEYS.ESC;\n }\n }, {\n key: \"isSpecialKey\",\n value: function isSpecialKey(e) {\n var k = e.keyCode;\n return k === 9 || k === 13 || k === 27 || k === 16 || k === 17 || k >= 18 && k <= 20 || DomHandler.getBrowser().opera && !e.shiftKey && (k === 8 || k >= 33 && k <= 35 || k >= 36 && k <= 39 || k >= 44 && k <= 45);\n }\n }, {\n key: \"getKey\",\n value: function getKey(e) {\n var k = e.keyCode || e.charCode;\n return DomHandler.getBrowser().safari ? KeyFilter.SAFARI_KEYS[k] || k : k;\n }\n }, {\n key: \"getCharCode\",\n value: function getCharCode(e) {\n return e.charCode || e.keyCode || e.which;\n }\n }, {\n key: \"onKeyPress\",\n value: function onKeyPress(e, keyfilter, validateOnly) {\n if (validateOnly) {\n return;\n }\n\n var regex = KeyFilter.DEFAULT_MASKS[keyfilter] ? KeyFilter.DEFAULT_MASKS[keyfilter] : keyfilter;\n var browser = DomHandler.getBrowser();\n\n if (e.ctrlKey || e.altKey) {\n return;\n }\n\n var k = this.getKey(e);\n\n if (browser.mozilla && (this.isNavKeyPress(e) || k === KeyFilter.KEYS.BACKSPACE || k === KeyFilter.KEYS.DELETE && e.charCode === 0)) {\n return;\n }\n\n var c = this.getCharCode(e);\n var cc = String.fromCharCode(c);\n\n if (browser.mozilla && (this.isSpecialKey(e) || !cc)) {\n return;\n }\n\n if (!regex.test(cc)) {\n e.preventDefault();\n }\n }\n }, {\n key: \"validate\",\n value: function validate(e, keyfilter) {\n var value = e.target.value,\n validatePattern = true;\n\n if (value && !keyfilter.test(value)) {\n validatePattern = false;\n }\n\n return validatePattern;\n }\n }]);\n\n return KeyFilter;\n}();\n\n_defineProperty(KeyFilter, \"DEFAULT_MASKS\", {\n pint: /[\\d]/,\n \"int\": /[\\d\\-]/,\n pnum: /[\\d\\.]/,\n money: /[\\d\\.\\s,]/,\n num: /[\\d\\-\\.]/,\n hex: /[0-9a-f]/i,\n email: /[a-z0-9_\\.\\-@]/i,\n alpha: /[a-z_]/i,\n alphanum: /[a-z0-9_]/i\n});\n\n_defineProperty(KeyFilter, \"KEYS\", {\n TAB: 9,\n RETURN: 13,\n ESC: 27,\n BACKSPACE: 8,\n DELETE: 46\n});\n\n_defineProperty(KeyFilter, \"SAFARI_KEYS\", {\n 63234: 37,\n // left\n 63235: 39,\n // right\n 63232: 38,\n // up\n 63233: 40,\n // down\n 63276: 33,\n // page up\n 63277: 34,\n // page down\n 63272: 46,\n // delete\n 63273: 36,\n // home\n 63275: 35 // end\n\n});\n\nexport { KeyFilter };\n"],"mappings":"AAAA,SAASA,UAAT,QAA2B,kBAA3B;;AAEA,SAASC,eAAT,CAAyBC,QAAzB,EAAmCC,WAAnC,EAAgD;EAC9C,IAAI,EAAED,QAAQ,YAAYC,WAAtB,CAAJ,EAAwC;IACtC,MAAM,IAAIC,SAAJ,CAAc,mCAAd,CAAN;EACD;AACF;;AAED,SAASC,iBAAT,CAA2BC,MAA3B,EAAmCC,KAAnC,EAA0C;EACxC,KAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,KAAK,CAACE,MAA1B,EAAkCD,CAAC,EAAnC,EAAuC;IACrC,IAAIE,UAAU,GAAGH,KAAK,CAACC,CAAD,CAAtB;IACAE,UAAU,CAACC,UAAX,GAAwBD,UAAU,CAACC,UAAX,IAAyB,KAAjD;IACAD,UAAU,CAACE,YAAX,GAA0B,IAA1B;IACA,IAAI,WAAWF,UAAf,EAA2BA,UAAU,CAACG,QAAX,GAAsB,IAAtB;IAC3BC,MAAM,CAACC,cAAP,CAAsBT,MAAtB,EAA8BI,UAAU,CAACM,GAAzC,EAA8CN,UAA9C;EACD;AACF;;AAED,SAASO,YAAT,CAAsBd,WAAtB,EAAmCe,UAAnC,EAA+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