n-design-readonly-plugin 1.0.11 → 1.0.12
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 +3 -0
- package/dist/index.cjs.js +3 -3
- package/dist/index.d.ts +12 -1
- package/dist/index.es.js +238 -234
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("vue"),p=require("n-designv3");function x(e,t){Me(e)&&(e="100%");var r=Re(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Me(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Re(e){return typeof e=="string"&&e.indexOf("%")!==-1}function $e(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function B(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Y(e){return e.length===1?"0"+e:String(e)}function _e(e,t,r){return{r:x(e,255)*255,g:x(t,255)*255,b:x(r,255)*255}}function J(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function De(e,t,r){var n,a,o;if(e=x(e,360),t=x(t,100),r=x(r,100),t===0)a=r,o=r,n=r;else{var i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;n=J(l,i,e+1/3),a=J(l,i,e),o=J(l,i,e-1/3)}return{r:n*255,g:a*255,b:o*255}}function Le(e,t,r){e=x(e,255),t=x(t,255),r=x(r,255);var n=Math.max(e,t,r),a=Math.min(e,t,r),o=0,i=n,l=n-a,c=n===0?0:l/n;if(n===a)o=0;else{switch(n){case e:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-e)/l+2;break;case r:o=(e-t)/l+4;break}o/=6}return{h:o,s:c,v:i}}function He(e,t,r){e=x(e,360)*6,t=x(t,100),r=x(r,100);var n=Math.floor(e),a=e-n,o=r*(1-t),i=r*(1-a*t),l=r*(1-(1-a)*t),c=n%6,f=[r,i,o,o,l,r][c],d=[l,r,r,i,o,o][c],O=[o,o,l,r,r,i][c];return{r:f*255,g:d*255,b:O*255}}function Be(e,t,r,n){var a=[Y(Math.round(e).toString(16)),Y(Math.round(t).toString(16)),Y(Math.round(r).toString(16))];return a.join("")}function le(e){return w(e)/255}function w(e){return parseInt(e,16)}var ce={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function R(e){var t={r:0,g:0,b:0},r=1,n=null,a=null,o=null,i=!1,l=!1;return typeof e=="string"&&(e=We(e)),typeof e=="object"&&(j(e.r)&&j(e.g)&&j(e.b)?(t=_e(e.r,e.g,e.b),i=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):j(e.h)&&j(e.s)&&j(e.v)?(n=B(e.s),a=B(e.v),t=He(e.h,n,a),i=!0,l="hsv"):j(e.h)&&j(e.s)&&j(e.l)&&(n=B(e.s),o=B(e.l),t=De(e.h,n,o),i=!0,l="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=$e(r),{ok:i,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var ze="[-\\+]?\\d+%?",Ue="[-\\+]?\\d*\\.\\d+%?",I="(?:".concat(Ue,")|(?:").concat(ze,")"),Z="[\\s|\\(]+(".concat(I,")[,|\\s]+(").concat(I,")[,|\\s]+(").concat(I,")\\s*\\)?"),Q="[\\s|\\(]+(".concat(I,")[,|\\s]+(").concat(I,")[,|\\s]+(").concat(I,")[,|\\s]+(").concat(I,")\\s*\\)?"),T={CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+Z),rgba:new RegExp("rgba"+Q),hsl:new RegExp("hsl"+Z),hsla:new RegExp("hsla"+Q),hsv:new RegExp("hsv"+Z),hsva:new RegExp("hsva"+Q),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function We(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(ce[e])e=ce[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=T.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=T.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=T.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=T.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=T.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=T.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=T.hex8.exec(e),r?{r:w(r[1]),g:w(r[2]),b:w(r[3]),a:le(r[4]),format:t?"name":"hex8"}:(r=T.hex6.exec(e),r?{r:w(r[1]),g:w(r[2]),b:w(r[3]),format:t?"name":"hex"}:(r=T.hex4.exec(e),r?{r:w(r[1]+r[1]),g:w(r[2]+r[2]),b:w(r[3]+r[3]),a:le(r[4]+r[4]),format:t?"name":"hex8"}:(r=T.hex3.exec(e),r?{r:w(r[1]+r[1]),g:w(r[2]+r[2]),b:w(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function j(e){return!!T.CSS_UNIT.exec(String(e))}var z=2,fe=.16,qe=.05,Ge=.05,Ke=.15,we=5,Se=4,Ve=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function ue(e){var t=e.r,r=e.g,n=e.b,a=Le(t,r,n);return{h:a.h*360,s:a.s,v:a.v}}function U(e){var t=e.r,r=e.g,n=e.b;return"#".concat(Be(t,r,n))}function Ye(e,t,r){var n=r/100,a={r:(t.r-e.r)*n+e.r,g:(t.g-e.g)*n+e.g,b:(t.b-e.b)*n+e.b};return a}function se(e,t,r){var n;return Math.round(e.h)>=60&&Math.round(e.h)<=240?n=r?Math.round(e.h)-z*t:Math.round(e.h)+z*t:n=r?Math.round(e.h)+z*t:Math.round(e.h)-z*t,n<0?n+=360:n>=360&&(n-=360),n}function de(e,t,r){if(e.h===0&&e.s===0)return e.s;var n;return r?n=e.s-fe*t:t===Se?n=e.s+fe:n=e.s+qe*t,n>1&&(n=1),r&&t===we&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function pe(e,t,r){var n;return r?n=e.v+Ge*t:n=e.v-Ke*t,n>1&&(n=1),Number(n.toFixed(2))}function te(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[],n=R(e),a=we;a>0;a-=1){var o=ue(n),i=U(R({h:se(o,a,!0),s:de(o,a,!0),v:pe(o,a,!0)}));r.push(i)}r.push(U(n));for(var l=1;l<=Se;l+=1){var c=ue(n),f=U(R({h:se(c,l),s:de(c,l),v:pe(c,l)}));r.push(f)}return t.theme==="dark"?Ve.map(function(d){var O=d.index,v=d.opacity,N=U(Ye(R(t.backgroundColor||"#141414"),R(r[O]),v*100));return N}):r}var X={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},ee={},re={};Object.keys(X).forEach(function(e){ee[e]=te(X[e]),ee[e].primary=ee[e][5],re[e]=te(X[e],{theme:"dark",backgroundColor:"#141414"}),re[e].primary=re[e][5]});var be=[],$=[],Je="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function Ze(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}function Qe(e,t){if(t=t||{},e===void 0)throw new Error(Je);var r=t.prepend===!0?"prepend":"append",n=t.container!==void 0?t.container:document.querySelector("head"),a=be.indexOf(n);a===-1&&(a=be.push(n)-1,$[a]={});var o;return $[a]!==void 0&&$[a][r]!==void 0?o=$[a][r]:(o=$[a][r]=Ze(),r==="prepend"?n.insertBefore(o,n.childNodes[0]):n.appendChild(o)),e.charCodeAt(0)===65279&&(e=e.substr(1,e.length)),o.styleSheet?o.styleSheet.cssText+=e:o.textContent+=e,o}function ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.forEach(function(a){Xe(e,a,r[a])})}return e}function Xe(e,t,r){return t=er(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function er(e){var t=rr(e,"string");return typeof t=="symbol"?t:String(t)}function rr(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tr(e,t){process.env.NODE_ENV!=="production"&&!e&&console!==void 0&&console.error("Warning: ".concat(t))}function nr(e,t){tr(e,"[@nancal-icon/icons-vue] ".concat(t))}function ge(e){return typeof e=="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(typeof e.icon=="object"||typeof e.icon=="function")}function ne(e,t,r){return r?u.h(e.tag,ye({key:t},r,e.attrs),(e.children||[]).map(function(n,a){return ne(n,"".concat(t,"-").concat(e.tag,"-").concat(a))})):u.h(e.tag,ye({key:t},e.attrs),(e.children||[]).map(function(n,a){return ne(n,"".concat(t,"-").concat(e.tag,"-").concat(a))}))}function xe(e){return te(e)[0]}function Oe(e){return e?Array.isArray(e)?e:[e]:[]}var ar=`
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("vue"),p=require("n-designv3");function x(e,t){Ee(e)&&(e="100%");var r=Me(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Ee(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Me(e){return typeof e=="string"&&e.indexOf("%")!==-1}function $e(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function B(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Y(e){return e.length===1?"0"+e:String(e)}function _e(e,t,r){return{r:x(e,255)*255,g:x(t,255)*255,b:x(r,255)*255}}function J(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function De(e,t,r){var n,a,o;if(e=x(e,360),t=x(t,100),r=x(r,100),t===0)a=r,o=r,n=r;else{var i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;n=J(l,i,e+1/3),a=J(l,i,e),o=J(l,i,e-1/3)}return{r:n*255,g:a*255,b:o*255}}function Le(e,t,r){e=x(e,255),t=x(t,255),r=x(r,255);var n=Math.max(e,t,r),a=Math.min(e,t,r),o=0,i=n,l=n-a,c=n===0?0:l/n;if(n===a)o=0;else{switch(n){case e:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-e)/l+2;break;case r:o=(e-t)/l+4;break}o/=6}return{h:o,s:c,v:i}}function He(e,t,r){e=x(e,360)*6,t=x(t,100),r=x(r,100);var n=Math.floor(e),a=e-n,o=r*(1-t),i=r*(1-a*t),l=r*(1-(1-a)*t),c=n%6,f=[r,i,o,o,l,r][c],d=[l,r,r,i,o,o][c],T=[o,o,l,r,r,i][c];return{r:f*255,g:d*255,b:T*255}}function Be(e,t,r,n){var a=[Y(Math.round(e).toString(16)),Y(Math.round(t).toString(16)),Y(Math.round(r).toString(16))];return a.join("")}function le(e){return w(e)/255}function w(e){return parseInt(e,16)}var ce={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function M(e){var t={r:0,g:0,b:0},r=1,n=null,a=null,o=null,i=!1,l=!1;return typeof e=="string"&&(e=We(e)),typeof e=="object"&&(P(e.r)&&P(e.g)&&P(e.b)?(t=_e(e.r,e.g,e.b),i=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):P(e.h)&&P(e.s)&&P(e.v)?(n=B(e.s),a=B(e.v),t=He(e.h,n,a),i=!0,l="hsv"):P(e.h)&&P(e.s)&&P(e.l)&&(n=B(e.s),o=B(e.l),t=De(e.h,n,o),i=!0,l="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=$e(r),{ok:i,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var ze="[-\\+]?\\d+%?",Ue="[-\\+]?\\d*\\.\\d+%?",I="(?:".concat(Ue,")|(?:").concat(ze,")"),Z="[\\s|\\(]+(".concat(I,")[,|\\s]+(").concat(I,")[,|\\s]+(").concat(I,")\\s*\\)?"),Q="[\\s|\\(]+(".concat(I,")[,|\\s]+(").concat(I,")[,|\\s]+(").concat(I,")[,|\\s]+(").concat(I,")\\s*\\)?"),O={CSS_UNIT:new RegExp(I),rgb:new RegExp("rgb"+Z),rgba:new RegExp("rgba"+Q),hsl:new RegExp("hsl"+Z),hsla:new RegExp("hsla"+Q),hsv:new RegExp("hsv"+Z),hsva:new RegExp("hsva"+Q),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function We(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(ce[e])e=ce[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=O.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=O.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=O.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=O.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=O.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=O.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=O.hex8.exec(e),r?{r:w(r[1]),g:w(r[2]),b:w(r[3]),a:le(r[4]),format:t?"name":"hex8"}:(r=O.hex6.exec(e),r?{r:w(r[1]),g:w(r[2]),b:w(r[3]),format:t?"name":"hex"}:(r=O.hex4.exec(e),r?{r:w(r[1]+r[1]),g:w(r[2]+r[2]),b:w(r[3]+r[3]),a:le(r[4]+r[4]),format:t?"name":"hex8"}:(r=O.hex3.exec(e),r?{r:w(r[1]+r[1]),g:w(r[2]+r[2]),b:w(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function P(e){return!!O.CSS_UNIT.exec(String(e))}var z=2,fe=.16,qe=.05,Ge=.05,Ke=.15,we=5,Se=4,Ve=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function ue(e){var t=e.r,r=e.g,n=e.b,a=Le(t,r,n);return{h:a.h*360,s:a.s,v:a.v}}function U(e){var t=e.r,r=e.g,n=e.b;return"#".concat(Be(t,r,n))}function Ye(e,t,r){var n=r/100,a={r:(t.r-e.r)*n+e.r,g:(t.g-e.g)*n+e.g,b:(t.b-e.b)*n+e.b};return a}function se(e,t,r){var n;return Math.round(e.h)>=60&&Math.round(e.h)<=240?n=r?Math.round(e.h)-z*t:Math.round(e.h)+z*t:n=r?Math.round(e.h)+z*t:Math.round(e.h)-z*t,n<0?n+=360:n>=360&&(n-=360),n}function de(e,t,r){if(e.h===0&&e.s===0)return e.s;var n;return r?n=e.s-fe*t:t===Se?n=e.s+fe:n=e.s+qe*t,n>1&&(n=1),r&&t===we&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function pe(e,t,r){var n;return r?n=e.v+Ge*t:n=e.v-Ke*t,n>1&&(n=1),Number(n.toFixed(2))}function te(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=[],n=M(e),a=we;a>0;a-=1){var o=ue(n),i=U(M({h:se(o,a,!0),s:de(o,a,!0),v:pe(o,a,!0)}));r.push(i)}r.push(U(n));for(var l=1;l<=Se;l+=1){var c=ue(n),f=U(M({h:se(c,l),s:de(c,l),v:pe(c,l)}));r.push(f)}return t.theme==="dark"?Ve.map(function(d){var T=d.index,v=d.opacity,N=U(Ye(M(t.backgroundColor||"#141414"),M(r[T]),v*100));return N}):r}var X={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},ee={},re={};Object.keys(X).forEach(function(e){ee[e]=te(X[e]),ee[e].primary=ee[e][5],re[e]=te(X[e],{theme:"dark",backgroundColor:"#141414"}),re[e].primary=re[e][5]});var be=[],$=[],Je="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function Ze(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}function Qe(e,t){if(t=t||{},e===void 0)throw new Error(Je);var r=t.prepend===!0?"prepend":"append",n=t.container!==void 0?t.container:document.querySelector("head"),a=be.indexOf(n);a===-1&&(a=be.push(n)-1,$[a]={});var o;return $[a]!==void 0&&$[a][r]!==void 0?o=$[a][r]:(o=$[a][r]=Ze(),r==="prepend"?n.insertBefore(o,n.childNodes[0]):n.appendChild(o)),e.charCodeAt(0)===65279&&(e=e.substr(1,e.length)),o.styleSheet?o.styleSheet.cssText+=e:o.textContent+=e,o}function ye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.forEach(function(a){Xe(e,a,r[a])})}return e}function Xe(e,t,r){return t=er(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function er(e){var t=rr(e,"string");return typeof t=="symbol"?t:String(t)}function rr(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tr(e,t){process.env.NODE_ENV!=="production"&&!e&&console!==void 0&&console.error("Warning: ".concat(t))}function nr(e,t){tr(e,"[@nancal-icon/icons-vue] ".concat(t))}function ge(e){return typeof e=="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(typeof e.icon=="object"||typeof e.icon=="function")}function ne(e,t,r){return r?u.h(e.tag,ye({key:t},r,e.attrs),(e.children||[]).map(function(n,a){return ne(n,"".concat(t,"-").concat(e.tag,"-").concat(a))})):u.h(e.tag,ye({key:t},e.attrs),(e.children||[]).map(function(n,a){return ne(n,"".concat(t,"-").concat(e.tag,"-").concat(a))}))}function xe(e){return te(e)[0]}function Te(e){return e?Array.isArray(e)?e:[e]:[]}var ar=`
|
|
2
2
|
.anticon {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
color: #8091B7;
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
`,me=!1,or=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ar;u.nextTick(function(){me||(typeof window<"u"&&window.document&&window.document.documentElement&&Qe(t,{prepend:!0}),me=!0)})},ir=["icon","primaryColor","secondaryColor"];function lr(e,t){if(e==null)return{};var r=cr(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cr(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function W(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.forEach(function(a){fr(e,a,r[a])})}return e}function fr(e,t,r){return t=ur(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ur(e){var t=sr(e,"string");return typeof t=="symbol"?t:String(t)}function sr(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function dr(e){var t=e.primaryColor,r=e.secondaryColor;_.primaryColor=t,_.secondaryColor=r||xe(t),_.calculated=!!r}function pr(){return W({},_)}var F=function(t,r){var n=W({},t,r.attrs),a=n.icon,o=n.primaryColor,i=n.secondaryColor,l=lr(n,ir),c=_;if(o&&(c={primaryColor:o,secondaryColor:i||xe(o)}),or(),nr(ge(a),"icon should be icon definiton, but got ".concat(a)),!ge(a))return null;var f=a;return f&&typeof f.icon=="function"&&(f=W({},f,{icon:f.icon(c.primaryColor,c.secondaryColor)})),ne(f.icon,"svg-".concat(f.name),W({},l,{"data-icon":f.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"}))};F.props={icon:Object,primaryColor:String,secondaryColor:String,focusable:String};F.inheritAttrs=!1;F.displayName="IconBase";F.getTwoToneColors=pr;F.setTwoToneColors=dr;function br(e,t){return hr(e)||mr(e,t)||gr(e,t)||yr()}function yr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
56
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gr(e,t){if(e){if(typeof e=="string")return he(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return he(e,t)}}function he(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mr(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,o,i,l=[],c=!0,f=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(c=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){f=!0,a=d}finally{try{if(!c&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(f)throw a}}return l}}function hr(e){if(Array.isArray(e))return e}function
|
|
57
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sr(e,t){if(e){if(typeof e=="string")return ve(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ve(e,t)}}function ve(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xr(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,o,i,l=[],c=!0,f=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(c=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){f=!0,a=d}finally{try{if(!c&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(f)throw a}}return l}}function Or(e){if(Array.isArray(e))return e}function ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.forEach(function(a){ae(e,a,r[a])})}return e}function ae(e,t,r){return t=Tr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tr(e){var t=jr(e,"string");return typeof t=="symbol"?t:String(t)}function jr(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nr(e,t){if(e==null)return{};var r=Pr(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pr(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}Te("#1890ff");var M=function(t,r){var n,a=ke({},t,r.attrs),o=a.class,i=a.icon,l=a.spin,c=a.rotate,f=a.tabindex,d=a.twoToneColor,O=a.onClick,v=Nr(a,kr),N=(n={anticon:!0},ae(n,"anticon-".concat(i.name),!!i.name),ae(n,o,o),n),y=l===""||l||i.name==="loading"?"anticon-spin":"",g=f;g===void 0&&O&&(g=-1,v.tabindex=g);var s=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,m=Oe(d),k=Cr(m,2),C=k[0],P=k[1];return u.createVNode("span",ke({role:"img","aria-label":i.name},v,{onClick:O,class:N}),[u.createVNode(F,{class:y,icon:i,primaryColor:C,secondaryColor:P,style:s},null)])};M.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String};M.displayName="AntdIcon";M.inheritAttrs=!1;M.getTwoToneColor=vr;M.setTwoToneColor=Te;var Ar={icon:{tag:"svg",attrs:{viewBox:"32 32 960 960",focusable:"false"},children:[{tag:"path",attrs:{d:"M384 32a96 96 0 00-96 96v96a32 32 0 0064 0v-96a32 32 0 0132-32h512a32 32 0 0132 32v512a32 32 0 01-32 32h-96a32 32 0 000 64h96a96 96 0 0096-96V128a96 96 0 00-96-96H384z"}},{tag:"path",attrs:{d:"M128 288a96 96 0 00-96 96v512a96 96 0 0096 96h512a96 96 0 0096-96V384a96 96 0 00-96-96H128zm-32 96a32 32 0 0132-32h512a32 32 0 0132 32v512a32 32 0 01-32 32H128a32 32 0 01-32-32V384z"}}]},name:"copy",theme:"outlined"};function Ce(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.forEach(function(a){Ir(e,a,r[a])})}return e}function Ir(e,t,r){return t=Fr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fr(e){var t=Er(e,"string");return typeof t=="symbol"?t:String(t)}function Er(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oe=function(t,r){var n=Ce({},t,r.attrs);return u.createVNode(M,Ce({},n,{icon:Ar}),null)};oe.displayName="CopyOutlined";oe.inheritAttrs=!1;function D(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(D).join("");if(typeof e=="object"){if(typeof e.children=="string")return e.children;if(e?.default&&typeof e.default=="function"){const t=e.default();if(Array.isArray(t))return D(t)}e.children&&D(e.children)}return""}function je(e,t={}){const r=new Map,{value:n="value",label:a="label"}=t;if(!e)return r;const o=Array.isArray(e)?e:[e];for(const i of o)if(!(!i||typeof i!="object")){if(i.type&&(typeof i.type=="object"||typeof i.type=="function")){let l=i.type.name?.toLowerCase()||"";if(typeof i.type=="function"?l=i.type.displayName?.toLowerCase()||"":typeof i.type=="string"&&(l=i.type?.toLowerCase()||""),/option|radio|checkbox/i.test(l)){const c=i.props||{},f=c[n]??c.value,d=c[a]??c.label;if(f!=null){const O=D(i.children)||d||String(f);r.set(f,O)}}}i.children&&je(i.children,t).forEach((c,f)=>{r.has(f)||r.set(f,c)})}return r}function Mr(e,t,r){const{value:n="value",label:a="label",children:o="children"}=r,i=[];let l=e;for(const c of t){const f=l.find(d=>d[n]===c);if(f)i.push(f[a]||f[n]||String(c)),l=f[o]||[];else{i.push(String(c));break}}return i}function Rr(e,t,r){const{value:n="value",label:a="title",children:o="children"}=r,i=[],l=new Set(Array.isArray(t)?t:[t]);function c(f){for(const d of f)l.has(d[n])&&i.push(d[a]||d[n]),d[o]&&c(d[o])}return c(e),i}function $r({modelValue:e,options:t,treeData:r,valueToLabel:n,fieldNames:a,slots:o,isSelect:i,isRadioGroup:l,isCheckboxGroup:c,isCheckbox:f,isRadio:d,isCascader:O,isTreeSelect:v,isSwitch:N,attrs:y,emptyText:g}){if(n)try{return n(e)||g}catch(s){console.warn("[ReadonlyHOC] valueToLabel error",s)}if(N){const s=y.checkedValue??y["checked-value"]??!0,m=y.uncheckedValue??y["un-checked-value"]??!1;return e===s?y.checkedChildren??y["checked-children"]??"开启":e===m?y.uncheckedChildren??y["un-checked-children"]??"关闭":String(e||g)}if(O&&Array.isArray(e)&&t?.length)return Mr(t,e,a).join(" / ")||g;if(v&&r?.length)return Rr(r,e,a).join(", ")||g;if(t?.length){const s=a.value||"value",m=a.label||"label",k=C=>{const P=t.find(q=>q[s]===C);return P?P[m]||P[s]:C==null?"":String(C)};return Array.isArray(e)?e.map(k).join(", ")||g:k(e)||g}else if((i||l||c)&&o?.default)try{const s=o.default(),m=je(s,a);if(m.size>0){const k=C=>C==null?"":m.get(C)||String(C);return Array.isArray(e)?e.map(k).join(", ")||g:k(e)||g}}catch(s){console.warn("[ReadonlyHOC] Failed to parse slot options",s)}else if(o?.default&&(f||d)&&typeof e=="boolean")try{const s=o.default(),m=D(s);if(m)return m}catch{}return e==null||e===""?g:Array.isArray(e)?e.join(", "):String(e)}function Ne(e){if(typeof e=="function")return e;const t=e.name||"",r=t.toLowerCase(),n=/select/i.test(r)&&!/tree|cascader/i.test(r),a=/radio/i.test(r)&&!/group/i.test(r),o=/radio.*group/i.test(r),i=/checkbox/i.test(r)&&!/group/i.test(r),l=/checkbox.*group/i.test(r),c=/switch/i.test(r),f=/cascader/i.test(r),d=/tree.*select/i.test(r),v=i||c||a?"checked":"value",N=`update:${v}`,y=/form$/i.test(r),g=/form.*item/i.test(r);return u.defineComponent({name:t,inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:void 0},[v]:{type:[String,Number,Boolean,Array,Object],default:void 0},readonly:{type:Boolean,default:void 0},emptyText:{type:String,default:"--"},valueToLabel:{type:Function,default:null},copyable:{type:Boolean,default:void 0}},emits:["update:modelValue",N],setup(s,{emit:m,slots:k,expose:C}){const P=u.inject("nkReadonly",u.ref(!1)),q=u.inject("copyable",u.ref(!0)),A=u.computed(()=>s.readonly??P.value),G=u.computed(()=>s.readonly??P.value),K=u.computed(()=>s.copyable??q.value??!0),L=u.ref(!1);y&&(u.provide("nkReadonly",G),u.provide("copyable",K));const ie=u.computed(()=>s[v]!==void 0?s[v]:s.modelValue),Pe=b=>{m("update:modelValue",b),m(N,b)},S=u.useAttrs(),H=u.computed(()=>{if(!A.value)return"";const b=S.fieldNames??S["field-names"]??{},V=S.options,Ee=S.treeData??S["tree-data"];return $r({modelValue:ie.value,options:V,treeData:Ee,valueToLabel:s.valueToLabel,fieldNames:b,slots:k,isSelect:n,isRadioGroup:o,isCheckboxGroup:l,isCheckbox:i,isRadio:a,isCascader:f,isTreeSelect:d,isSwitch:c,attrs:S,emptyText:s.emptyText})}),Ae={lineHeight:"32px",padding:"0 6px",display:"inline-block",minHeight:"32px",cursor:"text",wordBreak:"break-all",color:"rgba(0, 0, 0, 0.85)",position:"relative",borderRadius:"4px",border:"none",backgroundColor:"none",whiteSpace:"pre-wrap"},E=u.ref();y&&C({validate:()=>A.value?Promise.resolve({}):E.value?.validate?.(),validateFields:b=>A.value?Promise.resolve({}):E.value?.validateFields?.(b),resetFields:b=>!A.value&&E.value?.resetFields?.(b),clearValidate:b=>!A.value&&E.value?.clearValidate?.(b),scrollToField:b=>!A.value&&E.value?.scrollToField?.(b)});const Ie=()=>{L.value=!0},Fe=()=>{L.value=!1};return()=>g?u.h(e,{...S,style:{...S.style||{},marginBottom:A.value?"10px":void 0}},k):y?u.h(e,{...S,rules:G.value?null:S.rules,disabled:G.value?!0:S.disabled,ref:E},k):A.value?u.h("span",{onMouseenter:Ie,onMouseleave:Fe,class:"nk-readonly-wrapper",style:{...Ae,color:K.value&&L.value?"#6e9eff":"rgba(0, 0, 0, 0.65)"}},[u.h("span",{style:{marginRight:"8px"}},H.value),K.value&&H.value!==s.emptyText?u.h("span",{class:"copy-icon",style:{visibility:L.value?"visible":"hidden",marginLeft:"8px"}},[u.h(oe,{onClick:async()=>{try{if(window.__POWERED_BY_WUJIE__){if(await window.gvUtil?.clipboard(null,H.value)===!1){p.message.error("您的浏览器不支持自动复制,请手动复制");return}p.message.success("复制成功")}else{const b=new Blob([H.value],{type:"text/plain"}),V=new ClipboardItem({"text/plain":b});await navigator.clipboard.write([V]),p.message.success("复制成功")}}catch{p.message.error("您的浏览器不支持自动复制,请手动复制")}},style:{cursor:"pointer",color:"#447dfd",fontSize:"12px",position:"absolute",top:"5px",right:"6px"}})]):null]):u.h(e,{...S,[v]:ie.value,[`onUpdate:${v}`]:Pe,ref:y?E:void 0},k)}})}const _r={Input:p.Input,InputNumber:p.InputNumber,Textarea:p.Textarea,Select:p.Select,SelectOption:p.Select.Option,TreeSelect:p.TreeSelect,Cascader:p.Cascader,DatePicker:p.DatePicker,TimePicker:p.TimePicker,Radio:p.Radio,Checkbox:p.Checkbox,RadioGroup:p.Radio.Group,CheckboxGroup:p.Checkbox.Group,Switch:p.Switch,Form:p.Form,FormItem:p.Form.Item},h={};for(const[e,t]of Object.entries(_r))if(t){const r=Ne(t);h[`Nk${e}`]=r}const Dr={install(e){for(const[t,r]of Object.entries(h))if(r){const n=r;e.component(t,n)}}},Lr=h.NkInput,Hr=h.NkInputNumber,Br=h.NkSelect,zr=h.NkCascader,Ur=h.NkTreeSelect,Wr=h.NkDatePicker,qr=h.NkTimePicker,Gr=h.NkCheckbox,Kr=h.NkRadio,Vr=h.NkSwitch,Yr=h.NkForm,Jr=h.NkFormItem;exports.NkCascader=zr;exports.NkCheckbox=Gr;exports.NkDatePicker=Wr;exports.NkForm=Yr;exports.NkFormItem=Jr;exports.NkInput=Lr;exports.NkInputNumber=Hr;exports.NkRadio=Kr;exports.NkSelect=Br;exports.NkSwitch=Vr;exports.NkTimePicker=qr;exports.NkTreeSelect=Ur;exports.default=Dr;exports.withReadonly=Ne;
|
|
56
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gr(e,t){if(e){if(typeof e=="string")return he(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return he(e,t)}}function he(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mr(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,o,i,l=[],c=!0,f=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(c=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){f=!0,a=d}finally{try{if(!c&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(f)throw a}}return l}}function hr(e){if(Array.isArray(e))return e}function Oe(e){var t=Te(e),r=br(t,2),n=r[0],a=r[1];return F.setTwoToneColors({primaryColor:n,secondaryColor:a})}function vr(){var e=F.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var kr=["class","icon","spin","rotate","tabindex","twoToneColor","onClick"];function Cr(e,t){return Tr(e)||xr(e,t)||Sr(e,t)||wr()}function wr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
57
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sr(e,t){if(e){if(typeof e=="string")return ve(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ve(e,t)}}function ve(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xr(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,o,i,l=[],c=!0,f=!1;try{if(o=(r=r.call(e)).next,t!==0)for(;!(c=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){f=!0,a=d}finally{try{if(!c&&r.return!=null&&(i=r.return(),Object(i)!==i))return}finally{if(f)throw a}}return l}}function Tr(e){if(Array.isArray(e))return e}function ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.forEach(function(a){ae(e,a,r[a])})}return e}function ae(e,t,r){return t=Or(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Or(e){var t=Pr(e,"string");return typeof t=="symbol"?t:String(t)}function Pr(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nr(e,t){if(e==null)return{};var r=jr(e,t),n,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jr(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,o;for(o=0;o<n.length;o++)a=n[o],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}Oe("#1890ff");var E=function(t,r){var n,a=ke({},t,r.attrs),o=a.class,i=a.icon,l=a.spin,c=a.rotate,f=a.tabindex,d=a.twoToneColor,T=a.onClick,v=Nr(a,kr),N=(n={anticon:!0},ae(n,"anticon-".concat(i.name),!!i.name),ae(n,o,o),n),g=l===""||l||i.name==="loading"?"anticon-spin":"",m=f;m===void 0&&T&&(m=-1,v.tabindex=m);var s=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,h=Te(d),k=Cr(h,2),C=k[0],j=k[1];return u.createVNode("span",ke({role:"img","aria-label":i.name},v,{onClick:T,class:N}),[u.createVNode(F,{class:g,icon:i,primaryColor:C,secondaryColor:j,style:s},null)])};E.props={spin:Boolean,rotate:Number,icon:Object,twoToneColor:String};E.displayName="AntdIcon";E.inheritAttrs=!1;E.getTwoToneColor=vr;E.setTwoToneColor=Oe;var Ar={icon:{tag:"svg",attrs:{viewBox:"32 32 960 960",focusable:"false"},children:[{tag:"path",attrs:{d:"M384 32a96 96 0 00-96 96v96a32 32 0 0064 0v-96a32 32 0 0132-32h512a32 32 0 0132 32v512a32 32 0 01-32 32h-96a32 32 0 000 64h96a96 96 0 0096-96V128a96 96 0 00-96-96H384z"}},{tag:"path",attrs:{d:"M128 288a96 96 0 00-96 96v512a96 96 0 0096 96h512a96 96 0 0096-96V384a96 96 0 00-96-96H128zm-32 96a32 32 0 0132-32h512a32 32 0 0132 32v512a32 32 0 01-32 32H128a32 32 0 01-32-32V384z"}}]},name:"copy",theme:"outlined"};function Ce(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.forEach(function(a){Ir(e,a,r[a])})}return e}function Ir(e,t,r){return t=Fr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fr(e){var t=Rr(e,"string");return typeof t=="symbol"?t:String(t)}function Rr(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oe=function(t,r){var n=Ce({},t,r.attrs);return u.createVNode(E,Ce({},n,{icon:Ar}),null)};oe.displayName="CopyOutlined";oe.inheritAttrs=!1;function D(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(D).join("");if(typeof e=="object"){if(typeof e.children=="string")return e.children;if(e?.default&&typeof e.default=="function"){const t=e.default();if(Array.isArray(t))return D(t)}e.children&&D(e.children)}return""}function Pe(e,t={}){const r=new Map,{value:n="value",label:a="label"}=t;if(!e)return r;const o=Array.isArray(e)?e:[e];for(const i of o)if(!(!i||typeof i!="object")){if(i.type&&(typeof i.type=="object"||typeof i.type=="function")){let l=i.type.name?.toLowerCase()||"";if(typeof i.type=="function"?l=i.type.displayName?.toLowerCase()||"":typeof i.type=="string"&&(l=i.type?.toLowerCase()||""),/option|radio|checkbox/i.test(l)){const c=i.props||{},f=c[n]??c.value,d=c[a]??c.label;if(f!=null){const T=D(i.children)||d||String(f);r.set(f,T)}}}i.children&&Pe(i.children,t).forEach((c,f)=>{r.has(f)||r.set(f,c)})}return r}function Er(e,t,r){const{value:n="value",label:a="label",children:o="children"}=r,i=[];let l=e;for(const c of t){const f=l.find(d=>d[n]===c);if(f)i.push(f[a]||f[n]||String(c)),l=f[o]||[];else{i.push(String(c));break}}return i}function Mr(e,t,r){const{value:n="value",label:a="title",children:o="children"}=r,i=[],l=new Set(Array.isArray(t)?t:[t]);function c(f){for(const d of f)l.has(d[n])&&i.push(d[a]||d[n]),d[o]&&c(d[o])}return c(e),i}function $r({modelValue:e,options:t,treeData:r,valueToLabel:n,fieldNames:a,slots:o,isSelect:i,isRadioGroup:l,isCheckboxGroup:c,isCheckbox:f,isRadio:d,isCascader:T,isTreeSelect:v,isSwitch:N,attrs:g,emptyText:m}){if(n)try{return n(e)||m}catch(s){console.warn("[ReadonlyHOC] valueToLabel error",s)}if(N){const s=g.checkedValue??g["checked-value"]??!0,h=g.uncheckedValue??g["un-checked-value"]??!1;return e===s?g.checkedChildren??g["checked-children"]??"开启":e===h?g.uncheckedChildren??g["un-checked-children"]??"关闭":String(e||m)}if(T&&Array.isArray(e)&&t?.length)return Er(t,e,a).join(" / ")||m;if(v&&r?.length)return Mr(r,e,a).join(", ")||m;if(t?.length){const s=a.value||"value",h=a.label||"label",k=C=>{const j=t.find(q=>q[s]===C);return j?j[h]||j[s]:C==null?"":String(C)};return Array.isArray(e)?e.map(k).join(", ")||m:k(e)||m}else if((i||l||c)&&o?.default)try{const s=o.default(),h=Pe(s,a);if(h.size>0){const k=C=>C==null?"":h.get(C)||String(C);return Array.isArray(e)?e.map(k).join(", ")||m:k(e)||m}}catch(s){console.warn("[ReadonlyHOC] Failed to parse slot options",s)}else if(o?.default&&(f||d)&&typeof e=="boolean")try{const s=o.default(),h=D(s);if(h)return h}catch{}return e==null||e===""?m:Array.isArray(e)?e.join(", "):String(e)}function Ne(e){if(typeof e=="function")return e;const t=e.name||"",r=t.toLowerCase(),n=/select/i.test(r)&&!/tree|cascader/i.test(r),a=/radio/i.test(r)&&!/group/i.test(r),o=/radio.*group/i.test(r),i=/checkbox/i.test(r)&&!/group/i.test(r),l=/checkbox.*group/i.test(r),c=/switch/i.test(r),f=/cascader/i.test(r),d=/tree.*select/i.test(r),v=i||c||a?"checked":"value",N=`update:${v}`,g=/form$/i.test(r),m=/form.*item/i.test(r);return u.defineComponent({name:t,inheritAttrs:!1,props:{modelValue:{type:[String,Number,Boolean,Array,Object],default:void 0},[v]:{type:[String,Number,Boolean,Array,Object],default:void 0},readonly:{type:Boolean,default:void 0},emptyText:{type:String,default:"--"},valueToLabel:{type:Function,default:null},copyable:{type:Boolean,default:void 0}},emits:["update:modelValue",N],setup(s,{emit:h,slots:k,expose:C}){const j=u.inject("nkReadonly",u.ref(!1)),q=u.inject("copyable",u.ref(!0)),A=u.computed(()=>s.readonly??j.value),G=u.computed(()=>s.readonly??j.value),K=u.computed(()=>s.copyable??q.value??!0),L=u.ref(!1);g&&(u.provide("nkReadonly",G),u.provide("copyable",K));const ie=u.computed(()=>s[v]!==void 0?s[v]:s.modelValue),je=b=>{h("update:modelValue",b),h(N,b)},S=u.useAttrs(),H=u.computed(()=>{if(!A.value)return"";const b=S.fieldNames??S["field-names"]??{},V=S.options,Re=S.treeData??S["tree-data"];return $r({modelValue:ie.value,options:V,treeData:Re,valueToLabel:s.valueToLabel,fieldNames:b,slots:k,isSelect:n,isRadioGroup:o,isCheckboxGroup:l,isCheckbox:i,isRadio:a,isCascader:f,isTreeSelect:d,isSwitch:c,attrs:S,emptyText:s.emptyText})}),Ae={lineHeight:"32px",padding:"0 6px",display:"inline-block",minHeight:"32px",cursor:"text",wordBreak:"break-all",color:"rgba(0, 0, 0, 0.85)",position:"relative",borderRadius:"4px",border:"none",backgroundColor:"none",whiteSpace:"pre-wrap"},R=u.ref();g&&C({validate:()=>A.value?Promise.resolve({}):R.value?.validate?.(),validateFields:b=>A.value?Promise.resolve({}):R.value?.validateFields?.(b),resetFields:b=>!A.value&&R.value?.resetFields?.(b),clearValidate:b=>!A.value&&R.value?.clearValidate?.(b),scrollToField:b=>!A.value&&R.value?.scrollToField?.(b)});const Ie=()=>{L.value=!0},Fe=()=>{L.value=!1};return()=>m?u.h(e,{...S,style:{...S.style||{},marginBottom:A.value?"10px":void 0}},k):g?u.h(e,{...S,rules:G.value?null:S.rules,disabled:G.value?!0:S.disabled,ref:R},k):A.value?u.h("span",{onMouseenter:Ie,onMouseleave:Fe,class:"nk-readonly-wrapper",style:{...Ae,color:K.value&&L.value?"#6e9eff":"rgba(0, 0, 0, 0.65)"}},[u.h("span",{style:{marginRight:"8px"}},H.value),K.value&&H.value!==s.emptyText?u.h("span",{class:"copy-icon",style:{visibility:L.value?"visible":"hidden",marginLeft:"8px"}},[u.h(oe,{onClick:async()=>{try{if(window.__POWERED_BY_WUJIE__){if(await window.gvUtil?.clipboard(null,H.value)===!1){p.message.error("您的浏览器不支持自动复制,请手动复制");return}p.message.success("复制成功")}else{const b=new Blob([H.value],{type:"text/plain"}),V=new ClipboardItem({"text/plain":b});await navigator.clipboard.write([V]),p.message.success("复制成功")}}catch{p.message.error("您的浏览器不支持自动复制,请手动复制")}},style:{cursor:"pointer",color:"#447dfd",fontSize:"12px",position:"absolute",top:"5px",right:"6px"}})]):null]):u.h(e,{...S,[v]:ie.value,[`onUpdate:${v}`]:je,ref:g?R:void 0},k)}})}const _r={Input:p.Input,InputNumber:p.InputNumber,Textarea:p.Textarea,Select:p.Select,SelectOption:p.Select.Option,TreeSelect:p.TreeSelect,Cascader:p.Cascader,DatePicker:p.DatePicker,RangePicker:p.DatePicker.RangePicker,TimePicker:p.TimePicker,TimeRangePicker:p.TimePicker.TimeRangePicker,Radio:p.Radio,Checkbox:p.Checkbox,RadioGroup:p.Radio.Group,CheckboxGroup:p.Checkbox.Group,Switch:p.Switch,Form:p.Form,FormItem:p.Form.Item},y={};for(const[e,t]of Object.entries(_r))if(t){const r=Ne(t);y[`Nk${e}`]=r}const Dr={install(e){for(const[t,r]of Object.entries(y))if(r){const n=r;e.component(t,n)}}},Lr=y.NkInput,Hr=y.NkInputNumber,Br=y.NkSelect,zr=y.NkCascader,Ur=y.NkTreeSelect,Wr=y.NkDatePicker,qr=y.NkRangePicker,Gr=y.NkTimePicker,Kr=y.NkTimeRangePicker,Vr=y.NkCheckbox,Yr=y.NkRadio,Jr=y.NkSwitch,Zr=y.NkForm,Qr=y.NkFormItem;exports.NkCascader=zr;exports.NkCheckbox=Vr;exports.NkDatePicker=Wr;exports.NkForm=Zr;exports.NkFormItem=Qr;exports.NkInput=Lr;exports.NkInputNumber=Hr;exports.NkRadio=Yr;exports.NkRangePicker=qr;exports.NkSelect=Br;exports.NkSwitch=Jr;exports.NkTimePicker=Gr;exports.NkTimeRangePicker=Kr;exports.NkTreeSelect=Ur;exports.default=Dr;exports.withReadonly=Ne;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component, Plugin } from 'vue';
|
|
2
2
|
import { withReadonly } from './withReadonly';
|
|
3
|
-
import { InputProps, InputNumberProps, TextAreaProps, SelectProps, TreeSelectProps, CascaderProps, DatePickerProps, TimePickerProps, RadioProps, CheckboxProps, SwitchProps, SliderProps, RateProps, FormProps, FormItemProps } from 'n-designv3';
|
|
3
|
+
import { DatePicker, InputProps, InputNumberProps, TextAreaProps, SelectProps, TreeSelectProps, CascaderProps, DatePickerProps, TimePickerProps, TimeRangePickerProps, RadioProps, CheckboxProps, SwitchProps, SliderProps, RateProps, FormProps, FormItemProps } from 'n-designv3';
|
|
4
|
+
type RangePickerProps = typeof DatePicker.RangePicker;
|
|
4
5
|
declare const NDesignReadonlyPlugin: Plugin;
|
|
5
6
|
export default NDesignReadonlyPlugin;
|
|
6
7
|
export { withReadonly };
|
|
@@ -10,7 +11,9 @@ export declare const NkSelect: Component;
|
|
|
10
11
|
export declare const NkCascader: Component;
|
|
11
12
|
export declare const NkTreeSelect: Component;
|
|
12
13
|
export declare const NkDatePicker: Component;
|
|
14
|
+
export declare const NkRangePicker: Component;
|
|
13
15
|
export declare const NkTimePicker: Component;
|
|
16
|
+
export declare const NkTimeRangePicker: Component;
|
|
14
17
|
export declare const NkCheckbox: Component;
|
|
15
18
|
export declare const NkRadio: Component;
|
|
16
19
|
export declare const NkSwitch: Component;
|
|
@@ -54,10 +57,18 @@ export interface NkComponents {
|
|
|
54
57
|
modelValue?: FormModelValue;
|
|
55
58
|
value?: FormModelValue;
|
|
56
59
|
} & Partial<ReadonlyExtraPropsType>>;
|
|
60
|
+
NkRangePicker: Component<Omit<RangePickerProps, 'modelValue' | 'value'> & {
|
|
61
|
+
modelValue?: FormModelValue;
|
|
62
|
+
value?: FormModelValue;
|
|
63
|
+
} & Partial<ReadonlyExtraPropsType>>;
|
|
57
64
|
NkTimePicker: Component<Omit<TimePickerProps, 'modelValue' | 'value'> & {
|
|
58
65
|
modelValue?: FormModelValue;
|
|
59
66
|
value?: FormModelValue;
|
|
60
67
|
} & Partial<ReadonlyExtraPropsType>>;
|
|
68
|
+
NkTimeRangePicker: Component<Omit<TimeRangePickerProps, 'modelValue' | 'value'> & {
|
|
69
|
+
modelValue?: FormModelValue;
|
|
70
|
+
value?: FormModelValue;
|
|
71
|
+
} & Partial<ReadonlyExtraPropsType>>;
|
|
61
72
|
NkRadio: Component<Omit<RadioProps, 'modelValue' | 'value' | 'checked'> & {
|
|
62
73
|
modelValue?: FormModelValue;
|
|
63
74
|
value?: FormModelValue;
|
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { nextTick as
|
|
2
|
-
import { message as z, Form as de, Checkbox as pe, Radio as be,
|
|
3
|
-
function
|
|
1
|
+
import { nextTick as We, h as T, createVNode as ae, defineComponent as Ge, inject as ue, ref as B, computed as R, provide as se, useAttrs as qe } from "vue";
|
|
2
|
+
import { message as z, Form as de, Checkbox as pe, Radio as be, TimePicker as ye, DatePicker as ge, Select as me, Switch as Ke, Cascader as Ve, TreeSelect as Ye, Textarea as Je, InputNumber as Ze, Input as Qe } from "n-designv3";
|
|
3
|
+
function w(e, t) {
|
|
4
4
|
Xe(e) && (e = "100%");
|
|
5
5
|
var r = er(e);
|
|
6
6
|
return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), r && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e);
|
|
@@ -22,9 +22,9 @@ function Z(e) {
|
|
|
22
22
|
}
|
|
23
23
|
function tr(e, t, r) {
|
|
24
24
|
return {
|
|
25
|
-
r:
|
|
26
|
-
g:
|
|
27
|
-
b:
|
|
25
|
+
r: w(e, 255) * 255,
|
|
26
|
+
g: w(t, 255) * 255,
|
|
27
|
+
b: w(r, 255) * 255
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function Q(e, t, r) {
|
|
@@ -32,7 +32,7 @@ function Q(e, t, r) {
|
|
|
32
32
|
}
|
|
33
33
|
function nr(e, t, r) {
|
|
34
34
|
var n, a, o;
|
|
35
|
-
if (e =
|
|
35
|
+
if (e = w(e, 360), t = w(t, 100), r = w(r, 100), t === 0)
|
|
36
36
|
a = r, o = r, n = r;
|
|
37
37
|
else {
|
|
38
38
|
var i = r < 0.5 ? r * (1 + t) : r + t - r * t, l = 2 * r - i;
|
|
@@ -41,8 +41,8 @@ function nr(e, t, r) {
|
|
|
41
41
|
return { r: n * 255, g: a * 255, b: o * 255 };
|
|
42
42
|
}
|
|
43
43
|
function ar(e, t, r) {
|
|
44
|
-
e =
|
|
45
|
-
var n = Math.max(e, t, r), a = Math.min(e, t, r), o = 0, i = n, l = n - a,
|
|
44
|
+
e = w(e, 255), t = w(t, 255), r = w(r, 255);
|
|
45
|
+
var n = Math.max(e, t, r), a = Math.min(e, t, r), o = 0, i = n, l = n - a, c = n === 0 ? 0 : l / n;
|
|
46
46
|
if (n === a)
|
|
47
47
|
o = 0;
|
|
48
48
|
else {
|
|
@@ -59,12 +59,12 @@ function ar(e, t, r) {
|
|
|
59
59
|
}
|
|
60
60
|
o /= 6;
|
|
61
61
|
}
|
|
62
|
-
return { h: o, s:
|
|
62
|
+
return { h: o, s: c, v: i };
|
|
63
63
|
}
|
|
64
64
|
function or(e, t, r) {
|
|
65
|
-
e =
|
|
66
|
-
var n = Math.floor(e), a = e - n, o = r * (1 - t), i = r * (1 - a * t), l = r * (1 - (1 - a) * t),
|
|
67
|
-
return { r:
|
|
65
|
+
e = w(e, 360) * 6, t = w(t, 100), r = w(r, 100);
|
|
66
|
+
var n = Math.floor(e), a = e - n, o = r * (1 - t), i = r * (1 - a * t), l = r * (1 - (1 - a) * t), c = n % 6, f = [r, i, o, o, l, r][c], s = [l, r, r, i, o, o][c], S = [o, o, l, r, r, i][c];
|
|
67
|
+
return { r: f * 255, g: s * 255, b: S * 255 };
|
|
68
68
|
}
|
|
69
69
|
function ir(e, t, r, n) {
|
|
70
70
|
var a = [
|
|
@@ -74,13 +74,13 @@ function ir(e, t, r, n) {
|
|
|
74
74
|
];
|
|
75
75
|
return a.join("");
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
77
|
+
function he(e) {
|
|
78
|
+
return k(e) / 255;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function k(e) {
|
|
81
81
|
return parseInt(e, 16);
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var ve = {
|
|
84
84
|
aliceblue: "#f0f8ff",
|
|
85
85
|
antiquewhite: "#faebd7",
|
|
86
86
|
aqua: "#00ffff",
|
|
@@ -230,9 +230,9 @@ var me = {
|
|
|
230
230
|
yellow: "#ffff00",
|
|
231
231
|
yellowgreen: "#9acd32"
|
|
232
232
|
};
|
|
233
|
-
function
|
|
233
|
+
function M(e) {
|
|
234
234
|
var t = { r: 0, g: 0, b: 0 }, r = 1, n = null, a = null, o = null, i = !1, l = !1;
|
|
235
|
-
return typeof e == "string" && (e =
|
|
235
|
+
return typeof e == "string" && (e = fr(e)), typeof e == "object" && (O(e.r) && O(e.g) && O(e.b) ? (t = tr(e.r, e.g, e.b), i = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : O(e.h) && O(e.s) && O(e.v) ? (n = U(e.s), a = U(e.v), t = or(e.h, n, a), i = !0, l = "hsv") : O(e.h) && O(e.s) && O(e.l) && (n = U(e.s), o = U(e.l), t = nr(e.h, n, o), i = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (r = e.a)), r = rr(r), {
|
|
236
236
|
ok: i,
|
|
237
237
|
format: e.format || l,
|
|
238
238
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -241,7 +241,7 @@ function R(e) {
|
|
|
241
241
|
a: r
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
var lr = "[-\\+]?\\d+%?",
|
|
244
|
+
var lr = "[-\\+]?\\d+%?", cr = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(cr, ")|(?:").concat(lr, ")"), X = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), ee = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), x = {
|
|
245
245
|
CSS_UNIT: new RegExp(N),
|
|
246
246
|
rgb: new RegExp("rgb" + X),
|
|
247
247
|
rgba: new RegExp("rgba" + ee),
|
|
@@ -254,43 +254,43 @@ var lr = "[-\\+]?\\d+%?", fr = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(fr, ")|(
|
|
|
254
254
|
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
255
255
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
256
256
|
};
|
|
257
|
-
function
|
|
257
|
+
function fr(e) {
|
|
258
258
|
if (e = e.trim().toLowerCase(), e.length === 0)
|
|
259
259
|
return !1;
|
|
260
260
|
var t = !1;
|
|
261
|
-
if (
|
|
262
|
-
e =
|
|
261
|
+
if (ve[e])
|
|
262
|
+
e = ve[e], t = !0;
|
|
263
263
|
else if (e === "transparent")
|
|
264
264
|
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
265
265
|
var r = x.rgb.exec(e);
|
|
266
266
|
return r ? { r: r[1], g: r[2], b: r[3] } : (r = x.rgba.exec(e), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = x.hsl.exec(e), r ? { h: r[1], s: r[2], l: r[3] } : (r = x.hsla.exec(e), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = x.hsv.exec(e), r ? { h: r[1], s: r[2], v: r[3] } : (r = x.hsva.exec(e), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = x.hex8.exec(e), r ? {
|
|
267
|
-
r:
|
|
268
|
-
g:
|
|
269
|
-
b:
|
|
270
|
-
a:
|
|
267
|
+
r: k(r[1]),
|
|
268
|
+
g: k(r[2]),
|
|
269
|
+
b: k(r[3]),
|
|
270
|
+
a: he(r[4]),
|
|
271
271
|
format: t ? "name" : "hex8"
|
|
272
272
|
} : (r = x.hex6.exec(e), r ? {
|
|
273
|
-
r:
|
|
274
|
-
g:
|
|
275
|
-
b:
|
|
273
|
+
r: k(r[1]),
|
|
274
|
+
g: k(r[2]),
|
|
275
|
+
b: k(r[3]),
|
|
276
276
|
format: t ? "name" : "hex"
|
|
277
277
|
} : (r = x.hex4.exec(e), r ? {
|
|
278
|
-
r:
|
|
279
|
-
g:
|
|
280
|
-
b:
|
|
281
|
-
a:
|
|
278
|
+
r: k(r[1] + r[1]),
|
|
279
|
+
g: k(r[2] + r[2]),
|
|
280
|
+
b: k(r[3] + r[3]),
|
|
281
|
+
a: he(r[4] + r[4]),
|
|
282
282
|
format: t ? "name" : "hex8"
|
|
283
283
|
} : (r = x.hex3.exec(e), r ? {
|
|
284
|
-
r:
|
|
285
|
-
g:
|
|
286
|
-
b:
|
|
284
|
+
r: k(r[1] + r[1]),
|
|
285
|
+
g: k(r[2] + r[2]),
|
|
286
|
+
b: k(r[3] + r[3]),
|
|
287
287
|
format: t ? "name" : "hex"
|
|
288
288
|
} : !1)))))))));
|
|
289
289
|
}
|
|
290
290
|
function O(e) {
|
|
291
291
|
return !!x.CSS_UNIT.exec(String(e));
|
|
292
292
|
}
|
|
293
|
-
var W = 2,
|
|
293
|
+
var W = 2, ke = 0.16, ur = 0.05, sr = 0.05, dr = 0.15, Fe = 5, Re = 4, pr = [{
|
|
294
294
|
index: 7,
|
|
295
295
|
opacity: 0.15
|
|
296
296
|
}, {
|
|
@@ -321,7 +321,7 @@ var W = 2, he = 0.16, ur = 0.05, sr = 0.05, dr = 0.15, Ie = 5, Ee = 4, pr = [{
|
|
|
321
321
|
index: 1,
|
|
322
322
|
opacity: 0.98
|
|
323
323
|
}];
|
|
324
|
-
function
|
|
324
|
+
function Ce(e) {
|
|
325
325
|
var t = e.r, r = e.g, n = e.b, a = ar(t, r, n);
|
|
326
326
|
return {
|
|
327
327
|
h: a.h * 360,
|
|
@@ -341,41 +341,41 @@ function br(e, t, r) {
|
|
|
341
341
|
};
|
|
342
342
|
return a;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function we(e, t, r) {
|
|
345
345
|
var n;
|
|
346
346
|
return Math.round(e.h) >= 60 && Math.round(e.h) <= 240 ? n = r ? Math.round(e.h) - W * t : Math.round(e.h) + W * t : n = r ? Math.round(e.h) + W * t : Math.round(e.h) - W * t, n < 0 ? n += 360 : n >= 360 && (n -= 360), n;
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function Se(e, t, r) {
|
|
349
349
|
if (e.h === 0 && e.s === 0)
|
|
350
350
|
return e.s;
|
|
351
351
|
var n;
|
|
352
|
-
return r ? n = e.s -
|
|
352
|
+
return r ? n = e.s - ke * t : t === Re ? n = e.s + ke : n = e.s + ur * t, n > 1 && (n = 1), r && t === Fe && n > 0.1 && (n = 0.1), n < 0.06 && (n = 0.06), Number(n.toFixed(2));
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function xe(e, t, r) {
|
|
355
355
|
var n;
|
|
356
356
|
return r ? n = e.v + sr * t : n = e.v - dr * t, n > 1 && (n = 1), Number(n.toFixed(2));
|
|
357
357
|
}
|
|
358
358
|
function oe(e) {
|
|
359
|
-
for (var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = [], n =
|
|
360
|
-
var o =
|
|
361
|
-
h:
|
|
362
|
-
s:
|
|
363
|
-
v:
|
|
359
|
+
for (var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = [], n = M(e), a = Fe; a > 0; a -= 1) {
|
|
360
|
+
var o = Ce(n), i = G(M({
|
|
361
|
+
h: we(o, a, !0),
|
|
362
|
+
s: Se(o, a, !0),
|
|
363
|
+
v: xe(o, a, !0)
|
|
364
364
|
}));
|
|
365
365
|
r.push(i);
|
|
366
366
|
}
|
|
367
367
|
r.push(G(n));
|
|
368
|
-
for (var l = 1; l <=
|
|
369
|
-
var
|
|
370
|
-
h:
|
|
371
|
-
s:
|
|
372
|
-
v:
|
|
368
|
+
for (var l = 1; l <= Re; l += 1) {
|
|
369
|
+
var c = Ce(n), f = G(M({
|
|
370
|
+
h: we(c, l),
|
|
371
|
+
s: Se(c, l),
|
|
372
|
+
v: xe(c, l)
|
|
373
373
|
}));
|
|
374
|
-
r.push(
|
|
374
|
+
r.push(f);
|
|
375
375
|
}
|
|
376
376
|
return t.theme === "dark" ? pr.map(function(s) {
|
|
377
|
-
var
|
|
378
|
-
return
|
|
377
|
+
var S = s.index, m = s.opacity, P = G(br(M(t.backgroundColor || "#141414"), M(r[S]), m * 100));
|
|
378
|
+
return P;
|
|
379
379
|
}) : r;
|
|
380
380
|
}
|
|
381
381
|
var re = {
|
|
@@ -399,7 +399,7 @@ Object.keys(re).forEach(function(e) {
|
|
|
399
399
|
backgroundColor: "#141414"
|
|
400
400
|
}), ne[e].primary = ne[e][5];
|
|
401
401
|
});
|
|
402
|
-
var
|
|
402
|
+
var Oe = [], $ = [], yr = "insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";
|
|
403
403
|
function gr() {
|
|
404
404
|
var e = document.createElement("style");
|
|
405
405
|
return e.setAttribute("type", "text/css"), e;
|
|
@@ -407,12 +407,12 @@ function gr() {
|
|
|
407
407
|
function mr(e, t) {
|
|
408
408
|
if (t = t || {}, e === void 0)
|
|
409
409
|
throw new Error(yr);
|
|
410
|
-
var r = t.prepend === !0 ? "prepend" : "append", n = t.container !== void 0 ? t.container : document.querySelector("head"), a =
|
|
411
|
-
a === -1 && (a =
|
|
410
|
+
var r = t.prepend === !0 ? "prepend" : "append", n = t.container !== void 0 ? t.container : document.querySelector("head"), a = Oe.indexOf(n);
|
|
411
|
+
a === -1 && (a = Oe.push(n) - 1, $[a] = {});
|
|
412
412
|
var o;
|
|
413
413
|
return $[a] !== void 0 && $[a][r] !== void 0 ? o = $[a][r] : (o = $[a][r] = gr(), r === "prepend" ? n.insertBefore(o, n.childNodes[0]) : n.appendChild(o)), e.charCodeAt(0) === 65279 && (e = e.substr(1, e.length)), o.styleSheet ? o.styleSheet.cssText += e : o.textContent += e, o;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Te(e) {
|
|
416
416
|
for (var t = 1; t < arguments.length; t++) {
|
|
417
417
|
var r = arguments[t] != null ? Object(arguments[t]) : {}, n = Object.keys(r);
|
|
418
418
|
typeof Object.getOwnPropertySymbols == "function" && n.push.apply(n, Object.getOwnPropertySymbols(r).filter(function(a) {
|
|
@@ -427,10 +427,10 @@ function hr(e, t, r) {
|
|
|
427
427
|
return t = vr(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
428
428
|
}
|
|
429
429
|
function vr(e) {
|
|
430
|
-
var t =
|
|
430
|
+
var t = kr(e, "string");
|
|
431
431
|
return typeof t == "symbol" ? t : String(t);
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function kr(e, t) {
|
|
434
434
|
if (typeof e != "object" || e === null) return e;
|
|
435
435
|
var r = e[Symbol.toPrimitive];
|
|
436
436
|
if (r !== void 0) {
|
|
@@ -440,33 +440,33 @@ function Cr(e, t) {
|
|
|
440
440
|
}
|
|
441
441
|
return (t === "string" ? String : Number)(e);
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function Cr(e, t) {
|
|
444
444
|
process.env.NODE_ENV !== "production" && !e && console !== void 0 && console.error("Warning: ".concat(t));
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
|
|
446
|
+
function wr(e, t) {
|
|
447
|
+
Cr(e, "[@nancal-icon/icons-vue] ".concat(t));
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function Pe(e) {
|
|
450
450
|
return typeof e == "object" && typeof e.name == "string" && typeof e.theme == "string" && (typeof e.icon == "object" || typeof e.icon == "function");
|
|
451
451
|
}
|
|
452
452
|
function ie(e, t, r) {
|
|
453
|
-
return r ? T(e.tag,
|
|
453
|
+
return r ? T(e.tag, Te({
|
|
454
454
|
key: t
|
|
455
455
|
}, r, e.attrs), (e.children || []).map(function(n, a) {
|
|
456
456
|
return ie(n, "".concat(t, "-").concat(e.tag, "-").concat(a));
|
|
457
|
-
})) : T(e.tag,
|
|
457
|
+
})) : T(e.tag, Te({
|
|
458
458
|
key: t
|
|
459
459
|
}, e.attrs), (e.children || []).map(function(n, a) {
|
|
460
460
|
return ie(n, "".concat(t, "-").concat(e.tag, "-").concat(a));
|
|
461
461
|
}));
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function Me(e) {
|
|
464
464
|
return oe(e)[0];
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function $e(e) {
|
|
467
467
|
return e ? Array.isArray(e) ? e : [e] : [];
|
|
468
468
|
}
|
|
469
|
-
var
|
|
469
|
+
var Sr = `
|
|
470
470
|
.anticon {
|
|
471
471
|
display: inline-block;
|
|
472
472
|
color: #8091B7;
|
|
@@ -520,17 +520,17 @@ var kr = `
|
|
|
520
520
|
transform: rotate(360deg);
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
`,
|
|
524
|
-
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
525
|
-
|
|
526
|
-
|
|
523
|
+
`, Ae = !1, xr = function() {
|
|
524
|
+
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Sr;
|
|
525
|
+
We(function() {
|
|
526
|
+
Ae || (typeof window < "u" && window.document && window.document.documentElement && mr(t, {
|
|
527
527
|
prepend: !0
|
|
528
|
-
}),
|
|
528
|
+
}), Ae = !0);
|
|
529
529
|
});
|
|
530
530
|
}, Or = ["icon", "primaryColor", "secondaryColor"];
|
|
531
531
|
function Tr(e, t) {
|
|
532
532
|
if (e == null) return {};
|
|
533
|
-
var r =
|
|
533
|
+
var r = Pr(e, t), n, a;
|
|
534
534
|
if (Object.getOwnPropertySymbols) {
|
|
535
535
|
var o = Object.getOwnPropertySymbols(e);
|
|
536
536
|
for (a = 0; a < o.length; a++)
|
|
@@ -538,7 +538,7 @@ function Tr(e, t) {
|
|
|
538
538
|
}
|
|
539
539
|
return r;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function Pr(e, t) {
|
|
542
542
|
if (e == null) return {};
|
|
543
543
|
var r = {}, n = Object.keys(e), a, o;
|
|
544
544
|
for (o = 0; o < n.length; o++)
|
|
@@ -551,15 +551,15 @@ function q(e) {
|
|
|
551
551
|
typeof Object.getOwnPropertySymbols == "function" && n.push.apply(n, Object.getOwnPropertySymbols(r).filter(function(a) {
|
|
552
552
|
return Object.getOwnPropertyDescriptor(r, a).enumerable;
|
|
553
553
|
})), n.forEach(function(a) {
|
|
554
|
-
|
|
554
|
+
Ar(e, a, r[a]);
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
return e;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
560
|
-
return t =
|
|
559
|
+
function Ar(e, t, r) {
|
|
560
|
+
return t = jr(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function jr(e) {
|
|
563
563
|
var t = Nr(e, "string");
|
|
564
564
|
return typeof t == "symbol" ? t : String(t);
|
|
565
565
|
}
|
|
@@ -580,23 +580,23 @@ var _ = {
|
|
|
580
580
|
};
|
|
581
581
|
function Ir(e) {
|
|
582
582
|
var t = e.primaryColor, r = e.secondaryColor;
|
|
583
|
-
_.primaryColor = t, _.secondaryColor = r ||
|
|
583
|
+
_.primaryColor = t, _.secondaryColor = r || Me(t), _.calculated = !!r;
|
|
584
584
|
}
|
|
585
585
|
function Er() {
|
|
586
586
|
return q({}, _);
|
|
587
587
|
}
|
|
588
588
|
var I = function(t, r) {
|
|
589
|
-
var n = q({}, t, r.attrs), a = n.icon, o = n.primaryColor, i = n.secondaryColor, l = Tr(n, Or),
|
|
590
|
-
if (o && (
|
|
589
|
+
var n = q({}, t, r.attrs), a = n.icon, o = n.primaryColor, i = n.secondaryColor, l = Tr(n, Or), c = _;
|
|
590
|
+
if (o && (c = {
|
|
591
591
|
primaryColor: o,
|
|
592
|
-
secondaryColor: i ||
|
|
593
|
-
}), xr(),
|
|
592
|
+
secondaryColor: i || Me(o)
|
|
593
|
+
}), xr(), wr(Pe(a), "icon should be icon definiton, but got ".concat(a)), !Pe(a))
|
|
594
594
|
return null;
|
|
595
|
-
var
|
|
596
|
-
return
|
|
597
|
-
icon:
|
|
598
|
-
})), ie(
|
|
599
|
-
"data-icon":
|
|
595
|
+
var f = a;
|
|
596
|
+
return f && typeof f.icon == "function" && (f = q({}, f, {
|
|
597
|
+
icon: f.icon(c.primaryColor, c.secondaryColor)
|
|
598
|
+
})), ie(f.icon, "svg-".concat(f.name), q({}, l, {
|
|
599
|
+
"data-icon": f.name,
|
|
600
600
|
width: "1em",
|
|
601
601
|
height: "1em",
|
|
602
602
|
fill: "currentColor",
|
|
@@ -614,21 +614,21 @@ I.displayName = "IconBase";
|
|
|
614
614
|
I.getTwoToneColors = Er;
|
|
615
615
|
I.setTwoToneColors = Ir;
|
|
616
616
|
function Fr(e, t) {
|
|
617
|
-
return _r(e) || $r(e, t) ||
|
|
617
|
+
return _r(e) || $r(e, t) || Mr(e, t) || Rr();
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function Rr() {
|
|
620
620
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
621
621
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Mr(e, t) {
|
|
624
624
|
if (e) {
|
|
625
|
-
if (typeof e == "string") return
|
|
625
|
+
if (typeof e == "string") return je(e, t);
|
|
626
626
|
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
627
627
|
if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
|
|
628
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
628
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return je(e, t);
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
function
|
|
631
|
+
function je(e, t) {
|
|
632
632
|
(t == null || t > e.length) && (t = e.length);
|
|
633
633
|
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
|
|
634
634
|
return n;
|
|
@@ -636,16 +636,16 @@ function Ae(e, t) {
|
|
|
636
636
|
function $r(e, t) {
|
|
637
637
|
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
638
638
|
if (r != null) {
|
|
639
|
-
var n, a, o, i, l = [],
|
|
639
|
+
var n, a, o, i, l = [], c = !0, f = !1;
|
|
640
640
|
try {
|
|
641
|
-
if (o = (r = r.call(e)).next, t !== 0) for (; !(
|
|
641
|
+
if (o = (r = r.call(e)).next, t !== 0) for (; !(c = (n = o.call(r)).done) && (l.push(n.value), l.length !== t); c = !0) ;
|
|
642
642
|
} catch (s) {
|
|
643
|
-
|
|
643
|
+
f = !0, a = s;
|
|
644
644
|
} finally {
|
|
645
645
|
try {
|
|
646
|
-
if (!
|
|
646
|
+
if (!c && r.return != null && (i = r.return(), Object(i) !== i)) return;
|
|
647
647
|
} finally {
|
|
648
|
-
if (
|
|
648
|
+
if (f) throw a;
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
return l;
|
|
@@ -654,8 +654,8 @@ function $r(e, t) {
|
|
|
654
654
|
function _r(e) {
|
|
655
655
|
if (Array.isArray(e)) return e;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
var t =
|
|
657
|
+
function _e(e) {
|
|
658
|
+
var t = $e(e), r = Fr(t, 2), n = r[0], a = r[1];
|
|
659
659
|
return I.setTwoToneColors({
|
|
660
660
|
primaryColor: n,
|
|
661
661
|
secondaryColor: a
|
|
@@ -675,13 +675,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
675
675
|
}
|
|
676
676
|
function zr(e, t) {
|
|
677
677
|
if (e) {
|
|
678
|
-
if (typeof e == "string") return
|
|
678
|
+
if (typeof e == "string") return Ne(e, t);
|
|
679
679
|
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
680
680
|
if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
|
|
681
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
681
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Ne(e, t);
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function Ne(e, t) {
|
|
685
685
|
(t == null || t > e.length) && (t = e.length);
|
|
686
686
|
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
|
|
687
687
|
return n;
|
|
@@ -689,16 +689,16 @@ function je(e, t) {
|
|
|
689
689
|
function Ur(e, t) {
|
|
690
690
|
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
691
691
|
if (r != null) {
|
|
692
|
-
var n, a, o, i, l = [],
|
|
692
|
+
var n, a, o, i, l = [], c = !0, f = !1;
|
|
693
693
|
try {
|
|
694
|
-
if (o = (r = r.call(e)).next, t !== 0) for (; !(
|
|
694
|
+
if (o = (r = r.call(e)).next, t !== 0) for (; !(c = (n = o.call(r)).done) && (l.push(n.value), l.length !== t); c = !0) ;
|
|
695
695
|
} catch (s) {
|
|
696
|
-
|
|
696
|
+
f = !0, a = s;
|
|
697
697
|
} finally {
|
|
698
698
|
try {
|
|
699
|
-
if (!
|
|
699
|
+
if (!c && r.return != null && (i = r.return(), Object(i) !== i)) return;
|
|
700
700
|
} finally {
|
|
701
|
-
if (
|
|
701
|
+
if (f) throw a;
|
|
702
702
|
}
|
|
703
703
|
}
|
|
704
704
|
return l;
|
|
@@ -707,7 +707,7 @@ function Ur(e, t) {
|
|
|
707
707
|
function Wr(e) {
|
|
708
708
|
if (Array.isArray(e)) return e;
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Ie(e) {
|
|
711
711
|
for (var t = 1; t < arguments.length; t++) {
|
|
712
712
|
var r = arguments[t] != null ? Object(arguments[t]) : {}, n = Object.keys(r);
|
|
713
713
|
typeof Object.getOwnPropertySymbols == "function" && n.push.apply(n, Object.getOwnPropertySymbols(r).filter(function(a) {
|
|
@@ -752,27 +752,27 @@ function Vr(e, t) {
|
|
|
752
752
|
a = n[o], !(t.indexOf(a) >= 0) && (r[a] = e[a]);
|
|
753
753
|
return r;
|
|
754
754
|
}
|
|
755
|
-
|
|
755
|
+
_e("#1890ff");
|
|
756
756
|
var F = function(t, r) {
|
|
757
|
-
var n, a =
|
|
757
|
+
var n, a = Ie({}, t, r.attrs), o = a.class, i = a.icon, l = a.spin, c = a.rotate, f = a.tabindex, s = a.twoToneColor, S = a.onClick, m = Kr(a, Lr), P = (n = {
|
|
758
758
|
anticon: !0
|
|
759
|
-
}, le(n, "anticon-".concat(i.name), !!i.name), le(n, o, o), n),
|
|
760
|
-
|
|
761
|
-
var u =
|
|
762
|
-
msTransform: "rotate(".concat(
|
|
763
|
-
transform: "rotate(".concat(
|
|
764
|
-
} : void 0,
|
|
765
|
-
return ae("span",
|
|
759
|
+
}, le(n, "anticon-".concat(i.name), !!i.name), le(n, o, o), n), b = l === "" || l || i.name === "loading" ? "anticon-spin" : "", y = f;
|
|
760
|
+
y === void 0 && S && (y = -1, m.tabindex = y);
|
|
761
|
+
var u = c ? {
|
|
762
|
+
msTransform: "rotate(".concat(c, "deg)"),
|
|
763
|
+
transform: "rotate(".concat(c, "deg)")
|
|
764
|
+
} : void 0, g = $e(s), h = Hr(g, 2), v = h[0], A = h[1];
|
|
765
|
+
return ae("span", Ie({
|
|
766
766
|
role: "img",
|
|
767
767
|
"aria-label": i.name
|
|
768
768
|
}, m, {
|
|
769
|
-
onClick:
|
|
770
|
-
class:
|
|
769
|
+
onClick: S,
|
|
770
|
+
class: P
|
|
771
771
|
}), [ae(I, {
|
|
772
|
-
class:
|
|
772
|
+
class: b,
|
|
773
773
|
icon: i,
|
|
774
774
|
primaryColor: v,
|
|
775
|
-
secondaryColor:
|
|
775
|
+
secondaryColor: A,
|
|
776
776
|
style: u
|
|
777
777
|
}, null)]);
|
|
778
778
|
};
|
|
@@ -785,9 +785,9 @@ F.props = {
|
|
|
785
785
|
F.displayName = "AntdIcon";
|
|
786
786
|
F.inheritAttrs = !1;
|
|
787
787
|
F.getTwoToneColor = Dr;
|
|
788
|
-
F.setTwoToneColor =
|
|
788
|
+
F.setTwoToneColor = _e;
|
|
789
789
|
var Yr = { icon: { tag: "svg", attrs: { viewBox: "32 32 960 960", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M384 32a96 96 0 00-96 96v96a32 32 0 0064 0v-96a32 32 0 0132-32h512a32 32 0 0132 32v512a32 32 0 01-32 32h-96a32 32 0 000 64h96a96 96 0 0096-96V128a96 96 0 00-96-96H384z" } }, { tag: "path", attrs: { d: "M128 288a96 96 0 00-96 96v512a96 96 0 0096 96h512a96 96 0 0096-96V384a96 96 0 00-96-96H128zm-32 96a32 32 0 0132-32h512a32 32 0 0132 32v512a32 32 0 01-32 32H128a32 32 0 01-32-32V384z" } }] }, name: "copy", theme: "outlined" };
|
|
790
|
-
function
|
|
790
|
+
function Ee(e) {
|
|
791
791
|
for (var t = 1; t < arguments.length; t++) {
|
|
792
792
|
var r = arguments[t] != null ? Object(arguments[t]) : {}, n = Object.keys(r);
|
|
793
793
|
typeof Object.getOwnPropertySymbols == "function" && n.push.apply(n, Object.getOwnPropertySymbols(r).filter(function(a) {
|
|
@@ -815,14 +815,14 @@ function Qr(e, t) {
|
|
|
815
815
|
}
|
|
816
816
|
return (t === "string" ? String : Number)(e);
|
|
817
817
|
}
|
|
818
|
-
var
|
|
819
|
-
var n =
|
|
820
|
-
return ae(F,
|
|
818
|
+
var ce = function(t, r) {
|
|
819
|
+
var n = Ee({}, t, r.attrs);
|
|
820
|
+
return ae(F, Ee({}, n, {
|
|
821
821
|
icon: Yr
|
|
822
822
|
}), null);
|
|
823
823
|
};
|
|
824
|
-
|
|
825
|
-
|
|
824
|
+
ce.displayName = "CopyOutlined";
|
|
825
|
+
ce.inheritAttrs = !1;
|
|
826
826
|
function D(e) {
|
|
827
827
|
if (e == null) return "";
|
|
828
828
|
if (typeof e == "string") return e;
|
|
@@ -839,7 +839,7 @@ function D(e) {
|
|
|
839
839
|
}
|
|
840
840
|
return "";
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function De(e, t = {}) {
|
|
843
843
|
const r = /* @__PURE__ */ new Map(), { value: n = "value", label: a = "label" } = t;
|
|
844
844
|
if (!e) return r;
|
|
845
845
|
const o = Array.isArray(e) ? e : [e];
|
|
@@ -848,15 +848,15 @@ function $e(e, t = {}) {
|
|
|
848
848
|
if (i.type && (typeof i.type == "object" || typeof i.type == "function")) {
|
|
849
849
|
let l = i.type.name?.toLowerCase() || "";
|
|
850
850
|
if (typeof i.type == "function" ? l = i.type.displayName?.toLowerCase() || "" : typeof i.type == "string" && (l = i.type?.toLowerCase() || ""), /option|radio|checkbox/i.test(l)) {
|
|
851
|
-
const
|
|
852
|
-
if (
|
|
853
|
-
const
|
|
854
|
-
r.set(
|
|
851
|
+
const c = i.props || {}, f = c[n] ?? c.value, s = c[a] ?? c.label;
|
|
852
|
+
if (f != null) {
|
|
853
|
+
const S = D(i.children) || s || String(f);
|
|
854
|
+
r.set(f, S);
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
|
-
i.children &&
|
|
859
|
-
r.has(
|
|
858
|
+
i.children && De(i.children, t).forEach((c, f) => {
|
|
859
|
+
r.has(f) || r.set(f, c);
|
|
860
860
|
});
|
|
861
861
|
}
|
|
862
862
|
return r;
|
|
@@ -864,12 +864,12 @@ function $e(e, t = {}) {
|
|
|
864
864
|
function Xr(e, t, r) {
|
|
865
865
|
const { value: n = "value", label: a = "label", children: o = "children" } = r, i = [];
|
|
866
866
|
let l = e;
|
|
867
|
-
for (const
|
|
868
|
-
const
|
|
869
|
-
if (
|
|
870
|
-
i.push(
|
|
867
|
+
for (const c of t) {
|
|
868
|
+
const f = l.find((s) => s[n] === c);
|
|
869
|
+
if (f)
|
|
870
|
+
i.push(f[a] || f[n] || String(c)), l = f[o] || [];
|
|
871
871
|
else {
|
|
872
|
-
i.push(String(
|
|
872
|
+
i.push(String(c));
|
|
873
873
|
break;
|
|
874
874
|
}
|
|
875
875
|
}
|
|
@@ -877,11 +877,11 @@ function Xr(e, t, r) {
|
|
|
877
877
|
}
|
|
878
878
|
function et(e, t, r) {
|
|
879
879
|
const { value: n = "value", label: a = "title", children: o = "children" } = r, i = [], l = new Set(Array.isArray(t) ? t : [t]);
|
|
880
|
-
function f
|
|
881
|
-
for (const s of
|
|
882
|
-
l.has(s[n]) && i.push(s[a] || s[n]), s[o] &&
|
|
880
|
+
function c(f) {
|
|
881
|
+
for (const s of f)
|
|
882
|
+
l.has(s[n]) && i.push(s[a] || s[n]), s[o] && c(s[o]);
|
|
883
883
|
}
|
|
884
|
-
return
|
|
884
|
+
return c(e), i;
|
|
885
885
|
}
|
|
886
886
|
function rt({
|
|
887
887
|
modelValue: e,
|
|
@@ -892,58 +892,58 @@ function rt({
|
|
|
892
892
|
slots: o,
|
|
893
893
|
isSelect: i,
|
|
894
894
|
isRadioGroup: l,
|
|
895
|
-
isCheckboxGroup:
|
|
896
|
-
isCheckbox:
|
|
895
|
+
isCheckboxGroup: c,
|
|
896
|
+
isCheckbox: f,
|
|
897
897
|
isRadio: s,
|
|
898
|
-
isCascader:
|
|
898
|
+
isCascader: S,
|
|
899
899
|
isTreeSelect: m,
|
|
900
|
-
isSwitch:
|
|
901
|
-
attrs:
|
|
902
|
-
emptyText:
|
|
900
|
+
isSwitch: P,
|
|
901
|
+
attrs: b,
|
|
902
|
+
emptyText: y
|
|
903
903
|
}) {
|
|
904
904
|
if (n)
|
|
905
905
|
try {
|
|
906
|
-
return n(e) ||
|
|
906
|
+
return n(e) || y;
|
|
907
907
|
} catch (u) {
|
|
908
908
|
console.warn("[ReadonlyHOC] valueToLabel error", u);
|
|
909
909
|
}
|
|
910
|
-
if (
|
|
911
|
-
const u =
|
|
912
|
-
return e === u ?
|
|
910
|
+
if (P) {
|
|
911
|
+
const u = b.checkedValue ?? b["checked-value"] ?? !0, g = b.uncheckedValue ?? b["un-checked-value"] ?? !1;
|
|
912
|
+
return e === u ? b.checkedChildren ?? b["checked-children"] ?? "开启" : e === g ? b.uncheckedChildren ?? b["un-checked-children"] ?? "关闭" : String(e || y);
|
|
913
913
|
}
|
|
914
|
-
if (
|
|
915
|
-
return Xr(t, e, a).join(" / ") ||
|
|
914
|
+
if (S && Array.isArray(e) && t?.length)
|
|
915
|
+
return Xr(t, e, a).join(" / ") || y;
|
|
916
916
|
if (m && r?.length)
|
|
917
|
-
return et(r, e, a).join(", ") ||
|
|
917
|
+
return et(r, e, a).join(", ") || y;
|
|
918
918
|
if (t?.length) {
|
|
919
|
-
const u = a.value || "value",
|
|
920
|
-
const
|
|
921
|
-
return
|
|
919
|
+
const u = a.value || "value", g = a.label || "label", h = (v) => {
|
|
920
|
+
const A = t.find((K) => K[u] === v);
|
|
921
|
+
return A ? A[g] || A[u] : v == null ? "" : String(v);
|
|
922
922
|
};
|
|
923
|
-
return Array.isArray(e) ? e.map(h).join(", ") ||
|
|
924
|
-
} else if ((i || l ||
|
|
923
|
+
return Array.isArray(e) ? e.map(h).join(", ") || y : h(e) || y;
|
|
924
|
+
} else if ((i || l || c) && o?.default)
|
|
925
925
|
try {
|
|
926
|
-
const u = o.default(),
|
|
927
|
-
if (
|
|
928
|
-
const h = (v) => v == null ? "" :
|
|
929
|
-
return Array.isArray(e) ? e.map(h).join(", ") ||
|
|
926
|
+
const u = o.default(), g = De(u, a);
|
|
927
|
+
if (g.size > 0) {
|
|
928
|
+
const h = (v) => v == null ? "" : g.get(v) || String(v);
|
|
929
|
+
return Array.isArray(e) ? e.map(h).join(", ") || y : h(e) || y;
|
|
930
930
|
}
|
|
931
931
|
} catch (u) {
|
|
932
932
|
console.warn("[ReadonlyHOC] Failed to parse slot options", u);
|
|
933
933
|
}
|
|
934
|
-
else if (o?.default && (
|
|
934
|
+
else if (o?.default && (f || s) && typeof e == "boolean")
|
|
935
935
|
try {
|
|
936
|
-
const u = o.default(),
|
|
937
|
-
if (
|
|
936
|
+
const u = o.default(), g = D(u);
|
|
937
|
+
if (g) return g;
|
|
938
938
|
} catch {
|
|
939
939
|
}
|
|
940
|
-
return e == null || e === "" ?
|
|
940
|
+
return e == null || e === "" ? y : Array.isArray(e) ? e.join(", ") : String(e);
|
|
941
941
|
}
|
|
942
942
|
function tt(e) {
|
|
943
943
|
if (typeof e == "function")
|
|
944
944
|
return e;
|
|
945
|
-
const t = e.name || "", r = t.toLowerCase(), n = /select/i.test(r) && !/tree|cascader/i.test(r), a = /radio/i.test(r) && !/group/i.test(r), o = /radio.*group/i.test(r), i = /checkbox/i.test(r) && !/group/i.test(r), l = /checkbox.*group/i.test(r),
|
|
946
|
-
return
|
|
945
|
+
const t = e.name || "", r = t.toLowerCase(), n = /select/i.test(r) && !/tree|cascader/i.test(r), a = /radio/i.test(r) && !/group/i.test(r), o = /radio.*group/i.test(r), i = /checkbox/i.test(r) && !/group/i.test(r), l = /checkbox.*group/i.test(r), c = /switch/i.test(r), f = /cascader/i.test(r), s = /tree.*select/i.test(r), m = i || c || a ? "checked" : "value", P = `update:${m}`, b = /form$/i.test(r), y = /form.*item/i.test(r);
|
|
946
|
+
return Ge({
|
|
947
947
|
name: t,
|
|
948
948
|
inheritAttrs: !1,
|
|
949
949
|
props: {
|
|
@@ -954,19 +954,19 @@ function tt(e) {
|
|
|
954
954
|
valueToLabel: { type: Function, default: null },
|
|
955
955
|
copyable: { type: Boolean, default: void 0 }
|
|
956
956
|
},
|
|
957
|
-
emits: ["update:modelValue",
|
|
958
|
-
setup(u, { emit:
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
},
|
|
964
|
-
if (!
|
|
965
|
-
const d =
|
|
957
|
+
emits: ["update:modelValue", P],
|
|
958
|
+
setup(u, { emit: g, slots: h, expose: v }) {
|
|
959
|
+
const A = ue("nkReadonly", B(!1)), K = ue("copyable", B(!0)), j = R(() => u.readonly ?? A.value), V = R(() => u.readonly ?? A.value), Y = R(() => u.copyable ?? K.value ?? !0), L = B(!1);
|
|
960
|
+
b && (se("nkReadonly", V), se("copyable", Y));
|
|
961
|
+
const fe = R(() => u[m] !== void 0 ? u[m] : u.modelValue), Le = (d) => {
|
|
962
|
+
g("update:modelValue", d), g(P, d);
|
|
963
|
+
}, C = qe(), H = R(() => {
|
|
964
|
+
if (!j.value) return "";
|
|
965
|
+
const d = C.fieldNames ?? C["field-names"] ?? {}, J = C.options, Ue = C.treeData ?? C["tree-data"];
|
|
966
966
|
return rt({
|
|
967
|
-
modelValue:
|
|
967
|
+
modelValue: fe.value,
|
|
968
968
|
options: J,
|
|
969
|
-
treeData:
|
|
969
|
+
treeData: Ue,
|
|
970
970
|
valueToLabel: u.valueToLabel,
|
|
971
971
|
fieldNames: d,
|
|
972
972
|
slots: h,
|
|
@@ -975,13 +975,13 @@ function tt(e) {
|
|
|
975
975
|
isCheckboxGroup: l,
|
|
976
976
|
isCheckbox: i,
|
|
977
977
|
isRadio: a,
|
|
978
|
-
isCascader:
|
|
978
|
+
isCascader: f,
|
|
979
979
|
isTreeSelect: s,
|
|
980
|
-
isSwitch:
|
|
981
|
-
attrs:
|
|
980
|
+
isSwitch: c,
|
|
981
|
+
attrs: C,
|
|
982
982
|
emptyText: u.emptyText
|
|
983
983
|
});
|
|
984
|
-
}),
|
|
984
|
+
}), He = {
|
|
985
985
|
lineHeight: "32px",
|
|
986
986
|
padding: "0 6px",
|
|
987
987
|
display: "inline-block",
|
|
@@ -995,42 +995,42 @@ function tt(e) {
|
|
|
995
995
|
backgroundColor: "none",
|
|
996
996
|
whiteSpace: "pre-wrap"
|
|
997
997
|
}, E = B();
|
|
998
|
-
|
|
999
|
-
validate: () =>
|
|
1000
|
-
validateFields: (d) =>
|
|
1001
|
-
resetFields: (d) => !
|
|
1002
|
-
clearValidate: (d) => !
|
|
1003
|
-
scrollToField: (d) => !
|
|
998
|
+
b && v({
|
|
999
|
+
validate: () => j.value ? Promise.resolve({}) : E.value?.validate?.(),
|
|
1000
|
+
validateFields: (d) => j.value ? Promise.resolve({}) : E.value?.validateFields?.(d),
|
|
1001
|
+
resetFields: (d) => !j.value && E.value?.resetFields?.(d),
|
|
1002
|
+
clearValidate: (d) => !j.value && E.value?.clearValidate?.(d),
|
|
1003
|
+
scrollToField: (d) => !j.value && E.value?.scrollToField?.(d)
|
|
1004
1004
|
});
|
|
1005
|
-
const
|
|
1005
|
+
const Be = () => {
|
|
1006
1006
|
L.value = !0;
|
|
1007
|
-
},
|
|
1007
|
+
}, ze = () => {
|
|
1008
1008
|
L.value = !1;
|
|
1009
1009
|
};
|
|
1010
|
-
return () =>
|
|
1010
|
+
return () => y ? T(
|
|
1011
1011
|
e,
|
|
1012
1012
|
{
|
|
1013
|
-
...
|
|
1014
|
-
style: { ...
|
|
1013
|
+
...C,
|
|
1014
|
+
style: { ...C.style || {}, marginBottom: j.value ? "10px" : void 0 }
|
|
1015
1015
|
},
|
|
1016
1016
|
h
|
|
1017
|
-
) :
|
|
1017
|
+
) : b ? T(
|
|
1018
1018
|
e,
|
|
1019
1019
|
{
|
|
1020
|
-
...
|
|
1021
|
-
rules: V.value ? null :
|
|
1022
|
-
disabled: V.value ? !0 :
|
|
1020
|
+
...C,
|
|
1021
|
+
rules: V.value ? null : C.rules,
|
|
1022
|
+
disabled: V.value ? !0 : C.disabled,
|
|
1023
1023
|
ref: E
|
|
1024
1024
|
},
|
|
1025
1025
|
h
|
|
1026
|
-
) :
|
|
1026
|
+
) : j.value ? T(
|
|
1027
1027
|
"span",
|
|
1028
1028
|
{
|
|
1029
|
-
onMouseenter:
|
|
1030
|
-
onMouseleave:
|
|
1029
|
+
onMouseenter: Be,
|
|
1030
|
+
onMouseleave: ze,
|
|
1031
1031
|
class: "nk-readonly-wrapper",
|
|
1032
1032
|
style: {
|
|
1033
|
-
...
|
|
1033
|
+
...He,
|
|
1034
1034
|
color: Y.value && L.value ? "#6e9eff" : "rgba(0, 0, 0, 0.65)"
|
|
1035
1035
|
}
|
|
1036
1036
|
},
|
|
@@ -1047,7 +1047,7 @@ function tt(e) {
|
|
|
1047
1047
|
},
|
|
1048
1048
|
[
|
|
1049
1049
|
T(
|
|
1050
|
-
|
|
1050
|
+
ce,
|
|
1051
1051
|
{
|
|
1052
1052
|
onClick: async () => {
|
|
1053
1053
|
try {
|
|
@@ -1081,10 +1081,10 @@ function tt(e) {
|
|
|
1081
1081
|
) : T(
|
|
1082
1082
|
e,
|
|
1083
1083
|
{
|
|
1084
|
-
...
|
|
1085
|
-
[m]:
|
|
1086
|
-
[`onUpdate:${m}`]:
|
|
1087
|
-
ref:
|
|
1084
|
+
...C,
|
|
1085
|
+
[m]: fe.value,
|
|
1086
|
+
[`onUpdate:${m}`]: Le,
|
|
1087
|
+
ref: b ? E : void 0
|
|
1088
1088
|
},
|
|
1089
1089
|
h
|
|
1090
1090
|
);
|
|
@@ -1095,46 +1095,50 @@ const nt = {
|
|
|
1095
1095
|
Input: Qe,
|
|
1096
1096
|
InputNumber: Ze,
|
|
1097
1097
|
Textarea: Je,
|
|
1098
|
-
Select:
|
|
1099
|
-
SelectOption:
|
|
1098
|
+
Select: me,
|
|
1099
|
+
SelectOption: me.Option,
|
|
1100
1100
|
TreeSelect: Ye,
|
|
1101
1101
|
Cascader: Ve,
|
|
1102
|
-
DatePicker:
|
|
1103
|
-
|
|
1102
|
+
DatePicker: ge,
|
|
1103
|
+
RangePicker: ge.RangePicker,
|
|
1104
|
+
TimePicker: ye,
|
|
1105
|
+
TimeRangePicker: ye.TimeRangePicker,
|
|
1104
1106
|
Radio: be,
|
|
1105
1107
|
Checkbox: pe,
|
|
1106
1108
|
RadioGroup: be.Group,
|
|
1107
1109
|
CheckboxGroup: pe.Group,
|
|
1108
|
-
Switch:
|
|
1110
|
+
Switch: Ke,
|
|
1109
1111
|
Form: de,
|
|
1110
1112
|
FormItem: de.Item
|
|
1111
|
-
},
|
|
1113
|
+
}, p = {};
|
|
1112
1114
|
for (const [e, t] of Object.entries(nt))
|
|
1113
1115
|
if (t) {
|
|
1114
1116
|
const r = tt(t);
|
|
1115
|
-
|
|
1117
|
+
p[`Nk${e}`] = r;
|
|
1116
1118
|
}
|
|
1117
1119
|
const it = {
|
|
1118
1120
|
install(e) {
|
|
1119
|
-
for (const [t, r] of Object.entries(
|
|
1121
|
+
for (const [t, r] of Object.entries(p))
|
|
1120
1122
|
if (r) {
|
|
1121
1123
|
const n = r;
|
|
1122
1124
|
e.component(t, n);
|
|
1123
1125
|
}
|
|
1124
1126
|
}
|
|
1125
|
-
}, lt =
|
|
1127
|
+
}, lt = p.NkInput, ct = p.NkInputNumber, ft = p.NkSelect, ut = p.NkCascader, st = p.NkTreeSelect, dt = p.NkDatePicker, pt = p.NkRangePicker, bt = p.NkTimePicker, yt = p.NkTimeRangePicker, gt = p.NkCheckbox, mt = p.NkRadio, ht = p.NkSwitch, vt = p.NkForm, kt = p.NkFormItem;
|
|
1126
1128
|
export {
|
|
1127
1129
|
ut as NkCascader,
|
|
1128
|
-
|
|
1130
|
+
gt as NkCheckbox,
|
|
1129
1131
|
dt as NkDatePicker,
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
+
vt as NkForm,
|
|
1133
|
+
kt as NkFormItem,
|
|
1132
1134
|
lt as NkInput,
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1135
|
+
ct as NkInputNumber,
|
|
1136
|
+
mt as NkRadio,
|
|
1137
|
+
pt as NkRangePicker,
|
|
1138
|
+
ft as NkSelect,
|
|
1139
|
+
ht as NkSwitch,
|
|
1140
|
+
bt as NkTimePicker,
|
|
1141
|
+
yt as NkTimeRangePicker,
|
|
1138
1142
|
st as NkTreeSelect,
|
|
1139
1143
|
it as default,
|
|
1140
1144
|
tt as withReadonly
|