bkui-vue 0.0.2-beta.15 → 0.0.2-beta.16

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
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","vue-types","../config-provider","../directives","../icon"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon")):t(e["../shared"],e.vue,e["vue-types"],e["../config-provider"],e["../directives"],e["../icon"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o,a)=>(()=>{"use strict";var i={2717:e=>{e.exports=n},4061:e=>{e.exports=o},6870:e=>{e.exports=a},4212:t=>{t.exports=e},748:e=>{e.exports=t},210:e=>{e.exports=r}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return i[e](r,r.exports,u),r.exports}u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{u.r(l),u.d(l,{default:()=>fe});var e=u(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var n=u(748);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a=/^\s+/,i=/\s+$/;function c(e,t){if(t=t||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,t);var r=function(e){var t,r,n,c={r:0,g:0,b:0},u=1,l=null,s=null,f=null,d=!1,h=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(i,"").toLowerCase();var t,r=!1;if(S[e])e=S[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=L.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=L.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=L.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=L.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=L.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=L.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=L.hex8.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),a:F(t[4]),format:r?"name":"hex8"}:(t=L.hex6.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:r?"name":"hex"}:(t=L.hex4.exec(e))?{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),a:F(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=L.hex3.exec(e))&&{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==o(e)&&(E(e.r)&&E(e.g)&&E(e.b)?(t=e.r,r=e.g,n=e.b,c={r:255*C(t,255),g:255*C(r,255),b:255*C(n,255)},d=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):E(e.h)&&E(e.s)&&E(e.v)?(l=R(e.s),s=R(e.v),c=function(e,t,r){e=6*C(e,360),t=C(t,100),r=C(r,100);var n=Math.floor(e),o=e-n,a=r*(1-t),i=r*(1-o*t),c=r*(1-(1-o)*t),u=n%6;return{r:255*[r,i,a,a,c,r][u],g:255*[c,r,r,i,a,a][u],b:255*[a,a,c,r,r,i][u]}}(e.h,l,s),d=!0,h="hsv"):E(e.h)&&E(e.s)&&E(e.l)&&(l=R(e.s),f=R(e.l),c=function(e,t,r){var n,o,a;function i(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=C(e,360),t=C(t,100),r=C(r,100),0===t)n=o=a=r;else{var c=r<.5?r*(1+t):r+t-r*t,u=2*r-c;n=i(u,c,e+1/3),o=i(u,c,e),a=i(u,c,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(e.h,l,f),d=!0,h="hsl"),e.hasOwnProperty("a")&&(u=e.a)),u=j(u),{ok:d,format:e.format||h,r:Math.min(255,Math.max(c.r,0)),g:Math.min(255,Math.max(c.g,0)),b:Math.min(255,Math.max(c.b,0)),a:u}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}function s(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,o,a=Math.max(e,t,r),i=Math.min(e,t,r),c=(a+i)/2;if(a==i)n=o=0;else{var u=a-i;switch(o=c>.5?u/(2-a-i):u/(a+i),a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:o,l:c}}function f(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,o,a=Math.max(e,t,r),i=Math.min(e,t,r),c=a,u=a-i;if(o=0===a?0:u/a,a==i)n=0;else{switch(a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:o,v:c}}function d(e,t,r,n){var o=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function h(e,t,r,n){return[P(T(n)),P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16))].join("")}function p(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s-=t/100,r.s=V(r.s),c(r)}function v(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s+=t/100,r.s=V(r.s),c(r)}function g(e){return c(e).desaturate(100)}function b(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l+=t/100,r.l=V(r.l),c(r)}function m(e,t){t=0===t?0:t||10;var r=c(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-t/100*255))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-t/100*255))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-t/100*255))),c(r)}function y(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l-=t/100,r.l=V(r.l),c(r)}function k(e,t){var r=c(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,c(r)}function w(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function x(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=c(e).toHsl(),n=[c(e)],o=360/t,a=1;a<t;a++)n.push(c({h:(r.h+a*o)%360,s:r.s,l:r.l}));return n}function _(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+72)%360,s:t.s,l:t.l}),c({h:(r+216)%360,s:t.s,l:t.l})]}function M(e,t,r){t=t||6,r=r||30;var n=c(e).toHsl(),o=360/r,a=[c(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(c(n));return a}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,o=r.s,a=r.v,i=[],u=1/t;t--;)i.push(c({h:n,s:o,v:a})),a=(a+u)%1;return i}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=j(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=s(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=s(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,o){var a=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16)),P(T(n))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*C(this._r,255))+"%",g:Math.round(100*C(this._g,255))+"%",b:Math.round(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*C(this._r,255))+"%, "+Math.round(100*C(this._g,255))+"%, "+Math.round(100*C(this._b,255))+"%)":"rgba("+Math.round(100*C(this._r,255))+"%, "+Math.round(100*C(this._g,255))+"%, "+Math.round(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(N[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+h(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=c(e);r="#"+h(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(k,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(x,[3])},tetrad:function(){return this._applyCombination(x,[4])}},c.fromRatio=function(e,t){if("object"==o(e)){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),o=c(t).toRgb(),a=r/100;return c({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},c.readability=function(e,t){var r=c(e),n=c(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,o,a,i,u,l=c.readability(e,t);switch(o=!1,(a=r,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(u=(a.size||"small").toLowerCase())&&"large"!==u&&(u="small"),n={level:i,size:u}).level+n.size){case"AAsmall":case"AAAlarge":o=l>=4.5;break;case"AAlarge":o=l>=3;break;case"AAAsmall":o=l>=7}return o},c.mostReadable=function(e,t,r){var n,o,a,i,u=null,l=0;o=(r=r||{}).includeFallbackColors,a=r.level,i=r.size;for(var s=0;s<t.length;s++)(n=c.readability(e,t[s]))>l&&(l=n,u=c(t[s]));return c.isReadable(e,u,{level:a,size:i})||!o?u:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var S=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function j(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function C(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function V(e){return Math.min(1,Math.max(0,e))}function O(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function T(e){return Math.round(255*parseFloat(e)).toString(16)}function F(e){return O(e)/255}var H,q,D,L=(q="[\\s|\\(]+("+(H="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",D="[\\s|\\(]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",{CSS_UNIT:new RegExp(H),rgb:new RegExp("rgb"+q),rgba:new RegExp("rgba"+D),hsl:new RegExp("hsl"+q),hsla:new RegExp("hsla"+D),hsv:new RegExp("hsv"+q),hsva:new RegExp("hsva"+D),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 E(e){return!!L.CSS_UNIT.exec(e)}var I=u(210),B=u(2717),U=u(4061),z=u(6870),K={placement:{type:String,default:"bottom-start",validator:function(e){return!(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].indexOf(e)<0&&(console.error("placement property is not valid: '".concat(e,"'")),1))}},className:{type:String},extPopoverCls:{type:String},appendToBody:{type:Boolean},triggerRef:{type:Object},onClick:Function};const W=(0,n.defineComponent)({props:K,emits:["changeVisible"],setup:function(t,r){var o=r.emit,a=Object.create(null),i=(0,n.ref)(null);(0,n.onMounted)((function(){u()})),(0,n.onBeforeUnmount)((function(){c()}));var c=function(){if(a&&0!==Object.keys(a).length){var e=a;e.isShow&&e.hide(),e.destroy(),a=null,o("changeVisible",!1)}},u=function(){a&&0!==Object.keys(a).length?(0,n.nextTick)((function(){a.update()})):(0,n.nextTick)((function(){a=new e.BKPopover(t.triggerRef,i.value,{placement:t.placement,trigger:"manual",modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},{name:"offset",options:{offset:[0,4]}}]})}))},l=(0,n.computed)((function(){var r={};return t.appendToBody&&(r["z-index"]=1060+e.bkZIndexManager.getModalNextIndex()),r})),s=(0,n.reactive)({styles:l}),f=(0,B.usePrefix)().resolveClassName;return Object.assign(Object.assign({},(0,n.toRefs)(s)),{refContentRef:i,forceUpdate:function(){var e;a&&(null===(e=null==a?void 0:a.forceUpdate)||void 0===e||e.call(a))},updateDropdown:u,destoryDropdown:c,resolveClassName:f})},render:function(){var e,t,r;return(0,n.createVNode)("div",{ref:"refContentRef",class:[this.resolveClassName("date-picker-dropdown"),this.className,this.extPopoverCls],style:this.styles,onClick:this.onClick},[null!==(r=null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))&&void 0!==r?r:""])}});var X={info:e.PropTypes.object.isRequired};const $=(0,n.defineComponent)({props:X,emits:["tab","input"],setup:function(t,r){var o=r.emit,a=function(e){"a"===t.info.key&&o("tab",e)},i=function(e){var r=t.info.key,n=e.target.value;o("input",r,n)},c=(0,B.usePrefix)().resolveClassName,u=(0,n.computed)((function(){return(0,e.classes)({error:t.info.error},"".concat(c("color-picker-input-value")))}));return function(){return(0,n.createVNode)("div",{class:"".concat(c("color-picker-input-part"))},[(0,n.createVNode)("input",{type:"HEX"===t.info.name?"text":"number",class:u.value,value:t.info.value,onKeydown:a,onInput:i},null),(0,n.createVNode)("span",{class:"".concat(c("color-picker-input-text"))},[t.info.name])])}}});var G={colorObj:e.PropTypes.object.isRequired};const Y=(0,n.defineComponent)({name:"ColorPicker",props:G,emits:["change","tab"],setup:function(e,t){var r=t.emit,o=(0,n.reactive)({key:"hex",name:"HEX",value:e.colorObj.hex,error:!1}),a=(0,n.reactive)({key:"r",name:"R",value:e.colorObj.rgba.r.toString(),error:!1}),i=(0,n.reactive)({key:"g",name:"G",value:e.colorObj.rgba.g.toString(),error:!1}),u=(0,n.reactive)({key:"b",name:"B",value:e.colorObj.rgba.b.toString(),error:!1}),l=(0,n.reactive)({key:"a",name:"Alpha",value:e.colorObj.rgba.a.toString(),error:!1});(0,n.watch)((function(){return e.colorObj}),(function(e){c(e.hex).toString()!==c(o.value).toString()&&(o.value=e.hex),a.value=e.rgba.r.toString(),i.value=e.rgba.g.toString(),u.value=e.rgba.b.toString(),l.value=e.rgba.a.toString(),d()}),{deep:!0});var s=function(e){r("tab",e)},f=function(e,t){if({r:a,g:i,b:u,a:l,hex:o}[e].value=t,d()){var n="hex"===e?o.value:"rgba(".concat(a.value,", ").concat(i.value,", ").concat(u.value,", ").concat(l.value,")");r("change",n)}},d=function(){var e=!0;!o.value.startsWith("#")||4!==o.value.length&&7!==o.value.length||o.value.slice(1).match(/[^0-9a-fA-F]/)?(o.error=!0,e=!1):o.error=!1,""!==l.value&&l.value>=0&&l.value<=1?l.error=!1:(l.error=!0,e=!1);for(var t=0,r=[a,i,u];t<r.length;t++){var n=r[t],c=n.value;""!==c&&c>=0&&c<=255?n.error=!1:(n.error=!0,e=!1)}return e},h=(0,B.usePrefix)().resolveClassName;return function(){return(0,n.createVNode)("div",{class:"".concat(h("color-picker-input"))},[(0,n.createVNode)("div",{class:"".concat(h("color-picker-input-hex"))},[(0,n.createVNode)($,{info:o,onInput:f},null)]),(0,n.createVNode)("div",{class:"".concat(h("color-picker-input-rgba"))},[(0,n.createVNode)($,{info:a,onInput:f},null),(0,n.createVNode)($,{info:i,onInput:f},null),(0,n.createVNode)($,{info:u,onInput:f},null),(0,n.createVNode)($,{info:l,onInput:f,onTab:s},null)])])}}});var J=function(e){var t=e;""===e&&(t="#FFFFFF");var r=c(e),n=r.toHsl(),o=r.toHsv();return 0===n.s&&(n.h=t.h||0,o.h=t.h||0),o.v<.0164&&(o.h=t.h||0,o.s=t.s||0),n.l<.01&&(n.h=t.h||0,n.s=t.s||0),{hsl:n,hsv:o,hex:r.toHexString().toUpperCase(),rgba:r.toRgb()}},Z=function(e,t,r){return e<t?t:e>r?r:e},Q=function(e,t){return e.touches?e.touches[0][t]:0},ee=function(e){var t=e.r,r=e.g,n=e.b,o=e.a;return"rgba(".concat([t,r,n,o].join(","),")")},te={colorObj:e.PropTypes.object.isRequired};const re=(0,n.defineComponent)({name:"ColorPicker",props:te,emits:["change"],setup:function(e,t){var r=t.emit,o=(0,n.ref)(null),a=(0,n.computed)((function(){return{left:"".concat(e.colorObj.hsv.h/360*100,"%")}})),i=function(t){var r=o.value.clientWidth,n=e.colorObj.hsv.h/360*r;switch(t.code){case"ArrowLeft":t.preventDefault(),n=Z(n-2,0,r);break;case"ArrowRight":t.preventDefault(),n=Z(n+2,0,r);break;case"ArrowUp":t.preventDefault(),n=Z(n-10,0,r);break;case"ArrowDown":t.preventDefault(),n=Z(n+10,0,r);break;default:return}u(null,n)},c=function e(){window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",e)},u=function(e,t){var r=o.value.clientWidth,n=void 0!==t?t:l(e);s(n/r)},l=function(e){var t=o.value.getBoundingClientRect().left+window.pageXOffset,r=e.pageX||Q(e,"PageX");return Z(r-t,0,o.value.clientWidth)},s=function(t){var n=e.colorObj.hsl,o=n.h,a=n.s,i=n.l,c=n.a,u=360*t;o!==u&&r("change",{h:u,s:a,l:i,a:c})},f=(0,B.usePrefix)().resolveClassName;return function(){return(0,n.createVNode)("div",{ref:o,tabindex:"0",class:"".concat(f("color-picker-hue")),onKeydown:i,onMousedown:function(e){e.stopPropagation(),e.preventDefault(),function(e){o.value.focus(),u(e),window.addEventListener("mousemove",u,{passive:!0}),window.addEventListener("mouseup",c)}(e)}},[(0,n.createVNode)("div",{class:"".concat(f("color-picker-hue-pointer")),style:a.value},[(0,n.createVNode)("div",{class:"".concat(f("color-picker-hue-rectangle"))},null)])])}}});var ne={colorObj:e.PropTypes.object.isRequired,recommend:e.PropTypes.oneOfType([e.PropTypes.array.def((function(){return[]})),e.PropTypes.bool.def(!0)]).isRequired};const oe=(0,n.defineComponent)({props:ne,emits:["change","tab"],setup:function(t,o){var a=o.emit,i=(0,n.ref)(!1),u=(0,n.ref)(-1),l=(0,n.ref)(null);(0,n.watch)((function(){return t.colorObj}),(function(){u.value=-1,l.value=null}),{deep:!0});var s=(0,n.computed)((function(){return v(t.recommend)})),f=(0,B.usePrefix)().resolveClassName,d=function(t,n){var o;return(0,e.classes)((r(o={},"".concat(f("color-picker-empty")),""===t),r(o,"".concat(f("color-picker-recommend-selected-color")),i.value&&u.value===n),o),"".concat(f("color-picker-recommend-color")))},h=function(e){if("Tab"===e.code)a("tab",e);else{var t=0,r=s.value.length-1;switch(e.code){case"ArrowLeft":e.preventDefault(),t=Z(u.value-1,0,r);break;case"ArrowRight":e.preventDefault(),t=Z(u.value+1,0,r);break;case"ArrowUp":e.preventDefault(),t=Z(u.value-10,0,r);break;case"ArrowDown":e.preventDefault(),t=Z(u.value+10,0,r);break;default:return}p(t)}},p=function(e){var t=s.value[e];a("change",t),(0,n.nextTick)((function(){u.value=e,l.value=t}))},v=function(e){return!0===e?["","#ff4500","#ff8c00","#ffd700","#90ee90","#ddffff","#00ced1","#3a84ff","#a933f5","#db7093","#000000","#494949","#9B9B9B","#ffffff"]:Array.isArray(e)?e.map((function(e){return c(e).isValid()?e:""})):void 0};return function(){return(0,n.createVNode)("div",{tabindex:"0",class:"".concat(f("color-picker-recommend")," "),onFocus:function(){return i.value=!0},onBlur:function(){return i.value=!1},onKeydown:h},[s.value.map((function(e,t){return(0,n.createVNode)("div",{style:"background: ".concat(e||"#fff"),class:d(e,t),onClick:function(){return p(t)}},[u.value===t?(0,n.createVNode)("div",{class:"".concat(f("color-picker-pointer"))},[(0,n.createVNode)("div",{class:"".concat(f("color-picker-circle"))},null)]):void 0])}))])}}});var ae={colorObj:e.PropTypes.object.isRequired};const ie=(0,n.defineComponent)({props:ae,emits:["change"],setup:function(e,t){var r=t.emit,o=(0,n.ref)(null),a=(0,n.computed)((function(){return{background:"hsl(".concat(e.colorObj.hsv.h,", 100%, 50%)")}})),i=(0,n.computed)((function(){return{top:"".concat(100*(1-e.colorObj.hsv.v),"%"),left:"".concat(100*e.colorObj.hsv.s,"%")}})),c=function e(){window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",e)},u=function(t){var r=o.value,n=r.clientWidth,a=r.clientHeight,i=e.colorObj.hsv.s*n,c=(1-e.colorObj.hsv.v)*a;switch(t.code){case"ArrowLeft":t.preventDefault(),i=Z(i-10,0,n);break;case"ArrowRight":t.preventDefault(),i=Z(i+10,0,n);break;case"ArrowUp":t.preventDefault(),c=Z(c-10,0,a);break;case"ArrowDown":t.preventDefault(),c=Z(c+10,0,a);break;default:return}l(null,i,c)},l=function(t,r,n){var a=o.value,i=a.clientWidth,c=a.clientHeight,u=(void 0!==r?r:s(t))/i,l=1-(void 0!==n?n:f(t))/c;d(e.colorObj.hsv.h,u,l,e.colorObj.hsv.a)},s=function(e){var t=o.value.getBoundingClientRect().left+window.pageXOffset,r=e.pageX||Q(e,"PageX");return Z(r-t,0,o.value.clientWidth)},f=function(e){var t=o.value.getBoundingClientRect().top+window.pageYOffset,r=e.pageY||Q(e,"PageY");return Z(r-t,0,o.value.clientHeight)},d=function(e,t,n,o){r("change",{h:e,s:t,v:n,a:o})},h=(0,B.usePrefix)().resolveClassName;return function(){return(0,n.createVNode)("div",{ref:o,tabindex:"0",class:"".concat(h("color-picker-saturation")),style:a.value,onKeydown:u,onMousedown:function(e){e.stopPropagation(),function(e){o.value.focus(),l(e),window.addEventListener("mousemove",l,{passive:!0}),window.addEventListener("mouseup",c)}(e)}},[(0,n.createVNode)("div",{class:"".concat(h("color-picker-saturation-white"))},null),(0,n.createVNode)("div",{class:"".concat(h("color-picker-saturation-black"))},null),(0,n.createVNode)("div",{class:"".concat(h("color-picker-pointer")),style:i.value},[(0,n.createVNode)("div",{class:"".concat(h("color-picker-circle"))},null)])])}}});var ce;!function(e){e.UNKNOWN="",e.SMALL="small",e.LARGE="large"}(ce||(ce={}));var ue={modelValue:e.PropTypes.string.def(""),disabled:e.PropTypes.bool.def(!1),readonly:e.PropTypes.bool.def(!1),transfer:e.PropTypes.bool.def(!1),size:(0,I.toType)("colorPickSize",{}).def(ce.UNKNOWN),showValue:e.PropTypes.bool.def(!0),recommend:e.PropTypes.oneOfType([e.PropTypes.array.def((function(){return[]})),e.PropTypes.bool.def(!0)]).def(!0),extCls:e.PropTypes.string.def(""),withValidate:e.PropTypes.bool.def(!0)},le=J("#FFFFFF");const se=(0,n.defineComponent)({name:"ColorPicker",directives:{clickoutside:U.clickoutside},props:ue,emits:["update:modelValue","change"],setup:function(t,o){var a=o.emit,i=(0,e.useFormItem)(),u=(0,n.ref)(!1),l=(0,n.ref)(""),s=(0,n.reactive)(JSON.parse(JSON.stringify(le))),f=(0,n.ref)(null),d=(0,n.ref)(null),h=(0,n.ref)(null),p=(0,B.usePrefix)().resolveClassName,v=(0,n.computed)((function(){var n;return(0,e.classes)((r(n={},"".concat(p("color-picker-".concat(t.size))),t.size),r(n,"".concat(p("color-picker-show-dropdown")),u.value),r(n,"".concat(p("color-picker-show-value")),t.showValue),r(n,"".concat(p("color-picker-disabled")),t.disabled||t.readonly),n),"".concat(p("color-picker")," ").concat(t.extCls))})),g=(0,n.computed)((function(){return Boolean(!0===t.recommend||Array.isArray(t.recommend)&&t.recommend.length)}));(0,n.onBeforeMount)((function(){M({isCreated:!0})})),(0,n.watch)((function(){return t.modelValue}),(function(){var e;M(),t.withValidate&&(null===(e=null==i?void 0:i.validate)||void 0===e||e.call(i,"change"))}));var b=function(e){"Enter"===e.code||"NumpadEnter"===e.code?y():"Escape"===e.code&&_()},m=function(e){t.transfer&&b(e)},y=function(){t.disabled||t.readonly||(u.value?_():x())},k=function(e){g.value||(e.preventDefault(),d.value.$el.focus())},w=function(e){e.preventDefault(),d.value.$el.focus()},x=function(){var e;u.value=!0,null===(e=f.value)||void 0===e||e.updateDropdown(),setTimeout((function(){f.value.$el.querySelector(".".concat(p("color-picker-input-hex")," .").concat(p("color-picker-input-value"))).select()}),100)},_=function(){var e;u.value&&((0,n.nextTick)((function(){return h.value.focus()})),u.value=!1,null===(e=f.value)||void 0===e||e.destoryDropdown(),M())},M=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).isCreated,r=void 0!==e&&e;if(""!==t.modelValue){var n=J(t.modelValue),o=1===n.rgba.a?n.hex:ee(n.rgba);if(o!==l.value){var i=c(t.modelValue).isValid();r?i?(l.value=o.toLowerCase()===t.modelValue.toLowerCase()?t.modelValue:o,Object.assign(s,n)):(Object.assign(s,le),a("change","")):i?o.toLowerCase()!==l.value.toLowerCase()&&(Object.assign(s,n),l.value=o):(l.value="",Object.assign(s,le))}}else""!==l.value&&(l.value="",Object.assign(s,le),a("update:modelValue",l.value))},A=function(e){if(""===e)return l.value="",Object.assign(s,le),a("update:modelValue",""),void a("change","");var t=J(e),r=1===t.rgba.a?t.hex:ee(t.rgba);l.value=r,Object.assign(s,t),a("update:modelValue",l.value),a("change",r)},S=function(){u.value=!1};return function(){return(0,n.withDirectives)((0,n.createVNode)("div",{ref:h,tabindex:"0",class:v.value,onKeydown:b,onClick:y},[(0,n.createVNode)("div",{class:"".concat(p("color-picker-color"))},[(0,n.createVNode)("span",{class:"".concat(p("color-picker-color-square")," ").concat(!l.value&&"".concat(p("color-picker-empty"))),style:"background: ".concat(l.value||"#FFF")},null)]),t.showValue?(0,n.createVNode)("div",{class:"".concat(p("color-picker-text"))},[(0,n.createVNode)("span",null,[l.value])]):void 0,(0,n.createVNode)("div",{class:"".concat(p("color-picker-icon"))},[(0,n.createVNode)(z.AngleUp,{class:"icon-angle-down"},null)]),(0,n.createVNode)(n.Transition,{name:"bk-fade-down-transition"},{default:function(){return[(0,n.withDirectives)((0,n.createVNode)(W,{ref:f,triggerRef:h.value},{default:function(){return[(0,n.createVNode)("div",{class:"".concat(p("color-dropdown-container"))},[(0,n.createVNode)("div",{class:"".concat(p("color-picker-dropdown")),onClick:function(e){e.stopPropagation()},onMousedown:function(e){e.stopPropagation()},onKeydown:m},[(0,n.createVNode)(ie,{ref:d,colorObj:s,onChange:A},null),(0,n.createVNode)(re,{colorObj:s,onChange:A},null),(0,n.createVNode)(Y,{colorObj:s,onTab:k,onChange:A},null),g.value?(0,n.createVNode)("div",{class:"".concat(p("color-picker-recommend-container"))},[(0,n.createVNode)(oe,{colorObj:s,recommend:t.recommend,onTab:w,onChange:A},null)]):void 0])])]}}),[[n.vShow,u.value]])]}})]),[[(0,n.resolveDirective)("clickoutside"),S]])}}}),fe=(0,e.withInstall)(se)})(),l})()));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","vue-types","../config-provider","../directives","../icon"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("vue-types"),require("../config-provider"),require("../directives"),require("../icon")):t(e["../shared"],e.vue,e["vue-types"],e["../config-provider"],e["../directives"],e["../icon"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,((e,t,r,n,o,a)=>(()=>{"use strict";var i={2717:e=>{e.exports=n},4061:e=>{e.exports=o},6870:e=>{e.exports=a},4212:t=>{t.exports=e},748:e=>{e.exports=t},210:e=>{e.exports=r}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return i[e](r,r.exports,u),r.exports}u.d=(e,t)=>{for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{u.r(l),u.d(l,{default:()=>fe});var e=u(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var n=u(748);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a=/^\s+/,i=/\s+$/;function c(e,t){if(t=t||{},(e=e||"")instanceof c)return e;if(!(this instanceof c))return new c(e,t);var r=function(e){var t,r,n,c={r:0,g:0,b:0},u=1,l=null,s=null,f=null,d=!1,h=!1;return"string"==typeof e&&(e=function(e){e=e.replace(a,"").replace(i,"").toLowerCase();var t,r=!1;if(S[e])e=S[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=L.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=L.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=L.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=L.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=L.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=L.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=L.hex8.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),a:T(t[4]),format:r?"name":"hex8"}:(t=L.hex6.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:r?"name":"hex"}:(t=L.hex4.exec(e))?{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),a:T(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=L.hex3.exec(e))&&{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==o(e)&&(E(e.r)&&E(e.g)&&E(e.b)?(t=e.r,r=e.g,n=e.b,c={r:255*j(t,255),g:255*j(r,255),b:255*j(n,255)},d=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):E(e.h)&&E(e.s)&&E(e.v)?(l=R(e.s),s=R(e.v),c=function(e,t,r){e=6*j(e,360),t=j(t,100),r=j(r,100);var n=Math.floor(e),o=e-n,a=r*(1-t),i=r*(1-o*t),c=r*(1-(1-o)*t),u=n%6;return{r:255*[r,i,a,a,c,r][u],g:255*[c,r,r,i,a,a][u],b:255*[a,a,c,r,r,i][u]}}(e.h,l,s),d=!0,h="hsv"):E(e.h)&&E(e.s)&&E(e.l)&&(l=R(e.s),f=R(e.l),c=function(e,t,r){var n,o,a;function i(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=j(e,360),t=j(t,100),r=j(r,100),0===t)n=o=a=r;else{var c=r<.5?r*(1+t):r+t-r*t,u=2*r-c;n=i(u,c,e+1/3),o=i(u,c,e),a=i(u,c,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(e.h,l,f),d=!0,h="hsl"),e.hasOwnProperty("a")&&(u=e.a)),u=V(u),{ok:d,format:e.format||h,r:Math.min(255,Math.max(c.r,0)),g:Math.min(255,Math.max(c.g,0)),b:Math.min(255,Math.max(c.b,0)),a:u}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}function s(e,t,r){e=j(e,255),t=j(t,255),r=j(r,255);var n,o,a=Math.max(e,t,r),i=Math.min(e,t,r),c=(a+i)/2;if(a==i)n=o=0;else{var u=a-i;switch(o=c>.5?u/(2-a-i):u/(a+i),a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:o,l:c}}function f(e,t,r){e=j(e,255),t=j(t,255),r=j(r,255);var n,o,a=Math.max(e,t,r),i=Math.min(e,t,r),c=a,u=a-i;if(o=0===a?0:u/a,a==i)n=0;else{switch(a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:o,v:c}}function d(e,t,r,n){var o=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16))];return n&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function h(e,t,r,n){return[P(F(n)),P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16))].join("")}function p(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s-=t/100,r.s=C(r.s),c(r)}function v(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s+=t/100,r.s=C(r.s),c(r)}function g(e){return c(e).desaturate(100)}function b(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l+=t/100,r.l=C(r.l),c(r)}function m(e,t){t=0===t?0:t||10;var r=c(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-t/100*255))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-t/100*255))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-t/100*255))),c(r)}function y(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l-=t/100,r.l=C(r.l),c(r)}function w(e,t){var r=c(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,c(r)}function k(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function x(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=c(e).toHsl(),n=[c(e)],o=360/t,a=1;a<t;a++)n.push(c({h:(r.h+a*o)%360,s:r.s,l:r.l}));return n}function _(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+72)%360,s:t.s,l:t.l}),c({h:(r+216)%360,s:t.s,l:t.l})]}function M(e,t,r){t=t||6,r=r||30;var n=c(e).toHsl(),o=360/r,a=[c(e)];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(c(n));return a}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,o=r.s,a=r.v,i=[],u=1/t;t--;)i.push(c({h:n,s:o,v:a})),a=(a+u)%1;return i}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=V(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=f(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=s(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=s(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return d(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,o){var a=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16)),P(F(n))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*j(this._r,255))+"%",g:Math.round(100*j(this._g,255))+"%",b:Math.round(100*j(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*j(this._r,255))+"%, "+Math.round(100*j(this._g,255))+"%, "+Math.round(100*j(this._b,255))+"%)":"rgba("+Math.round(100*j(this._r,255))+"%, "+Math.round(100*j(this._g,255))+"%, "+Math.round(100*j(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(N[d(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+h(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var o=c(e);r="#"+h(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(M,arguments)},complement:function(){return this._applyCombination(k,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(x,[3])},tetrad:function(){return this._applyCombination(x,[4])}},c.fromRatio=function(e,t){if("object"==o(e)){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:R(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),o=c(t).toRgb(),a=r/100;return c({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},c.readability=function(e,t){var r=c(e),n=c(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,o,a,i,u,l=c.readability(e,t);switch(o=!1,(a=r,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(u=(a.size||"small").toLowerCase())&&"large"!==u&&(u="small"),n={level:i,size:u}).level+n.size){case"AAsmall":case"AAAlarge":o=l>=4.5;break;case"AAlarge":o=l>=3;break;case"AAAsmall":o=l>=7}return o},c.mostReadable=function(e,t,r){var n,o,a,i,u=null,l=0;o=(r=r||{}).includeFallbackColors,a=r.level,i=r.size;for(var s=0;s<t.length;s++)(n=c.readability(e,t[s]))>l&&(l=n,u=c(t[s]));return c.isReadable(e,u,{level:a,size:i})||!o?u:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var S=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function V(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function j(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function C(e){return Math.min(1,Math.max(0,e))}function O(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function F(e){return Math.round(255*parseFloat(e)).toString(16)}function T(e){return O(e)/255}var H,q,D,L=(q="[\\s|\\(]+("+(H="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",D="[\\s|\\(]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")[,|\\s]+("+H+")\\s*\\)?",{CSS_UNIT:new RegExp(H),rgb:new RegExp("rgb"+q),rgba:new RegExp("rgba"+D),hsl:new RegExp("hsl"+q),hsla:new RegExp("hsla"+D),hsv:new RegExp("hsv"+q),hsva:new RegExp("hsva"+D),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 E(e){return!!L.CSS_UNIT.exec(e)}var I=u(210),B=u(2717),U=u(4061),z=u(6870),K={placement:{type:String,default:"bottom-start",validator:function(e){return!(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].indexOf(e)<0&&(console.error("placement property is not valid: '".concat(e,"'")),1))}},className:{type:String},extPopoverCls:{type:String},appendToBody:{type:Boolean},triggerRef:{type:Object},onClick:Function};const W=(0,n.defineComponent)({props:K,emits:["changeVisible"],setup:function(t,r){var o=r.emit,a=Object.create(null),i=(0,n.ref)(null);(0,n.onMounted)((function(){u()})),(0,n.onBeforeUnmount)((function(){c()}));var c=function(){if(a&&0!==Object.keys(a).length){var e=a;e.isShow&&e.hide(),e.destroy(),a=null,o("changeVisible",!1)}},u=function(){a&&0!==Object.keys(a).length?(0,n.nextTick)((function(){a.update()})):(0,n.nextTick)((function(){a=new e.BKPopover(t.triggerRef,i.value,{placement:t.placement,trigger:"manual",modifiers:[{name:"computeStyles",options:{adaptive:!1,gpuAcceleration:!1}},{name:"offset",options:{offset:[0,4]}}]})}))},l=(0,n.computed)((function(){var r={};return t.appendToBody&&(r["z-index"]=1060+e.bkZIndexManager.getModalNextIndex()),r})),s=(0,n.reactive)({styles:l}),f=(0,B.usePrefix)().resolveClassName;return Object.assign(Object.assign({},(0,n.toRefs)(s)),{refContentRef:i,forceUpdate:function(){var e;a&&(null===(e=null==a?void 0:a.forceUpdate)||void 0===e||e.call(a))},updateDropdown:u,destoryDropdown:c,resolveClassName:f})},render:function(){var e,t,r;return(0,n.createVNode)("div",{ref:"refContentRef",class:[this.resolveClassName("date-picker-dropdown"),this.className,this.extPopoverCls],style:this.styles,onClick:this.onClick},[null!==(r=null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))&&void 0!==r?r:""])}});var X={info:e.PropTypes.object.isRequired};const $=(0,n.defineComponent)({props:X,emits:["tab","input"],setup:function(t,r){var o=r.emit,a=function(e){"a"===t.info.key&&o("tab",e)},i=function(e){var r=t.info.key,n=e.target.value;o("input",r,n)},c=(0,B.usePrefix)().resolveClassName,u=(0,n.computed)((function(){return(0,e.classes)({error:t.info.error},"".concat(c("color-picker-input-value")))}));return function(){return(0,n.createVNode)("div",{class:"".concat(c("color-picker-input-part"))},[(0,n.createVNode)("input",{type:"HEX"===t.info.name?"text":"number",class:u.value,value:t.info.value,onKeydown:a,onInput:i},null),(0,n.createVNode)("span",{class:"".concat(c("color-picker-input-text"))},[t.info.name])])}}});var G={colorObj:e.PropTypes.object.isRequired};const Y=(0,n.defineComponent)({name:"ColorPicker",props:G,emits:["change","tab"],setup:function(e,t){var r=t.emit,o=(0,n.reactive)({key:"hex",name:"HEX",value:e.colorObj.hex,error:!1}),a=(0,n.reactive)({key:"r",name:"R",value:e.colorObj.rgba.r.toString(),error:!1}),i=(0,n.reactive)({key:"g",name:"G",value:e.colorObj.rgba.g.toString(),error:!1}),u=(0,n.reactive)({key:"b",name:"B",value:e.colorObj.rgba.b.toString(),error:!1}),l=(0,n.reactive)({key:"a",name:"Alpha",value:e.colorObj.rgba.a.toString(),error:!1});(0,n.watch)((function(){return e.colorObj}),(function(e){c(e.hex).toString()!==c(o.value).toString()&&(o.value=e.hex),a.value=e.rgba.r.toString(),i.value=e.rgba.g.toString(),u.value=e.rgba.b.toString(),l.value=e.rgba.a.toString(),d()}),{deep:!0});var s=function(e){r("tab",e)},f=function(e,t){if({r:a,g:i,b:u,a:l,hex:o}[e].value=t,d()){var n="hex"===e?o.value:"rgba(".concat(a.value,", ").concat(i.value,", ").concat(u.value,", ").concat(l.value,")");r("change",n)}},d=function(){var e=!0;!o.value.startsWith("#")||4!==o.value.length&&7!==o.value.length||o.value.slice(1).match(/[^0-9a-fA-F]/)?(o.error=!0,e=!1):o.error=!1,""!==l.value&&l.value>=0&&l.value<=1?l.error=!1:(l.error=!0,e=!1);for(var t=0,r=[a,i,u];t<r.length;t++){var n=r[t],c=n.value;""!==c&&c>=0&&c<=255?n.error=!1:(n.error=!0,e=!1)}return e},h=(0,B.usePrefix)().resolveClassName;return function(){return(0,n.createVNode)("div",{class:"".concat(h("color-picker-input"))},[(0,n.createVNode)("div",{class:"".concat(h("color-picker-input-hex"))},[(0,n.createVNode)($,{info:o,onInput:f},null)]),(0,n.createVNode)("div",{class:"".concat(h("color-picker-input-rgba"))},[(0,n.createVNode)($,{info:a,onInput:f},null),(0,n.createVNode)($,{info:i,onInput:f},null),(0,n.createVNode)($,{info:u,onInput:f},null),(0,n.createVNode)($,{info:l,onInput:f,onTab:s},null)])])}}});var J=function(e){var t=e;""===e&&(t="#FFFFFF");var r=c(e),n=r.toHsl(),o=r.toHsv();return 0===n.s&&(n.h=t.h||0,o.h=t.h||0),o.v<.0164&&(o.h=t.h||0,o.s=t.s||0),n.l<.01&&(n.h=t.h||0,n.s=t.s||0),{hsl:n,hsv:o,hex:r.toHexString().toUpperCase(),rgba:r.toRgb()}},Z=function(e,t,r){return e<t?t:e>r?r:e},Q=function(e,t){return e.touches?e.touches[0][t]:0},ee=function(e){var t=e.r,r=e.g,n=e.b,o=e.a;return"rgba(".concat([t,r,n,o].join(","),")")},te={colorObj:e.PropTypes.object.isRequired};const re=(0,n.defineComponent)({name:"ColorPicker",props:te,emits:["change"],setup:function(e,t){var r=t.emit,o=(0,n.ref)(null),a=(0,n.computed)((function(){return{left:"".concat(e.colorObj.hsv.h/360*100,"%")}})),i=function(t){var r=o.value.clientWidth,n=e.colorObj.hsv.h/360*r;switch(t.code){case"ArrowLeft":t.preventDefault(),n=Z(n-2,0,r);break;case"ArrowRight":t.preventDefault(),n=Z(n+2,0,r);break;case"ArrowUp":t.preventDefault(),n=Z(n-10,0,r);break;case"ArrowDown":t.preventDefault(),n=Z(n+10,0,r);break;default:return}u(null,n)},c=function e(){window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",e)},u=function(e,t){var r=o.value.clientWidth,n=void 0!==t?t:l(e);s(n/r)},l=function(e){var t=o.value.getBoundingClientRect().left+window.pageXOffset,r=e.pageX||Q(e,"PageX");return Z(r-t,0,o.value.clientWidth)},s=function(t){var n=e.colorObj.hsl,o=n.h,a=n.s,i=n.l,c=n.a,u=360*t;o!==u&&r("change",{h:u,s:a,l:i,a:c})},f=(0,B.usePrefix)().resolveClassName;return function(){return(0,n.createVNode)("div",{ref:o,tabindex:"0",class:"".concat(f("color-picker-hue")),onKeydown:i,onMousedown:function(e){e.stopPropagation(),e.preventDefault(),function(e){o.value.focus(),u(e),window.addEventListener("mousemove",u,{passive:!0}),window.addEventListener("mouseup",c)}(e)}},[(0,n.createVNode)("div",{class:"".concat(f("color-picker-hue-pointer")),style:a.value},[(0,n.createVNode)("div",{class:"".concat(f("color-picker-hue-rectangle"))},null)])])}}});var ne={colorObj:e.PropTypes.object.isRequired,recommend:e.PropTypes.oneOfType([e.PropTypes.array.def((function(){return[]})),e.PropTypes.bool.def(!0)]).isRequired};const oe=(0,n.defineComponent)({props:ne,emits:["change","tab"],setup:function(t,o){var a=o.emit,i=(0,n.ref)(!1),u=(0,n.ref)(-1),l=(0,n.ref)(null);(0,n.watch)((function(){return t.colorObj}),(function(){u.value=-1,l.value=null}),{deep:!0});var s=(0,n.computed)((function(){return v(t.recommend)})),f=(0,B.usePrefix)().resolveClassName,d=function(t,n){var o;return(0,e.classes)((r(o={},"".concat(f("color-picker-empty")),""===t),r(o,"".concat(f("color-picker-recommend-selected-color")),i.value&&u.value===n),o),"".concat(f("color-picker-recommend-color")))},h=function(e){if("Tab"===e.code)a("tab",e);else{var t=0,r=s.value.length-1;switch(e.code){case"ArrowLeft":e.preventDefault(),t=Z(u.value-1,0,r);break;case"ArrowRight":e.preventDefault(),t=Z(u.value+1,0,r);break;case"ArrowUp":e.preventDefault(),t=Z(u.value-10,0,r);break;case"ArrowDown":e.preventDefault(),t=Z(u.value+10,0,r);break;default:return}p(t)}},p=function(e){var t=s.value[e];a("change",t),(0,n.nextTick)((function(){u.value=e,l.value=t}))},v=function(e){return!0===e?["","#ff4500","#ff8c00","#ffd700","#90ee90","#ddffff","#00ced1","#3a84ff","#a933f5","#db7093","#000000","#494949","#9B9B9B","#ffffff"]:Array.isArray(e)?e.map((function(e){return c(e).isValid()?e:""})):void 0};return function(){return(0,n.createVNode)("div",{tabindex:"0",class:"".concat(f("color-picker-recommend")," "),onFocus:function(){return i.value=!0},onBlur:function(){return i.value=!1},onKeydown:h},[s.value.map((function(e,t){return(0,n.createVNode)("div",{style:"background: ".concat(e||"#fff"),class:d(e,t),onClick:function(){return p(t)}},[u.value===t?(0,n.createVNode)("div",{class:"".concat(f("color-picker-pointer"))},[(0,n.createVNode)("div",{class:"".concat(f("color-picker-circle"))},null)]):void 0])}))])}}});var ae={colorObj:e.PropTypes.object.isRequired};const ie=(0,n.defineComponent)({props:ae,emits:["change"],setup:function(e,t){var r=t.emit,o=(0,n.ref)(null),a=(0,n.computed)((function(){return{background:"hsl(".concat(e.colorObj.hsv.h,", 100%, 50%)")}})),i=(0,n.computed)((function(){return{top:"".concat(100*(1-e.colorObj.hsv.v),"%"),left:"".concat(100*e.colorObj.hsv.s,"%")}})),c=function e(){window.removeEventListener("mousemove",l),window.removeEventListener("mouseup",e)},u=function(t){var r=o.value,n=r.clientWidth,a=r.clientHeight,i=e.colorObj.hsv.s*n,c=(1-e.colorObj.hsv.v)*a;switch(t.code){case"ArrowLeft":t.preventDefault(),i=Z(i-10,0,n);break;case"ArrowRight":t.preventDefault(),i=Z(i+10,0,n);break;case"ArrowUp":t.preventDefault(),c=Z(c-10,0,a);break;case"ArrowDown":t.preventDefault(),c=Z(c+10,0,a);break;default:return}l(null,i,c)},l=function(t,r,n){var a=o.value,i=a.clientWidth,c=a.clientHeight,u=(void 0!==r?r:s(t))/i,l=1-(void 0!==n?n:f(t))/c;d(e.colorObj.hsv.h,u,l,e.colorObj.hsv.a)},s=function(e){var t=o.value.getBoundingClientRect().left+window.pageXOffset,r=e.pageX||Q(e,"PageX");return Z(r-t,0,o.value.clientWidth)},f=function(e){var t=o.value.getBoundingClientRect().top+window.pageYOffset,r=e.pageY||Q(e,"PageY");return Z(r-t,0,o.value.clientHeight)},d=function(e,t,n,o){r("change",{h:e,s:t,v:n,a:o})},h=(0,B.usePrefix)().resolveClassName;return function(){return(0,n.createVNode)("div",{ref:o,tabindex:"0",class:"".concat(h("color-picker-saturation")),style:a.value,onKeydown:u,onMousedown:function(e){e.stopPropagation(),function(e){o.value.focus(),l(e),window.addEventListener("mousemove",l,{passive:!0}),window.addEventListener("mouseup",c)}(e)}},[(0,n.createVNode)("div",{class:"".concat(h("color-picker-saturation-white"))},null),(0,n.createVNode)("div",{class:"".concat(h("color-picker-saturation-black"))},null),(0,n.createVNode)("div",{class:"".concat(h("color-picker-pointer")),style:i.value},[(0,n.createVNode)("div",{class:"".concat(h("color-picker-circle"))},null)])])}}});var ce;!function(e){e.UNKNOWN="",e.SMALL="small",e.LARGE="large"}(ce||(ce={}));var ue={modelValue:e.PropTypes.string.def(""),disabled:e.PropTypes.bool.def(!1),readonly:e.PropTypes.bool.def(!1),transfer:e.PropTypes.bool.def(!1),size:(0,I.toType)("colorPickSize",{}).def(ce.UNKNOWN),showValue:e.PropTypes.bool.def(!0),recommend:e.PropTypes.oneOfType([e.PropTypes.array.def((function(){return[]})),e.PropTypes.bool.def(!0)]).def(!0),extCls:e.PropTypes.string.def(""),withValidate:e.PropTypes.bool.def(!0)},le=J("#FFFFFF");const se=(0,n.defineComponent)({name:"ColorPicker",directives:{clickoutside:U.clickoutside},props:ue,emits:["update:modelValue","change"],setup:function(t,o){var a=o.emit,i=o.slots,u=(0,e.useFormItem)(),l=(0,n.ref)(!1),s=(0,n.ref)(""),f=(0,n.reactive)(JSON.parse(JSON.stringify(le))),d=(0,n.ref)(null),h=(0,n.ref)(null),p=(0,n.ref)(null),v=(0,B.usePrefix)().resolveClassName,g=(0,n.computed)((function(){var n;return(0,e.classes)((r(n={},"".concat(v("color-picker-".concat(t.size))),t.size),r(n,"".concat(v("color-picker-show-dropdown")),l.value),r(n,"".concat(v("color-picker-show-value")),t.showValue),r(n,"".concat(v("color-picker-disabled")),t.disabled||t.readonly),n),"".concat(v("color-picker")," ").concat(t.extCls))})),b=(0,n.computed)((function(){return Boolean(!0===t.recommend||Array.isArray(t.recommend)&&t.recommend.length)}));(0,n.onBeforeMount)((function(){A({isCreated:!0})})),(0,n.watch)((function(){return t.modelValue}),(function(){var e;A(),t.withValidate&&(null===(e=null==u?void 0:u.validate)||void 0===e||e.call(u,"change"))}));var m=function(e){"Enter"===e.code||"NumpadEnter"===e.code?w():"Escape"===e.code&&M()},y=function(e){t.transfer&&m(e)},w=function(){t.disabled||t.readonly||(l.value?M():_())},k=function(e){b.value||(e.preventDefault(),h.value.$el.focus())},x=function(e){e.preventDefault(),h.value.$el.focus()},_=function(){var e;l.value=!0,null===(e=d.value)||void 0===e||e.updateDropdown(),setTimeout((function(){d.value.$el.querySelector(".".concat(v("color-picker-input-hex")," .").concat(v("color-picker-input-value"))).select()}),100)},M=function(){var e;l.value&&((0,n.nextTick)((function(){return p.value.focus()})),l.value=!1,null===(e=d.value)||void 0===e||e.destoryDropdown(),A())},A=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).isCreated,r=void 0!==e&&e;if(""!==t.modelValue){var n=J(t.modelValue),o=1===n.rgba.a?n.hex:ee(n.rgba);if(o!==s.value){var i=c(t.modelValue).isValid();r?i?(s.value=o.toLowerCase()===t.modelValue.toLowerCase()?t.modelValue:o,Object.assign(f,n)):(Object.assign(f,le),a("change","")):i?o.toLowerCase()!==s.value.toLowerCase()&&(Object.assign(f,n),s.value=o):(s.value="",Object.assign(f,le))}}else""!==s.value&&(s.value="",Object.assign(f,le),a("update:modelValue",s.value))},S=function(e){if(""===e)return s.value="",Object.assign(f,le),a("update:modelValue",""),void a("change","");var t=J(e),r=1===t.rgba.a?t.hex:ee(t.rgba);s.value=r,Object.assign(f,t),a("update:modelValue",s.value),a("change",r)},N=function(){l.value=!1};return function(){return(0,n.withDirectives)((0,n.createVNode)("div",{ref:p,tabindex:"0",class:g.value,onKeydown:m,onClick:w},["function"==typeof i.trigger?i.trigger({value:s.value,isShowDropdown:l.value}):(0,n.createVNode)(n.Fragment,null,[(0,n.createVNode)("div",{class:"".concat(v("color-picker-color"))},[(0,n.createVNode)("span",{class:"".concat(v("color-picker-color-square")," ").concat(!s.value&&"".concat(v("color-picker-empty"))),style:"background: ".concat(s.value||"#FFF")},null)]),t.showValue?(0,n.createVNode)("div",{class:"".concat(v("color-picker-text"))},[(0,n.createVNode)("span",null,[s.value])]):void 0,(0,n.createVNode)("div",{class:"".concat(v("color-picker-icon"))},[(0,n.createVNode)(z.AngleUp,{class:"icon-angle-down"},null)])]),(0,n.createVNode)(n.Transition,{name:"bk-fade-down-transition"},{default:function(){return[(0,n.withDirectives)((0,n.createVNode)(W,{ref:d,triggerRef:p.value},{default:function(){return[(0,n.createVNode)("div",{class:"".concat(v("color-dropdown-container"))},[(0,n.createVNode)("div",{class:"".concat(v("color-picker-dropdown")),onClick:function(e){e.stopPropagation()},onMousedown:function(e){e.stopPropagation()},onKeydown:y},[(0,n.createVNode)(ie,{ref:h,colorObj:f,onChange:S},null),(0,n.createVNode)(re,{colorObj:f,onChange:S},null),(0,n.createVNode)(Y,{colorObj:f,onTab:k,onChange:S},null),b.value?(0,n.createVNode)("div",{class:"".concat(v("color-picker-recommend-container"))},[(0,n.createVNode)(oe,{colorObj:f,recommend:t.recommend,onTab:x,onChange:S},null)]):void 0])])]}}),[[n.vShow,l.value]])]}})]),[[(0,n.resolveDirective)("clickoutside"),N]])}}}),fe=(0,e.withInstall)(se)})(),l})()));
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../button"),require("../icon"),require("../modal"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../button","../icon","../modal"],t);else{var o="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../button"),require("../icon"),require("../modal")):t(e["../shared"],e.vue,e["../config-provider"],e["../button"],e["../icon"],e["../modal"]);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,((e,t,o,n,r,i)=>(()=>{var a={4976:e=>{"use strict";e.exports=n},2717:e=>{"use strict";e.exports=o},6870:e=>{"use strict";e.exports=r},8014:e=>{"use strict";e.exports=i},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t},7609:(e,t,o)=>{var n=o(7425).default;function r(){"use strict";e.exports=r=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,o){e[t]=o.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function f(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,o){return e[t]=o}}function d(e,t,o,n){var r=t&&t.prototype instanceof h?t:h,i=Object.create(r.prototype),l=new j(n||[]);return a(i,"_invoke",{value:C(e,o,l)}),i}function p(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var v={};function h(){}function m(){}function y(){}var g={};f(g,c,(function(){return this}));var x=Object.getPrototypeOf,b=x&&x(x(P([])));b&&b!==o&&i.call(b,c)&&(g=b);var w=y.prototype=h.prototype=Object.create(g);function T(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function o(r,a,l,c){var u=p(e[r],e,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,l,c)}),(function(e){o("throw",e,l,c)})):t.resolve(f).then((function(e){s.value=e,l(s)}),(function(e){return o("throw",e,l,c)}))}c(u.arg)}var r;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,r){o(e,n,t,r)}))}return r=r?r.then(i,i):i()}})}function C(e,t,o){var n="suspendedStart";return function(r,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw i;return{value:void 0,done:!0}}for(o.method=r,o.arg=i;;){var a=o.delegate;if(a){var l=S(a,o);if(l){if(l===v)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===n)throw n="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n="executing";var c=p(e,t,o);if("normal"===c.type){if(n=o.done?"completed":"suspendedYield",c.arg===v)continue;return{value:c.arg,done:o.done}}"throw"===c.type&&(n="completed",o.method="throw",o.arg=c.arg)}}}function S(e,t){var o=t.method,n=e.iterator[o];if(void 0===n)return t.delegate=null,"throw"===o&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==o&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+o+"' method")),v;var r=p(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,v;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function P(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,n=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:k}}function k(){return{value:void 0,done:!0}}return m.prototype=y,a(w,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:m,configurable:!0}),m.displayName=f(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,f(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},T(N.prototype),f(N.prototype,u,(function(){return this})),t.AsyncIterator=N,t.async=function(e,o,n,r,i){void 0===i&&(i=Promise);var a=new N(d(e,o,n,r),i);return t.isGeneratorFunction(o)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(w),f(w,s,"Generator"),f(w,c,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),o=[];for(var n in t)o.push(n);return o.reverse(),function e(){for(;o.length;){var n=o.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=P,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(o,n){return a.type="throw",a.arg=e,t.next=o,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n],a=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var l=i.call(r,"catchLoc"),c=i.call(r,"finallyLoc");if(l&&c){if(this.prev<r.catchLoc)return o(r.catchLoc,!0);if(this.prev<r.finallyLoc)return o(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return o(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return o(r.finallyLoc)}}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),E(o),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var n=o.completion;if("throw"===n.type){var r=n.arg;E(o)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:P(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),v}},t}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(o){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,o)=>{var n=o(7609)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var o=l[e]={exports:{}};return a[e](o,o.exports,c),o.exports}c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{"use strict";c.r(u),c.d(u,{default:()=>m});var e=c(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var o=c(2841),n=c.n(o);function r(e,t,o,n){return new(o||(o=Promise))((function(r,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function l(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,l)}c((n=n.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var i=c(748),a=c(2717),l=c(4976),s=c.n(l),f=c(6870),d=c(8014),p=c.n(d);const v=Object.assign(Object.assign({},d.propsMixin),{width:e.PropTypes.oneOfType([String,Number]).def(""),height:e.PropTypes.oneOfType([String,Number]).def(""),confirmText:e.PropTypes.string,cancelText:e.PropTypes.string,prevText:e.PropTypes.string,nextText:e.PropTypes.string,current:e.PropTypes.number.def(1),totalStep:e.PropTypes.number,title:e.PropTypes.string.def("title"),headerAlign:(0,e.alignType)().def(e.AlignEnum.LEFT),footerAlign:(0,e.alignType)().def(e.AlignEnum.RIGHT),theme:e.PropTypes.theme().def(e.ThemeEnum.PRIMARY),dialogType:(0,e.dialogTypeUnion)(),isLoading:e.PropTypes.bool.def(!1)}),h=(0,i.defineComponent)({name:"Dialog",components:{BkModal:p(),BkButton:s()},props:v,emits:["closed","update:isShow","confirm","prev","next","value-change"],setup:function(e,t){var o=this,l=t.emit,c=(0,a.useLocale)("dialog"),u=(0,i.computed)((function(){return void 0===e.confirmText?c.value.ok:e.confirmText})),s=(0,i.computed)((function(){return void 0===e.cancelText?c.value.cancel:e.cancelText})),f=(0,i.computed)((function(){return void 0===e.prevText?c.value.prev:e.prevText})),d=(0,i.computed)((function(){return void 0===e.nextText?c.value.next:e.nextText})),p=(0,i.reactive)({positionX:0,positionY:0,moveStyle:{top:"",left:""}}),v=(0,i.ref)(e.isShow);(0,i.onMounted)((function(){e.escClose&&addEventListener("keydown",y)})),(0,i.onBeforeUnmount)((function(){e.escClose&&removeEventListener("keydown",y)})),(0,i.watch)((function(){return e.isShow}),(function(e){e?v.value=!0:setTimeout((function(){p.moveStyle={top:"50%",left:"50%"},p.positionX=0,p.positionY=0,v.value=!1}),250),l("value-change",e)}));var h=function(){return r(o,void 0,void 0,n().mark((function t(){var o;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=!0,"function"!=typeof e.beforeClose){t.next=5;break}return t.next=4,e.beforeClose();case 4:o=t.sent;case 5:o&&(l("update:isShow",!1),l("closed"),v.value=!1);case 6:case"end":return t.stop()}}),t)})))},m=(0,i.computed)((function(){return["process","operation","confirm"].includes(e.dialogType)})),y=function(t){e.isShow&&e.closeIcon&&27===t.keyCode&&h()},g=(0,a.usePrefix)().resolveClassName;return{data:p,handleClose:h,handleConfirm:function(){l("update:isShow",!1),l("confirm")},escCloseHandler:y,moveHandler:function(t){if(e.fullscreen)return!1;if(!e.draggable)return!1;var o,n,r=t.target,i=t.currentTarget.parentNode.parentNode.offsetHeight,a=t.currentTarget.parentNode.parentNode.offsetWidth;0!==p.positionX&&0!==p.positionY?(o=t.clientX-p.positionX,n=t.clientY-p.positionY):(o=t.clientX-r.offsetLeft,n=t.clientY-r.offsetTop),document.onmousemove=function(e){var t=window.innerWidth-a,r=window.innerHeight-i,l=e.clientX-o,c=e.clientY-n;t/2-l<=0?l=t/2:t/2+l<=0&&(l=-t/2),r/2-c<=0?c=r/2:r/2+c<=0&&(c=-r/2),p.positionX=l,p.positionY=c,p.moveStyle.left="calc(50% + ".concat(l,"px)"),p.moveStyle.top="calc(50% + ".concat(c,"px)")},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}},handlePrevStep:function(){l("prev")},handleNextStep:function(){l("next")},hasFooter:m,isModalShow:v,localConfirmText:u,localCancelText:s,localPrevText:f,localNextText:d,resolveClassName:g}},render:function(){var e,t=this,o={header:function(){var e,o,n,r,a,l;return[(0,i.createVNode)("div",{class:[t.resolveClassName("dialog-tool"),t.fullscreen||!t.draggable?"":"move",t.draggable?"content-dragging":""],onMousedown:t.moveHandler},[null!==(n=null===(o=(e=t.$slots).tools)||void 0===o?void 0:o.call(e))&&void 0!==n?n:""]),(0,i.createVNode)("div",{class:t.resolveClassName("dialog-header")},[(0,i.createVNode)("div",{class:t.resolveClassName("header-icon")},[t.infoType?{loading:(0,i.createVNode)(f.Spinner,{class:[t.resolveClassName("info-icon"),"primary"]},null),warning:(0,i.createVNode)(f.Warn,{class:[t.resolveClassName("info-icon"),"warning"]},null),success:(0,i.createVNode)(f.Success,{class:[t.resolveClassName("info-icon"),"success"]},null),danger:(0,i.createVNode)(f.Close,{class:[t.resolveClassName("info-icon"),"danger"]},null)}[t.infoType]:(0,i.createVNode)("slot",{name:"info-icon"},null)]),(0,i.createVNode)("span",{class:t.resolveClassName("dialog-title"),style:"text-align: ".concat(t.headerAlign)},[null!==(l=null===(a=(r=t.$slots).header)||void 0===a?void 0:a.call(r))&&void 0!==l?l:t.title])])]},default:function(){var e,o,n;return null!==(n=null===(o=(e=t.$slots).default)||void 0===o?void 0:o.call(e))&&void 0!==n?n:"default"},footer:function(){var e,o,n,r,a,l,c,u,f;return(0,i.createVNode)("div",{class:t.resolveClassName("dialog-footer"),style:"text-align: ".concat(t.footerAlign)},["process"===t.dialogType?null!==(n=null===(o=(e=t.$slots).footer)||void 0===o?void 0:o.call(e))&&void 0!==n?n:(0,i.createVNode)(i.Fragment,null,[1===t.current?"":(0,i.createVNode)(s(),{class:t.resolveClassName("dialog-perv"),onClick:t.handlePrevStep},{default:function(){return[t.localPrevText]}}),t.current===t.totalStep?"":(0,i.createVNode)(s(),{class:t.resolveClassName("dialog-next"),onClick:t.handleNextStep},{default:function(){return[t.localNextText]}}),t.current===t.totalStep?(0,i.createVNode)(s(),{onClick:t.handleConfirm,theme:t.theme,loading:t.isLoading},{default:function(){return[t.localConfirmText]}}):"",(0,i.createVNode)(s(),{class:t.resolveClassName("dialog-cancel"),onClick:t.handleClose,disabled:t.isLoading},{default:function(){return[t.localCancelText]}})]):"","operation"===t.dialogType?null!==(l=null===(a=(r=t.$slots).footer)||void 0===a?void 0:a.call(r))&&void 0!==l?l:(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(s(),{onClick:t.handleConfirm,theme:t.theme,loading:t.isLoading},{default:function(){return[t.localConfirmText]}}),(0,i.createVNode)(s(),{class:t.resolveClassName("dialog-cancel"),onClick:t.handleClose,disabled:t.isLoading},{default:function(){return[t.localCancelText]}})]):"","confirm"===t.dialogType?null!==(f=null===(u=(c=t.$slots).footer)||void 0===u?void 0:u.call(c))&&void 0!==f?f:(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(s(),{onClick:t.handleConfirm,theme:t.theme,loading:t.isLoading},{default:function(){return[t.localConfirmText]}})]):""])},close:function(){return(0,i.createVNode)(f.Error,{onClick:t.handleClose},null)}},n="".concat(this.resolveClassName("dialog-wrapper ")," ").concat(this.scrollable?"scroll-able":""," ").concat(this.multiInstance?"multi-instance":""," ").concat(this.hasFooter?"has-footer":"no-footer");return(0,i.createVNode)(p(),(0,i.mergeProps)(this.$props,{class:n,onClose:this.handleClose,isShow:this.isModalShow,style:this.data.moveStyle}),"function"==typeof(e=o)||"[object Object]"===Object.prototype.toString.call(e)&&!(0,i.isVNode)(e)?o:{default:function(){return[o]}})}}),m=(0,e.withInstall)((function(e){var o=document.createElement("div"),l=(0,i.ref)(!1),c=(0,i.shallowRef)(e),u=(0,i.defineComponent)({name:"DialogConfirm",setup:function(e,o){var u=this,s=o.expose;(0,i.onMounted)((function(){(document.activeElement||document.body).blur(),!1!==c.value.isShow&&(l.value=!0)}));var f=function(){return r(u,void 0,void 0,n().mark((function e(){var t,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(null===(t=c.value)||void 0===t?void 0:t.onClosed)){e.next=3;break}return e.next=3,null===(o=c.value)||void 0===o?void 0:o.onClosed();case 3:l.value=!1;case 4:case"end":return e.stop()}}),e)})))},d=function(){return r(u,void 0,void 0,n().mark((function e(){var t,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(null===(t=c.value)||void 0===t?void 0:t.onConfirm)){e.next=3;break}return e.next=3,null===(o=c.value)||void 0===o?void 0:o.onConfirm();case 3:l.value=!1;case 4:case"end":return e.stop()}}),e)})))};s({update:function(e){c.value=e}});var p=(0,a.usePrefix)().resolveClassName;return function(){return(0,i.createVNode)(h,Object.assign(Object.assign({class:p("info-wrapper"),headerAlign:"center",footerAlign:"center"},c.value),{isShow:l.value,onClosed:f,onConfirm:d}),function(){var e=[],o=[];if(c.value.subTitle)switch(t(c.value.subTitle)){case"string":default:e.push(c.value.subTitle);break;case"function":e.push(c.value.subTitle())}return e.length&&o.push((0,i.h)("div",{class:p("info-sub-title"),style:"text-Align:".concat(c.value.contentAlign||"center")},e)),o}())}}}),s=(0,i.createApp)(u).mount(o);return{show:function(){l.value=!0},hide:function(){l.value=!1},update:function(e){s.update(e)},destroy:function(){s.unmount(),s=null}}}))})(),u})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../button"),require("../icon"),require("../modal"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../button","../icon","../modal"],t);else{var o="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../button"),require("../icon"),require("../modal")):t(e["../shared"],e.vue,e["../config-provider"],e["../button"],e["../icon"],e["../modal"]);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(self,((e,t,o,n,r,i)=>(()=>{var a={4976:e=>{"use strict";e.exports=n},2717:e=>{"use strict";e.exports=o},6870:e=>{"use strict";e.exports=r},8014:e=>{"use strict";e.exports=i},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t},7609:(e,t,o)=>{var n=o(7425).default;function r(){"use strict";e.exports=r=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(e,t,o){e[t]=o.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function f(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,o){return e[t]=o}}function d(e,t,o,n){var r=t&&t.prototype instanceof h?t:h,i=Object.create(r.prototype),l=new E(n||[]);return a(i,"_invoke",{value:C(e,o,l)}),i}function p(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var v={};function h(){}function m(){}function y(){}var g={};f(g,c,(function(){return this}));var x=Object.getPrototypeOf,b=x&&x(x(O([])));b&&b!==o&&i.call(b,c)&&(g=b);var w=y.prototype=h.prototype=Object.create(g);function T(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function o(r,a,l,c){var u=p(e[r],e,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,l,c)}),(function(e){o("throw",e,l,c)})):t.resolve(f).then((function(e){s.value=e,l(s)}),(function(e){return o("throw",e,l,c)}))}c(u.arg)}var r;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,r){o(e,n,t,r)}))}return r=r?r.then(i,i):i()}})}function C(e,t,o){var n="suspendedStart";return function(r,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw i;return{value:void 0,done:!0}}for(o.method=r,o.arg=i;;){var a=o.delegate;if(a){var l=S(a,o);if(l){if(l===v)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===n)throw n="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n="executing";var c=p(e,t,o);if("normal"===c.type){if(n=o.done?"completed":"suspendedYield",c.arg===v)continue;return{value:c.arg,done:o.done}}"throw"===c.type&&(n="completed",o.method="throw",o.arg=c.arg)}}}function S(e,t){var o=t.method,n=e.iterator[o];if(void 0===n)return t.delegate=null,"throw"===o&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==o&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+o+"' method")),v;var r=p(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,v;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,v):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function O(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,n=function t(){for(;++o<e.length;)if(i.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:P}}function P(){return{value:void 0,done:!0}}return m.prototype=y,a(w,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:m,configurable:!0}),m.displayName=f(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,f(e,s,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},T(N.prototype),f(N.prototype,u,(function(){return this})),t.AsyncIterator=N,t.async=function(e,o,n,r,i){void 0===i&&(i=Promise);var a=new N(d(e,o,n,r),i);return t.isGeneratorFunction(o)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},T(w),f(w,s,"Generator"),f(w,c,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),o=[];for(var n in t)o.push(n);return o.reverse(),function e(){for(;o.length;){var n=o.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(o,n){return a.type="throw",a.arg=e,t.next=o,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n],a=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var l=i.call(r,"catchLoc"),c=i.call(r,"finallyLoc");if(l&&c){if(this.prev<r.catchLoc)return o(r.catchLoc,!0);if(this.prev<r.finallyLoc)return o(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return o(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return o(r.finallyLoc)}}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),j(o),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var n=o.completion;if("throw"===n.type){var r=n.arg;j(o)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:O(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),v}},t}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(o){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,o)=>{var n=o(7609)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var o=l[e]={exports:{}};return a[e](o,o.exports,c),o.exports}c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{"use strict";c.r(u),c.d(u,{default:()=>m});var e=c(4212);function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var o=c(2841),n=c.n(o);function r(e,t,o,n){return new(o||(o=Promise))((function(r,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function l(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,l)}c((n=n.apply(e,t||[])).next())}))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var i=c(748),a=c(2717),l=c(4976),s=c.n(l),f=c(6870),d=c(8014),p=c.n(d);const v=Object.assign(Object.assign({},d.propsMixin),{width:e.PropTypes.oneOfType([String,Number]).def(""),height:e.PropTypes.oneOfType([String,Number]).def(""),confirmText:e.PropTypes.string,cancelText:e.PropTypes.string,prevText:e.PropTypes.string,nextText:e.PropTypes.string,current:e.PropTypes.number.def(1),totalStep:e.PropTypes.number,title:e.PropTypes.string.def("title"),headerAlign:(0,e.alignType)().def(e.AlignEnum.LEFT),footerAlign:(0,e.alignType)().def(e.AlignEnum.RIGHT),theme:e.PropTypes.theme().def(e.ThemeEnum.PRIMARY),dialogType:(0,e.dialogTypeUnion)(),isLoading:e.PropTypes.bool.def(!1)}),h=(0,i.defineComponent)({name:"Dialog",components:{BkModal:p(),BkButton:s()},props:v,emits:["closed","update:isShow","confirm","prev","next","value-change"],setup:function(e,t){var o=this,l=t.emit,c=(0,a.useLocale)("dialog"),u=(0,i.computed)((function(){return void 0===e.confirmText?c.value.ok:e.confirmText})),s=(0,i.computed)((function(){return void 0===e.cancelText?c.value.cancel:e.cancelText})),f=(0,i.computed)((function(){return void 0===e.prevText?c.value.prev:e.prevText})),d=(0,i.computed)((function(){return void 0===e.nextText?c.value.next:e.nextText})),p=(0,i.reactive)({positionX:0,positionY:0,moveStyle:{top:"",left:""}}),v=(0,i.ref)(e.isShow);(0,i.onMounted)((function(){e.escClose&&addEventListener("keydown",y)})),(0,i.onBeforeUnmount)((function(){e.escClose&&removeEventListener("keydown",y)})),(0,i.watch)((function(){return e.isShow}),(function(e){e?v.value=!0:setTimeout((function(){p.moveStyle={top:"50%",left:"50%"},p.positionX=0,p.positionY=0,v.value=!1}),250),l("value-change",e)}));var h=function(){return r(o,void 0,void 0,n().mark((function t(){var o;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=!0,"function"!=typeof e.beforeClose){t.next=5;break}return t.next=4,e.beforeClose();case 4:o=t.sent;case 5:o&&(l("update:isShow",!1),l("closed"),v.value=!1);case 6:case"end":return t.stop()}}),t)})))},m=(0,i.computed)((function(){return["process","operation","confirm"].includes(e.dialogType)})),y=function(t){e.isShow&&e.closeIcon&&27===t.keyCode&&h()},g=(0,a.usePrefix)().resolveClassName;return{data:p,handleClose:h,handleConfirm:function(){l("update:isShow",!1),l("confirm")},escCloseHandler:y,moveHandler:function(t){if(e.fullscreen)return!1;if(!e.draggable)return!1;var o,n,r=t.target,i=t.currentTarget.parentNode.parentNode.offsetHeight,a=t.currentTarget.parentNode.parentNode.offsetWidth;0!==p.positionX&&0!==p.positionY?(o=t.clientX-p.positionX,n=t.clientY-p.positionY):(o=t.clientX-r.offsetLeft,n=t.clientY-r.offsetTop),document.onmousemove=function(e){var t=window.innerWidth-a,r=window.innerHeight-i,l=e.clientX-o,c=e.clientY-n;t/2-l<=0?l=t/2:t/2+l<=0&&(l=-t/2),r/2-c<=0?c=r/2:r/2+c<=0&&(c=-r/2),p.positionX=l,p.positionY=c,p.moveStyle.left="calc(50% + ".concat(l,"px)"),p.moveStyle.top="calc(50% + ".concat(c,"px)")},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}},handlePrevStep:function(){l("prev")},handleNextStep:function(){l("next")},hasFooter:m,isModalShow:v,localConfirmText:u,localCancelText:s,localPrevText:f,localNextText:d,resolveClassName:g}},render:function(){var e,t=this,o={header:function(){var e,o,n,r,a,l;return[(0,i.createVNode)("div",{class:[t.resolveClassName("dialog-tool"),t.fullscreen||!t.draggable?"":"move",t.draggable?"content-dragging":""],onMousedown:t.moveHandler},[null!==(n=null===(o=(e=t.$slots).tools)||void 0===o?void 0:o.call(e))&&void 0!==n?n:""]),(0,i.createVNode)("div",{class:t.resolveClassName("dialog-header")},[(0,i.createVNode)("div",{class:t.resolveClassName("header-icon")},[t.infoType?{loading:(0,i.createVNode)(f.Spinner,{class:[t.resolveClassName("info-icon"),"primary"]},null),warning:(0,i.createVNode)(f.Warn,{class:[t.resolveClassName("info-icon"),"warning"]},null),success:(0,i.createVNode)(f.Success,{class:[t.resolveClassName("info-icon"),"success"]},null),danger:(0,i.createVNode)(f.Close,{class:[t.resolveClassName("info-icon"),"danger"]},null)}[t.infoType]:(0,i.createVNode)("slot",{name:"info-icon"},null)]),(0,i.createVNode)("span",{class:t.resolveClassName("dialog-title"),style:"text-align: ".concat(t.headerAlign)},[null!==(l=null===(a=(r=t.$slots).header)||void 0===a?void 0:a.call(r))&&void 0!==l?l:t.title])])]},default:function(){var e,o,n;return null!==(n=null===(o=(e=t.$slots).default)||void 0===o?void 0:o.call(e))&&void 0!==n?n:"default"},footer:function(){var e,o,n,r,a,l,c,u,f;return(0,i.createVNode)("div",{class:t.resolveClassName("dialog-footer"),style:"text-align: ".concat(t.footerAlign)},["process"===t.dialogType?null!==(n=null===(o=(e=t.$slots).footer)||void 0===o?void 0:o.call(e))&&void 0!==n?n:(0,i.createVNode)(i.Fragment,null,[1===t.current?"":(0,i.createVNode)(s(),{class:t.resolveClassName("dialog-perv"),onClick:t.handlePrevStep},{default:function(){return[t.localPrevText]}}),t.current===t.totalStep?"":(0,i.createVNode)(s(),{class:t.resolveClassName("dialog-next"),onClick:t.handleNextStep},{default:function(){return[t.localNextText]}}),t.current===t.totalStep?(0,i.createVNode)(s(),{onClick:t.handleConfirm,theme:t.theme,loading:t.isLoading},{default:function(){return[t.localConfirmText]}}):"",(0,i.createVNode)(s(),{class:t.resolveClassName("dialog-cancel"),onClick:t.handleClose,disabled:t.isLoading},{default:function(){return[t.localCancelText]}})]):"","operation"===t.dialogType?null!==(l=null===(a=(r=t.$slots).footer)||void 0===a?void 0:a.call(r))&&void 0!==l?l:(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(s(),{onClick:t.handleConfirm,theme:t.theme,loading:t.isLoading},{default:function(){return[t.localConfirmText]}}),(0,i.createVNode)(s(),{class:t.resolveClassName("dialog-cancel"),onClick:t.handleClose,disabled:t.isLoading},{default:function(){return[t.localCancelText]}})]):"","confirm"===t.dialogType?null!==(f=null===(u=(c=t.$slots).footer)||void 0===u?void 0:u.call(c))&&void 0!==f?f:(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)(s(),{onClick:t.handleConfirm,theme:t.theme,loading:t.isLoading},{default:function(){return[t.localConfirmText]}})]):""])},close:function(){return(0,i.createVNode)(f.Error,{onClick:t.handleClose},null)}},n="".concat(this.resolveClassName("dialog-wrapper ")," ").concat(this.scrollable?"scroll-able":""," ").concat(this.multiInstance?"multi-instance":""," ").concat(this.hasFooter?"has-footer":"no-footer");return(0,i.createVNode)(p(),(0,i.mergeProps)(this.$props,{class:n,onClose:this.handleClose,isShow:this.isModalShow,style:this.data.moveStyle}),"function"==typeof(e=o)||"[object Object]"===Object.prototype.toString.call(e)&&!(0,i.isVNode)(e)?o:{default:function(){return[o]}})}}),m=(0,e.withInstall)((function(e){var o=document.createElement("div"),l=(0,i.ref)(!1),c=(0,i.shallowRef)(e),u=(0,i.defineComponent)({name:"DialogConfirm",setup:function(e,o){var u=this,s=o.expose;(0,i.onMounted)((function(){(document.activeElement||document.body).blur(),!1!==c.value.isShow&&(l.value=!0)}));var f=function(){return r(u,void 0,void 0,n().mark((function e(){var t,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(null===(t=c.value)||void 0===t?void 0:t.onClosed)){e.next=3;break}return e.next=3,null===(o=c.value)||void 0===o?void 0:o.onClosed();case 3:l.value=!1;case 4:case"end":return e.stop()}}),e)})))},d=function(){return r(u,void 0,void 0,n().mark((function e(){var t,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(null===(t=c.value)||void 0===t?void 0:t.onConfirm)){e.next=3;break}return e.next=3,null===(o=c.value)||void 0===o?void 0:o.onConfirm();case 3:l.value=!1;case 4:case"end":return e.stop()}}),e)})))};s({update:function(e){c.value=Object.assign(Object.assign({},c.value),e)}});var p=(0,a.usePrefix)().resolveClassName;return function(){return(0,i.createVNode)(h,Object.assign(Object.assign({class:p("info-wrapper"),headerAlign:"center",footerAlign:"center",transfer:!0,fullscreen:!1},c.value),{isShow:l.value,onClosed:f,onConfirm:d}),function(){var e=[],o=[];if(c.value.subTitle)switch(t(c.value.subTitle)){case"string":default:e.push(c.value.subTitle);break;case"function":e.push(c.value.subTitle())}return e.length&&o.push((0,i.h)("div",{class:p("info-sub-title"),style:"text-Align:".concat(c.value.contentAlign||"center")},e)),o}())}}}),s=(0,i.createApp)(u).mount(o);return{show:function(){l.value=!0},hide:function(){l.value=!1},update:function(e){s.update(e)},destroy:function(){s.unmount(),s=null}}}))})(),u})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "0.0.2-beta.15",
3
+ "version": "0.0.2-beta.16",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*",