{"version":3,"sources":["js\\ewdatetimepicker.js"],"names":["tempusDominus","Namespace","css","toggleMeridiem","ew","dateTimePickerOptions","keepInvalid","localization","dayViewHeaderFormat","month","year","createDateTimePicker","formid","id","pickerOptions","options","includes","$","jQuery","el","getElement","$el","$input","dataKey","data","parent","args","form","enabled","deepAssign","document","trigger","inputGroup","$textbox","isInvalid","hasClass","attr","$btn","on","removeClass","addClass","wrap","after","tooltip","td","addEventListener","e","updateOptions","display","theme","detail","minDateField","fields","restrictions","minDate","date","maxDateField","maxDate"],"mappings":";;;;AAKAA,cAAcC,UAAUC,IAAIC,eAAiB,iCAG7CC,GAAGC,sBAAwB,CACvBC,aAAa,EACbC,aAAc,CACVC,oBAAqB,CAAEC,MAAO,OAAQC,KAAM,aAapDN,GAAGO,qBAAuB,SAASC,EAAQC,EAAIC,EAAeC,GAC1D,GAAIF,EAAGG,SAAS,cACZ,OACJ,IAAIC,EAAIC,OACJC,EAAKf,GAAGgB,WAAWP,EAAID,GACvBS,EAAMJ,EAAEE,GAERG,EAASL,EADJb,GAAGgB,WAAW,MAAQP,EAAID,IACdO,GACjBI,EAAUvB,cAAcC,UAAUsB,QACtC,IAAKJ,GAAMG,EAAOE,KAAKD,IAAYD,EAAOG,SAASD,KAAKD,GACpD,OACJ,IAAIG,EAAO,CACPb,GAAMA,EACNc,KAAQf,EACRgB,SAAW,EACXb,QAAWX,GAAGyB,WAAW,GAAIzB,GAAGC,sBAAuBS,IAG3D,GADAG,EAAEa,UAAUC,QAAQ,iBAAkB,CAACL,KAClCA,EAAKE,QACN,OACJ,GAAIb,EAAQiB,WAAY,CAKpB,IAAIC,EAAWX,EACXY,EAAYZ,EAAOa,SAAS,cAC5BtB,EAAK,kBAAoBD,EAAS,IAAMU,EAAOc,KAAK,MACpDC,KAAOpB,EAAE,iGACJqB,GAAG,SAASf,KAAW,IAAMU,EAASM,YAAY,gBAC3DjB,EAAOkB,SAAS,GAAGjB,WAAiBa,KAAK,iBAAkB,IAAMvB,GAC5D4B,KAAK,0BAA0BP,EAAY,cAAgB,WAAWrB,4EACtE6B,MAAML,KAAKD,KAAK,iBAAkB,IAAMvB,GAAIuB,KAAK,iBAAkB,mBACnEE,GAAG,SAASf,KAAW,IAAMU,EAASU,QAAQ,QAAQA,QAAQ,aAC9DL,GAAG,QAAQf,KAAW,IAAMU,EAASU,QAAQ,YAClDrB,EAASA,EAAOG,cAGhBH,EAAOkB,SAAS,GAAGjB,WACde,GAAG,SAASf,KAAW,IAAMD,EAAOqB,QAAQ,QAAQA,QAAQ,aAC5DL,GAAG,QAAQf,KAAW,IAAMD,EAAOqB,QAAQ,YAEpDrB,EAAOtB,cAAc0B,EAAKX,SAC1B,MAAM6B,EAAKtB,EAAOE,KAAKD,GAgBvB,OAfAO,SAASe,iBAAiB,eAAeC,GAAKF,EAAGG,cAAc,CAAEC,QAAS,CAAEC,MAAOH,EAAEI,YACjFnC,EAAQoC,cACR9B,EAAI+B,OAAOrC,EAAQoC,gBAAgB,IAAIN,iBAAiB,UAAWC,GAAMF,EAAGG,cAAc,CACtFM,aAAc,CACVC,QAASR,EAAEI,QAAQK,UAI3BxC,EAAQyC,cACRnC,EAAI+B,OAAOrC,EAAQyC,gBAAgB,IAAIX,iBAAiB,UAAWC,GAAMF,EAAGG,cAAc,CACtFM,aAAc,CACVI,QAASX,EAAEI,QAAQK,UAIxBX","sourcesContent":["/**\r\n * Create Date/Time Picker (for PHPMaker 2025)\r\n * @license Copyright (c) e.World Technology Limited. All rights reserved.\r\n */\r\n\r\ntempusDominus.Namespace.css.toggleMeridiem = \"toggleMeridiem,btn,btn-primary\";\r\n\r\n// Global options\r\new.dateTimePickerOptions = {\r\n keepInvalid: true,\r\n localization: {\r\n dayViewHeaderFormat: { month: \"long\", year: \"numeric\" }\r\n }\r\n};\r\n\r\n/**\r\n * Create date/time picker\r\n *\r\n * @param {string} formid - Form ID\r\n * @param {string} id - Field variable name\r\n * @param {object} pickerOptions - DateTime picker options\r\n * @param {object} options - Options\r\n * @returns\r\n */\r\new.createDateTimePicker = function(formid, id, pickerOptions, 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 sv = ew.getElement(\"sv_\" + id, formid), // AutoSuggest\r\n $input = $(sv || el),\r\n dataKey = tempusDominus.Namespace.dataKey; // \"td\"\r\n if (!el || $input.data(dataKey) || $input.parent().data(dataKey))\r\n return;\r\n let args = {\r\n \"id\": id,\r\n \"form\": formid,\r\n \"enabled\": true,\r\n \"options\": ew.deepAssign({}, ew.dateTimePickerOptions, pickerOptions)\r\n };\r\n $(document).trigger(\"datetimepicker\", [args]);\r\n if (!args.enabled)\r\n return;\r\n if (options.inputGroup) {\r\n //
\r\n // \r\n // \r\n //
\r\n let $textbox = $input,\r\n isInvalid = $input.hasClass(\"is-invalid\"),\r\n id = \"datetimepicker_\" + formid + \"_\" + $input.attr(\"id\");\r\n $btn = $('')\r\n .on(`click.${dataKey}`, () => $textbox.removeClass(\"is-invalid\"));\r\n $input.addClass(`${dataKey}-input`).attr(\"data-td-target\", \"#\" + id)\r\n .wrap(`
`)\r\n .after($btn.attr(\"data-td-target\", \"#\" + id).attr(\"data-td-toggle\", \"datetimepicker\"))\r\n .on(`focus.${dataKey}`, () => $textbox.tooltip(\"hide\").tooltip(\"disable\"))\r\n .on(`blur.${dataKey}`, () => $textbox.tooltip(\"enable\"));\r\n $input = $input.parent();\r\n } else {\r\n // \r\n $input.addClass(`${dataKey}-input`)\r\n .on(`focus.${dataKey}`, () => $input.tooltip(\"hide\").tooltip(\"disable\"))\r\n .on(`blur.${dataKey}`, () => $input.tooltip(\"enable\"));\r\n }\r\n $input.tempusDominus(args.options);\r\n const td = $input.data(dataKey);\r\n document.addEventListener(\"changetheme\", e => td.updateOptions({ display: { theme: e.detail } }));\r\n if (options.minDateField) {\r\n $el.fields(options.minDateField)?.[0]?.addEventListener(\"change\", (e) => td.updateOptions({\r\n restrictions: {\r\n minDate: e.detail?.date,\r\n },\r\n }));\r\n }\r\n if (options.maxDateField) {\r\n $el.fields(options.maxDateField)?.[0]?.addEventListener(\"change\", (e) => td.updateOptions({\r\n restrictions: {\r\n maxDate: e.detail?.date,\r\n },\r\n }));\r\n }\r\n return td;\r\n}\r\n"]}