Initial admin edits
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
import{A as e,ct as t,et as n,g as r,l as i}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a}from"./http-CTjL79ty.js";import{B as o}from"./index-DxcN1-hp.js";import{t as s}from"./BaseSwitch-Dz4ODUhf.js";function c(e=480){return new Promise(t=>{window.setTimeout(t,e)})}function l(e){let t=n(null),r=n(null),i=a();async function o(n,a){if(t.value)return a;let o=!a;if(!o&&e.confirmOff&&!await e.confirmOff())return a;t.value=n,r.value=null;let s=a;try{return await e.onPersist(o),i.success(e.successMessage?.(o)??(o?`وضعیت فعال شد.`:`وضعیت غیرفعال شد.`)),o}catch{return r.value=n,i.error(e.errorMessage??`بهروزرسانی وضعیت انجام نشد.`),s}finally{t.value=null}}function s(e){return t.value===e}function c(e){return r.value===e}return{toggle:o,isLoading:s,hasError:c}}var u=r({__name:`ActiveSwitchCell`,props:{id:{},modelValue:{type:Boolean},entityName:{},entityType:{},persist:{type:Function}},emits:[`update:modelValue`],setup(n,{emit:r}){let a=n,u=r,{toggle:d,isLoading:f,hasError:p}=l({onPersist:async e=>{a.persist?await a.persist(a.id,e):await c()},successMessage:e=>e?`${a.entityType??`مورد`} «${a.entityName}» فعال شد.`:`${a.entityType??`مورد`} «${a.entityName}» غیرفعال شد.`});async function m(e){if(e===a.modelValue)return;let t=a.entityType??`مورد`;if(!await o({title:e?`فعالسازی ${t}`:`غیرفعالسازی ${t}`,message:e?`آیا از فعال کردن «${a.entityName}» مطمئن هستید؟`:`آیا از غیرفعال کردن «${a.entityName}» مطمئن هستید؟`,tone:e?`primary`:`danger`,confirmLabel:e?`فعال کردن`:`غیرفعال کردن`,cancelLabel:`انصراف`}))return;let n=await d(a.id,a.modelValue);u(`update:modelValue`,n)}return(r,a)=>(e(),i(s,{"model-value":n.modelValue,loading:t(f)(n.id),error:t(p)(n.id),"onUpdate:modelValue":m},null,8,[`model-value`,`loading`,`error`]))}});export{u as t};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,g as t,k as n,l as r,st as i}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a}from"./http-BjLkjdQu.js";import{z as o}from"./index-SWzbcuqQ.js";import{t as s}from"./BaseSwitch-pJwnFBVo.js";function c(e=480){return new Promise(t=>{window.setTimeout(t,e)})}function l(t){let n=e(null),r=e(null),i=a();async function o(e,a){if(n.value)return a;let o=!a;if(!o&&t.confirmOff&&!await t.confirmOff())return a;n.value=e,r.value=null;let s=a;try{return await t.onPersist(o),i.success(t.successMessage?.(o)??(o?`وضعیت فعال شد.`:`وضعیت غیرفعال شد.`)),o}catch{return r.value=e,i.error(t.errorMessage??`بهروزرسانی وضعیت انجام نشد.`),s}finally{n.value=null}}function s(e){return n.value===e}function c(e){return r.value===e}return{toggle:o,isLoading:s,hasError:c}}var u=t({__name:`ActiveSwitchCell`,props:{id:{},modelValue:{type:Boolean},entityName:{},entityType:{},persist:{type:Function}},emits:[`update:modelValue`],setup(e,{emit:t}){let a=e,u=t,{toggle:d,isLoading:f,hasError:p}=l({onPersist:async e=>{a.persist?await a.persist(a.id,e):await c()},successMessage:e=>e?`${a.entityType??`مورد`} «${a.entityName}» فعال شد.`:`${a.entityType??`مورد`} «${a.entityName}» غیرفعال شد.`});async function m(e){if(e===a.modelValue)return;let t=a.entityType??`مورد`;if(!await o({title:e?`فعالسازی ${t}`:`غیرفعالسازی ${t}`,message:e?`آیا از فعال کردن «${a.entityName}» مطمئن هستید؟`:`آیا از غیرفعال کردن «${a.entityName}» مطمئن هستید؟`,tone:e?`primary`:`danger`,confirmLabel:e?`فعال کردن`:`غیرفعال کردن`,cancelLabel:`انصراف`}))return;let n=await d(a.id,a.modelValue);u(`update:modelValue`,n)}return(t,a)=>(n(),r(s,{"model-value":e.modelValue,loading:i(f)(e.id),error:i(p)(e.id),"onUpdate:modelValue":m},null,8,[`model-value`,`loading`,`error`]))}});export{u as t};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{Dt as e,d as t,g as n,k as r,s as i,t as a}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{c as o,r as s}from"./index-SWzbcuqQ.js";var c=[`id`,`value`,`placeholder`,`disabled`],l=a(n({__name:`AdminCurrencyInput`,props:{modelValue:{default:null},placeholder:{default:``},disabled:{type:Boolean,default:!1},id:{},inputClass:{default:`admin-input`},allowEmpty:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(n,{emit:a}){let l=n,u=a,d=i(()=>l.modelValue==null||!Number.isFinite(l.modelValue)?``:o(l.modelValue));function f(e){let t=e.target,n=s(t.value);if(!n){u(`update:modelValue`,l.allowEmpty?null:0),t.value=``;return}let r=Number(n);u(`update:modelValue`,r),t.value=o(r)}return(i,a)=>(r(),t(`input`,{id:n.id,type:`text`,inputmode:`numeric`,dir:`ltr`,class:e([`admin-currency-input`,n.inputClass]),value:d.value,placeholder:n.placeholder,disabled:n.disabled,onInput:f},null,42,c))}}),[[`__scopeId`,`data-v-56435fc8`]]);export{l as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{A as e,Ot as t,d as n,g as r,s as i,t as a}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{c as o,r as s}from"./index-DxcN1-hp.js";var c=[`id`,`value`,`placeholder`,`disabled`],l=a(r({__name:`AdminCurrencyInput`,props:{modelValue:{default:null},placeholder:{default:``},disabled:{type:Boolean,default:!1},id:{},inputClass:{default:`admin-input`},allowEmpty:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(r,{emit:a}){let l=r,u=a,d=i(()=>l.modelValue==null||!Number.isFinite(l.modelValue)?``:o(l.modelValue));function f(e){let t=e.target,n=s(t.value);if(!n){u(`update:modelValue`,l.allowEmpty?null:0),t.value=``;return}let r=Number(n);u(`update:modelValue`,r),t.value=o(r)}return(i,a)=>(e(),n(`input`,{id:r.id,type:`text`,inputmode:`numeric`,dir:`ltr`,class:t([`admin-currency-input`,r.inputClass]),value:d.value,placeholder:r.placeholder,disabled:r.disabled,onInput:f},null,42,c))}}),[[`__scopeId`,`data-v-56435fc8`]]);export{l as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{A as e,S as t,a as n,c as r,d as i,g as a,l as o,t as s,u as c,z as l}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{m as u}from"./http-CTjL79ty.js";var d=[`src`,`alt`],f=s(a({__name:`AdminImageLightbox`,props:t({src:{},alt:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let a=l(t,`modelValue`);return(s,l)=>(e(),o(n,{to:`body`},[a.value?(e(),i(`div`,{key:0,class:`admin-image-lightbox`,onClick:l[1]||=u(e=>a.value=!1,[`self`])},[r(`button`,{type:`button`,class:`admin-image-lightbox__close`,onClick:l[0]||=e=>a.value=!1},` بستن `),r(`img`,{src:t.src,alt:t.alt??`پیشنمایش تصویر`},null,8,d)])):c(``,!0)]))}}),[[`__scopeId`,`data-v-d52b23fb`]]);export{f as t};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{R as e,S as t,a as n,c as r,d as i,g as a,k as o,l as s,t as c,u as l}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{m as u}from"./http-BjLkjdQu.js";var d=[`src`,`alt`],f=c(a({__name:`AdminImageLightbox`,props:t({src:{},alt:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let a=e(t,`modelValue`);return(e,c)=>(o(),s(n,{to:`body`},[a.value?(o(),i(`div`,{key:0,class:`admin-image-lightbox`,onClick:c[1]||=u(e=>a.value=!1,[`self`])},[r(`button`,{type:`button`,class:`admin-image-lightbox__close`,onClick:c[0]||=e=>a.value=!1},` بستن `),r(`img`,{src:t.src,alt:t.alt??`پیشنمایش تصویر`},null,8,d)])):l(``,!0)]))}}),[[`__scopeId`,`data-v-d52b23fb`]]);export{f as t};
|
||||
-1
@@ -1 +0,0 @@
|
||||
.image-picker__label[data-v-0959163b]{margin:0 0 8px;font-size:.8125rem;font-weight:600}.image-picker__row[data-v-0959163b]{align-items:center;gap:12px;display:flex}.image-picker__preview[data-v-0959163b]{border:1px solid var(--color-border);background:#e8eceb 50%/cover no-repeat;border-radius:10px;flex-shrink:0;width:88px;height:72px}.image-picker__preview--empty[data-v-0959163b]{background:repeating-linear-gradient(45deg,#eef1f0,#eef1f0 8px,#e4e8e6 8px 16px)}.image-picker__actions[data-v-0959163b]{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.image-picker__file[data-v-0959163b]{display:none}.image-picker__error[data-v-0959163b]{width:100%;color:var(--color-danger);margin:0;font-size:.75rem}.image-picker__ok[data-v-0959163b]{width:100%;color:var(--color-success-dark);margin:0;font-size:.75rem;font-weight:600}
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,At as t,Dt as n,c as r,d as i,g as a,k as o,kt as s,st as c,t as l,u}from"./_plugin-vue_export-helper-QrIvvHC8.js";var d=960,f=.82;function p(e){let t=e.trim();return t?`url("${t.replace(/"/g,`\\"`)}")`:``}async function m(e){if(!e.type.startsWith(`image/`))throw Error(`فقط فایل تصویری مجاز است.`);if(e.size>8388608)throw Error(`حجم تصویر نباید بیشتر از ۸ مگابایت باشد.`);return g(await h(e))}function h(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result??``)),r.onerror=()=>n(Error(`خواندن تصویر ناموفق بود.`)),r.readAsDataURL(e)})}function g(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{let e=Math.min(1,d/Math.max(r.width,r.height)),i=Math.max(1,Math.round(r.width*e)),a=Math.max(1,Math.round(r.height*e)),o=document.createElement(`canvas`);o.width=i,o.height=a;let s=o.getContext(`2d`);if(!s){n(Error(`پردازش تصویر ناموفق بود.`));return}s.drawImage(r,0,0,i,a),t(o.toDataURL(`image/jpeg`,f))},r.onerror=()=>n(Error(`تصویر نامعتبر است.`)),r.src=e})}var _={class:`image-picker`},v={key:0,class:`image-picker__label`},y={class:`image-picker__row`},b={class:`image-picker__actions`},x=[`disabled`],S=[`disabled`],C={key:1,class:`image-picker__error`},w={key:2,class:`image-picker__ok`},T=l(a({__name:`AdminImagePicker`,props:{modelValue:{},label:{},showRemove:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(a,{emit:l}){let d=a,f=l,h=e(null),g=e(!1),T=e(``),E=e(!1);function D(){h.value?.click()}async function O(e){let t=e.target,n=t.files?.[0];if(t.value=``,n){g.value=!0,T.value=``,E.value=!1;try{f(`update:modelValue`,await m(n)),E.value=!0}catch(e){T.value=e instanceof Error?e.message:`بارگذاری تصویر ناموفق بود.`}finally{g.value=!1}}}function k(){f(`update:modelValue`,null)}return(e,l)=>(o(),i(`div`,_,[a.label?(o(),i(`p`,v,t(a.label),1)):u(``,!0),r(`div`,y,[r(`div`,{class:n([`image-picker__preview`,{"image-picker__preview--empty":!d.modelValue}]),style:s(d.modelValue?{backgroundImage:c(p)(d.modelValue)}:void 0)},null,6),r(`div`,b,[r(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:D},t(d.modelValue?`تغییر تصویر`:`افزودن تصویر`),9,x),d.showRemove&&d.modelValue?(o(),i(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:k},` حذف `,8,S)):u(``,!0),T.value?(o(),i(`p`,C,t(T.value),1)):E.value?(o(),i(`p`,w,`تصویر انتخاب شد — برای ثبت نهایی «ثبت» را بزنید.`)):u(``,!0)])]),r(`input`,{ref_key:`inputRef`,ref:h,type:`file`,accept:`image/*`,class:`image-picker__file`,onChange:O},null,544)]))}}),[[`__scopeId`,`data-v-0959163b`]]);export{p as n,T as t};
|
||||
+1
@@ -0,0 +1 @@
|
||||
.image-picker__label[data-v-64060a40]{margin:0 0 8px;font-size:.8125rem;font-weight:600}.image-picker__row[data-v-64060a40]{align-items:center;gap:12px;display:flex}.image-picker__preview[data-v-64060a40]{border:1px solid var(--color-border);object-fit:cover;background:#e8eceb 50%/cover no-repeat;border-radius:10px;flex-shrink:0;width:88px;height:72px;display:block}.image-picker__preview-img[data-v-64060a40]{background:#e8eceb}.image-picker__preview--empty[data-v-64060a40]{background:repeating-linear-gradient(45deg,#eef1f0,#eef1f0 8px,#e4e8e6 8px 16px)}.image-picker__actions[data-v-64060a40]{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.image-picker__file[data-v-64060a40]{display:none}.image-picker__error[data-v-64060a40]{width:100%;color:var(--color-danger);margin:0;font-size:.75rem}.image-picker__ok[data-v-64060a40]{width:100%;color:var(--color-success-dark);margin:0;font-size:.75rem;font-weight:600}.image-picker--compact .image-picker__row[data-v-64060a40]{gap:10px}.image-picker__preview-hit[data-v-64060a40]{cursor:pointer;background:0 0;border:none;border-radius:10px;flex-shrink:0;padding:0;line-height:0}.image-picker__preview-hit[data-v-64060a40]:disabled{cursor:not-allowed;opacity:.65}.image-picker__preview-hit[data-v-64060a40]:focus-visible{outline:2px solid var(--color-primary,#2d6a4f);outline-offset:2px}.image-picker--compact .image-picker__preview[data-v-64060a40]{border-radius:12px;width:72px;height:72px}.image-picker--compact .image-picker__change[data-v-64060a40]{color:var(--color-primary,#2d6a4f);font-weight:600}.image-picker--compact .image-picker__error[data-v-64060a40]{font-size:.7rem}
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{A as e,At as t,Ot as n,c as r,ct as i,d as a,et as o,g as s,jt as c,t as l,u}from"./_plugin-vue_export-helper-vx-p5QAT.js";var d=960,f=.82;function p(e){let t=e.trim();return t?`url("${t.replace(/"/g,`\\"`)}")`:``}async function m(e){if(!e.type.startsWith(`image/`))throw Error(`فقط فایل تصویری مجاز است.`);if(e.size>8388608)throw Error(`حجم تصویر نباید بیشتر از ۸ مگابایت باشد.`);return g(await h(e))}function h(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result??``)),r.onerror=()=>n(Error(`خواندن تصویر ناموفق بود.`)),r.readAsDataURL(e)})}function g(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{let e=Math.min(1,d/Math.max(r.width,r.height)),i=Math.max(1,Math.round(r.width*e)),a=Math.max(1,Math.round(r.height*e)),o=document.createElement(`canvas`);o.width=i,o.height=a;let s=o.getContext(`2d`);if(!s){n(Error(`پردازش تصویر ناموفق بود.`));return}s.drawImage(r,0,0,i,a),t(o.toDataURL(`image/jpeg`,f))},r.onerror=()=>n(Error(`تصویر نامعتبر است.`)),r.src=e})}var _={key:0,class:`image-picker__label`},v={class:`image-picker__row`},y=[`disabled`,`aria-label`],b=[`src`],x={key:1,class:`image-picker__preview image-picker__preview--empty`,"aria-hidden":`true`},S={class:`image-picker__actions`},C=[`disabled`],w=[`disabled`],T={key:1,class:`image-picker__error`},E={key:2,class:`image-picker__ok`},D=l(s({__name:`AdminImagePicker`,props:{modelValue:{},label:{},showRemove:{type:Boolean,default:!0},compact:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(s,{emit:l}){let d=s,f=l,h=o(null),g=o(!1),D=o(``),O=o(!1);function k(){h.value?.click()}async function A(e){let t=e.target,n=t.files?.[0];if(t.value=``,n){g.value=!0,D.value=``,O.value=!1;try{f(`update:modelValue`,await m(n)),O.value=!0}catch(e){D.value=e instanceof Error?e.message:`بارگذاری تصویر ناموفق بود.`}finally{g.value=!1}}}function j(){f(`update:modelValue`,null)}return(o,l)=>(e(),a(`div`,{class:n([`image-picker`,{"image-picker--compact":s.compact}])},[s.label&&!s.compact?(e(),a(`p`,_,c(s.label),1)):u(``,!0),r(`div`,v,[s.compact?(e(),a(`button`,{key:0,type:`button`,class:`image-picker__preview-hit`,disabled:g.value,"aria-label":d.modelValue?`تغییر تصویر`:`افزودن تصویر`,onClick:k},[d.modelValue?(e(),a(`img`,{key:0,src:d.modelValue,alt:``,class:`image-picker__preview image-picker__preview-img`},null,8,b)):(e(),a(`span`,x))],8,y)):(e(),a(`div`,{key:1,class:n([`image-picker__preview`,{"image-picker__preview--empty":!d.modelValue}]),style:t(d.modelValue?{backgroundImage:i(p)(d.modelValue)}:void 0)},null,6)),r(`div`,S,[r(`button`,{type:`button`,class:n(s.compact?`admin-btn admin-btn--ghost admin-btn--sm image-picker__change`:`admin-btn admin-btn--outline admin-btn--sm`),disabled:g.value,onClick:k},c(d.modelValue?`تغییر تصویر`:`افزودن تصویر`),11,C),!s.compact&&d.showRemove&&d.modelValue?(e(),a(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:j},` حذف `,8,w)):u(``,!0),D.value?(e(),a(`p`,T,c(D.value),1)):O.value&&!s.compact?(e(),a(`p`,E,`تصویر انتخاب شد — برای ثبت نهایی «ثبت» را بزنید.`)):u(``,!0)])]),r(`input`,{ref_key:`inputRef`,ref:h,type:`file`,accept:`image/*`,class:`image-picker__file`,onChange:A},null,544)],2))}}),[[`__scopeId`,`data-v-64060a40`]]);export{p as n,D as t};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{M as e,c as t,d as n,g as r,k as i,p as a,r as o,t as s}from"./_plugin-vue_export-helper-QrIvvHC8.js";var c={class:`admin-page-skeleton`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,"aria-label":`در حال بارگذاری`},l={class:`admin-card admin-page-skeleton__table`},u={key:1,class:`admin-card admin-page-skeleton__form`},d={key:2,class:`admin-card admin-page-skeleton__detail`},f={key:3,class:`admin-page-skeleton__cards`},p=s(r({__name:`AdminPageSkeleton`,props:{variant:{default:`cards`},rows:{default:5}},setup(r){return(s,p)=>(i(),n(`div`,c,[r.variant===`table`?(i(),n(o,{key:0},[p[1]||=t(`div`,{class:`admin-page-skeleton__toolbar`},[t(`span`,{class:`admin-skeleton admin-page-skeleton__search`}),t(`span`,{class:`admin-skeleton admin-page-skeleton__btn`})],-1),t(`div`,l,[(i(!0),n(o,null,e(r.rows,e=>(i(),n(`div`,{key:e,class:`admin-page-skeleton__tr`},[...p[0]||=[a(`<span class="admin-skeleton" style="width:18%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:22%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:14%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:16%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:12%;height:12px;" data-v-8283cd1d></span>`,5)]]))),128))])],64)):r.variant===`form`?(i(),n(`div`,u,[(i(!0),n(o,null,e(r.rows,e=>(i(),n(`div`,{key:e,class:`admin-page-skeleton__field`},[...p[2]||=[t(`span`,{class:`admin-skeleton`,style:{width:`28%`,height:`10px`}},null,-1),t(`span`,{class:`admin-skeleton`,style:{width:`100%`,height:`40px`,"border-radius":`10px`}},null,-1)]]))),128))])):r.variant===`detail`?(i(),n(`div`,d,[...p[3]||=[a(`<span class="admin-skeleton" style="width:40%;height:18px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:70%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:100%;height:120px;border-radius:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:100%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:88%;height:12px;" data-v-8283cd1d></span>`,5)]])):(i(),n(`div`,f,[(i(!0),n(o,null,e(r.rows,e=>(i(),n(`div`,{key:e,class:`admin-card admin-page-skeleton__card`},[...p[4]||=[t(`span`,{class:`admin-skeleton`,style:{width:`45%`,height:`14px`}},null,-1),t(`span`,{class:`admin-skeleton`,style:{width:`70%`,height:`11px`}},null,-1),t(`span`,{class:`admin-skeleton`,style:{width:`35%`,height:`11px`}},null,-1)]]))),128))]))]))}}),[[`__scopeId`,`data-v-8283cd1d`]]);export{p as t};
|
||||
import{A as e,N as t,c as n,d as r,g as i,p as a,r as o,t as s}from"./_plugin-vue_export-helper-vx-p5QAT.js";var c={class:`admin-page-skeleton`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,"aria-label":`در حال بارگذاری`},l={class:`admin-card admin-page-skeleton__table`},u={key:1,class:`admin-card admin-page-skeleton__form`},d={key:2,class:`admin-card admin-page-skeleton__detail`},f={key:3,class:`admin-page-skeleton__cards`},p=s(i({__name:`AdminPageSkeleton`,props:{variant:{default:`cards`},rows:{default:5}},setup(i){return(s,p)=>(e(),r(`div`,c,[i.variant===`table`?(e(),r(o,{key:0},[p[1]||=n(`div`,{class:`admin-page-skeleton__toolbar`},[n(`span`,{class:`admin-skeleton admin-page-skeleton__search`}),n(`span`,{class:`admin-skeleton admin-page-skeleton__btn`})],-1),n(`div`,l,[(e(!0),r(o,null,t(i.rows,t=>(e(),r(`div`,{key:t,class:`admin-page-skeleton__tr`},[...p[0]||=[a(`<span class="admin-skeleton" style="width:18%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:22%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:14%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:16%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:12%;height:12px;" data-v-8283cd1d></span>`,5)]]))),128))])],64)):i.variant===`form`?(e(),r(`div`,u,[(e(!0),r(o,null,t(i.rows,t=>(e(),r(`div`,{key:t,class:`admin-page-skeleton__field`},[...p[2]||=[n(`span`,{class:`admin-skeleton`,style:{width:`28%`,height:`10px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`100%`,height:`40px`,"border-radius":`10px`}},null,-1)]]))),128))])):i.variant===`detail`?(e(),r(`div`,d,[...p[3]||=[a(`<span class="admin-skeleton" style="width:40%;height:18px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:70%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:100%;height:120px;border-radius:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:100%;height:12px;" data-v-8283cd1d></span><span class="admin-skeleton" style="width:88%;height:12px;" data-v-8283cd1d></span>`,5)]])):(e(),r(`div`,f,[(e(!0),r(o,null,t(i.rows,t=>(e(),r(`div`,{key:t,class:`admin-card admin-page-skeleton__card`},[...p[4]||=[n(`span`,{class:`admin-skeleton`,style:{width:`45%`,height:`14px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`70%`,height:`11px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`35%`,height:`11px`}},null,-1)]]))),128))]))]))}}),[[`__scopeId`,`data-v-8283cd1d`]]);export{p as t};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,At as t,B as n,D as r,Dt as i,M as a,N as o,U as s,a as c,c as l,d as u,g as d,h as f,k as p,kt as m,l as h,r as g,s as _,t as v,u as y,w as b}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{f as x,m as S,p as C}from"./http-BjLkjdQu.js";import{I as w,j as T}from"./index-SWzbcuqQ.js";var E=[`id`],D=[`aria-label`,`aria-expanded`],O={class:`admin-select__trigger-content`},k={class:`admin-select__value`},A={class:`admin-select__chevron`,"aria-hidden":`true`},j=[`aria-label`],M={key:0,class:`admin-select__search`,role:`presentation`},N=[`placeholder`],P={key:1,class:`admin-select__empty`,role:`presentation`},F=[`aria-selected`,`onClick`],I={class:`admin-select__option-label`},L=v(d({__name:`AdminSelect`,props:{modelValue:{},options:{},placeholder:{default:`انتخاب کنید`},ariaLabel:{default:`انتخاب`},block:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:`جستجو…`},id:{default:void 0}},emits:[`update:modelValue`],setup(d,{emit:v}){let L=d,R=v,z=e(!1),B=e(``),V=e(null),H=e(null),U=e(null),W=e({});T(V,()=>{z.value=!1,B.value=``},{ignore:[H]});let G=_(()=>L.options.find(e=>e.value===L.modelValue)),K=_(()=>G.value?.label??L.placeholder),q=_(()=>{let e=B.value.trim().toLowerCase();return e?L.options.filter(t=>t.label.toLowerCase().includes(e)):L.options});function J(){let e=V.value;if(!e)return;let t=e.getBoundingClientRect(),n=Math.min(320,window.innerHeight*.5),r=window.innerHeight-t.bottom-6,i=t.top-6,a=r<Math.min(160,n)&&i>r,o=Math.max(120,Math.min(n,a?i:r));W.value={position:`fixed`,left:`${Math.max(8,Math.min(t.left,window.innerWidth-Math.max(t.width,220)-8))}px`,width:`${Math.max(t.width,220)}px`,zIndex:`1100`,maxHeight:`${o}px`,...a?{top:`auto`,bottom:`${window.innerHeight-t.top+6}px`}:{top:`${t.bottom+6}px`,bottom:`auto`}}}function Y(e){e?(window.addEventListener(`resize`,J),window.addEventListener(`scroll`,J,!0)):(window.removeEventListener(`resize`,J),window.removeEventListener(`scroll`,J,!0))}async function X(){z.value=!z.value,z.value&&(await b(),J(),L.searchable&&(B.value=``,await b(),U.value?.focus()))}function Z(e){R(`update:modelValue`,e),z.value=!1,B.value=``}return n(z,e=>{Y(e),e&&b(()=>J())}),r(()=>{Y(!1)}),(e,n)=>(p(),u(`div`,{id:d.id,ref_key:`rootRef`,ref:V,class:i([`admin-select`,{"admin-select--open":z.value,"admin-select--block":d.block}])},[l(`button`,{type:`button`,class:`admin-select__trigger`,"aria-label":d.ariaLabel,"aria-expanded":z.value,"aria-haspopup":`listbox`,onClick:X},[l(`span`,O,[o(e.$slots,`option-leading`,{option:G.value},void 0,!0),l(`span`,k,t(K.value),1)]),l(`span`,A,[f(w,{name:`chevron-down`,size:16})])],8,D),(p(),h(c,{to:`body`},[z.value?(p(),u(`ul`,{key:0,ref_key:`menuRef`,ref:H,class:`admin-select__menu`,role:`listbox`,"aria-label":d.ariaLabel,style:m(W.value)},[d.searchable?(p(),u(`li`,M,[s(l(`input`,{ref_key:`searchInputRef`,ref:U,"onUpdate:modelValue":n[0]||=e=>B.value=e,type:`search`,class:`admin-select__search-input`,placeholder:d.searchPlaceholder,onClick:n[1]||=S(()=>{},[`stop`]),onKeydown:n[2]||=C(S(e=>z.value=!1,[`stop`]),[`esc`])},null,40,N),[[x,B.value]])])):y(``,!0),q.value.length?y(``,!0):(p(),u(`li`,P,` موردی یافت نشد `)),(p(!0),u(g,null,a(q.value,n=>(p(),u(`li`,{key:n.value,role:`presentation`},[l(`button`,{type:`button`,class:i([`admin-select__option`,{"admin-select__option--active":n.value===d.modelValue}]),role:`option`,"aria-selected":n.value===d.modelValue,onClick:e=>Z(n.value)},[l(`span`,I,[o(e.$slots,`option-leading`,{option:n},void 0,!0),l(`span`,null,t(n.label),1)]),n.value===d.modelValue?(p(),h(w,{key:0,name:`check`,size:16,class:`admin-select__check`})):y(``,!0)],10,F)]))),128))],12,j)):y(``,!0)]))],10,E))}}),[[`__scopeId`,`data-v-4623e322`]]);export{L as t};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{A as e,At as t,N as n,O as r,Ot as i,P as a,V as o,W as s,a as c,c as l,d as u,et as d,g as f,h as p,jt as m,l as h,r as g,s as _,t as v,u as y,w as b}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{d as x,m as S,p as C}from"./http-CTjL79ty.js";import{L as w,M as T}from"./index-DxcN1-hp.js";import{n as E,r as D,t as O}from"./selectOptionSearch-BxACqWRl.js";var k=[`id`],A=[`aria-label`,`aria-expanded`],j={class:`admin-select__trigger-content`},ee={class:`admin-select__value`},te={class:`admin-select__chevron`,"aria-hidden":`true`},M=[`aria-label`],N={key:0,class:`admin-select__search`,role:`presentation`},P=[`placeholder`],F={key:1,class:`admin-select__empty`,role:`presentation`},I=[`aria-selected`,`onClick`,`onKeydown`],L={class:`admin-select__option-label`},R=v(f({__name:`AdminSelect`,props:{modelValue:{},options:{},placeholder:{default:`انتخاب کنید`},ariaLabel:{default:`انتخاب`},block:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},searchPlaceholder:{default:`جستجو…`},id:{default:void 0}},emits:[`update:modelValue`],setup(f,{emit:v}){let R=f,z=v,B=d(!1),V=d(``),H=d(null),U=d(null),W=d(null),G=d({});T(H,()=>{B.value=!1,V.value=``},{ignore:[U]});let K=_(()=>R.options.find(e=>e.value===R.modelValue)),q=_(()=>K.value?.label??R.placeholder),J=_(()=>O(R.options,V.value));function Y(e){e.key===`ArrowDown`?(e.preventDefault(),D(U.value,`first`)):e.key===`ArrowUp`&&(e.preventDefault(),D(U.value,`last`))}function X(e,t){let n=e.currentTarget;e.key===`ArrowDown`?(e.preventDefault(),E(n,1)):e.key===`ArrowUp`?(e.preventDefault(),E(n,-1)):(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),$(t))}function Z(){let e=H.value;if(!e)return;let t=e.getBoundingClientRect(),n=Math.min(320,window.innerHeight*.5),r=window.innerHeight-t.bottom-6,i=t.top-6,a=r<Math.min(160,n)&&i>r,o=Math.max(120,Math.min(n,a?i:r));G.value={position:`fixed`,left:`${Math.max(8,Math.min(t.left,window.innerWidth-Math.max(t.width,220)-8))}px`,width:`${Math.max(t.width,220)}px`,zIndex:`1100`,maxHeight:`${o}px`,...a?{top:`auto`,bottom:`${window.innerHeight-t.top+6}px`}:{top:`${t.bottom+6}px`,bottom:`auto`}}}function Q(e){e?(window.addEventListener(`resize`,Z),window.addEventListener(`scroll`,Z,!0)):(window.removeEventListener(`resize`,Z),window.removeEventListener(`scroll`,Z,!0))}async function ne(){B.value=!B.value,B.value&&(V.value=``,await b(),Z(),R.searchable&&(await b(),W.value?.focus()))}function $(e){z(`update:modelValue`,e),B.value=!1,V.value=``}return o(B,e=>{Q(e),e&&b(()=>Z())}),r(()=>{Q(!1)}),(r,o)=>(e(),u(`div`,{id:f.id,ref_key:`rootRef`,ref:H,class:i([`admin-select`,{"admin-select--open":B.value,"admin-select--block":f.block}])},[l(`button`,{type:`button`,class:`admin-select__trigger`,"aria-label":f.ariaLabel,"aria-expanded":B.value,"aria-haspopup":`listbox`,onClick:ne},[l(`span`,j,[a(r.$slots,`option-leading`,{option:K.value},void 0,!0),l(`span`,ee,m(q.value),1)]),l(`span`,te,[p(w,{name:`chevron-down`,size:16})])],8,A),(e(),h(c,{to:`body`},[B.value?(e(),u(`ul`,{key:0,ref_key:`menuRef`,ref:U,class:`admin-select__menu`,"data-select-menu":``,role:`listbox`,"aria-label":f.ariaLabel,style:t(G.value)},[f.searchable?(e(),u(`li`,N,[s(l(`input`,{ref_key:`searchInputRef`,ref:W,"onUpdate:modelValue":o[0]||=e=>V.value=e,type:`search`,class:`admin-select__search-input`,placeholder:f.searchPlaceholder,onClick:o[1]||=S(()=>{},[`stop`]),onKeydown:[o[2]||=C(S(e=>B.value=!1,[`stop`]),[`esc`]),Y]},null,40,P),[[x,V.value]])])):y(``,!0),J.value.length?y(``,!0):(e(),u(`li`,F,` موردی یافت نشد `)),(e(!0),u(g,null,n(J.value,t=>(e(),u(`li`,{key:t.value,role:`presentation`},[l(`button`,{type:`button`,class:i([`admin-select__option`,{"admin-select__option--active":t.value===f.modelValue}]),"data-select-option":``,role:`option`,"aria-selected":t.value===f.modelValue,onClick:e=>$(t.value),onKeydown:e=>X(e,t.value)},[l(`span`,L,[a(r.$slots,`option-leading`,{option:t},void 0,!0),l(`span`,null,m(t.label),1)]),t.value===f.modelValue?(e(),h(w,{key:0,name:`check`,size:16,class:`admin-select__check`})):y(``,!0)],42,I)]))),128))],12,M)):y(``,!0)]))],10,k))}}),[[`__scopeId`,`data-v-4ee349a1`]]);export{R as t};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.admin-select[data-v-4623e322]{min-width:200px;max-width:100%;position:relative}.admin-select--block[data-v-4623e322]{width:100%;min-width:0}.admin-select__trigger[data-v-4623e322]{width:100%;min-height:var(--control-height,40px);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);justify-content:space-between;align-items:center;gap:10px;padding:0 12px 0 10px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__trigger[data-v-4623e322]:hover{border-color:var(--color-primary);background:var(--color-elevated,var(--color-surface))}.admin-select--open .admin-select__trigger[data-v-4623e322],.admin-select__trigger[data-v-4623e322]:focus-visible{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__trigger-content[data-v-4623e322]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__value[data-v-4623e322]{text-align:start;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.admin-select__option-label[data-v-4623e322]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__chevron[data-v-4623e322]{color:var(--color-text-muted);transition:transform var(--transition-fast);flex-shrink:0;display:inline-flex}.admin-select--open .admin-select__chevron[data-v-4623e322]{color:var(--color-primary);transform:rotate(180deg)}.admin-select__menu[data-v-4623e322]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-card,0 12px 28px #0f172a1f);box-sizing:border-box;flex-direction:column;gap:4px;margin:0;padding:8px;list-style:none;display:flex;overflow-y:auto}.admin-select__search[data-v-4623e322]{z-index:1;background:var(--color-surface);padding-bottom:4px;position:sticky;top:0}.admin-select__search-input[data-v-4623e322]{border:1px solid var(--color-border);background:var(--color-bg);width:100%;height:36px;color:var(--color-text);font:inherit;border-radius:10px;padding:0 12px;font-size:.8125rem}.admin-select__search-input[data-v-4623e322]:focus{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__empty[data-v-4623e322]{color:var(--color-text-muted);text-align:center;padding:12px;font-size:.8125rem}.admin-select__option[data-v-4623e322]{width:100%;color:var(--color-text);text-align:start;cursor:pointer;transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);background:0 0;border:1px solid #0000;border-radius:12px;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__option[data-v-4623e322]:hover{background:var(--color-bg);border-color:var(--color-border)}.admin-select__option--active[data-v-4623e322]{background:var(--color-primary-soft);color:var(--color-primary);border-color:#0000;font-weight:600}.admin-select__option--active[data-v-4623e322]:hover{background:var(--color-primary-soft);border-color:#0000}.admin-select__check[data-v-4623e322]{color:var(--color-primary);flex-shrink:0}
|
||||
.admin-select[data-v-4ee349a1]{min-width:200px;max-width:100%;position:relative}.admin-select--block[data-v-4ee349a1]{width:100%;min-width:0}.admin-select__trigger[data-v-4ee349a1]{width:100%;min-height:var(--control-height,40px);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);justify-content:space-between;align-items:center;gap:10px;padding:0 12px 0 10px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__trigger[data-v-4ee349a1]:hover{border-color:var(--color-primary);background:var(--color-elevated,var(--color-surface))}.admin-select--open .admin-select__trigger[data-v-4ee349a1],.admin-select__trigger[data-v-4ee349a1]:focus-visible{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__trigger-content[data-v-4ee349a1]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__value[data-v-4ee349a1]{text-align:start;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.admin-select__option-label[data-v-4ee349a1]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__chevron[data-v-4ee349a1]{color:var(--color-text-muted);transition:transform var(--transition-fast);flex-shrink:0;display:inline-flex}.admin-select--open .admin-select__chevron[data-v-4ee349a1]{color:var(--color-primary);transform:rotate(180deg)}.admin-select__menu[data-v-4ee349a1]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-card,0 12px 28px #0f172a1f);box-sizing:border-box;flex-direction:column;gap:4px;margin:0;padding:8px;list-style:none;display:flex;overflow-y:auto}.admin-select__search[data-v-4ee349a1]{z-index:1;background:var(--color-surface);padding-bottom:4px;position:sticky;top:0}.admin-select__search-input[data-v-4ee349a1]{border:1px solid var(--color-border);background:var(--color-bg);width:100%;height:36px;color:var(--color-text);font:inherit;border-radius:10px;padding:0 12px;font-size:.8125rem}.admin-select__search-input[data-v-4ee349a1]:focus{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__empty[data-v-4ee349a1]{color:var(--color-text-muted);text-align:center;padding:12px;font-size:.8125rem}.admin-select__option[data-v-4ee349a1]{width:100%;color:var(--color-text);text-align:start;cursor:pointer;transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);background:0 0;border:1px solid #0000;border-radius:12px;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__option[data-v-4ee349a1]:hover{background:var(--color-bg);border-color:var(--color-border)}.admin-select__option--active[data-v-4ee349a1]{background:var(--color-primary-soft);color:var(--color-primary);border-color:#0000;font-weight:600}.admin-select__option--active[data-v-4ee349a1]:hover{background:var(--color-primary-soft);border-color:#0000}.admin-select__check[data-v-4ee349a1]{color:var(--color-primary);flex-shrink:0}
|
||||
+1
@@ -0,0 +1 @@
|
||||
.accounts-page__table[data-v-cb49a72f]{overflow:hidden}
|
||||
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
-1
@@ -1 +0,0 @@
|
||||
.accounts-page__table[data-v-0011826b]{overflow:hidden}
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+1
@@ -0,0 +1 @@
|
||||
.admin-page-header__sub[data-v-2c8696f3]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.banner-thumb[data-v-2c8696f3]{background:#e8eceb 50%/cover no-repeat;border-radius:8px;width:72px;height:44px;display:block}.banner-thumb--empty[data-v-2c8696f3]{background:#eef1f0}.banner-sub[data-v-2c8696f3]{color:var(--color-text-muted);margin:2px 0 0;font-size:.8rem}.field[data-v-2c8696f3]{flex-direction:column;gap:6px;margin-bottom:12px;font-size:.875rem;display:flex}.field__head[data-v-2c8696f3]{justify-content:space-between;align-items:center;gap:12px;display:flex}.field-hint[data-v-2c8696f3]{color:var(--color-text-muted);font-size:.75rem;line-height:1.4}
|
||||
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-1
@@ -1 +0,0 @@
|
||||
.admin-page-header__sub[data-v-1ca3d686]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.banner-thumb[data-v-1ca3d686]{background:#e8eceb 50%/cover no-repeat;border-radius:8px;width:72px;height:44px;display:block}.banner-thumb--empty[data-v-1ca3d686]{background:#eef1f0}.banner-sub[data-v-1ca3d686]{color:var(--color-text-muted);margin:2px 0 0;font-size:.8rem}.field[data-v-1ca3d686]{flex-direction:column;gap:6px;margin-bottom:12px;font-size:.875rem;display:flex}.field__head[data-v-1ca3d686]{justify-content:space-between;align-items:center;gap:12px;display:flex}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{At as e,Dt as t,N as n,c as r,d as i,g as a,h as o,k as s,t as c,u as l}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{I as u}from"./index-SWzbcuqQ.js";var d={class:`base-empty__icon`,"aria-hidden":`true`},f={class:`base-empty__title`},p={key:0,class:`base-empty__description`},m={key:1,class:`base-empty__actions`},h=c(a({__name:`BaseEmptyState`,props:{icon:{default:`file`},title:{},description:{},compact:{type:Boolean}},emits:[`action`,`secondary`],setup(a){return(c,h)=>(s(),i(`div`,{class:t([`base-empty`,{"base-empty--compact":a.compact}])},[r(`div`,d,[o(u,{name:a.icon,size:a.compact?28:36},null,8,[`name`,`size`])]),r(`h3`,f,e(a.title),1),a.description?(s(),i(`p`,p,e(a.description),1)):l(``,!0),c.$slots.default||c.$slots.secondary?(s(),i(`div`,m,[n(c.$slots,`default`,{},void 0,!0),n(c.$slots,`secondary`,{},void 0,!0)])):l(``,!0)],2))}}),[[`__scopeId`,`data-v-47ea81e4`]]);export{h as t};
|
||||
import{A as e,Ot as t,P as n,c as r,d as i,g as a,h as o,jt as s,t as c,u as l}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{L as u}from"./index-DxcN1-hp.js";var d={class:`base-empty__icon`,"aria-hidden":`true`},f={class:`base-empty__title`},p={key:0,class:`base-empty__description`},m={key:1,class:`base-empty__actions`},h=c(a({__name:`BaseEmptyState`,props:{icon:{default:`file`},title:{},description:{},compact:{type:Boolean}},emits:[`action`,`secondary`],setup(a){return(c,h)=>(e(),i(`div`,{class:t([`base-empty`,{"base-empty--compact":a.compact}])},[r(`div`,d,[o(u,{name:a.icon,size:a.compact?28:36},null,8,[`name`,`size`])]),r(`h3`,f,s(a.title),1),a.description?(e(),i(`p`,p,s(a.description),1)):l(``,!0),c.$slots.default||c.$slots.secondary?(e(),i(`div`,m,[n(c.$slots,`default`,{},void 0,!0),n(c.$slots,`secondary`,{},void 0,!0)])):l(``,!0)],2))}}),[[`__scopeId`,`data-v-47ea81e4`]]);export{h as t};
|
||||
@@ -1 +1 @@
|
||||
import{At as e,Dt as t,c as n,d as r,g as i,k as a,s as o,t as s,u as c}from"./_plugin-vue_export-helper-QrIvvHC8.js";var l=[`title`],u={key:0,class:`base-switch__label`},d={class:`base-switch__control`},f=[`id`,`checked`,`disabled`,`aria-checked`,`aria-label`],p={class:`base-switch__track`,"aria-hidden":`true`},m={class:`base-switch__thumb`},h={key:0,class:`base-switch__spinner`},g=s(i({__name:`BaseSwitch`,props:{modelValue:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},error:{type:Boolean},label:{},activeText:{default:`فعال`},inactiveText:{default:`غیرفعال`},id:{}},emits:[`update:modelValue`],setup(i,{emit:s}){let g=i,_=s,v=o(()=>g.id??`switch-${crypto.randomUUID().slice(0,8)}`),y=o(()=>g.modelValue?g.activeText:g.inactiveText);function b(e){let t=e.target,n=t.checked;t.checked=g.modelValue,!(g.disabled||g.loading)&&_(`update:modelValue`,n)}return(o,s)=>(a(),r(`label`,{class:t([`base-switch`,{"base-switch--disabled":i.disabled||i.loading,"base-switch--error":i.error}]),title:y.value},[i.label?(a(),r(`span`,u,e(i.label),1)):c(``,!0),n(`span`,d,[n(`input`,{id:v.value,class:`base-switch__input`,type:`checkbox`,role:`switch`,checked:i.modelValue,disabled:i.disabled||i.loading,"aria-checked":i.modelValue,"aria-label":i.label||y.value,onChange:b},null,40,f),n(`span`,p,[n(`span`,m,[i.loading?(a(),r(`span`,h)):c(``,!0)])])])],10,l))}}),[[`__scopeId`,`data-v-0410eed4`]]);export{g as t};
|
||||
import{A as e,Ot as t,c as n,d as r,g as i,jt as a,s as o,t as s,u as c}from"./_plugin-vue_export-helper-vx-p5QAT.js";var l=[`title`],u={key:0,class:`base-switch__label`},d={class:`base-switch__control`},f=[`id`,`checked`,`disabled`,`aria-checked`,`aria-label`],p={class:`base-switch__track`,"aria-hidden":`true`},m={class:`base-switch__thumb`},h={key:0,class:`base-switch__spinner`},g=s(i({__name:`BaseSwitch`,props:{modelValue:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},error:{type:Boolean},label:{},activeText:{default:`فعال`},inactiveText:{default:`غیرفعال`},id:{}},emits:[`update:modelValue`],setup(i,{emit:s}){let g=i,_=s,v=o(()=>g.id??`switch-${crypto.randomUUID().slice(0,8)}`),y=o(()=>g.modelValue?g.activeText:g.inactiveText);function b(e){let t=e.target,n=t.checked;t.checked=g.modelValue,!(g.disabled||g.loading)&&_(`update:modelValue`,n)}return(o,s)=>(e(),r(`label`,{class:t([`base-switch`,{"base-switch--disabled":i.disabled||i.loading,"base-switch--error":i.error}]),title:y.value},[i.label?(e(),r(`span`,u,a(i.label),1)):c(``,!0),n(`span`,d,[n(`input`,{id:v.value,class:`base-switch__input`,type:`checkbox`,role:`switch`,checked:i.modelValue,disabled:i.disabled||i.loading,"aria-checked":i.modelValue,"aria-label":i.label||y.value,onChange:b},null,40,f),n(`span`,p,[n(`span`,m,[i.loading?(e(),r(`span`,h)):c(``,!0)])])])],10,l))}}),[[`__scopeId`,`data-v-0410eed4`]]);export{g as t};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
.admin-page__head[data-v-a6f53b6f]{justify-content:space-between;margin-bottom:20px;display:flex}.admin-page__head h1[data-v-a6f53b6f]{margin:0 0 4px;font-size:1.25rem}.admin-page__head p[data-v-a6f53b6f]{color:var(--color-text-muted);margin:0;font-size:.875rem}.admin-table[data-v-a6f53b6f]{border-collapse:collapse;width:100%}.admin-table th[data-v-a6f53b6f],.admin-table td[data-v-a6f53b6f]{text-align:right;border-bottom:1px solid var(--color-border);padding:10px 8px}.field[data-v-a6f53b6f]{flex-direction:column;gap:6px;margin-bottom:12px;font-size:.875rem;display:flex}.link[data-v-a6f53b6f]{color:var(--color-primary);cursor:pointer;background:0 0;border:none;font-family:inherit}
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,At as t,E as n,H as r,M as i,U as a,Z as o,c as s,d as c,g as l,h as u,k as d,l as f,m as p,r as m,s as h,t as g}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as _,f as v,t as y}from"./http-BjLkjdQu.js";import{B as b,p as x}from"./index-SWzbcuqQ.js";import{t as S}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as C}from"./BaseSwitch-pJwnFBVo.js";import{t as w}from"./BaseEmptyState-Bzvl_pTa.js";var T={class:`admin-page`},E={key:2,class:`admin-table`},D={dir:`ltr`},O=[`onClick`],k={class:`field`},A={class:`field`},j={class:`field`},M={class:`field`},N=[`disabled`],P=g(l({__name:`BrandsView`,setup(l){let g=e([]),P=e(!0),F=e(!1),I=e(null),L=_(),R=o({name:``,slug:``,description:``,displayOrder:0,isActive:!0}),z=h(()=>I.value?`ویرایش برند`:`افزودن برند`);async function B(){P.value=!0;try{g.value=await x.list()}catch(e){L.error(e instanceof y?e.message:`بارگذاری برندها ناموفق بود`)}finally{P.value=!1}}function V(){I.value=null,Object.assign(R,{name:``,slug:``,description:``,displayOrder:g.value.length+1,isActive:!0}),F.value=!0}function H(e){I.value=e.id,Object.assign(R,{name:e.name,slug:e.slug??``,description:e.description??``,displayOrder:e.displayOrder,isActive:e.isActive}),F.value=!0}async function U(){try{let e={name:R.name.trim(),slug:R.slug.trim()||void 0,description:R.description.trim()||void 0,displayOrder:R.displayOrder,isActive:R.isActive};I.value?await x.update(I.value,e):await x.create(e),F.value=!1,L.success(`ذخیره شد`),await B()}catch(e){L.error(e instanceof y?e.message:`ذخیره ناموفق بود`)}}return n(()=>{B()}),(e,n)=>(d(),c(`div`,T,[s(`header`,{class:`admin-page__head`},[n[6]||=s(`div`,null,[s(`h1`,null,`برندها`)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`افزودن برند`)]),P.value?(d(),f(S,{key:0,variant:`table`})):g.value.length?(d(),c(`table`,E,[n[7]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`نام`),s(`th`,null,`شناسه لاتین`),s(`th`,null,`محصولات`),s(`th`,null,`فعال`),s(`th`)])],-1),s(`tbody`,null,[(d(!0),c(m,null,i(g.value,e=>(d(),c(`tr`,{key:e.id},[s(`td`,null,t(e.name),1),s(`td`,D,t(e.slug||`—`),1),s(`td`,null,t(e.productsCount??0),1),s(`td`,null,t(e.isActive?`بله`:`خیر`),1),s(`td`,null,[s(`button`,{type:`button`,class:`link`,onClick:t=>H(e)},`ویرایش`,8,O)])]))),128))])])):(d(),f(w,{key:1,title:`برندی ثبت نشده`})),u(b,{open:F.value,title:z.value,onClose:n[5]||=e=>F.value=!1},{footer:r(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!R.name.trim(),onClick:U},`ذخیره`,8,N)]),default:r(()=>[s(`label`,k,[n[8]||=p(`نام`,-1),a(s(`input`,{"onUpdate:modelValue":n[0]||=e=>R.name=e,class:`admin-input`},null,512),[[v,R.name]])]),s(`label`,A,[n[9]||=p(`شناسه لاتین`,-1),a(s(`input`,{"onUpdate:modelValue":n[1]||=e=>R.slug=e,class:`admin-input`,dir:`ltr`,placeholder:`مثلاً nademi-silk`},null,512),[[v,R.slug]])]),s(`label`,j,[n[10]||=p(`توضیح`,-1),a(s(`textarea`,{"onUpdate:modelValue":n[2]||=e=>R.description=e,class:`admin-input`,rows:`3`},null,512),[[v,R.description]])]),s(`label`,M,[n[11]||=p(`ترتیب`,-1),a(s(`input`,{"onUpdate:modelValue":n[3]||=e=>R.displayOrder=e,type:`number`,class:`admin-input`},null,512),[[v,R.displayOrder,void 0,{number:!0}]])]),u(C,{modelValue:R.isActive,"onUpdate:modelValue":n[4]||=e=>R.isActive=e,label:`فعال`},null,8,[`modelValue`])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-a6f53b6f`]]);export{P as default};
|
||||
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,At as t,E as n,M as r,c as i,d as a,g as o,h as s,k as c,l,m as u,r as d,st as f,t as p,u as m}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as h,t as g}from"./http-BjLkjdQu.js";import{h as _,o as v}from"./index-SWzbcuqQ.js";import{t as y}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as b}from"./BaseEmptyState-Bzvl_pTa.js";import{t as x}from"./AdminSelect-6a7SFr9x.js";var S={class:`admin-page`},C={class:`admin-page__head`},w={class:`request-card__top`},T={class:`muted`,dir:`ltr`},E={class:`badge`},D={key:0,class:`muted`},O={class:`admin-table`},k={dir:`ltr`},A={key:0,class:`movements`},j={class:`muted`},M=p(o({__name:`CatalogRequestsView`,setup(o){let p=[{value:``,label:`همه وضعیتها`},{value:`new`,label:`درخواست جدید`},{value:`approved`,label:`تأیید شده`},{value:`ready_to_ship`,label:`آماده ارسال`},{value:`delivered`,label:`تحویل به مشتری`},{value:`returned`,label:`بازگردانده شده`},{value:`cancelled`,label:`لغو شده`}],M=[{value:`warehouse`,label:`انبار`},{value:`customer`,label:`مشتری`},{value:`agent`,label:`واسطه`}],N=Object.fromEntries(p.filter(e=>e.value).map(e=>[e.value,e.label])),P=Object.fromEntries(M.map(e=>[e.value,e.label])),F=e([]),I=e(``),L=e(!0),R=e(null),z=h();async function B(){L.value=!0;try{F.value=await _.list(I.value||void 0)}catch(e){z.error(e instanceof g?e.message:`بارگذاری انجام نشد`)}finally{L.value=!1}}async function V(e,t){try{await _.updateStatus(e,t),z.success(`وضعیت بهروز شد`),await B()}catch(e){z.error(e instanceof g?e.message:`بهروزرسانی ناموفق بود`)}}async function H(e,t){if(!R.value){R.value=e;try{await _.updateHolder(e,{holderType:t}),z.success(`محل نگهداری بهروز شد`),await B()}catch(e){z.error(e instanceof g?e.message:`بهروزرسانی محل ناموفق بود`)}finally{R.value=null}}}function U(e){return P[e]??e}return n(()=>{B()}),(e,n)=>(c(),a(`div`,S,[i(`header`,C,[n[1]||=i(`div`,null,[i(`h1`,null,`درخواست کالیته فیزیکی`),i(`p`,null,`بررسی، گردش وضعیت و محل نگهداری اقلام`)],-1),s(x,{modelValue:I.value,"onUpdate:modelValue":[n[0]||=e=>I.value=e,B],options:p},null,8,[`modelValue`])]),L.value?(c(),l(y,{key:0,variant:`cards`})):F.value.length?(c(!0),a(d,{key:2},r(F.value,e=>(c(),a(`div`,{key:e.id,class:`request-card`},[i(`div`,w,[i(`div`,null,[i(`strong`,null,t(e.customerName),1),i(`span`,T,t(e.customerPhone),1),i(`span`,E,t(f(N)[e.status]??e.status),1)]),s(x,{"model-value":e.status,options:p.filter(e=>e.value),"onUpdate:modelValue":t=>V(e.id,String(t))},null,8,[`model-value`,`options`,`onUpdate:modelValue`])]),e.note?(c(),a(`p`,D,t(e.note),1)):m(``,!0),i(`table`,O,[n[2]||=i(`thead`,null,[i(`tr`,null,[i(`th`,null,`محصول`),i(`th`,null,`کد`),i(`th`,null,`تعداد`),i(`th`,null,`محل`)])],-1),i(`tbody`,null,[(c(!0),a(d,null,r(e.items,e=>(c(),a(`tr`,{key:e.id},[i(`td`,null,t(e.productName),1),i(`td`,k,t(e.productCode),1),i(`td`,null,t(e.quantity),1),i(`td`,null,[s(x,{"model-value":e.holderType,options:M,"onUpdate:modelValue":t=>H(e.id,String(t))},null,8,[`model-value`,`onUpdate:modelValue`]),e.movements?.length?(c(),a(`ul`,A,[(c(!0),a(d,null,r(e.movements,e=>(c(),a(`li`,{key:e.id},[u(t(U(e.fromHolder))+` → `+t(U(e.toHolder))+` `,1),i(`span`,j,t(f(v)(e.movedAt)),1)]))),128))])):m(``,!0)])]))),128))])])]))),128)):(c(),l(b,{key:1,title:`درخواستی نیست`}))]))}}),[[`__scopeId`,`data-v-747d8f88`]]);export{M as default};
|
||||
+1
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.admin-page__head[data-v-747d8f88]{justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px;display:flex}.admin-page__head h1[data-v-747d8f88]{margin:0 0 4px;font-size:1.25rem}.admin-page__head p[data-v-747d8f88]{color:var(--color-text-muted);margin:0;font-size:.875rem}.request-card[data-v-747d8f88]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;margin-bottom:12px;padding:16px}.request-card__top[data-v-747d8f88]{justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;display:flex}.request-card__top strong[data-v-747d8f88]{margin-left:8px}.muted[data-v-747d8f88]{color:var(--color-text-muted);margin-left:8px;font-size:.8125rem}.badge[data-v-747d8f88]{background:var(--color-primary-soft);color:var(--color-primary);border-radius:999px;padding:2px 8px;font-size:.75rem;display:inline-block}.admin-table[data-v-747d8f88]{border-collapse:collapse;width:100%;font-size:.8125rem}.admin-table th[data-v-747d8f88],.admin-table td[data-v-747d8f88]{text-align:right;border-top:1px solid var(--color-border);vertical-align:top;padding:8px 6px}.movements[data-v-747d8f88]{flex-direction:column;gap:4px;margin:8px 0 0;padding:0;font-size:.75rem;list-style:none;display:flex}
|
||||
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.category-icon[data-v-76e4dc13]{color:var(--color-text-muted);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.admin-page-header__sub[data-v-c42a22e0]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.categories-admin__grid[data-v-c42a22e0]{align-items:start;gap:16px;display:grid}.categories-panel[data-v-c42a22e0]{padding:20px}.categories-panel__head[data-v-c42a22e0]{border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px;padding-bottom:14px;display:flex}.categories-panel__head h2[data-v-c42a22e0]{margin:0 0 4px;font-size:1.05rem;font-weight:700}.categories-panel__head p[data-v-c42a22e0]{color:var(--color-text-muted);margin:0;font-size:.78rem}.categories-panel__add[data-v-c42a22e0]{border:1px dashed var(--color-border);background:var(--color-bg);border-radius:12px;gap:8px;margin-bottom:16px;padding:14px;display:grid}.categories-panel__empty[data-v-c42a22e0]{text-align:center;color:var(--color-text-muted);background:var(--color-bg);border-radius:12px;margin:0;padding:28px 12px;font-size:.875rem}.categories-panel__list[data-v-c42a22e0]{gap:12px;display:grid}.category-row[data-v-c42a22e0]{border:1px solid var(--color-border);background:var(--color-bg);border-radius:14px;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:12px;padding:12px;display:grid}.category-row__fields[data-v-c42a22e0]{gap:8px;min-width:0;display:grid}.category-row__line[data-v-c42a22e0]{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;display:grid}.category-row__line[data-v-c42a22e0] .admin-select{min-width:0}.category-row__id[data-v-c42a22e0]{color:var(--color-text-muted);margin:0;font-family:ui-monospace,monospace;font-size:.72rem}.category-row__remove[data-v-c42a22e0]{color:var(--color-danger,#dc3545);font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:none;padding:6px 4px;font-size:.8125rem}.category-row[data-v-c42a22e0] .image-picker__preview{width:72px;height:60px}@media (width>=900px){.categories-admin__grid[data-v-c42a22e0]{grid-template-columns:1fr 1fr}}@media (width<=640px){.category-row[data-v-c42a22e0]{grid-template-columns:1fr}.category-row__remove[data-v-c42a22e0]{justify-self:start}}
|
||||
-1
@@ -1 +0,0 @@
|
||||
.category-icon[data-v-76e4dc13]{color:var(--color-text-muted);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.admin-page-header__sub[data-v-092c0b6f]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.categories-admin__grid[data-v-092c0b6f]{align-items:start;gap:16px;display:grid}.categories-panel[data-v-092c0b6f]{padding:20px}.categories-panel__head[data-v-092c0b6f]{border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px;padding-bottom:14px;display:flex}.categories-panel__head h2[data-v-092c0b6f]{margin:0 0 4px;font-size:1.05rem;font-weight:700}.categories-panel__head p[data-v-092c0b6f]{color:var(--color-text-muted);margin:0;font-size:.78rem}.categories-panel__add[data-v-092c0b6f]{border:1px dashed var(--color-border);background:var(--color-bg);border-radius:12px;gap:8px;margin-bottom:16px;padding:14px;display:grid}.categories-panel__empty[data-v-092c0b6f]{text-align:center;color:var(--color-text-muted);background:var(--color-bg);border-radius:12px;margin:0;padding:28px 12px;font-size:.875rem}.categories-panel__list[data-v-092c0b6f]{gap:12px;display:grid}.category-row[data-v-092c0b6f]{border:1px solid var(--color-border);background:var(--color-bg);border-radius:14px;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:12px;padding:12px;display:grid}.category-row__fields[data-v-092c0b6f]{gap:8px;min-width:0;display:grid}.category-row__line[data-v-092c0b6f]{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;display:grid}.category-row__line[data-v-092c0b6f] .admin-select{min-width:0}.category-row__id[data-v-092c0b6f]{color:var(--color-text-muted);margin:0;font-family:ui-monospace,monospace;font-size:.72rem}.category-row__remove[data-v-092c0b6f]{color:var(--color-danger,#dc3545);font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:none;padding:6px 4px;font-size:.8125rem}.category-row[data-v-092c0b6f] .image-picker__preview{width:72px;height:60px}@media (width>=900px){.categories-admin__grid[data-v-092c0b6f]{grid-template-columns:1fr 1fr}}@media (width<=640px){.category-row[data-v-092c0b6f]{grid-template-columns:1fr}.category-row__remove[data-v-092c0b6f]{justify-self:start}}
|
||||
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
.companies-page__table[data-v-b4857c22]{overflow:hidden}.companies-page__card-logo[data-v-b4857c22]{align-items:center;gap:12px;display:flex}.companies-page__card-desc[data-v-b4857c22]{color:var(--color-text-muted);margin:4px 0 0;font-size:.8125rem;font-weight:400}.company-logo[data-v-b4857c22]{border-radius:var(--radius-sm);object-fit:contain;background:var(--color-bg);border:1px solid var(--color-border);width:40px;height:40px}.company-logo--fallback[data-v-b4857c22]{background:var(--color-primary);color:#fff;justify-content:center;align-items:center;font-size:1rem;font-weight:700;display:flex}.logo-upload[data-v-b4857c22]{flex-direction:column;gap:10px;display:flex}.logo-upload__input[data-v-b4857c22]{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.logo-upload__dropzone[data-v-b4857c22]{border:2px dashed var(--color-border);border-radius:var(--radius-md);background:var(--color-border-light);cursor:pointer;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:28px 16px;transition:border-color .15s,background .15s;display:flex}.logo-upload__dropzone[data-v-b4857c22]:hover{border-color:var(--color-primary);background:var(--color-info-light)}.logo-upload__icon[data-v-b4857c22]{background:var(--color-surface);border:1px solid var(--color-border);width:40px;height:40px;color:var(--color-text-muted);border-radius:50%;justify-content:center;align-items:center;font-size:1.5rem;line-height:1;display:flex}.logo-upload__text[data-v-b4857c22]{color:var(--color-text);font-size:.875rem;font-weight:600}.logo-upload__hint[data-v-b4857c22]{color:var(--color-text-muted);font-size:.75rem}.logo-upload__preview-wrap[data-v-b4857c22]{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-border-light);flex-direction:column;align-items:center;gap:10px;padding:16px;display:flex}.logo-upload__preview[data-v-b4857c22]{object-fit:contain;border-radius:var(--radius-sm);background:var(--color-surface);border:1px solid var(--color-border);width:80px;height:80px}.logo-upload__remove[data-v-b4857c22]{color:var(--color-danger);cursor:pointer;background:0 0;border:none;padding:0;font-size:.8125rem;font-weight:600}.logo-upload__remove[data-v-b4857c22]:hover{text-decoration:underline}.logo-upload__change[data-v-b4857c22]{align-self:flex-start}
|
||||
.companies-page__table[data-v-189e4d8e]{overflow:hidden}.companies-page__card-logo[data-v-189e4d8e]{align-items:center;gap:12px;display:flex}.companies-page__card-desc[data-v-189e4d8e]{color:var(--color-text-muted);margin:4px 0 0;font-size:.8125rem;font-weight:400}.company-logo[data-v-189e4d8e]{border-radius:var(--radius-sm);object-fit:contain;background:var(--color-bg);border:1px solid var(--color-border);width:40px;height:40px}.company-logo--fallback[data-v-189e4d8e]{background:var(--color-primary);color:#fff;justify-content:center;align-items:center;font-size:1rem;font-weight:700;display:flex}.logo-upload[data-v-189e4d8e]{flex-direction:column;gap:10px;display:flex}.logo-upload__input[data-v-189e4d8e]{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.logo-upload__dropzone[data-v-189e4d8e]{border:2px dashed var(--color-border);border-radius:var(--radius-md);background:var(--color-border-light);cursor:pointer;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:28px 16px;transition:border-color .15s,background .15s;display:flex}.logo-upload__dropzone[data-v-189e4d8e]:hover{border-color:var(--color-primary);background:var(--color-info-light)}.logo-upload__icon[data-v-189e4d8e]{background:var(--color-surface);border:1px solid var(--color-border);width:40px;height:40px;color:var(--color-text-muted);border-radius:50%;justify-content:center;align-items:center;font-size:1.5rem;line-height:1;display:flex}.logo-upload__text[data-v-189e4d8e]{color:var(--color-text);font-size:.875rem;font-weight:600}.logo-upload__hint[data-v-189e4d8e]{color:var(--color-text-muted);font-size:.75rem}.logo-upload__preview-wrap[data-v-189e4d8e]{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-border-light);flex-direction:column;align-items:center;gap:10px;padding:16px;display:flex}.logo-upload__preview[data-v-189e4d8e]{object-fit:contain;border-radius:var(--radius-sm);background:var(--color-surface);border:1px solid var(--color-border);width:80px;height:80px}.logo-upload__remove[data-v-189e4d8e]{color:var(--color-danger);cursor:pointer;background:0 0;border:none;padding:0;font-size:.8125rem;font-weight:600}.logo-upload__remove[data-v-189e4d8e]:hover{text-decoration:underline}.logo-upload__change[data-v-189e4d8e]{align-self:flex-start}
|
||||
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
.suggestions-panel[data-v-4182e847]{border-top:1px solid var(--color-border);margin-top:20px;padding-top:20px}.suggestions-panel__head[data-v-4182e847]{margin-bottom:12px}.suggestions-panel__title[data-v-4182e847]{margin:0 0 4px;font-size:.95rem}.suggestions-panel__hint[data-v-4182e847]{color:var(--color-text-muted);margin:0;font-size:.78rem;line-height:1.5}.suggestions-panel__loading[data-v-4182e847],.suggestions-panel__empty[data-v-4182e847]{color:var(--color-text-muted);font-size:.85rem}.suggestions-panel__add[data-v-4182e847]{flex-direction:column;gap:10px;display:flex}.field[data-v-4182e847]{flex-direction:column;gap:6px;font-size:.85rem;display:flex}.suggestions-panel__picked[data-v-4182e847]{flex-wrap:wrap;gap:6px;display:flex}.suggestions-panel__chip[data-v-4182e847]{background:var(--color-primary-soft);color:var(--color-primary);border-radius:999px;align-items:center;gap:6px;padding:4px 8px;font-size:.75rem;font-weight:700;display:inline-flex}.suggestions-panel__chip button[data-v-4182e847]{color:inherit;cursor:pointer;background:0 0;border:none;font-size:1rem;line-height:1}.suggestions-panel__sub[data-v-4182e847]{margin:16px 0 8px;font-size:.85rem}.suggestions-panel__list ul[data-v-4182e847]{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.suggestions-panel__row[data-v-4182e847]{background:var(--color-bg);border:1px solid var(--color-border);border-radius:10px;justify-content:space-between;align-items:flex-start;gap:12px;padding:10px 12px;display:flex}.suggestions-panel__actions[data-v-4182e847]{flex-direction:column;flex-shrink:0;align-items:flex-end;gap:4px;display:flex}.muted[data-v-4182e847]{color:var(--color-text-muted);margin-inline-start:4px;font-size:.75rem}.note[data-v-4182e847]{color:var(--color-text-muted);margin:4px 0 0;font-size:.75rem}.on[data-v-4182e847]{color:var(--color-success);font-size:.72rem;font-weight:700}.off[data-v-4182e847]{color:var(--color-text-muted);font-size:.72rem}.link[data-v-4182e847]{color:var(--color-primary);cursor:pointer;background:0 0;border:none;font-family:inherit;font-size:.78rem}.customers-page__tabs[data-v-2e37be8d]{gap:8px;margin-bottom:16px;display:flex}.customers-page__tab[data-v-2e37be8d]{border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-muted);font:inherit;cursor:pointer;border-radius:999px;padding:8px 16px;font-size:.875rem;font-weight:600}.customers-page__tab.is-active[data-v-2e37be8d]{border-color:var(--color-primary);background:var(--color-primary-soft);color:var(--color-primary)}.customers-page__search[data-v-2e37be8d]{color:var(--color-text-muted);align-items:center;gap:10px;margin-bottom:16px;padding:10px 14px;display:flex}.customers-page__search-input[data-v-2e37be8d]{background:0 0;border:none;outline:none;flex:1;font-size:.875rem}.customers-page__table[data-v-2e37be8d]{overflow:hidden}
|
||||
.suggestions-panel[data-v-4182e847]{border-top:1px solid var(--color-border);margin-top:20px;padding-top:20px}.suggestions-panel__head[data-v-4182e847]{margin-bottom:12px}.suggestions-panel__title[data-v-4182e847]{margin:0 0 4px;font-size:.95rem}.suggestions-panel__hint[data-v-4182e847]{color:var(--color-text-muted);margin:0;font-size:.78rem;line-height:1.5}.suggestions-panel__loading[data-v-4182e847],.suggestions-panel__empty[data-v-4182e847]{color:var(--color-text-muted);font-size:.85rem}.suggestions-panel__add[data-v-4182e847]{flex-direction:column;gap:10px;display:flex}.field[data-v-4182e847]{flex-direction:column;gap:6px;font-size:.85rem;display:flex}.suggestions-panel__picked[data-v-4182e847]{flex-wrap:wrap;gap:6px;display:flex}.suggestions-panel__chip[data-v-4182e847]{background:var(--color-primary-soft);color:var(--color-primary);border-radius:999px;align-items:center;gap:6px;padding:4px 8px;font-size:.75rem;font-weight:700;display:inline-flex}.suggestions-panel__chip button[data-v-4182e847]{color:inherit;cursor:pointer;background:0 0;border:none;font-size:1rem;line-height:1}.suggestions-panel__sub[data-v-4182e847]{margin:16px 0 8px;font-size:.85rem}.suggestions-panel__list ul[data-v-4182e847]{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.suggestions-panel__row[data-v-4182e847]{background:var(--color-bg);border:1px solid var(--color-border);border-radius:10px;justify-content:space-between;align-items:flex-start;gap:12px;padding:10px 12px;display:flex}.suggestions-panel__actions[data-v-4182e847]{flex-direction:column;flex-shrink:0;align-items:flex-end;gap:4px;display:flex}.muted[data-v-4182e847]{color:var(--color-text-muted);margin-inline-start:4px;font-size:.75rem}.note[data-v-4182e847]{color:var(--color-text-muted);margin:4px 0 0;font-size:.75rem}.on[data-v-4182e847]{color:var(--color-success);font-size:.72rem;font-weight:700}.off[data-v-4182e847]{color:var(--color-text-muted);font-size:.72rem}.link[data-v-4182e847]{color:var(--color-primary);cursor:pointer;background:0 0;border:none;font-family:inherit;font-size:.78rem}.customers-page__tabs[data-v-e7c35ad6]{gap:8px;margin-bottom:16px;display:flex}.customers-page__tab[data-v-e7c35ad6]{border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-muted);font:inherit;cursor:pointer;border-radius:999px;padding:8px 16px;font-size:.875rem;font-weight:600}.customers-page__tab.is-active[data-v-e7c35ad6]{border-color:var(--color-primary);background:var(--color-primary-soft);color:var(--color-primary)}.customers-page__search[data-v-e7c35ad6]{color:var(--color-text-muted);align-items:center;gap:10px;margin-bottom:16px;padding:10px 14px;display:flex}.customers-page__search-input[data-v-e7c35ad6]{background:0 0;border:none;outline:none;flex:1;font-size:.875rem}.customers-page__table[data-v-e7c35ad6]{overflow:hidden}
|
||||
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import{$ as e,At as t,E as n,H as r,M as i,U as a,Z as o,c as s,d as c,g as l,h as u,k as d,l as f,m as p,r as m,s as h,t as g}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as _,f as v,t as y}from"./http-BjLkjdQu.js";import{B as b,x}from"./index-SWzbcuqQ.js";import{t as S}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as C}from"./BaseEmptyState-Bzvl_pTa.js";var w={class:`admin-page`},T={key:2,class:`admin-table`},E={dir:`ltr`},D=[`onClick`],O={class:`field`},k={class:`field`},A={class:`field`},j={class:`field`},M=[`disabled`],N=g(l({__name:`LevelsView`,setup(l){let g=e([]),N=e(!0),P=e(!1),F=e(null),I=_(),L=o({code:``,label:``,sortOrder:0,benefitsText:``}),R=h(()=>F.value?`ویرایش سطح`:`سطح جدید`);function z(e){return e.split(`
|
||||
`).map(e=>e.trim()).filter(Boolean).map(e=>({title:e}))}async function B(){N.value=!0;try{g.value=await x.list()}catch(e){I.error(e instanceof y?e.message:`بارگذاری سطوح ناموفق بود`)}finally{N.value=!1}}function V(){F.value=null,Object.assign(L,{code:``,label:``,sortOrder:g.value.length+1,benefitsText:``}),P.value=!0}function H(e){F.value=e.id,Object.assign(L,{code:e.code,label:e.label,sortOrder:e.sortOrder,benefitsText:e.benefits.map(e=>e.title).join(`
|
||||
`)}),P.value=!0}async function U(){try{let e={code:L.code.trim(),label:L.label.trim(),sortOrder:L.sortOrder,benefits:z(L.benefitsText)};F.value?await x.update(F.value,e):await x.create(e),P.value=!1,I.success(`ذخیره شد`),await B()}catch(e){I.error(e instanceof y?e.message:`ذخیره ناموفق بود`)}}return n(()=>{B()}),(e,n)=>(d(),c(`div`,w,[s(`header`,{class:`admin-page__head`},[n[5]||=s(`div`,null,[s(`h1`,null,`سطوح و مزایای مشتری`),s(`p`,null,`تعریف Level داخلی CRM و مزایای هر سطح (نمایش فقط در ادمین)`)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`سطح جدید`)]),N.value?(d(),f(S,{key:0,variant:`table`})):g.value.length?(d(),c(`table`,T,[n[6]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`کد`),s(`th`,null,`عنوان`),s(`th`,null,`مزایا`),s(`th`,null,`مشتریان`),s(`th`)])],-1),s(`tbody`,null,[(d(!0),c(m,null,i(g.value,e=>(d(),c(`tr`,{key:e.id},[s(`td`,E,t(e.code),1),s(`td`,null,t(e.label),1),s(`td`,null,t(e.benefits.map(e=>e.title).join(`، `)||`—`),1),s(`td`,null,t(e.customersCount),1),s(`td`,null,[s(`button`,{type:`button`,class:`link`,onClick:t=>H(e)},`ویرایش`,8,D)])]))),128))])])):(d(),f(C,{key:1,title:`سطحی تعریف نشده`})),u(b,{open:P.value,title:R.value,onClose:n[4]||=e=>P.value=!1},{footer:r(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!L.code.trim()||!L.label.trim(),onClick:U},` ذخیره `,8,M)]),default:r(()=>[s(`label`,O,[n[7]||=p(`کد`,-1),a(s(`input`,{"onUpdate:modelValue":n[0]||=e=>L.code=e,class:`admin-input`,dir:`ltr`},null,512),[[v,L.code]])]),s(`label`,k,[n[8]||=p(`عنوان`,-1),a(s(`input`,{"onUpdate:modelValue":n[1]||=e=>L.label=e,class:`admin-input`},null,512),[[v,L.label]])]),s(`label`,A,[n[9]||=p(`ترتیب`,-1),a(s(`input`,{"onUpdate:modelValue":n[2]||=e=>L.sortOrder=e,type:`number`,class:`admin-input`},null,512),[[v,L.sortOrder,void 0,{number:!0}]])]),s(`label`,j,[n[10]||=p(` مزایا (هر خط یک مورد) `,-1),a(s(`textarea`,{"onUpdate:modelValue":n[3]||=e=>L.benefitsText=e,class:`admin-input`,rows:`4`},null,512),[[v,L.benefitsText]])])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-44c7f808`]]);export{N as default};
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import{A as e,D as t,N as n,Q as r,U as i,W as a,c as o,d as s,et as c,g as l,h as u,jt as d,l as f,m as p,r as m,s as h,t as g}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as _,d as v,t as y}from"./http-CTjL79ty.js";import{S as b,V as x}from"./index-DxcN1-hp.js";import{t as S}from"./AdminPageSkeleton-DacAHji8.js";import{t as C}from"./BaseEmptyState-BAIuUvAl.js";var w={class:`admin-page`},T={key:2,class:`admin-table`},E={dir:`ltr`},D=[`onClick`],O={class:`field`},k={class:`field`},A={class:`field`},j={class:`field`},M=[`disabled`],N=g(l({__name:`LevelsView`,setup(l){let g=c([]),N=c(!0),P=c(!1),F=c(null),I=_(),L=r({code:``,label:``,sortOrder:0,benefitsText:``}),R=h(()=>F.value?`ویرایش سطح`:`سطح جدید`);function z(e){return e.split(`
|
||||
`).map(e=>e.trim()).filter(Boolean).map(e=>({title:e}))}async function B(){N.value=!0;try{g.value=await b.list()}catch(e){I.error(e instanceof y?e.message:`بارگذاری سطوح ناموفق بود`)}finally{N.value=!1}}function V(){F.value=null,Object.assign(L,{code:``,label:``,sortOrder:g.value.length+1,benefitsText:``}),P.value=!0}function H(e){F.value=e.id,Object.assign(L,{code:e.code,label:e.label,sortOrder:e.sortOrder,benefitsText:e.benefits.map(e=>e.title).join(`
|
||||
`)}),P.value=!0}async function U(){try{let e={code:L.code.trim(),label:L.label.trim(),sortOrder:L.sortOrder,benefits:z(L.benefitsText)};F.value?await b.update(F.value,e):await b.create(e),P.value=!1,I.success(`ذخیره شد`),await B()}catch(e){I.error(e instanceof y?e.message:`ذخیره ناموفق بود`)}}return t(()=>{B()}),(t,r)=>(e(),s(`div`,w,[o(`header`,{class:`admin-page__head`},[r[5]||=o(`div`,null,[o(`h1`,null,`سطوح و مزایای مشتری`),o(`p`,null,`تعریف Level داخلی CRM و مزایای هر سطح (نمایش فقط در ادمین)`)],-1),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`سطح جدید`)]),N.value?(e(),f(S,{key:0,variant:`table`})):g.value.length?(e(),s(`table`,T,[r[6]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`کد`),o(`th`,null,`عنوان`),o(`th`,null,`مزایا`),o(`th`,null,`مشتریان`),o(`th`)])],-1),o(`tbody`,null,[(e(!0),s(m,null,n(g.value,t=>(e(),s(`tr`,{key:t.id},[o(`td`,E,d(t.code),1),o(`td`,null,d(t.label),1),o(`td`,null,d(t.benefits.map(e=>e.title).join(`، `)||`—`),1),o(`td`,null,d(t.customersCount),1),o(`td`,null,[o(`button`,{type:`button`,class:`link`,onClick:e=>H(t)},`ویرایش`,8,D)])]))),128))])])):(e(),f(C,{key:1,title:`سطحی تعریف نشده`})),u(x,{open:P.value,title:R.value,onClose:r[4]||=e=>P.value=!1},{footer:i(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!L.code.trim()||!L.label.trim(),onClick:U},` ذخیره `,8,M)]),default:i(()=>[o(`label`,O,[r[7]||=p(`کد`,-1),a(o(`input`,{"onUpdate:modelValue":r[0]||=e=>L.code=e,class:`admin-input`,dir:`ltr`},null,512),[[v,L.code]])]),o(`label`,k,[r[8]||=p(`عنوان`,-1),a(o(`input`,{"onUpdate:modelValue":r[1]||=e=>L.label=e,class:`admin-input`},null,512),[[v,L.label]])]),o(`label`,A,[r[9]||=p(`ترتیب`,-1),a(o(`input`,{"onUpdate:modelValue":r[2]||=e=>L.sortOrder=e,type:`number`,class:`admin-input`},null,512),[[v,L.sortOrder,void 0,{number:!0}]])]),o(`label`,j,[r[10]||=p(` مزایا (هر خط یک مورد) `,-1),a(o(`textarea`,{"onUpdate:modelValue":r[3]||=e=>L.benefitsText=e,class:`admin-input`,rows:`4`},null,512),[[v,L.benefitsText]])])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-44c7f808`]]);export{N as default};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{A as e,W as t,c as n,ct as r,d as i,et as a,g as o,h as s,jt as c,m as l,s as u,t as d,u as f}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as p,d as m,l as h,m as g,u as _}from"./http-CTjL79ty.js";import{F as v,I as y,L as b,P as x,R as S,z as C}from"./index-DxcN1-hp.js";var w={class:`login-page`},T={class:`login-page__form-wrap`},E={class:`login-page__card admin-card`},D={class:`login-page__header`},O={key:0,class:`login-page__mock-hint`},k={dir:`ltr`},A={dir:`ltr`},j={key:0,class:`admin-form__error`,role:`alert`},M={class:`admin-form__field`},N={class:`login-page__input-wrap`},P={class:`login-page__field-icon`,"aria-hidden":`true`},F={class:`admin-form__field`},I={class:`login-page__input-wrap login-page__input-wrap--password`},L={class:`login-page__field-icon`,"aria-hidden":`true`},R=[`type`],z=[`aria-label`],B={class:`login-page__remember`},V=[`disabled`],H={key:0,class:`admin-btn__spinner`,"aria-hidden":`true`},U=d(o({__name:`LoginView`,setup(o){let d=C(),U=S(),W=x(),G=p(),K=a(y()?v.phone:``),q=a(y()?v.password:``),J=a(!0),Y=a(!1),X=y(),Z=u(()=>K.value.trim().length>0&&q.value.length>0);function Q(e){return e.replace(/[۰-۹]/g,e=>String(`۰۱۲۳۴۵۶۷۸۹`.indexOf(e))).replace(/[٠-٩]/g,e=>String(`٠١٢٣٤٥٦٧٨٩`.indexOf(e)))}async function $(){if(!Z.value){W.error=`لطفاً شماره موبایل و رمز عبور را وارد کنید.`;return}if(!await W.login(Q(K.value.trim()),q.value,J.value))return;G.success(`خوش آمدید، ${W.fullName}`);let e=typeof U.query.redirect==`string`?U.query.redirect:`/`,t=`/admin/`.replace(/\/$/,``),n=e.startsWith(t)?e.slice(t.length)||`/`:e;await d.replace(n)}return(a,o)=>(e(),i(`div`,w,[n(`div`,T,[n(`div`,E,[n(`div`,D,[o[8]||=n(`h2`,{class:`login-page__title`},`ورود به پنل مدیریت`,-1),o[9]||=n(`p`,{class:`login-page__subtitle`},`برای ادامه، اطلاعات حساب کاربری خود را وارد کنید.`,-1),r(X)?(e(),i(`p`,O,[o[6]||=l(` حالت موک فعال است — `,-1),n(`span`,k,c(r(v).phone),1),o[7]||=l(` / `,-1),n(`span`,A,c(r(v).password),1)])):f(``,!0)]),n(`form`,{class:`admin-form login-page__form`,onSubmit:g($,[`prevent`])},[r(W).error?(e(),i(`p`,j,c(r(W).error),1)):f(``,!0),n(`div`,M,[o[10]||=n(`label`,{for:`login-phone`},`شماره موبایل`,-1),n(`div`,N,[n(`span`,P,[s(b,{name:`phone`,size:18})]),t(n(`input`,{id:`login-phone`,"onUpdate:modelValue":o[0]||=e=>K.value=e,type:`tel`,class:`admin-input login-page__input`,placeholder:`۰۹۱۲۱۱۱۱۲۲۲۲`,autocomplete:`username`,inputmode:`tel`,dir:`ltr`,onInput:o[1]||=e=>r(W).clearError()},null,544),[[m,K.value]])])]),n(`div`,F,[o[11]||=n(`label`,{for:`login-password`},`رمز عبور`,-1),n(`div`,I,[n(`span`,L,[s(b,{name:`lock`,size:18})]),t(n(`input`,{id:`login-password`,"onUpdate:modelValue":o[2]||=e=>q.value=e,type:Y.value?`text`:`password`,class:`admin-input login-page__input login-page__input--with-toggle`,placeholder:`رمز عبور`,autocomplete:`current-password`,onInput:o[3]||=e=>r(W).clearError()},null,40,R),[[_,q.value]]),n(`button`,{type:`button`,class:`login-page__toggle-password`,"aria-label":Y.value?`پنهان کردن رمز`:`نمایش رمز`,onClick:o[4]||=e=>Y.value=!Y.value},[s(b,{name:Y.value?`eye-off`:`eye`,size:18},null,8,[`name`])],8,z)])]),n(`label`,B,[t(n(`input`,{"onUpdate:modelValue":o[5]||=e=>J.value=e,type:`checkbox`},null,512),[[h,J.value]]),o[12]||=n(`span`,null,`مرا به خاطر بسپار`,-1)]),n(`button`,{type:`submit`,class:`admin-btn admin-btn--primary login-page__submit`,disabled:!Z.value||r(W).loading},[r(W).loading?(e(),i(`span`,H)):f(``,!0),o[13]||=l(` ورود به پنل `,-1)],8,V)],32)])]),n(`div`,{class:`login-page__brand`},[n(`div`,{class:`login-page__brand-inner`},[n(`img`,{src:`/admin/brand-logo.png`,alt:`نادمی تکس`,class:`login-page__brand-logo`}),o[14]||=n(`p`,{class:`login-page__brand-badge`},`پارچه`,-1),o[15]||=n(`h1`,{class:`login-page__brand-title`},`پنل مدیریت سفارشهای عمده`,-1),o[16]||=n(`p`,{class:`login-page__brand-text`},` مدیریت سفارشها، مشتریان، قیمتگذاری، چکها و گزارشهای فروش در یک محیط یکپارچه. `,-1)])])]))}}),[[`__scopeId`,`data-v-df8d196a`]]);export{U as default};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,At as t,U as n,c as r,d as i,g as a,h as o,k as s,m as c,s as l,st as u,t as d,u as f}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as p,f as m,l as h,m as g,u as _}from"./http-BjLkjdQu.js";import{F as v,I as y,L as b,N as x,P as S,R as C}from"./index-SWzbcuqQ.js";var w={class:`login-page`},T={class:`login-page__form-wrap`},E={class:`login-page__card admin-card`},D={class:`login-page__header`},O={key:0,class:`login-page__mock-hint`},k={dir:`ltr`},A={dir:`ltr`},j={key:0,class:`admin-form__error`,role:`alert`},M={class:`admin-form__field`},N={class:`login-page__input-wrap`},P={class:`login-page__field-icon`,"aria-hidden":`true`},F={class:`admin-form__field`},I={class:`login-page__input-wrap login-page__input-wrap--password`},L={class:`login-page__field-icon`,"aria-hidden":`true`},R=[`type`],z=[`aria-label`],B={class:`login-page__remember`},V=[`disabled`],H={key:0,class:`admin-btn__spinner`,"aria-hidden":`true`},U=d(a({__name:`LoginView`,setup(a){let d=C(),U=b(),W=x(),G=p(),K=e(v()?S.phone:``),q=e(v()?S.password:``),J=e(!0),Y=e(!1),X=v(),Z=l(()=>K.value.trim().length>0&&q.value.length>0);function Q(e){return e.replace(/[۰-۹]/g,e=>String(`۰۱۲۳۴۵۶۷۸۹`.indexOf(e))).replace(/[٠-٩]/g,e=>String(`٠١٢٣٤٥٦٧٨٩`.indexOf(e)))}async function $(){if(!Z.value){W.error=`لطفاً شماره موبایل و رمز عبور را وارد کنید.`;return}if(!await W.login(Q(K.value.trim()),q.value,J.value))return;G.success(`خوش آمدید، ${W.fullName}`);let e=typeof U.query.redirect==`string`?U.query.redirect:`/`,t=`/admin/`.replace(/\/$/,``),n=e.startsWith(t)?e.slice(t.length)||`/`:e;await d.replace(n)}return(e,a)=>(s(),i(`div`,w,[r(`div`,T,[r(`div`,E,[r(`div`,D,[a[8]||=r(`h2`,{class:`login-page__title`},`ورود به پنل مدیریت`,-1),a[9]||=r(`p`,{class:`login-page__subtitle`},`برای ادامه، اطلاعات حساب کاربری خود را وارد کنید.`,-1),u(X)?(s(),i(`p`,O,[a[6]||=c(` حالت موک فعال است — `,-1),r(`span`,k,t(u(S).phone),1),a[7]||=c(` / `,-1),r(`span`,A,t(u(S).password),1)])):f(``,!0)]),r(`form`,{class:`admin-form login-page__form`,onSubmit:g($,[`prevent`])},[u(W).error?(s(),i(`p`,j,t(u(W).error),1)):f(``,!0),r(`div`,M,[a[10]||=r(`label`,{for:`login-phone`},`شماره موبایل`,-1),r(`div`,N,[r(`span`,P,[o(y,{name:`phone`,size:18})]),n(r(`input`,{id:`login-phone`,"onUpdate:modelValue":a[0]||=e=>K.value=e,type:`tel`,class:`admin-input login-page__input`,placeholder:`۰۹۱۲۱۱۱۱۲۲۲۲`,autocomplete:`username`,inputmode:`tel`,dir:`ltr`,onInput:a[1]||=e=>u(W).clearError()},null,544),[[m,K.value]])])]),r(`div`,F,[a[11]||=r(`label`,{for:`login-password`},`رمز عبور`,-1),r(`div`,I,[r(`span`,L,[o(y,{name:`lock`,size:18})]),n(r(`input`,{id:`login-password`,"onUpdate:modelValue":a[2]||=e=>q.value=e,type:Y.value?`text`:`password`,class:`admin-input login-page__input login-page__input--with-toggle`,placeholder:`رمز عبور`,autocomplete:`current-password`,onInput:a[3]||=e=>u(W).clearError()},null,40,R),[[_,q.value]]),r(`button`,{type:`button`,class:`login-page__toggle-password`,"aria-label":Y.value?`پنهان کردن رمز`:`نمایش رمز`,onClick:a[4]||=e=>Y.value=!Y.value},[o(y,{name:Y.value?`eye-off`:`eye`,size:18},null,8,[`name`])],8,z)])]),r(`label`,B,[n(r(`input`,{"onUpdate:modelValue":a[5]||=e=>J.value=e,type:`checkbox`},null,512),[[h,J.value]]),a[12]||=r(`span`,null,`مرا به خاطر بسپار`,-1)]),r(`button`,{type:`submit`,class:`admin-btn admin-btn--primary login-page__submit`,disabled:!Z.value||u(W).loading},[u(W).loading?(s(),i(`span`,H)):f(``,!0),a[13]||=c(` ورود به پنل `,-1)],8,V)],32)])]),r(`div`,{class:`login-page__brand`},[r(`div`,{class:`login-page__brand-inner`},[r(`img`,{src:`/admin/brand-logo.png`,alt:`نادمی تکس`,class:`login-page__brand-logo`}),a[14]||=r(`p`,{class:`login-page__brand-badge`},`پارچه`,-1),a[15]||=r(`h1`,{class:`login-page__brand-title`},`پنل مدیریت سفارشهای عمده`,-1),a[16]||=r(`p`,{class:`login-page__brand-text`},` مدیریت سفارشها، مشتریان، قیمتگذاری، چکها و گزارشهای فروش در یک محیط یکپارچه. `,-1)])])]))}}),[[`__scopeId`,`data-v-df8d196a`]]);export{U as default};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{H as e,P as t,c as n,d as r,h as i,k as a,m as o,t as s}from"./_plugin-vue_export-helper-QrIvvHC8.js";var c={},l={class:`not-found`};function u(s,c){let u=t(`RouterLink`);return a(),r(`main`,l,[c[1]||=n(`p`,{class:`not-found__code`},`404`,-1),c[2]||=n(`h1`,null,`صفحه پیدا نشد`,-1),c[3]||=n(`p`,null,`آدرسی که وارد کردهاید وجود ندارد.`,-1),i(u,{to:`/`},{default:e(()=>[...c[0]||=[o(`بازگشت به داشبورد`,-1)]]),_:1})])}var d=s(c,[[`render`,u],[`__scopeId`,`data-v-1c91077f`]]);export{d as default};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{A as e,F as t,U as n,c as r,d as i,h as a,m as o,t as s}from"./_plugin-vue_export-helper-vx-p5QAT.js";var c={},l={class:`not-found`};function u(s,c){let u=t(`RouterLink`);return e(),i(`main`,l,[c[1]||=r(`p`,{class:`not-found__code`},`404`,-1),c[2]||=r(`h1`,null,`صفحه پیدا نشد`,-1),c[3]||=r(`p`,null,`آدرسی که وارد کردهاید وجود ندارد.`,-1),a(u,{to:`/`},{default:n(()=>[...c[0]||=[o(`بازگشت به داشبورد`,-1)]]),_:1})])}var d=s(c,[[`render`,u],[`__scopeId`,`data-v-1c91077f`]]);export{d as default};
|
||||
-1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
.products-page__filters[data-v-83a6f3f4]{flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px;padding:12px 14px;display:flex}.products-page__search[data-v-83a6f3f4]{min-width:200px;color:var(--color-text-muted);flex:1;align-items:center;gap:10px;display:flex}.products-page__search-input[data-v-83a6f3f4]{background:0 0;border:none;outline:none;flex:1;font-size:.875rem}.products-page__catalog-filter[data-v-83a6f3f4]{width:min(260px,100%)}.admin-form__hint[data-v-83a6f3f4]{color:var(--color-text-muted);margin:6px 0 0;font-size:.75rem;line-height:1.5}.products-page__table[data-v-83a6f3f4]{overflow:hidden}.product-thumb[data-v-83a6f3f4]{background:#e8eceb 50%/cover no-repeat;border-radius:8px;width:44px;height:36px;display:block}.product-thumb--empty[data-v-83a6f3f4]{background:#eef1f0}.color-variants__hint[data-v-83a6f3f4]{color:var(--color-text-muted);margin:0 0 10px;font-size:.75rem;line-height:1.6}.general-images[data-v-83a6f3f4],.color-variants[data-v-83a6f3f4]{flex-direction:column;gap:10px;display:flex}.product-media-row[data-v-83a6f3f4]{border:1px solid var(--color-border);background:var(--color-elevated,#fff);border-radius:14px;grid-template-columns:1fr auto;align-items:center;gap:12px 14px;padding:12px 14px;display:grid;box-shadow:0 1px 2px #0f172a0a}.product-media-row--color[data-v-83a6f3f4]{grid-template-columns:auto 1fr auto;align-items:center}.product-media-row[data-v-83a6f3f4] .image-picker{min-width:0}.product-media-row__input[data-v-83a6f3f4]{min-width:0;height:44px}.product-media-row__delete[data-v-83a6f3f4]{width:40px;height:40px;color:var(--color-text-muted);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:12px;flex-shrink:0;justify-content:center;align-items:center;padding:0;transition:color .15s,background .15s,border-color .15s;display:inline-flex}.product-media-row__delete[data-v-83a6f3f4]:hover{color:#c53030;background:#c5303014;border-color:#c530302e}.product-media-row__delete[data-v-83a6f3f4]:focus-visible{outline:2px solid var(--color-primary,#2d6a4f);outline-offset:2px}.product-media-add[data-v-83a6f3f4]{justify-content:center;align-self:stretch}@media (width<=520px){.product-media-row--color[data-v-83a6f3f4]{grid-template-rows:auto auto;grid-template-columns:1fr auto}.product-media-row--color[data-v-83a6f3f4] .image-picker{grid-column:1/-1}.product-media-row--color .product-media-row__delete[data-v-83a6f3f4]{grid-area:2/2}.product-media-row--color .product-media-row__input[data-v-83a6f3f4]{grid-area:2/1}}
|
||||
-1
@@ -1 +0,0 @@
|
||||
.products-page__filters[data-v-1acc8c48]{flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px;padding:12px 14px;display:flex}.products-page__search[data-v-1acc8c48]{min-width:200px;color:var(--color-text-muted);flex:1;align-items:center;gap:10px;display:flex}.products-page__search-input[data-v-1acc8c48]{background:0 0;border:none;outline:none;flex:1;font-size:.875rem}.products-page__catalog-filter[data-v-1acc8c48]{width:min(260px,100%)}.admin-form__hint[data-v-1acc8c48]{color:var(--color-text-muted);margin:6px 0 0;font-size:.75rem;line-height:1.5}.products-page__table[data-v-1acc8c48]{overflow:hidden}.product-thumb[data-v-1acc8c48]{background:#e8eceb 50%/cover no-repeat;border-radius:8px;width:44px;height:36px;display:block}.product-thumb--empty[data-v-1acc8c48]{background:#eef1f0}.color-variants[data-v-1acc8c48]{flex-direction:column;gap:14px;display:flex}.color-variants__hint[data-v-1acc8c48]{color:var(--color-text-muted);margin:0 0 10px;font-size:.75rem;line-height:1.6}.general-images[data-v-1acc8c48]{flex-direction:column;gap:12px;display:flex}.general-images__row[data-v-1acc8c48],.color-variant[data-v-1acc8c48]{border:1px solid var(--color-border);background:var(--color-bg,#f7f8f7);border-radius:12px;flex-wrap:wrap;align-items:center;gap:12px;padding:10px;display:flex}.color-variant__fields[data-v-1acc8c48]{flex-direction:column;flex:1;align-items:flex-start;gap:8px;min-width:180px;display:flex}
|
||||
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
-1
@@ -1 +0,0 @@
|
||||
.admin-multi-select[data-v-9a22912b]{min-width:200px;max-width:100%;position:relative}.admin-multi-select--block[data-v-9a22912b]{width:100%;min-width:0}.admin-multi-select__trigger[data-v-9a22912b]{width:100%;min-height:var(--control-height,40px);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);justify-content:space-between;align-items:center;gap:10px;padding:0 12px 0 10px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-multi-select--disabled .admin-multi-select__trigger[data-v-9a22912b]{opacity:.55;cursor:not-allowed}.admin-multi-select__trigger[data-v-9a22912b]:hover:not(:disabled){border-color:var(--color-primary);background:var(--color-elevated,var(--color-surface))}.admin-multi-select--open .admin-multi-select__trigger[data-v-9a22912b],.admin-multi-select__trigger[data-v-9a22912b]:focus-visible:not(:disabled){border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-multi-select__value[data-v-9a22912b]{text-align:start;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.admin-multi-select__chevron[data-v-9a22912b]{color:var(--color-text-muted);transition:transform var(--transition-fast);flex-shrink:0;display:inline-flex}.admin-multi-select--open .admin-multi-select__chevron[data-v-9a22912b]{color:var(--color-primary);transform:rotate(180deg)}.admin-multi-select__chips[data-v-9a22912b]{flex-wrap:wrap;gap:6px;margin:8px 0 0;padding:0;list-style:none;display:flex}.admin-multi-select__chip[data-v-9a22912b]{background:var(--color-primary-soft);max-width:100%;color:var(--color-primary);border-radius:999px;align-items:center;gap:4px;padding:4px 8px;font-size:.75rem;font-weight:600;display:inline-flex}.admin-multi-select__chip-label[data-v-9a22912b]{text-overflow:ellipsis;white-space:nowrap;max-width:220px;overflow:hidden}.admin-multi-select__chip-remove[data-v-9a22912b]{color:inherit;cursor:pointer;background:0 0;border:none;padding:0 2px;font-size:1rem;line-height:1}.admin-multi-select__menu[data-v-9a22912b]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-card,0 12px 28px #0f172a1f);box-sizing:border-box;flex-direction:column;gap:4px;margin:0;padding:8px;list-style:none;display:flex;overflow-y:auto}.admin-multi-select__search[data-v-9a22912b]{z-index:1;background:var(--color-surface);padding-bottom:4px;position:sticky;top:0}.admin-multi-select__search-input[data-v-9a22912b]{border:1px solid var(--color-border);background:var(--color-bg);width:100%;height:36px;color:var(--color-text);font:inherit;border-radius:10px;padding:0 12px;font-size:.8125rem}.admin-multi-select__search-input[data-v-9a22912b]:focus{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-multi-select__empty[data-v-9a22912b]{color:var(--color-text-muted);text-align:center;padding:12px;font-size:.8125rem}.admin-multi-select__option[data-v-9a22912b]{width:100%;color:var(--color-text);text-align:start;cursor:pointer;transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);background:0 0;border:1px solid #0000;border-radius:12px;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-multi-select__option[data-v-9a22912b]:hover{background:var(--color-bg);border-color:var(--color-border)}.admin-multi-select__option--active[data-v-9a22912b]{background:var(--color-primary-soft);color:var(--color-primary);border-color:#0000;font-weight:600}.admin-multi-select__check[data-v-9a22912b]{color:var(--color-primary);flex-shrink:0}.settings-page__grid[data-v-230ea03a]{grid-template-columns:repeat(2,1fr);gap:16px;display:grid}.settings-page__section[data-v-230ea03a]{padding:20px}.settings-page__title[data-v-230ea03a]{margin:0 0 16px;font-size:1rem;font-weight:700}.settings-page__checks[data-v-230ea03a]{flex-direction:column;gap:12px;display:flex}.settings-page__check[data-v-230ea03a]{cursor:pointer;align-items:center;gap:10px;font-size:.875rem;display:flex}.settings-page__check input[data-v-230ea03a]{width:16px;height:16px;accent-color:var(--color-primary)}.settings-page__check--block[data-v-230ea03a]{margin-bottom:12px}.settings-page__broadcast-submit[data-v-230ea03a]{margin-top:4px}.settings-page__hint[data-v-230ea03a]{color:var(--color-text-muted);margin:6px 0 0;font-size:.75rem;line-height:1.5}@media (width<=1279px){.settings-page__grid[data-v-230ea03a]{grid-template-columns:1fr}}
|
||||
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
Vendored
+1
@@ -0,0 +1 @@
|
||||
import{A as e,Ot as t,ct as n,d as r,g as i,jt as a,t as o}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{t as s}from"./orderStatus-CeC05Cv4.js";var c=o(i({__name:`StatusBadge`,props:{status:{}},setup(i){let o={active:{label:`فعال`,tone:`success`},inactive:{label:`غیرفعال`,tone:`neutral`},pending_check_review:{label:`در انتظار بررسی`,tone:`warning`},check_approved:{label:`تأیید شده`,tone:`success`},check_rejected:{label:`رد شده`,tone:`danger`}};return(c,l)=>(e(),r(`span`,{class:t([`admin-badge status-badge`,`admin-badge--${(n(s)[i.status]??o[i.status])?.tone??`neutral`}`])},a((n(s)[i.status]??o[i.status])?.label??i.status),3))}}),[[`__scopeId`,`data-v-23aa055a`]]);export{c as t};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{At as e,Dt as t,d as n,g as r,k as i,st as a,t as o}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{t as s}from"./orderStatus-CeC05Cv4.js";var c=o(r({__name:`StatusBadge`,props:{status:{}},setup(r){let o={active:{label:`فعال`,tone:`success`},inactive:{label:`غیرفعال`,tone:`neutral`},pending_check_review:{label:`در انتظار بررسی`,tone:`warning`},check_approved:{label:`تأیید شده`,tone:`success`},check_rejected:{label:`رد شده`,tone:`danger`}};return(c,l)=>(i(),n(`span`,{class:t([`admin-badge status-badge`,`admin-badge--${(a(s)[r.status]??o[r.status])?.tone??`neutral`}`])},e((a(s)[r.status]??o[r.status])?.label??r.status),3))}}),[[`__scopeId`,`data-v-23aa055a`]]);export{c as t};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{$ as e,At as t,E as n,H as r,M as i,U as a,Z as o,c as s,d as c,g as l,h as u,k as d,l as f,m as p,r as m,s as h,t as g}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as _,f as v,t as y}from"./http-BjLkjdQu.js";import{A as b,B as x,T as S,v as C}from"./index-SWzbcuqQ.js";import{t as w}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as T}from"./BaseEmptyState-Bzvl_pTa.js";import{t as E}from"./AdminSelect-6a7SFr9x.js";var D={class:`admin-page`},O={class:`admin-page__head`},k={key:2,class:`admin-table`},A={class:`muted`,dir:`ltr`},j=[`onClick`],M={class:`field`},N={class:`field`},P={class:`field`},F=[`disabled`],I=g(l({__name:`SuggestionsView`,setup(l){let g=e([]),I=e(!0),L=e([]),R=e([]),z=e(!1),B=_(),V=o({customerId:``,productId:``,note:``}),H=h(()=>L.value.map(e=>({value:e.id,label:e.name?.trim()||e.phone}))),U=h(()=>R.value.map(e=>({value:e.id,label:`${e.name} (${e.productCode})`})));async function W(){I.value=!0;try{let[e,t,n]=await Promise.all([b.list(),C.list(),S.list()]);g.value=e,L.value=t,R.value=n}catch(e){B.error(e instanceof y?e.message:`بارگذاری ناموفق بود`)}finally{I.value=!1}}async function G(){try{await b.create({customerId:V.customerId,productId:V.productId,note:V.note.trim()||void 0}),z.value=!1,V.note=``,B.success(`پیشنهاد ثبت شد`),await W()}catch(e){B.error(e instanceof y?e.message:`ثبت ناموفق بود`)}}async function K(e){try{await b.setActive(e.id,!e.isActive),await W()}catch(e){B.error(e instanceof y?e.message:`بهروزرسانی ناموفق بود`)}}return n(()=>{W()}),(e,n)=>(d(),c(`div`,D,[s(`header`,O,[n[5]||=s(`div`,null,[s(`h1`,null,`پیشنهاد محصول`),s(`p`,null,`پیشنهاد دستی محصول به مشتری`)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:n[0]||=e=>z.value=!0},`پیشنهاد جدید`)]),I.value?(d(),f(w,{key:0,variant:`table`})):g.value.length?(d(),c(`table`,k,[n[6]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`مشتری`),s(`th`,null,`محصول`),s(`th`,null,`یادداشت`),s(`th`,null,`وضعیت`),s(`th`)])],-1),s(`tbody`,null,[(d(!0),c(m,null,i(g.value,e=>(d(),c(`tr`,{key:e.id},[s(`td`,null,t(e.customerName),1),s(`td`,null,[p(t(e.productName)+` `,1),s(`span`,A,`(`+t(e.productCode)+`)`,1)]),s(`td`,null,t(e.note||`—`),1),s(`td`,null,t(e.isActive?`فعال`:`غیرفعال`),1),s(`td`,null,[s(`button`,{type:`button`,class:`link`,onClick:t=>K(e)},t(e.isActive?`غیرفعال`:`فعال`),9,j)])]))),128))])])):(d(),f(T,{key:1,title:`پیشنهادی ثبت نشده`})),u(x,{open:z.value,title:`پیشنهاد محصول`,onClose:n[4]||=e=>z.value=!1},{footer:r(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!V.customerId||!V.productId,onClick:G},` ثبت `,8,F)]),default:r(()=>[s(`label`,M,[n[7]||=p(`مشتری `,-1),u(E,{modelValue:V.customerId,"onUpdate:modelValue":n[1]||=e=>V.customerId=e,options:H.value},null,8,[`modelValue`,`options`])]),s(`label`,N,[n[8]||=p(`محصول `,-1),u(E,{modelValue:V.productId,"onUpdate:modelValue":n[2]||=e=>V.productId=e,options:U.value},null,8,[`modelValue`,`options`])]),s(`label`,P,[n[9]||=p(`یادداشت`,-1),a(s(`textarea`,{"onUpdate:modelValue":n[3]||=e=>V.note=e,class:`admin-input`,rows:`3`},null,512),[[v,V.note]])])]),_:1},8,[`open`])]))}}),[[`__scopeId`,`data-v-56e3e728`]]);export{I as default};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{A as e,D as t,N as n,Q as r,U as i,W as a,c as o,d as s,et as c,g as l,h as u,jt as d,l as f,m as p,r as m,s as h,t as g}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as _,d as v,t as y}from"./http-CTjL79ty.js";import{E as b,V as x,j as S,y as C}from"./index-DxcN1-hp.js";import{t as w}from"./AdminPageSkeleton-DacAHji8.js";import{t as T}from"./BaseEmptyState-BAIuUvAl.js";import{t as E}from"./AdminSelect-BYntBSYd.js";var D={class:`admin-page`},O={class:`admin-page__head`},k={key:2,class:`admin-table`},A={class:`muted`,dir:`ltr`},j=[`onClick`],M={class:`field`},N={class:`field`},P={class:`field`},F=[`disabled`],I=g(l({__name:`SuggestionsView`,setup(l){let g=c([]),I=c(!0),L=c([]),R=c([]),z=c(!1),B=_(),V=r({customerId:``,productId:``,note:``}),H=h(()=>L.value.map(e=>({value:e.id,label:e.name?.trim()||e.phone}))),U=h(()=>R.value.map(e=>({value:e.id,label:`${e.name} (${e.productCode})`})));async function W(){I.value=!0;try{let[e,t,n]=await Promise.all([S.list(),C.list(),b.list()]);g.value=e,L.value=t,R.value=n}catch(e){B.error(e instanceof y?e.message:`بارگذاری ناموفق بود`)}finally{I.value=!1}}async function G(){try{await S.create({customerId:V.customerId,productId:V.productId,note:V.note.trim()||void 0}),z.value=!1,V.note=``,B.success(`پیشنهاد ثبت شد`),await W()}catch(e){B.error(e instanceof y?e.message:`ثبت ناموفق بود`)}}async function K(e){try{await S.setActive(e.id,!e.isActive),await W()}catch(e){B.error(e instanceof y?e.message:`بهروزرسانی ناموفق بود`)}}return t(()=>{W()}),(t,r)=>(e(),s(`div`,D,[o(`header`,O,[r[5]||=o(`div`,null,[o(`h1`,null,`پیشنهاد محصول`),o(`p`,null,`پیشنهاد دستی محصول به مشتری`)],-1),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:r[0]||=e=>z.value=!0},`پیشنهاد جدید`)]),I.value?(e(),f(w,{key:0,variant:`table`})):g.value.length?(e(),s(`table`,k,[r[6]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`مشتری`),o(`th`,null,`محصول`),o(`th`,null,`یادداشت`),o(`th`,null,`وضعیت`),o(`th`)])],-1),o(`tbody`,null,[(e(!0),s(m,null,n(g.value,t=>(e(),s(`tr`,{key:t.id},[o(`td`,null,d(t.customerName),1),o(`td`,null,[p(d(t.productName)+` `,1),o(`span`,A,`(`+d(t.productCode)+`)`,1)]),o(`td`,null,d(t.note||`—`),1),o(`td`,null,d(t.isActive?`فعال`:`غیرفعال`),1),o(`td`,null,[o(`button`,{type:`button`,class:`link`,onClick:e=>K(t)},d(t.isActive?`غیرفعال`:`فعال`),9,j)])]))),128))])])):(e(),f(T,{key:1,title:`پیشنهادی ثبت نشده`})),u(x,{open:z.value,title:`پیشنهاد محصول`,onClose:r[4]||=e=>z.value=!1},{footer:i(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!V.customerId||!V.productId,onClick:G},` ثبت `,8,F)]),default:i(()=>[o(`label`,M,[r[7]||=p(`مشتری `,-1),u(E,{modelValue:V.customerId,"onUpdate:modelValue":r[1]||=e=>V.customerId=e,options:H.value},null,8,[`modelValue`,`options`])]),o(`label`,N,[r[8]||=p(`محصول `,-1),u(E,{modelValue:V.productId,"onUpdate:modelValue":r[2]||=e=>V.productId=e,options:U.value},null,8,[`modelValue`,`options`])]),o(`label`,P,[r[9]||=p(`یادداشت`,-1),a(o(`textarea`,{"onUpdate:modelValue":r[3]||=e=>V.note=e,class:`admin-input`,rows:`3`},null,512),[[v,V.note]])])]),_:1},8,[`open`])]))}}),[[`__scopeId`,`data-v-56e3e728`]]);export{I as default};
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
.users-page__search[data-v-62273fa5]{color:var(--color-text-muted);align-items:center;gap:10px;margin-bottom:16px;padding:10px 14px;display:flex}.users-page__search-input[data-v-62273fa5]{background:0 0;border:none;outline:none;flex:1;font-size:.875rem}.users-page__table[data-v-62273fa5]{overflow:hidden}
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
@@ -1 +0,0 @@
|
||||
.users-page__search[data-v-345a9659]{color:var(--color-text-muted);align-items:center;gap:10px;margin-bottom:16px;padding:10px 14px;display:flex}.users-page__search-input[data-v-345a9659]{background:0 0;border:none;outline:none;flex:1;font-size:.875rem}.users-page__table[data-v-345a9659]{overflow:hidden}
|
||||
Vendored
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
var e={wholesale:`عمدهفروش`,retail:`خردهفروش`},t={admin:`مدیر سیستم`,sales:`واحد فروش`,finance:`واحد مالی`,warehouse:`انبار`},n={pending_review:`در انتظار تأیید`,approved:`تأیید شده`,rejected:`رد شده`,expired:`منقضیشده`},r={pending_review:`admin-badge--warning`,approved:`admin-badge--success`,rejected:`admin-badge--danger`,expired:`admin-badge--neutral`},i={preparing:`در حال آمادهسازی`,ready:`آماده ارسال`,shipped:`ارسال شده`,delivered:`تحویل شده`},a={preparing:`admin-badge--warning`,ready:`admin-badge--info`,shipped:`admin-badge--purple`,delivered:`admin-badge--success`};export{i as a,a as i,n,t as o,e as r,r as t};
|
||||
var e={wholesale:`عمدهفروش`,retail:`خردهفروش`},t={admin:`مدیر سیستم`,sales:`واحد فروش`,finance:`واحد مالی`,warehouse:`انبار`},n={pending_review:`در انتظار تأیید`,approved:`تأیید شده`,rejected:`رد شده`,expired:`منقضیشده`},r={pending_review:`admin-badge--warning`,approved:`admin-badge--success`,rejected:`admin-badge--danger`,expired:`admin-badge--neutral`},i={preparing:`در حال آمادهسازی`,ready:`آماده ارسال`,shipped:`ارسال شده`,delivered:`تحویل شده`},a={preparing:`admin-badge--warning`,ready:`admin-badge--info`,shipped:`admin-badge--purple`,delivered:`admin-badge--success`},o={new:`درخواست جدید`,approved:`تأیید شده`,ready_to_ship:`آماده ارسال`,delivered:`تحویل به مشتری`,returned:`بازگردانده شده`,cancelled:`لغو شده`};export{a,e as i,n,i as o,o as r,t as s,r as t};
|
||||
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
import{l as e}from"./index-DxcN1-hp.js";function t(t){return e(t).toLowerCase().replace(/ي/g,`ی`).replace(/ك/g,`ک`).normalize(`NFKC`).trim()}function n(e,n){let r=t(n);return!r||t(e).includes(r)}function r(e,t){let r=t.trim();return r?e.filter(e=>n(e.label,r)):e}function i(e,t){if(!e)return;let n=e.querySelectorAll(`[data-select-option]`);(t===`first`?n[0]:n[n.length-1])?.focus()}function a(e,t){let n=e.closest(`[data-select-menu]`);if(!n)return;let r=[...n.querySelectorAll(`[data-select-option]`)],i=r.indexOf(e);i<0||r[i+t]?.focus()}export{a as n,i as r,r as t};
|
||||
Vendored
+4
-4
@@ -11,10 +11,10 @@
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>پنل مدیریت | پارچه</title>
|
||||
<script type="module" crossorigin src="/admin/assets/index-SWzbcuqQ.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/admin/assets/_plugin-vue_export-helper-QrIvvHC8.js">
|
||||
<link rel="modulepreload" crossorigin href="/admin/assets/http-BjLkjdQu.js">
|
||||
<link rel="stylesheet" crossorigin href="/admin/assets/index-CrGJrAMi.css">
|
||||
<script type="module" crossorigin src="/admin/assets/index-DxcN1-hp.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/admin/assets/_plugin-vue_export-helper-vx-p5QAT.js">
|
||||
<link rel="modulepreload" crossorigin href="/admin/assets/http-CTjL79ty.js">
|
||||
<link rel="stylesheet" crossorigin href="/admin/assets/index-7MPoiPI4.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/* Admin top bar — very narrow phones (< 460px) */
|
||||
|
||||
@media (max-width: 460px) {
|
||||
:root {
|
||||
--header-height: 56px;
|
||||
--admin-header-control: 36px;
|
||||
}
|
||||
|
||||
.admin-header {
|
||||
height: var(--header-height);
|
||||
min-height: var(--header-height);
|
||||
padding: 0 10px;
|
||||
gap: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.admin-header__menu-btn {
|
||||
width: var(--admin-header-control);
|
||||
height: var(--admin-header-control);
|
||||
}
|
||||
|
||||
.admin-header__left {
|
||||
flex: 1;
|
||||
justify-content: flex-end;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.sms-credit {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.admin-header__dropdown--messages,
|
||||
.admin-header__dropdown--notifications {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.admin-header__icon-btn {
|
||||
min-width: var(--admin-header-control);
|
||||
width: var(--admin-header-control);
|
||||
height: var(--admin-header-control);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.admin-header__avatar {
|
||||
width: var(--admin-header-control);
|
||||
height: var(--admin-header-control);
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
}
|
||||
@@ -59,6 +59,7 @@ const ICON_MAP: Record<string, string> = {
|
||||
user: 'vuesax-linear:profile-circle',
|
||||
building: 'vuesax-linear:building',
|
||||
trash: 'vuesax-linear:trash',
|
||||
close: 'vuesax-linear:close-circle',
|
||||
}
|
||||
|
||||
const iconKey = computed(() => {
|
||||
|
||||
@@ -823,6 +823,12 @@ async function copyDeposit(value: string) {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 460px) {
|
||||
.sms-credit {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.sms-credit {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -8,8 +8,10 @@ const props = withDefaults(
|
||||
label?: string
|
||||
/** دکمهٔ حذف تصویر (مثلاً برای رنگبندی که فقط «حذف رنگ» داریم) */
|
||||
showRemove?: boolean
|
||||
/** چیدمان فشرده برای داخل ردیفهای فرم (بدون برچسب، پیشنمایش کلیکپذیر) */
|
||||
compact?: boolean
|
||||
}>(),
|
||||
{ showRemove: true },
|
||||
{ showRemove: true, compact: false },
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -49,20 +51,42 @@ function remove() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="image-picker">
|
||||
<p v-if="label" class="image-picker__label">{{ label }}</p>
|
||||
<div class="image-picker" :class="{ 'image-picker--compact': compact }">
|
||||
<p v-if="label && !compact" class="image-picker__label">{{ label }}</p>
|
||||
<div class="image-picker__row">
|
||||
<button
|
||||
v-if="compact"
|
||||
type="button"
|
||||
class="image-picker__preview-hit"
|
||||
:disabled="busy"
|
||||
:aria-label="props.modelValue ? 'تغییر تصویر' : 'افزودن تصویر'"
|
||||
@click="openPicker"
|
||||
>
|
||||
<img
|
||||
v-if="props.modelValue"
|
||||
:src="props.modelValue"
|
||||
alt=""
|
||||
class="image-picker__preview image-picker__preview-img"
|
||||
/>
|
||||
<span v-else class="image-picker__preview image-picker__preview--empty" aria-hidden="true" />
|
||||
</button>
|
||||
<div
|
||||
v-else
|
||||
class="image-picker__preview"
|
||||
:class="{ 'image-picker__preview--empty': !props.modelValue }"
|
||||
:style="props.modelValue ? { backgroundImage: toCssBackgroundUrl(props.modelValue) } : undefined"
|
||||
/>
|
||||
<div class="image-picker__actions">
|
||||
<button type="button" class="admin-btn admin-btn--outline admin-btn--sm" :disabled="busy" @click="openPicker">
|
||||
<button
|
||||
type="button"
|
||||
:class="compact ? 'admin-btn admin-btn--ghost admin-btn--sm image-picker__change' : 'admin-btn admin-btn--outline admin-btn--sm'"
|
||||
:disabled="busy"
|
||||
@click="openPicker"
|
||||
>
|
||||
{{ props.modelValue ? 'تغییر تصویر' : 'افزودن تصویر' }}
|
||||
</button>
|
||||
<button
|
||||
v-if="props.showRemove && props.modelValue"
|
||||
v-if="!compact && props.showRemove && props.modelValue"
|
||||
type="button"
|
||||
class="admin-btn admin-btn--outline admin-btn--sm"
|
||||
:disabled="busy"
|
||||
@@ -71,7 +95,7 @@ function remove() {
|
||||
حذف
|
||||
</button>
|
||||
<p v-if="error" class="image-picker__error">{{ error }}</p>
|
||||
<p v-else-if="picked" class="image-picker__ok">تصویر انتخاب شد — برای ثبت نهایی «ثبت» را بزنید.</p>
|
||||
<p v-else-if="picked && !compact" class="image-picker__ok">تصویر انتخاب شد — برای ثبت نهایی «ثبت» را بزنید.</p>
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
@@ -98,12 +122,18 @@ function remove() {
|
||||
}
|
||||
|
||||
.image-picker__preview {
|
||||
display: block;
|
||||
width: 88px;
|
||||
height: 72px;
|
||||
border-radius: 10px;
|
||||
background: #e8eceb center / cover no-repeat;
|
||||
flex-shrink: 0;
|
||||
border: 1px solid var(--color-border);
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.image-picker__preview-img {
|
||||
background: #e8eceb;
|
||||
}
|
||||
|
||||
.image-picker__preview--empty {
|
||||
@@ -141,4 +171,43 @@ function remove() {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.image-picker--compact .image-picker__row {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.image-picker__preview-hit {
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
border-radius: 10px;
|
||||
flex-shrink: 0;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.image-picker__preview-hit:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
.image-picker__preview-hit:focus-visible {
|
||||
outline: 2px solid var(--color-primary, #2d6a4f);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.image-picker--compact .image-picker__preview {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.image-picker--compact .image-picker__change {
|
||||
font-weight: 600;
|
||||
color: var(--color-primary, #2d6a4f);
|
||||
}
|
||||
|
||||
.image-picker--compact .image-picker__error {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
|
||||
import { onClickOutside } from '@vueuse/core'
|
||||
import AdminIcon from '@/components/icons/AdminIcon.vue'
|
||||
import {
|
||||
filterSelectOptionsBySearch,
|
||||
focusAdjacentSelectOption,
|
||||
focusSelectMenuOption,
|
||||
} from '@/utils/selectOptionSearch'
|
||||
|
||||
export type AdminMultiSelectOption = {
|
||||
value: string
|
||||
@@ -42,33 +47,67 @@ const menuRef = ref<HTMLElement | null>(null)
|
||||
const searchInputRef = ref<HTMLInputElement | null>(null)
|
||||
const menuStyle = ref<Record<string, string>>({})
|
||||
|
||||
function closeMenu() {
|
||||
open.value = false
|
||||
searchQuery.value = ''
|
||||
}
|
||||
|
||||
onClickOutside(
|
||||
rootRef,
|
||||
() => {
|
||||
open.value = false
|
||||
searchQuery.value = ''
|
||||
closeMenu()
|
||||
},
|
||||
{ ignore: [menuRef] },
|
||||
)
|
||||
|
||||
const selectedSet = computed(() => new Set(props.modelValue))
|
||||
const modelValues = computed(() =>
|
||||
Array.isArray(props.modelValue) ? props.modelValue : [],
|
||||
)
|
||||
|
||||
const selectedSet = computed(() => new Set(modelValues.value))
|
||||
|
||||
const optionList = computed(() =>
|
||||
Array.isArray(props.options) ? props.options : [],
|
||||
)
|
||||
|
||||
const selectedOptions = computed(() =>
|
||||
props.options.filter((option) => selectedSet.value.has(option.value)),
|
||||
optionList.value.filter((option) => selectedSet.value.has(option.value)),
|
||||
)
|
||||
|
||||
const triggerLabel = computed(() => {
|
||||
const n = props.modelValue.length
|
||||
const n = modelValues.value.length
|
||||
if (!n) return props.placeholder
|
||||
if (n === 1) return selectedOptions.value[0]?.label ?? props.placeholder
|
||||
return `${n} مورد انتخاب شده`
|
||||
})
|
||||
|
||||
const filteredOptions = computed(() => {
|
||||
const q = searchQuery.value.trim().toLowerCase()
|
||||
if (!q) return props.options
|
||||
return props.options.filter((option) => option.label.toLowerCase().includes(q))
|
||||
})
|
||||
const filteredOptions = computed(() =>
|
||||
filterSelectOptionsBySearch(optionList.value, searchQuery.value),
|
||||
)
|
||||
|
||||
function onSearchKeydown(event: KeyboardEvent) {
|
||||
if (event.key === 'ArrowDown') {
|
||||
event.preventDefault()
|
||||
focusSelectMenuOption(menuRef.value, 'first')
|
||||
} else if (event.key === 'ArrowUp') {
|
||||
event.preventDefault()
|
||||
focusSelectMenuOption(menuRef.value, 'last')
|
||||
}
|
||||
}
|
||||
|
||||
function onOptionKeydown(event: KeyboardEvent, value: string) {
|
||||
const target = event.currentTarget as HTMLElement
|
||||
if (event.key === 'ArrowDown') {
|
||||
event.preventDefault()
|
||||
focusAdjacentSelectOption(target, 1)
|
||||
} else if (event.key === 'ArrowUp') {
|
||||
event.preventDefault()
|
||||
focusAdjacentSelectOption(target, -1)
|
||||
} else if (event.key === 'Enter' || event.key === ' ') {
|
||||
event.preventDefault()
|
||||
toggleOption(value)
|
||||
}
|
||||
}
|
||||
|
||||
function updateMenuPosition() {
|
||||
const el = rootRef.value
|
||||
@@ -113,10 +152,10 @@ async function toggle() {
|
||||
if (props.disabled) return
|
||||
open.value = !open.value
|
||||
if (open.value) {
|
||||
searchQuery.value = ''
|
||||
await nextTick()
|
||||
updateMenuPosition()
|
||||
if (props.searchable) {
|
||||
searchQuery.value = ''
|
||||
await nextTick()
|
||||
searchInputRef.value?.focus()
|
||||
}
|
||||
@@ -124,7 +163,7 @@ async function toggle() {
|
||||
}
|
||||
|
||||
function toggleOption(value: string) {
|
||||
const next = new Set(props.modelValue)
|
||||
const next = new Set(modelValues.value)
|
||||
if (next.has(value)) next.delete(value)
|
||||
else next.add(value)
|
||||
emit('update:modelValue', [...next])
|
||||
@@ -133,7 +172,7 @@ function toggleOption(value: string) {
|
||||
function removeChip(value: string) {
|
||||
emit(
|
||||
'update:modelValue',
|
||||
props.modelValue.filter((id) => id !== value),
|
||||
modelValues.value.filter((id) => id !== value),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -144,7 +183,15 @@ watch(open, (isOpen) => {
|
||||
}
|
||||
})
|
||||
|
||||
watch(
|
||||
() => props.disabled,
|
||||
(isDisabled) => {
|
||||
if (isDisabled) closeMenu()
|
||||
},
|
||||
)
|
||||
|
||||
onUnmounted(() => {
|
||||
closeMenu()
|
||||
bindPositionListeners(false)
|
||||
})
|
||||
</script>
|
||||
@@ -191,9 +238,10 @@ onUnmounted(() => {
|
||||
|
||||
<Teleport to="body">
|
||||
<ul
|
||||
v-if="open"
|
||||
v-if="open && !disabled"
|
||||
ref="menuRef"
|
||||
class="admin-multi-select__menu"
|
||||
data-select-menu
|
||||
role="listbox"
|
||||
:aria-label="ariaLabel"
|
||||
:style="menuStyle"
|
||||
@@ -208,6 +256,7 @@ onUnmounted(() => {
|
||||
:placeholder="searchPlaceholder"
|
||||
@click.stop
|
||||
@keydown.esc.stop="open = false"
|
||||
@keydown="onSearchKeydown"
|
||||
/>
|
||||
</li>
|
||||
<li v-if="!filteredOptions.length" class="admin-multi-select__empty" role="presentation">
|
||||
@@ -218,9 +267,11 @@ onUnmounted(() => {
|
||||
type="button"
|
||||
class="admin-multi-select__option"
|
||||
:class="{ 'admin-multi-select__option--active': selectedSet.has(option.value) }"
|
||||
data-select-option
|
||||
role="option"
|
||||
:aria-selected="selectedSet.has(option.value)"
|
||||
@click="toggleOption(option.value)"
|
||||
@keydown="onOptionKeydown($event, option.value)"
|
||||
>
|
||||
<span class="admin-multi-select__option-label">{{ option.label }}</span>
|
||||
<AdminIcon
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
|
||||
import { onClickOutside } from '@vueuse/core'
|
||||
import AdminIcon from '@/components/icons/AdminIcon.vue'
|
||||
import {
|
||||
filterSelectOptionsBySearch,
|
||||
focusAdjacentSelectOption,
|
||||
focusSelectMenuOption,
|
||||
} from '@/utils/selectOptionSearch'
|
||||
|
||||
export type AdminSelectOption = {
|
||||
value: string
|
||||
@@ -23,7 +28,7 @@ const props = withDefaults(
|
||||
placeholder: 'انتخاب کنید',
|
||||
ariaLabel: 'انتخاب',
|
||||
block: false,
|
||||
searchable: false,
|
||||
searchable: true,
|
||||
searchPlaceholder: 'جستجو…',
|
||||
id: undefined,
|
||||
},
|
||||
@@ -55,11 +60,33 @@ const selectedOption = computed(() =>
|
||||
|
||||
const selectedLabel = computed(() => selectedOption.value?.label ?? props.placeholder)
|
||||
|
||||
const filteredOptions = computed(() => {
|
||||
const q = searchQuery.value.trim().toLowerCase()
|
||||
if (!q) return props.options
|
||||
return props.options.filter((option) => option.label.toLowerCase().includes(q))
|
||||
})
|
||||
const filteredOptions = computed(() =>
|
||||
filterSelectOptionsBySearch(props.options, searchQuery.value),
|
||||
)
|
||||
|
||||
function onSearchKeydown(event: KeyboardEvent) {
|
||||
if (event.key === 'ArrowDown') {
|
||||
event.preventDefault()
|
||||
focusSelectMenuOption(menuRef.value, 'first')
|
||||
} else if (event.key === 'ArrowUp') {
|
||||
event.preventDefault()
|
||||
focusSelectMenuOption(menuRef.value, 'last')
|
||||
}
|
||||
}
|
||||
|
||||
function onOptionKeydown(event: KeyboardEvent, value: string) {
|
||||
const target = event.currentTarget as HTMLElement
|
||||
if (event.key === 'ArrowDown') {
|
||||
event.preventDefault()
|
||||
focusAdjacentSelectOption(target, 1)
|
||||
} else if (event.key === 'ArrowUp') {
|
||||
event.preventDefault()
|
||||
focusAdjacentSelectOption(target, -1)
|
||||
} else if (event.key === 'Enter' || event.key === ' ') {
|
||||
event.preventDefault()
|
||||
pick(value)
|
||||
}
|
||||
}
|
||||
|
||||
function updateMenuPosition() {
|
||||
const el = rootRef.value
|
||||
@@ -103,10 +130,10 @@ function bindPositionListeners(active: boolean) {
|
||||
async function toggle() {
|
||||
open.value = !open.value
|
||||
if (open.value) {
|
||||
searchQuery.value = ''
|
||||
await nextTick()
|
||||
updateMenuPosition()
|
||||
if (props.searchable) {
|
||||
searchQuery.value = ''
|
||||
await nextTick()
|
||||
searchInputRef.value?.focus()
|
||||
}
|
||||
@@ -160,6 +187,7 @@ onUnmounted(() => {
|
||||
v-if="open"
|
||||
ref="menuRef"
|
||||
class="admin-select__menu"
|
||||
data-select-menu
|
||||
role="listbox"
|
||||
:aria-label="ariaLabel"
|
||||
:style="menuStyle"
|
||||
@@ -173,6 +201,7 @@ onUnmounted(() => {
|
||||
:placeholder="searchPlaceholder"
|
||||
@click.stop
|
||||
@keydown.esc.stop="open = false"
|
||||
@keydown="onSearchKeydown"
|
||||
/>
|
||||
</li>
|
||||
<li v-if="!filteredOptions.length" class="admin-select__empty" role="presentation">
|
||||
@@ -183,9 +212,11 @@ onUnmounted(() => {
|
||||
type="button"
|
||||
class="admin-select__option"
|
||||
:class="{ 'admin-select__option--active': option.value === modelValue }"
|
||||
data-select-option
|
||||
role="option"
|
||||
:aria-selected="option.value === modelValue"
|
||||
@click="pick(option.value)"
|
||||
@keydown="onOptionKeydown($event, option.value)"
|
||||
>
|
||||
<span class="admin-select__option-label">
|
||||
<slot name="option-leading" :option="option" />
|
||||
|
||||
@@ -18,6 +18,8 @@ const props = defineProps<{
|
||||
hint?: string
|
||||
error?: string
|
||||
disabled?: boolean
|
||||
/** فشرده برای نوار ابزار (بدون برچسب بلند، پنل تقویم با عرض ثابت) */
|
||||
compact?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -120,7 +122,11 @@ onBeforeUnmount(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div ref="rootRef" class="form-group persian-date-input">
|
||||
<div
|
||||
ref="rootRef"
|
||||
class="form-group persian-date-input"
|
||||
:class="{ 'persian-date-input--compact': compact }"
|
||||
>
|
||||
<label v-if="label" class="form-label">{{ label }}</label>
|
||||
|
||||
<button
|
||||
@@ -333,4 +339,42 @@ onBeforeUnmount(() => {
|
||||
background: var(--color-primary-soft);
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.persian-date-input--compact .form-label {
|
||||
font-size: 0.75rem;
|
||||
margin-bottom: 4px;
|
||||
color: var(--color-text-muted);
|
||||
}
|
||||
|
||||
.persian-date-input--compact .persian-date-input__trigger {
|
||||
height: 36px;
|
||||
padding: 0 10px;
|
||||
font-size: 0.8125rem;
|
||||
border-radius: 8px;
|
||||
background: var(--color-elevated);
|
||||
}
|
||||
|
||||
.persian-date-input--compact .persian-date-input__icon svg {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.persian-date-input--compact .persian-date-input__panel {
|
||||
left: auto;
|
||||
right: 0;
|
||||
width: min(292px, calc(100vw - 24px));
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.persian-date-input--compact .persian-date-input__cell {
|
||||
height: 32px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.persian-date-input--compact .persian-date-input__nav {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { companiesApi, customersApi, mapAdminOrder, ordersApi } from '@/services
|
||||
import { ApiError } from '@/services/http'
|
||||
import type { Company, Customer, Order, RawOrderStatus } from '@/types'
|
||||
import { ORDER_TABS, rawStatusLabel } from '@/utils/orderStatus'
|
||||
import { settlementMethodLabel } from '@/utils/settlement'
|
||||
|
||||
import { useToast } from '@/composables/useToast'
|
||||
|
||||
@@ -193,8 +194,7 @@ export function useOrdersPage() {
|
||||
}
|
||||
|
||||
function settlementLabel(method?: string | null) {
|
||||
if (!method) return 'انتخابنشده'
|
||||
return method === 'check' ? 'چکی' : 'نقدی'
|
||||
return settlementMethodLabel(method)
|
||||
}
|
||||
|
||||
const statusSaving = ref(false)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user