djm-ui 0.67.2 → 0.67.3

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.
@@ -1,4 +1,4 @@
1
- /*! DJM UI v0.67.2 · MIT · 2026-10-26 */
1
+ /*! DJM UI v0.67.3 · MIT · 2026-10-26 */
2
2
  "use strict";
3
3
  var DjmUI = (() => {
4
4
  var __defProp = Object.defineProperty;
@@ -1235,6 +1235,13 @@ Minimum version required to store current data is: ` + i + `.
1235
1235
  this.$emit("update:modelValue", event.target.value);
1236
1236
  this.$emit("input", event);
1237
1237
  },
1238
+ // 浏览器自动填充与前进后退的表单恢复只改 DOM 值、不触发 input,
1239
+ // 模型为空时清掉,否则会看到有值但实际没按它筛选;登录类字段保留自动填充
1240
+ clearStaleValue() {
1241
+ const input = this.$refs.input;
1242
+ if (!input || this.autocomplete !== "off") return;
1243
+ if (String(this.modelValue ?? "").length === 0 && input.value) input.value = "";
1244
+ },
1238
1245
  clear() {
1239
1246
  this.$emit("update:modelValue", "");
1240
1247
  this.$emit("clear");
@@ -1248,6 +1255,15 @@ Minimum version required to store current data is: ` + i + `.
1248
1255
  if (this.$refs.input) this.$refs.input.blur();
1249
1256
  }
1250
1257
  },
