djm-ui 0.67.4 → 0.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -0
- package/README.md +38 -2
- package/dist/djm-ui.cjs +1032 -347
- package/dist/djm-ui.cjs.map +4 -4
- package/dist/djm-ui.css +752 -17
- package/dist/djm-ui.esm.js +1105 -420
- package/dist/djm-ui.esm.js.map +4 -4
- package/dist/djm-ui.esm.min.js +373 -227
- package/dist/djm-ui.min.cjs +373 -227
- package/dist/djm-ui.min.css +2 -2
- package/dist/djm-ui.umd.js +944 -259
- package/dist/djm-ui.umd.min.js +373 -227
- package/dist/mcp/manifest.json +12195 -0
- package/dist/mcp/server.js +90 -0
- package/package.json +12 -4
- package/src/components/icon/index.js +13 -1
- package/src/components/rich-editor/index.js +724 -61
- package/src/index.js +1 -1
- package/src/locale/en-US.js +33 -1
- package/src/locale/zh-CN.js +33 -1
- package/src/styles/base.css +2 -3
- package/src/styles/components/button.css +2 -1
- package/src/styles/components/console.css +5 -0
- package/src/styles/components/content.css +517 -0
- package/src/styles/components/form.css +5 -0
- package/src/styles/components/layout.css +326 -0
- package/src/styles/components/media-picker.css +3 -3
- package/src/styles/components/menu.css +2 -1
- package/src/styles/components/org-picker.css +1 -1
- package/src/styles/components/responsive.css +86 -0
- package/src/styles/components/rich-editor.css +206 -7
- package/src/styles/components/skin.css +54 -0
- package/src/styles/components/template.css +5 -0
- package/src/styles/index.css +1 -0
- package/src/styles/theme-dark.css +2 -0
- package/src/styles/tokens.css +8 -0
- package/src/theme/index.js +40 -0
- package/src/utils/sanitize-html.js +44 -6
- package/types/index.d.ts +8 -0
package/dist/djm-ui.esm.min.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! DJM UI v0.
|
|
2
|
-
var
|
|
3
|
-
]))+`;e.KANJI=new RegExp(
|
|
4
|
-
Make sure your charset is UTF-8`);
|
|
5
|
-
Suggested mode is: `+t.toString(
|
|
1
|
+
/*! DJM UI v0.72.0 · MIT · 2026-10-26 */
|
|
2
|
+
var sl=Object.defineProperty;var dl=(e,t,a)=>()=>{if(a)throw a[0];try{return e&&(t=e(e=0)),t}catch(i){throw a=[i],i}};var cl=(e,t)=>{for(var a in t)sl(e,a,{get:t[a],enumerable:!0})};var Bi={};cl(Bi,{default:()=>Jo});var ie,Co,Re,na,To,Io,Lo,Ao,zo,Li,Po,Bo,No,Ai,zi,Ve,Ro,Vo,Ho,Oo,$o,Fo,Ko,Wo,Uo,Pi,qo,_o,Yo,Jo,Ni=dl(()=>{"use strict";ie=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(a){throw t=0,a}},Co=ie((e,t)=>{t.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}}),Re=ie(e=>{var t,a=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(i){if(!i)throw new Error('"version" cannot be null or undefined');if(i<1||i>40)throw new Error('"version" should be in range from 1 to 40');return i*4+17},e.getSymbolTotalCodewords=function(i){return a[i]},e.getBCHDigit=function(i){let n=0;for(;i!==0;)n++,i>>>=1;return n},e.setToSJISFunction=function(i){if(typeof i!="function")throw new Error('"toSJISFunc" is not a valid function.');t=i},e.isKanjiModeEnabled=function(){return typeof t<"u"},e.toSJIS=function(i){return t(i)}}),na=ie(e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+a)}}e.isValid=function(a){return a&&typeof a.bit<"u"&&a.bit>=0&&a.bit<4},e.from=function(a,i){if(e.isValid(a))return a;try{return t(a)}catch{return i}}}),To=ie((e,t)=>{function a(){this.buffer=[],this.length=0}a.prototype={get:function(i){let n=Math.floor(i/8);return(this.buffer[n]>>>7-i%8&1)===1},put:function(i,n){for(let l=0;l<n;l++)this.putBit((i>>>n-l-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(i){let n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),i&&(this.buffer[n]|=128>>>this.length%8),this.length++}},t.exports=a}),Io=ie((e,t)=>{function a(i){if(!i||i<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=i,this.data=new Uint8Array(i*i),this.reservedBit=new Uint8Array(i*i)}a.prototype.set=function(i,n,l,r){let o=i*this.size+n;this.data[o]=l,r&&(this.reservedBit[o]=!0)},a.prototype.get=function(i,n){return this.data[i*this.size+n]},a.prototype.xor=function(i,n,l){this.data[i*this.size+n]^=l},a.prototype.isReserved=function(i,n){return this.reservedBit[i*this.size+n]},t.exports=a}),Lo=ie(e=>{var t=Re().getSymbolSize;e.getRowColCoords=function(a){if(a===1)return[];let i=Math.floor(a/7)+2,n=t(a),l=n===145?26:Math.ceil((n-13)/(2*i-2))*2,r=[n-7];for(let o=1;o<i-1;o++)r[o]=r[o-1]-l;return r.push(6),r.reverse()},e.getPositions=function(a){let i=[],n=e.getRowColCoords(a),l=n.length;for(let r=0;r<l;r++)for(let o=0;o<l;o++)r===0&&o===0||r===0&&o===l-1||r===l-1&&o===0||i.push([n[r],n[o]]);return i}}),Ao=ie(e=>{var t=Re().getSymbolSize,a=7;e.getPositions=function(i){let n=t(i);return[[0,0],[n-a,0],[0,n-a]]}}),zo=ie(e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},e.from=function(i){return e.isValid(i)?parseInt(i,10):void 0},e.getPenaltyN1=function(i){let n=i.size,l=0,r=0,o=0,s=null,d=null;for(let p=0;p<n;p++){r=o=0,s=d=null;for(let c=0;c<n;c++){let h=i.get(p,c);h===s?r++:(r>=5&&(l+=t.N1+(r-5)),s=h,r=1),h=i.get(c,p),h===d?o++:(o>=5&&(l+=t.N1+(o-5)),d=h,o=1)}r>=5&&(l+=t.N1+(r-5)),o>=5&&(l+=t.N1+(o-5))}return l},e.getPenaltyN2=function(i){let n=i.size,l=0;for(let r=0;r<n-1;r++)for(let o=0;o<n-1;o++){let s=i.get(r,o)+i.get(r,o+1)+i.get(r+1,o)+i.get(r+1,o+1);(s===4||s===0)&&l++}return l*t.N2},e.getPenaltyN3=function(i){let n=i.size,l=0,r=0,o=0;for(let s=0;s<n;s++){r=o=0;for(let d=0;d<n;d++)r=r<<1&2047|i.get(s,d),d>=10&&(r===1488||r===93)&&l++,o=o<<1&2047|i.get(d,s),d>=10&&(o===1488||o===93)&&l++}return l*t.N3},e.getPenaltyN4=function(i){let n=0,l=i.data.length;for(let r=0;r<l;r++)n+=i.data[r];return Math.abs(Math.ceil(n*100/l/5)-10)*t.N4};function a(i,n,l){switch(i){case e.Patterns.PATTERN000:return(n+l)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return l%3===0;case e.Patterns.PATTERN011:return(n+l)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(l/3))%2===0;case e.Patterns.PATTERN101:return n*l%2+n*l%3===0;case e.Patterns.PATTERN110:return(n*l%2+n*l%3)%2===0;case e.Patterns.PATTERN111:return(n*l%3+(n+l)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}e.applyMask=function(i,n){let l=n.size;for(let r=0;r<l;r++)for(let o=0;o<l;o++)n.isReserved(o,r)||n.xor(o,r,a(i,o,r))},e.getBestMask=function(i,n){let l=Object.keys(e.Patterns).length,r=0,o=1/0;for(let s=0;s<l;s++){n(s),e.applyMask(s,i);let d=e.getPenaltyN1(i)+e.getPenaltyN2(i)+e.getPenaltyN3(i)+e.getPenaltyN4(i);e.applyMask(s,i),d<o&&(o=d,r=s)}return r}}),Li=ie(e=>{var t=na(),a=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(n,l){switch(l){case t.L:return a[(n-1)*4+0];case t.M:return a[(n-1)*4+1];case t.Q:return a[(n-1)*4+2];case t.H:return a[(n-1)*4+3];default:return}},e.getTotalCodewordsCount=function(n,l){switch(l){case t.L:return i[(n-1)*4+0];case t.M:return i[(n-1)*4+1];case t.Q:return i[(n-1)*4+2];case t.H:return i[(n-1)*4+3];default:return}}}),Po=ie(e=>{var t=new Uint8Array(512),a=new Uint8Array(256);(function(){let i=1;for(let n=0;n<255;n++)t[n]=i,a[i]=n,i<<=1,i&256&&(i^=285);for(let n=255;n<512;n++)t[n]=t[n-255]})(),e.log=function(i){if(i<1)throw new Error("log("+i+")");return a[i]},e.exp=function(i){return t[i]},e.mul=function(i,n){return i===0||n===0?0:t[a[i]+a[n]]}}),Bo=ie(e=>{var t=Po();e.mul=function(a,i){let n=new Uint8Array(a.length+i.length-1);for(let l=0;l<a.length;l++)for(let r=0;r<i.length;r++)n[l+r]^=t.mul(a[l],i[r]);return n},e.mod=function(a,i){let n=new Uint8Array(a);for(;n.length-i.length>=0;){let l=n[0];for(let o=0;o<i.length;o++)n[o]^=t.mul(i[o],l);let r=0;for(;r<n.length&&n[r]===0;)r++;n=n.slice(r)}return n},e.generateECPolynomial=function(a){let i=new Uint8Array([1]);for(let n=0;n<a;n++)i=e.mul(i,new Uint8Array([1,t.exp(n)]));return i}}),No=ie((e,t)=>{var a=Bo();function i(n){this.genPoly=void 0,this.degree=n,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(n){this.degree=n,this.genPoly=a.generateECPolynomial(this.degree)},i.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");let l=new Uint8Array(n.length+this.degree);l.set(n);let r=a.mod(l,this.genPoly),o=this.degree-r.length;if(o>0){let s=new Uint8Array(this.degree);return s.set(r,o),s}return r},t.exports=i}),Ai=ie(e=>{e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}}),zi=ie(e=>{var t="[0-9]+",a="[A-Z $%*+\\-./:]+",i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");var n="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
|
|
3
|
+
]))+`;e.KANJI=new RegExp(i,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(n,"g"),e.NUMERIC=new RegExp(t,"g"),e.ALPHANUMERIC=new RegExp(a,"g");var l=new RegExp("^"+i+"$"),r=new RegExp("^"+t+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(s){return l.test(s)},e.testNumeric=function(s){return r.test(s)},e.testAlphanumeric=function(s){return o.test(s)}}),Ve=ie(e=>{var t=Ai(),a=zi();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(n,l){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!t.isValid(l))throw new Error("Invalid version: "+l);return l>=1&&l<10?n.ccBits[0]:l<27?n.ccBits[1]:n.ccBits[2]},e.getBestModeForData=function(n){return a.testNumeric(n)?e.NUMERIC:a.testAlphanumeric(n)?e.ALPHANUMERIC:a.testKanji(n)?e.KANJI:e.BYTE},e.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},e.isValid=function(n){return n&&n.bit&&n.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(n,l){if(e.isValid(n))return n;try{return i(n)}catch{return l}}}),Ro=ie(e=>{var t=Re(),a=Li(),i=na(),n=Ve(),l=Ai(),r=7973,o=t.getBCHDigit(r);function s(h,v,u){for(let g=1;g<=40;g++)if(v<=e.getCapacity(g,u,h))return g}function d(h,v){return n.getCharCountIndicator(h,v)+4}function p(h,v){let u=0;return h.forEach(function(g){let y=d(g.mode,v);u+=y+g.getBitsLength()}),u}function c(h,v){for(let u=1;u<=40;u++)if(p(h,u)<=e.getCapacity(u,v,n.MIXED))return u}e.from=function(h,v){return l.isValid(h)?parseInt(h,10):v},e.getCapacity=function(h,v,u){if(!l.isValid(h))throw new Error("Invalid QR Code version");typeof u>"u"&&(u=n.BYTE);let g=t.getSymbolTotalCodewords(h),y=a.getTotalCodewordsCount(h,v),j=(g-y)*8;if(u===n.MIXED)return j;let w=j-d(u,h);switch(u){case n.NUMERIC:return Math.floor(w/10*3);case n.ALPHANUMERIC:return Math.floor(w/11*2);case n.KANJI:return Math.floor(w/13);case n.BYTE:default:return Math.floor(w/8)}},e.getBestVersionForData=function(h,v){let u,g=i.from(v,i.M);if(Array.isArray(h)){if(h.length>1)return c(h,g);if(h.length===0)return 1;u=h[0]}else u=h;return s(u.mode,u.getLength(),g)},e.getEncodedBits=function(h){if(!l.isValid(h)||h<7)throw new Error("Invalid QR Code version");let v=h<<12;for(;t.getBCHDigit(v)-o>=0;)v^=r<<t.getBCHDigit(v)-o;return h<<12|v}}),Vo=ie(e=>{var t=Re(),a=1335,i=21522,n=t.getBCHDigit(a);e.getEncodedBits=function(l,r){let o=l.bit<<3|r,s=o<<10;for(;t.getBCHDigit(s)-n>=0;)s^=a<<t.getBCHDigit(s)-n;return(o<<10|s)^i}}),Ho=ie((e,t)=>{var a=Ve();function i(n){this.mode=a.NUMERIC,this.data=n.toString()}i.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(n){let l,r,o;for(l=0;l+3<=this.data.length;l+=3)r=this.data.substr(l,3),o=parseInt(r,10),n.put(o,10);let s=this.data.length-l;s>0&&(r=this.data.substr(l),o=parseInt(r,10),n.put(o,s*3+1))},t.exports=i}),Oo=ie((e,t)=>{var a=Ve(),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function n(l){this.mode=a.ALPHANUMERIC,this.data=l}n.getBitsLength=function(l){return 11*Math.floor(l/2)+6*(l%2)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(l){let r;for(r=0;r+2<=this.data.length;r+=2){let o=i.indexOf(this.data[r])*45;o+=i.indexOf(this.data[r+1]),l.put(o,11)}this.data.length%2&&l.put(i.indexOf(this.data[r]),6)},t.exports=n}),$o=ie((e,t)=>{var a=Ve();function i(n){this.mode=a.BYTE,typeof n=="string"?this.data=new TextEncoder().encode(n):this.data=new Uint8Array(n)}i.getBitsLength=function(n){return n*8},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(n){for(let l=0,r=this.data.length;l<r;l++)n.put(this.data[l],8)},t.exports=i}),Fo=ie((e,t)=>{var a=Ve(),i=Re();function n(l){this.mode=a.KANJI,this.data=l}n.getBitsLength=function(l){return l*13},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(l){let r;for(r=0;r<this.data.length;r++){let o=i.toSJIS(this.data[r]);if(o>=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[r]+`
|
|
4
|
+
Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),l.put(o,13)}},t.exports=n}),Ko=ie((e,t)=>{"use strict";var a={single_source_shortest_paths:function(i,n,l){var r={},o={};o[n]=0;var s=a.PriorityQueue.make();s.push(n,0);for(var d,p,c,h,v,u,g,y,j;!s.empty();){d=s.pop(),p=d.value,h=d.cost,v=i[p]||{};for(c in v)v.hasOwnProperty(c)&&(u=v[c],g=h+u,y=o[c],j=typeof o[c]>"u",(j||y>g)&&(o[c]=g,s.push(c,g),r[c]=p))}if(typeof l<"u"&&typeof o[l]>"u"){var w=["Could not find a path from ",n," to ",l,"."].join("");throw new Error(w)}return r},extract_shortest_path_from_predecessor_list:function(i,n){for(var l=[],r=n,o;r;)l.push(r),o=i[r],r=i[r];return l.reverse(),l},find_path:function(i,n,l){var r=a.single_source_shortest_paths(i,n,l);return a.extract_shortest_path_from_predecessor_list(r,l)},PriorityQueue:{make:function(i){var n=a.PriorityQueue,l={},r;i=i||{};for(r in n)n.hasOwnProperty(r)&&(l[r]=n[r]);return l.queue=[],l.sorter=i.sorter||n.default_sorter,l},default_sorter:function(i,n){return i.cost-n.cost},push:function(i,n){var l={value:i,cost:n};this.queue.push(l),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof t<"u"&&(t.exports=a)}),Wo=ie(e=>{var t=Ve(),a=Ho(),i=Oo(),n=$o(),l=Fo(),r=zi(),o=Re(),s=Ko();function d(j){return unescape(encodeURIComponent(j)).length}function p(j,w,b){let m=[],f;for(;(f=j.exec(b))!==null;)m.push({data:f[0],index:f.index,mode:w,length:f[0].length});return m}function c(j){let w=p(r.NUMERIC,t.NUMERIC,j),b=p(r.ALPHANUMERIC,t.ALPHANUMERIC,j),m,f;return o.isKanjiModeEnabled()?(m=p(r.BYTE,t.BYTE,j),f=p(r.KANJI,t.KANJI,j)):(m=p(r.BYTE_KANJI,t.BYTE,j),f=[]),w.concat(b,m,f).sort(function(E,D){return E.index-D.index}).map(function(E){return{data:E.data,mode:E.mode,length:E.length}})}function h(j,w){switch(w){case t.NUMERIC:return a.getBitsLength(j);case t.ALPHANUMERIC:return i.getBitsLength(j);case t.KANJI:return l.getBitsLength(j);case t.BYTE:return n.getBitsLength(j)}}function v(j){return j.reduce(function(w,b){let m=w.length-1>=0?w[w.length-1]:null;return m&&m.mode===b.mode?(w[w.length-1].data+=b.data,w):(w.push(b),w)},[])}function u(j){let w=[];for(let b=0;b<j.length;b++){let m=j[b];switch(m.mode){case t.NUMERIC:w.push([m,{data:m.data,mode:t.ALPHANUMERIC,length:m.length},{data:m.data,mode:t.BYTE,length:m.length}]);break;case t.ALPHANUMERIC:w.push([m,{data:m.data,mode:t.BYTE,length:m.length}]);break;case t.KANJI:w.push([m,{data:m.data,mode:t.BYTE,length:d(m.data)}]);break;case t.BYTE:w.push([{data:m.data,mode:t.BYTE,length:d(m.data)}])}}return w}function g(j,w){let b={},m={start:{}},f=["start"];for(let E=0;E<j.length;E++){let D=j[E],k=[];for(let B=0;B<D.length;B++){let S=D[B],T=""+E+B;k.push(T),b[T]={node:S,lastCount:0},m[T]={};for(let L=0;L<f.length;L++){let A=f[L];b[A]&&b[A].node.mode===S.mode?(m[A][T]=h(b[A].lastCount+S.length,S.mode)-h(b[A].lastCount,S.mode),b[A].lastCount+=S.length):(b[A]&&(b[A].lastCount=S.length),m[A][T]=h(S.length,S.mode)+4+t.getCharCountIndicator(S.mode,w))}}f=k}for(let E=0;E<f.length;E++)m[f[E]].end=0;return{map:m,table:b}}function y(j,w){let b,m=t.getBestModeForData(j);if(b=t.from(w,m),b!==t.BYTE&&b.bit<m.bit)throw new Error('"'+j+'" cannot be encoded with mode '+t.toString(b)+`.
|
|
5
|
+
Suggested mode is: `+t.toString(m));switch(b===t.KANJI&&!o.isKanjiModeEnabled()&&(b=t.BYTE),b){case t.NUMERIC:return new a(j);case t.ALPHANUMERIC:return new i(j);case t.KANJI:return new l(j);case t.BYTE:return new n(j)}}e.fromArray=function(j){return j.reduce(function(w,b){return typeof b=="string"?w.push(y(b,null)):b.data&&w.push(y(b.data,b.mode)),w},[])},e.fromString=function(j,w){let b=c(j,o.isKanjiModeEnabled()),m=u(b),f=g(m,w),E=s.find_path(f.map,"start","end"),D=[];for(let k=1;k<E.length-1;k++)D.push(f.table[E[k]].node);return e.fromArray(v(D))},e.rawSplit=function(j){return e.fromArray(c(j,o.isKanjiModeEnabled()))}}),Uo=ie(e=>{var t=Re(),a=na(),i=To(),n=Io(),l=Lo(),r=Ao(),o=zo(),s=Li(),d=No(),p=Ro(),c=Vo(),h=Ve(),v=Wo();function u(D,k){let B=D.size,S=r.getPositions(k);for(let T=0;T<S.length;T++){let L=S[T][0],A=S[T][1];for(let O=-1;O<=7;O++)if(!(L+O<=-1||B<=L+O))for(let $=-1;$<=7;$++)A+$<=-1||B<=A+$||(O>=0&&O<=6&&($===0||$===6)||$>=0&&$<=6&&(O===0||O===6)||O>=2&&O<=4&&$>=2&&$<=4?D.set(L+O,A+$,!0,!0):D.set(L+O,A+$,!1,!0))}}function g(D){let k=D.size;for(let B=8;B<k-8;B++){let S=B%2===0;D.set(B,6,S,!0),D.set(6,B,S,!0)}}function y(D,k){let B=l.getPositions(k);for(let S=0;S<B.length;S++){let T=B[S][0],L=B[S][1];for(let A=-2;A<=2;A++)for(let O=-2;O<=2;O++)A===-2||A===2||O===-2||O===2||A===0&&O===0?D.set(T+A,L+O,!0,!0):D.set(T+A,L+O,!1,!0)}}function j(D,k){let B=D.size,S=p.getEncodedBits(k),T,L,A;for(let O=0;O<18;O++)T=Math.floor(O/3),L=O%3+B-8-3,A=(S>>O&1)===1,D.set(T,L,A,!0),D.set(L,T,A,!0)}function w(D,k,B){let S=D.size,T=c.getEncodedBits(k,B),L,A;for(L=0;L<15;L++)A=(T>>L&1)===1,L<6?D.set(L,8,A,!0):L<8?D.set(L+1,8,A,!0):D.set(S-15+L,8,A,!0),L<8?D.set(8,S-L-1,A,!0):L<9?D.set(8,15-L-1+1,A,!0):D.set(8,15-L-1,A,!0);D.set(S-8,8,1,!0)}function b(D,k){let B=D.size,S=-1,T=B-1,L=7,A=0;for(let O=B-1;O>0;O-=2)for(O===6&&O--;;){for(let $=0;$<2;$++)if(!D.isReserved(T,O-$)){let X=!1;A<k.length&&(X=(k[A]>>>L&1)===1),D.set(T,O-$,X),L--,L===-1&&(A++,L=7)}if(T+=S,T<0||B<=T){T-=S,S=-S;break}}}function m(D,k,B){let S=new i;B.forEach(function($){S.put($.mode.bit,4),S.put($.getLength(),h.getCharCountIndicator($.mode,D)),$.write(S)});let T=t.getSymbolTotalCodewords(D),L=s.getTotalCodewordsCount(D,k),A=(T-L)*8;for(S.getLengthInBits()+4<=A&&S.put(0,4);S.getLengthInBits()%8!==0;)S.putBit(0);let O=(A-S.getLengthInBits())/8;for(let $=0;$<O;$++)S.put($%2?17:236,8);return f(S,D,k)}function f(D,k,B){let S=t.getSymbolTotalCodewords(k),T=s.getTotalCodewordsCount(k,B),L=S-T,A=s.getBlocksCount(k,B),O=S%A,$=A-O,X=Math.floor(S/A),ee=Math.floor(L/A),H=ee+1,U=X-ee,Y=new d(U),ne=0,te=new Array(A),re=new Array(A),z=0,K=new Uint8Array(D.buffer);for(let N=0;N<A;N++){let W=N<$?ee:H;te[N]=K.slice(ne,ne+W),re[N]=Y.encode(te[N]),ne+=W,z=Math.max(z,W)}let _=new Uint8Array(S),se=0,x,I;for(x=0;x<z;x++)for(I=0;I<A;I++)x<te[I].length&&(_[se++]=te[I][x]);for(x=0;x<U;x++)for(I=0;I<A;I++)_[se++]=re[I][x];return _}function E(D,k,B,S){let T;if(Array.isArray(D))T=v.fromArray(D);else if(typeof D=="string"){let X=k;if(!X){let ee=v.rawSplit(D);X=p.getBestVersionForData(ee,B)}T=v.fromString(D,X||40)}else throw new Error("Invalid data");let L=p.getBestVersionForData(T,B);if(!L)throw new Error("The amount of data is too big to be stored in a QR Code");if(!k)k=L;else if(k<L)throw new Error(`
|
|
6
6
|
The chosen QR Code version cannot contain this amount of data.
|
|
7
|
-
Minimum version required to store current data is: `+
|
|
8
|
-
`);let A=
|
|
9
|
-
`;return typeof
|
|
7
|
+
Minimum version required to store current data is: `+L+`.
|
|
8
|
+
`);let A=m(k,B,T),O=t.getSymbolSize(k),$=new n(O);return u($,k),g($),y($,k),w($,B,0),k>=7&&j($,k),b($,A),isNaN(S)&&(S=o.getBestMask($,w.bind(null,$,B))),o.applyMask(S,$),w($,B,S),{modules:$,version:k,errorCorrectionLevel:B,maskPattern:S,segments:T}}e.create=function(D,k){if(typeof D>"u"||D==="")throw new Error("No input text");let B=a.M,S,T;return typeof k<"u"&&(B=a.from(k.errorCorrectionLevel,a.M),S=p.from(k.version),T=o.from(k.maskPattern),k.toSJISFunc&&t.setToSJISFunction(k.toSJISFunc)),E(D,S,B,T)}}),Pi=ie(e=>{function t(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw new Error("Color should be defined as hex string");let i=a.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+a);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(l){return[l,l]}))),i.length===6&&i.push("F","F");let n=parseInt(i.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(a){a||(a={}),a.color||(a.color={});let i=typeof a.margin>"u"||a.margin===null||a.margin<0?4:a.margin,n=a.width&&a.width>=21?a.width:void 0,l=a.scale||4;return{width:n,scale:n?4:l,margin:i,color:{dark:t(a.color.dark||"#000000ff"),light:t(a.color.light||"#ffffffff")},type:a.type,rendererOpts:a.rendererOpts||{}}},e.getScale=function(a,i){return i.width&&i.width>=a+i.margin*2?i.width/(a+i.margin*2):i.scale},e.getImageWidth=function(a,i){let n=e.getScale(a,i);return Math.floor((a+i.margin*2)*n)},e.qrToImageData=function(a,i,n){let l=i.modules.size,r=i.modules.data,o=e.getScale(l,n),s=Math.floor((l+n.margin*2)*o),d=n.margin*o,p=[n.color.light,n.color.dark];for(let c=0;c<s;c++)for(let h=0;h<s;h++){let v=(c*s+h)*4,u=n.color.light;if(c>=d&&h>=d&&c<s-d&&h<s-d){let g=Math.floor((c-d)/o),y=Math.floor((h-d)/o);u=p[r[g*l+y]?1:0]}a[v++]=u.r,a[v++]=u.g,a[v++]=u.b,a[v]=u.a}}}),qo=ie(e=>{var t=Pi();function a(n,l,r){n.clearRect(0,0,l.width,l.height),l.style||(l.style={}),l.height=r,l.width=r,l.style.height=r+"px",l.style.width=r+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(n,l,r){let o=r,s=l;typeof o>"u"&&(!l||!l.getContext)&&(o=l,l=void 0),l||(s=i()),o=t.getOptions(o);let d=t.getImageWidth(n.modules.size,o),p=s.getContext("2d"),c=p.createImageData(d,d);return t.qrToImageData(c.data,n,o),a(p,s,d),p.putImageData(c,0,0),s},e.renderToDataURL=function(n,l,r){let o=r;typeof o>"u"&&(!l||!l.getContext)&&(o=l,l=void 0),o||(o={});let s=e.render(n,l,o),d=o.type||"image/png",p=o.rendererOpts||{};return s.toDataURL(d,p.quality)}}),_o=ie(e=>{var t=Pi();function a(l,r){let o=l.a/255,s=r+'="'+l.hex+'"';return o<1?s+" "+r+'-opacity="'+o.toFixed(2).slice(1)+'"':s}function i(l,r,o){let s=l+r;return typeof o<"u"&&(s+=" "+o),s}function n(l,r,o){let s="",d=0,p=!1,c=0;for(let h=0;h<l.length;h++){let v=Math.floor(h%r),u=Math.floor(h/r);!v&&!p&&(p=!0),l[h]?(c++,h>0&&v>0&&l[h-1]||(s+=p?i("M",v+o,.5+u+o):i("m",d,0),d=0,p=!1),v+1<r&&l[h+1]||(s+=i("h",c),c=0)):d++}return s}e.render=function(l,r,o){let s=t.getOptions(r),d=l.modules.size,p=l.modules.data,c=d+s.margin*2,h=s.color.light.a?"<path "+a(s.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",v="<path "+a(s.color.dark,"stroke")+' d="'+n(p,d,s.margin)+'"/>',u='viewBox="0 0 '+c+" "+c+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+u+' shape-rendering="crispEdges">'+h+v+`</svg>
|
|
9
|
+
`;return typeof o=="function"&&o(null,g),g}}),Yo=ie(e=>{var t=Co(),a=Uo(),i=qo(),n=_o();function l(r,o,s,d,p){let c=[].slice.call(arguments,1),h=c.length,v=typeof c[h-1]=="function";if(!v&&!t())throw new Error("Callback required as last argument");if(v){if(h<2)throw new Error("Too few arguments provided");h===2?(p=s,s=o,o=d=void 0):h===3&&(o.getContext&&typeof p>"u"?(p=d,d=void 0):(p=d,d=s,s=o,o=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(s=o,o=d=void 0):h===2&&!o.getContext&&(d=s,s=o,o=void 0),new Promise(function(u,g){try{let y=a.create(s,d);u(r(y,o,d))}catch(y){g(y)}})}try{let u=a.create(s,d);p(null,r(u,o,d))}catch(u){p(u)}}e.create=a.create,e.toCanvas=l.bind(null,i.render),e.toDataURL=l.bind(null,i.renderToDataURL),e.toString=l.bind(null,function(r,o,s){return n.render(r,s)})}),Jo=Yo()});var ul={grid:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",users:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M13 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75",shield:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10zM9 12l2 2 4-4",search:"M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0zM21 21l-4.35-4.35",bell:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9M13.73 21a2 2 0 0 1-3.46 0","chevron-down":"M6 9l6 6 6-6","chevron-up":"M6 15l6-6 6 6","chevron-right":"M9 18l6-6-6-6","chevron-left":"M15 18l-6-6 6-6","chevrons-left":"M11 17l-5-5 5-5M18 17l-5-5 5-5","chevrons-right":"M13 17l5-5-5-5M6 17l5-5-5-5",menu:"M3 6h18M3 12h18M3 18h18",plus:"M12 5v14M5 12h14",minus:"M5 12h14",download:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3",upload:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",trash:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6",refresh:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15",sliders:"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6",x:"M18 6L6 18M6 6l12 12",edit:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z",lock:"M5 11h14v10H5zM8 11V7a4 4 0 1 1 8 0v4","log-out":"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9",clock:"M12 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20zM12 6v6l4 2",filter:"M22 3H2l8 9.46V19l4 2v-8.54L22 3z",check:"M20 6L9 17l-5-5",info:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20M12 16v-5M12 8h.01",alert:"M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z","arrow-up":"M12 19V5M5 12l7-7 7 7","arrow-down":"M12 5v14M19 12l-7 7-7-7",layers:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",clipboard:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2M9 4h6v3H9zM8 12h8M8 16h5",table:"M3 4h18v16H3zM3 10h18M3 16h18M9 4v16M15 4v16",message:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",calendar:"M4 5h16v16H4zM8 3v4M16 3v4M4 10h16",image:"M3 5h18v14H3zM8.5 11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M21 15l-5-5L5 21",file:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6",grip:"M9 5h.01M15 5h.01M9 12h.01M15 12h.01M9 19h.01M15 19h.01",printer:"M6 9V3h12v6M6 18H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2M6 14h12v7H6z",code:"M16 18l6-6-6-6M8 6l-6 6 6 6",eye:"M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12zM15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0","eye-off":"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19M14.12 14.12a3 3 0 1 1-4.24-4.24M1 1l22 22",link:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07L12 4.5M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07L14 19.5",folder:"M3 5h6l2 2h10v12H3z",layout:"M3 3h18v18H3zM3 9h18M9 9v12","bar-chart":"M4 20V10M10 20V4M16 20v-6M22 20H2",maximize:"M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3",minimize:"M5 12h14",columns:"M3 4h18v16H3zM9 4v16M15 4v16",monitor:"M3 4h18v12H3zM8 20h8M12 16v4",mail:"M4 5h16v14H4zM4 7l8 6 8-6",phone:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z","user-plus":"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M13 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0M19 8v6M22 11h-6","shield-off":"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10zM4 4l16 16",activity:"M22 12h-4l-3 9L9 3l-3 9H2",database:"M12 8c4.42 0 8-1.34 8-3s-3.58-3-8-3-8 1.34-8 3 3.58 3 8 3zM4 5v14c0 1.66 3.58 3 8 3s8-1.34 8-3V5M4 12c0 1.66 3.58 3 8 3s8-1.34 8-3",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42",moon:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z",undo:"M3 10h11a5 5 0 1 1 0 10H8M3 10l4-4M3 10l4 4",redo:"M21 10H10a5 5 0 1 0 0 10h6M21 10l-4-4M21 10l-4 4","align-left":"M4 6h16M4 12h10M4 18h13","align-center":"M4 6h16M7 12h10M6 18h12","align-right":"M4 6h16M10 12h10M7 18h13","align-justify":"M4 6h16M4 12h16M4 18h16",list:"M9 6h11M9 12h11M9 18h11M4.5 6h.01M4.5 12h.01M4.5 18h.01","list-ordered":"M10 6h10M10 12h10M10 18h10M4 6h1v4M4 12h2M4 16h2v2H4",outdent:"M4 6h16M10 12h10M10 18h10M8 9l-3 3 3 3",indent:"M4 6h16M10 12h10M10 18h10M5 9l3 3-3 3",unlink:"M10 13a5 5 0 0 0 7.5.5M14 11a5 5 0 0 0-7.5-.5M2 2l20 20",images:"M8 3h12v12M4 7h12v12H4zM7 15l3-3 3 3"},P={name:"DjmIcon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:16}},computed:{d(){return ul[this.name]||""}},template:`
|
|
10
10
|
<svg
|
|
11
11
|
class="djm-icon"
|
|
12
12
|
:width="size"
|
|
@@ -19,7 +19,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
19
19
|
stroke-linejoin="round"
|
|
20
20
|
aria-hidden="true"
|
|
21
21
|
><path :d="d" /></svg>
|
|
22
|
-
`};var
|
|
22
|
+
`};var Sa={name:"DjmButton",components:{DjmIcon:P},props:{variant:{type:String,default:""},size:{type:String,default:""},icon:{type:String,default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},ariaLabel:{type:String,default:""},nativeType:{type:String,default:"button"}},emits:["click"],computed:{classes(){return["djm-btn",this.variant?"djm-btn-"+this.variant:"",this.size?"djm-btn-"+this.size:""].filter(Boolean)}},template:`
|
|
23
23
|
<button
|
|
24
24
|
:class="classes"
|
|
25
25
|
:type="nativeType"
|
|
@@ -31,7 +31,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
31
31
|
<DjmIcon v-else-if="icon" :name="icon" />
|
|
32
32
|
<slot></slot>
|
|
33
33
|
</button>
|
|
34
|
-
`};var
|
|
34
|
+
`};var ge={name:"DjmInput",components:{DjmIcon:P},props:{modelValue:{type:[String,Number],default:""},type:{type:String,default:"text"},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},clearable:{type:Boolean,default:!1},maxlength:{type:Number,default:0},showWordLimit:{type:Boolean,default:!1},ariaLabel:{type:String,default:""}},emits:["update:modelValue","input","change","enter","focus","blur","clear"],computed:{classes(){return["djm-input",{"djm-is-invalid":this.invalid,"djm-has-affix":this.hasAffix}]},hasAffix(){return this.clearable||this.maxlength>0&&this.showWordLimit},showClear(){return this.clearable&&!this.disabled&&!this.readonly&&String(this.modelValue??"").length>0},showCount(){return this.maxlength>0&&this.showWordLimit&&!this.showClear},wordCount(){return String(this.modelValue??"").length},maxlengthAttr(){return this.maxlength>0?this.maxlength:void 0}},methods:{onInput(e){this.$emit("update:modelValue",e.target.value),this.$emit("input",e)},clearStaleValue(){let e=this.$refs.input;!e||this.autocomplete!=="off"||String(this.modelValue??"").length===0&&e.value&&(e.value="")},clear(){this.$emit("update:modelValue",""),this.$emit("clear"),this.$emit("change",""),this.focus()},focus(){this.clearStaleValue(),this.$refs.input&&this.$refs.input.focus()},onFocus(e){this.clearStaleValue(),this.$emit("focus",e)},blur(){this.$refs.input&&this.$refs.input.blur()}},mounted(){this.staleTimers=[null,200,600,1200,2400].map(e=>e===null?(this.clearStaleValue(),null):setTimeout(()=>this.clearStaleValue(),e)),window.addEventListener("pageshow",this.clearStaleValue)},beforeUnmount(){this.staleTimers.forEach(e=>clearTimeout(e)),window.removeEventListener("pageshow",this.clearStaleValue)},template:`
|
|
35
35
|
<div v-if="hasAffix" class="djm-input-wrap">
|
|
36
36
|
<input
|
|
37
37
|
ref="input"
|
|
@@ -81,7 +81,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
81
81
|
@focus="onFocus"
|
|
82
82
|
@blur="$emit('blur', $event)"
|
|
83
83
|
/>
|
|
84
|
-
`};import{computed as re,nextTick as nt,onBeforeUnmount as ol,ref as be,watch as rl}from"vue";import{reactive as il}from"vue";var Qe={"common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","common.confirm":"\u786E\u5B9A","common.selected":"\u5DF2\u9009 {count} \u9879","common.dialog":"\u5BF9\u8BDD\u6846","common.noOptions":"\u6682\u65E0\u9009\u9879","common.removeTag":"\u79FB\u9664\u6807\u7B7E","pagination.total":"\u5171 {total} \u6761","pagination.pageSize":"\u6BCF\u9875 {size} \u6761","pagination.jump":"\u8DF3\u81F3","pagination.pageUnit":"\u9875","pagination.first":"\u9996\u9875","pagination.prev":"\u4E0A\u4E00\u9875","pagination.next":"\u4E0B\u4E00\u9875","pagination.last":"\u672B\u9875","pagination.page":"\u7B2C {page} \u9875","pagination.pageSizeLabel":"\u6BCF\u9875\u6761\u6570","pagination.jumpLabel":"\u8DF3\u81F3\u9875\u7801","table.loading":"\u6B63\u5728\u52A0\u8F7D\u6570\u636E\u2026","table.empty":"\u6682\u65E0\u6570\u636E","table.selectAll":"\u5168\u9009\u5F53\u524D\u9875","table.selectRow":"\u9009\u62E9\u8BE5\u884C","table.scrollRegion":"\u8868\u683C\u6570\u636E\u533A","empty.title":"\u6682\u65E0\u6570\u636E","datePicker.placeholder":"\u9009\u62E9\u65E5\u671F","datePicker.rangePlaceholder":"\u9009\u62E9\u65E5\u671F\u8303\u56F4","datePicker.rangeEnd":"\u7ED3\u675F\u65E5\u671F","datePicker.today":"\u4ECA\u5929","datePicker.clear":"\u6E05\u7A7A","datePicker.title":"{year} \u5E74 {month} \u6708","datePicker.weeks":"\u4E00,\u4E8C,\u4E09,\u56DB,\u4E94,\u516D,\u65E5","calendar.title":"{year} \u5E74 {month} \u6708","calendar.prevMonth":"\u4E0A\u4E00\u6708","calendar.nextMonth":"\u4E0B\u4E00\u6708","calendar.grid":"\u65E5\u671F","treeSelect.placeholder":"\u8BF7\u9009\u62E9","treeSelect.search":"\u641C\u7D22\u8282\u70B9","treeSelect.empty":"\u6CA1\u6709\u5339\u914D\u7684\u8282\u70B9","treeSelect.clear":"\u6E05\u7A7A","treeSelect.clearSearch":"\u6E05\u7A7A\u641C\u7D22","treeSelect.remove":"\u79FB\u9664 {label}","treeSelect.expand":"\u5C55\u5F00","treeSelect.collapse":"\u6536\u8D77","cascader.empty":"\u6682\u65E0\u9009\u9879","steps.order":"\u7B2C {index} \u6B65","password.aria":"\u5BC6\u7801","password.show":"\u663E\u793A\u5BC6\u7801","password.hide":"\u9690\u85CF\u5BC6\u7801","password.weak":"\u5F31","password.medium":"\u4E2D","password.strong":"\u5F3A","password.hint":"\u81F3\u5C11 8 \u4F4D\uFF0C\u5EFA\u8BAE\u6DF7\u5408\u5927\u5C0F\u5199\u4E0E\u7B26\u53F7","password.strength":"\u5BC6\u7801\u5F3A\u5EA6\uFF1A{level}","contextMenu.empty":"\u6CA1\u6709\u53EF\u6267\u884C\u7684\u64CD\u4F5C","tree.empty":"\u6682\u65E0\u8282\u70B9","confirm.title":"\u64CD\u4F5C\u786E\u8BA4","confirm.confirm":"\u786E\u5B9A","confirm.cancel":"\u53D6\u6D88","upload.dropText":"\u62D6\u62FD\u6587\u4EF6\u5230\u8FD9\u91CC\uFF0C\u6216\u70B9\u51FB\u9009\u62E9","upload.dropHint":"\u652F\u6301\u591A\u9009\uFF0C\u53EF\u62D6\u62FD\u6216\u70B9\u51FB\u4E0A\u4F20","upload.select":"\u9009\u62E9\u6587\u4EF6","upload.count":"\u5DF2\u6DFB\u52A0 {count} \u4E2A\u6587\u4EF6","upload.clear":"\u5168\u90E8\u79FB\u9664","upload.empty":"\u5C1A\u672A\u9009\u62E9\u6587\u4EF6","upload.uploading":"\u4E0A\u4F20\u4E2D {percent}%","upload.done":"\u4E0A\u4F20\u5B8C\u6210","upload.ready":"\u5F85\u4E0A\u4F20","upload.failed":"\u4E0A\u4F20\u5931\u8D25","upload.retry":"\u91CD\u8BD5","upload.start":"\u4E0A\u4F20","upload.remove":"\u79FB\u9664","upload.limitHint":"\u6700\u591A {count} \u4E2A\u6587\u4EF6","upload.sizeHint":"\u5355\u4E2A\u4E0D\u8D85\u8FC7 {size}","select.placeholder":"\u8BF7\u9009\u62E9","select.empty":"\u65E0\u5339\u914D\u9879","select.clear":"\u6E05\u7A7A","orgPicker.placeholder":"\u9009\u62E9\u4EBA\u5458","orgPicker.title":"\u9009\u62E9\u4EBA\u5458","orgPicker.search":"\u641C\u7D22\u59D3\u540D\u6216\u804C\u4F4D","orgPicker.deptTree":"\u90E8\u95E8","orgPicker.allStaff":"\u5168\u90E8\u4EBA\u5458","orgPicker.expand":"\u5C55\u5F00\u6216\u6536\u8D77\u90E8\u95E8","orgPicker.selected":"\u5DF2\u9009 {count} \u4EBA","orgPicker.clearSelected":"\u6E05\u7A7A\u5DF2\u9009","orgPicker.clear":"\u6E05\u7A7A","orgPicker.empty":"\u6CA1\u6709\u5339\u914D\u7684\u4EBA\u5458","queryFilter.search":"\u67E5\u8BE2","queryFilter.reset":"\u91CD\u7F6E","queryFilter.expand":"\u5C55\u5F00","queryFilter.collapse":"\u6536\u8D77","mediaPicker.select":"\u9009\u62E9\u7D20\u6750","mediaPicker.title":"\u5A92\u4F53\u5E93","mediaPicker.search":"\u641C\u7D22\u7D20\u6750\u540D\u79F0","mediaPicker.empty":"\u6CA1\u6709\u5339\u914D\u7684\u7D20\u6750","mediaPicker.total":"\u5171 {total} \u4E2A\u7D20\u6750","mediaPicker.limit":"\u6700\u591A\u9009 {limit} \u4E2A","image.preview":"\u9884\u89C8\u56FE\u7247","image.close":"\u5173\u95ED\u9884\u89C8","image.dialog":"\u56FE\u7247\u9884\u89C8","image.failed":"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25","tour.label":"\u64CD\u4F5C\u5F15\u5BFC","tour.close":"\u5173\u95ED\u5F15\u5BFC","tour.prev":"\u4E0A\u4E00\u6B65","tour.next":"\u4E0B\u4E00\u6B65","tour.finish":"\u5B8C\u6210","richEditor.aria":"\u5BCC\u6587\u672C\u7F16\u8F91\u5668","richEditor.placeholder":"\u8BF7\u8F93\u5165\u5185\u5BB9\u2026","richEditor.bold":"\u52A0\u7C97","richEditor.italic":"\u659C\u4F53","richEditor.underline":"\u4E0B\u5212\u7EBF","richEditor.strike":"\u5220\u9664\u7EBF","richEditor.heading":"\u4E8C\u7EA7\u6807\u9898","richEditor.paragraph":"\u6B63\u6587","richEditor.bulletList":"\u65E0\u5E8F\u5217\u8868","richEditor.numberList":"\u6709\u5E8F\u5217\u8868","richEditor.link":"\u63D2\u5165\u94FE\u63A5","richEditor.linkPrompt":"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740","richEditor.clearFormat":"\u6E05\u9664","richEditor.undo":"\u64A4\u9500","richEditor.redo":"\u91CD\u505A","richEditor.source":"\u6E90\u7801","richEditor.visual":"\u53EF\u89C6\u5316","approval.start":"\u53D1\u8D77","approval.cc":"\u6284\u9001","approval.approved":"\u5DF2\u901A\u8FC7","approval.rejected":"\u5DF2\u9A73\u56DE","approval.pending":"\u5BA1\u6279\u4E2D","approval.waiting":"\u5F85\u5904\u7406","approval.empty":"\u6682\u65E0\u5BA1\u6279\u8BB0\u5F55","kanban.board":"\u770B\u677F","kanban.empty":"\u6682\u65E0\u5361\u7247","kanban.addCard":"\u65B0\u5EFA\u5361\u7247","attachment.empty":"\u6682\u65E0\u9644\u4EF6","attachment.preview":"\u9884\u89C8","attachment.download":"\u4E0B\u8F7D","attachment.remove":"\u5220\u9664","notification.unread":"\u672A\u8BFB {count} \u6761","notification.readAll":"\u5168\u90E8\u5DF2\u8BFB","notification.clear":"\u6E05\u7A7A","notification.clearConfirm":"\u786E\u8BA4\u6E05\u7A7A","notification.empty":"\u6682\u65E0\u901A\u77E5","dateTimePicker.placeholder":"\u9009\u62E9\u65E5\u671F\u65F6\u95F4","dateTimePicker.now":"\u6B64\u523B","dateTimePicker.clear":"\u6E05\u7A7A","dateTimePicker.prevMonth":"\u4E0A\u4E2A\u6708","dateTimePicker.nextMonth":"\u4E0B\u4E2A\u6708","virtualList.empty":"\u6682\u65E0\u6570\u636E","batchBar.selected":"\u5DF2\u9009 {count} \u9879","batchBar.selectAll":"\u5168\u9009 {total} \u9879","batchBar.clear":"\u53D6\u6D88\u9009\u62E9","importWizard.stepFile":"\u9009\u62E9\u6587\u4EF6","importWizard.stepMapping":"\u5B57\u6BB5\u6620\u5C04","importWizard.stepResult":"\u5BFC\u5165\u7ED3\u679C","importWizard.pick":"\u9009\u62E9\u6587\u4EF6","importWizard.dragTip":"\u628A\u6587\u4EF6\u62D6\u5230\u8FD9\u91CC\uFF0C\u6216\u70B9\u51FB\u9009\u62E9\uFF08{accept}\uFF09","importWizard.acceptError":"\u4EC5\u652F\u6301 {accept} \u683C\u5F0F","importWizard.sizeError":"\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7 {size} MB","importWizard.reselect":"\u91CD\u65B0\u9009\u62E9","importWizard.sourcePlaceholder":"\u8BF7\u9009\u62E9\u5BF9\u5E94\u7684\u6587\u4EF6\u5B57\u6BB5","importWizard.missingRequired":"\u5FC5\u586B\u5B57\u6BB5\u672A\u6620\u5C04\uFF1A{fields}","importWizard.prev":"\u4E0A\u4E00\u6B65","importWizard.submit":"\u5F00\u59CB\u5BFC\u5165","importWizard.importing":"\u5BFC\u5165\u4E2D\u2026","importWizard.statTotal":"\u603B\u6761\u6570","importWizard.statSuccess":"\u6210\u529F","importWizard.statFailed":"\u5931\u8D25","importWizard.rowNo":"\u7B2C {row} \u884C","importWizard.retry":"\u8FD4\u56DE\u4FEE\u6539","importWizard.restart":"\u91CD\u65B0\u5BFC\u5165","diff.before":"\u4FEE\u6539\u524D","diff.after":"\u4FEE\u6539\u540E","diff.same":"\u5185\u5BB9\u4E00\u81F4","diff.expand":"\u5C55\u5F00 {count} \u884C\u672A\u53D8\u66F4\u5185\u5BB9","treeTable.empty":"\u6682\u65E0\u6570\u636E","treeTable.loading":"\u6B63\u5728\u52A0\u8F7D\u2026","treeTable.selectAll":"\u5168\u9009","treeTable.expand":"\u5C55\u5F00","treeTable.collapse":"\u6536\u8D77","schedule.title":"\u65E5\u7A0B","schedule.weekdays":"\u5468\u4E00,\u5468\u4E8C,\u5468\u4E09,\u5468\u56DB,\u5468\u4E94,\u5468\u516D,\u5468\u65E5","schedule.prevWeek":"\u4E0A\u4E00\u5468","schedule.nextWeek":"\u4E0B\u4E00\u5468","schedule.today":"\u672C\u5468","comment.placeholder":"\u8BF4\u70B9\u4EC0\u4E48\u2026","comment.replyPlaceholder":"\u56DE\u590D {name}","comment.replyingTo":"\u6B63\u5728\u56DE\u590D {name}","comment.cancelReply":"\u53D6\u6D88\u56DE\u590D","comment.submit":"\u53D1\u5E03","comment.submitting":"\u53D1\u5E03\u4E2D\u2026","comment.reply":"\u56DE\u590D","comment.remove":"\u5220\u9664","comment.empty":"\u8FD8\u6CA1\u6709\u8BC4\u8BBA","signature.label":"\u624B\u5199\u7B7E\u540D","signature.hint":"\u8BF7\u5728\u6B64\u5904\u7B7E\u540D","signature.clear":"\u6E05\u7A7A","print.button":"\u6253\u5370","gantt.task":"\u4EFB\u52A1","gantt.empty":"\u6682\u65E0\u4EFB\u52A1","fieldList.add":"\u6DFB\u52A0\u4E00\u884C","fieldList.remove":"\u5220\u9664\u8FD9\u4E00\u884C","fieldList.empty":"\u6682\u65E0\u6570\u636E","fieldList.select":"\u8BF7\u9009\u62E9","fieldList.required":"{label}\u4E0D\u80FD\u4E3A\u7A7A","chat.label":"\u6D88\u606F\u5217\u8868","chat.placeholder":"\u8F93\u5165\u6D88\u606F\uFF0CEnter \u53D1\u9001","chat.send":"\u53D1\u9001","chat.sending":"\u53D1\u9001\u4E2D\u2026","chat.failed":"\u53D1\u9001\u5931\u8D25","chat.empty":"\u6682\u65E0\u6D88\u606F","chat.image":"\u56FE\u7247\u6D88\u606F","chat.me":"\u6211","orgChart.empty":"\u6682\u65E0\u7EC4\u7EC7\u6570\u636E","orgChart.toggle":"\u5C55\u5F00\u6216\u6536\u8D77","pageTabs.label":"\u9875\u9762\u6807\u7B7E","pageTabs.close":"\u5173\u95ED"};var ba={"common.close":"Close","common.cancel":"Cancel","common.confirm":"OK","common.selected":"{count} selected","common.dialog":"Dialog","common.noOptions":"No options","common.removeTag":"Remove tag","pagination.total":"{total} items","pagination.pageSize":"{size} / page","pagination.jump":"Go to","pagination.pageUnit":"","pagination.first":"First","pagination.prev":"Previous","pagination.next":"Next","pagination.last":"Last","pagination.page":"Page {page}","pagination.pageSizeLabel":"Rows per page","pagination.jumpLabel":"Go to page","table.loading":"Loading\u2026","table.empty":"No data","table.selectAll":"Select all rows","table.selectRow":"Select row","table.scrollRegion":"Table data","empty.title":"No data","datePicker.placeholder":"Select date","datePicker.rangePlaceholder":"Select date range","datePicker.rangeEnd":"End date","datePicker.today":"Today","datePicker.clear":"Clear","datePicker.title":"{month}/{year}","datePicker.weeks":"Mo,Tu,We,Th,Fr,Sa,Su","calendar.title":"{month}/{year}","calendar.prevMonth":"Previous month","calendar.nextMonth":"Next month","calendar.grid":"Dates","treeSelect.placeholder":"Please select","treeSelect.search":"Search","treeSelect.empty":"No matching nodes","treeSelect.clear":"Clear","treeSelect.clearSearch":"Clear search","treeSelect.remove":"Remove {label}","treeSelect.expand":"Expand","treeSelect.collapse":"Collapse","cascader.empty":"No options","steps.order":"Step {index}","password.aria":"Password","password.show":"Show password","password.hide":"Hide password","password.weak":"Weak","password.medium":"Medium","password.strong":"Strong","password.hint":"At least 8 characters, mix upper and lower case with symbols","password.strength":"Password strength: {level}","contextMenu.empty":"No actions available","tree.empty":"No nodes","confirm.title":"Confirm","confirm.confirm":"OK","confirm.cancel":"Cancel","upload.dropText":"Drop files here, or click to select","upload.dropHint":"Multiple files supported","upload.select":"Select files","upload.count":"{count} files added","upload.clear":"Remove all","upload.empty":"No files selected","upload.uploading":"Uploading {percent}%","upload.done":"Uploaded","upload.ready":"Pending","upload.failed":"Upload failed","upload.retry":"Retry","upload.start":"Upload","upload.remove":"Remove","upload.limitHint":"Up to {count} files","upload.sizeHint":"Max {size} each","select.placeholder":"Please select","select.empty":"No matches","select.clear":"Clear","orgPicker.placeholder":"Select people","orgPicker.title":"Select people","orgPicker.search":"Search name or title","orgPicker.deptTree":"Departments","orgPicker.allStaff":"All people","orgPicker.expand":"Expand or collapse department","orgPicker.selected":"{count} selected","orgPicker.clearSelected":"Clear","orgPicker.clear":"Clear","orgPicker.empty":"No matching people","queryFilter.search":"Search","queryFilter.reset":"Reset","queryFilter.expand":"More","queryFilter.collapse":"Less","mediaPicker.select":"Choose asset","mediaPicker.title":"Media library","mediaPicker.search":"Search assets","mediaPicker.empty":"No matching assets","mediaPicker.total":"{total} assets","mediaPicker.limit":"up to {limit}","image.preview":"Preview image","image.close":"Close preview","image.dialog":"Image preview","image.failed":"Failed to load image","tour.label":"Guided tour","tour.close":"Close tour","tour.prev":"Previous","tour.next":"Next","tour.finish":"Done","richEditor.aria":"Rich text editor","richEditor.placeholder":"Type something\u2026","richEditor.bold":"Bold","richEditor.italic":"Italic","richEditor.underline":"Underline","richEditor.strike":"Strikethrough","richEditor.heading":"Heading 2","richEditor.paragraph":"Paragraph","richEditor.bulletList":"Bullet list","richEditor.numberList":"Numbered list","richEditor.link":"Insert link","richEditor.linkPrompt":"Enter link URL","richEditor.clearFormat":"Clear","richEditor.undo":"Undo","richEditor.redo":"Redo","richEditor.source":"Source","richEditor.visual":"Visual","approval.start":"Started","approval.cc":"CC","approval.approved":"Approved","approval.rejected":"Rejected","approval.pending":"In review","approval.waiting":"Waiting","approval.empty":"No approval records","kanban.board":"Kanban board","kanban.empty":"No cards","kanban.addCard":"Add card","attachment.empty":"No attachments","attachment.preview":"Preview","attachment.download":"Download","attachment.remove":"Remove","notification.unread":"{count} unread","notification.readAll":"Mark all read","notification.clear":"Clear all","notification.clearConfirm":"Confirm clear","notification.empty":"No notifications","dateTimePicker.placeholder":"Select date and time","dateTimePicker.now":"Now","dateTimePicker.clear":"Clear","dateTimePicker.prevMonth":"Previous month","dateTimePicker.nextMonth":"Next month","virtualList.empty":"No data","batchBar.selected":"{count} selected","batchBar.selectAll":"Select all {total}","batchBar.clear":"Clear selection","importWizard.stepFile":"Choose file","importWizard.stepMapping":"Map fields","importWizard.stepResult":"Result","importWizard.pick":"Choose a file","importWizard.dragTip":"Drop a file here or click to choose ({accept})","importWizard.acceptError":"Only {accept} files are allowed","importWizard.sizeError":"File must be under {size} MB","importWizard.reselect":"Choose another","importWizard.sourcePlaceholder":"Select a source column","importWizard.missingRequired":"Required fields not mapped: {fields}","importWizard.prev":"Back","importWizard.submit":"Start import","importWizard.importing":"Importing\u2026","importWizard.statTotal":"Total","importWizard.statSuccess":"Succeeded","importWizard.statFailed":"Failed","importWizard.rowNo":"Row {row}","importWizard.retry":"Back to edit","importWizard.restart":"Import again","diff.before":"Before","diff.after":"After","diff.same":"No changes","diff.expand":"Show {count} unchanged lines","treeTable.empty":"No data","treeTable.loading":"Loading\u2026","treeTable.selectAll":"Select all","treeTable.expand":"Expand","treeTable.collapse":"Collapse","schedule.title":"Schedule","schedule.weekdays":"Mon,Tue,Wed,Thu,Fri,Sat,Sun","schedule.prevWeek":"Previous week","schedule.nextWeek":"Next week","schedule.today":"This week","comment.placeholder":"Write a comment\u2026","comment.replyPlaceholder":"Reply to {name}","comment.replyingTo":"Replying to {name}","comment.cancelReply":"Cancel reply","comment.submit":"Post","comment.submitting":"Posting\u2026","comment.reply":"Reply","comment.remove":"Delete","comment.empty":"No comments yet","signature.label":"Signature","signature.hint":"Sign here","signature.clear":"Clear","print.button":"Print","gantt.task":"Task","gantt.empty":"No tasks","fieldList.add":"Add row","fieldList.remove":"Remove row","fieldList.empty":"No rows","fieldList.select":"Select","fieldList.required":"{label} is required","chat.label":"Messages","chat.placeholder":"Type a message, Enter to send","chat.send":"Send","chat.sending":"Sending\u2026","chat.failed":"Failed","chat.empty":"No messages","chat.image":"Image message","chat.me":"Me","orgChart.empty":"No organization data","orgChart.toggle":"Expand or collapse","pageTabs.label":"Page tabs","pageTabs.close":"Close"};var Ve=il({code:"zh-CN",messages:{"zh-CN":Qe,"en-US":ba}});function He(e){Ve.messages[e]&&(Ve.code=e)}function ll(){return Ve.code}function C(e,t){let a=Ve.messages[Ve.code]||Qe,n=e in a?a[e]:e in Qe?Qe[e]:e;return t&&Object.keys(t).forEach(i=>{n=n.split("{"+i+"}").join(t[i])}),n}var Z={position:"fixed",left:"0px",top:"0px",visibility:"hidden"};function G({root:e,panel:t,onClose:a,onReposition:n,esc:i=!0}){let l=s=>typeof s=="function"?s():s;function o(s){let d=l(e),f=l(t);d&&d.contains(s.target)||f&&f.contains(s.target)||a()}function r(s){s.key==="Escape"&&a()}return document.addEventListener("mousedown",o,!0),i&&document.addEventListener("keydown",r),n&&(window.addEventListener("resize",n),window.addEventListener("scroll",n,!0)),function(){document.removeEventListener("mousedown",o,!0),i&&document.removeEventListener("keydown",r),n&&(window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0))}}function se(e,t){return window.innerHeight-e.bottom<t+8&&e.top>t}function de({rect:e,flip:t,gap:a=4,width:n,clampWidth:i,maxHeight:l}){let o={position:"fixed",visibility:"visible"},r=e.left;return i!=null&&(r=Math.max(8,Math.min(e.left,window.innerWidth-i-8))),o.left=r+"px",n!=null&&(o.width=n+"px"),t?(o.bottom=window.innerHeight-e.top+a+"px",o.top="auto"):(o.top=e.bottom+a+"px",o.bottom="auto"),l!=null&&(o.maxHeight=l+"px"),o}var sl=0,Te={name:"DjmSelect",components:{DjmIcon:L},props:{modelValue:{type:[String,Number,Boolean,Array],default:""},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{type:Number,default:0},emptyText:{type:String,default:""},virtual:{type:Boolean,default:!1},optionHeight:{type:Number,default:30},overscan:{type:Number,default:5}},emits:["update:modelValue","change","clear","visible-change","focus","blur"],setup(e,{emit:t}){let a="djm-select-"+ ++sl,n=be(null),i=be(null),l=be(null),o=be(!1),r=be(""),s=be(-1),d=be({}),f=be(0),c=be(0),p=null;function g(N){return N&&typeof N=="object"?{label:N.label,value:N.value,disabled:!!N.disabled}:{label:N,value:N,disabled:!1}}let m=re(()=>e.options.some(N=>N&&typeof N=="object"&&Array.isArray(N.options))),h=re(()=>{let N=[];return e.options.forEach(K=>{K&&typeof K=="object"&&Array.isArray(K.options)?K.options.forEach(_=>N.push(g(_))):N.push(g(K))}),N}),b=re(()=>{let N=r.value.trim().toLowerCase();return N?h.value.filter(K=>String(K.label).toLowerCase().includes(N)):h.value}),j=re(()=>{let N=r.value.trim().toLowerCase(),K=oe=>!N||String(oe.label).toLowerCase().includes(N),_=[],ae=0;return e.options.forEach(oe=>{if(oe&&typeof oe=="object"&&Array.isArray(oe.options)){let ce=[];oe.options.forEach(fe=>{let ue=g(fe);K(ue)&&ce.push({option:ue,index:ae++})}),ce.length&&_.push({label:oe.label,items:ce})}else{let ce=g(oe);K(ce)&&_.push({label:null,items:[{option:ce,index:ae++}]})}}),_}),w=re(()=>e.multiple?Array.isArray(e.modelValue)?e.modelValue:[]:e.modelValue===""||e.modelValue===null||e.modelValue===void 0?[]:[e.modelValue]),y=re(()=>w.value.length>0),u=re(()=>w.value.map(N=>h.value.find(K=>K.value===N)||{label:String(N),value:N})),v=re(()=>!e.maxTagCount||e.maxTagCount<=0?u.value:u.value.slice(0,e.maxTagCount)),T=re(()=>Math.max(0,u.value.length-v.value.length)),D=re(()=>u.value.length?e.multiple?u.value.map(N=>N.label).join("\u3001"):u.value[0].label:""),x=re(()=>e.placeholder||C("select.placeholder")),z=re(()=>e.emptyText||C("select.empty")),S=re(()=>e.virtual&&!m.value&&b.value.length>0),M=re(()=>Math.max(16,e.optionHeight)),I=re(()=>{let N=b.value;if(!S.value)return N.map((ce,fe)=>({option:ce,index:fe}));let K=M.value,_=c.value||220,ae=Math.max(0,Math.floor(f.value/K)-e.overscan),oe=Math.min(N.length,Math.ceil((f.value+_)/K)+e.overscan);return N.slice(ae,oe).map((ce,fe)=>({option:ce,index:ae+fe}))}),A=re(()=>!S.value||!I.value.length?0:I.value[0].index*M.value),V=re(()=>{if(!S.value||!I.value.length)return 0;let N=I.value[I.value.length-1].index;return Math.max(0,(b.value.length-N-1)*M.value)});function H(N){if(!S.value)return;let K=N.target;f.value=K.scrollTop,c.value=K.clientHeight}let Y=re(()=>{if(!(!o.value||s.value<0))return a+"-opt-"+s.value});function X(N){return w.value.includes(N.value)}function R(){let N=b.value;if(!N.length)return-1;let K=N.findIndex(_=>X(_)&&!_.disabled);return K!==-1?K:N.findIndex(_=>!_.disabled)}function F(){e.disabled||o.value||(o.value=!0,s.value=R(),t("visible-change",!0),p=G({root:()=>n.value,panel:()=>i.value,onClose:()=>U(),onReposition:te,esc:!1}),nt(()=>{e.filterable&&l.value&&l.value.focus(),te(),i.value&&(i.value.scrollTop=0,c.value=i.value.clientHeight,f.value=0),k()}))}function U(N=!0){o.value&&(o.value=!1,N&&(r.value=""),d.value={},p&&(p(),p=null),t("visible-change",!1))}function te(){if(!o.value||!n.value)return;let N=n.value.getBoundingClientRect(),K=i.value?i.value.offsetHeight:220,_=window.innerHeight-N.bottom-8,ae=_<Math.min(K,160)&&N.top>_,oe=Math.max(120,ae?N.top-12:_);d.value={position:"fixed",left:N.left+"px",width:N.width+"px",top:ae?"auto":N.bottom+4+"px",bottom:ae?window.innerHeight-N.top+4+"px":"auto",maxHeight:Math.min(220,oe)+"px"}}function Q(){e.disabled||(o.value?U():F())}function le(N){e.disabled||N.target.closest(".djm-select-clear")||N.target.closest(".djm-select-tag-close")||e.filterable&&o.value&&N.target.tagName==="INPUT"||(e.filterable||N.preventDefault(),Q())}function P(N){t("update:modelValue",N),t("change",N)}function O(N){if(!(!N||N.disabled))if(e.multiple){let K=w.value.slice(),_=K.indexOf(N.value);_===-1?K.push(N.value):K.splice(_,1),P(K),nt(k)}else P(N.value),U(),e.filterable&&l.value&&l.value.blur()}function W(N){e.disabled||P(w.value.filter(K=>K!==N))}function ne(){e.disabled||(P(e.multiple?[]:""),t("clear"),U())}function k(){if(!i.value||s.value<0)return;if(S.value){let ae=M.value,oe=s.value*ae,ce=i.value.clientHeight;oe<i.value.scrollTop?i.value.scrollTop=oe:oe+ae>i.value.scrollTop+ce&&(i.value.scrollTop=oe+ae-ce),f.value=i.value.scrollTop;return}let N=i.value.querySelector('[data-index="'+s.value+'"]');if(!N)return;let K=N.offsetTop,_=K+N.offsetHeight;K<i.value.scrollTop?i.value.scrollTop=K:_>i.value.scrollTop+i.value.clientHeight&&(i.value.scrollTop=_-i.value.clientHeight)}function E(N){let K=b.value;if(!K.length||e.disabled)return;if(!o.value){F();return}let _=s.value;for(let ae=0;ae<K.length&&(_=(_+N+K.length)%K.length,!!K[_].disabled);ae++);s.value=_,nt(k)}function B(N){r.value=N.target.value,o.value||F(),i.value&&(i.value.scrollTop=0,f.value=0),s.value=R(),nt(k)}function $(N){if(!e.disabled)switch(N.key){case"ArrowDown":N.preventDefault(),E(1);break;case"ArrowUp":N.preventDefault(),E(-1);break;case"Enter":N.preventDefault(),o.value?O(b.value[s.value]):F();break;case"Escape":o.value&&(N.preventDefault(),U());break;case"Tab":U();break;case"Backspace":e.multiple&&e.filterable&&!r.value&&w.value.length&&(N.preventDefault(),W(w.value[w.value.length-1]));break;default:break}}function q(N){if(e.disabled)return;let K=N.relatedTarget;K&&n.value&&n.value.contains(K)||K&&i.value&&i.value.contains(K)||t("focus",N)}function ie(N){let K=N.relatedTarget;K&&n.value&&n.value.contains(K)||K&&i.value&&i.value.contains(K)||t("blur",N)}return rl(()=>e.modelValue,()=>{o.value||(s.value=-1)}),ol(()=>{p&&(p(),p=null)}),{instanceId:a,root:n,panel:i,panelStyle:d,searchRef:l,open:o,query:r,activeIndex:s,isGrouped:m,visibleOptions:b,visibleGroups:j,virtualEnabled:S,renderedOptions:I,optionPadTop:A,optionPadBottom:V,onPanelScroll:H,selectedOptions:u,visibleTags:v,restTagCount:T,displayText:D,placeholderText:x,emptyLabel:z,activeDescendant:Y,hasValue:y,isSelected:X,toggle:Q,openPanel:F,closePanel:U,onTriggerMousedown:le,selectOption:O,removeTag:W,clear:ne,onInput:B,onKeydown:$,onFocusIn:q,onFocusOut:ie,t:C}},template:`
|
|
84
|
+
`};import{computed as ce,nextTick as st,onBeforeUnmount as pl,ref as ke,watch as hl}from"vue";import{reactive as ml}from"vue";var it={"common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","common.confirm":"\u786E\u5B9A","common.selected":"\u5DF2\u9009 {count} \u9879","common.dialog":"\u5BF9\u8BDD\u6846","common.noOptions":"\u6682\u65E0\u9009\u9879","common.removeTag":"\u79FB\u9664\u6807\u7B7E","pagination.total":"\u5171 {total} \u6761","pagination.pageSize":"\u6BCF\u9875 {size} \u6761","pagination.jump":"\u8DF3\u81F3","pagination.pageUnit":"\u9875","pagination.first":"\u9996\u9875","pagination.prev":"\u4E0A\u4E00\u9875","pagination.next":"\u4E0B\u4E00\u9875","pagination.last":"\u672B\u9875","pagination.page":"\u7B2C {page} \u9875","pagination.pageSizeLabel":"\u6BCF\u9875\u6761\u6570","pagination.jumpLabel":"\u8DF3\u81F3\u9875\u7801","table.loading":"\u6B63\u5728\u52A0\u8F7D\u6570\u636E\u2026","table.empty":"\u6682\u65E0\u6570\u636E","table.selectAll":"\u5168\u9009\u5F53\u524D\u9875","table.selectRow":"\u9009\u62E9\u8BE5\u884C","table.scrollRegion":"\u8868\u683C\u6570\u636E\u533A","empty.title":"\u6682\u65E0\u6570\u636E","datePicker.placeholder":"\u9009\u62E9\u65E5\u671F","datePicker.rangePlaceholder":"\u9009\u62E9\u65E5\u671F\u8303\u56F4","datePicker.rangeEnd":"\u7ED3\u675F\u65E5\u671F","datePicker.today":"\u4ECA\u5929","datePicker.clear":"\u6E05\u7A7A","datePicker.title":"{year} \u5E74 {month} \u6708","datePicker.weeks":"\u4E00,\u4E8C,\u4E09,\u56DB,\u4E94,\u516D,\u65E5","calendar.title":"{year} \u5E74 {month} \u6708","calendar.prevMonth":"\u4E0A\u4E00\u6708","calendar.nextMonth":"\u4E0B\u4E00\u6708","calendar.grid":"\u65E5\u671F","treeSelect.placeholder":"\u8BF7\u9009\u62E9","treeSelect.search":"\u641C\u7D22\u8282\u70B9","treeSelect.empty":"\u6CA1\u6709\u5339\u914D\u7684\u8282\u70B9","treeSelect.clear":"\u6E05\u7A7A","treeSelect.clearSearch":"\u6E05\u7A7A\u641C\u7D22","treeSelect.remove":"\u79FB\u9664 {label}","treeSelect.expand":"\u5C55\u5F00","treeSelect.collapse":"\u6536\u8D77","cascader.empty":"\u6682\u65E0\u9009\u9879","steps.order":"\u7B2C {index} \u6B65","password.aria":"\u5BC6\u7801","password.show":"\u663E\u793A\u5BC6\u7801","password.hide":"\u9690\u85CF\u5BC6\u7801","password.weak":"\u5F31","password.medium":"\u4E2D","password.strong":"\u5F3A","password.hint":"\u81F3\u5C11 8 \u4F4D\uFF0C\u5EFA\u8BAE\u6DF7\u5408\u5927\u5C0F\u5199\u4E0E\u7B26\u53F7","password.strength":"\u5BC6\u7801\u5F3A\u5EA6\uFF1A{level}","contextMenu.empty":"\u6CA1\u6709\u53EF\u6267\u884C\u7684\u64CD\u4F5C","tree.empty":"\u6682\u65E0\u8282\u70B9","confirm.title":"\u64CD\u4F5C\u786E\u8BA4","confirm.confirm":"\u786E\u5B9A","confirm.cancel":"\u53D6\u6D88","upload.dropText":"\u62D6\u62FD\u6587\u4EF6\u5230\u8FD9\u91CC\uFF0C\u6216\u70B9\u51FB\u9009\u62E9","upload.dropHint":"\u652F\u6301\u591A\u9009\uFF0C\u53EF\u62D6\u62FD\u6216\u70B9\u51FB\u4E0A\u4F20","upload.select":"\u9009\u62E9\u6587\u4EF6","upload.count":"\u5DF2\u6DFB\u52A0 {count} \u4E2A\u6587\u4EF6","upload.clear":"\u5168\u90E8\u79FB\u9664","upload.empty":"\u5C1A\u672A\u9009\u62E9\u6587\u4EF6","upload.uploading":"\u4E0A\u4F20\u4E2D {percent}%","upload.done":"\u4E0A\u4F20\u5B8C\u6210","upload.ready":"\u5F85\u4E0A\u4F20","upload.failed":"\u4E0A\u4F20\u5931\u8D25","upload.retry":"\u91CD\u8BD5","upload.start":"\u4E0A\u4F20","upload.remove":"\u79FB\u9664","upload.limitHint":"\u6700\u591A {count} \u4E2A\u6587\u4EF6","upload.sizeHint":"\u5355\u4E2A\u4E0D\u8D85\u8FC7 {size}","select.placeholder":"\u8BF7\u9009\u62E9","select.empty":"\u65E0\u5339\u914D\u9879","select.clear":"\u6E05\u7A7A","orgPicker.placeholder":"\u9009\u62E9\u4EBA\u5458","orgPicker.title":"\u9009\u62E9\u4EBA\u5458","orgPicker.search":"\u641C\u7D22\u59D3\u540D\u6216\u804C\u4F4D","orgPicker.deptTree":"\u90E8\u95E8","orgPicker.allStaff":"\u5168\u90E8\u4EBA\u5458","orgPicker.expand":"\u5C55\u5F00\u6216\u6536\u8D77\u90E8\u95E8","orgPicker.selected":"\u5DF2\u9009 {count} \u4EBA","orgPicker.clearSelected":"\u6E05\u7A7A\u5DF2\u9009","orgPicker.clear":"\u6E05\u7A7A","orgPicker.empty":"\u6CA1\u6709\u5339\u914D\u7684\u4EBA\u5458","queryFilter.search":"\u67E5\u8BE2","queryFilter.reset":"\u91CD\u7F6E","queryFilter.expand":"\u5C55\u5F00","queryFilter.collapse":"\u6536\u8D77","mediaPicker.select":"\u9009\u62E9\u7D20\u6750","mediaPicker.title":"\u5A92\u4F53\u5E93","mediaPicker.search":"\u641C\u7D22\u7D20\u6750\u540D\u79F0","mediaPicker.empty":"\u6CA1\u6709\u5339\u914D\u7684\u7D20\u6750","mediaPicker.total":"\u5171 {total} \u4E2A\u7D20\u6750","mediaPicker.limit":"\u6700\u591A\u9009 {limit} \u4E2A","image.preview":"\u9884\u89C8\u56FE\u7247","image.close":"\u5173\u95ED\u9884\u89C8","image.dialog":"\u56FE\u7247\u9884\u89C8","image.failed":"\u56FE\u7247\u52A0\u8F7D\u5931\u8D25","tour.label":"\u64CD\u4F5C\u5F15\u5BFC","tour.close":"\u5173\u95ED\u5F15\u5BFC","tour.prev":"\u4E0A\u4E00\u6B65","tour.next":"\u4E0B\u4E00\u6B65","tour.finish":"\u5B8C\u6210","richEditor.aria":"\u5BCC\u6587\u672C\u7F16\u8F91\u5668","richEditor.placeholder":"\u8BF7\u8F93\u5165\u5185\u5BB9\u2026","richEditor.bold":"\u52A0\u7C97","richEditor.italic":"\u659C\u4F53","richEditor.underline":"\u4E0B\u5212\u7EBF","richEditor.strike":"\u5220\u9664\u7EBF","richEditor.paragraph":"\u6B63\u6587","richEditor.bulletList":"\u65E0\u5E8F\u5217\u8868","richEditor.numberList":"\u6709\u5E8F\u5217\u8868","richEditor.link":"\u63D2\u5165\u94FE\u63A5","richEditor.linkPrompt":"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740","richEditor.clearFormat":"\u6E05\u9664","richEditor.undo":"\u64A4\u9500","richEditor.redo":"\u91CD\u505A","richEditor.source":"\u6E90\u7801","richEditor.visual":"\u53EF\u89C6\u5316","richEditor.toolbar":"\u7F16\u8F91\u5DE5\u5177\u680F","richEditor.block":"\u6BB5\u843D\u683C\u5F0F","richEditor.heading1":"\u6807\u9898 1","richEditor.heading2":"\u6807\u9898 2","richEditor.heading3":"\u6807\u9898 3","richEditor.quote":"\u5F15\u7528","richEditor.codeBlock":"\u4EE3\u7801\u5757","richEditor.fontSize":"\u5B57\u53F7","richEditor.defaultSize":"\u9ED8\u8BA4","richEditor.inlineCode":"\u884C\u5185\u4EE3\u7801","richEditor.textColor":"\u6587\u5B57\u989C\u8272","richEditor.bgColor":"\u80CC\u666F\u8272","richEditor.alignLeft":"\u5DE6\u5BF9\u9F50","richEditor.alignCenter":"\u5C45\u4E2D","richEditor.alignRight":"\u53F3\u5BF9\u9F50","richEditor.alignJustify":"\u4E24\u7AEF\u5BF9\u9F50","richEditor.outdent":"\u51CF\u5C11\u7F29\u8FDB","richEditor.indent":"\u589E\u52A0\u7F29\u8FDB","richEditor.unlink":"\u53D6\u6D88\u94FE\u63A5","richEditor.image":"\u63D2\u5165\u56FE\u7247","richEditor.singleImage":"\u63D2\u5165\u5355\u56FE","richEditor.multiImage":"\u63D2\u5165\u591A\u56FE","richEditor.mediaLibrary":"\u4ECE\u7D20\u6750\u5E93\u9009\u62E9","richEditor.hr":"\u5206\u5272\u7EBF","richEditor.fullscreen":"\u5168\u5C4F","richEditor.exitFullscreen":"\u9000\u51FA\u5168\u5C4F","richEditor.wordCount":"\u5171 {count} \u5B57","richEditor.uploading":"\u6B63\u5728\u4E0A\u4F20 {count} \u5F20\u56FE\u7247\u2026","richEditor.uploadFailed":"\u56FE\u7247\u4E0A\u4F20\u5931\u8D25","richEditor.imageTypeError":"\u53EA\u80FD\u4E0A\u4F20\u56FE\u7247\u6587\u4EF6","richEditor.imageSizeError":"\u56FE\u7247\u4E0D\u80FD\u8D85\u8FC7 {size}MB","richEditor.imageUrlInvalid":"\u56FE\u7247\u5730\u5740\u4E0D\u5408\u6CD5\uFF0C\u5DF2\u62D2\u7EDD\u63D2\u5165","richEditor.linkInvalid":"\u94FE\u63A5\u53EA\u652F\u6301 http(s)\u3001mailto\u3001tel \u6216\u7AD9\u5185\u76F8\u5BF9\u5730\u5740","approval.start":"\u53D1\u8D77","approval.cc":"\u6284\u9001","approval.approved":"\u5DF2\u901A\u8FC7","approval.rejected":"\u5DF2\u9A73\u56DE","approval.pending":"\u5BA1\u6279\u4E2D","approval.waiting":"\u5F85\u5904\u7406","approval.empty":"\u6682\u65E0\u5BA1\u6279\u8BB0\u5F55","kanban.board":"\u770B\u677F","kanban.empty":"\u6682\u65E0\u5361\u7247","kanban.addCard":"\u65B0\u5EFA\u5361\u7247","attachment.empty":"\u6682\u65E0\u9644\u4EF6","attachment.preview":"\u9884\u89C8","attachment.download":"\u4E0B\u8F7D","attachment.remove":"\u5220\u9664","notification.unread":"\u672A\u8BFB {count} \u6761","notification.readAll":"\u5168\u90E8\u5DF2\u8BFB","notification.clear":"\u6E05\u7A7A","notification.clearConfirm":"\u786E\u8BA4\u6E05\u7A7A","notification.empty":"\u6682\u65E0\u901A\u77E5","dateTimePicker.placeholder":"\u9009\u62E9\u65E5\u671F\u65F6\u95F4","dateTimePicker.now":"\u6B64\u523B","dateTimePicker.clear":"\u6E05\u7A7A","dateTimePicker.prevMonth":"\u4E0A\u4E2A\u6708","dateTimePicker.nextMonth":"\u4E0B\u4E2A\u6708","virtualList.empty":"\u6682\u65E0\u6570\u636E","batchBar.selected":"\u5DF2\u9009 {count} \u9879","batchBar.selectAll":"\u5168\u9009 {total} \u9879","batchBar.clear":"\u53D6\u6D88\u9009\u62E9","importWizard.stepFile":"\u9009\u62E9\u6587\u4EF6","importWizard.stepMapping":"\u5B57\u6BB5\u6620\u5C04","importWizard.stepResult":"\u5BFC\u5165\u7ED3\u679C","importWizard.pick":"\u9009\u62E9\u6587\u4EF6","importWizard.dragTip":"\u628A\u6587\u4EF6\u62D6\u5230\u8FD9\u91CC\uFF0C\u6216\u70B9\u51FB\u9009\u62E9\uFF08{accept}\uFF09","importWizard.acceptError":"\u4EC5\u652F\u6301 {accept} \u683C\u5F0F","importWizard.sizeError":"\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7 {size} MB","importWizard.reselect":"\u91CD\u65B0\u9009\u62E9","importWizard.sourcePlaceholder":"\u8BF7\u9009\u62E9\u5BF9\u5E94\u7684\u6587\u4EF6\u5B57\u6BB5","importWizard.missingRequired":"\u5FC5\u586B\u5B57\u6BB5\u672A\u6620\u5C04\uFF1A{fields}","importWizard.prev":"\u4E0A\u4E00\u6B65","importWizard.submit":"\u5F00\u59CB\u5BFC\u5165","importWizard.importing":"\u5BFC\u5165\u4E2D\u2026","importWizard.statTotal":"\u603B\u6761\u6570","importWizard.statSuccess":"\u6210\u529F","importWizard.statFailed":"\u5931\u8D25","importWizard.rowNo":"\u7B2C {row} \u884C","importWizard.retry":"\u8FD4\u56DE\u4FEE\u6539","importWizard.restart":"\u91CD\u65B0\u5BFC\u5165","diff.before":"\u4FEE\u6539\u524D","diff.after":"\u4FEE\u6539\u540E","diff.same":"\u5185\u5BB9\u4E00\u81F4","diff.expand":"\u5C55\u5F00 {count} \u884C\u672A\u53D8\u66F4\u5185\u5BB9","treeTable.empty":"\u6682\u65E0\u6570\u636E","treeTable.loading":"\u6B63\u5728\u52A0\u8F7D\u2026","treeTable.selectAll":"\u5168\u9009","treeTable.expand":"\u5C55\u5F00","treeTable.collapse":"\u6536\u8D77","schedule.title":"\u65E5\u7A0B","schedule.weekdays":"\u5468\u4E00,\u5468\u4E8C,\u5468\u4E09,\u5468\u56DB,\u5468\u4E94,\u5468\u516D,\u5468\u65E5","schedule.prevWeek":"\u4E0A\u4E00\u5468","schedule.nextWeek":"\u4E0B\u4E00\u5468","schedule.today":"\u672C\u5468","comment.placeholder":"\u8BF4\u70B9\u4EC0\u4E48\u2026","comment.replyPlaceholder":"\u56DE\u590D {name}","comment.replyingTo":"\u6B63\u5728\u56DE\u590D {name}","comment.cancelReply":"\u53D6\u6D88\u56DE\u590D","comment.submit":"\u53D1\u5E03","comment.submitting":"\u53D1\u5E03\u4E2D\u2026","comment.reply":"\u56DE\u590D","comment.remove":"\u5220\u9664","comment.empty":"\u8FD8\u6CA1\u6709\u8BC4\u8BBA","signature.label":"\u624B\u5199\u7B7E\u540D","signature.hint":"\u8BF7\u5728\u6B64\u5904\u7B7E\u540D","signature.clear":"\u6E05\u7A7A","print.button":"\u6253\u5370","gantt.task":"\u4EFB\u52A1","gantt.empty":"\u6682\u65E0\u4EFB\u52A1","fieldList.add":"\u6DFB\u52A0\u4E00\u884C","fieldList.remove":"\u5220\u9664\u8FD9\u4E00\u884C","fieldList.empty":"\u6682\u65E0\u6570\u636E","fieldList.select":"\u8BF7\u9009\u62E9","fieldList.required":"{label}\u4E0D\u80FD\u4E3A\u7A7A","chat.label":"\u6D88\u606F\u5217\u8868","chat.placeholder":"\u8F93\u5165\u6D88\u606F\uFF0CEnter \u53D1\u9001","chat.send":"\u53D1\u9001","chat.sending":"\u53D1\u9001\u4E2D\u2026","chat.failed":"\u53D1\u9001\u5931\u8D25","chat.empty":"\u6682\u65E0\u6D88\u606F","chat.image":"\u56FE\u7247\u6D88\u606F","chat.me":"\u6211","orgChart.empty":"\u6682\u65E0\u7EC4\u7EC7\u6570\u636E","orgChart.toggle":"\u5C55\u5F00\u6216\u6536\u8D77","pageTabs.label":"\u9875\u9762\u6807\u7B7E","pageTabs.close":"\u5173\u95ED"};var Da={"common.close":"Close","common.cancel":"Cancel","common.confirm":"OK","common.selected":"{count} selected","common.dialog":"Dialog","common.noOptions":"No options","common.removeTag":"Remove tag","pagination.total":"{total} items","pagination.pageSize":"{size} / page","pagination.jump":"Go to","pagination.pageUnit":"","pagination.first":"First","pagination.prev":"Previous","pagination.next":"Next","pagination.last":"Last","pagination.page":"Page {page}","pagination.pageSizeLabel":"Rows per page","pagination.jumpLabel":"Go to page","table.loading":"Loading\u2026","table.empty":"No data","table.selectAll":"Select all rows","table.selectRow":"Select row","table.scrollRegion":"Table data","empty.title":"No data","datePicker.placeholder":"Select date","datePicker.rangePlaceholder":"Select date range","datePicker.rangeEnd":"End date","datePicker.today":"Today","datePicker.clear":"Clear","datePicker.title":"{month}/{year}","datePicker.weeks":"Mo,Tu,We,Th,Fr,Sa,Su","calendar.title":"{month}/{year}","calendar.prevMonth":"Previous month","calendar.nextMonth":"Next month","calendar.grid":"Dates","treeSelect.placeholder":"Please select","treeSelect.search":"Search","treeSelect.empty":"No matching nodes","treeSelect.clear":"Clear","treeSelect.clearSearch":"Clear search","treeSelect.remove":"Remove {label}","treeSelect.expand":"Expand","treeSelect.collapse":"Collapse","cascader.empty":"No options","steps.order":"Step {index}","password.aria":"Password","password.show":"Show password","password.hide":"Hide password","password.weak":"Weak","password.medium":"Medium","password.strong":"Strong","password.hint":"At least 8 characters, mix upper and lower case with symbols","password.strength":"Password strength: {level}","contextMenu.empty":"No actions available","tree.empty":"No nodes","confirm.title":"Confirm","confirm.confirm":"OK","confirm.cancel":"Cancel","upload.dropText":"Drop files here, or click to select","upload.dropHint":"Multiple files supported","upload.select":"Select files","upload.count":"{count} files added","upload.clear":"Remove all","upload.empty":"No files selected","upload.uploading":"Uploading {percent}%","upload.done":"Uploaded","upload.ready":"Pending","upload.failed":"Upload failed","upload.retry":"Retry","upload.start":"Upload","upload.remove":"Remove","upload.limitHint":"Up to {count} files","upload.sizeHint":"Max {size} each","select.placeholder":"Please select","select.empty":"No matches","select.clear":"Clear","orgPicker.placeholder":"Select people","orgPicker.title":"Select people","orgPicker.search":"Search name or title","orgPicker.deptTree":"Departments","orgPicker.allStaff":"All people","orgPicker.expand":"Expand or collapse department","orgPicker.selected":"{count} selected","orgPicker.clearSelected":"Clear","orgPicker.clear":"Clear","orgPicker.empty":"No matching people","queryFilter.search":"Search","queryFilter.reset":"Reset","queryFilter.expand":"More","queryFilter.collapse":"Less","mediaPicker.select":"Choose asset","mediaPicker.title":"Media library","mediaPicker.search":"Search assets","mediaPicker.empty":"No matching assets","mediaPicker.total":"{total} assets","mediaPicker.limit":"up to {limit}","image.preview":"Preview image","image.close":"Close preview","image.dialog":"Image preview","image.failed":"Failed to load image","tour.label":"Guided tour","tour.close":"Close tour","tour.prev":"Previous","tour.next":"Next","tour.finish":"Done","richEditor.aria":"Rich text editor","richEditor.placeholder":"Type something\u2026","richEditor.bold":"Bold","richEditor.italic":"Italic","richEditor.underline":"Underline","richEditor.strike":"Strikethrough","richEditor.paragraph":"Paragraph","richEditor.bulletList":"Bullet list","richEditor.numberList":"Numbered list","richEditor.link":"Insert link","richEditor.linkPrompt":"Enter link URL","richEditor.clearFormat":"Clear","richEditor.undo":"Undo","richEditor.redo":"Redo","richEditor.source":"Source","richEditor.visual":"Visual","richEditor.toolbar":"Formatting toolbar","richEditor.block":"Paragraph style","richEditor.heading1":"Heading 1","richEditor.heading2":"Heading 2","richEditor.heading3":"Heading 3","richEditor.quote":"Quote","richEditor.codeBlock":"Code block","richEditor.fontSize":"Font size","richEditor.defaultSize":"Default","richEditor.inlineCode":"Inline code","richEditor.textColor":"Text color","richEditor.bgColor":"Background color","richEditor.alignLeft":"Align left","richEditor.alignCenter":"Align center","richEditor.alignRight":"Align right","richEditor.alignJustify":"Justify","richEditor.outdent":"Decrease indent","richEditor.indent":"Increase indent","richEditor.unlink":"Remove link","richEditor.image":"Insert image","richEditor.singleImage":"Insert single image","richEditor.multiImage":"Insert multiple images","richEditor.mediaLibrary":"Choose from media library","richEditor.hr":"Divider","richEditor.fullscreen":"Fullscreen","richEditor.exitFullscreen":"Exit fullscreen","richEditor.wordCount":"{count} characters","richEditor.uploading":"Uploading {count} image(s)\u2026","richEditor.uploadFailed":"Image upload failed","richEditor.imageTypeError":"Only image files are allowed","richEditor.imageSizeError":"Image must be smaller than {size}MB","richEditor.imageUrlInvalid":"Invalid image URL, insertion rejected","richEditor.linkInvalid":"Only http(s), mailto, tel or relative URLs are allowed","approval.start":"Started","approval.cc":"CC","approval.approved":"Approved","approval.rejected":"Rejected","approval.pending":"In review","approval.waiting":"Waiting","approval.empty":"No approval records","kanban.board":"Kanban board","kanban.empty":"No cards","kanban.addCard":"Add card","attachment.empty":"No attachments","attachment.preview":"Preview","attachment.download":"Download","attachment.remove":"Remove","notification.unread":"{count} unread","notification.readAll":"Mark all read","notification.clear":"Clear all","notification.clearConfirm":"Confirm clear","notification.empty":"No notifications","dateTimePicker.placeholder":"Select date and time","dateTimePicker.now":"Now","dateTimePicker.clear":"Clear","dateTimePicker.prevMonth":"Previous month","dateTimePicker.nextMonth":"Next month","virtualList.empty":"No data","batchBar.selected":"{count} selected","batchBar.selectAll":"Select all {total}","batchBar.clear":"Clear selection","importWizard.stepFile":"Choose file","importWizard.stepMapping":"Map fields","importWizard.stepResult":"Result","importWizard.pick":"Choose a file","importWizard.dragTip":"Drop a file here or click to choose ({accept})","importWizard.acceptError":"Only {accept} files are allowed","importWizard.sizeError":"File must be under {size} MB","importWizard.reselect":"Choose another","importWizard.sourcePlaceholder":"Select a source column","importWizard.missingRequired":"Required fields not mapped: {fields}","importWizard.prev":"Back","importWizard.submit":"Start import","importWizard.importing":"Importing\u2026","importWizard.statTotal":"Total","importWizard.statSuccess":"Succeeded","importWizard.statFailed":"Failed","importWizard.rowNo":"Row {row}","importWizard.retry":"Back to edit","importWizard.restart":"Import again","diff.before":"Before","diff.after":"After","diff.same":"No changes","diff.expand":"Show {count} unchanged lines","treeTable.empty":"No data","treeTable.loading":"Loading\u2026","treeTable.selectAll":"Select all","treeTable.expand":"Expand","treeTable.collapse":"Collapse","schedule.title":"Schedule","schedule.weekdays":"Mon,Tue,Wed,Thu,Fri,Sat,Sun","schedule.prevWeek":"Previous week","schedule.nextWeek":"Next week","schedule.today":"This week","comment.placeholder":"Write a comment\u2026","comment.replyPlaceholder":"Reply to {name}","comment.replyingTo":"Replying to {name}","comment.cancelReply":"Cancel reply","comment.submit":"Post","comment.submitting":"Posting\u2026","comment.reply":"Reply","comment.remove":"Delete","comment.empty":"No comments yet","signature.label":"Signature","signature.hint":"Sign here","signature.clear":"Clear","print.button":"Print","gantt.task":"Task","gantt.empty":"No tasks","fieldList.add":"Add row","fieldList.remove":"Remove row","fieldList.empty":"No rows","fieldList.select":"Select","fieldList.required":"{label} is required","chat.label":"Messages","chat.placeholder":"Type a message, Enter to send","chat.send":"Send","chat.sending":"Sending\u2026","chat.failed":"Failed","chat.empty":"No messages","chat.image":"Image message","chat.me":"Me","orgChart.empty":"No organization data","orgChart.toggle":"Expand or collapse","pageTabs.label":"Page tabs","pageTabs.close":"Close"};var Fe=ml({code:"zh-CN",messages:{"zh-CN":it,"en-US":Da}});function Ke(e){Fe.messages[e]&&(Fe.code=e)}function fl(){return Fe.code}function C(e,t){let a=Fe.messages[Fe.code]||it,i=e in a?a[e]:e in it?it[e]:e;return t&&Object.keys(t).forEach(n=>{i=i.split("{"+n+"}").join(t[n])}),i}var le={position:"fixed",left:"0px",top:"0px",visibility:"hidden"};function ae({root:e,panel:t,onClose:a,onReposition:i,esc:n=!0}){let l=s=>typeof s=="function"?s():s;function r(s){let d=l(e),p=l(t);d&&d.contains(s.target)||p&&p.contains(s.target)||a()}function o(s){s.key==="Escape"&&a()}return document.addEventListener("mousedown",r,!0),n&&document.addEventListener("keydown",o),i&&(window.addEventListener("resize",i),window.addEventListener("scroll",i,!0)),function(){document.removeEventListener("mousedown",r,!0),n&&document.removeEventListener("keydown",o),i&&(window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0))}}function ue(e,t){return window.innerHeight-e.bottom<t+8&&e.top>t}function me({rect:e,flip:t,gap:a=4,width:i,clampWidth:n,maxHeight:l}){let r={position:"fixed",visibility:"visible"},o=e.left;return n!=null&&(o=Math.max(8,Math.min(e.left,window.innerWidth-n-8))),r.left=o+"px",i!=null&&(r.width=i+"px"),t?(r.bottom=window.innerHeight-e.top+a+"px",r.top="auto"):(r.top=e.bottom+a+"px",r.bottom="auto"),l!=null&&(r.maxHeight=l+"px"),r}var vl=0,Ie={name:"DjmSelect",components:{DjmIcon:P},props:{modelValue:{type:[String,Number,Boolean,Array],default:""},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{type:Number,default:0},emptyText:{type:String,default:""},virtual:{type:Boolean,default:!1},optionHeight:{type:Number,default:30},overscan:{type:Number,default:5}},emits:["update:modelValue","change","clear","visible-change","focus","blur"],setup(e,{emit:t}){let a="djm-select-"+ ++vl,i=ke(null),n=ke(null),l=ke(null),r=ke(!1),o=ke(""),s=ke(-1),d=ke({}),p=ke(0),c=ke(0),h=null;function v(V){return V&&typeof V=="object"?{label:V.label,value:V.value,disabled:!!V.disabled}:{label:V,value:V,disabled:!1}}let u=ce(()=>e.options.some(V=>V&&typeof V=="object"&&Array.isArray(V.options))),g=ce(()=>{let V=[];return e.options.forEach(q=>{q&&typeof q=="object"&&Array.isArray(q.options)?q.options.forEach(M=>V.push(v(M))):V.push(v(q))}),V}),y=ce(()=>{let V=o.value.trim().toLowerCase();return V?g.value.filter(q=>String(q.label).toLowerCase().includes(V)):g.value}),j=ce(()=>{let V=o.value.trim().toLowerCase(),q=F=>!V||String(F.label).toLowerCase().includes(V),M=[],R=0;return e.options.forEach(F=>{if(F&&typeof F=="object"&&Array.isArray(F.options)){let J=[];F.options.forEach(Q=>{let Z=v(Q);q(Z)&&J.push({option:Z,index:R++})}),J.length&&M.push({label:F.label,items:J})}else{let J=v(F);q(J)&&M.push({label:null,items:[{option:J,index:R++}]})}}),M}),w=ce(()=>e.multiple?Array.isArray(e.modelValue)?e.modelValue:[]:e.modelValue===""||e.modelValue===null||e.modelValue===void 0?[]:[e.modelValue]),b=ce(()=>w.value.length>0),m=ce(()=>w.value.map(V=>g.value.find(q=>q.value===V)||{label:String(V),value:V})),f=ce(()=>!e.maxTagCount||e.maxTagCount<=0?m.value:m.value.slice(0,e.maxTagCount)),E=ce(()=>Math.max(0,m.value.length-f.value.length)),D=ce(()=>m.value.length?e.multiple?m.value.map(V=>V.label).join("\u3001"):m.value[0].label:""),k=ce(()=>e.placeholder||C("select.placeholder")),B=ce(()=>e.emptyText||C("select.empty")),S=ce(()=>e.virtual&&!u.value&&y.value.length>0),T=ce(()=>Math.max(16,e.optionHeight)),L=ce(()=>{let V=y.value;if(!S.value)return V.map((J,Q)=>({option:J,index:Q}));let q=T.value,M=c.value||220,R=Math.max(0,Math.floor(p.value/q)-e.overscan),F=Math.min(V.length,Math.ceil((p.value+M)/q)+e.overscan);return V.slice(R,F).map((J,Q)=>({option:J,index:R+Q}))}),A=ce(()=>!S.value||!L.value.length?0:L.value[0].index*T.value),O=ce(()=>{if(!S.value||!L.value.length)return 0;let V=L.value[L.value.length-1].index;return Math.max(0,(y.value.length-V-1)*T.value)});function $(V){if(!S.value)return;let q=V.target;p.value=q.scrollTop,c.value=q.clientHeight}let X=ce(()=>{if(!(!r.value||s.value<0))return a+"-opt-"+s.value});function ee(V){return w.value.includes(V.value)}function H(){let V=y.value;if(!V.length)return-1;let q=V.findIndex(M=>ee(M)&&!M.disabled);return q!==-1?q:V.findIndex(M=>!M.disabled)}function U(){e.disabled||r.value||(r.value=!0,s.value=H(),t("visible-change",!0),h=ae({root:()=>i.value,panel:()=>n.value,onClose:()=>Y(),onReposition:ne,esc:!1}),st(()=>{e.filterable&&l.value&&l.value.focus(),ne(),n.value&&(n.value.scrollTop=0,c.value=n.value.clientHeight,p.value=0),x()}))}function Y(V=!0){r.value&&(r.value=!1,V&&(o.value=""),d.value={},h&&(h(),h=null),t("visible-change",!1))}function ne(){if(!r.value||!i.value)return;let V=i.value.getBoundingClientRect(),q=n.value?n.value.offsetHeight:220,M=window.innerHeight-V.bottom-8,R=M<Math.min(q,160)&&V.top>M,F=Math.max(120,R?V.top-12:M);d.value={position:"fixed",left:V.left+"px",width:V.width+"px",top:R?"auto":V.bottom+4+"px",bottom:R?window.innerHeight-V.top+4+"px":"auto",maxHeight:Math.min(220,F)+"px"}}function te(){e.disabled||(r.value?Y():U())}function re(V){e.disabled||V.target.closest(".djm-select-clear")||V.target.closest(".djm-select-tag-close")||e.filterable&&r.value&&V.target.tagName==="INPUT"||(e.filterable||V.preventDefault(),te())}function z(V){t("update:modelValue",V),t("change",V)}function K(V){if(!(!V||V.disabled))if(e.multiple){let q=w.value.slice(),M=q.indexOf(V.value);M===-1?q.push(V.value):q.splice(M,1),z(q),st(x)}else z(V.value),Y(),e.filterable&&l.value&&l.value.blur()}function _(V){e.disabled||z(w.value.filter(q=>q!==V))}function se(){e.disabled||(z(e.multiple?[]:""),t("clear"),Y())}function x(){if(!n.value||s.value<0)return;if(S.value){let R=T.value,F=s.value*R,J=n.value.clientHeight;F<n.value.scrollTop?n.value.scrollTop=F:F+R>n.value.scrollTop+J&&(n.value.scrollTop=F+R-J),p.value=n.value.scrollTop;return}let V=n.value.querySelector('[data-index="'+s.value+'"]');if(!V)return;let q=V.offsetTop,M=q+V.offsetHeight;q<n.value.scrollTop?n.value.scrollTop=q:M>n.value.scrollTop+n.value.clientHeight&&(n.value.scrollTop=M-n.value.clientHeight)}function I(V){let q=y.value;if(!q.length||e.disabled)return;if(!r.value){U();return}let M=s.value;for(let R=0;R<q.length&&(M=(M+V+q.length)%q.length,!!q[M].disabled);R++);s.value=M,st(x)}function N(V){o.value=V.target.value,r.value||U(),n.value&&(n.value.scrollTop=0,p.value=0),s.value=H(),st(x)}function W(V){if(!e.disabled)switch(V.key){case"ArrowDown":V.preventDefault(),I(1);break;case"ArrowUp":V.preventDefault(),I(-1);break;case"Enter":V.preventDefault(),r.value?K(y.value[s.value]):U();break;case"Escape":r.value&&(V.preventDefault(),Y());break;case"Tab":Y();break;case"Backspace":e.multiple&&e.filterable&&!o.value&&w.value.length&&(V.preventDefault(),_(w.value[w.value.length-1]));break;default:break}}function G(V){if(e.disabled)return;let q=V.relatedTarget;q&&i.value&&i.value.contains(q)||q&&n.value&&n.value.contains(q)||t("focus",V)}function de(V){let q=V.relatedTarget;q&&i.value&&i.value.contains(q)||q&&n.value&&n.value.contains(q)||t("blur",V)}return hl(()=>e.modelValue,()=>{r.value||(s.value=-1)}),pl(()=>{h&&(h(),h=null)}),{instanceId:a,root:i,panel:n,panelStyle:d,searchRef:l,open:r,query:o,activeIndex:s,isGrouped:u,visibleOptions:y,visibleGroups:j,virtualEnabled:S,renderedOptions:L,optionPadTop:A,optionPadBottom:O,onPanelScroll:$,selectedOptions:m,visibleTags:f,restTagCount:E,displayText:D,placeholderText:k,emptyLabel:B,activeDescendant:X,hasValue:b,isSelected:ee,toggle:te,openPanel:U,closePanel:Y,onTriggerMousedown:re,selectOption:K,removeTag:_,clear:se,onInput:N,onKeydown:W,onFocusIn:G,onFocusOut:de,t:C}},template:`
|
|
85
85
|
<div
|
|
86
86
|
ref="root"
|
|
87
87
|
class="djm-select djm-select-custom"
|
|
@@ -234,7 +234,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
234
234
|
</div>
|
|
235
235
|
</Teleport>
|
|
236
236
|
</div>
|
|
237
|
-
`};var
|
|
237
|
+
`};var dt={name:"DjmCheckbox",props:{modelValue:{type:[Boolean,Array],default:!1},value:{type:[String,Number,Boolean],default:void 0},label:{type:String,default:""},disabled:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},direction:{type:String,default:"horizontal"},min:{type:Number,default:0},max:{type:Number,default:0}},emits:["update:modelValue","change","exceed"],computed:{isGroup(){return Array.isArray(this.modelValue)},current(){return this.isGroup?this.modelValue:[]},checked(){return this.isGroup?this.modelValue.includes(this.value):this.modelValue},normalizedOptions(){return this.options.map(e=>e&&typeof e=="object"?{label:e.label,value:e.value,disabled:!!e.disabled}:{label:e,value:e,disabled:!1})}},methods:{update(e){this.$emit("update:modelValue",e),this.$emit("change",e)},onChange(e){if(this.isGroup){let t=e.target.checked?[...this.modelValue,this.value]:this.modelValue.filter(a=>a!==this.value);this.update(t)}else this.update(e.target.checked)},isChecked(e){return this.current.includes(e)},toggleOption(e,t){let a=t.target.checked?[...this.current,e.value]:this.current.filter(i=>i!==e.value);if(t.target.checked&&this.max>0&&a.length>this.max){t.target.checked=!1,this.$emit("exceed",{type:"max",max:this.max,value:e.value});return}if(!t.target.checked&&this.min>0&&a.length<this.min){t.target.checked=!0,this.$emit("exceed",{type:"min",min:this.min,value:e.value});return}this.update(a)}},template:`
|
|
238
238
|
<div v-if="options.length" class="djm-check-group" :class="'djm-is-' + direction" role="group">
|
|
239
239
|
<label
|
|
240
240
|
v-for="option in normalizedOptions"
|
|
@@ -261,7 +261,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
261
261
|
/>
|
|
262
262
|
<span><slot>{{ label }}</slot></span>
|
|
263
263
|
</label>
|
|
264
|
-
`};var
|
|
264
|
+
`};var Ea=0,ct={name:"DjmRadio",props:{modelValue:{type:[String,Number,Boolean],default:""},value:{type:[String,Number,Boolean],default:void 0},label:{type:String,default:""},disabled:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},direction:{type:String,default:"horizontal"},name:{type:String,default:""}},emits:["update:modelValue","change"],data(){return Ea+=1,{radioUid:Ea}},computed:{groupName(){return this.name||"djm-radio-"+this.radioUid},normalizedOptions(){return this.options.map(e=>e&&typeof e=="object"?{label:e.label,value:e.value,disabled:!!e.disabled}:{label:e,value:e,disabled:!1})}},methods:{select(e,t){this.$emit("update:modelValue",e),this.$emit("change",t)},onChange(e){this.select(this.value,e)}},template:`
|
|
265
265
|
<div v-if="options.length" class="djm-radio-group" :class="'djm-is-' + direction" role="radiogroup">
|
|
266
266
|
<label
|
|
267
267
|
v-for="option in normalizedOptions"
|
|
@@ -292,7 +292,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
292
292
|
/>
|
|
293
293
|
<span><slot>{{ label }}</slot></span>
|
|
294
294
|
</label>
|
|
295
|
-
`};var
|
|
295
|
+
`};var We={name:"DjmSwitch",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""},ariaLabel:{type:String,default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],methods:{onChange(e){this.$emit("update:modelValue",e.target.checked),this.$emit("change",e)}},computed:{hasLabel(){return!!this.label||!!this.$slots.default}},template:`
|
|
296
296
|
<label class="djm-switch" :class="{ 'djm-is-disabled': disabled }">
|
|
297
297
|
<input
|
|
298
298
|
type="checkbox"
|
|
@@ -304,26 +304,26 @@ Minimum version required to store current data is: `+I+`.
|
|
|
304
304
|
<span class="djm-switch-track"><i></i></span>
|
|
305
305
|
<em v-if="hasLabel"><slot>{{ label }}</slot></em>
|
|
306
306
|
</label>
|
|
307
|
-
`};import{computed as
|
|
307
|
+
`};import{computed as Ma,reactive as gl,provide as bl}from"vue";var ut={name:"DjmForm",props:{model:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:""},inline:{type:Boolean,default:!1}},emits:["submit"],setup(e,{emit:t}){let a=gl({}),i=new Map,n={};function l(){try{n=JSON.parse(JSON.stringify(e.model||{}))}catch{n={...e.model}}}l();function r(u,g){u&&i.set(u,g)}function o(u){i.delete(u)}async function s(u){let g=i.get(u),y=g?await g():"";return y?a[u]=y:delete a[u],!y}async function d(){let u=[...i.keys()];return(await Promise.all(u.map(y=>s(y)))).every(Boolean)}function p(u){(u?[].concat(u):[...i.keys()]).forEach(y=>{delete a[y]})}function c(){Object.keys(e.model||{}).forEach(u=>{u in n||delete e.model[u]}),Object.keys(n).forEach(u=>{let g=n[u];e.model[u]=g&&typeof g=="object"?JSON.parse(JSON.stringify(g)):g}),p()}function h(){l()}async function v(u){let g=await d();t("submit",u,g)}return bl("djmForm",{get model(){return e.model},get rules(){return e.rules},get horizontal(){return!!e.labelWidth||e.inline},errors:a,register:r,unregister:o}),{onSubmit:v,validate:d,validateField:s,clearValidate:p,resetFields:c,setInitial:h,errors:a,formClass:Ma(()=>({"djm-is-inline":e.inline,"djm-is-horizontal":!!e.labelWidth})),formStyle:Ma(()=>{let u=e.labelWidth;return u?{"--djm-form-label-width":typeof u=="number"||/^\d+(\.\d+)?$/.test(u)?u+"px":u}:{}})}},template:`
|
|
308
308
|
<form class="djm-form-grid" :class="formClass" :style="formStyle" @submit.prevent="onSubmit">
|
|
309
309
|
<slot></slot>
|
|
310
310
|
</form>
|
|
311
|
-
`};import{computed as
|
|
311
|
+
`};import{computed as yl,inject as wl,onMounted as jl,onBeforeUnmount as xl}from"vue";var mt={name:"DjmFormItem",props:{label:{type:String,default:""},prop:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},hint:{type:String,default:""},full:{type:Boolean,default:!1},tag:{type:String,default:"label"}},setup(e){let t=wl("djmForm",null);async function a(){if(!t||!e.prop)return"";let n=t.rules&&t.rules[e.prop]||[],l=t.model?t.model[e.prop]:void 0,r=l==null?"":String(l);for(let o of n){if(o.required&&r.trim()==="")return o.message||`${e.label||e.prop} \u4E3A\u5FC5\u586B\u9879`;if(o.pattern&&r!==""&&!o.pattern.test(r))return o.message||"\u683C\u5F0F\u4E0D\u6B63\u786E";if(typeof o.validator=="function"){let s=await o.validator(l,t.model);if(s===!1)return o.message||"\u6821\u9A8C\u672A\u901A\u8FC7";if(typeof s=="string"&&s)return s}}return""}return jl(()=>{t&&e.prop&&t.register(e.prop,a)}),xl(()=>{t&&e.prop&&t.unregister(e.prop)}),{errorText:yl(()=>e.error?e.error:t&&e.prop&&t.errors[e.prop]||"")}},template:`
|
|
312
312
|
<component :is="tag" class="djm-form-item" :class="{ 'djm-full': full, 'djm-has-label': !!label }">
|
|
313
313
|
<span v-if="label" class="djm-form-label">{{ label }} <i v-if="required">*</i></span>
|
|
314
314
|
<slot></slot>
|
|
315
315
|
<em v-if="errorText" class="djm-form-error" role="alert">{{ errorText }}</em>
|
|
316
316
|
<span v-else-if="hint" class="djm-form-hint">{{ hint }}</span>
|
|
317
317
|
</component>
|
|
318
|
-
`};var
|
|
318
|
+
`};var ft={name:"DjmEmpty",components:{DjmIcon:P},props:{icon:{type:String,default:"clipboard"},title:{type:String,default:""},description:{type:String,default:""}},computed:{label(){return this.title||C("empty.title")}},template:`
|
|
319
319
|
<div class="djm-empty">
|
|
320
320
|
<span class="djm-empty-icon"><DjmIcon :name="icon" :size="22" /></span>
|
|
321
321
|
<strong>{{ label }}</strong>
|
|
322
322
|
<span v-if="description">{{ description }}</span>
|
|
323
323
|
<slot></slot>
|
|
324
324
|
</div>
|
|
325
|
-
`};function
|
|
326
|
-
`);this.$emit("export",{rows:this.displayRows.slice(),csv:
|
|
325
|
+
`};function Ue(e){return Array.isArray(e.children)&&e.children.length>0}function Ca(e){return Ue(e)?e.children.reduce((t,a)=>t+Ca(a),0):1}var pt={name:"DjmTable",components:{DjmEmpty:ft,DjmIcon:P},props:{columns:{type:Array,required:!0},rows:{type:Array,default:()=>[]},rowKey:{type:String,default:"id"},selected:{type:Array,default:()=>[]},selectable:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1},indexOffset:{type:Number,default:0},loading:{type:Boolean,default:!1},loadingText:{type:String,default:""},striped:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},emptyText:{type:String,default:""},emptyHint:{type:String,default:""},emptyIcon:{type:String,default:"clipboard"},sortKey:{type:String,default:""},sortDir:{type:String,default:""},expandable:{type:[Boolean,Function],default:!1},expanded:{type:Array,default:()=>[]},rowClass:{type:[String,Function],default:""},maxHeight:{type:[Number,String],default:""},columnSetting:{type:Boolean,default:!1},exportable:{type:Boolean,default:!1},exportName:{type:String,default:"export"},resizable:{type:Boolean,default:!1},minColumnWidth:{type:Number,default:60},minWidth:{type:[Number,String],default:""},rowDraggable:{type:Boolean,default:!1},allowRowDrag:{type:Function,default:null},virtual:{type:Boolean,default:!1},rowHeight:{type:Number,default:44},overscan:{type:Number,default:6}},emits:["update:selected","row-click","row-dblclick","update:sortKey","update:sortDir","sort-change","update:expanded","export","column-resize","column-resize-end","row-drop"],data(){return{hiddenColumns:[],settingOpen:!1,colWidths:{},resizeState:null,rowDragState:null,rowDropState:null,scrollTop:0,viewportHeight:0}},computed:{leafColumns(){let e=[],t=(a,i)=>{a.forEach(n=>{if(Ue(n)){t(n.children,n);return}e.push(i?{...n,groupKey:i.key,groupLabel:i.label}:n)})};return t(this.columns,null),e},visibleColumns(){return this.leafColumns.filter(e=>!this.hiddenColumns.includes(e.key))},headerTree(){let e=t=>t.map(a=>Ue(a)?{...a,children:e(a.children)}:{...a}).filter(a=>Ue(a)?a.children.length>0:!this.hiddenColumns.includes(a.key));return e(this.columns)},headerRows(){let e=[],t=n=>Ue(n)?1+Math.max(...n.children.map(t)):1,a=this.headerTree.reduce((n,l)=>Math.max(n,t(l)),1),i=(n,l)=>{e[l]||(e[l]=[]),n.forEach(r=>{Ue(r)?(e[l].push({node:r,colspan:Ca(r),rowspan:1,group:!0}),i(r.children,l+1)):e[l].push({node:r,colspan:1,rowspan:a-l,group:!1})})};return i(this.headerTree,0),e},colSpan(){return this.visibleColumns.length+(this.selectable?1:0)+(this.showIndex?1:0)+(this.expandable?1:0)+(this.rowDraggable?1:0)},hasFixed(){return this.visibleColumns.some(e=>e.fixed==="left"||e.fixed==="right")},prependOffsets(){if(!this.hasFixed)return null;let e={drag:null,expand:null,select:null,index:null,base:0},t=0;return this.rowDraggable&&(e.drag=t,t+=36),this.expandable&&(e.expand=t,t+=38),this.selectable&&(e.select=t,t+=42),this.showIndex&&(e.index=t,t+=52),e.base=t,e},stickyMap(){if(!this.hasFixed)return{};let e=this.visibleColumns,t={},a=this.prependOffsets?this.prependOffsets.base:0;e.forEach(r=>{r.fixed==="left"&&(t[r.key]={side:"left",offset:a,edge:!1},a+=this.columnWidth(r))});let i=0;for(let r=e.length-1;r>=0;r--){let o=e[r];o.fixed==="right"&&(t[o.key]={side:"right",offset:i,edge:!1},i+=this.columnWidth(o))}let n=e.filter(r=>r.fixed==="left").map(r=>r.key),l=e.filter(r=>r.fixed==="right").map(r=>r.key);return n.length&&(t[n[n.length-1]].edge=!0),l.length&&(t[l[0]].edge=!0),t},scrollStyle(){if(!this.maxHeight)return{};let e=this.maxHeight;return typeof e=="number"||/^\d+(\.\d+)?$/.test(e)?{maxHeight:e+"px"}:{maxHeight:e}},tableStyle(){let e=this.minWidth;return e===""||e===null||e===void 0?{}:typeof e=="number"||/^\d+(\.\d+)?$/.test(e)?{minWidth:e+"px"}:{minWidth:e}},loadingLabel(){return this.loadingText||C("table.loading")},emptyLabel(){return this.emptyText||C("table.empty")},selectAllLabel(){return C("table.selectAll")},selectRowLabel(){return C("table.selectRow")},scrollRegionLabel(){return C("table.scrollRegion")},allChecked(){return this.rows.length>0&&this.rows.every(e=>this.isSelected(e))},someChecked(){return!this.allChecked&&this.rows.some(e=>this.isSelected(e))},displayRows(){if(!this.sortKey||!this.sortDir)return this.rows;let e=this.leafColumns.find(i=>i.key===this.sortKey);if(!e)return this.rows;let t=this.sortDir==="asc"?1:-1,a=this.rows.slice();return typeof e.sorter=="function"?a.sort((i,n)=>e.sorter(i,n)*t):a.sort((i,n)=>{let l=i[this.sortKey],r=n[this.sortKey];return typeof l=="number"&&typeof r=="number"?(l-r)*t:String(l??"").localeCompare(String(r??""),"zh-Hans-CN")*t})},virtualEnabled(){return!!(this.virtual&&this.maxHeight&&!this.expandable)},effectiveRowHeight(){return Math.max(16,this.rowHeight)},visibleRange(){let e=this.displayRows.length;if(!this.virtualEnabled||!e)return{start:0,end:e};let t=this.effectiveRowHeight,a=this.viewportHeight||t*10,i=Math.max(0,Math.floor(this.scrollTop/t)-this.overscan),n=Math.min(e,Math.ceil((this.scrollTop+a)/t)+this.overscan);return{start:i,end:n}},bodyRows(){let{start:e,end:t}=this.visibleRange;return this.displayRows.slice(e,t).map((a,i)=>({row:a,index:e+i}))},topPad(){return this.virtualEnabled?this.visibleRange.start*this.effectiveRowHeight:0},bottomPad(){if(!this.virtualEnabled)return 0;let e=this.displayRows.length;return Math.max(0,(e-this.visibleRange.end)*this.effectiveRowHeight)}},mounted(){document.addEventListener("mousedown",this.onDocumentMousedown,!0),this.measureViewport()},beforeUnmount(){document.removeEventListener("mousedown",this.onDocumentMousedown,!0),document.removeEventListener("mousemove",this.onResizeMove),document.removeEventListener("mouseup",this.onResizeEnd)},methods:{measureViewport(){let e=this.$refs.wrap;!e||!this.virtualEnabled||(this.viewportHeight=e.clientHeight,this.scrollTop=e.scrollTop)},onScroll(e){if(!this.virtualEnabled)return;let t=e.target;this.scrollTop=t.scrollTop,this.viewportHeight=t.clientHeight},toggleColumn(e){if(this.hiddenColumns.includes(e)){this.hiddenColumns=this.hiddenColumns.filter(t=>t!==e);return}this.visibleColumns.length<=1||(this.hiddenColumns=[...this.hiddenColumns,e])},resetColumns(){this.hiddenColumns=[]},onDocumentMousedown(e){!this.$refs.root||this.$refs.root.contains(e.target)||(this.settingOpen=!1)},exportCsv(){let e=this.visibleColumns.filter(n=>n.exportable!==!1);if(!e.length)return;let t=e.map(n=>n.label||n.key),a=this.displayRows.map(n=>e.map(l=>{let r=typeof l.exportValue=="function"?l.exportValue(n):n[l.key];return String(r??"").replace(/"/g,'""')})),i="\uFEFF"+[t,...a].map(n=>n.map(l=>`"${l}"`).join(",")).join(`
|
|
326
|
+
`);this.$emit("export",{rows:this.displayRows.slice(),csv:i}),this.downloadCsv(i)},downloadCsv(e){let t=new Date,a=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,i=URL.createObjectURL(new Blob([e],{type:"text/csv;charset=utf-8"})),n=document.createElement("a");n.href=i,n.download=`${this.exportName}-${a}.csv`,n.click(),URL.revokeObjectURL(i)},isSelected(e){return this.selected.includes(e[this.rowKey])},canExpand(e){return typeof this.expandable=="function"?!!this.expandable(e):!!this.expandable},isExpanded(e){return this.expanded.includes(e[this.rowKey])},toggleExpand(e){let t=e[this.rowKey],a=this.expanded.includes(t)?this.expanded.filter(i=>i!==t):[...this.expanded,t];this.$emit("update:expanded",a)},rowClassOf(e,t){return typeof this.rowClass=="function"?this.rowClass(e,t):this.rowClass},columnWidth(e){let t=this.colWidths[e.key];return typeof t=="number"?t:typeof e.width=="number"?e.width:120},stickyClassOf(e){let t=this.stickyMap[e.key];return t?[t.side==="left"?"djm-sticky-left":"djm-sticky-right",t.edge?"djm-sticky-edge":""]:""},stickyStyleOf(e){let t=this.stickyMap[e.key];return t?t.side==="left"?{left:t.offset+"px"}:{right:t.offset+"px"}:{}},stickyTop(e){return this.headerRows.length<=1?{}:{top:e*(this.compact?32:38)+"px"}},prependClass(e){if(!this.prependOffsets)return"";let t=this.prependOffsets[e];if(t==null)return"";let a=["drag","expand","select","index"].filter(l=>this.prependOffsets[l]!==null),i=a[a.length-1]===e,n=this.visibleColumns.some(l=>l.fixed==="left");return["djm-sticky-left",i&&!n?"djm-sticky-edge":""]},prependStyle(e){if(!this.prependOffsets)return{};let t=this.prependOffsets[e];return t==null?{}:{left:t+"px"}},ariaSort(e){if(e.sortable)return this.sortKey!==e.key?"none":this.sortDir==="asc"?"ascending":"descending"},toggleSort(e){if(!e.sortable)return;let t=e.key,a="asc";this.sortKey===e.key&&this.sortDir==="asc"?a="desc":this.sortKey===e.key&&this.sortDir==="desc"&&(t="",a=""),this.$emit("update:sortKey",t),this.$emit("update:sortDir",a),this.$emit("sort-change",{key:t,dir:a})},toggleAll(e){let t=this.rows.map(a=>a[this.rowKey]);if(e.target.checked){let a=new Set(this.selected);t.forEach(i=>a.add(i)),this.$emit("update:selected",[...a])}else{let a=new Set(t);this.$emit("update:selected",this.selected.filter(i=>!a.has(i)))}},toggleRow(e){let t=e[this.rowKey],a=this.selected.includes(t)?this.selected.filter(i=>i!==t):[...this.selected,t];this.$emit("update:selected",a)},cellStyle(e){let t=this.colWidths[e.key],a="";return typeof t=="number"?a=t+"px":typeof e.width=="number"?a=e.width+"px":e.width&&(a=String(e.width)),{width:a,minWidth:a,maxWidth:e.fixed?a:"",textAlign:e.align||""}},startResize(e,t){if(!this.resizable||t.resizable===!1)return;let a=e.currentTarget.parentNode;this.resizeState={key:t.key,startX:e.clientX,startWidth:a.getBoundingClientRect().width},document.addEventListener("mousemove",this.onResizeMove),document.addEventListener("mouseup",this.onResizeEnd)},onResizeMove(e){let t=this.resizeState;if(!t)return;let a=Math.max(40,this.minColumnWidth),i=Math.round(Math.max(a,t.startWidth+e.clientX-t.startX));this.colWidths={...this.colWidths,[t.key]:i},this.$emit("column-resize",{key:t.key,width:i})},onResizeEnd(){if(!this.resizeState)return;let{key:e}=this.resizeState;this.resizeState=null,document.removeEventListener("mousemove",this.onResizeMove),document.removeEventListener("mouseup",this.onResizeEnd),this.$emit("column-resize-end",{key:e,width:this.colWidths[e]})},resetColumnWidth(e){if(!this.colWidths[e])return;let t={...this.colWidths};delete t[e],this.colWidths=t},canDragRow(e,t){return this.rowDraggable?typeof this.allowRowDrag=="function"?this.allowRowDrag(e,t)!==!1:!0:!1},isRowDragging(e){return!!(this.rowDragState&&this.rowDragState.key===e.row[this.rowKey])},rowDropClassOf(e){let t=this.rowDropState;return!t||t.key!==e.row[this.rowKey]?"":"djm-is-row-drop-"+t.position},onRowDragStart(e,t){if(!this.canDragRow(e.row,e.index)){t.preventDefault();return}this.rowDragState={key:e.row[this.rowKey],index:e.index},t.dataTransfer&&(t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",String(e.index)))},dropPositionOf(e){let t=e.currentTarget.getBoundingClientRect();return(t.height?(e.clientY-t.top)/t.height:.5)<.5?"before":"after"},onRowDragOver(e,t){this.rowDragState&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),this.rowDropState={key:e.row[this.rowKey],index:e.index,position:this.dropPositionOf(t)})},onRowDragLeave(e,t){let a=t.currentTarget;a&&t.relatedTarget&&a.contains(t.relatedTarget)||this.rowDropState&&this.rowDropState.key===e.row[this.rowKey]&&(this.rowDropState=null)},onRowDrop(e,t){let a=this.rowDragState;if(!a)return;t.preventDefault();let i=this.rowDropState,n=i&&i.key===e.row[this.rowKey]?i.position:this.dropPositionOf(t);this.resetRowDrag(),!this.isNoopDrop(a.index,e.index,n)&&this.$emit("row-drop",{dragIndex:a.index,dropIndex:e.index,position:n,dragKey:a.key,dropKey:e.row[this.rowKey]})},isNoopDrop(e,t,a){return e===t||a==="after"&&t===e-1||a==="before"&&t===e+1},onRowDragEnd(){this.resetRowDrag()},resetRowDrag(){this.rowDragState=null,this.rowDropState=null}},template:`
|
|
327
327
|
<div class="djm-table-root" :class="{ 'djm-is-resizing': !!resizeState }" ref="root">
|
|
328
328
|
<div
|
|
329
329
|
v-if="columnSetting || exportable || $slots.toolbar || $slots['toolbar-extra']"
|
|
@@ -561,7 +561,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
561
561
|
</div>
|
|
562
562
|
</div>
|
|
563
563
|
</div>
|
|
564
|
-
`};var
|
|
564
|
+
`};var Ta={name:"DjmPageHeader",props:{title:{type:String,required:!0},description:{type:String,default:""}},template:`
|
|
565
565
|
<header class="djm-page-head">
|
|
566
566
|
<div>
|
|
567
567
|
<h1>{{ title }}</h1>
|
|
@@ -571,7 +571,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
571
571
|
<slot name="actions"></slot>
|
|
572
572
|
</div>
|
|
573
573
|
</header>
|
|
574
|
-
`};var
|
|
574
|
+
`};var Ia={name:"DjmBreadcrumb",components:{Icon:P},props:{items:{type:Array,required:!0},separator:{type:String,default:"/"},separatorIcon:{type:String,default:""},ariaLabel:{type:String,default:"\u9762\u5305\u5C51"}},emits:["navigate"],methods:{isLast(e){return e===this.items.length-1}},template:`
|
|
575
575
|
<nav class="djm-breadcrumb" :aria-label="ariaLabel">
|
|
576
576
|
<ol class="djm-breadcrumb-list">
|
|
577
577
|
<li v-for="(item, index) in items" :key="item.key || item.label" class="djm-breadcrumb-item">
|
|
@@ -590,7 +590,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
590
590
|
</li>
|
|
591
591
|
</ol>
|
|
592
592
|
</nav>
|
|
593
|
-
`};var
|
|
593
|
+
`};var he={name:"DjmAvatar",props:{src:{type:String,default:""},alt:{type:String,default:""},text:{type:String,default:""},size:{type:String,default:"md"},shape:{type:String,default:"circle"},tone:{type:String,default:""}},data(){return{failed:!1}},computed:{initial(){let e=(this.text||this.alt||"").trim();return e?/^[+\d]/.test(e)?e:e.slice(0,1):""},showImage(){return!!this.src&&!this.failed}},watch:{src(){this.failed=!1}},template:`
|
|
594
594
|
<span
|
|
595
595
|
class="djm-avatar"
|
|
596
596
|
:class="['djm-avatar-' + size, { 'djm-is-square': shape === 'square' }]"
|
|
@@ -599,11 +599,11 @@ Minimum version required to store current data is: `+I+`.
|
|
|
599
599
|
<img v-if="showImage" :src="src" :alt="alt || text" @error="failed = true" />
|
|
600
600
|
<template v-else>{{ initial }}</template>
|
|
601
601
|
</span>
|
|
602
|
-
`};var
|
|
602
|
+
`};var La={name:"DjmAvatarGroup",props:{gap:{type:[Number,String],default:-8}},computed:{groupStyle(){return{"--djm-avatar-gap":typeof this.gap=="number"?this.gap+"px":this.gap}}},template:`
|
|
603
603
|
<div class="djm-avatar-group" :style="groupStyle">
|
|
604
604
|
<slot></slot>
|
|
605
605
|
</div>
|
|
606
|
-
`};var
|
|
606
|
+
`};var Aa={name:"DjmBadge",props:{count:{type:[Number,String],default:0},max:{type:Number,default:99},dot:{type:Boolean,default:!1},tone:{type:String,default:"danger"},hidden:{type:Boolean,default:!1}},computed:{display(){let e=Number(this.count);return Number.isFinite(e)?e>this.max?this.max+"+":String(e):String(this.count)},show(){if(this.hidden)return!1;if(this.dot)return!0;let e=String(this.count===null||this.count===void 0?"":this.count).trim();return e===""?!1:Number.isFinite(Number(e))?Number(e)!==0:!0}},template:`
|
|
607
607
|
<span class="djm-badge-anchor">
|
|
608
608
|
<slot></slot>
|
|
609
609
|
<i
|
|
@@ -612,7 +612,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
612
612
|
:class="[dot ? 'djm-is-dot' : 'djm-badge-count', 'djm-' + tone]"
|
|
613
613
|
>{{ dot ? '' : display }}</i>
|
|
614
614
|
</span>
|
|
615
|
-
`};import{nextTick as
|
|
615
|
+
`};import{nextTick as za,onBeforeUnmount as kl,onMounted as Sl,ref as ht,watch as Dl}from"vue";var Pa={name:"DjmPopover",props:{placement:{type:String,default:"bottom-end"},width:{type:[Number,String],default:""},trigger:{type:String,default:"click"},disabled:{type:Boolean,default:!1}},emits:["visible-change"],setup(e,{emit:t}){let a=ht(!1),i=ht(null),n=ht(null),l=ht({}),r=null;function o(){let g=i.value&&i.value.querySelector(".djm-popover-trigger");if(!g)return;let y=g.querySelector('button, a[href], [role="button"]'),j=y||g;y||(j.setAttribute("role","button"),j.setAttribute("tabindex","0")),j.setAttribute("aria-haspopup","dialog"),j.setAttribute("aria-expanded",String(a.value))}Sl(()=>za(o)),Dl(a,()=>za(o));function s(){if(!a.value||!i.value)return;let g=i.value.getBoundingClientRect(),y={position:"fixed"};e.width&&(y.width=typeof e.width=="number"?e.width+"px":e.width);let j=window.innerHeight-g.bottom;e.placement.indexOf("top")===0||j<220&&g.top>j?y.bottom=window.innerHeight-g.top+8+"px":y.top=g.bottom+8+"px",e.placement.indexOf("end")>-1?y.right=window.innerWidth-g.right+"px":y.left=g.left+"px",l.value=y}function d(){e.disabled||a.value||(a.value=!0,t("visible-change",!0),r=ae({root:()=>i.value,panel:()=>n.value,onClose:p,onReposition:s}),requestAnimationFrame(s))}function p(){a.value&&(a.value=!1,l.value={},t("visible-change",!1),r&&(r(),r=null))}function c(){e.disabled||(a.value?p():d())}let h=null;function v(){e.trigger==="hover"&&(window.clearTimeout(h),d())}function u(){e.trigger==="hover"&&(window.clearTimeout(h),h=window.setTimeout(p,120))}return kl(()=>{window.clearTimeout(h),p()}),{open:a,root:i,panelEl:n,panelStyle:l,toggle:c,close:p,onHoverIn:v,onHoverOut:u}},template:`
|
|
616
616
|
<span class="djm-popover" ref="root" @mouseenter="onHoverIn" @mouseleave="onHoverOut">
|
|
617
617
|
<span
|
|
618
618
|
class="djm-popover-trigger"
|
|
@@ -637,7 +637,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
637
637
|
</Transition>
|
|
638
638
|
</Teleport>
|
|
639
639
|
</span>
|
|
640
|
-
`};import{reactive as
|
|
640
|
+
`};import{reactive as El}from"vue";var Ml={name:"DjmMenuSubList",components:{DjmIcon:P},props:{items:{type:Array,default:()=>[]},activeKey:{type:String,default:""},level:{type:Number,default:1}},emits:["pick"],setup(e,{emit:t}){let a=El({key:null,top:0,left:0});function i(d){return Array.isArray(d.children)&&d.children.length>0}function n(d,p){if(!i(d))return;let c=p.currentTarget.getBoundingClientRect(),h=Math.min(d.children.length*34+10,420);a.key=d.key,a.top=Math.max(8,Math.min(c.top-5,window.innerHeight-h-8)),a.left=c.right}function l(){a.key=null}function r(d){d.currentTarget.contains(d.relatedTarget)||l()}function o(d){d.disabled||i(d)||t("pick",d)}function s(d){return d.key===e.activeKey?!0:i(d)&&d.children.some(p=>p.key===e.activeKey)}return{nested:a,hasChildren:i,place:n,clear:l,onFocusOut:r,onClick:o,isActive:s}},template:`
|
|
641
641
|
<ul class="djm-menu-sub djm-menu-pop" @scroll="clear">
|
|
642
642
|
<li
|
|
643
643
|
v-for="item in items"
|
|
@@ -674,7 +674,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
674
674
|
/>
|
|
675
675
|
</li>
|
|
676
676
|
</ul>
|
|
677
|
-
`},
|
|
677
|
+
`},Ba={name:"DjmMenu",components:{DjmIcon:P,MenuSubList:Ml},props:{items:{type:Array,default:()=>[]},mode:{type:String,default:"vertical"},activeKey:{type:String,default:""},collapsed:{type:Boolean,default:!1},defaultOpenKeys:{type:Array,default:()=>[]},accordion:{type:Boolean,default:!1},highlightGroup:{type:Boolean,default:!1}},emits:["select","update:activeKey"],data(){return{openKeys:this.defaultOpenKeys.slice()}},computed:{isHorizontal(){return this.mode==="horizontal"},isPopMode(){return this.isHorizontal||this.collapsed},menuClass(){return["djm-menu",this.isHorizontal?"djm-menu-horizontal":"djm-menu-vertical",{"djm-is-collapsed":this.collapsed&&!this.isHorizontal}]}},methods:{hasChildren(e){return Array.isArray(e.children)&&e.children.length>0},isOpen(e){return this.openKeys.indexOf(e.key)>-1},open(e){this.isOpen(e)||(this.accordion&&!this.isPopMode&&(this.openKeys=[]),this.openKeys.push(e.key))},close(e){let t=this.openKeys.indexOf(e.key);t>-1&&this.openKeys.splice(t,1)},toggle(e){this.isOpen(e)?this.close(e):this.open(e)},onItemClick(e){if(!e.disabled){if(this.hasChildren(e)){this.toggle(e);return}this.pick(e)}},pick(e){e.disabled||(this.$emit("update:activeKey",e.key),this.$emit("select",e),this.isHorizontal&&(this.openKeys=[]))},isActive(e){return e.key===this.activeKey?!0:this.highlightGroup?this.hasChildren(e)&&e.children.some(t=>t.key===this.activeKey):!1},itemTitle(e){return this.collapsed&&!this.isHorizontal?e.label:null}},template:`
|
|
678
678
|
<nav :class="menuClass">
|
|
679
679
|
<ul class="djm-menu-list">
|
|
680
680
|
<li
|
|
@@ -736,7 +736,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
736
736
|
</li>
|
|
737
737
|
</ul>
|
|
738
738
|
</nav>
|
|
739
|
-
`};var
|
|
739
|
+
`};var Cl={success:"green",warning:"amber",warn:"amber",danger:"red",error:"red",info:"brand",ok:"green",off:"default"},Na={name:"DjmTag",props:{tone:{type:String,default:""},type:{type:String,default:""},size:{type:String,default:"md"},closable:{type:Boolean,default:!1}},emits:["close"],computed:{toneClass(){let e=this.tone||this.type||"default";return"djm-tag-"+(Cl[e]||e)}},methods:{onClose(){this.$emit("close")},t:C},template:`
|
|
740
740
|
<span class="djm-tag" :class="[toneClass, size === 'sm' ? 'djm-tag-sm' : '']">
|
|
741
741
|
<slot></slot>
|
|
742
742
|
<button
|
|
@@ -747,7 +747,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
747
747
|
@click.stop="onClose"
|
|
748
748
|
>\xD7</button>
|
|
749
749
|
</span>
|
|
750
|
-
`};var
|
|
750
|
+
`};var Ra={name:"DjmCard",props:{title:{type:String,default:""},hoverable:{type:Boolean,default:!1},flush:{type:Boolean,default:!1}},template:`
|
|
751
751
|
<section class="djm-card" :class="{ 'djm-is-hoverable': hoverable, 'djm-is-flush': flush }">
|
|
752
752
|
<header v-if="title || $slots.extra" class="djm-card-head">
|
|
753
753
|
<div class="djm-card-title">{{ title }}<slot name="title"></slot></div>
|
|
@@ -756,14 +756,14 @@ Minimum version required to store current data is: `+I+`.
|
|
|
756
756
|
<div class="djm-card-body"><slot></slot></div>
|
|
757
757
|
<footer v-if="$slots.footer" class="djm-card-foot"><slot name="footer"></slot></footer>
|
|
758
758
|
</section>
|
|
759
|
-
`};var
|
|
759
|
+
`};var Va={name:"DjmProgress",props:{percent:{type:Number,default:0},status:{type:String,default:""},showText:{type:Boolean,default:!0},strokeWidth:{type:Number,default:6},color:{type:String,default:""}},computed:{safePercent(){return Math.min(100,Math.max(0,Number(this.percent)||0))},barStyle(){let e={width:this.safePercent+"%"};return this.color&&(e.background=this.color),e},trackStyle(){return{height:this.strokeWidth+"px"}}},template:`
|
|
760
760
|
<div class="djm-progress-line" :class="status ? 'djm-is-' + status : ''">
|
|
761
761
|
<div class="djm-progress" :style="trackStyle">
|
|
762
762
|
<div class="djm-progress-bar" :style="barStyle"></div>
|
|
763
763
|
</div>
|
|
764
764
|
<span v-if="showText" class="djm-progress-label">{{ safePercent }}%</span>
|
|
765
765
|
</div>
|
|
766
|
-
`};var
|
|
766
|
+
`};var Ha={name:"DjmSkeleton",props:{loading:{type:Boolean,default:!0},rows:{type:Number,default:3},title:{type:Boolean,default:!0},avatar:{type:Boolean,default:!1},animated:{type:Boolean,default:!0}},computed:{rowStyle(){return e=>({width:e===this.rows?"60%":"100%"})}},template:`
|
|
767
767
|
<div v-if="loading" class="djm-skeleton-block" :class="{ 'djm-is-static': !animated }" aria-busy="true">
|
|
768
768
|
<div v-if="avatar" class="djm-skeleton-avatar"></div>
|
|
769
769
|
<div class="djm-skeleton-main">
|
|
@@ -777,7 +777,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
777
777
|
</div>
|
|
778
778
|
</div>
|
|
779
779
|
<slot v-else></slot>
|
|
780
|
-
`};var
|
|
780
|
+
`};var Oa={success:"check",warning:"alert",error:"x",info:"info"},Tl={danger:"error"},$a={name:"DjmResult",components:{DjmIcon:P},props:{status:{type:String,default:""},type:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""}},computed:{actualStatus(){let e=this.status||this.type||"info";return Tl[e]||e},iconName(){return Oa[this.actualStatus]||Oa.info}},template:`
|
|
781
781
|
<div class="djm-result" :class="'djm-result-' + actualStatus" role="status">
|
|
782
782
|
<div class="djm-result-icon">
|
|
783
783
|
<slot name="icon">
|
|
@@ -788,7 +788,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
788
788
|
<div v-if="description" class="djm-result-desc">{{ description }}</div>
|
|
789
789
|
<div v-if="$slots.default" class="djm-result-extra"><slot></slot></div>
|
|
790
790
|
</div>
|
|
791
|
-
`};var
|
|
791
|
+
`};var Fa={name:"DjmTimeline",props:{items:{type:Array,default:()=>[]}},template:`
|
|
792
792
|
<ul class="djm-timeline">
|
|
793
793
|
<li v-for="(item, index) in items" :key="item.key || index">
|
|
794
794
|
<i class="djm-timeline-dot" :class="item.tone ? 'djm-tone-' + item.tone : ''"></i>
|
|
@@ -800,7 +800,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
800
800
|
<slot name="item" :item="item"></slot>
|
|
801
801
|
</li>
|
|
802
802
|
</ul>
|
|
803
|
-
`};var
|
|
803
|
+
`};var Ka={name:"DjmCollapse",components:{DjmIcon:P},props:{items:{type:Array,default:()=>[]},modelValue:{type:Array,default:()=>[]},accordion:{type:Boolean,default:!1}},emits:["update:modelValue","change"],methods:{isOpen(e){return this.modelValue.indexOf(e.key)>-1},toggle(e){if(e.disabled)return;let t;this.accordion?t=this.isOpen(e)?[]:[e.key]:this.isOpen(e)?t=this.modelValue.filter(a=>a!==e.key):t=this.modelValue.concat(e.key),this.$emit("update:modelValue",t),this.$emit("change",t)}},template:`
|
|
804
804
|
<div class="djm-accordion">
|
|
805
805
|
<div v-for="item in items" :key="item.key" class="djm-accordion-item">
|
|
806
806
|
<button
|
|
@@ -818,7 +818,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
818
818
|
</div>
|
|
819
819
|
</div>
|
|
820
820
|
</div>
|
|
821
|
-
`};var
|
|
821
|
+
`};var Wa={name:"DjmStatistic",props:{title:{type:String,default:""},value:{type:[Number,String],default:0},precision:{type:Number,default:0},prefix:{type:String,default:""},suffix:{type:String,default:""},trend:{type:Number,default:0},trendLabel:{type:String,default:"\u8F83\u4E0A\u671F"}},computed:{display(){let e=Number(this.value);if(!Number.isFinite(e))return this.value;let t=Math.min(100,Math.max(0,Math.floor(Number(this.precision))||0));return e.toFixed(t)}},template:`
|
|
822
822
|
<div class="djm-stat">
|
|
823
823
|
<div class="djm-stat-title">{{ title }}</div>
|
|
824
824
|
<div class="djm-stat-value">
|
|
@@ -831,7 +831,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
831
831
|
{{ trend > 0 ? '+' : '' }}{{ trend }}%
|
|
832
832
|
</div>
|
|
833
833
|
</div>
|
|
834
|
-
`};var
|
|
834
|
+
`};var Ua={name:"DjmSteps",components:{DjmIcon:P},props:{items:{type:Array,default:()=>[]},current:{type:Number,default:0},direction:{type:String,default:"horizontal"},status:{type:String,default:""}},methods:{stepState(e){return e<this.current?"finish":e===this.current?this.status==="error"?"error":"process":"wait"},t:C},template:`
|
|
835
835
|
<div class="djm-steps" :class="'djm-steps-' + direction">
|
|
836
836
|
<div
|
|
837
837
|
v-for="(item, index) in items"
|
|
@@ -852,7 +852,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
852
852
|
<div v-if="item.description" class="djm-step-desc">{{ item.description }}</div>
|
|
853
853
|
</div>
|
|
854
854
|
</div>
|
|
855
|
-
`};var
|
|
855
|
+
`};var qe={name:"DjmInputNumber",props:{modelValue:{type:Number,default:null},min:{type:Number,default:-1/0},max:{type:Number,default:1/0},step:{type:Number,default:1},precision:{type:Number,default:0},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:""},ariaLabel:{type:String,default:"\u6570\u5B57\u8F93\u5165"}},emits:["update:modelValue","change","focus","blur"],data(){return{draft:this.displayOf(this.modelValue)}},watch:{modelValue(e){this.draft=this.displayOf(e)}},computed:{canDecrease(){return!this.disabled&&Number(this.modelValue)>this.min},canIncrease(){return!this.disabled&&Number(this.modelValue)<this.max}},methods:{displayOf(e){if(e==null||e==="")return"";let t=Number(e);return Number.isFinite(t)?t.toFixed(this.precision):""},normalize(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?(t=Math.min(this.max,Math.max(this.min,t)),Number(t.toFixed(this.precision))):null},commit(e){let t=this.normalize(e);this.draft=this.displayOf(t),t!==this.modelValue&&(this.$emit("update:modelValue",t),this.$emit("change",t))},stepBy(e){if(this.disabled)return;let t=Number(this.modelValue);this.commit((Number.isFinite(t)?t:0)+e)},onInput(e){this.draft=e.target.value},onBlur(e){this.draft===""?this.commit(null):this.commit(this.draft),this.$emit("blur",e)},onKeydown(e){e.key==="ArrowUp"?(e.preventDefault(),this.stepBy(this.step)):e.key==="ArrowDown"&&(e.preventDefault(),this.stepBy(-this.step))}},template:`
|
|
856
856
|
<div class="djm-input-number" :class="{ 'djm-is-disabled': disabled }">
|
|
857
857
|
<input
|
|
858
858
|
class="djm-input"
|
|
@@ -878,7 +878,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
878
878
|
</button>
|
|
879
879
|
</span>
|
|
880
880
|
</div>
|
|
881
|
-
`};var
|
|
881
|
+
`};var vt={name:"DjmRate",props:{modelValue:{type:Number,default:0},count:{type:Number,default:5},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0}},emits:["update:modelValue","change"],data(){return{hovered:0}},computed:{activeCount(){return this.hovered||this.modelValue}},methods:{pick(e){if(this.disabled||this.readonly)return;let t=this.clearable&&this.modelValue===e?0:e;this.$emit("update:modelValue",t),this.$emit("change",t)},onKey(e,t){if(this.disabled||this.readonly)return;let a=t.key==="ArrowRight"||t.key==="ArrowUp"?1:t.key==="ArrowLeft"||t.key==="ArrowDown"?-1:0,i=0;a?i=Math.min(this.count,Math.max(1,e+a)):t.key==="Home"?i=1:t.key==="End"&&(i=this.count),i&&(t.preventDefault(),this.pick(i),this.$nextTick(()=>{let l=(this.$refs.stars||[])[i-1];l&&l.focus()}))}},template:`
|
|
882
882
|
<div
|
|
883
883
|
class="djm-rate"
|
|
884
884
|
:class="{ 'djm-is-disabled': disabled || readonly }"
|
|
@@ -909,7 +909,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
909
909
|
</svg>
|
|
910
910
|
</button>
|
|
911
911
|
</div>
|
|
912
|
-
`};var
|
|
912
|
+
`};var gt={name:"DjmSlider",props:{modelValue:{type:[Number,Array],default:0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},disabled:{type:Boolean,default:!1},marks:{type:Object,default:()=>({})}},emits:["update:modelValue","change"],data(){return{dragging:-1}},computed:{stepSize(){return Math.abs(Number(this.step))||1},isRange(){return Array.isArray(this.modelValue)},values(){return(this.isRange?this.modelValue:[this.modelValue]).map(t=>this.clamp(Number(t)||0))},barStyle(){let e=this.percentOf(this.values[0]),t=this.percentOf(this.values[this.values.length-1]);return{left:e+"%",width:t-e+"%"}},markList(){return Object.keys(this.marks).map(e=>({value:Number(e),label:this.marks[e],percent:this.percentOf(Number(e))}))}},methods:{clamp(e){let t=this.isRange?this.min:this.min;return Math.min(this.max,Math.max(t,e))},percentOf(e){return this.max===this.min?0:(e-this.min)/(this.max-this.min)*100},quantize(e){let t=Math.round((e-this.min)/this.stepSize);return Number((this.min+t*this.stepSize).toFixed(6))},valueAt(e){let t=this.$refs.track.getBoundingClientRect();if(!t.width)return this.min;let a=Math.min(1,Math.max(0,(e-t.left)/t.width));return this.quantize(this.min+a*(this.max-this.min))},emitValue(e){let t=this.isRange?e:e[0];this.$emit("update:modelValue",t)},startDrag(e,t){this.disabled||(t.preventDefault(),t.stopPropagation(),this.dragging=e,window.addEventListener("pointermove",this.onMove),window.addEventListener("pointerup",this.onUp),this.$refs.track.setPointerCapture&&this.$refs.track.setPointerCapture(t.pointerId))},onTrackDown(e){if(this.disabled)return;let t=this.valueAt(e.clientX),a=this.values.slice();if(!this.isRange){this.emitValue([t]),this.startDrag(0,e);return}let i=Math.abs(t-a[0])<=Math.abs(t-a[1])?0:1;a[i]=t,a.sort((n,l)=>n-l),this.emitValue(a),this.startDrag(i,e)},onMove(e){if(this.dragging<0)return;let t=this.valueAt(e.clientX),a=this.values.slice();if(this.isRange){let i=a[1-this.dragging];a[this.dragging]=this.dragging===0?Math.min(t,i):Math.max(t,i)}else a[0]=t;this.emitValue(a)},onUp(){this.dragging<0||(this.dragging=-1,window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onUp),this.$emit("change",this.isRange?this.values.slice():this.values[0]))},onKey(e,t){if(this.disabled)return;let a=t.key==="ArrowRight"||t.key==="ArrowUp"?this.stepSize:t.key==="ArrowLeft"||t.key==="ArrowDown"?-this.stepSize:0;if(!a)return;t.preventDefault();let i=this.values.slice();i[e]=Math.min(this.max,Math.max(this.min,i[e]+a)),this.isRange&&e===0&&i[0]>i[1]&&(i[0]=i[1]),this.isRange&&e===1&&i[1]<i[0]&&(i[1]=i[0]),this.emitValue(i),this.$emit("change",this.isRange?i:i[0])}},beforeUnmount(){window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onUp)},template:`
|
|
913
913
|
<div class="djm-slider" :class="{ 'djm-is-disabled': disabled, 'djm-has-marks': markList.length }">
|
|
914
914
|
<div class="djm-slider-track" ref="track" @pointerdown="onTrackDown">
|
|
915
915
|
<div class="djm-slider-rail"></div>
|
|
@@ -939,7 +939,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
939
939
|
>{{ mark.label }}</span>
|
|
940
940
|
</div>
|
|
941
941
|
</div>
|
|
942
|
-
`};var
|
|
942
|
+
`};var Jt=e=>String(e).padStart(2,"0"),bt={name:"DjmTimePicker",components:{DjmIcon:P},props:{modelValue:{type:String,default:""},format:{type:String,default:"HH:mm"},minuteStep:{type:Number,default:1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"\u9009\u62E9\u65F6\u95F4"},clearable:{type:Boolean,default:!0}},emits:["update:modelValue","change","visible-change"],watch:{open(e){this.$emit("visible-change",e)}},data(){return{open:!1,draft:{h:"00",m:"00",s:"00"},panelStyle:{...le}}},computed:{hasSeconds(){return this.format.indexOf("ss")>-1},hours(){return Array.from({length:24},(e,t)=>Jt(t))},minutes(){let e=Math.max(1,Math.floor(Number(this.minuteStep))||1),t=[];for(let a=0;a<60;a+=e)t.push(Jt(a));return t},seconds(){return Array.from({length:60},(e,t)=>Jt(t))},columnDefs(){let e=[{key:"h",list:this.hours},{key:"m",list:this.minutes}];return this.hasSeconds&&e.push({key:"s",list:this.seconds}),e}},methods:{openPanel(){if(this.disabled)return;let e=(this.modelValue||"00:00:00").split(":");this.draft={h:e[0]||"00",m:e[1]||"00",s:e[2]||"00"},this.open=!0,this._detachPanel=ae({root:()=>this.$refs.root,panel:()=>this.$refs.panel,onClose:this.closePanel,onReposition:this.updatePosition}),requestAnimationFrame(this.updatePosition)},updatePosition(){if(!this.open||!this.$refs.root)return;let e=this.$refs.root.getBoundingClientRect(),t=this.$refs.panel;this.panelStyle=me({rect:e,flip:ue(e,t?t.offsetHeight:240),clampWidth:t?t.offsetWidth:180})},closePanel(){this.open&&(this.open=!1,this.panelStyle={...le},this._detachPanel&&(this._detachPanel(),this._detachPanel=null))},pick(e,t){this.draft={...this.draft,[e]:t};let a=this.hasSeconds?this.draft.h+":"+this.draft.m+":"+this.draft.s:this.draft.h+":"+this.draft.m;this.$emit("update:modelValue",a),this.$emit("change",a)},clear(){this.$emit("update:modelValue",""),this.$emit("change","")}},beforeUnmount(){this.closePanel()},template:`
|
|
943
943
|
<div class="djm-time-picker" ref="root" :class="{ 'djm-is-disabled': disabled }">
|
|
944
944
|
<!-- \u7528 div \u627F\u8F7D combobox\uFF0C\u6E05\u7A7A\u6309\u94AE\u4F5C\u4E3A\u5176\u5B50\u5143\u7D20\uFF0C\u907F\u514D\u6309\u94AE\u5D4C\u5957\u6309\u94AE -->
|
|
945
945
|
<div
|
|
@@ -993,7 +993,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
993
993
|
</div>
|
|
994
994
|
</Teleport>
|
|
995
995
|
</div>
|
|
996
|
-
`};var
|
|
996
|
+
`};var yt={name:"DjmColorPicker",props:{modelValue:{type:String,default:""},presets:{type:Array,default:()=>["#145a9f","#2b86d9","#4ec98d","#178050","#e3b45f","#966215","#ef8071","#c0392b","#805ad5","#4a5568","#1e2b3a","#f1f4f9"]},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change","visible-change"],data(){return{open:!1,draft:this.modelValue,panelStyle:{...le}}},watch:{modelValue(e){this.draft=e},open(e){this.$emit("visible-change",e)}},methods:{openPanel(){this.disabled||(this.draft=this.modelValue,this.open=!0,this._detachPanel=ae({root:()=>this.$refs.root,panel:()=>this.$refs.panel,onClose:this.closePanel,onReposition:this.updatePosition}),requestAnimationFrame(this.updatePosition))},updatePosition(){if(!this.open||!this.$refs.root)return;let e=this.$refs.root.getBoundingClientRect(),t=this.$refs.panel;this.panelStyle=me({rect:e,flip:ue(e,t?t.offsetHeight:220),clampWidth:t?t.offsetWidth:220})},closePanel(){this.open&&(this.open=!1,this.panelStyle={...le},this._detachPanel&&(this._detachPanel(),this._detachPanel=null))},emitColor(e){this.$emit("update:modelValue",e),this.$emit("change",e)},pick(e){this.draft=e,this.emitColor(e)},commitInput(){let e=this.draft.trim();if(!/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)){this.draft=this.modelValue;return}this.emitColor(e.toLowerCase())}},beforeUnmount(){this.closePanel()},template:`
|
|
997
997
|
<div class="djm-color-picker" ref="root" :class="{ 'djm-is-disabled': disabled }">
|
|
998
998
|
<button
|
|
999
999
|
class="djm-input djm-color-trigger"
|
|
@@ -1037,7 +1037,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1037
1037
|
</div>
|
|
1038
1038
|
</Teleport>
|
|
1039
1039
|
</div>
|
|
1040
|
-
`};var
|
|
1040
|
+
`};var _e={name:"DjmCascader",components:{DjmIcon:P},props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},placeholder:{type:String,default:"\u8BF7\u9009\u62E9"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0}},emits:["update:modelValue","change","visible-change"],watch:{open(e){this.$emit("visible-change",e)}},data(){return{open:!1,activePath:[],panelStyle:{...le}}},computed:{selectedLabels(){let e=[],t=this.options;for(let a of this.modelValue){let i=(t||[]).find(n=>n.value===a);if(!i)break;e.push(i.label),t=i.children}return e},columns(){let e=[this.options],t=this.options;for(let a=0;a<this.activePath.length;a++){let i=(t||[]).find(n=>n.value===this.activePath[a]);if(!i||!i.children||!i.children.length)break;e.push(i.children),t=i.children}return e}},methods:{t:C,openPanel(){this.disabled||(this.activePath=this.modelValue.slice(),this.open=!0,this._detachPanel=ae({root:()=>this.$refs.root,panel:()=>this.$refs.panel,onClose:this.closePanel,onReposition:this.updatePosition}),requestAnimationFrame(this.updatePosition))},updatePosition(){if(!this.open||!this.$refs.root)return;let e=this.$refs.root.getBoundingClientRect(),t=this.$refs.panel;this.panelStyle=me({rect:e,flip:ue(e,t?t.offsetHeight:240),clampWidth:t?t.offsetWidth:320})},closePanel(){this.open&&(this.open=!1,this.panelStyle={...le},this._detachPanel&&(this._detachPanel(),this._detachPanel=null))},pick(e,t){this.activePath=this.activePath.slice(0,t).concat(e.value),(!e.children||!e.children.length)&&(this.$emit("update:modelValue",this.activePath.slice()),this.$emit("change",this.activePath.slice()),this.closePanel())},isActive(e,t){return this.activePath[t]===e.value},clear(){this.$emit("update:modelValue",[]),this.$emit("change",[])}},beforeUnmount(){this.closePanel()},template:`
|
|
1041
1041
|
<div class="djm-cascader" ref="root" :class="{ 'djm-is-disabled': disabled }">
|
|
1042
1042
|
<!-- \u7528 div \u627F\u8F7D combobox\uFF0C\u6E05\u7A7A\u6309\u94AE\u4F5C\u4E3A\u5176\u5B50\u5143\u7D20\uFF0C\u907F\u514D\u6309\u94AE\u5D4C\u5957\u6309\u94AE -->
|
|
1043
1043
|
<div
|
|
@@ -1083,7 +1083,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1083
1083
|
</div>
|
|
1084
1084
|
</Teleport>
|
|
1085
1085
|
</div>
|
|
1086
|
-
`};var
|
|
1086
|
+
`};var qa={name:"DjmTransfer",props:{modelValue:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},titles:{type:Array,default:()=>["\u5F85\u9009","\u5DF2\u9009"]},searchable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],data(){return{checkedLeft:[],checkedRight:[],leftKeyword:"",rightKeyword:""}},watch:{leftKeyword(){this.checkedLeft=this.checkedLeft.filter(e=>this.leftList.some(t=>t.value===e))},rightKeyword(){this.checkedRight=this.checkedRight.filter(e=>this.rightList.some(t=>t.value===e))}},computed:{leftList(){return this.filtered(this.data.filter(e=>this.modelValue.indexOf(e.value)===-1),this.leftKeyword)},rightList(){return this.filtered(this.data.filter(e=>this.modelValue.indexOf(e.value)>-1),this.rightKeyword)},leftAllChecked(){return this.leftList.length>0&&this.leftList.every(e=>this.checkedLeft.indexOf(e.value)>-1)},rightAllChecked(){return this.rightList.length>0&&this.rightList.every(e=>this.checkedRight.indexOf(e.value)>-1)}},methods:{filtered(e,t){let a=t.trim().toLowerCase();return a?e.filter(i=>i.label.toLowerCase().indexOf(a)>-1):e},toggleLeft(e){e.disabled||this.disabled||(this.checkedLeft=this.toggleValue(this.checkedLeft,e.value))},toggleRight(e){e.disabled||this.disabled||(this.checkedRight=this.toggleValue(this.checkedRight,e.value))},toggleValue(e,t){return e.indexOf(t)>-1?e.filter(a=>a!==t):e.concat(t)},toggleAll(e){if(!this.disabled)if(e==="left"){let t=this.leftList.filter(a=>!a.disabled).map(a=>a.value);this.checkedLeft=this.leftAllChecked?[]:t}else{let t=this.rightList.filter(a=>!a.disabled).map(a=>a.value);this.checkedRight=this.rightAllChecked?[]:t}},move(e){if(this.disabled)return;let t;if(e==="right"){let a=this.checkedLeft.filter(i=>{let n=this.data.find(l=>l.value===i);return n&&!n.disabled});t=this.modelValue.concat(a),this.checkedLeft=[]}else t=this.modelValue.filter(a=>this.checkedRight.indexOf(a)===-1),this.checkedRight=[];this.$emit("update:modelValue",t),this.$emit("change",t)}},template:`
|
|
1087
1087
|
<div class="djm-transfer" :class="{ 'djm-is-disabled': disabled }">
|
|
1088
1088
|
<div class="djm-transfer-panel">
|
|
1089
1089
|
<div class="djm-transfer-head">
|
|
@@ -1140,7 +1140,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1140
1140
|
</div>
|
|
1141
1141
|
</div>
|
|
1142
1142
|
</div>
|
|
1143
|
-
`};var
|
|
1143
|
+
`};var Il={info:"info",success:"check",warning:"alert",danger:"alert"},_a={name:"DjmAlert",components:{DjmIcon:P},props:{tone:{type:String,default:"info"},title:{type:String,default:""},closable:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!0}},emits:["close"],computed:{iconName(){return Il[this.tone]||"info"}},template:`
|
|
1144
1144
|
<div class="djm-alert" :class="'djm-alert-' + tone" role="alert">
|
|
1145
1145
|
<DjmIcon v-if="showIcon" :name="iconName" :size="14" />
|
|
1146
1146
|
<div class="djm-alert-body">
|
|
@@ -1157,7 +1157,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1157
1157
|
<DjmIcon name="x" :size="12" />
|
|
1158
1158
|
</button>
|
|
1159
1159
|
</div>
|
|
1160
|
-
`};var
|
|
1160
|
+
`};var Ya={name:"DjmSpin",props:{spinning:{type:Boolean,default:!0},size:{type:String,default:"md"},tip:{type:String,default:""}},computed:{wrapped(){return!!this.$slots.default}},template:`
|
|
1161
1161
|
<div
|
|
1162
1162
|
v-if="wrapped"
|
|
1163
1163
|
class="djm-spin-wrap"
|
|
@@ -1180,7 +1180,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1180
1180
|
<span class="djm-spinner"></span>
|
|
1181
1181
|
<span v-if="tip" class="djm-spin-tip">{{ tip }}</span>
|
|
1182
1182
|
</span>
|
|
1183
|
-
`};import{nextTick as
|
|
1183
|
+
`};import{nextTick as wt,onBeforeUnmount as Ll,onMounted as Al,ref as jt,watch as zl}from"vue";var Ja={name:"DjmPopconfirm",components:{DjmIcon:P},props:{content:{type:String,default:""},confirmText:{type:String,default:"\u786E\u5B9A"},cancelText:{type:String,default:"\u53D6\u6D88"},tone:{type:String,default:"danger"},placement:{type:String,default:"top"},disabled:{type:Boolean,default:!1}},emits:["confirm","cancel","visible-change"],setup(e,{emit:t}){let a=jt(!1),i=jt(null),n=jt(null),l=jt({}),r=244,o=null;function s(){let g=i.value&&i.value.querySelector(".djm-popconfirm-trigger");if(!g)return;let y=g.querySelector('button, a[href], [role="button"]'),j=y||g;y||(j.setAttribute("role","button"),j.setAttribute("tabindex","0")),j.setAttribute("aria-haspopup","dialog"),j.setAttribute("aria-expanded",String(a.value))}Al(()=>wt(s)),zl(a,()=>wt(s));function d(){if(!a.value||!i.value)return;let g=i.value.getBoundingClientRect(),y={position:"fixed",width:r+"px"};(e.placement==="top"||window.innerHeight-g.bottom<120)&&g.top>120?y.bottom=window.innerHeight-g.top+8+"px":y.top=g.bottom+8+"px",y.left=Math.max(8,Math.min(g.left,window.innerWidth-r-8))+"px",l.value=y}function p(){e.disabled||a.value||(a.value=!0,t("visible-change",!0),o=ae({root:()=>i.value,panel:()=>n.value,onClose:c,onReposition:d}),requestAnimationFrame(d),wt(()=>{let g=n.value&&n.value.querySelector("button");g&&g.focus()}))}function c(){if(!a.value)return;let g=n.value&&n.value.contains(document.activeElement);a.value=!1,l.value={},t("visible-change",!1),o&&(o(),o=null),g&&wt(()=>{let y=i.value&&i.value.querySelector(".djm-popconfirm-trigger"),j=y&&(y.querySelector('button, a[href], [role="button"]')||y);j&&j.focus()})}function h(){e.disabled||(a.value?c():p())}function v(){t("confirm"),c()}function u(){t("cancel"),c()}return Ll(c),{open:a,root:i,panelEl:n,panelStyle:l,toggle:h,close:c,confirm:v,cancel:u}},template:`
|
|
1184
1184
|
<span class="djm-popconfirm" ref="root">
|
|
1185
1185
|
<span
|
|
1186
1186
|
class="djm-popconfirm-trigger"
|
|
@@ -1217,7 +1217,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1217
1217
|
</Transition>
|
|
1218
1218
|
</Teleport>
|
|
1219
1219
|
</span>
|
|
1220
|
-
`};import{onBeforeUnmount as
|
|
1220
|
+
`};import{onBeforeUnmount as Pl,onMounted as Bl,ref as Ga,watch as Nl}from"vue";var Xa={name:"DjmAnchor",props:{items:{type:Array,default:()=>[]},offset:{type:Number,default:12},container:{type:String,default:""},title:{type:String,default:""},smooth:{type:Boolean,default:!0}},emits:["change"],setup(e,{emit:t}){let a=Ga(null),i=Ga(""),n=null,l=null;function r(){return e.container?document.querySelector(e.container):a.value&&a.value.closest(".djm-content")||window}function o(v){return v===window?window.scrollY:v.scrollTop}function s(v){return v===window?0:v.getBoundingClientRect().top}function d(){if(!l)return;let v=o(l)+e.offset,u=e.items.length?e.items[0].href:"";for(let g of e.items){let y=document.querySelector(g.href);if(!y)continue;y.getBoundingClientRect().top-s(l)+o(l)<=v&&(u=g.href)}u&&u!==i.value&&(i.value=u,t("change",u))}function p(){c(),l=r(),l&&(n=l===window?window:l,n.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),d())}function c(){n&&(n.removeEventListener("scroll",d),window.removeEventListener("resize",d),n=null,l=null)}function h(v){let u=document.querySelector(v.href);if(!u||!l)return;let g=u.getBoundingClientRect().top-s(l)+o(l)-e.offset,y=e.smooth?"smooth":"auto";l===window?window.scrollTo({top:Math.max(0,g),behavior:y}):l.scrollTo({top:Math.max(0,g),behavior:y}),i.value=v.href,t("change",v.href)}return Bl(p),Nl(()=>e.container,p),Pl(c),{root:a,activeKey:i,go:h}},template:`
|
|
1221
1221
|
<nav ref="root" class="djm-anchor" aria-label="\u9875\u5185\u5BFC\u822A">
|
|
1222
1222
|
<div v-if="title" class="djm-anchor-title">{{ title }}</div>
|
|
1223
1223
|
<ul class="djm-anchor-list">
|
|
@@ -1232,7 +1232,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1232
1232
|
</li>
|
|
1233
1233
|
</ul>
|
|
1234
1234
|
</nav>
|
|
1235
|
-
`};import{onBeforeUnmount as
|
|
1235
|
+
`};import{onBeforeUnmount as Rl,onMounted as Vl,ref as Qa}from"vue";var Za={name:"DjmBacktop",components:{DjmIcon:P},props:{visibilityHeight:{type:Number,default:320},container:{type:String,default:""},right:{type:Number,default:24},bottom:{type:Number,default:24},smooth:{type:Boolean,default:!0}},emits:["click"],setup(e,{emit:t}){let a=Qa(!1),i=Qa(null),n=null,l=null;function r(){return e.container?document.querySelector(e.container):i.value&&i.value.closest(".djm-content")||window}function o(){if(!n)return;let c=n===window?window.scrollY:n.scrollTop;a.value=c>e.visibilityHeight}function s(){d(),n=r(),n&&(l=n===window?window:n,l.addEventListener("scroll",o,{passive:!0}),o())}function d(){l&&(l.removeEventListener("scroll",o),l=null,n=null)}function p(){if(!n)return;let c=e.smooth?"smooth":"auto";n===window?window.scrollTo({top:0,behavior:c}):n.scrollTo({top:0,behavior:c}),t("click")}return Vl(s),Rl(d),{visible:a,root:i,toTop:p}},template:`
|
|
1236
1236
|
<span ref="root" class="djm-backtop-host">
|
|
1237
1237
|
<Transition name="djm-fade">
|
|
1238
1238
|
<button
|
|
@@ -1247,7 +1247,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1247
1247
|
</button>
|
|
1248
1248
|
</Transition>
|
|
1249
1249
|
</span>
|
|
1250
|
-
`};var
|
|
1250
|
+
`};var ei={name:"DjmDivider",props:{vertical:{type:Boolean,default:!1}},computed:{withText(){return!this.vertical&&!!this.$slots.default}},template:`
|
|
1251
1251
|
<div
|
|
1252
1252
|
class="djm-divider"
|
|
1253
1253
|
:class="vertical ? 'djm-is-vertical' : ['djm-is-horizontal', { 'djm-is-text': withText }]"
|
|
@@ -1256,7 +1256,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1256
1256
|
>
|
|
1257
1257
|
<span v-if="withText" class="djm-divider-text"><slot /></span>
|
|
1258
1258
|
</div>
|
|
1259
|
-
`};var
|
|
1259
|
+
`};var ti={name:"DjmSpace",props:{size:{type:[Number,String],default:8},direction:{type:String,default:"horizontal"},align:{type:String,default:"center"},wrap:{type:Boolean,default:!1}},computed:{gap(){return typeof this.size=="number"?this.size+"px":this.size}},template:`
|
|
1260
1260
|
<div
|
|
1261
1261
|
class="djm-space"
|
|
1262
1262
|
:class="[
|
|
@@ -1268,13 +1268,13 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1268
1268
|
>
|
|
1269
1269
|
<slot />
|
|
1270
1270
|
</div>
|
|
1271
|
-
`};import{onBeforeUnmount as
|
|
1271
|
+
`};import{onBeforeUnmount as Hl,onMounted as Ol,ref as xt}from"vue";var ai={name:"DjmAffix",props:{offsetTop:{type:Number,default:0},offsetBottom:{type:Number,default:null},container:{type:String,default:""},zIndex:{type:Number,default:900}},setup(e){let t=xt(null),a=xt(!1),i=xt({}),n=xt({}),l=null,r=null;function o(){return e.container?document.querySelector(e.container):t.value&&t.value.closest(".djm-content")||window}function s(v,u){a.value||(n.value={height:u.height+"px"},a.value=!0),i.value={position:"fixed",left:u.left+"px",width:u.width+"px",zIndex:e.zIndex,...v}}function d(){a.value&&(a.value=!1,i.value={},n.value={})}function p(){if(!l||!t.value)return;let v=t.value.getBoundingClientRect(),u=l===window?0:l.getBoundingClientRect().top;if(typeof e.offsetBottom=="number"){let g=window.innerHeight-e.offsetBottom;v.bottom>=g?s({bottom:e.offsetBottom+"px"},v):d();return}v.top<u+e.offsetTop?s({top:e.offsetTop+"px"},v):d()}function c(){h(),l=o(),l&&(r=l===window?window:l,r.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),p())}function h(){r&&(r.removeEventListener("scroll",p),window.removeEventListener("resize",p),r=null,l=null)}return Ol(c),Hl(h),{root:t,fixed:a,affixStyle:i,holderStyle:n}},template:`
|
|
1272
1272
|
<div ref="root" class="djm-affix" :style="holderStyle">
|
|
1273
1273
|
<div class="djm-affix-inner" :class="{ 'djm-is-fixed': fixed }" :style="affixStyle">
|
|
1274
1274
|
<slot />
|
|
1275
1275
|
</div>
|
|
1276
1276
|
</div>
|
|
1277
|
-
`};var
|
|
1277
|
+
`};var ii={name:"DjmSegmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]},ariaLabel:{type:String,default:"\u5206\u6BB5\u5207\u6362"}},emits:["update:modelValue","change"],methods:{isActive(e){return e.value===this.modelValue},select(e){e.disabled||this.isActive(e)||(this.$emit("update:modelValue",e.value),this.$emit("change",e.value))}},template:`
|
|
1278
1278
|
<div class="djm-segmented" role="group" :aria-label="ariaLabel">
|
|
1279
1279
|
<button
|
|
1280
1280
|
v-for="item in options"
|
|
@@ -1290,7 +1290,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1290
1290
|
<span v-if="item.badge !== undefined && item.badge !== null" class="djm-segmented-badge">{{ item.badge }}</span>
|
|
1291
1291
|
</button>
|
|
1292
1292
|
</div>
|
|
1293
|
-
`};import{nextTick as
|
|
1293
|
+
`};import{nextTick as Fl,onBeforeUnmount as Kl,ref as kt,watch as Wl}from"vue";var nt=0,ni="",Gt=!1;function $l(){return Math.max(0,window.innerWidth-document.documentElement.clientWidth)}function Le(){if(nt===0){let e=$l();if(e>0){ni=document.body.style.paddingRight;let t=parseFloat(window.getComputedStyle(document.body).paddingRight)||0;document.body.style.paddingRight=t+e+"px",Gt=!0}document.body.classList.add("djm-no-scroll")}nt+=1}function be(){nt!==0&&(nt-=1,!(nt>0)&&(document.body.classList.remove("djm-no-scroll"),Gt&&(document.body.style.paddingRight=ni,Gt=!1)))}var li={name:"DjmImage",components:{DjmIcon:P},props:{src:{type:String,default:""},alt:{type:String,default:""},width:{type:[Number,String],default:""},height:{type:[Number,String],default:""},fit:{type:String,default:"cover"},preview:{type:Boolean,default:!0}},setup(e){let t=kt(!1),a=kt(!1),i=kt(null),n=kt(null);Wl(()=>e.src,()=>{t.value=!1});function l(d){return typeof d=="number"?d+"px":d}function r(d){d.key==="Escape"&&s()}async function o(){t.value||!e.src||(a.value=!0,Le(),document.addEventListener("keydown",r),await Fl(),n.value&&n.value.focus())}function s(){a.value&&(a.value=!1,be(),document.removeEventListener("keydown",r),i.value&&i.value.focus())}return Kl(s),{failed:t,open:a,zoomRef:i,closeRef:n,toSize:l,openPreview:o,closePreview:s,t:C}},template:`
|
|
1294
1294
|
<div
|
|
1295
1295
|
class="djm-image"
|
|
1296
1296
|
:style="{ width: toSize(width), height: toSize(height) }"
|
|
@@ -1338,12 +1338,12 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1338
1338
|
</div>
|
|
1339
1339
|
</Teleport>
|
|
1340
1340
|
</div>
|
|
1341
|
-
`};import{computed as
|
|
1341
|
+
`};import{computed as Ql,onBeforeUnmount as Zl,onMounted as eo,ref as to,watch as ao}from"vue";import{ref as oi}from"vue";var ri="djm-theme",Xt="djm-primary",Ae=oi("light"),Ul=[{name:"\u9ED8\u8BA4\u84DD",value:"#1a6fc4"},{name:"\u79D1\u6280\u84DD",value:"#2563eb"},{name:"\u9752\u78A7",value:"#0f8b8d"},{name:"\u7FE1\u7FE0\u7EFF",value:"#12855a"},{name:"\u5178\u96C5\u7D2B",value:"#6d4ad8"},{name:"\u7425\u73C0\u6A59",value:"#b8620f"},{name:"\u6731\u7802\u7EA2",value:"#c0392b"},{name:"\u77F3\u58A8\u7070",value:"#4b5b6b"}],St=oi(""),ql=["--djm-brand-50","--djm-brand-100","--djm-brand-200","--djm-brand-500","--djm-brand-600","--djm-brand-700","--djm-brand-800","--djm-brand-solid","--djm-brand-solid-hover","--djm-brand-soft","--djm-info","--djm-info-bg","--djm-info-border"];function _l(e){let t=String(e||"").replace("#",""),a=t.length===3?t.split("").map(h=>h+h).join(""):t;if(!/^[0-9a-fA-F]{6}$/.test(a))return{h:206,s:76,l:44};let i=parseInt(a.slice(0,2),16)/255,n=parseInt(a.slice(2,4),16)/255,l=parseInt(a.slice(4,6),16)/255,r=Math.max(i,n,l),o=Math.min(i,n,l),s=(r+o)/2;if(r===o)return{h:0,s:0,l:Math.round(s*100)};let d=r-o,p=s>.5?d/(2-r-o):d/(r+o),c;return r===i?c=((n-l)/d+(n<l?6:0))*60:r===n?c=((l-i)/d+2)*60:c=((i-n)/d+4)*60,{h:Math.round(c),s:Math.round(p*100),l:Math.round(s*100)}}function oe(e,t,a){let i=Math.min(100,Math.max(0,t))/100,n=Math.min(100,Math.max(0,a))/100,l=(1-Math.abs(2*n-1))*i,r=l*(1-Math.abs(e/60%2-1)),o=n-l/2,s;return e<60?s=[l,r,0]:e<120?s=[r,l,0]:e<180?s=[0,l,r]:e<240?s=[0,r,l]:e<300?s=[r,0,l]:s=[l,0,r],"#"+s.map(d=>Math.round((d+o)*255).toString(16).padStart(2,"0")).join("")}function Yl(e,t){let{h:a,s:i,l:n}=_l(e),l=Math.min(Math.max(i,20),92),r=o=>Math.min(97,Math.max(8,o));if(t){let o=Math.min(36,n);return{"--djm-brand-50":oe(a,Math.min(40,l*.5),14),"--djm-brand-100":oe(a,Math.min(42,l*.55),19),"--djm-brand-200":oe(a,Math.min(46,l*.6),27),"--djm-brand-500":oe(a,l,r(n+18)),"--djm-brand-600":oe(a,l,r(n+12)),"--djm-brand-700":oe(a,l*.95,r(n+30)),"--djm-brand-800":oe(a,l*.9,r(n+40)),"--djm-brand-solid":oe(a,l,o),"--djm-brand-solid-hover":oe(a,l,Math.max(10,o-6)),"--djm-brand-soft":oe(a,Math.min(40,l*.5),18),"--djm-info":oe(a,l*.95,r(n+34)),"--djm-info-bg":oe(a,Math.min(38,l*.48),16),"--djm-info-border":oe(a,Math.min(44,l*.58),26)}}return{"--djm-brand-50":oe(a,Math.min(95,l*1.05),96),"--djm-brand-100":oe(a,Math.min(92,l),92),"--djm-brand-200":oe(a,Math.min(88,l*.95),84),"--djm-brand-500":oe(a,l,r(n+7)),"--djm-brand-600":oe(a,l,r(n)),"--djm-brand-700":oe(a,l,r(n-7)),"--djm-brand-800":oe(a,l,r(n-14)),"--djm-brand-solid":oe(a,l,r(n)),"--djm-brand-solid-hover":oe(a,l,r(n-7)),"--djm-brand-soft":oe(a,Math.min(90,l*1.05),96),"--djm-info":oe(a,l,r(n-7)),"--djm-info-bg":oe(a,Math.min(90,l*1.05),96),"--djm-info-border":oe(a,Math.min(85,l*.9),86)}}function si(e){let t=document.documentElement;if(!e){ql.forEach(i=>t.style.removeProperty(i));return}let a=Yl(e,Ae.value==="dark");Object.keys(a).forEach(i=>t.style.setProperty(i,a[i]))}function di(e){St.value=e||"",si(e||"");try{e?localStorage.setItem(Xt,e):localStorage.removeItem(Xt)}catch{}}function Jl(){di("")}function Qt(e){Ae.value=e==="dark"?"dark":"light",document.documentElement.dataset.djmTheme=Ae.value,si(St.value);try{localStorage.setItem(ri,Ae.value)}catch{}}function Gl(){Qt(Ae.value==="dark"?"light":"dark")}function Xl(){let e="";try{e=localStorage.getItem(ri)||""}catch{e=""}let t="";try{t=new URLSearchParams(window.location.search).get("theme")||""}catch{t=""}let a="";try{a=localStorage.getItem(Xt)||""}catch{a=""}a&&(St.value=a),Qt(t==="dark"||t==="light"?t:e||"light")}var ci={name:"DjmWatermark",props:{content:{type:[String,Array],default:"\u5185\u90E8\u8D44\u6599"},gap:{type:Number,default:80},fontSize:{type:Number,default:14},color:{type:String,default:""},rotate:{type:Number,default:-20},zIndex:{type:Number,default:10}},setup(e){let t=to(""),a=null;function i(){let l=(Array.isArray(e.content)?e.content:[e.content]).filter(Boolean);if(!l.length){t.value="";return}a||(a=document.createElement("canvas"));let r=a.getContext("2d"),o=window.devicePixelRatio||1,s=Math.round(e.fontSize*1.6),d=e.fontSize+'px -apple-system, "PingFang SC", sans-serif';r.font=d;let p=Math.max(...l.map(j=>r.measureText(j).width)),c=s*l.length,h=e.rotate*Math.PI/180,v=Math.abs(Math.cos(h)),u=Math.abs(Math.sin(h)),g=Math.ceil(p*v+c*u+e.gap),y=Math.ceil(p*u+c*v+e.gap);a.width=g*o,a.height=y*o,r.scale(o,o),r.clearRect(0,0,g,y),r.translate(g/2,y/2),r.rotate(e.rotate*Math.PI/180),r.fillStyle=e.color||getComputedStyle(document.documentElement).getPropertyValue("--djm-watermark").trim()||"rgba(0, 0, 0, 0.08)",r.font=d,r.textAlign="center",r.textBaseline="middle",l.forEach((j,w)=>{let b=(w-(l.length-1)/2)*s;r.fillText(j,0,b)}),t.value=a.toDataURL("image/png")}let n=Ql(()=>({backgroundImage:t.value?"url("+t.value+")":"none",zIndex:e.zIndex}));return eo(i),ao(()=>[e.content,e.gap,e.fontSize,e.color,e.rotate,Ae.value],i,{deep:!0}),Zl(()=>{a=null}),{layerStyle:n}},template:`
|
|
1342
1342
|
<div class="djm-watermark">
|
|
1343
1343
|
<slot />
|
|
1344
1344
|
<div class="djm-watermark-layer" :style="layerStyle" aria-hidden="true"></div>
|
|
1345
1345
|
</div>
|
|
1346
|
-
`};var
|
|
1346
|
+
`};var io=0,ui={name:"DjmAutoComplete",props:{modelValue:{type:String,default:""},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},minChars:{type:Number,default:1},ariaLabel:{type:String,default:"\u81EA\u52A8\u5B8C\u6210"}},emits:["update:modelValue","input","select","focus","blur"],data(){return{query:this.modelValue,open:!1,activeIndex:-1,listId:"djm-autocomplete-"+ ++io,panelStyle:{...le}}},watch:{modelValue(e){this.query=e}},computed:{normalized(){return this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)},filtered(){let e=(this.query||"").trim().toLowerCase();return e.length<this.minChars?[]:(e?this.normalized.filter(a=>String(a.label).toLowerCase().indexOf(e)>-1):this.normalized).slice(0,8)},activeId(){return this.activeIndex>-1?this.listId+"-"+this.activeIndex:void 0}},methods:{onInput(e){this.query=e.target.value,this.$emit("update:modelValue",e.target.value),this.$emit("input",e),this.activeIndex=-1,this.filtered.length?this.openPanel():this.closePanel()},onFocus(e){this.activeIndex=-1,this.filtered.length&&this.openPanel(),this.$emit("focus",e)},onBlur(e){this.closePanel(),this.$emit("blur",e)},onKeydown(e){if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(!this.open){if(!this.filtered.length)return;this.openPanel()}e.preventDefault();let t=e.key==="ArrowDown"?1:-1,a=this.filtered.length;this.activeIndex=(this.activeIndex+t+a)%a;return}if(e.key==="Enter"){let t=this.filtered[this.activeIndex]||this.filtered[0];this.open&&t&&(e.preventDefault(),this.choose(t));return}e.key==="Escape"&&this.closePanel()},choose(e){this.query=e.value,this.$emit("update:modelValue",e.value),this.$emit("select",e),this.closePanel()},openPanel(){if(this.open){this.$nextTick(this.updatePosition);return}this.open=!0,this._detachPanel=ae({root:()=>this.$refs.root,panel:()=>this.$refs.panel,onClose:this.closePanel,onReposition:this.updatePosition,esc:!1}),this.$nextTick(this.updatePosition)},closePanel(){this.open&&(this.open=!1,this.activeIndex=-1,this.panelStyle={...le},this._detachPanel&&(this._detachPanel(),this._detachPanel=null))},updatePosition(){if(!this.open||!this.$refs.root)return;let e=this.$refs.root.getBoundingClientRect(),t=this.$refs.panel;this.panelStyle=me({rect:e,flip:ue(e,t?t.offsetHeight:240),width:e.width,clampWidth:e.width})}},beforeUnmount(){this.closePanel()},template:`
|
|
1347
1347
|
<div class="djm-autocomplete" ref="root" :class="{ 'djm-is-disabled': disabled }">
|
|
1348
1348
|
<input
|
|
1349
1349
|
class="djm-input djm-autocomplete-input"
|
|
@@ -1386,7 +1386,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1386
1386
|
</div>
|
|
1387
1387
|
</Teleport>
|
|
1388
1388
|
</div>
|
|
1389
|
-
`};import{computed as
|
|
1389
|
+
`};import{computed as no,onBeforeUnmount as lo,ref as mi}from"vue";var fi={name:"DjmSplitter",props:{modelValue:{type:Number,default:50},direction:{type:String,default:"horizontal"},min:{type:Number,default:15},max:{type:Number,default:85}},emits:["update:modelValue","change"],setup(e,{emit:t}){let a=mi(null),i=mi(!1),n=no(()=>{let p=Number(e.modelValue),c=Number.isFinite(p)?p:50;return Math.min(e.max,Math.max(e.min,c))});function l(p){let c=Math.min(e.max,Math.max(e.min,Math.round(p*10)/10));c!==n.value&&(t("update:modelValue",c),t("change",c))}function r(p){if(!a.value)return;let c=a.value.getBoundingClientRect(),h=e.direction==="vertical",v=h?p.clientY-c.top:p.clientX-c.left,u=h?c.height:c.width;u&&l(v/u*100)}function o(){i.value&&(i.value=!1,window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",o))}function s(){i.value=!0,window.addEventListener("pointermove",r),window.addEventListener("pointerup",o)}function d(p){let c=e.direction==="vertical",h=c?"ArrowUp":"ArrowLeft",v=c?"ArrowDown":"ArrowRight",u=p.shiftKey?10:2;p.key===h?(p.preventDefault(),l(n.value-u)):p.key===v&&(p.preventDefault(),l(n.value+u))}return lo(o),{root:a,dragging:i,ratio:n,startDrag:s,onKeydown:d}},template:`
|
|
1390
1390
|
<div
|
|
1391
1391
|
ref="root"
|
|
1392
1392
|
class="djm-splitter"
|
|
@@ -1416,7 +1416,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1416
1416
|
<slot name="second" />
|
|
1417
1417
|
</div>
|
|
1418
1418
|
</div>
|
|
1419
|
-
`};import{onBeforeUnmount as
|
|
1419
|
+
`};import{onBeforeUnmount as oo,onMounted as ro,ref as so,watch as co}from"vue";var pi={name:"DjmCarousel",components:{DjmIcon:P},props:{items:{type:Array,default:()=>[]},height:{type:[Number,String],default:180},autoplay:{type:Boolean,default:!1},interval:{type:Number,default:4e3},arrows:{type:Boolean,default:!0},dots:{type:Boolean,default:!0}},emits:["change"],setup(e,{emit:t}){let a=so(0),i=null,n=()=>({height:typeof e.height=="number"?e.height+"px":e.height});function l(v){let u=e.items.length;if(!u)return;let g=(v+u)%u;g!==a.value&&(a.value=g,t("change",g))}function r(){l(a.value+1)}function o(){l(a.value-1)}function s(){window.clearInterval(i),i=null}function d(){s(),!(!e.autoplay||e.items.length<2)&&(i=window.setInterval(r,Math.max(1200,e.interval)))}function p(v){v.key==="ArrowLeft"?(v.preventDefault(),o()):v.key==="ArrowRight"&&(v.preventDefault(),r())}ro(d),co(()=>[e.autoplay,e.interval,e.items.length],d);function c(){e.autoplay&&s()}function h(){e.autoplay&&d()}return oo(s),{index:a,boxStyle:n,go:l,next:r,prev:o,onKeydown:p,pause:c,resume:h}},template:`
|
|
1420
1420
|
<div
|
|
1421
1421
|
class="djm-carousel"
|
|
1422
1422
|
role="region"
|
|
@@ -1469,7 +1469,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1469
1469
|
></button>
|
|
1470
1470
|
</div>
|
|
1471
1471
|
</div>
|
|
1472
|
-
`};import{computed as
|
|
1472
|
+
`};import{computed as uo,nextTick as Zt,onBeforeUnmount as mo,onMounted as fo,ref as Dt,watch as po}from"vue";var hi={name:"DjmTour",components:{DjmIcon:P},props:{modelValue:{type:Boolean,default:!1},steps:{type:Array,default:()=>[]},offset:{type:Number,default:10}},emits:["update:modelValue","change","finish"],setup(e,{emit:t}){let a=Dt(0),i=Dt({top:"0px",left:"0px",width:"0px",height:"0px"}),n=Dt({position:"fixed",left:"0px",top:"0px",visibility:"hidden"}),l=Dt(null),r=uo(()=>e.steps[a.value]||null);function o(){let u=r.value;if(!u)return;let g=u.target?document.querySelector(u.target):null,y=g?g.getBoundingClientRect():{top:80,left:80,width:220,height:40,bottom:120};i.value={top:y.top-4+"px",left:y.left-4+"px",width:y.width+8+"px",height:y.height+8+"px"};let j=l.value?l.value.offsetHeight:160,w=l.value?l.value.offsetWidth:280,m=window.innerHeight-y.bottom>j+e.offset+12?y.bottom+e.offset:Math.max(12,y.top-j-e.offset),f=Math.max(12,Math.min(y.left,window.innerWidth-w-12));n.value={position:"fixed",top:m+"px",left:f+"px",visibility:"visible"}}function s(u){u.key==="Escape"?c():u.key==="ArrowRight"&&l.value&&l.value.contains(document.activeElement)?h():u.key==="ArrowLeft"&&l.value&&l.value.contains(document.activeElement)&&v()}function d(){a.value=0,t("change",0),document.addEventListener("keydown",s),window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),Zt(()=>{o(),l.value&&l.value.focus({preventScroll:!0})})}function p(){document.removeEventListener("keydown",s),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}function c(){e.modelValue&&t("update:modelValue",!1)}function h(){if(a.value>=e.steps.length-1){t("finish"),c();return}a.value+=1,t("change",a.value),Zt(o)}function v(){a.value!==0&&(a.value-=1,t("change",a.value),Zt(o))}return po(()=>e.modelValue,u=>{u?d():p()}),fo(()=>{e.modelValue&&d()}),mo(p),{current:a,step:r,highlight:i,cardStyle:n,card:l,close:c,next:h,prev:v,t:C}},template:`
|
|
1473
1473
|
<Teleport to="body">
|
|
1474
1474
|
<div v-if="modelValue && step" class="djm-tour">
|
|
1475
1475
|
<div class="djm-tour-highlight" :style="highlight"></div>
|
|
@@ -1500,7 +1500,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1500
1500
|
</div>
|
|
1501
1501
|
</div>
|
|
1502
1502
|
</Teleport>
|
|
1503
|
-
`};import{computed as
|
|
1503
|
+
`};import{computed as Et,ref as vi,watch as ho}from"vue";function gi(e){return String(e).padStart(2,"0")}function Mt(e,t,a){return`${e}-${gi(t+1)}-${gi(a)}`}function ea(e){if(!e)return null;let t=String(e).split("-").map(Number);if(t.length!==3||t.some(r=>!Number.isFinite(r)))return null;let[a,i,n]=t,l=new Date(a,i-1,n);return i<1||i>12||n<1||l.getFullYear()!==a||l.getMonth()!==i-1||l.getDate()!==n?null:{year:a,month:i-1,day:n}}var bi={name:"DjmCalendar",components:{DjmIcon:P},props:{modelValue:{type:String,default:""},marks:{type:Array,default:()=>[]},firstDay:{type:Number,default:1}},emits:["update:modelValue","change","month-change"],setup(e,{emit:t}){let a=new Date,i=Mt(a.getFullYear(),a.getMonth(),a.getDate()),n=ea(e.modelValue),l=vi(n?n.year:a.getFullYear()),r=vi(n?n.month:a.getMonth()),o=Et(()=>{let g=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"];return g.slice(e.firstDay).concat(g.slice(0,e.firstDay))}),s=Et(()=>new Set(e.marks.map(g=>typeof g=="string"?g:g.date).filter(Boolean))),d=Et(()=>{let y=(new Date(l.value,r.value,1).getDay()-e.firstDay+7)%7,j=new Date(l.value,r.value,1-y),w=[];for(let b=0;b<42;b++){let m=new Date(j.getFullYear(),j.getMonth(),j.getDate()+b);w.push({key:Mt(m.getFullYear(),m.getMonth(),m.getDate()),day:m.getDate(),outside:m.getMonth()!==r.value})}return w}),p=Et(()=>{let g=d.value;return Array.from({length:6},(y,j)=>g.slice(j*7,j*7+7))});function c(g){let y=new Date(l.value,r.value+g,1);l.value=y.getFullYear(),r.value=y.getMonth(),t("month-change",Mt(l.value,r.value,1))}function h(g){t("update:modelValue",g.key),t("change",g.key);let y=ea(g.key);y&&(y.year!==l.value||y.month!==r.value)&&(l.value=y.year,r.value=y.month,t("month-change",Mt(y.year,y.month,1)))}function v(){l.value=a.getFullYear(),r.value=a.getMonth(),h({key:i})}function u(g){let y={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7},j=[...g.currentTarget.querySelectorAll(".djm-date-picker-day")],w=j.indexOf(document.activeElement);if(w<0)return;let b=y[g.key];if(g.key==="Home"||g.key==="End"){g.preventDefault();let f=w-w%7;j[g.key==="Home"?f:Math.min(f+6,j.length-1)].focus();return}if(!b)return;let m=w+b;m<0||m>=j.length||(g.preventDefault(),j[m].focus())}return ho(()=>e.modelValue,g=>{let y=ea(g);y&&(y.year!==l.value||y.month!==r.value)&&(l.value=y.year,r.value=y.month)}),{todayKey:i,viewYear:l,viewMonth:r,weekNames:o,markSet:s,cells:d,weeks:p,shift:c,select:h,goToday:v,onGridKey:u,t:C}},template:`
|
|
1504
1504
|
<div class="djm-calendar">
|
|
1505
1505
|
<div class="djm-calendar-head">
|
|
1506
1506
|
<div class="djm-calendar-title" aria-live="polite">{{ t('calendar.title', { year: viewYear, month: viewMonth + 1 }) }}</div>
|
|
@@ -1541,7 +1541,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1541
1541
|
</div>
|
|
1542
1542
|
</div>
|
|
1543
1543
|
</div>
|
|
1544
|
-
`};import{onBeforeUnmount as
|
|
1544
|
+
`};import{onBeforeUnmount as vo,ref as go}from"vue";var yi={name:"DjmFloatButton",components:{DjmIcon:P},props:{icon:{type:String,default:"plus"},label:{type:String,default:"\u5FEB\u6377\u64CD\u4F5C"},items:{type:Array,default:()=>[]},type:{type:String,default:"primary"},right:{type:Number,default:24},bottom:{type:Number,default:24}},emits:["click","select"],setup(e,{emit:t}){let a=go(!1);function i(d){d.key==="Escape"&&l()}function n(d){d.target.closest(".djm-float-button")||l()}function l(){a.value&&(a.value=!1,document.removeEventListener("mousedown",n,!0),document.removeEventListener("keydown",i))}function r(){a.value=!a.value,a.value?(document.addEventListener("mousedown",n,!0),document.addEventListener("keydown",i)):l()}function o(){if(!e.items.length){t("click");return}r()}function s(d){l(),t("select",d),typeof d.onClick=="function"&&d.onClick(d)}return vo(l),{open:a,onMainClick:o,choose:s}},template:`
|
|
1545
1545
|
<div class="djm-float-button" :style="{ right: right + 'px', bottom: bottom + 'px' }">
|
|
1546
1546
|
<Transition name="djm-fade">
|
|
1547
1547
|
<div v-if="open && items.length" class="djm-float-list">
|
|
@@ -1569,7 +1569,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1569
1569
|
<DjmIcon :name="open ? 'x' : icon" :size="18" />
|
|
1570
1570
|
</button>
|
|
1571
1571
|
</div>
|
|
1572
|
-
`};import{computed as
|
|
1572
|
+
`};import{computed as ta,nextTick as aa,onBeforeUnmount as bo,ref as Ne,watch as yo}from"vue";var wo=0,wi={name:"DjmMentions",props:{modelValue:{type:String,default:""},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},rows:{type:Number,default:3},disabled:{type:Boolean,default:!1},ariaLabel:{type:String,default:"\u5185\u5BB9\u8F93\u5165"}},emits:["update:modelValue","input","select"],setup(e,{emit:t}){let a=Ne(null),i=Ne(null),n=Ne(e.modelValue),l=Ne(!1),r=Ne(""),o=Ne(-1),s="djm-mentions-"+ ++wo,d=Ne({...le}),p=-1,c=null;yo(()=>e.modelValue,f=>{n.value=f});let h=ta(()=>e.options.map(f=>typeof f=="string"?{value:f,label:f}:f)),v=ta(()=>{let f=r.value.trim().toLowerCase();return(f?h.value.filter(D=>String(D.label).toLowerCase().indexOf(f)>-1):h.value).slice(0,6)}),u=ta(()=>o.value>-1?s+"-"+o.value:void 0);function g(){if(!l.value||!a.value)return;let f=a.value.getBoundingClientRect(),E=document.getElementById(s);d.value=me({rect:f,flip:ue(f,E?E.offsetHeight:200),width:f.width})}function y(){l.value=!0,c=ae({root:()=>a.value,panel:()=>document.getElementById(s),onClose:j,onReposition:g,esc:!1}),aa(g)}function j(){l.value&&(l.value=!1,o.value=-1,d.value={...le},c&&(c(),c=null))}function w(f){let E=f.target.value;n.value=E,t("update:modelValue",E),t("input",f);let D=f.target.selectionStart||0,k=/@([^\s@]*)$/.exec(E.slice(0,D));if(!k){j();return}p=D-k[0].length,r.value=k[1],o.value=-1,l.value?aa(g):y()}function b(f){if(l.value){if(f.key==="ArrowDown"||f.key==="ArrowUp"){f.preventDefault();let E=f.key==="ArrowDown"?1:-1,D=v.value.length;if(!D)return;o.value=(o.value+E+D)%D;return}if(f.key==="Enter"){let E=v.value[o.value]||v.value[0];E&&(f.preventDefault(),m(E));return}f.key==="Escape"&&j()}}function m(f){let E=n.value||"",D=p+1+r.value.length,k=E.slice(0,p)+"@"+f.label+" "+E.slice(D);n.value=k,t("update:modelValue",k),t("select",f),j(),aa(()=>{if(!i.value)return;let B=p+f.label.length+2;i.value.focus(),i.value.setSelectionRange(B,B)})}return bo(j),{root:a,input:i,text:n,open:l,activeIndex:o,listId:s,panelStyle:d,filtered:v,activeId:u,onInput:w,onKeydown:b,choose:m}},template:`
|
|
1573
1573
|
<div ref="root" class="djm-mentions">
|
|
1574
1574
|
<textarea
|
|
1575
1575
|
ref="input"
|
|
@@ -1605,11 +1605,11 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1605
1605
|
</div>
|
|
1606
1606
|
</Teleport>
|
|
1607
1607
|
</div>
|
|
1608
|
-
`};var
|
|
1608
|
+
`};var Ct={name:"DjmRow",props:{gap:{type:[Number,String],default:10}},computed:{style(){return{gap:typeof this.gap=="number"?this.gap+"px":this.gap}}},template:'<div class="djm-grid-row" :style="style"><slot /></div>'};var Tt={name:"DjmCol",props:{span:{type:Number,default:12},offset:{type:Number,default:0}},computed:{classes(){return"djm-col-"+Math.min(12,Math.max(1,this.span))},style(){return this.offset?{gridColumnStart:this.offset+1}:null}},template:'<div :class="classes" :style="style"><slot /></div>'};var ji={name:"DjmLayout",props:{direction:{type:String,default:"vertical"}},template:`
|
|
1609
1609
|
<div class="djm-layout" :class="'djm-layout-' + direction">
|
|
1610
1610
|
<slot />
|
|
1611
1611
|
</div>
|
|
1612
|
-
`};var
|
|
1612
|
+
`};var xi={name:"DjmLayoutHeader",template:'<header class="djm-layout-header"><slot /></header>'};var ki={name:"DjmLayoutSider",props:{width:{type:[Number,String],default:200}},computed:{style(){return{width:typeof this.width=="number"?this.width+"px":this.width}}},template:'<aside class="djm-layout-sider" :style="style"><slot /></aside>'};var Si={name:"DjmLayoutContent",template:'<main class="djm-layout-content"><slot /></main>'};var Di={name:"DjmLayoutFooter",template:'<footer class="djm-layout-footer"><slot /></footer>'};var Ei={name:"DjmList",props:{items:{type:Array,default:()=>[]},bordered:{type:Boolean,default:!0},emptyText:{type:String,default:"\u6682\u65E0\u6570\u636E"}},template:`
|
|
1613
1613
|
<div class="djm-list" :class="{ 'djm-is-bordered': bordered }">
|
|
1614
1614
|
<div v-if="$slots.header" class="djm-list-header"><slot name="header" /></div>
|
|
1615
1615
|
<ul v-if="items.length" class="djm-list-body">
|
|
@@ -1626,7 +1626,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1626
1626
|
<div v-else class="djm-list-empty">{{ emptyText }}</div>
|
|
1627
1627
|
<div v-if="$slots.footer" class="djm-list-footer"><slot name="footer" /></div>
|
|
1628
1628
|
</div>
|
|
1629
|
-
`};var
|
|
1629
|
+
`};var Mi={name:"DjmInputTag",components:{DjmIcon:P},props:{modelValue:{type:Array,default:()=>[]},placeholder:{type:String,default:""},max:{type:Number,default:0},disabled:{type:Boolean,default:!1},allowDuplicate:{type:Boolean,default:!1},ariaLabel:{type:String,default:"\u6807\u7B7E\u8F93\u5165"}},emits:["update:modelValue","change","add","remove","focus","blur"],data(){return{draft:""}},computed:{reachedMax(){return this.max>0&&this.modelValue.length>=this.max},placeholderText(){return this.modelValue.length?"":this.placeholder}},methods:{focusInput(){this.disabled||!this.$refs.input||this.$refs.input.focus()},commit(){let e=this.draft.trim();if(!e){this.draft="";return}if(this.reachedMax||!this.allowDuplicate&&this.modelValue.indexOf(e)>-1){this.draft="";return}let t=this.modelValue.concat(e);this.draft="",this.$emit("update:modelValue",t),this.$emit("change",t),this.$emit("add",e)},remove(e){if(this.disabled)return;let t=this.modelValue[e],a=this.modelValue.slice();a.splice(e,1),this.$emit("update:modelValue",a),this.$emit("change",a),this.$emit("remove",t)},onKeydown(e){if(e.key==="Enter"||e.key===","){e.preventDefault(),this.commit();return}e.key==="Backspace"&&!this.draft&&this.modelValue.length&&(e.preventDefault(),this.remove(this.modelValue.length-1))},onInput(e){this.draft=e.target.value},onBlur(e){this.commit(),this.$el.contains(e.relatedTarget)||this.$emit("blur",e)}},template:`
|
|
1630
1630
|
<div
|
|
1631
1631
|
class="djm-input djm-input-tag"
|
|
1632
1632
|
:class="{ 'djm-is-disabled': disabled, 'djm-is-full': reachedMax }"
|
|
@@ -1659,7 +1659,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1659
1659
|
@focus="$emit('focus', $event)"
|
|
1660
1660
|
/>
|
|
1661
1661
|
</div>
|
|
1662
|
-
`};import{computed as
|
|
1662
|
+
`};import{computed as ia,ref as jo}from"vue";var Ci={name:"DjmPassword",components:{DjmIcon:P},props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},showStrength:{type:Boolean,default:!0},ariaLabel:{type:String,default:""}},emits:["update:modelValue","input","change","enter","focus","blur"],setup(e,{emit:t}){let a=jo(!1),i=ia(()=>{let o=e.modelValue||"";if(!o)return 0;let s=0;return o.length>=8&&(s+=1),/[a-z]/.test(o)&&/[A-Z]/.test(o)&&(s+=1),/\d/.test(o)&&(s+=1),/[^a-zA-Z\d]/.test(o)&&(s+=1),s}),n=ia(()=>i.value<=1?1:i.value<=3?2:3),l=ia(()=>{let o=["","password.weak","password.medium","password.strong"][n.value];return C(o)});function r(o){t("update:modelValue",o.target.value),t("input",o)}return{visible:a,score:i,level:n,label:l,onInput:r,t:C}},template:`
|
|
1663
1663
|
<div class="djm-password">
|
|
1664
1664
|
<div class="djm-password-field">
|
|
1665
1665
|
<input
|
|
@@ -1695,7 +1695,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1695
1695
|
<span class="djm-password-label">{{ modelValue ? label : t('password.hint') }}</span>
|
|
1696
1696
|
</div>
|
|
1697
1697
|
</div>
|
|
1698
|
-
`};import{computed as
|
|
1698
|
+
`};import{computed as Ti,nextTick as ko,onBeforeUnmount as So,onMounted as Do,ref as lt,watch as Eo}from"vue";var xo=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(",");function Ye(e){if(!e)return()=>{};let t=document.activeElement,a=()=>[...e.querySelectorAll(xo)].filter(l=>l.getClientRects().length>0),i=a()[0];i&&i.focus();function n(l){if(l.key!=="Tab")return;let r=a();if(!r.length)return;let o=r[0],s=r[r.length-1];l.shiftKey&&(document.activeElement===o||!e.contains(document.activeElement))?(l.preventDefault(),s.focus()):!l.shiftKey&&document.activeElement===s&&(l.preventDefault(),o.focus())}return e.addEventListener("keydown",n),()=>{e.removeEventListener("keydown",n),t&&typeof t.focus=="function"&&t.focus()}}var Mo=0,Ii={name:"DjmCommandPalette",props:{modelValue:{type:Boolean,default:!1},commands:{type:Array,default:()=>[]},placeholder:{type:String,default:"\u641C\u7D22\u547D\u4EE4"},shortcut:{type:Boolean,default:!0}},emits:["update:modelValue","run"],setup(e,{emit:t}){let a=lt(!1),i=lt(""),n=lt(-1),l=lt(null),r=lt(null),o="djm-command-list-"+ ++Mo,s=null,d=Ti(()=>{let m=i.value.trim().toLowerCase();return m?e.commands.filter(f=>[f.label,f.group,f.hint].filter(Boolean).join(" ").toLowerCase().indexOf(m)>-1):e.commands}),p=Ti(()=>n.value>-1?o+"-"+n.value:void 0);function c(){a.value||(a.value=!0,i.value="",n.value=-1,t("update:modelValue",!0),Le(),document.addEventListener("keydown",u),ko(()=>{s=Ye(r.value),l.value&&l.value.focus()}))}function h(){a.value&&(a.value=!1,t("update:modelValue",!1),be(),document.removeEventListener("keydown",u),s&&(s(),s=null))}function v(){a.value?h():c()}function u(m){m.key==="Escape"&&h()}function g(m){e.shortcut&&(m.metaKey||m.ctrlKey)&&String(m.key).toLowerCase()==="k"&&(m.preventDefault(),v())}function y(m){let f=d.value.length;f&&(n.value=(n.value+m+f)%f)}function j(m){i.value=m.target.value,n.value=d.value.length?0:-1}function w(m){if(m.key==="ArrowDown"){m.preventDefault(),y(1);return}if(m.key==="ArrowUp"){m.preventDefault(),y(-1);return}if(m.key==="Enter"){let f=d.value[n.value]||d.value[0];f&&(m.preventDefault(),b(f))}}function b(m){t("run",m),typeof m.run=="function"&&m.run(m),h()}return Eo(()=>e.modelValue,m=>{m?c():h()}),Do(()=>window.addEventListener("keydown",g)),So(()=>{window.removeEventListener("keydown",g),h()}),{open:a,keyword:i,activeIndex:n,searchInput:l,panelEl:r,listId:o,filtered:d,activeId:p,hide:h,move:y,onInput:j,onKeydown:w,run:b}},template:`
|
|
1699
1699
|
<Teleport to="body">
|
|
1700
1700
|
<div v-if="open" class="djm-command-mask" @mousedown.self="hide">
|
|
1701
1701
|
<div class="djm-command-panel" ref="panelEl" role="dialog" aria-modal="true" aria-label="\u547D\u4EE4\u9762\u677F">
|
|
@@ -1737,15 +1737,15 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1737
1737
|
</div>
|
|
1738
1738
|
</div>
|
|
1739
1739
|
</Teleport>
|
|
1740
|
-
`};import{onMounted as
|
|
1740
|
+
`};import{onMounted as Go,ref as Ri,watch as Xo}from"vue";var Vi={name:"DjmQRCode",props:{value:{type:String,default:""},size:{type:Number,default:120},level:{type:String,default:"M"},margin:{type:Number,default:2},dark:{type:String,default:"#000000"},light:{type:String,default:"#ffffff"},alt:{type:String,default:"\u4E8C\u7EF4\u7801"}},setup(e){let t=Ri(""),a=Ri(""),i=null,n=0;async function l(){if(!i){let o=await Promise.resolve().then(()=>(Ni(),Bi));i=o.default||o}return i}async function r(){let o=e.value,s=++n;if(!o){t.value="",a.value="";return}try{let p=await(await l()).toString(o,{type:"svg",margin:e.margin,width:e.size,errorCorrectionLevel:e.level,color:{dark:e.dark,light:e.light}});if(s!==n)return;t.value="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(p),a.value=""}catch{if(s!==n)return;t.value="",a.value="\u4E8C\u7EF4\u7801\u751F\u6210\u5931\u8D25"}}return Go(r),Xo(()=>[e.value,e.size,e.level,e.margin,e.dark,e.light],r),{src:t,error:a}},template:`
|
|
1741
1741
|
<div class="djm-qrcode" :style="{ width: size + 'px', height: size + 'px' }">
|
|
1742
1742
|
<img v-if="src" class="djm-qrcode-img" :src="src" :alt="alt" :width="size" :height="size" />
|
|
1743
1743
|
<span v-else-if="error" class="djm-qrcode-tip">{{ error }}</span>
|
|
1744
1744
|
<span v-else class="djm-qrcode-tip">\u6682\u65E0\u5185\u5BB9</span>
|
|
1745
1745
|
</div>
|
|
1746
|
-
`};var
|
|
1746
|
+
`};var Qo={success:"ok",warning:"warn",error:"danger",info:"brand",default:"off"},Hi={name:"DjmStatus",props:{tone:{type:String,default:""},type:{type:String,default:""},label:{type:String,default:""}},computed:{classes(){let e=(this.tone||this.type||"off").replace(/^djm-/,"");return["djm-status","djm-"+(Qo[e]||e)]}},template:`
|
|
1747
1747
|
<span :class="classes"><i></i><slot>{{ label }}</slot></span>
|
|
1748
|
-
`};import{ref as
|
|
1748
|
+
`};import{ref as ot,nextTick as Zo,onBeforeUnmount as er}from"vue";var tr=0,Oi={name:"DjmTooltip",props:{content:{type:String,default:""},placement:{type:String,default:"top"},disabled:{type:Boolean,default:!1},delay:{type:Number,default:80}},setup(e){let t=ot(!1),a=ot(null),i=ot(null),n=ot(e.placement),l=ot({}),r="djm-tooltip-"+ ++tr,o=null;function s(){let u=a.value;return u&&(u.firstElementChild||u)}function d(u){let g=s();g&&(u?g.setAttribute("aria-describedby",r):g.removeAttribute("aria-describedby"))}function p(){let u=s(),g=i.value;if(!u||!g)return;let y=u.getBoundingClientRect(),j=g.offsetWidth,w=g.offsetHeight,b=8,m=e.placement;m==="top"&&y.top-w-b<8?m="bottom":m==="bottom"&&y.bottom+w+b>window.innerHeight-8?m="top":m==="left"&&y.left-j-b<8?m="right":m==="right"&&y.right+j+b>window.innerWidth-8&&(m="left"),n.value=m;let f,E;m==="top"?(f=y.top-w-b,E=y.left+y.width/2-j/2):m==="bottom"?(f=y.bottom+b,E=y.left+y.width/2-j/2):m==="left"?(f=y.top+y.height/2-w/2,E=y.left-j-b):(f=y.top+y.height/2-w/2,E=y.right+b),l.value={position:"fixed",top:Math.max(8,Math.min(f,window.innerHeight-w-8))+"px",left:Math.max(8,Math.min(E,window.innerWidth-j-8))+"px"}}function c(u){let g=u?"addEventListener":"removeEventListener";window[g]("scroll",p,!0),window[g]("resize",p)}function h(){e.disabled||!e.content||(window.clearTimeout(o),o=window.setTimeout(async()=>{t.value=!0,await Zo(),p(),d(!0),c(!0)},e.delay))}function v(){window.clearTimeout(o),t.value=!1,l.value={},d(!1),c(!1)}return er(()=>{window.clearTimeout(o),c(!1)}),{visible:t,rootRef:a,contentRef:i,actualPlacement:n,panelStyle:l,tipId:r,show:h,hide:v}},template:`
|
|
1749
1749
|
<span ref="rootRef" class="djm-tooltip" @mouseenter="show" @mouseleave="hide" @focusin="show" @focusout="hide" @keydown.esc="hide">
|
|
1750
1750
|
<slot></slot>
|
|
1751
1751
|
<Transition name="djm-fade">
|
|
@@ -1760,7 +1760,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1760
1760
|
>{{ content }}</span>
|
|
1761
1761
|
</Transition>
|
|
1762
1762
|
</span>
|
|
1763
|
-
`};import{nextTick as
|
|
1763
|
+
`};import{nextTick as la,onBeforeUnmount as ar,onMounted as ir,ref as It,watch as nr}from"vue";var $i={name:"DjmDropdown",components:{DjmIcon:P},props:{items:{type:Array,default:()=>[]},placement:{type:String,default:"bottom-start"},width:{type:[Number,String],default:""},maxHeight:{type:[Number,String],default:""},disabled:{type:Boolean,default:!1},trigger:{type:String,default:"click"},closeOnSelect:{type:Boolean,default:!0}},emits:["select","visible-change"],setup(e,{emit:t}){let a=It(!1),i=It(null),n=It(null),l=It({}),r=null;function o(){let m=i.value&&i.value.querySelector(".djm-dropdown-trigger");if(!m)return;let f=m.querySelector('button, a[href], input, [role="button"]'),E=f||m;f||E.setAttribute("role","button"),E.setAttribute("aria-haspopup","menu"),E.setAttribute("aria-expanded",String(a.value)),e.disabled?E.setAttribute("aria-disabled","true"):E.removeAttribute("aria-disabled")}ir(()=>la(o)),nr(a,()=>la(o));function s(){if(!a.value||!i.value)return;let m=i.value.getBoundingClientRect(),f={position:"fixed"};e.width&&(f.minWidth=typeof e.width=="number"?e.width+"px":e.width),e.maxHeight&&(f.maxHeight=typeof e.maxHeight=="number"?e.maxHeight+"px":e.maxHeight,f.overflowY="auto");let E=window.innerHeight-m.bottom;e.placement.indexOf("top")===0||E<160&&m.top>E?f.bottom=window.innerHeight-m.top+6+"px":f.top=m.bottom+6+"px",e.placement.indexOf("end")>-1?f.right=window.innerWidth-m.right+"px":f.left=m.left+"px",l.value=f}function d(){e.disabled||a.value||(a.value=!0,t("visible-change",!0),r=ae({root:()=>i.value,panel:()=>n.value,onClose:p,onReposition:s}),requestAnimationFrame(s))}function p(){a.value&&(a.value=!1,l.value={},t("visible-change",!1),r&&(r(),r=null),h())}function c(){la(()=>{let m=n.value&&n.value.querySelector(".djm-dropdown-item:not(:disabled)");m&&m.focus()})}function h(){let m=i.value&&i.value.querySelector(".djm-dropdown-trigger");if(!m||!n.value||!n.value.contains(document.activeElement))return;(m.querySelector('button, a[href], input, [role="button"]')||m).focus()}function v(m){if(m.key==="Escape"){m.stopPropagation(),p();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(m.key))return;m.preventDefault();let f=[...n.value?n.value.querySelectorAll(".djm-dropdown-item:not(:disabled)"):[]];if(!f.length)return;let E=f.indexOf(document.activeElement),D=0;m.key==="End"?D=f.length-1:m.key==="ArrowDown"?D=E<0?0:(E+1)%f.length:m.key==="ArrowUp"&&(D=E<0?f.length-1:(E-1+f.length)%f.length),f[D].focus()}function u(m){if(!e.disabled){if(a.value){p();return}d(),m&&m.detail===0&&c()}}function g(){e.disabled||a.value||(d(),c())}let y=null;function j(){e.trigger==="hover"&&(window.clearTimeout(y),d())}function w(){e.trigger==="hover"&&(window.clearTimeout(y),y=window.setTimeout(p,120))}function b(m){m.disabled||m.divider||(t("select",m),e.closeOnSelect&&p())}return ar(()=>{window.clearTimeout(y),p()}),{open:a,root:i,menuEl:n,panelStyle:l,toggle:u,close:p,pick:b,openMenu:d,onHoverIn:j,onHoverOut:w,onMenuKeydown:v,onTriggerDown:g,t:C}},template:`
|
|
1764
1764
|
<div
|
|
1765
1765
|
class="djm-dropdown"
|
|
1766
1766
|
:class="{ 'djm-is-disabled': disabled }"
|
|
@@ -1815,7 +1815,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1815
1815
|
</Transition>
|
|
1816
1816
|
</Teleport>
|
|
1817
1817
|
</div>
|
|
1818
|
-
`};import{ref as
|
|
1818
|
+
`};import{ref as lr,nextTick as or,watch as rr,onMounted as sr,onBeforeUnmount as dr}from"vue";var cr=0,Fi={name:"DjmDrawer",components:{DjmIcon:P},props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"right"},width:{type:[Number,String],default:420},maskClosable:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0}},emits:["update:modelValue","open","close"],setup(e,{emit:t}){let a=lr(null),i=`djm-drawer-title-${++cr}`,n=!1,l=null;function r(){t("update:modelValue",!1)}function o(c){e.closeOnEsc&&c.key==="Escape"&&r()}function s(){l&&(l(),l=null)}async function d(){document.addEventListener("keydown",o),Le(),n=!0,t("open"),await or(),l=Ye(a.value)}function p(){document.removeEventListener("keydown",o),s(),n&&(be(),n=!1),t("close")}return rr(()=>e.modelValue,c=>{c?d():p()}),sr(()=>{e.modelValue&&d()}),dr(()=>{document.removeEventListener("keydown",o),s(),n&&be()}),{close:r,panelRef:a,titleId:i,t:C}},computed:{panelStyle(){return{width:typeof this.width=="number"?this.width+"px":this.width}}},template:`
|
|
1819
1819
|
<Teleport to="body">
|
|
1820
1820
|
<Transition name="djm-drawer">
|
|
1821
1821
|
<div v-if="modelValue" class="djm-drawer-mask" @mousedown.self="maskClosable && close()">
|
|
@@ -1853,7 +1853,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1853
1853
|
</div>
|
|
1854
1854
|
</Transition>
|
|
1855
1855
|
</Teleport>
|
|
1856
|
-
`};import{ref as
|
|
1856
|
+
`};import{ref as ur,nextTick as mr,watch as fr,computed as pr,onMounted as hr,onBeforeUnmount as vr}from"vue";var gr=0,Je={name:"DjmModal",components:{Icon:P},props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"640px"},maskClosable:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(e,{emit:t}){let a=ur(null),i=`djm-modal-title-${++gr}`,n=!1,l=null;function r(){t("update:modelValue",!1)}function o(c){e.closeOnEsc&&c.key==="Escape"&&r()}function s(){l&&(l(),l=null)}async function d(){document.addEventListener("keydown",o),Le(),n=!0,t("open"),await mr(),l=Ye(a.value)}function p(){document.removeEventListener("keydown",o),s(),n&&(be(),n=!1),t("close")}return fr(()=>e.modelValue,c=>{c?d():p()}),hr(()=>{e.modelValue&&d()}),vr(()=>{document.removeEventListener("keydown",o),s(),n&&be()}),{close:r,dialogRef:a,titleId:i,t:C,dialogStyle:pr(()=>e.fullscreen?{width:"calc(100vw - 32px)",height:"calc(100vh - 48px)"}:{width:e.width})}},template:`
|
|
1857
1857
|
<Teleport to="body">
|
|
1858
1858
|
<Transition name="djm-modal">
|
|
1859
1859
|
<div v-if="modelValue" class="djm-modal-mask" @mousedown.self="maskClosable && close()">
|
|
@@ -1891,7 +1891,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1891
1891
|
</div>
|
|
1892
1892
|
</Transition>
|
|
1893
1893
|
</Teleport>
|
|
1894
|
-
`};var
|
|
1894
|
+
`};var Ki={name:"DjmConfirmDialog",components:{AppModal:Je},props:{modelValue:{type:Boolean,default:!1},title:{type:String,default:""},message:{type:String,default:""},confirmText:{type:String,default:""},cancelText:{type:String,default:""},danger:{type:Boolean,default:!1}},emits:["update:modelValue","confirm"],computed:{titleText(){return this.title||C("confirm.title")},confirmLabel(){return this.confirmText||C("confirm.confirm")},cancelLabel(){return this.cancelText||C("confirm.cancel")}},setup(e,{emit:t}){function a(){t("update:modelValue",!1)}function i(){t("confirm"),a()}return{close:a,confirm:i}},template:`
|
|
1895
1895
|
<AppModal
|
|
1896
1896
|
:model-value="modelValue"
|
|
1897
1897
|
:title="titleText"
|
|
@@ -1917,7 +1917,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1917
1917
|
>{{ confirmLabel }}</button>
|
|
1918
1918
|
</template>
|
|
1919
1919
|
</AppModal>
|
|
1920
|
-
`};import{computed as
|
|
1920
|
+
`};import{computed as oa,ref as br}from"vue";var Lt={name:"DjmPagination",components:{Icon:P},props:{total:{type:Number,default:0},page:{type:Number,default:1},pageSize:{type:Number,default:10},pageSizes:{type:Array,default:()=>[10,20,50]}},emits:["update:page","update:pageSize","change"],setup(e,{emit:t}){let a=br(""),i=oa(()=>Math.max(1,Math.ceil(e.total/Math.max(1,e.pageSize)))),n=oa(()=>Math.min(Math.max(1,e.page),i.value)),l=oa(()=>{let d=i.value,p=n.value;if(d<=7)return Array.from({length:d},(u,g)=>g+1);let c=Math.max(2,p-1),h=Math.min(d-1,p+1);p<=3&&(c=2,h=4),p>=d-2&&(c=d-3,h=d-1);let v=[1];c>2&&v.push("...");for(let u=c;u<=h;u++)v.push(u);return h<d-1&&v.push("..."),v.push(d),v});function r(d){let p=Math.min(Math.max(1,d),i.value);p!==e.page&&(t("update:page",p),t("change",{page:p,pageSize:e.pageSize})),a.value=""}function o(d){let p=Number(d.target.value);t("update:pageSize",p),t("update:page",1),t("change",{page:1,pageSize:p})}function s(){let d=Number(a.value);if(!Number.isFinite(d)||d<1){a.value="";return}r(Math.floor(d))}return{jumpText:a,pageCount:i,current:n,pages:l,go:r,changeSize:o,doJump:s,t:C}},template:`
|
|
1921
1921
|
<div class="djm-pagination">
|
|
1922
1922
|
<div class="djm-pagination-info">
|
|
1923
1923
|
{{ t('pagination.total', { total }) }}
|
|
@@ -1963,7 +1963,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
1963
1963
|
</div>
|
|
1964
1964
|
</div>
|
|
1965
1965
|
</div>
|
|
1966
|
-
`};import{computed as
|
|
1966
|
+
`};import{computed as yr}from"vue";var wr=0,Wi={name:"DjmTabs",components:{Icon:P},props:{modelValue:{type:[String,Number],required:!0},items:{type:Array,default:()=>[]},variant:{type:String,default:"line"},flush:{type:Boolean,default:!1},persist:{type:Boolean,default:!1}},emits:["update:modelValue","close"],setup(e,{emit:t}){let a=`djm-tabs-panel-${++wr}`,i=yr(()=>e.items.find(c=>c.key===e.modelValue)||{label:String(e.modelValue)});function n(c){return`${a}-${c.key}`}function l(c){c.disabled||c.key===e.modelValue||t("update:modelValue",c.key)}function r(c){t("close",c)}function o(c){return e.persist?`${a}-${c.key}`:a}function s(c){let h=String(c.badge===null||c.badge===void 0?"":c.badge).trim();return h===""?!1:Number.isFinite(Number(h))?Number(h)!==0:!0}function d(c){!c.closable||c.disabled||r(c.key)}function p(c){let h=c.key==="ArrowLeft"?-1:c.key==="ArrowRight"?1:0,v=c.key==="Home",u=c.key==="End";if(!h&&!v&&!u)return;let g=c.currentTarget.closest(".djm-tabs-head");if(!g)return;let j=[...g.querySelectorAll('[role="tab"]')].filter(m=>m.getAttribute("aria-disabled")!=="true");if(!j.length)return;c.preventDefault();let w=j.indexOf(c.currentTarget);v?w=0:u?w=j.length-1:w=(w+h+j.length)%j.length;let b=j[w];b.focus(),b.click()}return{panelId:a,activeItem:i,tabId:n,panelOf:o,activate:l,close:r,onDelete:d,onKeydown:p,hasBadge:s}},template:`
|
|
1967
1967
|
<div class="djm-tabs" :class="[variant === 'line' ? '' : 'djm-tabs-' + variant, { 'djm-is-flush': flush }]">
|
|
1968
1968
|
<div class="djm-tabs-head" role="tablist">
|
|
1969
1969
|
<div
|
|
@@ -2017,7 +2017,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2017
2017
|
</slot>
|
|
2018
2018
|
</div>
|
|
2019
2019
|
</div>
|
|
2020
|
-
`};import{ref as
|
|
2020
|
+
`};import{ref as Ui,watch as qi,nextTick as jr,onBeforeUnmount as xr}from"vue";var _i={name:"DjmContextMenu",components:{Icon:P},props:{modelValue:{type:Boolean,default:!1},x:{type:Number,default:0},y:{type:Number,default:0},items:{type:Array,default:()=>[]}},emits:["update:modelValue","select"],setup(e,{emit:t}){let a=Ui(null),i=Ui({left:0,top:0}),n=8;function l(){t("update:modelValue",!1)}function r(){let v=a.value?a.value.offsetWidth:180,u=a.value?a.value.offsetHeight:220,g=e.x,y=e.y;g+v+n>window.innerWidth&&(g=Math.max(n,window.innerWidth-v-n)),y+u+n>window.innerHeight&&(y=Math.max(n,y-u)),i.value={left:g,top:y}}async function o(){i.value={left:e.x,top:e.y},await jr(),r();let v=a.value&&a.value.querySelector(".djm-context-menu-item:not(:disabled)");v&&v.focus()}function s(v){v.disabled||v.divider||(t("select",v),l())}function d(v){if(v.key==="Escape"){v.stopPropagation(),l();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(v.key))return;v.preventDefault();let u=[...a.value?a.value.querySelectorAll(".djm-context-menu-item:not(:disabled)"):[]];if(!u.length)return;let g=u.indexOf(document.activeElement),y=0;v.key==="End"?y=u.length-1:v.key==="ArrowDown"?y=g<0?0:(g+1)%u.length:v.key==="ArrowUp"&&(y=g<0?u.length-1:(g-1+u.length)%u.length),u[y].focus()}let p=null;function c(){p=ae({root:()=>null,panel:()=>a.value,onClose:l,onReposition:l})}function h(){p&&(p(),p=null)}return qi(()=>e.modelValue,v=>{v?(o(),c()):h()}),qi([()=>e.x,()=>e.y],()=>{e.modelValue&&o()}),xr(h),{menuRef:a,pos:i,close:l,onSelect:s,onKeydown:d,t:C}},template:`
|
|
2021
2021
|
<Teleport to="body">
|
|
2022
2022
|
<Transition name="djm-context-menu">
|
|
2023
2023
|
<div
|
|
@@ -2049,7 +2049,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2049
2049
|
</div>
|
|
2050
2050
|
</Transition>
|
|
2051
2051
|
</Teleport>
|
|
2052
|
-
`};import{ref as
|
|
2052
|
+
`};import{ref as ye,computed as ze,onBeforeUnmount as Yi,watch as kr}from"vue";var Sr=0;function Ji(e){return String(e).padStart(2,"0")}function Gi(e,t,a){return`${e}-${Ji(t+1)}-${Ji(a)}`}function Xi(e){if(!e)return null;let t=String(e).split("-").map(Number);return t.length!==3||t.some(a=>!Number.isFinite(a))?null:{year:t[0],month:t[1]-1,day:t[2]}}var Se={name:"DjmDatePicker",components:{Icon:P},props:{modelValue:{type:[String,Array],default:""},placeholder:{type:String,default:""},min:{type:String,default:""},max:{type:String,default:""},clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},presets:{type:Array,default:()=>[]},disabledDate:{type:Function,default:null},panels:{type:Number,default:2}},emits:["update:modelValue","change","visible-change"],setup(e,{emit:t}){let a=ye(!1);kr(a,x=>t("visible-change",x));let i=ye(null),n=ye(null),l="djm-date-panel-"+ ++Sr,r=ye({...le}),o=null,s=new Date,d=Gi(s.getFullYear(),s.getMonth(),s.getDate()),p=ze(()=>e.range?Array.isArray(e.modelValue)?e.modelValue:[]:e.modelValue?[e.modelValue]:[]),c=ze(()=>{if(!e.range)return p.value[0]||"";let[x,I]=p.value;return x?I?`${x} ~ ${I}`:`${x} ~ ${C("datePicker.rangeEnd")}`:""}),h=Xi(p.value[0]),v=ye(h?h.year:s.getFullYear()),u=ye(h?h.month:s.getMonth()),g=ye(p.value[0]||""),y=ye(p.value[1]||""),j=ze(()=>e.placeholder?e.placeholder:C(e.range?"datePicker.rangePlaceholder":"datePicker.placeholder")),w=ze(()=>C("datePicker.weeks").split(",")),b=ye(!1),m=null,f=x=>{b.value=x.matches};typeof window<"u"&&window.matchMedia&&(m=window.matchMedia("(max-width: 760px)"),b.value=m.matches,m.addEventListener?m.addEventListener("change",f):m.addListener(f)),Yi(()=>{m&&(m.removeEventListener?m.removeEventListener("change",f):m.removeListener(f))});let E=ze(()=>e.range?Math.min(b.value?1:2,Math.max(1,e.panels)):1),D=ye(""),k=ze(()=>{if(!e.range||!g.value||y.value||!D.value)return null;let x=g.value,I=D.value;return x<=I?[x,I]:[I,x]});function B(x){let I=new Date(v.value,u.value+x,1);return{year:I.getFullYear(),month:I.getMonth()}}function S(x,I){let W=(new Date(x,I,1).getDay()+6)%7,G=new Date(x,I,1-W),de=e.range?g.value:p.value[0],V=e.range?y.value:"",q=k.value,M=q?q[0]:V?de:"",R=q?q[1]:V;return Array.from({length:42},(F,J)=>{let Q=new Date(G.getFullYear(),G.getMonth(),G.getDate()+J),Z=Gi(Q.getFullYear(),Q.getMonth(),Q.getDate());return{key:Z,day:Q.getDate(),outside:Q.getMonth()!==I,today:Z===d,selected:Z===de||Z===V||R!==""&&(Z===M||Z===R),inRange:!!(M&&R&&Z>M&&Z<R),edgeStart:!!(M&&R&&Z===M),edgeEnd:!!(R&&Z===R),disabled:L(Z)}})}let T=ze(()=>Array.from({length:E.value},(x,I)=>{let{year:N,month:W}=B(I);return{key:N*100+W,label:C("datePicker.title",{year:N,month:W+1}),cells:S(N,W)}}));function L(x){return e.min&&x<e.min||e.max&&x>e.max?!0:typeof e.disabledDate=="function"?!!e.disabledDate(x):!1}let A=ze(()=>e.range?(e.presets||[]).map(x=>{let I=typeof x.value=="function"?x.value():x.value,N=Array.isArray(I)&&I.length===2&&I.every(W=>!L(W));return{...x,value:I,invalid:!N}}):[]);function O(x){t("update:modelValue",x),t("change",x)}function $(){let x=Xi(p.value[0]);x&&(v.value=x.year,u.value=x.month)}function X(){e.disabled||($(),g.value=p.value[0]||"",y.value=p.value[1]||"",D.value="",a.value=!0,o=ae({root:()=>i.value,panel:()=>n.value,onClose:H,onReposition:ee}),requestAnimationFrame(ee))}function ee(){if(!a.value||!i.value)return;let x=i.value.getBoundingClientRect(),I=n.value?n.value.offsetHeight:320,N=n.value?n.value.offsetWidth:300,W=Math.max(8,Math.min(x.left,window.innerWidth-N-8)),de=window.innerHeight-x.bottom-8>=I?x.bottom+4:x.top-I-4;de=Math.max(8,Math.min(de,window.innerHeight-I-8)),r.value={position:"fixed",visibility:"visible",left:W+"px",top:de+"px",bottom:"auto"}}function H(){a.value=!1,D.value="",r.value={...le},o&&(o(),o=null)}function U(){a.value?H():X()}function Y(){u.value===0?(u.value=11,v.value-=1):u.value-=1}function ne(){u.value===11?(u.value=0,v.value+=1):u.value+=1}function te(){v.value-=1}function re(){v.value+=1}function z(x){if(x.disabled)return;if(!e.range){O(x.key),H();return}if(!g.value||y.value){g.value=x.key,y.value="",D.value="";return}let I=g.value,N=x.key;if(N<I){let W=I;I=N,N=W}g.value=I,y.value=N,O([I,N]),H()}function K(){L(d)||(e.range?O([d,d]):O(d),H())}function _(x){if(x.invalid)return;let I=x.value;g.value=I[0],y.value=I[1],O([I[0],I[1]]),H()}function se(){O(e.range?[]:""),g.value="",y.value="",H()}return Yi(()=>{o&&(o(),o=null)}),{open:a,root:i,panel:n,panelId:l,panelStyle:r,viewYear:v,viewMonth:u,placeholderText:j,weeks:w,t:C,panels:T,panelCount:E,hoverKey:D,presetList:A,displayText:c,values:p,toggle:U,closePanel:H,prevMonth:Y,nextMonth:ne,prevYear:te,nextYear:re,pick:z,pickToday:K,pickPreset:_,clear:se}},template:`
|
|
2053
2053
|
<div class="djm-date-picker" ref="root" :class="{ 'djm-is-disabled': disabled }">
|
|
2054
2054
|
<button
|
|
2055
2055
|
class="djm-input djm-date-trigger"
|
|
@@ -2139,7 +2139,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2139
2139
|
</Transition>
|
|
2140
2140
|
</Teleport>
|
|
2141
2141
|
</div>
|
|
2142
|
-
`};import{ref as
|
|
2142
|
+
`};import{ref as Pe,computed as At,nextTick as Dr,onBeforeUnmount as Er,watch as Mr}from"vue";function Qi(e,t,a=[]){return e.children&&e.children.length?e.children.forEach(i=>Qi(i,t,a)):a.push(t(e)),a}function zt(e,t=[]){return e.forEach(a=>{t.push(a),a.children&&a.children.length&&zt(a.children,t)}),t}var Ge={name:"DjmTreeSelect",components:{Icon:P},props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},nodeKey:{type:String,default:"id"},labelKey:{type:String,default:"label"},placeholder:{type:String,default:""},searchPlaceholder:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},maxTagCount:{type:Number,default:2},showFooter:{type:Boolean,default:!0}},emits:["update:modelValue","change","visible-change"],setup(e,{emit:t}){let a=Pe(!1),i=Pe(null),n=Pe(null),l=Pe(null),r=Pe(""),o=Pe([]),s=Pe({...le}),d=null;function p(H){return H?H[e.nodeKey]:void 0}function c(H){let U=H?H[e.labelKey]:"";return U==null?"":String(U)}let h=Pe(new Set(zt(e.options).filter(H=>H.children&&H.children.length).map(H=>p(H)))),v=At(()=>{let H=new Map;return zt(e.options).forEach(U=>H.set(p(U),U)),H});Mr(()=>e.options,H=>{!H||!H.length||h.value.size||(h.value=new Set(zt(H).filter(U=>U.children&&U.children.length).map(U=>p(U))))});let u=At(()=>e.modelValue.map(H=>v.value.get(H)).filter(Boolean).map(H=>({key:p(H),label:c(H)}))),g=At(()=>{let H=r.value.trim().toLowerCase();if(!H)return null;let U=new Set,Y=ne=>{let te=!1;return ne.forEach(re=>{let z=re.children&&re.children.length?Y(re.children):!1;(c(re).toLowerCase().includes(H)||z)&&(U.add(p(re)),te=!0)}),te};return Y(e.options),U}),y=At(()=>{let H=[],U=(Y,ne)=>{Y.forEach(te=>{if(g.value&&!g.value.has(p(te)))return;H.push({node:te,depth:ne,key:p(te),label:c(te)});let re=te.children&&te.children.length,z=g.value?!0:h.value.has(p(te));re&&z&&U(te.children,ne+1)})};return U(e.options,0),H});function j(H){return!!(H.children&&H.children.length)}function w(H){return g.value?!0:h.value.has(p(H))}function b(H){let U=f(H);return U.length>0&&U.every(Y=>o.value.includes(Y))}function m(H){let U=f(H),Y=U.filter(ne=>o.value.includes(ne)).length;return Y>0&&Y<U.length}function f(H){return Qi(H,p).filter(U=>{let Y=v.value.get(U);return Y&&!Y.disabled})}function E(H){if(H.disabled)return;let U=f(H);if(!U.length)return;U.every(ne=>o.value.includes(ne))?o.value=o.value.filter(ne=>!U.includes(ne)):o.value=[...new Set([...o.value,...U])],e.showFooter||(t("update:modelValue",[...o.value]),t("change",[...o.value]))}function D(H){if(!j(H))return;let U=p(H),Y=new Set(h.value);Y.has(U)?Y.delete(U):Y.add(U),h.value=Y}function k(H){j(H)?D(H):E(H)}function B(){a.value||e.disabled||(o.value=[...e.modelValue],r.value="",a.value=!0,t("visible-change",!0),d=ae({root:()=>i.value,panel:()=>n.value,onClose:T,onReposition:S}),Dr(()=>{S(),l.value&&l.value.focus()}))}function S(){if(!a.value||!i.value)return;let H=i.value.getBoundingClientRect(),U=n.value?n.value.offsetHeight:320,Y=Math.min(300,window.innerWidth-16);s.value=me({rect:H,flip:ue(H,U),gap:4,width:Y,clampWidth:Y})}function T(){a.value&&(a.value=!1,s.value={...le},t("visible-change",!1),d&&(d(),d=null))}function L(){e.disabled||(a.value?T():B())}function A(){t("update:modelValue",[...o.value]),t("change",[...o.value]),T()}function O(){T()}function $(){o.value=[]}function X(H){let U=e.modelValue.filter(Y=>Y!==H);t("update:modelValue",U),t("change",U),o.value=o.value.filter(Y=>Y!==H)}function ee(){e.disabled||(t("update:modelValue",[]),t("change",[]),o.value=[])}return Er(()=>{d&&(d(),d=null)}),{open:a,root:i,panel:n,panelStyle:s,searchInput:l,search:r,temp:o,rows:y,selectedNodes:u,hasChildren:j,isExpanded:w,isChecked:b,isIndeterminate:m,toggleNode:E,onRowClick:k,toggle:L,confirm:A,cancel:O,clearTemp:$,clearAll:ee,removeTag:X,t:C}},template:`
|
|
2143
2143
|
<div class="djm-tree-select" :class="{ 'djm-is-disabled': disabled }" ref="root">
|
|
2144
2144
|
<div
|
|
2145
2145
|
class="djm-tree-select-trigger djm-input"
|
|
@@ -2243,17 +2243,142 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2243
2243
|
</div>
|
|
2244
2244
|
</Transition>
|
|
2245
2245
|
</div>
|
|
2246
|
-
`};import{ref as
|
|
2247
|
-
<
|
|
2248
|
-
<
|
|
2249
|
-
<
|
|
2246
|
+
`};import{ref as ve,computed as sa,watch as Br,onMounted as Nr,onBeforeUnmount as Rr}from"vue";import{computed as ra,ref as Pt,watch as Zi}from"vue";var Bt={name:"DjmMediaPicker",components:{DjmModal:Je,DjmPagination:Lt,DjmIcon:P},props:{modelValue:{type:[Array,String,Number],default:""},items:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},limit:{type:Number,default:0},accept:{type:String,default:""},title:{type:String,default:""},triggerText:{type:String,default:""},pageSize:{type:Number,default:12},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){let a=Pt(!1),i=Pt(""),n=Pt(1),l=Pt([]),r=ra(()=>e.multiple?Array.isArray(e.modelValue)?e.modelValue:[]:e.modelValue===""||e.modelValue===null||e.modelValue===void 0?[]:[e.modelValue]);function o(y){return y.type?y.type==="image":/\.(png|jpe?g|gif|webp|svg|avif)$/i.test(y.url||"")}let s=ra(()=>{let y=i.value.trim().toLowerCase();return e.items.filter(j=>!(e.accept==="image"&&!o(j)||e.accept==="file"&&o(j)||y&&!String(j.name||"").toLowerCase().includes(y)))}),d=ra(()=>{let y=(n.value-1)*e.pageSize;return s.value.slice(y,y+e.pageSize)});Zi(i,()=>{n.value=1}),Zi(()=>s.value.length,()=>{let y=Math.max(1,Math.ceil(s.value.length/e.pageSize));n.value>y&&(n.value=y)});function p(y){return l.value.includes(y)}function c(){return e.limit>0&&l.value.length>=e.limit}function h(y){if(e.multiple){if(p(y.id)){l.value=l.value.filter(j=>j!==y.id);return}if(c())return;l.value=[...l.value,y.id];return}l.value=[y.id]}function v(){e.disabled||(l.value=[...r.value],i.value="",n.value=1,a.value=!0)}function u(){let y=e.multiple?[...l.value]:l.value[0]!==void 0?l.value[0]:"";t("update:modelValue",y),t("change",y),a.value=!1}function g(){l.value=[...r.value],a.value=!1}return{open:a,keyword:i,page:n,temp:l,selectedIds:r,filtered:s,paged:d,isImage:o,isChecked:p,atLimit:c,toggle:h,openPanel:v,commit:u,cancel:g,t:C}},template:`
|
|
2247
|
+
<span class="djm-media-picker">
|
|
2248
|
+
<slot name="trigger" :open="openPanel" :count="selectedIds.length">
|
|
2249
|
+
<button
|
|
2250
|
+
class="djm-btn"
|
|
2251
|
+
type="button"
|
|
2252
|
+
:disabled="disabled"
|
|
2253
|
+
@click="openPanel"
|
|
2254
|
+
>{{ triggerText || t('mediaPicker.select') }}<span v-if="selectedIds.length" class="djm-media-picker-count">{{ selectedIds.length }}</span></button>
|
|
2255
|
+
</slot>
|
|
2256
|
+
|
|
2257
|
+
<DjmModal
|
|
2258
|
+
:model-value="open"
|
|
2259
|
+
:title="title || t('mediaPicker.title')"
|
|
2260
|
+
width="760px"
|
|
2261
|
+
@update:model-value="cancel"
|
|
2262
|
+
>
|
|
2263
|
+
<div class="djm-media-toolbar">
|
|
2264
|
+
<label class="djm-media-search">
|
|
2265
|
+
<DjmIcon name="search" :size="13" />
|
|
2266
|
+
<input
|
|
2267
|
+
v-model="keyword"
|
|
2268
|
+
class="djm-media-search-input"
|
|
2269
|
+
type="text"
|
|
2270
|
+
:placeholder="t('mediaPicker.search')"
|
|
2271
|
+
:aria-label="t('mediaPicker.search')"
|
|
2272
|
+
/>
|
|
2273
|
+
</label>
|
|
2274
|
+
<span class="djm-media-toolbar-slot">
|
|
2275
|
+
<slot name="toolbar"></slot>
|
|
2276
|
+
</span>
|
|
2277
|
+
</div>
|
|
2278
|
+
|
|
2279
|
+
<div class="djm-media-grid" role="listbox" :aria-multiselectable="multiple ? 'true' : 'false'">
|
|
2280
|
+
<div
|
|
2281
|
+
v-for="item in paged"
|
|
2282
|
+
:key="item.id"
|
|
2283
|
+
class="djm-media-item"
|
|
2284
|
+
:class="{
|
|
2285
|
+
'djm-is-checked': isChecked(item.id),
|
|
2286
|
+
'djm-is-disabled': multiple && atLimit() && !isChecked(item.id)
|
|
2287
|
+
}"
|
|
2288
|
+
role="option"
|
|
2289
|
+
tabindex="0"
|
|
2290
|
+
:aria-selected="String(isChecked(item.id))"
|
|
2291
|
+
@click="toggle(item)"
|
|
2292
|
+
@keydown.enter.prevent="toggle(item)"
|
|
2293
|
+
@keydown.space.prevent="toggle(item)"
|
|
2294
|
+
>
|
|
2295
|
+
<div class="djm-media-thumb">
|
|
2296
|
+
<img v-if="isImage(item)" :src="item.url" :alt="item.name" loading="lazy" />
|
|
2297
|
+
<DjmIcon v-else name="folder" :size="26" />
|
|
2298
|
+
<span v-if="isChecked(item.id)" class="djm-media-check">
|
|
2299
|
+
<DjmIcon name="check" :size="11" />
|
|
2300
|
+
</span>
|
|
2301
|
+
</div>
|
|
2302
|
+
<div class="djm-media-name" :title="item.name">{{ item.name }}</div>
|
|
2303
|
+
</div>
|
|
2304
|
+
<div v-if="!paged.length" class="djm-media-empty">{{ t('mediaPicker.empty') }}</div>
|
|
2305
|
+
</div>
|
|
2306
|
+
|
|
2307
|
+
<div class="djm-media-foot">
|
|
2308
|
+
<span class="djm-media-total">
|
|
2309
|
+
{{ t('mediaPicker.total', { total: filtered.length }) }}
|
|
2310
|
+
<em v-if="multiple && limit > 0">{{ t('mediaPicker.limit', { limit }) }}</em>
|
|
2311
|
+
</span>
|
|
2312
|
+
<DjmPagination
|
|
2313
|
+
v-if="filtered.length > pageSize"
|
|
2314
|
+
v-model:page="page"
|
|
2315
|
+
:page-size="pageSize"
|
|
2316
|
+
:total="filtered.length"
|
|
2317
|
+
/>
|
|
2318
|
+
</div>
|
|
2319
|
+
|
|
2320
|
+
<template #footer>
|
|
2321
|
+
<button class="djm-btn" type="button" @click="cancel">{{ t('common.cancel') }}</button>
|
|
2322
|
+
<button class="djm-btn djm-btn-primary" type="button" @click="commit">{{ t('common.confirm') }}</button>
|
|
2323
|
+
</template>
|
|
2324
|
+
</DjmModal>
|
|
2325
|
+
</span>
|
|
2326
|
+
`};var Cr=new Set(["p","br","div","span","strong","b","em","i","u","s","del","sub","sup","h1","h2","h3","h4","h5","h6","ul","ol","li","blockquote","pre","code","hr","a","img","table","thead","tbody","tfoot","tr","th","td"]),Tr=new Set(["class","title","style"]),Ir=new Set(["color","background-color","font-size","font-weight","font-style","text-decoration","text-align","text-indent","line-height"]),Lr={a:new Set(["href","target","rel"]),img:new Set(["src","alt","width","height"]),ol:new Set(["start"]),th:new Set(["colspan","rowspan","scope"]),td:new Set(["colspan","rowspan"])};function Ar(e){return String(e||"").split(";").map(t=>{let a=t.indexOf(":");if(a===-1)return"";let i=t.slice(0,a).trim().toLowerCase(),n=t.slice(a+1).trim();return!Ir.has(i)||/url\s*\(|expression\s*\(|javascript:/i.test(n)?"":i+": "+n}).filter(Boolean).join("; ")}var zr=new Set(["http","https","mailto","tel"]);function Pr(e,t){let a=String(e||"").replace(/[\u0000-\u0020]+/g,""),i=a.match(/^([a-z][a-z0-9+.-]*):/i);if(!i)return!0;let n=i[1].toLowerCase();return!!(zr.has(n)||t==="img"&&(n==="blob"||n==="data"&&/^data:image\//i.test(a)))}function en(e){[...e.childNodes].forEach(a=>{if(a.nodeType===8){a.remove();return}if(a.nodeType!==1)return;let i=a.tagName.toLowerCase();if(!Cr.has(i)){a.remove();return}let n=Lr[i];[...a.attributes].forEach(l=>{let r=l.name.toLowerCase();if(!(Tr.has(r)||n&&n.has(r))){a.removeAttribute(l.name);return}if(r==="style"){let s=Ar(l.value);s?a.setAttribute("style",s):a.removeAttribute("style");return}(r==="href"||r==="src")&&!Pr(l.value,i)&&a.removeAttribute(l.name)}),i==="a"&&a.getAttribute("target")==="_blank"&&a.setAttribute("rel","noopener noreferrer"),en(a)})}function Nt(e){if(!e)return"";let a=new DOMParser().parseFromString('<div id="djm-sanitize-root">'+e+"</div>","text/html").getElementById("djm-sanitize-root");return a?(en(a),a.innerHTML):""}var Vr=[{value:"p",label:"paragraph"},{value:"h1",label:"heading1"},{value:"h2",label:"heading2"},{value:"h3",label:"heading3"},{value:"blockquote",label:"quote"},{value:"pre",label:"codeBlock"}],Hr=[{value:"",label:"defaultSize"},{value:"12px",label:"12px"},{value:"14px",label:"14px"},{value:"16px",label:"16px"},{value:"18px",label:"18px"},{value:"24px",label:"24px"}],tn=["#1f2d3d","#5a6b7d","#2b86d9","#2fa36b","#d97706","#dc2626","#7c3aed","#ffffff"],an={simple:["history","inline","list","insert"],basic:["history","format","inline","align","list","insert","view"],full:["history","format","inline","color","align","list","insert","view"]};function nn(e){let t=String(e||"").replace(/[\u0000-\u0020]+/g,"");if(!t)return!1;let a=t.match(/^([a-z][a-z0-9+.-]*):/i);if(!a)return!0;let i=a[1].toLowerCase();return i==="http"||i==="https"||i==="blob"?!0:i==="data"&&/^data:image\//i.test(t)}function Or(e){let t=String(e||"").trim();if(!t)return!1;let a=t.replace(/[\u0000-\u0020]+/g,"").match(/^([a-z][a-z0-9+.-]*):/i);return a?["http","https","mailto","tel"].indexOf(a[1].toLowerCase())>-1:!0}var ln={name:"DjmRichEditor",components:{Icon:P,MediaPicker:Bt},props:{modelValue:{type:String,default:""},placeholder:{type:String,default:""},minHeight:{type:Number,default:200},sanitize:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},toolbar:{type:[String,Array],default:"full"},uploadImage:{type:Function,default:null},media:{type:Array,default:()=>[]},accept:{type:String,default:"image/*"},maxImageSize:{type:Number,default:5},multiple:{type:Boolean,default:!0},showCount:{type:Boolean,default:!0}},emits:["update:modelValue","upload-error"],setup(e,{emit:t}){let a=ve(null),i=ve(null),n=ve(!1),l=ve(e.modelValue),r=ve(!1),o=ve(""),s=ve(0),d=ve(tn[0]),p=ve("#fdf3c4"),c=ve(""),h=ve(0),v=ve({bold:!1,italic:!1,underline:!1,strike:!1,code:!1,block:"p",align:"",list:""}),u=null,g=sa(()=>!e.disabled&&!n.value),y=sa(()=>{let M=Array.isArray(e.toolbar)?e.toolbar:an[e.toolbar]||an.full;return new Set(M)});function j(M){return y.value.has(M)}let w=sa(()=>(e.media||[]).map((M,R)=>typeof M=="string"?{id:"media-"+R,url:M,name:"",type:"image"}:{id:M&&M.id!==void 0?String(M.id):"media-"+R,url:M&&(M.url||M.src)||"",name:M&&(M.name||M.alt)||"",type:"image"}).filter(M=>!!M.url));function b(M){return e.sanitize?Nt(M):M}function m(M){return String(M||"").replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/&[a-z]+;/gi," ")}function f(){if(!a.value)return;let M=b(a.value.innerHTML);h.value=m(M).trim().length,t("update:modelValue",M)}function E(){let M=window.getSelection();if(!M||!M.rangeCount||!a.value)return null;let R=M.getRangeAt(0);return a.value.contains(R.commonAncestorContainer)?R:null}function D(){let M=E();u=M?M.cloneRange():null}function k(M){if(!a.value)return;a.value.focus();let R=window.getSelection();if(R.removeAllRanges(),M){R.addRange(M);return}let F=document.createRange();F.selectNodeContents(a.value),F.collapse(!1),R.addRange(F)}function B(M,R){if(!a.value)return;k(M);let F=window.getSelection();F.rangeCount?F.getRangeAt(0).insertNode(R):a.value.appendChild(R),f(),N()}function S(){let M=E();return M||(u?(k(u),E()):null)}function T(M,R=null){g.value&&typeof document.execCommand=="function"&&(S(),document.execCommand("styleWithCSS",!1,!0),document.execCommand(M,!1,R),a.value&&a.value.focus(),f(),N())}function L(M){o.value="",T("formatBlock","<"+M+">")}function A(M){if(o.value="",!g.value||!a.value)return;c.value=M;let R=S();if(!R||R.collapsed)return;if(!M){let Z=document.createTreeWalker(a.value,NodeFilter.SHOW_ELEMENT),fe=[];for(;Z.nextNode();){let pe=Z.currentNode;pe.style&&pe.style.fontSize&&R.intersectsNode(pe)&&fe.push(pe)}fe.forEach(pe=>{pe.style.fontSize=""}),f();return}let F=document.createElement("span");F.style.fontSize=M,F.appendChild(R.extractContents()),R.insertNode(F);let J=window.getSelection(),Q=document.createRange();Q.setStartAfter(F),Q.collapse(!0),J.removeAllRanges(),J.addRange(Q),f(),N()}function O(M,R){if(o.value="",M==="text"?d.value=R:p.value=R,!g.value||typeof document.execCommand!="function")return;document.execCommand("styleWithCSS",!1,!0);let F=M==="text"?"foreColor":"hiliteColor";!document.execCommand(F,!1,R)&&M==="bg"&&document.execCommand("backColor",!1,R),a.value&&a.value.focus(),f(),N()}function $(M){g.value&&(o.value=o.value===M?"":M)}function X(){if(!g.value||!a.value)return;let M=E();if(!M)return;let R=M.commonAncestorContainer,F=R.nodeType===1?R:R.parentElement,J=F&&F.closest?F.closest("code"):null;if(J&&a.value.contains(J)){let pe=J.parentNode;for(;J.firstChild;)pe.insertBefore(J.firstChild,J);pe.removeChild(J),f();return}if(M.collapsed)return;let Q=document.createElement("code");Q.appendChild(M.extractContents()),M.insertNode(Q);let Z=window.getSelection(),fe=document.createRange();fe.setStartAfter(Q),fe.collapse(!0),Z.removeAllRanges(),Z.addRange(fe),f(),N()}function ee(){if(!g.value)return;let M=window.prompt(C("richEditor.linkPrompt"),"https://");if(!M)return;if(!Or(M)){window.alert(C("richEditor.linkInvalid"));return}let R=E();if(R&&R.collapsed){let F=document.createElement("a");F.href=M,F.target="_blank",F.rel="noopener noreferrer",F.textContent=M,B(R,F);return}T("createLink",M),a.value&&a.value.querySelectorAll("a[href]").forEach(F=>{F.getAttribute("target")||F.setAttribute("target","_blank"),F.setAttribute("rel","noopener noreferrer")}),f()}function H(M){return new Promise((R,F)=>{let J=new FileReader;J.onload=()=>R(J.result),J.onerror=()=>F(J.error||new Error("read failed")),J.readAsDataURL(M)})}async function U(M){if(e.uploadImage){let R=await e.uploadImage(M),F=typeof R=="string"?R:R&&R.url;if(!F)throw new Error(C("richEditor.imageUrlInvalid"));if(!nn(F))throw new Error(C("richEditor.imageUrlInvalid"));return String(F).trim()}return H(M)}function Y(M){return M&&/^image\//.test(M.type)}function ne(M){!g.value||!i.value||(D(),i.value.multiple=!!M&&e.multiple,i.value.click())}function te(M){if(!g.value)return;let F=(Array.isArray(M)?M:[M]).map(Z=>w.value.find(fe=>fe.id===String(Z))).filter(Boolean).filter(Z=>nn(Z.url)?!0:(t("upload-error",{file:null,message:C("richEditor.imageUrlInvalid")}),!1));if(!F.length)return;k(u);let J=document.createDocumentFragment();F.forEach(Z=>{let fe=document.createElement("img");fe.src=Z.url,fe.alt=Z.name||"image",fe.className="djm-rich-editor-img",J.appendChild(fe)});let Q=window.getSelection();Q.rangeCount?Q.getRangeAt(0).insertNode(J):a.value.appendChild(J),f(),N()}function re(M){if(!M.length||!a.value)return;s.value=M.length;let R=document.createElement("span");R.className="djm-rich-editor-uploading",R.textContent=C("richEditor.uploading",{count:M.length});let F=u&&a.value.contains(u.commonAncestorContainer)?u:null;k(F);let J=window.getSelection();J.rangeCount?J.getRangeAt(0).insertNode(R):a.value.appendChild(R),Promise.all(M.map(async Q=>{if(!Y(Q))return{file:Q,error:C("richEditor.imageTypeError")};if(e.maxImageSize>0&&Q.size>e.maxImageSize*1024*1024)return{file:Q,error:C("richEditor.imageSizeError",{size:e.maxImageSize})};try{return{file:Q,url:await U(Q)}}catch(Z){return{file:Q,error:Z&&Z.message||C("richEditor.uploadFailed")}}})).then(Q=>{s.value=0;let Z=Q.filter(xe=>xe.url),fe=Q.filter(xe=>xe.error),pe=a.value&&a.value.contains(R);Z.length&&a.value&&Z.forEach(xe=>{let at=document.createElement("img");at.src=xe.url,at.alt=xe.file.name||"image",at.className="djm-rich-editor-img",pe?R.parentNode.insertBefore(at,R):a.value.appendChild(at)}),pe&&R.remove(),fe.forEach(xe=>t("upload-error",{file:xe.file,message:xe.error})),f()})}function z(M){let R=Array.from(M.target.files||[]);M.target.value="",re(R)}function K(M){let R=M.clipboardData;if(!R)return;let F=Array.from(R.files||[]).filter(Y);if(F.length){M.preventDefault(),re(F);return}let J=R.getData("text/html");J&&(M.preventDefault(),document.execCommand("insertHTML",!1,Nt(J)),f())}function _(M){g.value&&M.dataTransfer&&Array.from(M.dataTransfer.types||[]).includes("Files")&&M.preventDefault()}function se(M){if(!g.value)return;let R=Array.from(M.dataTransfer&&M.dataTransfer.files||[]).filter(Y);R.length&&(M.preventDefault(),D(),re(R))}function x(M,R){let F=M&&(M.nodeType===1?M:M.parentElement);return F&&F.closest?F.closest(R):null}function I(){let M=window.getSelection();if(!M||!M.anchorNode)return"p";let R=M.anchorNode;for(R.nodeType!==1&&(R=R.parentElement);R&&R!==a.value;){let F=R.tagName.toLowerCase();if(["p","h1","h2","h3","blockquote","pre"].includes(F))return F;R=R.parentElement}return"p"}function N(){if(e.disabled||n.value||!a.value||!a.value.contains(document.activeElement))return;let M=window.getSelection();v.value={bold:document.queryCommandState("bold"),italic:document.queryCommandState("italic"),underline:document.queryCommandState("underline"),strike:document.queryCommandState("strikeThrough"),code:!!x(M.anchorNode,"code"),block:I(),align:document.queryCommandState("justifyCenter")?"center":document.queryCommandState("justifyRight")?"right":document.queryCommandState("justifyFull")?"justify":"left",list:document.queryCommandState("insertOrderedList")?"ol":document.queryCommandState("insertUnorderedList")?"ul":""}}function W(){h.value=m(l.value).trim().length,t("update:modelValue",b(l.value))}function G(){e.disabled||(o.value="",n.value?(t("update:modelValue",b(l.value)),n.value=!1,requestAnimationFrame(()=>{a.value&&(a.value.innerHTML=b(l.value)),f()})):(l.value=a.value?a.value.innerHTML:e.modelValue,n.value=!0))}function de(){e.disabled||(r.value=!r.value,o.value="")}function V(M){o.value&&(M.target.closest&&M.target.closest(".djm-rich-editor-color")||(o.value=""))}function q(M){M.key==="Escape"&&r.value&&(r.value=!1,o.value="")}return Br(()=>e.modelValue,M=>{if(n.value){l.value=M;return}let R=b(M);a.value&&a.value.innerHTML!==R&&(a.value.innerHTML=R),h.value=m(R).trim().length}),Nr(()=>{a.value&&(a.value.innerHTML=b(e.modelValue)),h.value=m(e.modelValue).trim().length,document.addEventListener("selectionchange",N),document.addEventListener("click",V),document.addEventListener("keydown",q)}),Rr(()=>{document.removeEventListener("selectionchange",N),document.removeEventListener("click",V),document.removeEventListener("keydown",q)}),{editor:a,fileInput:i,sourceMode:n,source:l,fullscreen:r,panel:o,uploadCount:s,textColor:d,bgColor:p,fontSize:c,count:h,formats:v,blocks:Vr,sizes:Hr,colors:tn,mediaLibrary:w,has:j,exec:T,setBlock:L,setFontSize:A,applyColor:O,togglePanel:$,toggleInlineCode:X,addLink:ee,pickImage:ne,insertMedia:te,onFilesChange:z,onPaste:K,onDragOver:_,onDrop:se,rememberRange:D,onSourceInput:W,toggleSource:G,toggleFullscreen:de,syncFromDom:f,syncFormats:N,t:C}},template:`
|
|
2327
|
+
<div
|
|
2328
|
+
class="djm-rich-editor"
|
|
2329
|
+
:class="{ 'djm-is-disabled': disabled, 'djm-is-fullscreen': fullscreen }"
|
|
2330
|
+
>
|
|
2331
|
+
<div class="djm-rich-editor-toolbar" role="toolbar" :aria-label="t('richEditor.toolbar')" @mousedown="rememberRange">
|
|
2332
|
+
<div class="djm-rich-editor-group" v-if="has('history')">
|
|
2333
|
+
<button
|
|
2334
|
+
class="djm-rich-editor-btn"
|
|
2335
|
+
type="button"
|
|
2336
|
+
:title="t('richEditor.undo')"
|
|
2337
|
+
:aria-label="t('richEditor.undo')"
|
|
2338
|
+
:disabled="disabled || sourceMode"
|
|
2339
|
+
@mousedown.prevent
|
|
2340
|
+
@click="exec('undo')"
|
|
2341
|
+
><Icon name="undo" :size="13" /></button>
|
|
2342
|
+
<button
|
|
2343
|
+
class="djm-rich-editor-btn"
|
|
2344
|
+
type="button"
|
|
2345
|
+
:title="t('richEditor.redo')"
|
|
2346
|
+
:aria-label="t('richEditor.redo')"
|
|
2347
|
+
:disabled="disabled || sourceMode"
|
|
2348
|
+
@mousedown.prevent
|
|
2349
|
+
@click="exec('redo')"
|
|
2350
|
+
><Icon name="redo" :size="13" /></button>
|
|
2351
|
+
</div>
|
|
2352
|
+
|
|
2353
|
+
<div class="djm-rich-editor-group" v-if="has('format')">
|
|
2354
|
+
<select
|
|
2355
|
+
class="djm-rich-editor-select"
|
|
2356
|
+
:value="formats.block"
|
|
2357
|
+
:aria-label="t('richEditor.block')"
|
|
2358
|
+
:disabled="disabled || sourceMode"
|
|
2359
|
+
@change="setBlock($event.target.value)"
|
|
2360
|
+
>
|
|
2361
|
+
<option v-for="item in blocks" :key="item.value" :value="item.value">{{ t('richEditor.' + item.label) }}</option>
|
|
2362
|
+
</select>
|
|
2363
|
+
<select
|
|
2364
|
+
class="djm-rich-editor-select djm-rich-editor-select-size"
|
|
2365
|
+
:value="fontSize"
|
|
2366
|
+
:aria-label="t('richEditor.fontSize')"
|
|
2367
|
+
:disabled="disabled || sourceMode"
|
|
2368
|
+
@change="setFontSize($event.target.value)"
|
|
2369
|
+
>
|
|
2370
|
+
<option v-for="item in sizes" :key="item.value" :value="item.value">{{ t('richEditor.' + item.label) }}</option>
|
|
2371
|
+
</select>
|
|
2372
|
+
</div>
|
|
2373
|
+
|
|
2374
|
+
<div class="djm-rich-editor-group" v-if="has('inline')">
|
|
2250
2375
|
<button
|
|
2251
2376
|
class="djm-rich-editor-btn djm-rich-editor-btn-bold"
|
|
2252
2377
|
type="button"
|
|
2253
2378
|
:title="t('richEditor.bold')"
|
|
2254
2379
|
:aria-label="t('richEditor.bold')"
|
|
2255
2380
|
:aria-pressed="String(formats.bold)"
|
|
2256
|
-
:disabled="disabled"
|
|
2381
|
+
:disabled="disabled || sourceMode"
|
|
2257
2382
|
@mousedown.prevent
|
|
2258
2383
|
@click="exec('bold')"
|
|
2259
2384
|
>B</button>
|
|
@@ -2263,7 +2388,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2263
2388
|
:title="t('richEditor.italic')"
|
|
2264
2389
|
:aria-label="t('richEditor.italic')"
|
|
2265
2390
|
:aria-pressed="String(formats.italic)"
|
|
2266
|
-
:disabled="disabled"
|
|
2391
|
+
:disabled="disabled || sourceMode"
|
|
2267
2392
|
@mousedown.prevent
|
|
2268
2393
|
@click="exec('italic')"
|
|
2269
2394
|
>I</button>
|
|
@@ -2273,7 +2398,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2273
2398
|
:title="t('richEditor.underline')"
|
|
2274
2399
|
:aria-label="t('richEditor.underline')"
|
|
2275
2400
|
:aria-pressed="String(formats.underline)"
|
|
2276
|
-
:disabled="disabled"
|
|
2401
|
+
:disabled="disabled || sourceMode"
|
|
2277
2402
|
@mousedown.prevent
|
|
2278
2403
|
@click="exec('underline')"
|
|
2279
2404
|
>U</button>
|
|
@@ -2283,46 +2408,130 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2283
2408
|
:title="t('richEditor.strike')"
|
|
2284
2409
|
:aria-label="t('richEditor.strike')"
|
|
2285
2410
|
:aria-pressed="String(formats.strike)"
|
|
2286
|
-
:disabled="disabled"
|
|
2411
|
+
:disabled="disabled || sourceMode"
|
|
2287
2412
|
@mousedown.prevent
|
|
2288
2413
|
@click="exec('strikeThrough')"
|
|
2289
2414
|
>S</button>
|
|
2415
|
+
<button
|
|
2416
|
+
class="djm-rich-editor-btn"
|
|
2417
|
+
type="button"
|
|
2418
|
+
:title="t('richEditor.inlineCode')"
|
|
2419
|
+
:aria-label="t('richEditor.inlineCode')"
|
|
2420
|
+
:aria-pressed="String(formats.code)"
|
|
2421
|
+
:disabled="disabled || sourceMode"
|
|
2422
|
+
@mousedown.prevent
|
|
2423
|
+
@click="toggleInlineCode"
|
|
2424
|
+
><Icon name="code" :size="13" /></button>
|
|
2290
2425
|
</div>
|
|
2291
2426
|
|
|
2292
|
-
<div class="djm-rich-editor-group">
|
|
2293
|
-
<button
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2427
|
+
<div class="djm-rich-editor-group djm-rich-editor-color" v-if="has('color')">
|
|
2428
|
+
<button
|
|
2429
|
+
class="djm-rich-editor-btn"
|
|
2430
|
+
type="button"
|
|
2431
|
+
:title="t('richEditor.textColor')"
|
|
2432
|
+
:aria-label="t('richEditor.textColor')"
|
|
2433
|
+
:aria-expanded="String(panel === 'text')"
|
|
2434
|
+
:disabled="disabled || sourceMode"
|
|
2435
|
+
@mousedown.prevent
|
|
2436
|
+
@click.stop="togglePanel('text')"
|
|
2437
|
+
>
|
|
2438
|
+
<span class="djm-rich-editor-letter" :style="{ borderBottomColor: textColor }">A</span>
|
|
2303
2439
|
</button>
|
|
2304
|
-
<button
|
|
2305
|
-
|
|
2440
|
+
<button
|
|
2441
|
+
class="djm-rich-editor-btn"
|
|
2442
|
+
type="button"
|
|
2443
|
+
:title="t('richEditor.bgColor')"
|
|
2444
|
+
:aria-label="t('richEditor.bgColor')"
|
|
2445
|
+
:aria-expanded="String(panel === 'bg')"
|
|
2446
|
+
:disabled="disabled || sourceMode"
|
|
2447
|
+
@mousedown.prevent
|
|
2448
|
+
@click.stop="togglePanel('bg')"
|
|
2449
|
+
>
|
|
2450
|
+
<span class="djm-rich-editor-letter djm-rich-editor-letter-bg" :style="{ background: bgColor }">A</span>
|
|
2306
2451
|
</button>
|
|
2452
|
+
<div v-if="panel === 'text' || panel === 'bg'" class="djm-rich-editor-panel" role="group" :aria-label="t('richEditor.textColor')">
|
|
2453
|
+
<button
|
|
2454
|
+
v-for="color in colors"
|
|
2455
|
+
:key="color"
|
|
2456
|
+
class="djm-rich-editor-swatch"
|
|
2457
|
+
type="button"
|
|
2458
|
+
:title="color"
|
|
2459
|
+
:aria-label="color"
|
|
2460
|
+
:style="{ background: color }"
|
|
2461
|
+
@mousedown.prevent
|
|
2462
|
+
@click="applyColor(panel, color)"
|
|
2463
|
+
></button>
|
|
2464
|
+
</div>
|
|
2307
2465
|
</div>
|
|
2308
2466
|
|
|
2309
|
-
<div class="djm-rich-editor-group">
|
|
2310
|
-
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.
|
|
2311
|
-
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.
|
|
2312
|
-
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.
|
|
2467
|
+
<div class="djm-rich-editor-group" v-if="has('align')">
|
|
2468
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.alignLeft')" :aria-label="t('richEditor.alignLeft')" :aria-pressed="String(formats.align === 'left')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('justifyLeft')"><Icon name="align-left" :size="13" /></button>
|
|
2469
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.alignCenter')" :aria-label="t('richEditor.alignCenter')" :aria-pressed="String(formats.align === 'center')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('justifyCenter')"><Icon name="align-center" :size="13" /></button>
|
|
2470
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.alignRight')" :aria-label="t('richEditor.alignRight')" :aria-pressed="String(formats.align === 'right')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('justifyRight')"><Icon name="align-right" :size="13" /></button>
|
|
2471
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.alignJustify')" :aria-label="t('richEditor.alignJustify')" :aria-pressed="String(formats.align === 'justify')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('justifyFull')"><Icon name="align-justify" :size="13" /></button>
|
|
2313
2472
|
</div>
|
|
2314
2473
|
|
|
2315
|
-
<div class="djm-rich-editor-
|
|
2316
|
-
|
|
2317
|
-
class="djm-rich-editor-btn"
|
|
2318
|
-
|
|
2319
|
-
type="button"
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
<
|
|
2325
|
-
|
|
2474
|
+
<div class="djm-rich-editor-group" v-if="has('list')">
|
|
2475
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.bulletList')" :aria-label="t('richEditor.bulletList')" :aria-pressed="String(formats.list === 'ul')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('insertUnorderedList')"><Icon name="list" :size="13" /></button>
|
|
2476
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.numberList')" :aria-label="t('richEditor.numberList')" :aria-pressed="String(formats.list === 'ol')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('insertOrderedList')"><Icon name="list-ordered" :size="13" /></button>
|
|
2477
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.outdent')" :aria-label="t('richEditor.outdent')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('outdent')"><Icon name="outdent" :size="13" /></button>
|
|
2478
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.indent')" :aria-label="t('richEditor.indent')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('indent')"><Icon name="indent" :size="13" /></button>
|
|
2479
|
+
</div>
|
|
2480
|
+
|
|
2481
|
+
<div class="djm-rich-editor-group" v-if="has('insert')">
|
|
2482
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.link')" :aria-label="t('richEditor.link')" :disabled="disabled || sourceMode" @mousedown.prevent @click="addLink"><Icon name="link" :size="13" /></button>
|
|
2483
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.unlink')" :aria-label="t('richEditor.unlink')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('unlink')"><Icon name="unlink" :size="13" /></button>
|
|
2484
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.singleImage')" :aria-label="t('richEditor.singleImage')" :disabled="disabled || sourceMode" @mousedown.prevent @click="pickImage(false)"><Icon name="image" :size="13" /></button>
|
|
2485
|
+
<button v-if="multiple" class="djm-rich-editor-btn" type="button" :title="t('richEditor.multiImage')" :aria-label="t('richEditor.multiImage')" :disabled="disabled || sourceMode" @mousedown.prevent @click="pickImage(true)"><Icon name="images" :size="13" /></button>
|
|
2486
|
+
<MediaPicker
|
|
2487
|
+
v-if="mediaLibrary.length"
|
|
2488
|
+
class="djm-rich-editor-picker"
|
|
2489
|
+
multiple
|
|
2490
|
+
accept="image"
|
|
2491
|
+
:items="mediaLibrary"
|
|
2492
|
+
:title="t('richEditor.mediaLibrary')"
|
|
2493
|
+
:disabled="disabled || sourceMode"
|
|
2494
|
+
@change="insertMedia"
|
|
2495
|
+
>
|
|
2496
|
+
<template #trigger="{ open }">
|
|
2497
|
+
<button
|
|
2498
|
+
class="djm-rich-editor-btn"
|
|
2499
|
+
type="button"
|
|
2500
|
+
:title="t('richEditor.mediaLibrary')"
|
|
2501
|
+
:aria-label="t('richEditor.mediaLibrary')"
|
|
2502
|
+
:disabled="disabled || sourceMode"
|
|
2503
|
+
@mousedown.prevent="rememberRange"
|
|
2504
|
+
@click="open"
|
|
2505
|
+
><Icon name="grid" :size="13" /></button>
|
|
2506
|
+
</template>
|
|
2507
|
+
</MediaPicker>
|
|
2508
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.hr')" :aria-label="t('richEditor.hr')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('insertHorizontalRule')">\u2014</button>
|
|
2509
|
+
<button class="djm-rich-editor-btn" type="button" :title="t('richEditor.clearFormat')" :aria-label="t('richEditor.clearFormat')" :disabled="disabled || sourceMode" @mousedown.prevent @click="exec('removeFormat')"><span class="djm-rich-editor-glyph">T\xD7</span></button>
|
|
2510
|
+
</div>
|
|
2511
|
+
|
|
2512
|
+
<div class="djm-rich-editor-spacer" v-if="has('view')"></div>
|
|
2513
|
+
<div class="djm-rich-editor-group djm-rich-editor-group-end" v-if="has('view')">
|
|
2514
|
+
<button
|
|
2515
|
+
class="djm-rich-editor-btn"
|
|
2516
|
+
:class="{ 'djm-is-active': sourceMode }"
|
|
2517
|
+
type="button"
|
|
2518
|
+
:title="sourceMode ? t('richEditor.visual') : t('richEditor.source')"
|
|
2519
|
+
:aria-label="sourceMode ? t('richEditor.visual') : t('richEditor.source')"
|
|
2520
|
+
:aria-pressed="String(sourceMode)"
|
|
2521
|
+
:disabled="disabled"
|
|
2522
|
+
@click="toggleSource"
|
|
2523
|
+
><Icon name="code" :size="13" /></button>
|
|
2524
|
+
<button
|
|
2525
|
+
class="djm-rich-editor-btn"
|
|
2526
|
+
:class="{ 'djm-is-active': fullscreen }"
|
|
2527
|
+
type="button"
|
|
2528
|
+
:title="fullscreen ? t('richEditor.exitFullscreen') : t('richEditor.fullscreen')"
|
|
2529
|
+
:aria-label="fullscreen ? t('richEditor.exitFullscreen') : t('richEditor.fullscreen')"
|
|
2530
|
+
:aria-pressed="String(fullscreen)"
|
|
2531
|
+
:disabled="disabled"
|
|
2532
|
+
@click="toggleFullscreen"
|
|
2533
|
+
><Icon :name="fullscreen ? 'minimize' : 'maximize'" :size="13" /></button>
|
|
2534
|
+
</div>
|
|
2326
2535
|
</div>
|
|
2327
2536
|
|
|
2328
2537
|
<div
|
|
@@ -2338,6 +2547,8 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2338
2547
|
:style="{ minHeight: minHeight + 'px' }"
|
|
2339
2548
|
@input="syncFromDom"
|
|
2340
2549
|
@paste="onPaste"
|
|
2550
|
+
@dragover="onDragOver"
|
|
2551
|
+
@drop="onDrop"
|
|
2341
2552
|
></div>
|
|
2342
2553
|
|
|
2343
2554
|
<textarea
|
|
@@ -2350,8 +2561,23 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2350
2561
|
spellcheck="false"
|
|
2351
2562
|
@input="onSourceInput"
|
|
2352
2563
|
></textarea>
|
|
2564
|
+
|
|
2565
|
+
<div v-if="showCount" class="djm-rich-editor-foot">
|
|
2566
|
+
<span v-if="uploadCount" class="djm-rich-editor-foot-item">{{ t('richEditor.uploading', { count: uploadCount }) }}</span>
|
|
2567
|
+
<span class="djm-rich-editor-foot-item">{{ t('richEditor.wordCount', { count }) }}</span>
|
|
2568
|
+
</div>
|
|
2569
|
+
|
|
2570
|
+
<input
|
|
2571
|
+
ref="fileInput"
|
|
2572
|
+
class="djm-rich-editor-file"
|
|
2573
|
+
type="file"
|
|
2574
|
+
:accept="accept"
|
|
2575
|
+
tabindex="-1"
|
|
2576
|
+
aria-hidden="true"
|
|
2577
|
+
@change="onFilesChange"
|
|
2578
|
+
/>
|
|
2353
2579
|
</div>
|
|
2354
|
-
`};import{ref as
|
|
2580
|
+
`};import{ref as Xe,onBeforeUnmount as $r}from"vue";function Rt(e,t,a){return Math.min(Math.max(e,t),Math.max(t,a))}var on={name:"DjmFloatingWindow",components:{Icon:P},props:{title:{type:String,default:"\u7A97\u53E3"},icon:{type:String,default:"monitor"},initialX:{type:Number,default:24},initialY:{type:Number,default:24},width:{type:Number,default:420},height:{type:Number,default:280},zIndex:{type:Number,default:1}},emits:["close","focus"],setup(e,{emit:t}){let a=Xe(null),i=Xe({x:e.initialX,y:e.initialY}),n=Xe({w:e.width,h:e.height}),l=Xe(!1),r=Xe(!1),o=Xe(null),s=null,d=null;function p(){return a.value?a.value.parentElement:null}function c(b){if(b.button!==0||l.value||r.value)return;t("focus");let m=p();m&&(s={sx:b.clientX,sy:b.clientY,x:i.value.x,y:i.value.y,maxX:m.clientWidth-n.value.w,maxY:m.clientHeight-n.value.h},window.addEventListener("pointermove",h),window.addEventListener("pointerup",v),b.preventDefault())}function h(b){s&&(i.value={x:Rt(s.x+b.clientX-s.sx,0,s.maxX),y:Rt(s.y+b.clientY-s.sy,0,s.maxY)})}function v(){s=null,window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",v)}function u(b){if(l.value||r.value)return;b.stopPropagation(),t("focus");let m=p();m&&(d={sx:b.clientX,sy:b.clientY,w:n.value.w,h:n.value.h,maxW:m.clientWidth-i.value.x,maxH:m.clientHeight-i.value.y},window.addEventListener("pointermove",g),window.addEventListener("pointerup",y),b.preventDefault())}function g(b){if(!d)return;let m=Math.min(280,d.maxW),f=Math.min(170,d.maxH);n.value={w:Rt(d.w+b.clientX-d.sx,m,d.maxW),h:Rt(d.h+b.clientY-d.sy,f,d.maxH)}}function y(){d=null,window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y)}function j(){l.value=!l.value,t("focus")}function w(){if(r.value)o.value&&(i.value={...o.value.pos},n.value={...o.value.size},r.value=!1);else{o.value={pos:{...i.value},size:{...n.value}};let b=p();b&&(i.value={x:0,y:0},n.value={w:b.clientWidth-2,h:b.clientHeight-2}),r.value=!0,l.value=!1}t("focus")}return $r(()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",v),window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y)}),{root:a,pos:i,size:n,minimized:l,maximized:r,startDrag:c,startResize:u,toggleMin:j,toggleMax:w}},template:`
|
|
2355
2581
|
<div
|
|
2356
2582
|
ref="root"
|
|
2357
2583
|
class="djm-float-window"
|
|
@@ -2387,7 +2613,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2387
2613
|
|
|
2388
2614
|
<span class="djm-float-resize" v-if="!minimized && !maximized" @pointerdown="startResize"></span>
|
|
2389
2615
|
</div>
|
|
2390
|
-
`};import{reactive as
|
|
2616
|
+
`};import{reactive as Fr,ref as da,watch as Kr,onBeforeUnmount as Wr}from"vue";var rn=0;function Ur(e){let t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}function Qe(e){return!e&&e!==0?"":e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/1024/1024).toFixed(1)+" MB"}function qr(e,t){if(!t)return!0;let a=(e.name||"").toLowerCase(),i=(e.type||"").toLowerCase();return t.split(",").map(n=>n.trim().toLowerCase()).filter(Boolean).some(n=>n.startsWith(".")?a.endsWith(n):n.endsWith("/*")?i.startsWith(n.slice(0,-1)):i===n)}var sn={name:"DjmUpload",components:{DjmIcon:P},props:{modelValue:{type:Array,default:()=>[]},accept:{type:String,default:""},maxSize:{type:Number,default:10*1024*1024},limit:{type:Number,default:6},multiple:{type:Boolean,default:!0},drag:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},listType:{type:String,default:"text"},autoUpload:{type:Boolean,default:!0},request:{type:Function,default:null},beforeUpload:{type:Function,default:null},hint:{type:String,default:""},showList:{type:Boolean,default:!0}},emits:["update:modelValue","change","success","error","remove","exceed"],setup(e,{emit:t}){let a=da([]),i=da(!1),n=da(null),l=new Map;Kr(()=>e.modelValue,b=>{let m=b||[],f=a.value;m.length===f.length&&m.every((D,k)=>D===f[k])||(a.value=m.slice())});function r(){t("update:modelValue",a.value.slice()),t("change",a.value.slice())}function o(b,m){return C(b,m)}function s(){e.disabled||n.value&&n.value.click()}function d(b,m,f){a.value.includes(b)&&(l.delete(b.uid),m==="done"?(b.status="done",b.progress=100,b.response=f,b.message="",t("success",b,f)):(b.status="error",b.message=f&&f.message?f.message:o("upload.failed"),t("error",b,f)),r())}function p(b){if(!e.request){b.status="ready";return}b.status="uploading",b.progress=0,b.message="";let m=e.request(b.raw,{onProgress(f){b.progress=Math.max(0,Math.min(100,Math.round(f)))},onSuccess(f){d(b,"done",f)},onError(f){d(b,"error",f)}});m&&typeof m.then=="function"&&m.then(f=>d(b,"done",f),f=>d(b,"error",f)),typeof m=="function"&&l.set(b.uid,m)}async function c(b){if(e.disabled)return[];let m=Array.from(b||[]);if(!m.length)return[];let f=e.limit>0?e.limit-a.value.length:m.length;if(f<=0)return t("exceed",m),[];let E=m.slice(0,f);m.length>f&&t("exceed",m.slice(f));let D=[];for(let k of E){if(!qr(k,e.accept)){t("error",{file:k,reason:"accept"});continue}if(e.maxSize>0&&k.size>e.maxSize){t("error",{file:k,reason:"size"});continue}if(typeof e.beforeUpload=="function"){let S=!0;try{S=await e.beforeUpload(k)}catch{S=!1}if(S===!1)continue}rn+=1;let B=Fr({uid:rn,name:k.name,size:k.size,ext:Ur(k.name),type:k.type,raw:k,url:k.type&&k.type.startsWith("image/")?URL.createObjectURL(k):"",progress:0,status:e.autoUpload?"uploading":"ready",response:null,message:""});a.value.push(B),D.push(B)}return D.length&&(r(),D.forEach(p)),D}function h(b){c(b.target.files),b.target.value=""}function v(){e.disabled||(i.value=!0)}function u(b){i.value=!1,c(b.dataTransfer.files)}function g(b){let m=l.get(b.uid);typeof m=="function"&&m(),l.delete(b.uid),b.url&&URL.revokeObjectURL(b.url),a.value=a.value.filter(f=>f.uid!==b.uid),t("remove",b),r()}function y(b){e.disabled||p(b)}function j(){a.value.filter(b=>b.status==="ready"||b.status==="error").forEach(p)}function w(){a.value.forEach(b=>{let m=l.get(b.uid);typeof m=="function"&&m(),b.url&&URL.revokeObjectURL(b.url)}),l.clear(),a.value=[],r()}return Wr(()=>{a.value.forEach(b=>{b.url&&URL.revokeObjectURL(b.url)}),l.clear()}),{files:a,dragActive:i,inputRef:n,pick:s,addFiles:c,onChange:h,onDragOver:v,onDrop:u,remove:g,retry:y,submit:j,clear:w,formatFileSize:Qe,statusLabel(b){return b.status==="uploading"?o("upload.uploading",{percent:b.progress}):b.status==="done"?o("upload.done"):b.status==="error"?b.message||o("upload.failed"):o("upload.ready")},hintText(){if(e.hint)return e.hint;let b=[];return e.limit>0&&b.push(o("upload.limitHint",{count:e.limit})),e.maxSize>0&&b.push(o("upload.sizeHint",{size:Qe(e.maxSize)})),b.join(" \xB7 ")||o("upload.dropHint")},t:o}},template:`
|
|
2391
2617
|
<div class="djm-upload" :class="{ 'djm-is-disabled': disabled }">
|
|
2392
2618
|
<div
|
|
2393
2619
|
v-if="drag"
|
|
@@ -2495,7 +2721,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2495
2721
|
<div class="djm-upload-empty" v-else>{{ t('upload.empty') }}</div>
|
|
2496
2722
|
</template>
|
|
2497
2723
|
</div>
|
|
2498
|
-
`};import{computed as
|
|
2724
|
+
`};import{computed as dn,ref as De,watch as ca}from"vue";var cn={name:"DjmTree",components:{Icon:P},props:{data:{type:Array,default:()=>[]},nodeKey:{type:String,default:"id"},labelKey:{type:String,default:"label"},checkable:{type:Boolean,default:!1},checked:{type:Array,default:()=>[]},checkStrictly:{type:Boolean,default:!1},expanded:{type:Array,default:()=>[]},defaultExpandAll:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},load:{type:Function,default:null},keyword:{type:String,default:""},activeKey:{type:[String,Number],default:""},rowClass:{type:[String,Function],default:""},draggable:{type:Boolean,default:!1},allowDrop:{type:Function,default:null},emptyText:{type:String,default:""}},emits:["update:checked","update:expanded","node-click","check","node-drop","load-error"],setup(e,{emit:t}){let a=De({}),i=De([]),n=De([...e.expanded]),l=De([...e.checked]);ca(()=>e.expanded,x=>{Array.isArray(x)&&(n.value=x)}),ca(()=>e.checked,x=>{Array.isArray(x)&&(l.value=x)});function r(x){let I=x[e.nodeKey];return a.value[I]?a.value[I]:x.children||null}function o(x){let I=r(x);return I&&I.length?!0:s(x)}function s(x){let I=x[e.nodeKey];return a.value[I]?!1:e.lazy&&typeof e.load=="function"&&!x.children&&x.isLeaf!==!0}function d(x){return e.keyword.trim()?!0:n.value.includes(x[e.nodeKey])}function p(x){return i.value.includes(x[e.nodeKey])}function c(x,I=[]){return x.forEach(N=>{let W=r(N);W&&W.length&&(I.push(N[e.nodeKey]),c(W,I))}),I}ca(()=>e.data,()=>{e.defaultExpandAll&&(n.value=c(e.data))},{immediate:!0});function h(x){return String(x[e.labelKey]||"").toLowerCase().includes(e.keyword.trim().toLowerCase())}function v(x){if(!e.keyword.trim()||h(x))return!0;let I=r(x);return!!(I&&I.some(N=>v(N)))}let u=dn(()=>{let x=[],I=(N,W)=>{N.forEach(G=>{if(!v(G))return;x.push({node:G,level:W,index:x.length});let de=r(G);de&&de.length&&d(G)&&I(de,W+1)})};return I(e.data,0),x});function g(x,I=[]){let N=r(x);return N&&N.length?N.forEach(W=>g(W,I)):I.push(x[e.nodeKey]),I}function y(x){let I=e.checkStrictly?[x[e.nodeKey]]:g(x);return I.length>0&&I.every(N=>l.value.includes(N))}function j(x){if(e.checkStrictly)return!1;let I=g(x),N=I.filter(W=>l.value.includes(W)).length;return N>0&&N<I.length}function w(x,I){if(x.disabled){I&&(I.target.checked=y(x));return}let N=e.checkStrictly?[x[e.nodeKey]]:g(x),W=N.every(de=>l.value.includes(de)),G=W?l.value.filter(de=>!N.includes(de)):[...new Set([...l.value,...N])];l.value=G,t("update:checked",G),t("check",{node:x,checked:!W,keys:G})}async function b(x){let I=x[e.nodeKey];if(!o(x))return;if(s(x)&&!a.value[I]){i.value=[...i.value,I];try{let G=await e.load(x);a.value={...a.value,[I]:G||[]}}catch(G){t("load-error",x,G);return}finally{i.value=i.value.filter(G=>G!==I)}}let W=n.value.includes(I)?n.value.filter(G=>G!==I):[...n.value,I];n.value=W,t("update:expanded",W)}function m(x){x.disabled||t("node-click",x)}function f(x){return e.activeKey!==""&&x[e.nodeKey]===e.activeKey}let E=De(null),D=De(-1);function k(x){return(D.value===-1?0:D.value)===x?0:-1}function B(x){let N=(E.value?E.value.querySelectorAll(".djm-tree-node"):[])[x];N&&(D.value=x,N.focus())}function S(x){let I=u.value.length;if(!I)return;let N=D.value===-1?0:D.value,W=u.value[N],G=x.key;if(G==="ArrowDown"||G==="ArrowUp"){x.preventDefault(),B(Math.min(I-1,Math.max(0,N+(G==="ArrowDown"?1:-1))));return}if(G==="Home"||G==="End"){x.preventDefault(),B(G==="Home"?0:I-1);return}if(G==="ArrowRight"){x.preventDefault(),W&&o(W.node)&&!d(W.node)?b(W.node):B(Math.min(I-1,N+1));return}if(G==="ArrowLeft"){if(x.preventDefault(),W&&o(W.node)&&d(W.node)){b(W.node);return}for(let de=N-1;de>=0;de--)if(u.value[de].level===W.level-1){B(de);break}return}if(G==="Enter"||G===" "){if(!W)return;x.preventDefault(),G===" "&&e.checkable?w(W.node):m(W.node)}}function T(x,I){return typeof e.rowClass=="function"?e.rowClass(x,I):e.rowClass}let L=De(""),A=De(""),O=De("");function $(x,I=e.data){for(let N of I){if(N[e.nodeKey]===x)return N;let W=r(N);if(W&&W.length){let G=$(x,W);if(G)return G}}return null}function X(x,I){if(x[e.nodeKey]===I)return!0;let N=r(x);return!!(N&&N.some(W=>X(W,I)))}function ee(x,I){let N=x.currentTarget.getBoundingClientRect(),W=N.height?(x.clientY-N.top)/N.height:.5;return W<.28?"before":W>.72?"after":o(I)?"inside":"after"}function H(x,I){if(!e.draggable||!L.value||x.disabled)return!1;let N=$(L.value);return!(!N||N===x||X(N,x[e.nodeKey])||typeof e.allowDrop=="function"&&e.allowDrop(N,x,I)===!1)}function U(){L.value="",A.value="",O.value=""}function Y(x,I){!e.draggable||x.disabled||(L.value=x[e.nodeKey],A.value="",I.dataTransfer&&(I.dataTransfer.setData("text/plain",String(L.value)),I.dataTransfer.effectAllowed="move"))}function ne(x,I){if(!e.draggable||!L.value)return;let N=ee(I,x);if(!H(x,N)){A.value===x[e.nodeKey]&&U();return}I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="move"),A.value=x[e.nodeKey],O.value=N}function te(x){A.value===x[e.nodeKey]&&(A.value="",O.value="")}function re(x,I){if(!e.draggable||!L.value)return;I.preventDefault();let N=O.value||ee(I,x),W=$(L.value);A.value===x[e.nodeKey]&&H(x,N)&&W&&t("node-drop",{dragNode:W,dropNode:x,position:N}),U()}function z(){U()}function K(x){return A.value!==x[e.nodeKey]?"":"djm-is-drop-"+O.value}function _(x){return L.value!==""&&x[e.nodeKey]===L.value}function se(x){return x[e.labelKey]}return{rows:u,rootEl:E,focusIndex:D,tabIndexOf:k,onKeydown:S,childrenOf:r,hasChildren:o,isExpanded:d,isActive:f,isLoading:p,isChecked:y,isIndeterminate:j,toggleCheck:w,toggleExpand:b,onNodeClick:m,rowClassOf:T,dropClassOf:K,isDragging:_,onDragStart:Y,onDragOver:ne,onDragLeave:te,onDrop:re,onDragEnd:z,labelOf:se,emptyLabel:dn(()=>e.emptyText||C("tree.empty")),t:C}},template:`
|
|
2499
2725
|
<div class="djm-tree" role="tree" ref="rootEl" @keydown="onKeydown">
|
|
2500
2726
|
<div
|
|
2501
2727
|
v-for="row in rows"
|
|
@@ -2556,7 +2782,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2556
2782
|
|
|
2557
2783
|
<div v-if="!rows.length" class="djm-tree-empty">{{ emptyLabel }}</div>
|
|
2558
2784
|
</div>
|
|
2559
|
-
`};import{computed as
|
|
2785
|
+
`};import{computed as ua,nextTick as _r,reactive as un,ref as mn,useSlots as Yr,watch as Jr}from"vue";var ma="__editable_actions";function fa(e){return e===""||e===null||e===void 0?!0:Array.isArray(e)&&e.length===0}var fn={name:"DjmEditableTable",components:{DjmTable:pt,DjmInput:ge,DjmSelect:Ie,DjmSwitch:We,DjmDatePicker:Se},inheritAttrs:!1,props:{columns:{type:Array,required:!0},rows:{type:Array,default:()=>[]},rowKey:{type:String,default:"id"},showActions:{type:Boolean,default:!0},actionLabel:{type:String,default:"\u64CD\u4F5C"},actionWidth:{type:Number,default:120},editable:{type:Function,default:null}},emits:["edit","save","cancel"],setup(e,{emit:t}){let a=Yr(),i=mn(""),n=un({}),l=un({}),r=mn(null),o=ua(()=>e.columns.filter(m=>m.editor)),s=ua(()=>e.showActions?e.columns.concat({key:ma,label:e.actionLabel,width:e.actionWidth,class:"djm-col-actions",fixed:"right",exportable:!1}):e.columns),d=ua(()=>{let m=new Set(o.value.map(f=>"cell-"+f.key));return m.add("cell-"+ma),Object.keys(a).filter(f=>!m.has(f))});function p(m){return"cell-"+m.key}let c="cell-"+ma;function h(){Object.keys(l).forEach(m=>delete l[m])}function v(m){return i.value!==""&&m[e.rowKey]===i.value}function u(m){return typeof e.editable=="function"?!!e.editable(m):!0}function g(m){return u(m)?(i.value=m[e.rowKey],o.value.forEach(f=>{n[f.key]=m[f.key]}),h(),t("edit",m),!0):!1}function y(){let m=j(i.value);i.value="",h(),m&&t("cancel",m)}function j(m){return m===""?null:e.rows.find(f=>f[e.rowKey]===m)||null}function w(){return h(),o.value.forEach(m=>{let f=n[m.key],E=m.rules||[];for(let D of E){if(D.required&&fa(f)){l[m.key]=D.message||"\u8BE5\u9879\u4E3A\u5FC5\u586B";break}if(D.pattern&&!fa(f)&&!D.pattern.test(String(f))){l[m.key]=D.message||"\u683C\u5F0F\u4E0D\u6B63\u786E";break}if(typeof D.validator=="function"){let k=D.validator(f,n);if(k===!1){l[m.key]=D.message||"\u6821\u9A8C\u672A\u901A\u8FC7";break}if(typeof k=="string"){l[m.key]=k;break}}}}),Object.keys(l).length===0}function b(){let m=j(i.value);if(!m)return i.value="",!1;if(!w())return _r(()=>{let E=r.value&&r.value.$el?r.value.$el.querySelector(".djm-cell-error"):null;E&&E.scrollIntoView({block:"nearest"})}),!1;let f={};return o.value.forEach(E=>{let D=n[E.key];E.editor==="number"?f[E.key]=fa(D)?null:Number(D):f[E.key]=typeof D=="string"?D.trim():D}),t("save",{row:m,changes:f}),i.value="",h(),!0}return Jr(()=>e.rows,()=>{i.value&&!j(i.value)&&(i.value="",h())}),{tableRef:r,editingKey:i,draft:n,errors:l,editableColumns:o,renderColumns:s,forwardedSlotNames:d,cellSlot:p,actionsSlot:c,isEditing:v,rowEditable:u,startEdit:g,cancelEdit:y,saveEdit:b}},template:`
|
|
2560
2786
|
<DjmTable
|
|
2561
2787
|
ref="tableRef"
|
|
2562
2788
|
v-bind="$attrs"
|
|
@@ -2618,7 +2844,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2618
2844
|
<slot :name="name" v-bind="scope || {}"></slot>
|
|
2619
2845
|
</template>
|
|
2620
2846
|
</DjmTable>
|
|
2621
|
-
`};var
|
|
2847
|
+
`};var pn={name:"DjmDescriptions",props:{items:{type:Array,default:()=>[]},columns:{type:[Number,String],default:2},labelWidth:{type:[Number,String],default:72}},computed:{descStyle(){let e=Math.max(1,Number(this.columns)||1),t=this.labelWidth,a=typeof t=="number"||/^\d+(\.\d+)?$/.test(t)?t+"px":t;return{"--djm-desc-columns":e,"--djm-desc-label-w":a}}},methods:{slotOf(e){return"value-"+(e.key||e.label)}},template:`
|
|
2622
2848
|
<dl class="djm-descriptions" :style="descStyle">
|
|
2623
2849
|
<div
|
|
2624
2850
|
v-for="item in items"
|
|
@@ -2632,7 +2858,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2632
2858
|
</dd>
|
|
2633
2859
|
</div>
|
|
2634
2860
|
</dl>
|
|
2635
|
-
`};import{reactive as
|
|
2861
|
+
`};import{reactive as Gr}from"vue";var He=Gr([]),Xr=0;function hn(e){let t=He.findIndex(a=>a.id===e);t>-1&&He.splice(t,1)}function Vt(e,t="success",a=2600){let i=++Xr;return He.push({id:i,text:e,type:t}),a>0&&window.setTimeout(()=>hn(i),a),i}function Ze(e,t="success",a){return Vt(e,t,a)}Ze.success=(e,t)=>Vt(e,"success",t);Ze.info=(e,t)=>Vt(e,"info",t);Ze.error=(e,t)=>Vt(e,"error",t);Ze.close=hn;Ze.clear=()=>He.splice(0,He.length);var vn={name:"DjmMessageHost",components:{DjmIcon:P},setup(){return{messages:He}},template:`
|
|
2636
2862
|
<Teleport to="body">
|
|
2637
2863
|
<TransitionGroup name="djm-toast" tag="div" class="djm-toast-stack" role="status" aria-live="polite">
|
|
2638
2864
|
<div
|
|
@@ -2647,7 +2873,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2647
2873
|
</div>
|
|
2648
2874
|
</TransitionGroup>
|
|
2649
2875
|
</Teleport>
|
|
2650
|
-
`};import{computed as
|
|
2876
|
+
`};import{computed as Ee,onBeforeUnmount as Qr,ref as Me,watch as Zr}from"vue";var gn={name:"DjmOrgPicker",components:{DjmIcon:P},props:{modelValue:{type:Array,default:()=>[]},departments:{type:Array,default:()=>[]},staff:{type:Array,default:()=>[]},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},maxTagCount:{type:Number,default:3},showFooter:{type:Boolean,default:!0},emptyText:{type:String,default:""}},emits:["update:modelValue","change","visible-change"],setup(e,{emit:t}){let a=Me(!1),i=Me(null),n=Me(null),l=Me(""),r=Me(""),o=Me([]),s=Me(new Set),d=null;function p(z,K=[]){return z.forEach(_=>{K.push(_.id),_.children&&_.children.length&&p(_.children,K)}),K}function c(z){let K=I=>{for(let N of I){if(N.id===z)return N;if(N.children){let W=K(N.children);if(W)return W}}return null},_=K(e.departments);if(!_)return new Set([z]);let se=new Set,x=I=>I.forEach(N=>{se.add(N.id),N.children&&x(N.children)});return x([_]),se}let h=Ee(()=>{let z=new Map;return e.staff.forEach(K=>z.set(K.id,K)),z}),v=Ee(()=>e.modelValue.map(z=>h.value.get(z)).filter(Boolean)),u=Ee(()=>e.maxTagCount<=0?v.value:v.value.slice(0,e.maxTagCount)),g=Ee(()=>Math.max(0,v.value.length-u.value.length)),y=Ee(()=>{let z=l.value.trim().toLowerCase();if(z)return e.staff.filter(_=>(_.name+" "+(_.title||"")).toLowerCase().includes(z));if(!r.value)return e.staff;let K=c(r.value);return e.staff.filter(_=>K.has(_.deptId))}),j=Ee(()=>{let z=[],K=(_,se)=>{_.forEach(x=>{let I=Array.isArray(x.children)&&x.children.length>0;z.push({node:x,depth:se,hasChildren:I}),I&&s.value.has(x.id)&&K(x.children,se+1)})};return K(e.departments,0),z}),w=Ee(()=>o.value.length),b=Ee(()=>e.placeholder||C("orgPicker.placeholder")),m=Ee(()=>e.emptyText||C("orgPicker.empty")),f=Me(null),E=Me({...le}),D=342;function k(){if(!a.value||!i.value)return;let z=i.value.getBoundingClientRect(),K=Math.min(520,window.innerWidth-16);E.value=me({rect:z,flip:ue(z,D),width:K,clampWidth:K})}function B(){s.value=new Set(p(e.departments))}B(),Zr(()=>e.departments,()=>{s.value=new Set([...s.value,...p(e.departments)])});function S(z){return(z.name||"").slice(0,1)}function T(z){return o.value.includes(z)}function L(z){o.value.includes(z.id)?o.value=o.value.filter(K=>K!==z.id):o.value=[...o.value,z.id],e.showFooter||H()}function A(z){r.value=z,l.value=""}function O(z){let K=new Set(s.value);K.has(z.id)?K.delete(z.id):K.add(z.id),s.value=K}function $(){let z=y.value.find(K=>!o.value.includes(K.id));z&&L(z)}function X(){e.disabled||a.value||(o.value=[...e.modelValue],l.value="",r.value="",a.value=!0,t("visible-change",!0),d=ae({root:()=>i.value,panel:()=>f.value,onClose:ee,onReposition:k}),requestAnimationFrame(()=>{k(),n.value&&n.value.focus()}))}function ee(){a.value&&(a.value=!1,E.value={...le},t("visible-change",!1),d&&(d(),d=null))}function H(){let z=[...o.value];t("update:modelValue",z),t("change",z),e.showFooter&&ee()}function U(){o.value=[...e.modelValue],ee()}function Y(){e.disabled||(a.value?U():X())}function ne(z){let K=e.modelValue.filter(_=>_!==z);t("update:modelValue",K),t("change",K),o.value=o.value.filter(_=>_!==z)}function te(){e.disabled||(t("update:modelValue",[]),t("change",[]),o.value=[])}function re(){o.value=[]}return Qr(()=>{d&&(d(),d=null)}),{open:a,root:i,panel:f,panelStyle:E,searchRef:n,keyword:l,activeDept:r,temp:o,expandedIds:s,appliedStaff:v,visibleTags:u,restTagCount:g,visibleStaff:y,deptRows:j,selectedCount:w,placeholderText:b,emptyLabel:m,initialOf:S,isSelected:T,toggleStaff:L,pickDept:A,toggleExpand:O,onSearchEnter:$,openPanel:X,closePanel:ee,commit:H,cancel:U,toggle:Y,removeTag:ne,clearAll:te,clearTemp:re,t:C}},template:`
|
|
2651
2877
|
<div class="djm-org-picker" ref="root" :class="{ 'djm-is-open': open, 'djm-is-disabled': disabled }">
|
|
2652
2878
|
<div
|
|
2653
2879
|
class="djm-input djm-org-trigger"
|
|
@@ -2788,7 +3014,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2788
3014
|
</div>
|
|
2789
3015
|
</Teleport>
|
|
2790
3016
|
</div>
|
|
2791
|
-
`};import{computed as
|
|
3017
|
+
`};import{computed as bn,reactive as es,ref as ts,watch as pa}from"vue";var as={input:ge,number:qe,select:Ie,radio:ct,checkbox:dt,switch:We,date:Se,time:bt,cascader:_e,treeSelect:Ge,rate:vt,slider:gt,color:yt},yn={name:"DjmSchemaForm",components:{DjmForm:ut,DjmFormItem:mt,DjmRow:Ct,DjmCol:Tt},props:{modelValue:{type:Object,default:()=>({})},fields:{type:Array,default:()=>[]},rules:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},gap:{type:[Number,String],default:12}},emits:["update:modelValue","change"],setup(e,{emit:t}){let a=ts(null),i=es({...e.modelValue});pa(()=>e.fields,u=>{u.forEach(g=>{i[g.key]===void 0&&g.default!==void 0&&(i[g.key]=typeof g.default=="function"?g.default():g.default)})},{immediate:!0,deep:!0}),pa(()=>e.modelValue,u=>{u&&Object.keys(u).forEach(g=>{i[g]!==u[g]&&(i[g]=u[g])})},{deep:!0}),pa(i,()=>{t("update:modelValue",{...i}),t("change",{...i})},{deep:!0});let n=bn(()=>{let u={...e.rules};return e.fields.forEach(g=>{if(!g.required&&!g.rules)return;let y=[...u[g.key]||[]];g.required&&!y.some(j=>j.required)&&y.unshift({required:!0,message:g.requiredMessage||(g.label||g.key)+" \u4E3A\u5FC5\u586B\u9879"}),g.rules&&y.push(...g.rules),u[g.key]=y}),u}),l=bn(()=>e.fields.filter(u=>typeof u.visibleWhen!="function"?!0:!!u.visibleWhen(i)));function r(u){return as[u.type]||ge}function o(u){let g={...u.props||{}};return{...g,options:u.options!==void 0?u.options:g.options,placeholder:u.placeholder!==void 0?u.placeholder:g.placeholder,disabled:e.disabled||!!u.disabled}}function s(u,g){i[u]=g}function d(){return{...i}}function p(){return a.value?a.value.validate():Promise.resolve(!0)}function c(u){return a.value?a.value.validateField(u):Promise.resolve(!0)}function h(){a.value&&a.value.clearValidate()}function v(){a.value&&a.value.resetFields()}return{innerForm:a,model:i,formRules:n,visibleFields:l,controlOf:r,controlProps:o,setValue:s,getModel:d,validate:p,validateField:c,clearValidate:h,resetFields:v}},template:`
|
|
2792
3018
|
<DjmForm ref="innerForm" :model="model" :rules="formRules" :label-width="labelWidth">
|
|
2793
3019
|
<DjmRow :gap="gap">
|
|
2794
3020
|
<DjmCol v-for="field in visibleFields" :key="field.key" :span="field.span || 12">
|
|
@@ -2843,7 +3069,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2843
3069
|
</DjmCol>
|
|
2844
3070
|
</DjmRow>
|
|
2845
3071
|
</DjmForm>
|
|
2846
|
-
`};var
|
|
3072
|
+
`};var wn={name:"DjmApprovalFlow",components:{DjmIcon:P},props:{nodes:{type:Array,default:()=>[]},compact:{type:Boolean,default:!1}},emits:["node-click"],computed:{list(){return this.nodes.map((e,t)=>({...e,index:t}))}},methods:{statusText(e){return C("approval."+(e||"waiting"))},iconOf(e){return e.status==="approved"?"check":e.status==="rejected"?"x":e.status==="pending"?"clock":""},initialOf(e){return(e.name||"").slice(0,1)},t:C},template:`
|
|
2847
3073
|
<div class="djm-approval" :class="{ 'djm-is-compact': compact }">
|
|
2848
3074
|
<div
|
|
2849
3075
|
v-for="node in list"
|
|
@@ -2892,7 +3118,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2892
3118
|
|
|
2893
3119
|
<div v-if="!nodes.length" class="djm-approval-empty">{{ t('approval.empty') }}</div>
|
|
2894
3120
|
</div>
|
|
2895
|
-
`};import{computed as
|
|
3121
|
+
`};import{computed as jn,reactive as is,ref as ns,watch as ha}from"vue";var ls={input:ge,number:qe,select:Ie,date:Se,dateRange:Se,cascader:_e,treeSelect:Ge},xn={name:"DjmQueryFilter",components:{DjmIcon:P},props:{modelValue:{type:Object,default:()=>({})},fields:{type:Array,default:()=>[]},visibleCount:{type:Number,default:3},showActions:{type:Boolean,default:!0},searchText:{type:String,default:""},resetText:{type:String,default:""}},emits:["update:modelValue","search","reset"],setup(e,{emit:t}){let a=ns(!1),i=is({...e.modelValue});ha(()=>e.fields,h=>{h.forEach(v=>{i[v.key]===void 0&&v.default!==void 0&&(i[v.key]=typeof v.default=="function"?v.default():v.default)})},{immediate:!0,deep:!0}),ha(()=>e.modelValue,h=>{h&&Object.keys(h).forEach(v=>{i[v]!==h[v]&&(i[v]=h[v])})},{deep:!0}),ha(i,()=>{t("update:modelValue",{...i})},{deep:!0});let n=jn(()=>e.fields.length>e.visibleCount),l=jn(()=>!n.value||a.value?e.fields:e.fields.slice(0,e.visibleCount));function r(h){return ls[h.type]||ge}function o(h){let v={...h.props||{}};return h.type==="dateRange"&&(v.range=!0,v.panels=1),{...v,options:h.options!==void 0?h.options:v.options,placeholder:h.placeholder!==void 0?h.placeholder:v.placeholder}}function s(h,v){i[h]=v}function d(){t("search",{...i})}function p(h){let v=h.target&&h.target.tagName;v!=="INPUT"&&v!=="TEXTAREA"||h.target.closest(".djm-select-panel, .djm-date-picker-panel, .djm-cascader-panel, .djm-tree-select-panel")||d()}function c(){e.fields.forEach(h=>{i[h.key]=h.default!==void 0?typeof h.default=="function"?h.default():h.default:h.type==="dateRange"?[]:""}),t("reset"),t("search",{...i})}return{expanded:a,model:i,collapsible:n,visibleFields:l,controlOf:r,controlProps:o,setValue:s,search:d,reset:c,onEnter:p,t:C}},template:`
|
|
2896
3122
|
<div class="djm-query-filter" @keydown.enter="onEnter">
|
|
2897
3123
|
<div class="djm-query-fields">
|
|
2898
3124
|
<div v-for="field in visibleFields" :key="field.key" class="djm-query-field">
|
|
@@ -2936,7 +3162,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2936
3162
|
</button>
|
|
2937
3163
|
</div>
|
|
2938
3164
|
</div>
|
|
2939
|
-
`};var
|
|
3165
|
+
`};var kn={name:"DjmFilterTags",props:{items:{type:Array,default:()=>[]},clearable:{type:Boolean,default:!0},clearText:{type:String,default:"\u6E05\u7A7A\u7B5B\u9009"}},emits:["remove","clear"],template:`
|
|
2940
3166
|
<div v-if="items.length" class="djm-filter-tags">
|
|
2941
3167
|
<span v-for="item in items" :key="item.key" class="djm-filter-tag">
|
|
2942
3168
|
<span class="djm-filter-tag-label">{{ item.label }}</span>
|
|
@@ -2952,87 +3178,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
2952
3178
|
{{ clearText }}
|
|
2953
3179
|
</button>
|
|
2954
3180
|
</div>
|
|
2955
|
-
`};import{
|
|
2956
|
-
<span class="djm-media-picker">
|
|
2957
|
-
<slot name="trigger" :open="openPanel" :count="selectedIds.length">
|
|
2958
|
-
<button
|
|
2959
|
-
class="djm-btn"
|
|
2960
|
-
type="button"
|
|
2961
|
-
:disabled="disabled"
|
|
2962
|
-
@click="openPanel"
|
|
2963
|
-
>{{ triggerText || t('mediaPicker.select') }}<span v-if="selectedIds.length" class="djm-media-picker-count">{{ selectedIds.length }}</span></button>
|
|
2964
|
-
</slot>
|
|
2965
|
-
|
|
2966
|
-
<DjmModal
|
|
2967
|
-
:model-value="open"
|
|
2968
|
-
:title="title || t('mediaPicker.title')"
|
|
2969
|
-
width="760px"
|
|
2970
|
-
@update:model-value="cancel"
|
|
2971
|
-
>
|
|
2972
|
-
<div class="djm-media-toolbar">
|
|
2973
|
-
<label class="djm-media-search">
|
|
2974
|
-
<DjmIcon name="search" :size="13" />
|
|
2975
|
-
<input
|
|
2976
|
-
v-model="keyword"
|
|
2977
|
-
class="djm-media-search-input"
|
|
2978
|
-
type="text"
|
|
2979
|
-
:placeholder="t('mediaPicker.search')"
|
|
2980
|
-
:aria-label="t('mediaPicker.search')"
|
|
2981
|
-
/>
|
|
2982
|
-
</label>
|
|
2983
|
-
<span class="djm-media-toolbar-slot">
|
|
2984
|
-
<slot name="toolbar"></slot>
|
|
2985
|
-
</span>
|
|
2986
|
-
</div>
|
|
2987
|
-
|
|
2988
|
-
<div class="djm-media-grid" role="listbox" :aria-multiselectable="multiple ? 'true' : 'false'">
|
|
2989
|
-
<div
|
|
2990
|
-
v-for="item in paged"
|
|
2991
|
-
:key="item.id"
|
|
2992
|
-
class="djm-media-item"
|
|
2993
|
-
:class="{
|
|
2994
|
-
'djm-is-checked': isChecked(item.id),
|
|
2995
|
-
'djm-is-disabled': multiple && atLimit() && !isChecked(item.id)
|
|
2996
|
-
}"
|
|
2997
|
-
role="option"
|
|
2998
|
-
tabindex="0"
|
|
2999
|
-
:aria-selected="String(isChecked(item.id))"
|
|
3000
|
-
@click="toggle(item)"
|
|
3001
|
-
@keydown.enter.prevent="toggle(item)"
|
|
3002
|
-
@keydown.space.prevent="toggle(item)"
|
|
3003
|
-
>
|
|
3004
|
-
<div class="djm-media-thumb">
|
|
3005
|
-
<img v-if="isImage(item)" :src="item.url" :alt="item.name" loading="lazy" />
|
|
3006
|
-
<DjmIcon v-else name="folder" :size="26" />
|
|
3007
|
-
<span v-if="isChecked(item.id)" class="djm-media-check">
|
|
3008
|
-
<DjmIcon name="check" :size="11" />
|
|
3009
|
-
</span>
|
|
3010
|
-
</div>
|
|
3011
|
-
<div class="djm-media-name" :title="item.name">{{ item.name }}</div>
|
|
3012
|
-
</div>
|
|
3013
|
-
<div v-if="!paged.length" class="djm-media-empty">{{ t('mediaPicker.empty') }}</div>
|
|
3014
|
-
</div>
|
|
3015
|
-
|
|
3016
|
-
<div class="djm-media-foot">
|
|
3017
|
-
<span class="djm-media-total">
|
|
3018
|
-
{{ t('mediaPicker.total', { total: filtered.length }) }}
|
|
3019
|
-
<em v-if="multiple && limit > 0">{{ t('mediaPicker.limit', { limit }) }}</em>
|
|
3020
|
-
</span>
|
|
3021
|
-
<DjmPagination
|
|
3022
|
-
v-if="filtered.length > pageSize"
|
|
3023
|
-
v-model:page="page"
|
|
3024
|
-
:page-size="pageSize"
|
|
3025
|
-
:total="filtered.length"
|
|
3026
|
-
/>
|
|
3027
|
-
</div>
|
|
3028
|
-
|
|
3029
|
-
<template #footer>
|
|
3030
|
-
<button class="djm-btn" type="button" @click="cancel">{{ t('common.cancel') }}</button>
|
|
3031
|
-
<button class="djm-btn djm-btn-primary" type="button" @click="commit">{{ t('common.confirm') }}</button>
|
|
3032
|
-
</template>
|
|
3033
|
-
</DjmModal>
|
|
3034
|
-
</span>
|
|
3035
|
-
`};import{ref as ca,watch as qr}from"vue";function vi(e){return(e||[]).map(t=>({...t,cards:(t.cards||[]).slice()}))}var gi={name:"DjmKanban",components:{DjmIcon:L,DjmAvatar:me},props:{columns:{type:Array,default:()=>[]},draggable:{type:Boolean,default:!0},showAddCard:{type:Boolean,default:!0},addCardText:{type:String,default:""}},emits:["update:columns","change","card-move","card-click","card-add"],setup(e,{emit:t}){let a=ca(vi(e.columns));qr(()=>e.columns,j=>{a.value=vi(j)});let n=ca(null),i=ca(null);function l(j){return a.value.find(w=>w.key===j)}function o(j,w,y){e.draggable&&(n.value={card:j,fromKey:w},y.dataTransfer&&(y.dataTransfer.effectAllowed="move",y.dataTransfer.setData("text/plain",String(j.id))))}function r(j,w,y){n.value&&(y.preventDefault(),y.stopPropagation(),y.dataTransfer&&(y.dataTransfer.dropEffect="move"),i.value={columnKey:j,index:w})}function s(j,w){if(!n.value)return;w.preventDefault(),w.dataTransfer&&(w.dataTransfer.dropEffect="move");let y=l(j);i.value={columnKey:j,index:y?y.cards.length:0}}function d(j){if(!n.value||!i.value)return;j.preventDefault();let{card:w,fromKey:y}=n.value,{columnKey:u,index:v}=i.value,T=l(y),D=l(u);if(!T||!D){f();return}let x=T.cards.findIndex(M=>M===w||M.id===w.id);if(x===-1){f();return}let z=v;y===u&&x<v&&(z=v-1),T.cards.splice(x,1),D.cards.splice(z,0,w);let S=a.value.slice();t("update:columns",S),t("change",S),t("card-move",{card:w,fromKey:y,toKey:u,toIndex:z}),f()}function f(){n.value=null,i.value=null}function c(j,w){let y=i.value;return!!(y&&y.columnKey===j&&y.index===w)}function p(j){let w=i.value;return!!(w&&w.columnKey===j.key&&w.index===j.cards.length)}function g(j){return!!(n.value&&n.value.card===j)}function m(j){return j.wipLimit>0&&j.cards.length>j.wipLimit}function h(j,w){t("card-click",j,w)}function b(j){t("card-add",j)}return{inner:a,dragCard:n,dropTarget:i,onDragStart:o,onCardDragOver:r,onColumnDragOver:s,onDrop:d,resetDrag:f,isDropBefore:c,isDropEnd:p,isDragging:g,wipOver:m,onCardClick:h,onCardAdd:b,t:C}},template:`
|
|
3181
|
+
`};import{ref as va,watch as os}from"vue";function Sn(e){return(e||[]).map(t=>({...t,cards:(t.cards||[]).slice()}))}var Dn={name:"DjmKanban",components:{DjmIcon:P,DjmAvatar:he},props:{columns:{type:Array,default:()=>[]},draggable:{type:Boolean,default:!0},showAddCard:{type:Boolean,default:!0},addCardText:{type:String,default:""}},emits:["update:columns","change","card-move","card-click","card-add"],setup(e,{emit:t}){let a=va(Sn(e.columns));os(()=>e.columns,j=>{a.value=Sn(j)});let i=va(null),n=va(null);function l(j){return a.value.find(w=>w.key===j)}function r(j,w,b){e.draggable&&(i.value={card:j,fromKey:w},b.dataTransfer&&(b.dataTransfer.effectAllowed="move",b.dataTransfer.setData("text/plain",String(j.id))))}function o(j,w,b){i.value&&(b.preventDefault(),b.stopPropagation(),b.dataTransfer&&(b.dataTransfer.dropEffect="move"),n.value={columnKey:j,index:w})}function s(j,w){if(!i.value)return;w.preventDefault(),w.dataTransfer&&(w.dataTransfer.dropEffect="move");let b=l(j);n.value={columnKey:j,index:b?b.cards.length:0}}function d(j){if(!i.value||!n.value)return;j.preventDefault();let{card:w,fromKey:b}=i.value,{columnKey:m,index:f}=n.value,E=l(b),D=l(m);if(!E||!D){p();return}let k=E.cards.findIndex(T=>T===w||T.id===w.id);if(k===-1){p();return}let B=f;b===m&&k<f&&(B=f-1),E.cards.splice(k,1),D.cards.splice(B,0,w);let S=a.value.slice();t("update:columns",S),t("change",S),t("card-move",{card:w,fromKey:b,toKey:m,toIndex:B}),p()}function p(){i.value=null,n.value=null}function c(j,w){let b=n.value;return!!(b&&b.columnKey===j&&b.index===w)}function h(j){let w=n.value;return!!(w&&w.columnKey===j.key&&w.index===j.cards.length)}function v(j){return!!(i.value&&i.value.card===j)}function u(j){return j.wipLimit>0&&j.cards.length>j.wipLimit}function g(j,w){t("card-click",j,w)}function y(j){t("card-add",j)}return{inner:a,dragCard:i,dropTarget:n,onDragStart:r,onCardDragOver:o,onColumnDragOver:s,onDrop:d,resetDrag:p,isDropBefore:c,isDropEnd:h,isDragging:v,wipOver:u,onCardClick:g,onCardAdd:y,t:C}},template:`
|
|
3036
3182
|
<div class="djm-kanban" role="list" :aria-label="t('kanban.board')">
|
|
3037
3183
|
<section
|
|
3038
3184
|
v-for="column in inner"
|
|
@@ -3097,7 +3243,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3097
3243
|
</footer>
|
|
3098
3244
|
</section>
|
|
3099
3245
|
</div>
|
|
3100
|
-
`};import{computed as
|
|
3246
|
+
`};import{computed as En}from"vue";var rs=["png","jpg","jpeg","gif","webp","bmp","svg"];function ss(e){if(e.ext)return String(e.ext).toLowerCase();let t=e.name||"",a=t.lastIndexOf(".");return a===-1?"":t.slice(a+1).toLowerCase()}var Mn={name:"DjmAttachmentList",components:{DjmIcon:P},props:{files:{type:Array,default:()=>[]},mode:{type:String,default:"list"},removable:{type:Boolean,default:!0},downloadable:{type:Boolean,default:!0},previewable:{type:Boolean,default:!0},autoDownload:{type:Boolean,default:!0},emptyText:{type:String,default:""}},emits:["preview","download","remove"],setup(e,{emit:t}){let a=En(()=>e.files.map((o,s)=>{let d=ss(o),p=o.type==="image"||rs.includes(d);return{...o,_key:o.uid!==void 0?o.uid:s,_ext:d,_isImage:p}})),i=En(()=>e.emptyText||C("attachment.empty"));function n(o){t("preview",o)}function l(o){if(t("download",o),e.autoDownload&&o.url){let s=document.createElement("a");s.href=o.url,s.download=o.name||"",s.rel="noopener",document.body.appendChild(s),s.click(),s.remove()}}function r(o){t("remove",o)}return{list:a,emptyLabel:i,onPreview:n,onDownload:l,onRemove:r,formatFileSize:Qe,t:C}},template:`
|
|
3101
3247
|
<div class="djm-attachment" :class="'djm-attachment-' + mode">
|
|
3102
3248
|
<p v-if="!list.length" class="djm-attachment-empty">{{ emptyLabel }}</p>
|
|
3103
3249
|
|
|
@@ -3170,7 +3316,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3170
3316
|
</figure>
|
|
3171
3317
|
</div>
|
|
3172
3318
|
</div>
|
|
3173
|
-
`};import{computed as
|
|
3319
|
+
`};import{computed as Cn,onBeforeUnmount as ds,ref as cs}from"vue";var Tn={info:{icon:"info",cls:"djm-is-info"},success:{icon:"check",cls:"djm-is-success"},warning:{icon:"alert",cls:"djm-is-warning"},error:{icon:"alert",cls:"djm-is-error"}},In={name:"DjmNotification",components:{DjmIcon:P,DjmAvatar:he},props:{items:{type:Array,default:()=>[]},showToolbar:{type:Boolean,default:!0},removable:{type:Boolean,default:!0},emptyText:{type:String,default:""}},emits:["click","read","read-all","remove","clear"],setup(e,{emit:t}){let a=Cn(()=>e.items.filter(c=>!c.read).length),i=Cn(()=>e.emptyText||C("notification.empty"));function n(c){return Tn[c.type]||Tn.info}function l(c){t("click",c),c.read||t("read",c)}function r(){t("read-all")}let o=cs(!1),s=null;function d(){if(!o.value){o.value=!0,s=window.setTimeout(()=>{o.value=!1},3e3);return}window.clearTimeout(s),o.value=!1,t("clear")}ds(()=>window.clearTimeout(s));function p(c){t("remove",c)}return{unreadCount:a,emptyLabel:i,clearing:o,typeOf:n,onClick:l,onReadAll:r,onClear:d,onRemove:p,t:C}},template:`
|
|
3174
3320
|
<div class="djm-notification">
|
|
3175
3321
|
<header v-if="showToolbar" class="djm-notification-bar">
|
|
3176
3322
|
<span class="djm-notification-count">
|
|
@@ -3225,11 +3371,11 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3225
3371
|
</li>
|
|
3226
3372
|
</ul>
|
|
3227
3373
|
</div>
|
|
3228
|
-
`};import{watch as
|
|
3374
|
+
`};import{watch as us}from"vue";var ms={xs:"24px",sm:"28px",md:"30px",lg:"34px"},Ln={name:"DjmConfigProvider",props:{locale:{type:String,default:""},size:{type:String,default:""}},setup(e){return e.locale&&Ke(e.locale),us(()=>e.locale,t=>{t&&Ke(t)}),{providerStyle(){let t=ms[e.size];return t?{"--djm-control-h":t}:{}}}},template:`
|
|
3229
3375
|
<div class="djm-config-provider" :style="providerStyle()">
|
|
3230
3376
|
<slot></slot>
|
|
3231
3377
|
</div>
|
|
3232
|
-
`};import{ref as
|
|
3378
|
+
`};import{ref as Oe,computed as we,watch as fs,onBeforeUnmount as ps}from"vue";var hs=0,Be=e=>String(e).padStart(2,"0");function Ht(e,t,a){return`${e}-${Be(t+1)}-${Be(a)}`}function An(e){if(!e)return{date:"",time:""};let[t="",a=""]=String(e).split(" ");return{date:t,time:a}}function Ot(e){let t=String(e||"").split("-").map(Number);return t.length!==3||t.some(a=>!Number.isFinite(a))?null:{year:t[0],month:t[1]-1,day:t[2]}}var zn={name:"DjmDateTimePicker",components:{DjmIcon:P},props:{modelValue:{type:String,default:""},format:{type:String,default:"YYYY-MM-DD HH:mm"},placeholder:{type:String,default:""},min:{type:String,default:""},max:{type:String,default:""},minuteStep:{type:Number,default:1},clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},disabledDate:{type:Function,default:null}},emits:["update:modelValue","change","visible-change"],setup(e,{emit:t}){let a=Oe(!1);fs(a,z=>t("visible-change",z));let i=Oe(null),n=Oe(null),l="djm-datetime-panel-"+ ++hs,r=Oe({...le}),o=null,s=new Date,d=Ht(s.getFullYear(),s.getMonth(),s.getDate()),p=we(()=>e.format.indexOf("ss")>-1),c=Oe({date:"",h:"00",m:"00",s:"00"}),h=Ot(An(e.modelValue).date),v=Oe(h?h.year:s.getFullYear()),u=Oe(h?h.month:s.getMonth()),g=we(()=>e.modelValue||""),y=we(()=>e.placeholder||C("dateTimePicker.placeholder")),j=we(()=>C("datePicker.weeks").split(",")),w=we(()=>Array.from({length:24},(z,K)=>Be(K))),b=we(()=>{let z=[];for(let K=0;K<60;K+=Math.max(1,e.minuteStep))z.push(Be(K));return z}),m=we(()=>Array.from({length:60},(z,K)=>Be(K))),f=we(()=>{let z=[{key:"h",list:w.value},{key:"m",list:b.value}];return p.value&&z.push({key:"s",list:m.value}),z}),E=we(()=>C("datePicker.title",{year:v.value,month:u.value+1})),D=we(()=>{let K=(new Date(v.value,u.value,1).getDay()+6)%7,_=new Date(v.value,u.value,1-K);return Array.from({length:42},(se,x)=>{let I=new Date(_.getFullYear(),_.getMonth(),_.getDate()+x),N=Ht(I.getFullYear(),I.getMonth(),I.getDate());return{key:N,day:I.getDate(),outside:I.getMonth()!==u.value,today:N===d,selected:N===c.value.date,disabled:k(N)}})});function k(z){return e.min&&z<e.min.slice(0,10)||e.max&&z>e.max.slice(0,10)?!0:typeof e.disabledDate=="function"?!!e.disabledDate(z):!1}function B(){let{date:z,time:K}=An(e.modelValue),_=S(z||d),[se="00",x="00",I="00"]=(K||"00:00:00").split(":");c.value={date:_,h:se,m:x,s:I};let N=Ot(_);N&&(v.value=N.year,u.value=N.month)}function S(z){if(!k(z))return z;for(let K=1;K<=366;K++){let _=T(z,K);if(!k(_))return _}return z}function T(z,K){let _=Ot(z);if(!_)return z;let se=new Date(_.year,_.month,_.day+K);return Ht(se.getFullYear(),se.getMonth(),se.getDate())}function L(){e.disabled||(B(),a.value=!0,o=ae({root:()=>i.value,panel:()=>n.value,onClose:O,onReposition:A}),requestAnimationFrame(A))}function A(){if(!a.value||!i.value)return;let z=i.value.getBoundingClientRect(),K=n.value?n.value.offsetHeight:360,_=n.value?n.value.offsetWidth:480;r.value=me({rect:z,flip:ue(z,K),clampWidth:_})}function O(){a.value&&(a.value=!1,r.value={...le},o&&(o(),o=null))}function $(){a.value?O():L()}function X(){u.value===0?(u.value=11,v.value-=1):u.value-=1}function ee(){u.value===11?(u.value=0,v.value+=1):u.value+=1}function H(z){z.disabled||(c.value={...c.value,date:z.key})}function U(z,K){c.value={...c.value,[z]:K}}function Y(){let z=p.value?`${c.value.h}:${c.value.m}:${c.value.s}`:`${c.value.h}:${c.value.m}`;return`${c.value.date} ${z}`}function ne(){if(k(c.value.date))return;let z=Y();t("update:modelValue",z),t("change",z),O()}function te(){let z=new Date,K=Ht(z.getFullYear(),z.getMonth(),z.getDate());if(k(K))return;c.value={date:K,h:Be(z.getHours()),m:Be(z.getMinutes()),s:Be(z.getSeconds())};let _=Ot(c.value.date);v.value=_.year,u.value=_.month}function re(){t("update:modelValue",""),t("change",""),O()}return ps(()=>{o&&(o(),o=null)}),{open:a,root:i,panel:n,panelId:l,panelStyle:r,draft:c,hasSeconds:p,displayText:g,placeholderText:y,weeks:j,monthLabel:E,cells:D,timeCols:f,toggle:$,closePanel:O,prevMonth:X,nextMonth:ee,pickDate:H,pickTime:U,confirm:ne,pickNow:te,clear:re,t:C}},template:`
|
|
3233
3379
|
<div class="djm-datetime" ref="root">
|
|
3234
3380
|
<div
|
|
3235
3381
|
class="djm-input djm-datetime-trigger"
|
|
@@ -3318,7 +3464,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3318
3464
|
</div>
|
|
3319
3465
|
</Teleport>
|
|
3320
3466
|
</div>
|
|
3321
|
-
`};import{ref as
|
|
3467
|
+
`};import{ref as ga,computed as $t,watch as vs,onMounted as gs,onBeforeUnmount as bs}from"vue";var Pn={name:"DjmVirtualList",props:{items:{type:Array,default:()=>[]},itemHeight:{type:[Number,Function],default:40},height:{type:[Number,String],default:320},overscan:{type:Number,default:4},bottomThreshold:{type:Number,default:40},keyField:{type:String,default:"id"}},emits:["scroll","reach-bottom","item-click"],setup(e,{emit:t,expose:a}){let i=ga(null),n=ga(0),l=ga(typeof e.height=="number"?e.height:320),r=!1;function o(w,b){return typeof e.itemHeight=="function"?Math.max(1,Number(e.itemHeight(w,b))||1):Math.max(1,e.itemHeight)}let s=$t(()=>{let w=[0],b=0;return e.items.forEach((m,f)=>{b+=o(m,f),w.push(b)}),w}),d=$t(()=>s.value[s.value.length-1]);function p(w){let b=s.value,m=0,f=b.length-1;for(;m<f;){let E=m+f>>1;b[E]<w?m=E+1:f=E}return Math.max(0,m-1)}let c=$t(()=>{let w=e.items.length;if(!w)return{start:0,end:0};let b=Math.max(0,p(n.value)-e.overscan),m=b,f=n.value+l.value+e.overscan*40;for(;m<w&&s.value[m]<f;)m+=1;return{start:b,end:Math.min(w,m+e.overscan)}}),h=$t(()=>{let{start:w,end:b}=c.value;return e.items.slice(w,b).map((m,f)=>{let E=w+f;return{item:m,index:E,key:m&&m[e.keyField]!==void 0?m[e.keyField]:E,top:s.value[E],height:o(m,E)}})});function v(w){let b=w.target;n.value=b.scrollTop,t("scroll",{scrollTop:b.scrollTop});let m=b.scrollTop+b.clientHeight>=d.value-e.bottomThreshold;m&&!r?(r=!0,t("reach-bottom")):m||(r=!1)}function u(w,b="auto"){let m=i.value;if(!m)return;let f=s.value[Math.max(0,Math.min(w,e.items.length-1))],E=s.value[Math.min(w+1,e.items.length)];b==="top"?m.scrollTop=f:b==="bottom"?m.scrollTop=E-m.clientHeight:f<m.scrollTop?m.scrollTop=f:E>m.scrollTop+m.clientHeight&&(m.scrollTop=E-m.clientHeight)}vs(()=>e.height,()=>{i.value&&(l.value=i.value.clientHeight)});function g(){i.value&&(l.value=i.value.clientHeight)}let y=null;gs(()=>{g(),window.ResizeObserver&&i.value&&(y=new ResizeObserver(()=>g()),y.observe(i.value))}),bs(()=>{y&&y.disconnect()});function j(w){t("item-click",w.item,w.index)}return a({scrollToIndex:u,measure:g}),{viewport:i,totalHeight:d,visibleRows:h,onScroll:v,onItemClick:j,scrollToIndex:u,measure:g,t:C}},template:`
|
|
3322
3468
|
<div
|
|
3323
3469
|
class="djm-vlist"
|
|
3324
3470
|
ref="viewport"
|
|
@@ -3341,7 +3487,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3341
3487
|
<slot name="empty">{{ t('virtualList.empty') }}</slot>
|
|
3342
3488
|
</div>
|
|
3343
3489
|
</div>
|
|
3344
|
-
`};import{computed as
|
|
3490
|
+
`};import{computed as Bn}from"vue";var Nn={name:"DjmBatchBar",props:{count:{type:Number,default:0},total:{type:Number,default:0},label:{type:String,default:""},clearable:{type:Boolean,default:!0},fixed:{type:Boolean,default:!1}},emits:["clear","select-all"],setup(e,{emit:t}){let a=Bn(()=>e.label||C("batchBar.selected",{count:e.count})),i=Bn(()=>e.total>e.count);return{text:a,canSelectAll:i,onClear:()=>t("clear"),onSelectAll:()=>t("select-all"),t:C}},template:`
|
|
3345
3491
|
<div v-if="count > 0" class="djm-batch-bar" :class="{ 'djm-is-fixed': fixed }" role="region" :aria-label="text">
|
|
3346
3492
|
<span class="djm-batch-info">
|
|
3347
3493
|
<strong class="djm-batch-count">{{ text }}</strong>
|
|
@@ -3356,7 +3502,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3356
3502
|
{{ t('batchBar.clear') }}
|
|
3357
3503
|
</button>
|
|
3358
3504
|
</div>
|
|
3359
|
-
`};import{ref as
|
|
3505
|
+
`};import{ref as et,computed as ba,watch as ya}from"vue";function ys(e,t){if(!t)return!0;let a="."+String(e).split(".").pop().toLowerCase();return t.split(",").map(i=>i.trim().toLowerCase()).some(i=>i===a||i==="*")}var Rn={name:"DjmImportWizard",components:{DjmIcon:P},props:{step:{type:Number,default:1},accept:{type:String,default:".csv,.xlsx,.xls"},maxSize:{type:Number,default:10},columns:{type:Array,default:()=>[]},fields:{type:Array,default:()=>[]},mapping:{type:Object,default:()=>({})},result:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1}},emits:["update:step","update:mapping","file-change","submit","retry"],setup(e,{emit:t}){let a=et(e.step||1);ya(()=>e.step,f=>{f&&(a.value=f)});let i=et(null),n=et(""),l=et(""),r=et(null),o=et({...e.mapping});ya(()=>e.mapping,f=>{o.value={...f}},{deep:!0});function s(f){a.value=f,t("update:step",f)}let d=ba(()=>[{index:1,title:C("importWizard.stepFile")},{index:2,title:C("importWizard.stepMapping")},{index:3,title:C("importWizard.stepResult")}]);function p(){r.value&&r.value.click()}function c(f){return f?ys(f.name,e.accept)?e.maxSize>0&&f.size>e.maxSize*1024*1024?(n.value=C("importWizard.sizeError",{size:e.maxSize}),!1):(n.value="",!0):(n.value=C("importWizard.acceptError",{accept:e.accept}),!1):!1}function h(f){c(f)&&(i.value=f,t("file-change",f),s(2))}function v(f){h(f.target.files&&f.target.files[0]),f.target.value=""}function u(f){let E=f.dataTransfer&&f.dataTransfer.files&&f.dataTransfer.files[0];h(E)}function g(f,E){let D={...o.value,[f]:E};E||delete D[f],o.value=D,l.value="",t("update:mapping",D)}let y=ba(()=>e.columns.filter(f=>f.required&&!o.value[f.key]));function j(){if(y.value.length){l.value=C("importWizard.missingRequired",{fields:y.value.map(f=>f.label||f.key).join("\u3001")});return}t("submit",{...o.value})}ya(()=>e.result,f=>{f&&(f.total||f.success||f.failed||f.errors&&f.errors.length)&&s(3)});function w(){i.value=null,n.value="",l.value="",o.value={},t("update:mapping",{}),r.value&&(r.value.value=""),s(1)}function b(){t("retry"),s(2)}let m=ba(()=>{let f=e.result||{};return{total:f.total||0,success:f.success||0,failed:f.failed||0,errors:f.errors||[]}});return{innerStep:a,steps:d,file:i,fileError:n,mappingError:l,fileInput:r,innerMapping:o,missingRequired:y,stats:m,pickFile:p,onFileChange:v,onDrop:u,setMapping:g,submit:j,reset:w,retry:b,goStep:s,formatFileSize:Qe,t:C}},template:`
|
|
3360
3506
|
<div class="djm-import-wizard">
|
|
3361
3507
|
<ol class="djm-import-steps">
|
|
3362
3508
|
<li
|
|
@@ -3467,9 +3613,9 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3467
3613
|
</div>
|
|
3468
3614
|
</div>
|
|
3469
3615
|
</div>
|
|
3470
|
-
`};import{ref as
|
|
3471
|
-
`):[],
|
|
3472
|
-
`):[],
|
|
3616
|
+
`};import{ref as ws,computed as tt}from"vue";function Vn(e,t){let a=e?String(e).split(`
|
|
3617
|
+
`):[],i=t?String(t).split(`
|
|
3618
|
+
`):[],n=[],l=0,r=0;if(a.length*i.length>1e6)return a.forEach(v=>n.push({type:"remove",text:v,oldLine:++l,newLine:0})),i.forEach(v=>n.push({type:"add",text:v,oldLine:0,newLine:++r})),n;let o=a.length,s=i.length,d=s+1,p=new Int32Array((o+1)*d);for(let v=o-1;v>=0;v--)for(let u=s-1;u>=0;u--)p[v*d+u]=a[v]===i[u]?p[(v+1)*d+u+1]+1:Math.max(p[(v+1)*d+u],p[v*d+u+1]);let c=0,h=0;for(;c<o&&h<s;)a[c]===i[h]?(n.push({type:"equal",text:a[c],oldLine:++l,newLine:++r}),c+=1,h+=1):p[(c+1)*d+h]>=p[c*d+h+1]?(n.push({type:"remove",text:a[c],oldLine:++l,newLine:0}),c+=1):(n.push({type:"add",text:i[h],oldLine:0,newLine:++r}),h+=1);for(;c<o;)n.push({type:"remove",text:a[c],oldLine:++l,newLine:0}),c+=1;for(;h<s;)n.push({type:"add",text:i[h],oldLine:0,newLine:++r}),h+=1;return n}var Hn={name:"DjmDiff",props:{before:{type:String,default:""},after:{type:String,default:""},mode:{type:String,default:"unified"},context:{type:Number,default:3},showLineNumbers:{type:Boolean,default:!0},beforeLabel:{type:String,default:""},afterLabel:{type:String,default:""}},setup(e){let t=tt(()=>Vn(e.before,e.after)),a=tt(()=>{let d=0,p=0;return t.value.forEach(c=>{c.type==="add"&&(d+=1),c.type==="remove"&&(p+=1)}),{add:d,remove:p}}),i=ws([]);function n(d){i.value=i.value.concat(d)}let l=tt(()=>{let d=Math.max(0,e.context),p=t.value;if(!d)return p;let c=[],h=0;for(;h<p.length;){if(p[h].type!=="equal"){c.push(p[h]),h+=1;continue}let v=h;for(;v<p.length&&p[v].type==="equal";)v+=1;let u=p.slice(h,v),g=h===0,y=v===p.length,j=g?0:d,w=y?0:d,b=j+w;u.length<=b+1||i.value.indexOf(h)>-1?c.push(...u):(j&&c.push(...u.slice(0,j)),c.push({type:"skip",count:u.length-b,blockIndex:h}),w&&c.push(...u.slice(u.length-w))),h=v}return c}),r=tt(()=>{let d=l.value,p=[],c=0;for(;c<d.length;){let h=d[c];if(h.type==="equal"||h.type==="skip"){p.push({left:h,right:h}),c+=1;continue}let v=[],u=[];for(;c<d.length&&(d[c].type==="remove"||d[c].type==="add");)d[c].type==="remove"?v.push(d[c]):u.push(d[c]),c+=1;let g=Math.max(v.length,u.length);for(let y=0;y<g;y++)p.push({left:v[y]||null,right:u[y]||null})}return p}),o=tt(()=>e.beforeLabel||C("diff.before")),s=tt(()=>e.afterLabel||C("diff.after"));return{stats:a,displayRows:l,splitRows:r,expand:n,beforeLabelText:o,afterLabelText:s,t:C}},template:`
|
|
3473
3619
|
<div class="djm-diff" :class="'djm-diff-' + mode">
|
|
3474
3620
|
<header class="djm-diff-bar">
|
|
3475
3621
|
<span class="djm-diff-stat djm-is-add">+{{ stats.add }}</span>
|
|
@@ -3520,7 +3666,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3520
3666
|
</div>
|
|
3521
3667
|
</div>
|
|
3522
3668
|
</div>
|
|
3523
|
-
`};import{ref as
|
|
3669
|
+
`};import{ref as On,computed as Ce,watch as $n}from"vue";function je(e,t){return e&&e[t]!==void 0?e[t]:e&&e.id}var Fn={name:"DjmTreeTable",components:{DjmIcon:P},props:{data:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},rowKey:{type:String,default:"id"},expandedKeys:{type:Array,default:null},defaultExpandAll:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},checkedKeys:{type:Array,default:null},checkStrictly:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},maxHeight:{type:[Number,String],default:""},striped:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyText:{type:String,default:""}},emits:["update:expandedKeys","update:checkedKeys","expand-change","check-change","row-click"],setup(e,{emit:t}){function a(S,T,L=1,A=null){(S||[]).forEach(O=>{T(O,L,A),O.children&&O.children.length&&a(O.children,T,L+1,je(O,e.rowKey))})}function i(){let S=[];return a(e.data,T=>S.push(je(T,e.rowKey))),S}let n=On(e.expandedKeys?e.expandedKeys.slice():e.defaultExpandAll?i():[]);$n(()=>e.expandedKeys,S=>{S&&(n.value=S.slice())});let l=On(e.checkedKeys?e.checkedKeys.slice():[]);$n(()=>e.checkedKeys,S=>{S&&(l.value=S.slice())});let r=Ce(()=>{let S=[];function T(L,A,O){(L||[]).forEach($=>{let X=je($,e.rowKey),ee=!!($.children&&$.children.length),H=n.value.indexOf(X)>-1;S.push({row:$,key:X,level:A,parentKey:O,hasChildren:ee,expanded:H}),ee&&H&&T($.children,A+1,X)})}return T(e.data,1,null),S}),o=Ce(()=>{let S={};function T(L){let A=je(L,e.rowKey),O=[];return(L.children||[]).forEach($=>{O.push(je($,e.rowKey),...T($))}),S[A]=O,O}return(e.data||[]).forEach(T),S}),s=Ce(()=>{let S=[];return a(e.data,T=>{(!T.children||!T.children.length)&&S.push(je(T,e.rowKey))}),S}),d=Ce(()=>new Set(l.value)),p=Ce(()=>s.value.length>0&&s.value.every(S=>d.value.has(S))),c=Ce(()=>!p.value&&s.value.some(S=>d.value.has(S)));function h(S){if(!e.selectable||e.checkStrictly)return!1;let T=o.value[je(S,e.rowKey)]||[];if(!T.length)return!1;let L=T.filter(A=>d.value.has(A)).length;return L>0&&L<T.length}function v(S){l.value=S,t("update:checkedKeys",S),t("check-change",S)}function u(S){let T=je(S,e.rowKey),L=!d.value.has(T),A=new Set(l.value);if(e.checkStrictly)L?A.add(T):A.delete(T);else{[T,...o.value[T]||[]].forEach(X=>L?A.add(X):A.delete(X));let $=y(T);for(;$!=null;){let X=j($);X.length>0&&X.every(H=>A.has(H))?A.add($):A.delete($),$=y($)}}v(Array.from(A))}let g=Ce(()=>{let S={};return a(e.data,(T,L,A)=>{S[je(T,e.rowKey)]={row:T,parentKey:A}}),S});function y(S){let T=g.value[S];return T?T.parentKey:null}function j(S){let T=g.value[S];return T?(T.row.children||[]).map(L=>je(L,e.rowKey)):[]}function w(){v(p.value||c.value?[]:s.value.slice())}function b(S){let T=S.key,L=n.value.indexOf(T),A=n.value.slice();L>-1?A.splice(L,1):A.push(T),n.value=A,t("update:expandedKeys",A),t("expand-change",T,L===-1)}function m(){let S=i();n.value=S,t("update:expandedKeys",S),t("expand-change",null,!0)}function f(){n.value=[],t("update:expandedKeys",[]),t("expand-change",null,!1)}function E(S,T){let L=S[T.key];return L??""}function D(S){t("row-click",S.row,S)}let k=Ce(()=>e.maxHeight?{maxHeight:typeof e.maxHeight=="number"?e.maxHeight+"px":e.maxHeight}:null),B=Ce(()=>e.emptyText||C("treeTable.empty"));return{rows:r,innerExpanded:n,checkedSet:d,allChecked:p,someChecked:c,isIndeterminate:h,toggleRowCheck:u,toggleAll:w,toggleExpand:b,expandAll:m,collapseAll:f,valueOf:E,onRowClick:D,scrollStyle:k,emptyLabel:B,t:C}},template:`
|
|
3524
3670
|
<div class="djm-tree-table">
|
|
3525
3671
|
<div
|
|
3526
3672
|
class="djm-tree-table-wrap"
|
|
@@ -3598,7 +3744,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3598
3744
|
<p v-else-if="!rows.length" class="djm-tree-table-empty">{{ emptyLabel }}</p>
|
|
3599
3745
|
</div>
|
|
3600
3746
|
</div>
|
|
3601
|
-
`};import{ref as
|
|
3747
|
+
`};import{ref as Kn,computed as Te,watch as js,onBeforeUnmount as xs}from"vue";var Ft=e=>String(e).padStart(2,"0");function wa(e){return`${e.getFullYear()}-${Ft(e.getMonth()+1)}-${Ft(e.getDate())}`}function ks(e){let t=String(e||"").split("-").map(Number);return t.length!==3||t.some(a=>!Number.isFinite(a))?null:new Date(t[0],t[1]-1,t[2])}function Wn(e,t){let a=String(e||"").split(":").map(Number);return a.length!==2||a.some(i=>!Number.isFinite(i))?t:a[0]*60+a[1]}var Un={name:"DjmSchedule",components:{DjmIcon:P},props:{modelValue:{type:String,default:""},items:{type:Array,default:()=>[]},startHour:{type:Number,default:8},endHour:{type:Number,default:20},hourHeight:{type:Number,default:48},showWeekend:{type:Boolean,default:!0},title:{type:String,default:""}},emits:["update:modelValue","event-click","slot-click","week-change"],setup(e,{emit:t}){let a=wa(new Date),i=Kn(new Date().getHours()*60+new Date().getMinutes()),n=window.setInterval(()=>{let f=new Date;i.value=f.getHours()*60+f.getMinutes()},6e4),l=Kn(e.modelValue||a);js(()=>e.modelValue,f=>{f&&(l.value=f)});function r(f){let E=ks(f)||new Date,k=(E.getDay()+6)%7;return new Date(E.getFullYear(),E.getMonth(),E.getDate()-k)}let o=Te(()=>r(l.value)),s=Te(()=>C("schedule.weekdays").split(","));function d(f){let E=f.map(T=>{let L=Wn(T.start,e.startHour*60),A=Math.max(L+30,Wn(T.end,L+60));return{item:T,startMin:L,endMin:A}}).sort((T,L)=>T.startMin-L.startMin),D=[],k=E.map(T=>{let L=D.findIndex(A=>A<=T.startMin);return L===-1?(D.push(T.endMin),L=D.length-1):D[L]=T.endMin,{...T,lane:L}}),B=Math.max(1,D.length),S=e.startHour*60;return k.map(T=>{let L=(T.startMin-S)/60*e.hourHeight,A=(T.endMin-T.startMin)/60*e.hourHeight;return{key:T.item.id!==void 0?T.item.id:T.item.title+T.startMin,item:T.item,top:Math.max(0,L),height:Math.max(18,A-2),left:T.lane*100/B,width:100/B}})}let p=Te(()=>{let f=o.value,E=Array.from({length:7},(D,k)=>{let B=new Date(f.getFullYear(),f.getMonth(),f.getDate()+k),S=wa(B);return{key:S,date:B,day:B.getDate(),month:B.getMonth()+1,weekday:s.value[k]||"",today:S===a,weekend:k>=5,blocks:d(e.items.filter(T=>T.date===S))}});return e.showWeekend?E:E.slice(0,5)}),c=Te(()=>{let f=[];for(let E=e.startHour;E<e.endHour;E++)f.push(E);return f}),h=Te(()=>(e.endHour-e.startHour)*e.hourHeight),v=Te(()=>({gridTemplateColumns:"56px repeat("+Math.max(1,p.value.length)+", minmax(0, 1fr))"})),u=Te(()=>(i.value-e.startHour*60)/60*e.hourHeight),g=Te(()=>i.value>=e.startHour*60&&i.value<=e.endHour*60&&p.value.some(f=>f.today)),y=Te(()=>{let f=p.value;if(!f.length)return"";let E=f[0],D=f[f.length-1];return`${E.month}\u6708${E.day}\u65E5 - ${D.month}\u6708${D.day}\u65E5`});function j(f){let E=o.value,D=new Date(E.getFullYear(),E.getMonth(),E.getDate()+f*7);l.value=wa(D),t("update:modelValue",l.value),t("week-change",l.value)}function w(){l.value=a,t("update:modelValue",a),t("week-change",a)}function b(f,E){t("event-click",f.item,E.key)}function m(f,E){let D=f.currentTarget.getBoundingClientRect(),k=(f.clientY-D.top)/D.height,B=e.startHour*60+Math.round(k*(e.endHour-e.startHour)*60/30)*30,S=Math.floor(B/60),T=B%60;t("slot-click",{date:E.key,time:`${Ft(S)}:${Ft(T)}`})}return xs(()=>window.clearInterval(n)),{days:p,hours:c,bodyHeight:h,gridStyle:v,nowTop:u,showNowLine:g,rangeLabel:y,shiftWeek:j,goToday:w,onBlockClick:b,onSlotClick:m,t:C}},template:`
|
|
3602
3748
|
<div class="djm-schedule">
|
|
3603
3749
|
<header class="djm-schedule-bar">
|
|
3604
3750
|
<span class="djm-schedule-title">{{ title || t('schedule.title') }}</span>
|
|
@@ -3678,7 +3824,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3678
3824
|
</div>
|
|
3679
3825
|
</div>
|
|
3680
3826
|
</div>
|
|
3681
|
-
`};import{ref as
|
|
3827
|
+
`};import{ref as qn,computed as rt}from"vue";var _n={name:"DjmComment",components:{DjmAvatar:he,DjmIcon:P},props:{list:{type:Array,default:()=>[]},maxLength:{type:Number,default:500},placeholder:{type:String,default:""},submitText:{type:String,default:""},removable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyText:{type:String,default:""}},emits:["submit","reply","remove"],setup(e,{emit:t}){let a=qn(""),i=qn(null),n=rt(()=>i.value?C("comment.replyPlaceholder",{name:i.value.author}):e.placeholder||C("comment.placeholder")),l=rt(()=>e.submitText||C("comment.submit")),r=rt(()=>e.emptyText||C("comment.empty")),o=rt(()=>a.value.length>e.maxLength),s=rt(()=>a.value.trim().length>0&&!o.value&&!e.disabled&&!e.loading);function d(u){a.value=u.target.value}function p(){s.value&&(t("submit",a.value.trim(),i.value),a.value="",i.value=null)}function c(u){i.value=u,t("reply",u)}function h(){i.value=null}function v(u){t("remove",u)}return{content:a,replyTarget:i,placeholderText:n,submitLabel:l,emptyLabel:r,overLimit:o,canSubmit:s,onInput:d,submit:p,startReply:c,cancelReply:h,remove:v,t:C}},template:`
|
|
3682
3828
|
<div class="djm-comment">
|
|
3683
3829
|
<div v-if="!list.length" class="djm-comment-empty">{{ emptyLabel }}</div>
|
|
3684
3830
|
|
|
@@ -3743,7 +3889,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3743
3889
|
</div>
|
|
3744
3890
|
</div>
|
|
3745
3891
|
</div>
|
|
3746
|
-
`};import{ref as
|
|
3892
|
+
`};import{ref as Kt,onMounted as Ss,onBeforeUnmount as Ds,watch as Es}from"vue";var Yn={name:"DjmSignature",props:{modelValue:{type:String,default:""},height:{type:Number,default:180},lineWidth:{type:Number,default:2.4},color:{type:String,default:""},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:""}},emits:["update:modelValue","change","start","end","clear"],setup(e,{emit:t}){let a=Kt(null),i=Kt(null),n=Kt([]),l=Kt(!1),r=null,o=!1,s=null,d=e.modelValue,p=null;function c(){return a.value?a.value.getContext("2d"):null}function h(){return e.color?e.color:getComputedStyle(document.documentElement).getPropertyValue("--djm-text").trim()||"#1e2b3a"}function v(k){k.lineWidth=e.lineWidth,k.lineCap="round",k.lineJoin="round",k.strokeStyle=h()}function u(){let k=a.value;if(!k)return;let B=k.parentElement?k.parentElement.clientWidth:k.clientWidth,S=window.devicePixelRatio||1;k.width=Math.max(1,Math.round(B*S)),k.height=Math.max(1,Math.round(e.height*S)),k.style.width="100%",k.style.height=e.height+"px";let T=c();T.setTransform(S,0,0,S,0,0),v(T),g()}function g(){let k=c();if(!k)return;let B=a.value.width/(window.devicePixelRatio||1);k.clearRect(0,0,B,e.height),r&&k.drawImage(r,0,0,B,e.height),v(k),n.value.forEach(S=>{if(S.length<2){k.beginPath(),k.arc(S[0].x,S[0].y,e.lineWidth/2,0,Math.PI*2),k.fillStyle=h(),k.fill();return}k.beginPath(),k.moveTo(S[0].x,S[0].y);for(let T=1;T<S.length;T++)k.lineTo(S[T].x,S[T].y);k.stroke()})}function y(k){let B=a.value.getBoundingClientRect();return{x:k.clientX-B.left,y:k.clientY-B.top}}function j(k){if(!e.disabled){k.preventDefault(),o=!0,r=null,l.value=!1,s=[y(k)],n.value=n.value.concat([s]);try{a.value.setPointerCapture&&a.value.setPointerCapture(k.pointerId)}catch{}t("start")}}function w(k){if(!o||!s)return;k.preventDefault();let B=y(k),S=c(),T=s[s.length-1];S.beginPath(),S.moveTo(T.x,T.y),S.lineTo(B.x,B.y),S.stroke(),s.push(B)}function b(){o&&(o=!1,s=null,m(),t("end"))}function m(){if(!a.value)return;let k=n.value.length?a.value.toDataURL("image/png"):"";d=k,t("update:modelValue",k),t("change",k)}function f(){n.value=[],r=null,l.value=!1;let k=c(),B=a.value.width/(window.devicePixelRatio||1);k&&k.clearRect(0,0,B,e.height),d="",t("update:modelValue",""),t("change",""),t("clear")}function E(){return a.value?a.value.toDataURL("image/png"):""}let D=()=>n.value.length===0&&!l.value;return Es(()=>e.modelValue,k=>{if(k===d)return;if(d=k||"",!k){n.value=[],r=null,l.value=!1,g();return}let B=new Image;B.onload=()=>{r=B,l.value=!0,n.value=[],g()},B.src=k}),Ss(()=>{if(u(),e.modelValue){let k=new Image;k.onload=()=>{r=k,l.value=!0,g()},k.src=e.modelValue}window.ResizeObserver&&(p=new ResizeObserver(()=>u()),i.value&&p.observe(i.value))}),Ds(()=>{p&&p.disconnect()}),{canvas:a,root:i,isEmpty:D,clear:f,onPointerDown:j,onPointerMove:w,onPointerUp:b,t:C}},expose:["clear","toDataURL","isEmpty"],template:`
|
|
3747
3893
|
<div class="djm-signature" ref="root" :class="{ 'djm-is-disabled': disabled }">
|
|
3748
3894
|
<div class="djm-signature-canvas-wrap">
|
|
3749
3895
|
<canvas
|
|
@@ -3764,7 +3910,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3764
3910
|
</button>
|
|
3765
3911
|
</div>
|
|
3766
3912
|
</div>
|
|
3767
|
-
`};import{ref as
|
|
3913
|
+
`};import{ref as Ms,computed as Cs}from"vue";function Jn(e){return String(e).replace(/[&<>"]/g,t=>({"&":"&","<":"<",">":">",'"':"""})[t])}var Gn={name:"DjmPrint",components:{DjmIcon:P},props:{title:{type:String,default:""},showButton:{type:Boolean,default:!0},buttonText:{type:String,default:""},landscape:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["before-print","after-print"],setup(e,{emit:t}){let a=Ms(null),i=Cs(()=>e.buttonText||C("print.button"));function n(){return Array.from(document.querySelectorAll('link[rel="stylesheet"], style')).map(r=>r.outerHTML).join("")}function l(){if(e.disabled||!a.value)return;t("before-print");let r=document.createElement("iframe");r.setAttribute("aria-hidden","true"),r.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0;",document.body.appendChild(r);let o=r.contentWindow.document,s=e.title?`<h1 class="djm-print-heading">${Jn(e.title)}</h1>`:"";o.open(),o.write(`<!doctype html><html><head><meta charset="utf-8"><title>${Jn(e.title||document.title)}</title>`+n()+`<style>@page { size: ${e.landscape?"A4 landscape":"A4 portrait"}; margin: 12mm; }html, body { background: #fff; margin: 0; padding: 0; }body { color: #000; font-size: 12px; }.djm-print-toolbar, .djm-no-print { display: none !important; }.djm-print-heading { margin: 0 0 12px; font-size: 17px; font-weight: 600; text-align: center; }table { page-break-inside: auto; } tr, img { page-break-inside: avoid; } thead { display: table-header-group; }</style></head><body><div class="djm-print-stage">`+s+a.value.innerHTML+"</div></body></html>"),o.close(),window.setTimeout(()=>{try{r.contentWindow.focus(),r.contentWindow.print()}finally{window.setTimeout(()=>{r.remove(),t("after-print")},300)}},120)}return{content:a,label:i,print:l,t:C}},expose:["print"],template:`
|
|
3768
3914
|
<div class="djm-print">
|
|
3769
3915
|
<div v-if="showButton" class="djm-print-actions djm-print-toolbar">
|
|
3770
3916
|
<button class="djm-btn" type="button" :disabled="disabled" @click="print">
|
|
@@ -3776,7 +3922,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3776
3922
|
<slot></slot>
|
|
3777
3923
|
</div>
|
|
3778
3924
|
</div>
|
|
3779
|
-
`};import{computed as
|
|
3925
|
+
`};import{computed as $e}from"vue";var Ts=864e5,Xn=e=>String(e).padStart(2,"0");function Ut(e){let t=String(e||"").split("-").map(Number);return t.length!==3||t.some(a=>!Number.isFinite(a))?null:new Date(t[0],t[1]-1,t[2])}function ja(e){return`${e.getFullYear()}-${Xn(e.getMonth()+1)}-${Xn(e.getDate())}`}function Wt(e,t){let a=Ut(e),i=Ut(t);return!a||!i?0:Math.round((a.getTime()-i.getTime())/Ts)}var Qn={name:"DjmGantt",props:{tasks:{type:Array,default:()=>[]},nameWidth:{type:Number,default:168},dayWidth:{type:Number,default:36},rowHeight:{type:Number,default:40},startDate:{type:String,default:""},endDate:{type:String,default:""},minDays:{type:Number,default:14},showToday:{type:Boolean,default:!0},emptyText:{type:String,default:""}},emits:["task-click"],setup(e,{emit:t}){let a=ja(new Date),i=$e(()=>{let c=e.tasks.map(y=>y.start).filter(Boolean).sort(),h=e.tasks.map(y=>y.end||y.start).filter(Boolean).sort(),v=e.startDate||c[0]||a,u=e.endDate||h[h.length-1]||v;if(u<v&&(u=v),Wt(u,v)+1<e.minDays){let y=Ut(v);u=ja(new Date(y.getFullYear(),y.getMonth(),y.getDate()+e.minDays-1))}return{start:v,end:u}}),n=$e(()=>{let c=Wt(i.value.end,i.value.start)+1,h=Ut(i.value.start);return Array.from({length:c},(v,u)=>{let g=new Date(h.getFullYear(),h.getMonth(),h.getDate()+u),y=ja(g);return{key:y,day:g.getDate(),month:g.getMonth()+1,monthStart:u===0||g.getDate()===1,today:y===a,weekend:g.getDay()===0||g.getDay()===6}})}),l=$e(()=>n.value.length*e.dayWidth),r=$e(()=>e.nameWidth+l.value),o=$e(()=>e.tasks.map((c,h)=>{let v=c.start||i.value.start,u=c.end||v,g=Math.max(0,Wt(v,i.value.start)),y=Math.max(1,Wt(u,v)+1),j=Math.min(100,Math.max(0,Number(c.progress)||0));return{task:c,key:c.id!==void 0?c.id:h,left:g*e.dayWidth,width:y*e.dayWidth,progress:j}})),s=$e(()=>{let c=n.value.findIndex(h=>h.today);return c===-1?null:e.nameWidth+c*e.dayWidth+e.dayWidth/2}),d=$e(()=>e.emptyText||C("gantt.empty"));function p(c){t("task-click",c.task)}return{days:n,bars:o,trackWidth:l,innerWidth:r,todayLeft:s,emptyLabel:d,onClick:p,t:C}},template:`
|
|
3780
3926
|
<div class="djm-gantt">
|
|
3781
3927
|
<div class="djm-gantt-scroll">
|
|
3782
3928
|
<div class="djm-gantt-inner" :style="{ width: innerWidth + 'px' }">
|
|
@@ -3839,7 +3985,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3839
3985
|
</div>
|
|
3840
3986
|
</div>
|
|
3841
3987
|
</div>
|
|
3842
|
-
`};import{ref as
|
|
3988
|
+
`};import{ref as Zn,computed as qt,watch as Is}from"vue";var Ls=0,el={name:"DjmFieldList",components:{DjmIcon:P},props:{modelValue:{type:Array,default:()=>[]},fields:{type:Array,default:()=>[]},addText:{type:String,default:""},min:{type:Number,default:0},max:{type:Number,default:0},defaultItem:{type:Object,default:null},showIndex:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},emptyText:{type:String,default:""}},emits:["update:modelValue","add","remove","change"],setup(e,{emit:t}){let a=Zn([]);function i(){let w=e.modelValue.length;if(a.value.length===w)return;let b=a.value.slice(0,w);for(;b.length<w;)b.push(++Ls);a.value=b}i(),Is(()=>e.modelValue.length,i);let n=Zn({}),l=qt(()=>e.addText||C("fieldList.add")),r=qt(()=>e.emptyText||C("fieldList.empty")),o=qt(()=>!e.disabled&&(!e.max||e.modelValue.length<e.max)),s=qt(()=>!e.disabled&&e.modelValue.length>e.min);function d(w){t("update:modelValue",w),t("change",w)}function p(w,b,m){let f=e.modelValue.map((D,k)=>k===w?{...D,[b]:m}:D);d(f);let E=a.value[w];if(n.value[E]&&n.value[E][b]){let D={...n.value[E]};delete D[b],n.value={...n.value,[E]:D}}}function c(w,b,m){let f=m.target.value;if(b.type!=="number"){p(w,b.key,f);return}let E=Number(f);p(w,b.key,f===""||!Number.isFinite(E)?f:E)}function h(){if(!o.value)return;let w=e.defaultItem?{...e.defaultItem}:{};d(e.modelValue.concat([w])),t("add",w)}function v(w){if(!s.value)return;let b=e.modelValue.slice(),[m]=b.splice(w,1);d(b),t("remove",m,w)}function u(w,b){if(!b.required)return;let f=(e.modelValue[w]||{})[b.key];if(!(f===""||f===void 0||f===null))return;let D=a.value[w];n.value={...n.value,[D]:{...n.value[D]||{},[b.key]:C("fieldList.required",{label:b.label||b.key})}}}function g(w,b){let m=a.value[w];return n.value[m]&&n.value[m][b.key]||""}function y(){let w={};return e.modelValue.forEach((b,m)=>{let f=a.value[m],E={};e.fields.forEach(D=>{if(!D.required)return;let k=b[D.key];(k===""||k===void 0||k===null)&&(E[D.key]=C("fieldList.required",{label:D.label||D.key}))}),Object.keys(E).length&&(w[f]=E)}),n.value=w,Object.keys(w).length===0}function j(w,b){let m=w[b];return m??""}return{uids:a,errors:n,addLabel:l,emptyLabel:r,canAdd:o,canRemove:s,add:h,remove:v,onInput:c,onBlur:u,errorOf:g,validate:y,valueOf:j,t:C}},expose:["validate"],template:`
|
|
3843
3989
|
<div class="djm-field-list">
|
|
3844
3990
|
<div v-if="!modelValue.length" class="djm-field-list-empty">{{ emptyLabel }}</div>
|
|
3845
3991
|
|
|
@@ -3905,7 +4051,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3905
4051
|
<DjmIcon name="plus" :size="14" />{{ addLabel }}
|
|
3906
4052
|
</button>
|
|
3907
4053
|
</div>
|
|
3908
|
-
`};import{ref as
|
|
4054
|
+
`};import{ref as tl,computed as _t,watch as As,nextTick as zs}from"vue";var al={name:"DjmChat",components:{DjmAvatar:he},props:{messages:{type:Array,default:()=>[]},placeholder:{type:String,default:""},sendText:{type:String,default:""},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},height:{type:[Number,String],default:360},emptyText:{type:String,default:""}},emits:["submit"],setup(e,{emit:t}){let a=tl(""),i=tl(null),n=_t(()=>e.placeholder||C("chat.placeholder")),l=_t(()=>e.sendText||C("chat.send")),r=_t(()=>e.emptyText||C("chat.empty")),o=_t(()=>a.value.trim().length>0&&!e.disabled&&!e.loading);function s(){let v=i.value;v&&(v.scrollTop=v.scrollHeight)}As(()=>e.messages.length,()=>zs(s));function d(v){a.value=v.target.value}function p(){o.value&&(t("submit",a.value.trim()),a.value="")}function c(v){v.key!=="Enter"||v.shiftKey||(v.preventDefault(),p())}function h(v){return v.from==="me"}return{content:a,listRef:i,placeholderText:n,sendLabel:l,emptyLabel:r,canSend:o,onInput:d,onKeydown:c,submit:p,isSelf:h,t:C}},mounted(){this.listRef.scrollTop=this.listRef.scrollHeight},template:`
|
|
3909
4055
|
<div class="djm-chat">
|
|
3910
4056
|
<div
|
|
3911
4057
|
class="djm-chat-list"
|
|
@@ -3977,7 +4123,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
3977
4123
|
</button>
|
|
3978
4124
|
</div>
|
|
3979
4125
|
</div>
|
|
3980
|
-
`};import{ref as
|
|
4126
|
+
`};import{ref as Ps,computed as il,watch as Bs}from"vue";var nl={name:"DjmOrgChart",components:{DjmAvatar:he,DjmIcon:P},props:{data:{type:Object,default:null},nodeWidth:{type:Number,default:168},nodeHeight:{type:Number,default:68},gap:{type:Number,default:20},verticalGap:{type:Number,default:40},collapsible:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!0},emptyText:{type:String,default:""}},emits:["node-click"],setup(e,{emit:t}){function a(p){return p&&p.id!==void 0?p.id:p?p.name:""}function i(p){let c=[];function h(v){let u=v&&v.children||[];u.length&&(c.push(a(v)),u.forEach(h))}return h(p),c}let n=Ps(e.defaultExpandAll?[]:i(e.data));Bs(()=>e.data,p=>{n.value=e.defaultExpandAll?[]:i(p)});let l=il(()=>{if(!e.data)return{nodes:[],links:[],width:0,height:0};let p=e.nodeHeight+e.verticalGap,c=0;function h(w,b){let m=a(w),f=w.children||[],E=e.collapsible&&n.value.indexOf(m)>-1,k=(E?[]:f).map(S=>h(S,b+1)),B;return k.length?B=(k[0].x+k[k.length-1].x)/2:(B=c,c+=e.nodeWidth+e.gap),{key:m,node:w,depth:b,x:B,y:b*p,collapsed:E,hasChildren:f.length>0,childrenItems:k}}let v=[],u=[];function g(w,b){v.push(w),b&&u.push({from:b,to:w}),w.childrenItems.forEach(m=>g(m,w))}let y=h(e.data,0);g(y,null);let j=v.reduce((w,b)=>Math.max(w,b.depth),0);return{nodes:v,links:u,width:Math.max(c,e.nodeWidth),height:(j+1)*e.nodeHeight+j*e.verticalGap,root:y}});function r(p){if(!e.collapsible||!p.hasChildren)return;let c=n.value.indexOf(p.key),h=n.value.slice();c>-1?h.splice(c,1):h.push(p.key),n.value=h}function o(p){let c=p.from.x+e.nodeWidth/2,h=p.from.y+e.nodeHeight,v=p.to.x+e.nodeWidth/2,u=p.to.y,g=h+(u-h)/2;return`M${c} ${h} V${g} H${v} V${u}`}function s(p){t("node-click",p.node)}let d=il(()=>e.emptyText||C("orgChart.empty"));return{layout:l,toggle:r,linkPath:o,onClick:s,emptyLabel:d,t:C}},template:`
|
|
3981
4127
|
<div class="djm-org-chart">
|
|
3982
4128
|
<p v-if="!data" class="djm-org-chart-empty">{{ emptyLabel }}</p>
|
|
3983
4129
|
|
|
@@ -4024,7 +4170,7 @@ Minimum version required to store current data is: `+I+`.
|
|
|
4024
4170
|
</div>
|
|
4025
4171
|
</div>
|
|
4026
4172
|
</div>
|
|
4027
|
-
`};import{computed as
|
|
4173
|
+
`};import{computed as Ns}from"vue";var ll={name:"DjmPageTabs",components:{DjmIcon:P},props:{modelValue:{type:String,default:""},tabs:{type:Array,default:()=>[]},closable:{type:Boolean,default:!0}},emits:["update:modelValue","change","close"],setup(e,{emit:t}){let a=Ns(()=>C("pageTabs.label"));function i(o){return o.closable===void 0?e.closable:o.closable}function n(o){o.key!==e.modelValue&&(t("update:modelValue",o.key),t("change",o.key,o))}function l(o){t("close",o.key,o)}function r(o,s){s.button!==1||!i(o)||(s.preventDefault(),l(o))}return{label:a,canClose:i,select:n,close:l,onAuxClick:r,t:C}},template:`
|
|
4028
4174
|
<div class="djm-page-tabs">
|
|
4029
4175
|
<nav class="djm-page-tabs-list" :aria-label="label">
|
|
4030
4176
|
<div
|
|
@@ -4056,4 +4202,4 @@ Minimum version required to store current data is: `+I+`.
|
|
|
4056
4202
|
<slot name="extra"></slot>
|
|
4057
4203
|
</div>
|
|
4058
4204
|
</div>
|
|
4059
|
-
`};function
|
|
4205
|
+
`};function xa(e,t,a,i=null){for(let n=0;n<e.length;n++){let l=e[n];if(l[a]===t)return{node:l,list:e,index:n,parent:i};let r=l.children;if(r&&r.length){let o=xa(r,t,a,l);if(o)return o}}return null}function ol(e,t,a){return e[a]===t?!0:(e.children||[]).some(n=>ol(n,t,a))}function Rs(e,t,a,i="before",n="id"){if(!Array.isArray(e)||t===a)return!1;let l=xa(e,t,n);if(!l||ol(l.node,a,n))return!1;l.list.splice(l.index,1);let r=xa(e,a,n);if(!r)return l.list.splice(l.index,0,l.node),!1;if(i==="inside")return Array.isArray(r.node.children)||(r.node.children=[]),r.node.children.push(l.node),!0;let o=i==="after"?r.index+1:r.index;return r.list.splice(o,0,l.node),!0}function Vs(e,t,a,i="before"){if(!Array.isArray(e)||!Number.isInteger(t)||!Number.isInteger(a)||t<0||t>=e.length||a<0||a>=e.length||t===a)return null;let n=e.slice(),[l]=n.splice(t,1),r=i==="after"?a+1:a;return t<r&&(r-=1),r===t?null:(n.splice(r,0,l),n)}import{reactive as Hs}from"vue";var Yt=Hs({codes:new Set});function Os(e){Yt.codes=new Set(e||[])}function $s(e){(e||[]).forEach(t=>Yt.codes.add(t))}function Fs(){Yt.codes=new Set}function rl(e){return!e||Array.isArray(e)&&!e.length?!0:(Array.isArray(e)?e:[e]).some(a=>Yt.codes.has(a))}var ka={mounted(e,t){if(!rl(t.value)){if(t.modifiers.disable){e.setAttribute("disabled","disabled"),e.classList.add("djm-is-no-permission");return}e.parentNode&&e.parentNode.replaceChild(document.createComment("v-permission"),e)}}};var Ks=[Sa,ge,Ie,dt,ct,We,ut,mt,pt,ft,Ta,Ia,he,La,Aa,Pa,Ba,Na,Ra,Va,Ha,$a,Fa,Ka,Wa,Ua,qe,vt,gt,bt,yt,_e,qa,_a,Ya,Ja,Xa,Za,ei,ti,ai,ii,li,ci,ui,fi,pi,hi,bi,yi,wi,Ct,Tt,ji,xi,ki,Si,Di,Ei,Mi,Ci,Ii,Vi,Hi,Oi,$i,Fi,P,Je,Ki,Lt,Wi,_i,Se,Ge,ln,on,sn,cn,fn,pn,vn,gn,yn,wn,xn,kn,Bt,Dn,Mn,In,Ln,zn,Pn,Nn,Rn,Hn,Fn,Un,_n,Yn,Gn,Qn,el,al,nl,ll],Ws="0.72.0";function Us(e,t={}){t.locale&&Ke(t.locale),Ks.forEach(a=>e.component(a.name,a)),e.directive("permission",ka)}var mg={install:Us,version:Ws};export{ai as DjmAffix,_a as DjmAlert,Xa as DjmAnchor,wn as DjmApprovalFlow,Mn as DjmAttachmentList,ui as DjmAutoComplete,he as DjmAvatar,La as DjmAvatarGroup,Za as DjmBacktop,Aa as DjmBadge,Nn as DjmBatchBar,Ia as DjmBreadcrumb,Sa as DjmButton,bi as DjmCalendar,Ra as DjmCard,pi as DjmCarousel,_e as DjmCascader,al as DjmChat,dt as DjmCheckbox,Tt as DjmCol,Ka as DjmCollapse,yt as DjmColorPicker,Ii as DjmCommandPalette,_n as DjmComment,Ln as DjmConfigProvider,Ki as DjmConfirmDialog,_i as DjmContextMenu,Se as DjmDatePicker,zn as DjmDateTimePicker,pn as DjmDescriptions,Hn as DjmDiff,ei as DjmDivider,Fi as DjmDrawer,$i as DjmDropdown,fn as DjmEditableTable,ft as DjmEmpty,el as DjmFieldList,kn as DjmFilterTags,yi as DjmFloatButton,on as DjmFloatingWindow,ut as DjmForm,mt as DjmFormItem,Qn as DjmGantt,P as DjmIcon,li as DjmImage,Rn as DjmImportWizard,ge as DjmInput,qe as DjmInputNumber,Mi as DjmInputTag,Dn as DjmKanban,ji as DjmLayout,Si as DjmLayoutContent,Di as DjmLayoutFooter,xi as DjmLayoutHeader,ki as DjmLayoutSider,Ei as DjmList,Bt as DjmMediaPicker,wi as DjmMentions,Ba as DjmMenu,vn as DjmMessageHost,Je as DjmModal,In as DjmNotification,nl as DjmOrgChart,gn as DjmOrgPicker,Ta as DjmPageHeader,ll as DjmPageTabs,Lt as DjmPagination,Ci as DjmPassword,Ja as DjmPopconfirm,Pa as DjmPopover,Gn as DjmPrint,Va as DjmProgress,Vi as DjmQRCode,xn as DjmQueryFilter,ct as DjmRadio,vt as DjmRate,$a as DjmResult,ln as DjmRichEditor,Ct as DjmRow,Un as DjmSchedule,yn as DjmSchemaForm,ii as DjmSegmented,Ie as DjmSelect,Yn as DjmSignature,Ha as DjmSkeleton,gt as DjmSlider,ti as DjmSpace,Ya as DjmSpin,fi as DjmSplitter,Wa as DjmStatistic,Hi as DjmStatus,Ua as DjmSteps,We as DjmSwitch,pt as DjmTable,Wi as DjmTabs,Na as DjmTag,bt as DjmTimePicker,Fa as DjmTimeline,Oi as DjmTooltip,hi as DjmTour,qa as DjmTransfer,cn as DjmTree,Ge as DjmTreeSelect,Fn as DjmTreeTable,sn as DjmUpload,Pn as DjmVirtualList,ci as DjmWatermark,Ul as PRESET_COLORS,$s as addPermissions,Fs as clearPermissions,mg as default,Ze as djmMessage,He as djmMessages,fl as getLocale,rl as hasPermission,Xl as initTheme,Us as install,Fe as localeState,Vs as moveRows,Rs as moveTreeNode,St as primaryColor,Jl as resetPrimaryColor,Nt as sanitizeHtml,Ke as setLocale,Os as setPermissions,di as setPrimaryColor,Qt as setTheme,C as t,Ae as theme,Gl as toggleTheme,ka as vPermission,Ws as version};
|