import{_ as f}from"./ButtonDefault-CghIUDY0.js";import{c as N,o as m,a as l,t as b,I as v,S as C,C as U,h as g,b as y,x as S,r as _,H as u,s as k}from"./index-CipWZKo_.js";import{u as D}from"./global-Fil99La8.js";import{_ as E}from"./_plugin-vue_export-helper-DlAUqK2U.js";const I={props:{data:{type:Object,default:()=>{}}},emits:["modalClose"],setup(t,{emit:e}){const o=D(),a=S("emitter"),s=_(null),c=_(!1);function n(){o?.NoticeEdit({TableID:t.data?.noteTable,RowID:t.data?.OrderID,UserNotice:s.value}).then(i=>{i==="SUCCESS"&&(e("modalClose"),t?.data?.emit&&a.emit(t?.data?.emit))})}function d(){o?.NoticeEdit({TableID:t.data?.noteTable,RowID:t.data?.OrderID,UserNotice:""}).then(i=>{i==="SUCCESS"&&(e("modalClose"),t?.data?.emit&&a.emit(t?.data?.emit))})}u(()=>{s.value=t?.data?.UserNotice});const r=i=>{i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&n()};return u(()=>{document.addEventListener("keyup",r)}),k(()=>{document.removeEventListener("keyup",r)}),{inputValue:s,isLoading:c,editNotice:n,deleteNotice:d}}},h={class:"modal__body"},x={class:"list-item__title"},V={class:"modal__input-row"},w={class:"list-form_col list-form_col--xl"},B={class:"search-field form-field"},L={class:"modal__buttons"};function T(t,e,o,a,s,c){const n=f;return m(),N("div",h,[l("div",x,"Редактирование примечания, заказ # "+b(o.data?.OrderID),1),l("div",V,[l("div",w,[l("div",B,[v(l("textarea",{"onUpdate:modelValue":e[0]||(e[0]=d=>a.inputValue=d)},null,512),[[C,a.inputValue]])])])]),l("div",L,[o.data?.UserNotice!==null&&o.data?.UserNotice!==""?(m(),U(n,{key:0,class:"modal__button",label:"Удалить","is-loading":a.isLoading,onClick:e[1]||(e[1]=d=>a.deleteNotice())},null,8,["is-loading"])):g("",!0),y(n,{class:"modal__button",label:o.data?.UserNotice!==null&&o.data?.UserNotice!==""?"Изменить":"Добавить","is-loading":a.isLoading,onClick:e[2]||(e[2]=d=>a.editNotice())},null,8,["label","is-loading"])])])}const R=E(I,[["render",T],["__scopeId","data-v-77554961"]]);export{R as default};