1258
+ mounted() {
1259
+ this.clearStaleValue();
1260
+ this.staleTimer = setTimeout(() => this.clearStaleValue(), 300);
1261
+ window.addEventListener("pageshow", this.clearStaleValue);
1262
+ },
1263
+ beforeUnmount() {
1264
+ clearTimeout(this.staleTimer);
1265
+ window.removeEventListener("pageshow", this.clearStaleValue);
1266
+ },
1251
1267
  template: `
1252
1268
  <div v-if="hasAffix" class="djm-input-wrap">
1253
1269
  <input
@@ -15320,7 +15336,7 @@ Minimum version required to store current data is: ` + i + `.
15320
15336
  org_chart_default,
15321
15337
  page_tabs_default
15322
15338
  ];
15323
- var version = "0.67.2";
15339
+ var version = "0.67.3";
15324
15340
  function install(app, options = {}) {
15325
15341
  if (options.locale) setLocale(options.locale);
15326
15342
  components.forEach((component) => app.component(component.name, component));
@@ -1,4 +1,4 @@
1
- /*! DJM UI v0.67.2 · MIT · 2026-10-26 */
1
+ /*! DJM UI v0.67.3 · MIT · 2026-10-26 */
2
2
  "use strict";var DjmUI=(()=>{var gt=Object.defineProperty;var Zn=Object.getOwnPropertyDescriptor;var ei=Object.getOwnPropertyNames;var ti=Object.prototype.hasOwnProperty;var ai=(e,t,a)=>()=>{if(a)throw a[0];try{return e&&(t=e(e=0)),t}catch(n){throw a=[n],n}};var rn=(e,t)=>{for(var a in t)gt(e,a,{get:t[a],enumerable:!0})},ni=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ei(t))!ti.call(e,i)&&i!==a&&gt(e,i,{get:()=>t[i],enumerable:!(n=Zn(t,i))||n.enumerable});return e};var ii=e=>ni(gt({},"__esModule",{value:!0}),e);var En={};rn(En,{default:()=>Oi});var ae,bi,ze,fa,wi,ji,xi,ki,Si,Dn,Di,Ti,Mi,Tn,Mn,Be,Ci,Ei,Ii,Li,Ai,Pi,zi,Bi,Ni,Cn,Ri,Vi,Hi,Oi,In=ai(()=>{"use strict";ae=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(a){throw t=0,a}},bi=ae((e,t)=>{t.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}}),ze=ae(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(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},e.getSymbolTotalCodewords=function(n){return a[n]},e.getBCHDigit=function(n){let i=0;for(;n!==0;)i++,n>>>=1;return i},e.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');t=n},e.isKanjiModeEnabled=function(){return typeof t<"u"},e.toSJIS=function(n){return t(n)}}),fa=ae(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,n){if(e.isValid(a))return a;try{return t(a)}catch{return n}}}),wi=ae((e,t)=>{function a(){this.buffer=[],this.length=0}a.prototype={get:function(n){let i=Math.floor(n/8);return(this.buffer[i]>>>7-n%8&1)===1},put:function(n,i){for(let l=0;l<i;l++)this.putBit((n>>>i-l-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(n){let i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),n&&(this.buffer[i]|=128>>>this.length%8),this.length++}},t.exports=a}),ji=ae((e,t)=>{function a(n){if(!n||n<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=n,this.data=new Uint8Array(n*n),this.reservedBit=new Uint8Array(n*n)}a.prototype.set=function(n,i,l,o){let r=n*this.size+i;this.data[r]=l,o&&(this.reservedBit[r]=!0)},a.prototype.get=function(n,i){return this.data[n*this.size+i]},a.prototype.xor=function(n,i,l){this.data[n*this.size+i]^=l},a.prototype.isReserved=function(n,i){return this.reservedBit[n*this.size+i]},t.exports=a}),xi=ae(e=>{var t=ze().getSymbolSize;e.getRowColCoords=function(a){if(a===1)return[];let n=Math.floor(a/7)+2,i=t(a),l=i===145?26:Math.ceil((i-13)/(2*n-2))*2,o=[i-7];for(let r=1;r<n-1;r++)o[r]=o[r-1]-l;return o.push(6),o.reverse()},e.getPositions=function(a){let n=[],i=e.getRowColCoords(a),l=i.length;for(let o=0;o<l;o++)for(let r=0;r<l;r++)o===0&&r===0||o===0&&r===l-1||o===l-1&&r===0||n.push([i[o],i[r]]);return n}}),ki=ae(e=>{var t=ze().getSymbolSize,a=7;e.getPositions=function(n){let i=t(n);return[[0,0],[i-a,0],[0,i-a]]}}),Si=ae(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(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){let i=n.size,l=0,o=0,r=0,s=null,d=null;for(let f=0;f<i;f++){o=r=0,s=d=null;for(let c=0;c<i;c++){let p=n.get(f,c);p===s?o++:(o>=5&&(l+=t.N1+(o-5)),s=p,o=1),p=n.get(c,f),p===d?r++:(r>=5&&(l+=t.N1+(r-5)),d=p,r=1)}o>=5&&(l+=t.N1+(o-5)),r>=5&&(l+=t.N1+(r-5))}return l},e.getPenaltyN2=function(n){let i=n.size,l=0;for(let o=0;o<i-1;o++)for(let r=0;r<i-1;r++){let s=n.get(o,r)+n.get(o,r+1)+n.get(o+1,r)+n.get(o+1,r+1);(s===4||s===0)&&l++}return l*t.N2},e.getPenaltyN3=function(n){let i=n.size,l=0,o=0,r=0;for(let s=0;s<i;s++){o=r=0;for(let d=0;d<i;d++)o=o<<1&2047|n.get(s,d),d>=10&&(o===1488||o===93)&&l++,r=r<<1&2047|n.get(d,s),d>=10&&(r===1488||r===93)&&l++}return l*t.N3},e.getPenaltyN4=function(n){let i=0,l=n.data.length;for(let o=0;o<l;o++)i+=n.data[o];return Math.abs(Math.ceil(i*100/l/5)-10)*t.N4};function a(n,i,l){switch(n){case e.Patterns.PATTERN000:return(i+l)%2===0;case e.Patterns.PATTERN001:return i%2===0;case e.Patterns.PATTERN010:return l%3===0;case e.Patterns.PATTERN011:return(i+l)%3===0;case e.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(l/3))%2===0;case e.Patterns.PATTERN101:return i*l%2+i*l%3===0;case e.Patterns.PATTERN110:return(i*l%2+i*l%3)%2===0;case e.Patterns.PATTERN111:return(i*l%3+(i+l)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(n,i){let l=i.size;for(let o=0;o<l;o++)for(let r=0;r<l;r++)i.isReserved(r,o)||i.xor(r,o,a(n,r,o))},e.getBestMask=function(n,i){let l=Object.keys(e.Patterns).length,o=0,r=1/0;for(let s=0;s<l;s++){i(s),e.applyMask(s,n);let d=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(s,n),d<r&&(r=d,o=s)}return o}}),Dn=ae(e=>{var t=fa(),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],n=[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(i,l){switch(l){case t.L:return a[(i-1)*4+0];case t.M:return a[(i-1)*4+1];case t.Q:return a[(i-1)*4+2];case t.H:return a[(i-1)*4+3];default:return}},e.getTotalCodewordsCount=function(i,l){switch(l){case t.L:return n[(i-1)*4+0];case t.M:return n[(i-1)*4+1];case t.Q:return n[(i-1)*4+2];case t.H:return n[(i-1)*4+3];default:return}}}),Di=ae(e=>{var t=new Uint8Array(512),a=new Uint8Array(256);(function(){let n=1;for(let i=0;i<255;i++)t[i]=n,a[n]=i,n<<=1,n&256&&(n^=285);for(let i=255;i<512;i++)t[i]=t[i-255]})(),e.log=function(n){if(n<1)throw new Error("log("+n+")");return a[n]},e.exp=function(n){return t[n]},e.mul=function(n,i){return n===0||i===0?0:t[a[n]+a[i]]}}),Ti=ae(e=>{var t=Di();e.mul=function(a,n){let i=new Uint8Array(a.length+n.length-1);for(let l=0;l<a.length;l++)for(let o=0;o<n.length;o++)i[l+o]^=t.mul(a[l],n[o]);return i},e.mod=function(a,n){let i=new Uint8Array(a);for(;i.length-n.length>=0;){let l=i[0];for(let r=0;r<n.length;r++)i[r]^=t.mul(n[r],l);let o=0;for(;o<i.length&&i[o]===0;)o++;i=i.slice(o)}return i},e.generateECPolynomial=function(a){let n=new Uint8Array([1]);for(let i=0;i<a;i++)n=e.mul(n,new Uint8Array([1,t.exp(i)]));return n}}),Mi=ae((e,t)=>{var a=Ti();function n(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(i){this.degree=i,this.genPoly=a.generateECPolynomial(this.degree)},n.prototype.encode=function(i){if(!this.genPoly)throw new Error("Encoder not initialized");let l=new Uint8Array(i.length+this.degree);l.set(i);let o=a.mod(l,this.genPoly),r=this.degree-o.length;if(r>0){let s=new Uint8Array(this.degree);return s.set(o,r),s}return o},t.exports=n}),Tn=ae(e=>{e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}}),Mn=ae(e=>{var t="[0-9]+",a="[A-Z $%*+\\-./:]+",n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");var i="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+`)(?:.|[\r
3
3
  ]))+`;e.KANJI=new RegExp(n,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(i,"g"),e.NUMERIC=new RegExp(t,"g"),e.ALPHANUMERIC=new RegExp(a,"g");var l=new RegExp("^"+n+"$"),o=new RegExp("^"+t+"$"),r=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(s){return l.test(s)},e.testNumeric=function(s){return o.test(s)},e.testAlphanumeric=function(s){return r.test(s)}}),Be=ae(e=>{var t=Tn(),a=Mn();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(i,l){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(l))throw new Error("Invalid version: "+l);return l>=1&&l<10?i.ccBits[0]:l<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return a.testNumeric(i)?e.NUMERIC:a.testAlphanumeric(i)?e.ALPHANUMERIC:a.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.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: "+i)}}e.from=function(i,l){if(e.isValid(i))return i;try{return n(i)}catch{return l}}}),Ci=ae(e=>{var t=ze(),a=Dn(),n=fa(),i=Be(),l=Tn(),o=7973,r=t.getBCHDigit(o);function s(p,g,m){for(let h=1;h<=40;h++)if(g<=e.getCapacity(h,m,p))return h}function d(p,g){return i.getCharCountIndicator(p,g)+4}function f(p,g){let m=0;return p.forEach(function(h){let b=d(h.mode,g);m+=b+h.getBitsLength()}),m}function c(p,g){for(let m=1;m<=40;m++)if(f(p,m)<=e.getCapacity(m,g,i.MIXED))return m}e.from=function(p,g){return l.isValid(p)?parseInt(p,10):g},e.getCapacity=function(p,g,m){if(!l.isValid(p))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=i.BYTE);let h=t.getSymbolTotalCodewords(p),b=a.getTotalCodewordsCount(p,g),x=(h-b)*8;if(m===i.MIXED)return x;let j=x-d(m,p);switch(m){case i.NUMERIC:return Math.floor(j/10*3);case i.ALPHANUMERIC:return Math.floor(j/11*2);case i.KANJI:return Math.floor(j/13);case i.BYTE:default:return Math.floor(j/8)}},e.getBestVersionForData=function(p,g){let m,h=n.from(g,n.M);if(Array.isArray(p)){if(p.length>1)return c(p,h);if(p.length===0)return 1;m=p[0]}else m=p;return s(m.mode,m.getLength(),h)},e.getEncodedBits=function(p){if(!l.isValid(p)||p<7)throw new Error("Invalid QR Code version");let g=p<<12;for(;t.getBCHDigit(g)-r>=0;)g^=o<<t.getBCHDigit(g)-r;return p<<12|g}}),Ei=ae(e=>{var t=ze(),a=1335,n=21522,i=t.getBCHDigit(a);e.getEncodedBits=function(l,o){let r=l.bit<<3|o,s=r<<10;for(;t.getBCHDigit(s)-i>=0;)s^=a<<t.getBCHDigit(s)-i;return(r<<10|s)^n}}),Ii=ae((e,t)=>{var a=Be();function n(i){this.mode=a.NUMERIC,this.data=i.toString()}n.getBitsLength=function(i){return 10*Math.floor(i/3)+(i%3?i%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(i){let l,o,r;for(l=0;l+3<=this.data.length;l+=3)o=this.data.substr(l,3),r=parseInt(o,10),i.put(r,10);let s=this.data.length-l;s>0&&(o=this.data.substr(l),r=parseInt(o,10),i.put(r,s*3+1))},t.exports=n}),Li=ae((e,t)=>{var a=Be(),n=["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 i(l){this.mode=a.ALPHANUMERIC,this.data=l}i.getBitsLength=function(l){return 11*Math.floor(l/2)+6*(l%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(l){let o;for(o=0;o+2<=this.data.length;o+=2){let r=n.indexOf(this.data[o])*45;r+=n.indexOf(this.data[o+1]),l.put(r,11)}this.data.length%2&&l.put(n.indexOf(this.data[o]),6)},t.exports=i}),Ai=ae((e,t)=>{var a=Be();function n(i){this.mode=a.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}n.getBitsLength=function(i){return i*8},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(i){for(let l=0,o=this.data.length;l<o;l++)i.put(this.data[l],8)},t.exports=n}),Pi=ae((e,t)=>{var a=Be(),n=ze();function i(l){this.mode=a.KANJI,this.data=l}i.getBitsLength=function(l){return l*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(l){let o;for(o=0;o<this.data.length;o++){let r=n.toSJIS(this.data[o]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
4
4
  Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),l.put(r,13)}},t.exports=i}),zi=ae((e,t)=>{"use strict";var a={single_source_shortest_paths:function(n,i,l){var o={},r={};r[i]=0;var s=a.PriorityQueue.make();s.push(i,0);for(var d,f,c,p,g,m,h,b,x;!s.empty();){d=s.pop(),f=d.value,p=d.cost,g=n[f]||{};for(c in g)g.hasOwnProperty(c)&&(m=g[c],h=p+m,b=r[c],x=typeof r[c]>"u",(x||b>h)&&(r[c]=h,s.push(c,h),o[c]=f))}if(typeof l<"u"&&typeof r[l]>"u"){var j=["Could not find a path from ",i," to ",l,"."].join("");throw new Error(j)}return o},extract_shortest_path_from_predecessor_list:function(n,i){for(var l=[],o=i,r;o;)l.push(o),r=n[o],o=n[o];return l.reverse(),l},find_path:function(n,i,l){var o=a.single_source_shortest_paths(n,i,l);return a.extract_shortest_path_from_predecessor_list(o,l)},PriorityQueue:{make:function(n){var i=a.PriorityQueue,l={},o;n=n||{};for(o in i)i.hasOwnProperty(o)&&(l[o]=i[o]);return l.queue=[],l.sorter=n.sorter||i.default_sorter,l},default_sorter:function(n,i){return n.cost-i.cost},push:function(n,i){var l={value:n,cost:i};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)}),Bi=ae(e=>{var t=Be(),a=Ii(),n=Li(),i=Ai(),l=Pi(),o=Mn(),r=ze(),s=zi();function d(x){return unescape(encodeURIComponent(x)).length}function f(x,j,y){let u=[],v;for(;(v=x.exec(y))!==null;)u.push({data:v[0],index:v.index,mode:j,length:v[0].length});return u}function c(x){let j=f(o.NUMERIC,t.NUMERIC,x),y=f(o.ALPHANUMERIC,t.ALPHANUMERIC,x),u,v;return r.isKanjiModeEnabled()?(u=f(o.BYTE,t.BYTE,x),v=f(o.KANJI,t.KANJI,x)):(u=f(o.BYTE_KANJI,t.BYTE,x),v=[]),j.concat(y,u,v).sort(function(C,M){return C.index-M.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function p(x,j){switch(j){case t.NUMERIC:return a.getBitsLength(x);case t.ALPHANUMERIC:return n.getBitsLength(x);case t.KANJI:return l.getBitsLength(x);case t.BYTE:return i.getBitsLength(x)}}function g(x){return x.reduce(function(j,y){let u=j.length-1>=0?j[j.length-1]:null;return u&&u.mode===y.mode?(j[j.length-1].data+=y.data,j):(j.push(y),j)},[])}function m(x){let j=[];for(let y=0;y<x.length;y++){let u=x[y];switch(u.mode){case t.NUMERIC:j.push([u,{data:u.data,mode:t.ALPHANUMERIC,length:u.length},{data:u.data,mode:t.BYTE,length:u.length}]);break;case t.ALPHANUMERIC:j.push([u,{data:u.data,mode:t.BYTE,length:u.length}]);break;case t.KANJI:j.push([u,{data:u.data,mode:t.BYTE,length:d(u.data)}]);break;case t.BYTE:j.push([{data:u.data,mode:t.BYTE,length:d(u.data)}])}}return j}function h(x,j){let y={},u={start:{}},v=["start"];for(let C=0;C<x.length;C++){let M=x[C],D=[];for(let N=0;N<M.length;N++){let T=M[N],E=""+C+N;D.push(E),y[E]={node:T,lastCount:0},u[E]={};for(let A=0;A<v.length;A++){let z=v[A];y[z]&&y[z].node.mode===T.mode?(u[z][E]=p(y[z].lastCount+T.length,T.mode)-p(y[z].lastCount,T.mode),y[z].lastCount+=T.length):(y[z]&&(y[z].lastCount=T.length),u[z][E]=p(T.length,T.mode)+4+t.getCharCountIndicator(T.mode,j))}}v=D}for(let C=0;C<v.length;C++)u[v[C]].end=0;return{map:u,table:y}}function b(x,j){let y,u=t.getBestModeForData(x);if(y=t.from(j,u),y!==t.BYTE&&y.bit<u.bit)throw new Error('"'+x+'" cannot be encoded with mode '+t.toString(y)+`.
