← Back
Editing: feature-FilePicker-legacy.js
(function(){System.register([`./rolldown-runtime-legacy.js?v=1795169270504`,`./vendor-utils-legacy.js?v=1795169270504`,`./vendor-vue-legacy.js?v=1795169270504`,`./vendor-naive-legacy.js?v=1795169270504`,`./app-legacy.js?v=1795169270504`,`./app-shared-legacy.js?v=1795169270504`],function(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,ee,te,y,ne,b,x,S,C,re,w,ie,ae,oe,se,ce,T,E,D,O,le,ue,k,de,A,j,M,N,fe,pe,P,F,I,L,R,me,z,B,V,he,H,U,W,G,ge,K,q,_e,J,ve,Y,X,Z,Q,ye;function $(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function be(e){if(Array.isArray(e))return e}function xe(e){if(Array.isArray(e))return $(e)}function Se(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Ce(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Se(a,r,i,o,s,`next`,e)}function s(e){Se(a,r,i,o,s,`throw`,e)}o(void 0)})}}function we(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Te(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function Ee(){throw TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function De(){throw TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oe(e,t){return be(e)||Te(e,t)||je(e,t)||Ee()}function ke(e){return xe(e)||we(e)||je(e)||De()}function Ae(e,t){var n,r,i,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype),s=Object.defineProperty;return s(o,`next`,{value:c(0)}),s(o,`throw`,{value:c(1)}),s(o,`return`,{value:c(2)}),typeof Symbol==`function`&&s(o,Symbol.iterator,{value:function(){return this}}),o;function c(e){return function(t){return l([e,t])}}function l(s){if(n)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=s[0]&2?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){a=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(s[0]===6&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function je(e,t){if(e){if(typeof e==`string`)return $(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(n);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(e,t)}}function Me(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!B(e)}return e({n:void 0,t:void 0}),{setters:[function(e){u=e.r},function(e){o=e._n,E=e.Sn,D=e.Cn,O=e.wn,le=e.Tn,k=e.En,A=e.kn,j=e.An,M=e.Mn,F=e.gr,I=e.Ln,L=e.ln,R=e.Br,z=e.yr,B=e.zn,V=e.Bn,U=e.Hn,W=e.Zn,G=e.wr,ge=e.$n,K=e.ii,q=e.Mr,J=e.sr,ve=e.m,Y=e.lr,X=e.pn,Z=e.fr,Q=e.pr,ye=e.mn},function(e){_e=e.l},function(e){n=e._t,r=e.q,i=e.J,a=e.X,s=e.wt,c=e.Tt,l=e.x},function(e){T=e.Jf,fe=e.op,me=e.Op},function(e){ue=e.Kd,de=e.qd,pe=e.Qd}],execute:function(){d=document.createElement(`style`),d.textContent=`.path-list[data-v-217193a6]{border-top:1px solid var(--color-border);border-bottom:1px solid var(--color-border);cursor:text;flex:1;display:flex;overflow:hidden}.path-list .path-item[data-v-217193a6]{white-space:nowrap;cursor:pointer;flex-shrink:0;align-items:center;height:100%;transition:background-color .3s cubic-bezier(.4,0,.2,1);display:flex}.path-list .path-item .path-dir[data-v-217193a6]{height:100%;color:var(--color-text-4);border-left:1px solid transparent;align-items:center;padding:0 6px;line-height:1;transition:border-color .3s cubic-bezier(.4,0,.2,1);display:flex}.path-list .path-item .path-arrow[data-v-217193a6]{border-left:1px solid transparent;border-right:1px solid transparent;align-items:center;height:100%;padding:0 2px;font-size:14px;transition:border-color .3s cubic-bezier(.4,0,.2,1);display:flex}.path-list .path-item .path-arrow.reversal i[data-v-217193a6]{transform:rotate(180deg)}.path-list .path-item[data-v-217193a6]:hover{background-color:var(--button-bg-hover)}.path-list .path-item:hover .path-dir[data-v-217193a6],.path-list .path-item:hover .path-arrow[data-v-217193a6]{border-left:var(--button-border-hover)}.path-list .path-item:hover .path-arrow[data-v-217193a6]{border-right:var(--button-border-hover)}.nav-btn[data-v-217193a6]{width:36px;padding:0}.n-data-table[data-v-b213fb92]{--n-border-radius:0}.n-data-table[data-v-b213fb92] .n-data-table-base-table-body .selected-row .n-data-table-td{background-color:var(--color-table-td-hover)}.folder-picker[data-v-b213fb92]{flex-direction:column;height:100%;display:flex}.folder-picker .header[data-v-b213fb92]{border-bottom:1px solid var(--color-border);flex-direction:column;gap:16px;padding:16px;display:flex}.folder-picker .header .header-content[data-v-b213fb92]{justify-content:space-between;align-items:center;gap:16px;display:flex}.folder-picker .header .navigator-wrapper[data-v-b213fb92]{flex:1;overflow:hidden}.folder-picker .header .search-wrapper[data-v-b213fb92]{flex-shrink:0;width:240px}.folder-picker .header .search-wrapper .search-icon[data-v-b213fb92]{cursor:pointer;color:var(--color-text-4);font-size:16px}.folder-picker .header .toolbar[data-v-b213fb92]{align-items:center;gap:12px;display:flex}.folder-picker .main-content[data-v-b213fb92]{flex:1;display:flex;overflow:hidden}.folder-picker .main-content .sidebar[data-v-b213fb92]{border-right:1px solid var(--color-border);flex-direction:column;width:160px;padding:12px 0;display:flex}.folder-picker .main-content .sidebar .dist-list .dist-item[data-v-b213fb92]{cursor:pointer;align-items:center;gap:8px;padding:8px 8px 8px 16px;line-height:1;transition:background-color .3s;display:flex}.folder-picker .main-content .sidebar .dist-list .dist-item[data-v-b213fb92]:hover{background-color:var(--color-bg-1)}.folder-picker .main-content .sidebar .dist-list .dist-item .disk-icon[data-v-b213fb92]{color:var(--color-text-4);font-size:18px}.folder-picker .main-content .sidebar .dist-list .dist-item .item-info[data-v-b213fb92]{flex:1;align-items:center;gap:4px;width:0;display:flex}.folder-picker .main-content .sidebar .dist-list .dist-item .item-info .name[data-v-b213fb92]{min-width:0}.folder-picker .main-content .sidebar .dist-list .dist-item .item-info .size[data-v-b213fb92]{white-space:nowrap}.folder-picker .main-content .file-list-container[data-v-b213fb92]{flex-direction:column;flex:1;display:flex;overflow:hidden}.folder-picker .main-content .file-list-container .file-table[data-v-b213fb92]{flex:1}.folder-picker .folder-picker-footer[data-v-b213fb92]{background-color:var(--modal-action-bg);border-top:1px solid var(--modal-action-top-border);border-bottom-left-radius:var(--n-border-radius);border-bottom-right-radius:var(--n-border-radius);justify-content:space-between;align-items:center;padding:10px 18px;display:flex} /*$vite$:1*/`,document.head.appendChild(d),I(),F(),L(),R(),p={class:`path-dir`},x=[`onClick`],C={class:`path-dir`},w={class:`flex-1`},H=M({__name:`navigator`,props:{path:{default:``},pathModifiers:{}},emits:V([`change`,`refresh`],[`update:path`]),setup:function(e,t){var r=t.emit,a=_e().t,l=J(e,`path`),u=Y(`pathListRef`),d=G(``),f=G(0);ve(u,function(e){var t=Oe(e,1)[0];t&&(f.value=t.contentRect.width)});var m=E(function(){return l.value.split(`/`).filter(Boolean).map(function(e,t){return{name:e,originalIndex:t}})}),h=function(e){return`/`.concat(m.value.slice(0,Math.max(0,e)).map(function(e){return e.name}).join(`/`))},g={rootItem:80,arrow:20,padding:12,maxText:150,char:8},_=E(function(){if(!f.value||m.value.length===0)return m.value;var e=f.value-g.rootItem,t=ke(m.value).reverse(),n=[],r=!0,i=!1,a=void 0;try{for(var o=t[Symbol.iterator](),s;!(r=(s=o.next()).done);r=!0){var c=s.value,l=Math.min(c.name.length*g.char,g.maxText)+g.arrow+g.padding;if(e<l)break;n.unshift(c),e-=l}}catch(e){i=!0,a=e}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}),v=E(function(){return _.value.length<m.value.length}),ee=E(function(){var e=m.value.map(function(e){return{key:e.originalIndex,label:e.name,icon:function(){return j(`i`,{class:`i-custom:file-dir text-16px`},null)}}});return e.unshift({key:`/`,label:a(`FolderPicker.RootDir`),icon:function(){return j(`i`,{class:`i-custom:file-dir text-16px`},null)}}),e}),te=function(){l.value=h(m.value.length-1),r(`change`,l.value)},y=function(e,t){typeof e==`number`?l.value=h(e+1):e===`/`&&(l.value=`/`),r(`change`,l.value),t==null||t.stopPropagation()},ne=function(e){y(e)},b=G(!0),S=Y(`inputRef`),re=function(){return Ce(function(){var e;return Ae(this,function(t){switch(t.label){case 0:return b.value=!1,d.value=l.value,[4,U()];case 1:return t.sent(),(e=S.value)==null||e.focus(),[2]}})})()},ie=function(){b.value=!0,d.value!==l.value&&(l.value=d.value,r(`change`,d.value))},ae=function(){var e;(e=S.value)==null||e.blur()},oe=function(){r(`refresh`)};return function(e,t){var r=n,l=i,f=c,m=s;return W(),O(m,null,{default:Z(function(){return[j(r,{class:`nav-btn`,onClick:te},{default:Z(function(){return ke(t[3]||(t[3]=[D(`i`,{class:`i-common-back text-14px`},null,-1)]))}),_:1}),Q(D(`div`,{ref_key:`pathListRef`,ref:u,class:`path-list`,onClick:re},[j(l,{trigger:`click`,placement:`bottom-start`,options:q(ee),onSelect:ne},{default:Z(function(){return[Q(D(`div`,{class:`path-item`,onClick:t[0]||(t[0]=function(e){return e.stopPropagation()})},ke(t[4]||(t[4]=[D(`div`,{class:`path-dir`},[D(`i`,{class:`i-file-dir text-16px`})],-1),D(`div`,{class:`path-arrow reversal`},[D(`i`,{class:`i-common-arrow-right`})],-1)])),512),[[X,q(v)]])]}),_:1},8,[`options`]),Q(D(`div`,{class:`path-item`,onClick:t[1]||(t[1]=function(e){return y(`/`,e)})},[D(`div`,p,K(q(a)(`FolderPicker.RootDir`)),1),t[5]||(t[5]=D(`div`,{class:`path-arrow`},[D(`i`,{class:`i-common-arrow-right`})],-1))],512),[[X,!q(v)]]),(W(!0),k(o,null,ge(q(_),function(e,n){return W(),k(`div`,{key:``.concat(e.name,`_`,n),class:`path-item`,onClick:function(t){return y(e.originalIndex,t)}},[D(`div`,C,K(e.name),1),t[6]||(t[6]=D(`div`,{class:`path-arrow`},[D(`i`,{class:`i-common-arrow-right`})],-1))],8,x)}),128))],512),[[X,q(b)]]),Q(D(`div`,w,[j(f,{ref_key:`inputRef`,ref:S,value:q(d),"onUpdate:value":t[2]||(t[2]=function(e){return z(d)?d.value=e:null}),placeholder:q(a)(`FolderPicker.PathPlaceholder`),onBlur:ie,onKeydown:ye(ae,[`enter`])},null,8,[`value`,`placeholder`])],512),[[X,!q(b)]]),j(r,{class:`nav-btn`,onClick:oe},{default:Z(function(){return ke(t[7]||(t[7]=[D(`i`,{class:`i-common-refresh text-14px`},null,-1)]))}),_:1})]}),_:1})}}}),e(`n`,he=T(H,[[`__scopeId`,`data-v-217193a6`]])),I(),F(),L(),R(),f={class:`folder-picker`},b={class:`header`},S={class:`header-content`},re={class:`navigator-wrapper`},ie={class:`search-wrapper`},ae={class:`toolbar`},oe={class:`main-content`},se={class:`sidebar`},ce={class:`dist-list`},m=[`onClick`],h={class:`item-info`},g={class:`name`},_={class:`size`},v={class:`file-list-container`},ee={class:`folder-picker-footer`},te={class:`flex items-center gap-10px pl-96px`},y={class:`w-240px`},ne={class:`flex gap-10px`},P=M({__name:`index`,props:{path:{default:`/www/wwwroot`},checkedType:{default:function(){return[`dir`]}},callback:{}},emits:[`close`],setup:function(e,t){var i=t.emit,s=e,u=i,d=_e().t,p=G(null),x=G(s.path),C=G(!1),w=G(null),T=G(``),O=G([]),M=G(``),N=G([]),P=G(null),F=G(``),I=G(null),L=function(e){P.value||(P.value=e,F.value=``,N.value.unshift({filename:`__creating__`,path:``,modify_time:0,permission:``,owner:``,type:e,isCreate:!0}),U(function(){var e;(e=I.value)==null||e.focus()}))},R=function(){P.value&&N.value.shift(),P.value=null,F.value=``},B=function(){return Ce(function(){var e;return Ae(this,function(t){switch(t.label){case 0:if(!F.value)return[2];C.value=!0,t.label=1;case 1:return t.trys.push([1,,6,7]),e=x.value===`/`?`/`:``.concat(x.value,`/`),P.value===`file`?[4,de({path:e+F.value})]:[3,3];case 2:return t.sent(),[3,5];case 3:return[4,ue({path:e+F.value})];case 4:t.sent(),t.label=5;case 5:return R(),H(),[3,7];case 6:return C.value=!1,[7];case 7:return[2]}})})()},V=E(function(){var e=T.value.split(`/`).filter(Boolean);return e.length>0?e[e.length-1]:``}),H=function(){return Ce(function(){var e,t,n;return Ae(this,function(r){switch(r.label){case 0:C.value=!0,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,pe({path:x.value,disk:!0,search:M.value})];case 2:return e=r.sent().message,me(e)&&(t=e.PATH,n=[],e.DIR.forEach(function(e){n.push(J(e,`dir`,t))}),e.FILES.forEach(function(e){n.push(J(e,`file`,t))}),N.value=n,x.value=t,T.value=s.checkedType.includes(`dir`)?t:``,e.DISK&&(O.value=e.DISK),w.value=null,U(function(){var e;(e=p.value)==null||e.scrollTo({top:0})})),[3,4];case 3:return C.value=!1,[7];case 4:return[2]}})})()},J=function(e,t,n){var r=e.split(`;`),i=r[0],a=Number(r[2]),o=r[3],s=r[4];return{path:(n===`/`?`/`:``.concat(n,`/`))+i,filename:i,modify_time:a,permission:o,owner:s,type:t}},ve=function(){M.value=``,H()},Y=function(e){x.value=e,M.value=``,H()},X=function(){U(function(){H()})},Q=function(e){if(e.isCreate)return{};var t=s.checkedType.includes(e.type),n=s.checkedType.length===1&&s.checkedType[0]===`file`;return{class:[`cursor-pointer`,w.value===e.filename?`selected-row`:``],onClick:function(){n&&e.type===`dir`?(x.value=``.concat(x.value,`/`,e.filename).replace(`//`,`/`),M.value=``,H()):t&&(w.value===e.filename?(w.value=null,T.value=``):(w.value=e.filename,T.value=e.path))},onDblclick:function(){n&&e.type===`dir`||e.type===`dir`&&(x.value=``.concat(x.value,`/`,e.filename).replace(`//`,`/`),M.value=``,H())}}},$=[{title:function(){return d(`FolderPicker.Name`)},key:`name`,colSpan:function(e){return e.isCreate?3:1},render:function(e){if(e.isCreate){var t,r;return j(`div`,{class:`flex items-center gap-16px`},[j(`div`,{class:`flex items-center gap-8px`},[j(`i`,{class:[`text-18px`,P.value===`dir`?`i-file-dir`:`i-file-file text-base`]},null),j(`div`,{class:`w-220px`},[j(c,{ref:I,value:F.value,onUpdateValue:function(e){return F.value=e},size:`small`,autofocus:!0,placeholder:d(`FolderPicker.NamePlaceholder`),onKeydown:function(e){e.key===`Enter`&&B()}},null)])]),j(`div`,{class:`flex items-center gap-8px`},[j(n,{size:`small`,type:`primary`,onClick:B},Me(t=d(`FolderPicker.Create`))?t:{default:function(){return[t]}}),j(n,{size:`small`,onClick:R},Me(r=d(`Public.Btn.Cancel`))?r:{default:function(){return[r]}})])])}return j(`div`,{class:`flex items-center gap-8px`},[j(`i`,{class:[`text-18px`,e.type===`dir`?`i-file-dir`:`i-file-file text-base`]},null),j(`div`,{class:`w-0 flex-1 leading-18px`},[j(a,null,{default:function(){return[e.filename]}})])])}},{title:function(){return d(`FolderPicker.ModifyTime`)},key:`modify_time`,width:180,render:function(e){return e.isCreate?null:fe(e.modify_time)}},{title:function(){return d(`FolderPicker.PermissionOwner`)},key:`permission`,width:150,render:function(e){return e.isCreate?null:``.concat(e.permission,` / `,e.owner)}}];H();var be=function(){var e,t=T.value,n=t.substring(t.lastIndexOf(`/`)+1),r=N.value.find(function(e){return e.filename===n});(e=s.callback)==null||e.call(s,t,r),xe()},xe=function(){u(`close`)};return function(e,t){var i=l,s=r;return W(),k(`div`,f,[D(`div`,b,[D(`div`,S,[D(`div`,re,[j(he,{path:q(x),"onUpdate:path":t[0]||(t[0]=function(e){return z(x)?x.value=e:null}),onChange:ve,onRefresh:X},null,8,[`path`])]),D(`div`,ie,[j(q(c),{value:q(M),"onUpdate:value":t[1]||(t[1]=function(e){return z(M)?M.value=e:null}),clearable:``,placeholder:q(d)(`FolderPicker.SearchPlaceholder`),onKeydown:ye(X,[`enter`]),onClear:X},{suffix:Z(function(){return[D(`i`,{class:`i-common-search search-icon`,onClick:X})]}),_:1},8,[`value`,`placeholder`])])]),D(`div`,ae,[j(q(n),{size:`small`,onClick:t[2]||(t[2]=function(e){return L(`file`)})},{default:Z(function(){return[A(K(q(d)(`FolderPicker.NewFile`)),1)]}),_:1}),j(q(n),{size:`small`,onClick:t[3]||(t[3]=function(e){return L(`dir`)})},{default:Z(function(){return[A(K(q(d)(`file.buttonGroup.createOptions.newDirectory`)),1)]}),_:1})])]),D(`div`,oe,[D(`div`,se,[j(i,null,{default:Z(function(){return[D(`div`,ce,[(W(!0),k(o,null,ge(q(O),function(e){return W(),k(`div`,{key:e.path,class:`dist-item`,onClick:function(t){return Y(e.path)}},[t[4]||(t[4]=D(`i`,{class:`disk-icon i-file-disk`},null,-1)),D(`div`,h,[D(`div`,g,[j(q(a),null,{default:Z(function(){return[A(K(e.path),1)]}),_:2},1024)]),D(`div`,_,` (`+K(e.size[0])+`) `,1)])],8,m)}),128))])]}),_:1})]),D(`div`,v,[j(s,{ref_key:`tableRef`,ref:p,"flex-height":``,columns:$,data:q(N),class:`file-table`,"row-props":Q,bordered:!1,"virtual-scroll":!0,loading:q(C)},null,8,[`data`,`loading`])])]),D(`div`,ee,[D(`div`,te,[q(V)?(W(),k(o,{key:0},[D(`span`,null,K(q(d)(`FolderPicker.CurrentSelection`)),1),D(`div`,y,[j(q(c),{value:q(V),readonly:``,size:`small`},null,8,[`value`])])],64)):le(``,!0)]),D(`div`,ne,[j(q(n),{class:`cancel-btn`,size:`small`,onClick:xe},{default:Z(function(){return[A(K(q(d)(`Public.Btn.Cancel`)),1)]}),_:1}),j(q(n),{type:`primary`,size:`small`,disabled:!q(T),onClick:be},{default:Z(function(){return[A(K(q(d)(`Public.Btn.Confirm`)),1)]}),_:1},8,[`disabled`])])])])}}}),e(`t`,u({default:function(){return N}})),N=T(P,[[`__scopeId`,`data-v-b213fb92`]])}}})})();
Save File
Cancel