{"version":3,"sources":["../extensions/timepicker/js/ewtimepicker.js"],"names":["ew","createTimePicker","formid","id","options","includes","$","jQuery","$el","getElement","isInvalid","hasClass","format","timeFormat","data","formatDateTime","valueOf","getTimezoneOffset","inputGroup","isBoolean","timepicker","on","this","timepickerObj","list","width","outerWidth","tooltip","$btn","addClass","wrap","after"],"mappings":";;;;AAIAA,GAAGC,iBAAmB,SAASC,EAAQC,EAAIC,GACvC,GAAID,EAAGE,SAAS,cACZ,OACJ,IAAIC,EAAIC,OAEJC,EAAMF,EADDN,GAAGS,WAAWN,EAAID,IAEvBQ,EAAYF,EAAIG,SAAS,cACzBC,EAASR,EAAQS,WACrB,GAAIL,EAAIG,SAAS,uBACb,OACAC,IAGAR,EAAQS,WAAaC,GAAQd,GAAGe,eAAeD,EAAKE,UAAY,IAAkC,GAA3BF,EAAKG,oBAA0BL,IAE1G,IAAIM,GAAaZ,EAAEa,UAAUf,EAAQc,aAAcd,EAAQc,WAS3D,UAROd,EAAkB,WACzBI,EAAIY,WAAWhB,GAASiB,GAAG,kBAAkB,WACzCC,KAAKC,cAAcC,KAAKC,MAAMjB,EAAIkB,aAAe,MAClDL,GAAG,SAAS,WACXb,EAAImB,QAAQ,QAAQA,QAAQ,cAC7BN,GAAG,QAAQ,WACVb,EAAImB,QAAQ,aAEZT,EAAY,CACZ,IAAIU,EAAOtB,EAAE,sEACRuB,SAAS,mBACTR,GAAG,SAAS,WACTb,EAAIY,WAAW,WAEvBZ,EAAIsB,KAAK,0BAA0BpB,EAAY,cAAgB,cAAcqB,MAAMH","sourcesContent":["/**\r\n * Create Time Picker (for PHPMaker 2024)\r\n * @license Copyright (c) e.World Technology Limited. All rights reserved.\r\n */\r\new.createTimePicker = function(formid, id, options) {\r\n if (id.includes(\"$rowindex$\"))\r\n return;\r\n let $ = jQuery,\r\n el = ew.getElement(id, formid),\r\n $el = $(el),\r\n isInvalid = $el.hasClass(\"is-invalid\"),\r\n format = options.timeFormat;\r\n if ($el.hasClass(\"ui-timepicker-input\"))\r\n return;\r\n if (format) {\r\n // data is a JS Date object created by new Date(1970, 0, 2, hours, minutes, seconds, 0) with browser time zone\r\n // so we need to convert it back to UTC\r\n options.timeFormat = data => ew.formatDateTime(data.valueOf() / 1000 - data.getTimezoneOffset() * 60, format);\r\n }\r\n let inputGroup = $.isBoolean(options.inputGroup) ? options.inputGroup : true;\r\n delete(options.inputGroup);\r\n $el.timepicker(options).on(\"showTimepicker\", function() {\r\n this.timepickerObj.list.width($el.outerWidth() - 2);\r\n }).on(\"focus\", function() {\r\n $el.tooltip(\"hide\").tooltip(\"disable\");\r\n }).on(\"blur\", function() {\r\n $el.tooltip(\"enable\");\r\n });\r\n if (inputGroup) {\r\n let $btn = $('')\r\n .addClass(\"btn btn-default\")\r\n .on(\"click\", function() {\r\n $el.timepicker(\"show\");\r\n });\r\n $el.wrap(`
`).after($btn);\r\n }\r\n}\r\n"]}