@@ -31,7 +31,7 @@ Minimum version required to store current data is: `+A+`.
31
31
  <DjmIcon v-else-if="icon" :name="icon" />
32
32
  <slot></slot>
33
33
  </button>
34
- `};var we={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)},clear(){this.$emit("update:modelValue",""),this.$emit("clear"),this.$emit("change",""),this.focus()},focus(){this.$refs.input&&this.$refs.input.focus()},blur(){this.$refs.input&&this.$refs.input.blur()}},template:`
34
+ `};var we={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.$refs.input&&this.$refs.input.focus()},blur(){this.$refs.input&&this.$refs.input.blur()}},mounted(){this.clearStaleValue(),this.staleTimer=setTimeout(()=>this.clearStaleValue(),300),window.addEventListener("pageshow",this.clearStaleValue)},beforeUnmount(){clearTimeout(this.staleTimer),window.removeEventListener("pageshow",this.clearStaleValue)},template:`
35
35
  <div v-if="hasAffix" class="djm-input-wrap">
36
36
  <input
37
37
  ref="input"
@@ -4056,4 +4056,4 @@ Minimum version required to store current data is: `+A+`.
4056
4056
  <slot name="extra"></slot>
4057
4057
  </div>
4058
4058
  </div>
4059
- `};function ln(e,t,a,n=null){for(let i=0;i<e.length;i++){let l=e[i];if(l[a]===t)return{node:l,list:e,index:i,parent:n};let o=l.children;if(o&&o.length){let r=ln(o,t,a,l);if(r)return r}}return null}function Un(e,t,a){return e[a]===t?!0:(e.children||[]).some(i=>Un(i,t,a))}function qn(e,t,a,n="before",i="id"){if(!Array.isArray(e)||t===a)return!1;let l=ln(e,t,i);if(!l||Un(l.node,a,i))return!1;l.list.splice(l.index,1);let o=ln(e,a,i);if(!o)return l.list.splice(l.index,0,l.node),!1;if(n==="inside")return Array.isArray(o.node.children)||(o.node.children=[]),o.node.children.push(l.node),!0;let r=n==="after"?o.index+1:o.index;return o.list.splice(r,0,l.node),!0}function _n(e,t,a,n="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 i=e.slice(),[l]=i.splice(t,1),o=n==="after"?a+1:a;return t<o&&(o-=1),o===t?null:(i.splice(o,0,l),i)}var ht=me({codes:new Set});function Yn(e){ht.codes=new Set(e||[])}function Jn(e){(e||[]).forEach(t=>ht.codes.add(t))}function Gn(){ht.codes=new Set}function on(e){return!e||Array.isArray(e)&&!e.length?!0:(Array.isArray(e)?e:[e]).some(a=>ht.codes.has(a))}var vt={mounted(e,t){if(!on(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 cl=[yt,we,Se,Ke,We,Le,Ue,qe,Ye,_e,bt,wt,ye,jt,xt,kt,St,Dt,Tt,Mt,Ct,Et,It,Lt,At,Pt,Ae,Je,Ge,Xe,Qe,Pe,Bt,Nt,Rt,Vt,Ht,Ot,$t,Ft,Kt,Wt,qt,Jt,Gt,Xt,Qt,Zt,ta,aa,na,tt,at,ia,la,oa,ra,sa,da,ca,ua,ma,pa,ha,va,ga,ya,P,Ne,ba,nt,wa,ja,xe,Re,xa,ka,Sa,Da,Ca,Ea,Ia,La,Aa,Pa,za,Ba,Na,Ra,Va,Ha,Oa,$a,Fa,Ka,Wa,Ua,qa,Ya,Ja,Ga,Xa,Za,en,tn,an,nn],Xn="0.67.2";function Qn(e,t={}){t.locale&&Ie(t.locale),cl.forEach(a=>e.component(a.name,a)),e.directive("permission",vt)}var ul={install:Qn,version:Xn};return ii(ml);})();
4059
+ `};function ln(e,t,a,n=null){for(let i=0;i<e.length;i++){let l=e[i];if(l[a]===t)return{node:l,list:e,index:i,parent:n};let o=l.children;if(o&&o.length){let r=ln(o,t,a,l);if(r)return r}}return null}function Un(e,t,a){return e[a]===t?!0:(e.children||[]).some(i=>Un(i,t,a))}function qn(e,t,a,n="before",i="id"){if(!Array.isArray(e)||t===a)return!1;let l=ln(e,t,i);if(!l||Un(l.node,a,i))return!1;l.list.splice(l.index,1);let o=ln(e,a,i);if(!o)return l.list.splice(l.index,0,l.node),!1;if(n==="inside")return Array.isArray(o.node.children)||(o.node.children=[]),o.node.children.push(l.node),!0;let r=n==="after"?o.index+1:o.index;return o.list.splice(r,0,l.node),!0}function _n(e,t,a,n="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 i=e.slice(),[l]=i.splice(t,1),o=n==="after"?a+1:a;return t<o&&(o-=1),o===t?null:(i.splice(o,0,l),i)}var ht=me({codes:new Set});function Yn(e){ht.codes=new Set(e||[])}function Jn(e){(e||[]).forEach(t=>ht.codes.add(t))}function Gn(){ht.codes=new Set}function on(e){return!e||Array.isArray(e)&&!e.length?!0:(Array.isArray(e)?e:[e]).some(a=>ht.codes.has(a))}var vt={mounted(e,t){if(!on(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 cl=[yt,we,Se,Ke,We,Le,Ue,qe,Ye,_e,bt,wt,ye,jt,xt,kt,St,Dt,Tt,Mt,Ct,Et,It,Lt,At,Pt,Ae,Je,Ge,Xe,Qe,Pe,Bt,Nt,Rt,Vt,Ht,Ot,$t,Ft,Kt,Wt,qt,Jt,Gt,Xt,Qt,Zt,ta,aa,na,tt,at,ia,la,oa,ra,sa,da,ca,ua,ma,pa,ha,va,ga,ya,P,Ne,ba,nt,wa,ja,xe,Re,xa,ka,Sa,Da,Ca,Ea,Ia,La,Aa,Pa,za,Ba,Na,Ra,Va,Ha,Oa,$a,Fa,Ka,Wa,Ua,qa,Ya,Ja,Ga,Xa,Za,en,tn,an,nn],Xn="0.67.3";function Qn(e,t={}){t.locale&&Ie(t.locale),cl.forEach(a=>e.component(a.name,a)),e.directive("permission",vt)}var ul={install:Qn,version:Xn};return ii(ml);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "djm-ui",
3
- "version": "0.67.2",
3
+ "version": "0.67.3",
4
4
  "description": "DJM UI — 企业级中后台 Vue 3 组件库",
5
5
  "homepage": "https://ui.duojumi.com",
6
6
  "repository": {
@@ -50,6 +50,13 @@ export default {
50
50
  this.$emit('update:modelValue', event.target.value)
51
51
  this.$emit('input', event)
52
52
  },
53
+ // 浏览器自动填充与前进后退的表单恢复只改 DOM 值、不触发 input,
54
+ // 模型为空时清掉,否则会看到有值但实际没按它筛选;登录类字段保留自动填充
55
+ clearStaleValue () {
56
+ const input = this.$refs.input
57
+ if (!input || this.autocomplete !== 'off') return
58
+ if (String(this.modelValue ?? '').length === 0 && input.value) input.value = ''
59
+ },
53
60
  clear () {
54
61
  this.$emit('update:modelValue', '')
55
62
  this.$emit('clear')
@@ -63,6 +70,16 @@ export default {
63
70
  if (this.$refs.input) this.$refs.input.blur()
64
71
  }
65
72
  },
73
+ mounted () {
74
+ // 自动填充通常发生在挂载之后,补两次校验;后退恢复走 pageshow
75
+ this.clearStaleValue()
76
+ this.staleTimer = setTimeout(() => this.clearStaleValue(), 300)
77
+ window.addEventListener('pageshow', this.clearStaleValue)
78
+ },
79
+ beforeUnmount () {
80
+ clearTimeout(this.staleTimer)
81
+ window.removeEventListener('pageshow', this.clearStaleValue)
82
+ },
66
83
  template: `
67
84
  <div v-if="hasAffix" class="djm-input-wrap">
68
85
  <input
package/src/index.js CHANGED
@@ -345,7 +345,7 @@ const components = [
345
345
  DjmPageTabs
346
346
  ]
347
347
 
348
- export const version = '0.67.2'
348
+ export const version = '0.67.3'
349
349
 
350
350
  export function install (app, options = {}) {
351
351
  if (options.locale) setLocale(options.locale)
@@ -277,6 +277,16 @@
277
277
  flex: none;
278
278
  margin-left: 8px;
279
279
  }
280
+ /* 浏览器自动填充检测:命中 :autofill 时触发一次极短动画,供脚本清空非登录输入 */
281
+ @keyframes djm-autofill-detect {
282
+ from { outline-color: transparent; }
283
+ to { outline-color: transparent; }
284
+ }
285
+
286
+ .djm-app input:-webkit-autofill {
287
+ animation: djm-autofill-detect 1ms;
288
+ }
289
+
280
290
  /* ---------------- 侧栏 ---------------- */
281
291
 
282
292
  .djm-sidebar {
@@ -297,7 +307,11 @@
297
307
  flex: 1;
298
308
  min-height: 0;
299
309
  overflow-y: auto;
300
- padding: 10px 8px 12px;
310
+ /* 左右留白一致,行内再留 8px,内容距侧栏边框统一 16px */
311
+ padding: 12px 8px;
312
+ /* 有滚动条时两侧同时预留,避免右侧被挤窄造成左右不对称 */
313
+ scrollbar-gutter: stable both-edges;
314
+ scrollbar-width: thin;
301
315
  }
302
316
 
303
317
  .djm-nav-tree {
@@ -309,10 +323,10 @@
309
323
  position: relative;
310
324
  display: flex;
311
325
  align-items: center;
312
- gap: 7px;
313
- height: 33px;
314
- padding-right: 6px;
315
- border-radius: 5px;
326
+ gap: 8px;
327
+ height: 36px;
328
+ padding-right: 8px;
329
+ border-radius: var(--djm-radius-lg);
316
330
  color: var(--djm-text-side);
317
331
  font-size: 13px;
318
332
  cursor: pointer;
@@ -321,16 +335,21 @@
321
335
  transition: background 0.14s, color 0.14s;
322
336
  }
323
337
 
338
+ /* 组内相邻行紧一点,组与组之间靠 .djm-root 拉开 */
324
339
  .djm-tree-row + .djm-tree-row {
325
- margin-top: 1px;
340
+ margin-top: 2px;
326
341
  }
327
342
 
328
343
  .djm-tree-row.djm-root {
329
- margin-top: 8px;
344
+ margin-top: 14px;
330
345
  font-weight: 500;
331
346
  color: var(--djm-text-nav);
332
347
  }
333
348
 
349
+ .djm-tree-row.djm-root:first-child {
350
+ margin-top: 0;
351
+ }
352
+
334
353
  .djm-tree-row:hover {
335
354
  background: var(--djm-surface-3);
336
355
  color: var(--djm-text);
@@ -409,27 +428,28 @@
409
428
  flex: none;
410
429
  display: inline-flex;
411
430
  align-items: center;
412
- height: 17px;
413
- padding: 0 5px;
414
- border-radius: 4px;
431
+ height: 18px;
432
+ padding: 0 6px;
433
+ border-radius: 9px;
415
434
  background: var(--djm-hover);
416
435
  color: var(--djm-text-2);
417
- font-size: 10px;
436
+ font-size: 11px;
418
437
  font-weight: 500;
438
+ font-variant-numeric: tabular-nums;
419
439
  }
420
440
 
421
441
  .djm-tree-row.djm-is-active .djm-nav-count {
422
- padding: 0 4px;
442
+ padding: 0 5px;
423
443
  border: 1px solid var(--djm-brand-200);
424
444
  background: var(--djm-surface);
425
445
  color: var(--djm-brand-700);
426
446
  }
427
447
 
428
448
  .djm-nav-tip {
429
- margin: 10px 2px 0;
430
- padding: 8px 8px 0;
449
+ margin: 12px 0 0;
450
+ padding: 12px 8px 0;
431
451
  border-top: 1px solid var(--djm-border);
432
- font-size: 10.5px;
452
+ font-size: 11px;
433
453
  color: var(--djm-text-3);
434
454
  }
435
455