Liferay.Loader.define("@liferay/commerce-warehouse-web@4.0.41/js/viewWarehouseItems",["module","exports","require"],(function(e,t,c){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default({ADD:e,CMD:t,UPDATE:c,namespace:o}){const r=document.getElementById("".concat(o,"fm"));function handleSaveBtnClick(n){const{commerceInventoryWarehouseId:a,commerceInventoryWarehouseItemId:u,index:l,mvccVersion:s}=n.target.closest("tr").dataset;r.querySelector("#".concat(o).concat(t)).value=u>0?c:e,r.querySelector("#".concat(o,"commerceInventoryWarehouseId")).value=a,r.querySelector("#".concat(o,"commerceInventoryWarehouseItemId")).value=u;const m=document.querySelector("#".concat(o,"commerceInventoryWarehouseItemQuantity").concat(l));r.querySelector("#".concat(o,"quantity")).value=m.value,r.querySelector("#".concat(o,"mvccVersion")).value=s,submitForm(r)}document.querySelectorAll(".warehouse-save-btn").forEach((e=>{e.addEventListener("click",handleSaveBtnClick)}));const n="".concat(o,"commerceInventoryWarehouseItemQuantity");document.querySelectorAll("input[id^=".concat(n,"]")).forEach((e=>{e.addEventListener("keypress",(t=>{13===t.keyCode&&(t.preventDefault(),e.closest("tr").querySelector(".warehouse-save-btn").click())}))}))}}));
//# sourceMappingURL=viewWarehouseItems.js.map