@code-id-labs/components 1.0.4 → 1.0.6
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 +1 @@
|
|
|
1
|
-
const e=require("../../weapp-vendors/miniapp-machine.js"),t=require("../../weapp-vendors/miniapp-behavior.js"),n=require("../../computed-behavior.js");function r(t,n){if(e._typeof(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e._typeof(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function i(t){var n=r(t,`string`);return e._typeof(n)==`symbol`?n:n+``}function a(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(o||{}),s=[0,1],c=[1,0],l=[2,3],u=[3,2],d={L:s,M:c,Q:l,H:u},f=/^\d*$/,p=/^[A-Z0-9 $%*+./:-]*$/,m=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,h=1,g=40,_=3,v=3,y=40,b=10,x=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],S=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],C=class{constructor(e,t,n,r){if(a(this,`size`,void 0),a(this,`mask`,void 0),a(this,`modules`,[]),a(this,`types`,[]),this.version=e,this.ecc=t,e<h||e>g)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let o=this.addEccAndInterleave(n);if(this.drawCodewords(o),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,o.Timing),this.setFunctionModule(e,6,e%2==0,o.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,T(r,e));this.setFunctionModule(8,7,T(r,6)),this.setFunctionModule(8,8,T(r,7)),this.setFunctionModule(7,8,T(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,T(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,T(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,T(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=T(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,s=t+n;a>=0&&a<this.size&&s>=0&&s<this.size&&this.setFunctionModule(a,s,i!==2&&i!==4,o.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,o.Alignment)}setFunctionModule(e,t,n,r=o.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==L(t,n))throw RangeError(`Invalid argument`);let r=S[n[0]][t],i=x[n[0]][t],a=Math.floor(I(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=R(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=z(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(I(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=T(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=_:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*y),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*y}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=_:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*y),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*y}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=v)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*b,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function w(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function T(e,t){return!!(e>>>t&1)}var E=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},D=[1,10,12,14],ee=[2,9,11,13],te=[4,8,16,16];function O(e,t){return e[Math.floor((t+7)/17)+1]}function k(e){let t=[];for(let n of e)w(n,8,t);return new E(te,e.length,t)}function ne(e){if(!M(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);w(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new E(D,e.length,t)}function A(e){if(!N(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n=0;for(;n+2<=e.length;n+=2){let r=m.indexOf(e.charAt(n))*45;r+=m.indexOf(e.charAt(n+1)),w(r,11,t)}return n<e.length&&w(m.indexOf(e.charAt(n)),6,t),new E(ee,e.length,t)}function j(e){return e===``?[]:M(e)?[ne(e)]:N(e)?[A(e)]:[k(F(e))]}function M(e){return f.test(e)}function N(e){return p.test(e)}function P(e,t){let n=0;for(let r of e){let e=O(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function F(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function I(e){if(e<h||e>g)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function L(e,t){return Math.floor(I(e)/8)-x[t[0]][e]*S[t[0]][e]}function R(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=B(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=B(n,2)}return t}function z(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=B(t,e))}return n}function B(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function V(e,t,n=1,r=40,i=-1,a=!0){if(!(h<=n&&n<=r&&r<=g)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=L(o,t)*8,i=P(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[c,l,u])a&&s<=L(o,e)*8&&(t=e);let d=[];for(let t of e){w(t.mode[0],4,d),w(t.numChars,O(t.mode,o),d);for(let e of t.getData())d.push(e)}let f=L(o,t)*8;w(0,Math.min(4,f-d.length),d),w(0,(8-d.length%8)%8,d);for(let e=236;d.length<f;e^=253)w(e,8,d);let p=Array.from({length:Math.ceil(d.length/8)},()=>0);return d.forEach((e,t)=>p[t>>>3]|=e<<7-(t&7)),new C(o,t,p,i)}function H(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?j(e):Array.isArray(e)?[k(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=V(c,d[n],i,a,o,r),u=U({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function U(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=o.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}var W=t=>e.partId(t,`qr`,`root`,`r`),G=t=>e.optPartId(t,`frame`),K=t=>e.optPartId(t,`pattern`),q=t=>e.optPartId(t,`overlay`);function J(e){let{state:t,send:n,context:r,computed:i,scope:a}=e,o=t.get(),s=r.get(`value`),c=i(`pixelSize`),l=i(`resolvedEncoding`),u=i(`ecc`),d=i(`border`),f=i(`encoded`),p=i(`viewBoxSize`),m=i(`path`),h=i(`dataUrl`),g={id:W(a),"data-state":o,"data-ecc":u,"aria-role":`img`,"aria-label":i(`ariaLabel`),style:i(`rootStyle`)},_={id:G(a),src:h,mode:`aspectFit`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${p} ${p}`,width:p,height:p},v={id:K(a),d:m,fill:`currentColor`},y={id:q(a),"aria-hidden":!0};return{state:o,value:s,encoded:f,path:m,viewBoxSize:p,matrixSize:f.size,pixelSize:c,ecc:u,border:d,encoding:l,dataUrl:h,setValue(e){n({type:`VALUE.SET`,value:e})},setEncoding(e){n({type:`ENCODING.SET`,encoding:e})},getDataUrl(e=`svg`){return h},getRootProps(){return g},getFrameProps(){return _},getPatternProps(){return v},getOverlayProps(){return y},rootProps:g,frameProps:_,patternProps:v,overlayProps:y}}var Y={value:null,defaultValue:``,ecc:`M`,border:0,encoding:{},pixelSize:10,color:`neutral`},X=new Set([`L`,`M`,`Q`,`H`]);function re(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e,n=t[500]??t[500]??t.default??Object.values(t)[0];if(typeof n==`string`)return n}}function ie(t){if(typeof t!=`string`)return`#000000`;let n=t.trim();if(!n)return`#000000`;if(n.startsWith(`#`)||n.startsWith(`rgb`)||n.startsWith(`hsl`)||n.startsWith(`oklch`))return n;let r=n.toLowerCase();if(r===`black`)return`#000000`;if(r===`white`)return`#ffffff`;let i=r;try{let t=e.getColors(),n=new Set;for(;i&&!n.has(i);){n.add(i);let e=re(t[i]);if(!e)break;let r=e.trim();if(r.startsWith(`#`)||r.startsWith(`rgb`)||r.startsWith(`hsl`)||r.startsWith(`oklch`))return r;i=r.toLowerCase()}}catch{}return`#000000`}function Z(e){if(typeof e==`string`){let t=e.toUpperCase();if(X.has(t))return t}return`M`}function Q(e){let t=Number(e);return Number.isFinite(t)&&t>=0?Math.floor(t):0}function $(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:10}var ae={version:1,size:0,maskPattern:0,data:[],types:[]},oe=e.createMachine({props:({props:e})=>({...Y,...e}),initialState:()=>`idle`,context:({prop:e,bindable:t})=>({value:t(()=>{let t=e(`value`);return{value:t===null?void 0:String(t),defaultValue:e(`defaultValue`),onChange:t=>{e(`onChange`)?.({value:t})}}}),ecc:t(()=>({value:Z(e(`ecc`)),defaultValue:Z(Y.ecc)})),border:t(()=>({value:Q(e(`border`)),defaultValue:Q(Y.border)})),encoding:t(()=>({value:e(`encoding`),defaultValue:Y.encoding}))}),computed:{ecc:({context:e})=>Z(e.get(`encoding`).ecc??e.get(`ecc`)),border:({context:e})=>Q(e.get(`encoding`).border??e.get(`border`)),resolvedEncoding:({context:e,computed:t})=>({...e.get(`encoding`),ecc:t(`ecc`),border:t(`border`)}),pixelSize:({prop:e})=>$(e(`pixelSize`)),encoded:({context:e,computed:t})=>{let n=e.get(`value`),r=t(`resolvedEncoding`),i={ecc:t(`ecc`),border:t(`border`)};r.maskPattern!==void 0&&(i.maskPattern=r.maskPattern),r.boostEcc!==void 0&&(i.boostEcc=r.boostEcc),r.minVersion!==void 0&&(i.minVersion=r.minVersion),r.maxVersion!==void 0&&(i.maxVersion=r.maxVersion),r.invert!==void 0&&(i.invert=r.invert);try{return H(n,i)}catch{return ae}},viewBoxSize:({computed:e})=>e(`encoded`).size*e(`pixelSize`),path:({computed:e})=>{let t=e(`encoded`),n=e(`pixelSize`),{size:r,data:i}=t,a=[];for(let e=0;e<r;e++){let t=i[e];if(t){for(let i=0;i<r;i++)if(t[i]){let t=i*n,r=e*n;a.push(`M${t},${r}h${n}v${n}h-${n}z`)}}}return a.join(``)},dataUrl:({prop:e,computed:t})=>{let n=t(`viewBoxSize`),r=t(`path`);if(n<=0)return``;let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n} ${n}" width="${n}" height="${n}"><path fill="${ie(e(`color`))}" d="${r}"/></svg>`;return`data:image/svg+xml,${encodeURIComponent(i)}`},rootStyle:({computed:e})=>{let t=e(`pixelSize`),n=e(`viewBoxSize`);return`--qrcode-pixel-size: ${t}px; --qrcode-width: ${n}px; --qrcode-height: ${n}px;`},ariaLabel:({context:e})=>{let t=e.get(`value`);return t?`QR code for ${t}`:`QR code`}},on:{"VALUE.SET":{actions:[`setValueContext`]},SET_VALUE:{actions:[`setValueContext`]},"ENCODING.SET":{actions:[`setEncodingContext`]},SET_ENCODING:{actions:[`setEncodingContext`]}},states:{idle:{}},implementations:{actions:{setValueContext:({context:e,event:t})=>{`value`in t&&e.set(`value`,String(t.value))},setEncodingContext:({context:e,event:t})=>{if(`encoding`in t&&t.encoding){let n={...e.get(`encoding`),...t.encoding};e.set(`encoding`,n),t.encoding.ecc!==void 0&&e.set(`ecc`,Z(t.encoding.ecc)),t.encoding.border!==void 0&&e.set(`border`,Q(t.encoding.border))}}}}}),se={slots:{root:`relative inline-flex items-center justify-center rounded-md bg-white border border-neutral-200 shadow-sm`,frame:`w-full h-full block`,pattern:`fill-current`,overlay:`absolute inset-0 m-auto flex items-center justify-center rounded-lg bg-white p-1 shadow-sm`,overlayImage:`w-full h-full rounded-sm`},variants:{color:{neutral:{root:`text-neutral-900`},...Object.fromEntries([`primary`,`secondary`,`danger`,`success`,`warning`,`info`].map(e=>[e,{root:`text-${e}`}]))},size:{xs:{root:`w-24 h-24 p-1.5`,overlay:`w-6 h-6`},sm:{root:`w-32 h-32 p-2`,overlay:`w-8 h-8`},md:{root:`w-40 h-40 p-2.5`,overlay:`w-10 h-10`},lg:{root:`w-48 h-48 p-3`,overlay:`w-12 h-12`},xl:{root:`w-56 h-56 p-3.5`,overlay:`w-14 h-14`}}},defaultVariants:{color:`neutral`,size:`md`}},ce=e.tv(se),le=t.createMachineBehavior({machine:oe,connect:J,key:`qrCode`,exportApi:!0,exportApiKeys:[`value`,`dataUrl`,`setValue`,`setEncoding`,`getDataUrl`]});Component(n.createComponentOptions({behaviors:[le,n.computedBehavior],slots:{overlay:!1},properties:t.createProperties(Y,{size:{type:String,value:`md`},overlaySrc:{type:String,value:``},showOverlay:{type:Boolean,value:!1},ui:{type:Object,value:{}},className:{type:String,value:``},rootStyle:{type:String,value:``}}),computed:{classes(){let t=ce({size:this.data.size,color:this.data.color});return e.resolveSlots(t,this.data.ui,this.data.className)}},methods:{setValue(t){e.getApi(this,`qrCode`)?.setValue(t)},setEncoding(t){e.getApi(this,`qrCode`)?.setEncoding(t)},getDataUrl(t=`svg`){return e.getApi(this,`qrCode`)?.getDataUrl(t)??``}}}));
|
|
1
|
+
const e=require("../../weapp-vendors/miniapp-machine.js"),t=require("../../weapp-vendors/miniapp-behavior.js"),n=require("../../computed-behavior.js");function r(t,n){if(e._typeof(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e._typeof(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function i(t){var n=r(t,`string`);return e._typeof(n)==`symbol`?n:n+``}function a(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(o||{}),s=[0,1],c=[1,0],l=[2,3],u=[3,2],d={L:s,M:c,Q:l,H:u},f=/^\d*$/,p=/^[A-Z0-9 $%*+./:-]*$/,m=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,h=1,g=40,_=3,v=3,y=40,b=10,x=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],S=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],C=class{constructor(e,t,n,r){if(a(this,`size`,void 0),a(this,`mask`,void 0),a(this,`modules`,[]),a(this,`types`,[]),this.version=e,this.ecc=t,e<h||e>g)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let o=this.addEccAndInterleave(n);if(this.drawCodewords(o),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,o.Timing),this.setFunctionModule(e,6,e%2==0,o.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,T(r,e));this.setFunctionModule(8,7,T(r,6)),this.setFunctionModule(8,8,T(r,7)),this.setFunctionModule(7,8,T(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,T(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,T(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,T(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=T(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,s=t+n;a>=0&&a<this.size&&s>=0&&s<this.size&&this.setFunctionModule(a,s,i!==2&&i!==4,o.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,o.Alignment)}setFunctionModule(e,t,n,r=o.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==L(t,n))throw RangeError(`Invalid argument`);let r=S[n[0]][t],i=x[n[0]][t],a=Math.floor(I(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=R(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=z(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(I(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=T(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=_:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*y),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*y}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=_:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*y),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*y}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=v)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*b,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function w(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function T(e,t){return!!(e>>>t&1)}var E=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},D=[1,10,12,14],ee=[2,9,11,13],te=[4,8,16,16];function O(e,t){return e[Math.floor((t+7)/17)+1]}function k(e){let t=[];for(let n of e)w(n,8,t);return new E(te,e.length,t)}function ne(e){if(!M(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);w(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new E(D,e.length,t)}function A(e){if(!N(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n=0;for(;n+2<=e.length;n+=2){let r=m.indexOf(e.charAt(n))*45;r+=m.indexOf(e.charAt(n+1)),w(r,11,t)}return n<e.length&&w(m.indexOf(e.charAt(n)),6,t),new E(ee,e.length,t)}function j(e){return e===``?[]:M(e)?[ne(e)]:N(e)?[A(e)]:[k(F(e))]}function M(e){return f.test(e)}function N(e){return p.test(e)}function P(e,t){let n=0;for(let r of e){let e=O(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function F(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function I(e){if(e<h||e>g)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function L(e,t){return Math.floor(I(e)/8)-x[t[0]][e]*S[t[0]][e]}function R(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=B(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=B(n,2)}return t}function z(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=B(t,e))}return n}function B(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function V(e,t,n=1,r=40,i=-1,a=!0){if(!(h<=n&&n<=r&&r<=g)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=L(o,t)*8,i=P(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[c,l,u])a&&s<=L(o,e)*8&&(t=e);let d=[];for(let t of e){w(t.mode[0],4,d),w(t.numChars,O(t.mode,o),d);for(let e of t.getData())d.push(e)}let f=L(o,t)*8;w(0,Math.min(4,f-d.length),d),w(0,(8-d.length%8)%8,d);for(let e=236;d.length<f;e^=253)w(e,8,d);let p=Array.from({length:Math.ceil(d.length/8)},()=>0);return d.forEach((e,t)=>p[t>>>3]|=e<<7-(t&7)),new C(o,t,p,i)}function H(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?j(e):Array.isArray(e)?[k(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=V(c,d[n],i,a,o,r),u=U({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function U(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=o.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}var W=t=>e.partId(t,`qr`,`root`,`r`),G=t=>e.optPartId(t,`frame`),K=t=>e.optPartId(t,`pattern`),q=t=>e.optPartId(t,`overlay`);function J(e){let{state:t,send:n,context:r,computed:i,scope:a}=e,o=t.get(),s=r.get(`value`),c=i(`pixelSize`),l=i(`resolvedEncoding`),u=i(`ecc`),d=i(`border`),f=i(`encoded`),p=i(`viewBoxSize`),m=i(`path`),h=i(`dataUrl`),g={id:W(a),"data-state":o,"data-ecc":u,"aria-role":`img`,"aria-label":i(`ariaLabel`),style:i(`rootStyle`)},_={id:G(a),src:h,mode:`aspectFit`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${p} ${p}`,width:p,height:p},v={id:K(a),d:m,fill:`currentColor`},y={id:q(a),"aria-hidden":!0};return{state:o,value:s,encoded:f,path:m,viewBoxSize:p,matrixSize:f.size,pixelSize:c,ecc:u,border:d,encoding:l,dataUrl:h,setValue(e){n({type:`VALUE.SET`,value:e})},setEncoding(e){n({type:`ENCODING.SET`,encoding:e})},getDataUrl(e=`svg`){return h},getRootProps(){return g},getFrameProps(){return _},getPatternProps(){return v},getOverlayProps(){return y},rootProps:g,frameProps:_,patternProps:v,overlayProps:y}}var Y={value:null,defaultValue:``,ecc:`M`,border:0,encoding:{},pixelSize:10,color:`neutral`},X=new Set([`L`,`M`,`Q`,`H`]);function re(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e,n=t[500]??t[500]??t.default??Object.values(t)[0];if(typeof n==`string`)return n}}function ie(t){if(typeof t!=`string`)return`#000000`;let n=t.trim();if(!n)return`#000000`;if(n.startsWith(`#`)||n.startsWith(`rgb`)||n.startsWith(`hsl`)||n.startsWith(`oklch`))return n;let r=n.toLowerCase();if(r===`black`)return`#000000`;if(r===`white`)return`#ffffff`;let i=r;try{let t=e.getColors(),n=new Set;for(;i&&!n.has(i);){n.add(i);let e=re(t[i]);if(!e)break;let r=e.trim();if(r.startsWith(`#`)||r.startsWith(`rgb`)||r.startsWith(`hsl`)||r.startsWith(`oklch`))return r;i=r.toLowerCase()}}catch{}return`#000000`}function Z(e){if(typeof e==`string`){let t=e.toUpperCase();if(X.has(t))return t}return`M`}function Q(e){let t=Number(e);return Number.isFinite(t)&&t>=0?Math.floor(t):0}function $(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:10}var ae={version:1,size:0,maskPattern:0,data:[],types:[]},oe=e.createMachine({props:({props:e})=>({...Y,...e}),initialState:()=>`idle`,context:({prop:e,bindable:t})=>({value:t(()=>{let t=e(`value`);return{value:t===null?void 0:String(t),defaultValue:e(`defaultValue`),onChange:t=>{e(`onChange`)?.({value:t})}}}),ecc:t(()=>({value:Z(e(`ecc`)),defaultValue:Z(Y.ecc)})),border:t(()=>({value:Q(e(`border`)),defaultValue:Q(Y.border)})),encoding:t(()=>({value:e(`encoding`),defaultValue:Y.encoding}))}),computed:{ecc:({context:e})=>Z(e.get(`encoding`).ecc??e.get(`ecc`)),border:({context:e})=>Q(e.get(`encoding`).border??e.get(`border`)),resolvedEncoding:({context:e,computed:t})=>({...e.get(`encoding`),ecc:t(`ecc`),border:t(`border`)}),pixelSize:({prop:e})=>$(e(`pixelSize`)),encoded:({context:e,computed:t})=>{let n=e.get(`value`),r=t(`resolvedEncoding`),i={ecc:t(`ecc`),border:t(`border`)};r.maskPattern!==void 0&&(i.maskPattern=r.maskPattern),r.boostEcc!==void 0&&(i.boostEcc=r.boostEcc),r.minVersion!==void 0&&(i.minVersion=r.minVersion),r.maxVersion!==void 0&&(i.maxVersion=r.maxVersion),r.invert!==void 0&&(i.invert=r.invert);try{return H(n,i)}catch{return ae}},viewBoxSize:({computed:e})=>e(`encoded`).size*e(`pixelSize`),path:({computed:e})=>{let t=e(`encoded`),n=e(`pixelSize`),{size:r,data:i}=t,a=[];for(let e=0;e<r;e++){let t=i[e];if(t){for(let i=0;i<r;i++)if(t[i]){let t=i*n,r=e*n;a.push(`M${t},${r}h${n}v${n}h-${n}z`)}}}return a.join(``)},dataUrl:({prop:e,computed:t})=>{let n=t(`viewBoxSize`),r=t(`path`);if(n<=0)return``;let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n} ${n}" width="${n}" height="${n}"><path fill="${ie(e(`color`))}" d="${r}"/></svg>`;return`data:image/svg+xml,${encodeURIComponent(i)}`},rootStyle:({computed:e})=>{let t=e(`pixelSize`),n=e(`viewBoxSize`);return`--qrcode-pixel-size: ${t}px; --qrcode-width: ${n}px; --qrcode-height: ${n}px;`},ariaLabel:({context:e})=>{let t=e.get(`value`);return t?`QR code for ${t}`:`QR code`}},on:{"VALUE.SET":{actions:[`setValueContext`]},SET_VALUE:{actions:[`setValueContext`]},"ENCODING.SET":{actions:[`setEncodingContext`]},SET_ENCODING:{actions:[`setEncodingContext`]}},states:{idle:{}},implementations:{actions:{setValueContext:({context:e,event:t})=>{`value`in t&&e.set(`value`,String(t.value))},setEncodingContext:({context:e,event:t})=>{if(`encoding`in t&&t.encoding){let n={...e.get(`encoding`),...t.encoding};e.set(`encoding`,n),t.encoding.ecc!==void 0&&e.set(`ecc`,Z(t.encoding.ecc)),t.encoding.border!==void 0&&e.set(`border`,Q(t.encoding.border))}}}}}),se={slots:{root:`relative inline-flex items-center justify-center rounded-md bg-white border border-neutral-200 shadow-sm`,frame:`w-full h-full block`,pattern:`fill-current`,overlay:`absolute inset-0 m-auto flex items-center justify-center rounded-lg bg-white p-1 shadow-sm`,overlayImage:`w-full h-full rounded-sm`},variants:{color:{neutral:{root:`text-neutral-900`},...Object.fromEntries([`primary`,`secondary`,`danger`,`success`,`warning`,`info`].map(e=>[e,{root:`text-${e}`}]))},size:{xs:{root:`w-24 h-24 p-1.5`,overlay:`w-6 h-6`},sm:{root:`w-32 h-32 p-2`,overlay:`w-8 h-8`},md:{root:`w-40 h-40 p-2.5`,overlay:`w-10 h-10`},lg:{root:`w-48 h-48 p-3`,overlay:`w-12 h-12`},xl:{root:`w-56 h-56 p-3.5`,overlay:`w-14 h-14`}}},defaultVariants:{color:`neutral`,size:`md`}},ce=e.tv(se),le=t.createMachineBehavior({machine:oe,connect:J,key:`qrCode`,exportApi:!0,exportApiKeys:[`value`,`dataUrl`,`setValue`,`setEncoding`,`getDataUrl`]});Component(n.createComponentOptions({behaviors:[le,n.computedBehavior],slots:{overlay:!1},properties:t.createProperties(Y,{size:{type:String,value:`md`},overlaySrc:{type:String,value:``},showOverlay:{type:Boolean,value:!1},ui:{type:Object,value:{}},className:{type:String,value:``}}),computed:{classes(){let t=ce({size:this.data.size,color:this.data.color});return e.resolveSlots(t,this.data.ui,this.data.className)}},methods:{setValue(t){e.getApi(this,`qrCode`)?.setValue(t)},setEncoding(t){e.getApi(this,`qrCode`)?.setEncoding(t)},getDataUrl(t=`svg`){return e.getApi(this,`qrCode`)?.getDataUrl(t)??``}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<view id="{{qrCode.rootProps.id}}" class="{{classes.root}}" style="{{qrCode.rootProps.style}}
|
|
1
|
+
<view id="{{qrCode.rootProps.id}}" class="{{classes.root}}" style="{{qrCode.rootProps.style}}" data-scope="qr-code" data-part="root" data-state="{{qrCode.state}}" data-size="{{size}}" data-color="{{color}}" data-ecc="{{qrCode.ecc}}" aria-role="img" aria-label="{{qrCode.rootProps['aria-label']}}"><image class="{{classes.frame}}" data-scope="qr-code" data-part="frame" src="{{qrCode.dataUrl}}" mode="aspectFit"/><view wx:if="{{showOverlay || overlaySrc || slots.overlay}}" class="{{classes.overlay}}" aria-hidden="{{true}}" data-scope="qr-code" data-part="overlay"><image wx:if="{{overlaySrc}}" src="{{overlaySrc}}" class="{{classes.overlayImage}}" mode="aspectFit"/><slot name="overlay"/></view></view>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-id-labs/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Prebuilt native WeChat MiniProgram UI components for code-ui",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -317,8 +317,8 @@
|
|
|
317
317
|
"@code-id-labs/pin-input": "0.0.1",
|
|
318
318
|
"@code-id-labs/progress": "0.0.1",
|
|
319
319
|
"@code-id-labs/pull-down-refresh": "0.0.1",
|
|
320
|
-
"@code-id-labs/radio": "0.0.1",
|
|
321
320
|
"@code-id-labs/qr-code": "0.0.1",
|
|
321
|
+
"@code-id-labs/radio": "0.0.1",
|
|
322
322
|
"@code-id-labs/radio-group": "0.0.1",
|
|
323
323
|
"@code-id-labs/select": "0.0.1",
|
|
324
324
|
"@code-id-labs/select-item": "0.0.1",
|
|
@@ -327,8 +327,8 @@
|
|
|
327
327
|
"@code-id-labs/stepper-item": "0.0.1",
|
|
328
328
|
"@code-id-labs/swipe-cell": "0.0.1",
|
|
329
329
|
"@code-id-labs/switch": "0.0.1",
|
|
330
|
-
"@code-id-labs/tabs-item": "0.0.1",
|
|
331
330
|
"@code-id-labs/tabs": "0.0.1",
|
|
331
|
+
"@code-id-labs/tabs-item": "0.0.1",
|
|
332
332
|
"@code-id-labs/textarea": "0.0.1",
|
|
333
333
|
"@code-id-labs/toast": "0.0.1",
|
|
334
334
|
"@code-id-labs/utils": "0.0.1"
|