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