bkui-vue 0.0.2-beta.3 → 0.0.2-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +63 -63
- package/dist/index.esm.js +13943 -13787
- package/dist/index.umd.js +62 -62
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/index.js +1 -1
- package/lib/backtop/index.js +1 -1
- package/lib/badge/badge.d.ts +1 -0
- package/lib/badge/index.d.ts +3 -0
- package/lib/badge/index.js +1 -1
- package/lib/breadcrumb/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb/breadcrumb.d.ts +1 -1
- package/lib/breadcrumb/index.d.ts +4 -4
- package/lib/button/button-group.d.ts +2 -2
- package/lib/button/index.d.ts +2 -2
- package/lib/button/index.js +1 -1
- package/lib/cascader/cascader-panel.d.ts +1 -0
- package/lib/cascader/cascader.d.ts +1 -0
- package/lib/cascader/cascader.less +4 -4
- package/lib/cascader/index.d.ts +4 -0
- package/lib/cascader/index.js +1 -1
- package/lib/checkbox/checkbox-group.d.ts +3 -1
- package/lib/checkbox/checkbox.d.ts +8 -8
- package/lib/checkbox/index.d.ts +15 -13
- package/lib/checkbox/index.js +1 -1
- package/lib/collapse-transition/collapse-transition.d.ts +1 -0
- package/lib/collapse-transition/index.js +1 -1
- package/lib/color-picker/color-picker.d.ts +1 -1
- package/lib/color-picker/index.d.ts +3 -3
- package/lib/color-picker/index.js +1 -1
- package/lib/date-picker/base/confirm.d.ts +1 -0
- package/lib/date-picker/base/date-table.d.ts +1 -0
- package/lib/date-picker/base/month-table.d.ts +1 -0
- package/lib/date-picker/base/picker-dropdown.d.ts +1 -0
- package/lib/date-picker/base/time-spinner.d.ts +2 -1
- package/lib/date-picker/base/year-table.d.ts +1 -0
- package/lib/date-picker/date-picker.d.ts +3 -2
- package/lib/date-picker/index.d.ts +9 -6
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/panel/date-range.d.ts +1 -0
- package/lib/date-picker/panel/date.d.ts +1 -0
- package/lib/date-picker/panel/time-range.d.ts +3 -2
- package/lib/date-picker/panel/time.d.ts +3 -2
- package/lib/date-picker/time-picker.d.ts +3 -2
- package/lib/dialog/dialog.d.ts +4 -3
- package/lib/dialog/index.d.ts +10 -7
- package/lib/dialog/index.js +1 -1
- package/lib/dialog/props.d.ts +1 -1
- package/lib/divider/divider.less +3 -4
- package/lib/divider/index.js +1 -1
- package/lib/fixed-navbar/index.js +1 -1
- package/lib/image/image-viewer.less +5 -3
- package/lib/image/image-viewer.variable.css +122 -0
- package/lib/image/image.css +142 -0
- package/lib/image/image.d.ts +0 -1
- package/lib/image/image.less +4 -1
- package/lib/image/image.variable.css +264 -0
- package/lib/image/index.js +1 -1
- package/lib/info-box/index.js +1 -1
- package/lib/input/index.d.ts +7 -7
- package/lib/input/index.js +1 -1
- package/lib/input/input.d.ts +4 -4
- package/lib/link/index.d.ts +3 -0
- package/lib/link/index.js +1 -1
- package/lib/link/link.d.ts +1 -0
- package/lib/loading/index.js +1 -1
- package/lib/message/index.js +1 -1
- package/lib/message/message.less +3 -3
- package/lib/message/messageConstructor.d.ts +2 -1
- package/lib/modal/index.d.ts +8 -8
- package/lib/modal/index.js +1 -1
- package/lib/modal/modal.d.ts +3 -3
- package/lib/modal/props.mixin.d.ts +1 -1
- package/lib/notify/notifyConstructor.d.ts +1 -1
- package/lib/pagination/index.d.ts +7 -7
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.d.ts +4 -4
- package/lib/plugin-popover/index.js +1 -1
- package/lib/pop-confirm/index.js +1 -1
- package/lib/pop-confirm/pop-confirm.less +9 -8
- package/lib/popover/content.d.ts +1 -0
- package/lib/popover/index.js +1 -1
- package/lib/progress/index.d.ts +7 -7
- package/lib/progress/progress.d.ts +4 -4
- package/lib/radio/index.d.ts +3 -3
- package/lib/radio/radio-button.d.ts +3 -3
- package/lib/radio/radio-group.d.ts +1 -1
- package/lib/radio/radio.less +1 -1
- package/lib/rate/index.d.ts +4 -4
- package/lib/rate/index.js +1 -1
- package/lib/rate/rate.d.ts +2 -2
- package/lib/rate/rate.less +5 -3
- package/lib/rate/rate.variable.css +122 -0
- package/lib/rate/star.less +6 -4
- package/lib/rate/star.variable.css +122 -0
- package/lib/resize-layout/index.js +1 -1
- package/lib/select/index.d.ts +20 -9
- package/lib/select/index.js +1 -1
- package/lib/select/option.d.ts +1 -0
- package/lib/select/optionGroup.d.ts +1 -0
- package/lib/select/select.d.ts +8 -5
- package/lib/select/selectTagInput.d.ts +1 -0
- package/lib/shared/vue-types.d.ts +2 -2
- package/lib/sideslider/index.d.ts +7 -7
- package/lib/sideslider/sideslider.d.ts +3 -3
- package/lib/slider/index.js +1 -1
- package/lib/slider/slider.less +6 -6
- package/lib/steps/index.d.ts +7 -7
- package/lib/steps/steps.d.ts +4 -4
- package/lib/styles/index.d.ts +2 -0
- package/lib/styles/reset.less +4 -2
- package/lib/styles/reset.variable.css +122 -0
- package/lib/switcher/index.d.ts +4 -4
- package/lib/switcher/switcher.d.ts +2 -2
- package/lib/tab/index.d.ts +3 -0
- package/lib/tab/index.js +1 -1
- package/lib/tab/tab-nav.d.ts +1 -0
- package/lib/tab/tab.d.ts +1 -0
- package/lib/table/index.d.ts +9 -9
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/head-filter.less +5 -7
- package/lib/table/plugins/settings.less +3 -3
- package/lib/table/table.d.ts +3 -3
- package/lib/table-column/index.d.ts +1 -1
- package/lib/tag-input/index.d.ts +12 -12
- package/lib/tag-input/tag-input.d.ts +6 -6
- package/lib/tag-input/tag-props.d.ts +2 -2
- package/lib/time-picker/index.d.ts +9 -6
- package/lib/time-picker/time-picker.less +39 -39
- package/lib/tree/index.d.ts +3 -3
- package/lib/tree/index.js +1 -1
- package/lib/tree/tree.d.ts +1 -1
- package/lib/virtual-render/index.js +1 -1
- package/lib/virtual-render/virtual-render.less +5 -6
- package/package.json +1 -1
package/lib/loading/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("../shared"),require("vue"));else if("function"==typeof define&&define.amd)define(["../shared","vue"],o);else{var t="object"==typeof exports?o(require("../shared"),require("vue")):o(e["../shared"],e.vue);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(self,((e,o)=>(()=>{"use strict";var
|
1
|
+
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("../shared"),require("vue"),require("../config-provider"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider"],o);else{var t="object"==typeof exports?o(require("../shared"),require("vue"),require("../config-provider")):o(e["../shared"],e.vue,e["../config-provider"]);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(self,((e,o,t)=>(()=>{"use strict";var n={2717:e=>{e.exports=t},4212:o=>{o.exports=e},748:e=>{e.exports=o}},i={};function r(e){var o=i[e];if(void 0!==o)return o.exports;var t=i[e]={exports:{}};return n[e](t,t.exports,r),t.exports}r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{r.r(l),r.d(l,{BkLoading:()=>m,BkLoadingMode:()=>i,BkLoadingSize:()=>a,default:()=>y,setDefaultIndicator:()=>c});var e=r(4212),o=r(748);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 n(e,o,n){return(o=function(e){var o=function(e,o){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(o)?o:String(o)}(o))in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}var i,a,u,d=r(2717);function c(e){u="function"==typeof e?e:function(){return(0,o.createVNode)(e,null,null)}}!function(e){e.Default="default",e.Spin="spin"}(i||(i={})),function(e){e.Normal="",e.Mini="mini",e.Small="small",e.Large="large"}(a||(a={}));var s={indicator:{type:Function},loading:e.PropTypes.bool.def(!0),inline:e.PropTypes.bool.def(!0),theme:{type:String},title:e.PropTypes.string.def(""),size:{type:String,default:a.Normal},mode:{type:String,default:"default"},opacity:e.PropTypes.number.def(.9),color:e.PropTypes.string.def("white"),zIndex:e.PropTypes.number.def(1),isDirective:e.PropTypes.bool.def(!1)};const v=(0,o.defineComponent)({name:"Loading",props:s,setup:function(t,r){var l=(0,d.usePrefix)().resolveClassName,a=(0,o.createVNode)("div",{class:"".concat(l("normal-indicator"))},[[1,2,3,4].map((function(e){return(0,o.createVNode)("span",{class:"dot dot-".concat(e)},null)}))]),c=(0,o.createVNode)("div",{class:"".concat(l("spin-indicator"))},[[1,2,3,4,5,6,7,8].map((function(e){return(0,o.createVNode)("span",{class:"oval oval-".concat(e)},null)}))]),s=(0,o.computed)((function(){return{zIndex:t.zIndex}})),v=(0,o.computed)((function(){return Object.assign({opacity:t.opacity,backgroundColor:t.color},s.value)})),p=(0,o.computed)((function(){var o;return(0,e.classes)((n(o={},"".concat(l("loading-wrapper")),t.loading),n(o,"".concat(l("nested-loading")),!!r.slots.default),n(o,"".concat(l("directive-loading")),t.isDirective),o))})),f=(0,o.computed)((function(){var o;return(0,e.classes)((n(o={},"".concat(l("loading-size-".concat(t.size))),!!t.size),n(o,"".concat(l("loading-".concat(t.theme))),!!t.theme),o),l("loading-indicator"))})),m=(0,o.computed)((function(){return!!t.title})),y=(0,o.computed)((function(){var e=t.mode===i.Spin;return"function"==typeof t.indicator?(0,o.createVNode)(t.indicator,null,null):"function"==typeof u?(0,o.createVNode)(u,null,null):e?c:a}));return function(){var e,n;return(0,o.createVNode)("div",{class:p.value},[null===(n=(e=r.slots).default)||void 0===n?void 0:n.call(e),t.loading&&[(r.slots.default||t.isDirective)&&(0,o.createVNode)("div",{class:"".concat(l("loading-mask")),style:v.value},null),(0,o.createVNode)("div",{class:f.value,style:s.value},[y.value,m.value&&(0,o.createVNode)("div",{class:"".concat(l("loading-title"))},[t.title])])]])}}});var p=Symbol("vBkLoading"),f={mounted:function(e,t){t.value&&function(e,t){var n,i,r,l,a,u=function(e){var o,n;return null!==(n=null===(o=t.value)||void 0===o?void 0:o[e])&&void 0!==n?n:void 0},d=(0,o.reactive)({indicator:u("indicator"),loading:null!==(n=u("loading"))&&void 0!==n&&n,inline:null!==(i=u("inline"))&&void 0!==i&&i,theme:u("theme"),title:null!==(r=u("title"))&&void 0!==r?r:"",size:null!==(l=u("size"))&&void 0!==l?l:"",mode:u("mode"),opacity:u("opacity"),color:null!==(a=u("color"))&&void 0!==a?a:"white",zIndex:u("zIndex"),isDirective:!0}),c=document.createElement("div");Object.assign(c.style,{position:"absolute",left:0,right:0,top:0,bottom:0}),Object.assign(e.style,{position:"relative"});var s=(0,o.createApp)({render:function(){return(0,o.h)(v,d)}});e[p]={options:d,instance:s,vm:s.mount(c)},e.appendChild(c)}(e,t)},updated:function(e,o){var t,n,i,r,l,a=e[p],u=o.value;r=u,l=a.options,Object.keys(r).forEach((function(e){r[e]!==l[e]&&(l[e]=r[e])})),(null===(i=null===(n=null===(t=null==a?void 0:a.vm)||void 0===t?void 0:t.$el)||void 0===n?void 0:n.parentNode)||void 0===i?void 0:i.style)&&(a.vm.$el.parentNode.style.display=u.loading?"":"none")},unmounted:function(e){var o,t,n,i=e[p];null==e||e.removeChild(null===(t=null===(o=null==i?void 0:i.vm)||void 0===o?void 0:o.$el)||void 0===t?void 0:t.parentNode),null===(n=null==i?void 0:i.instance)||void 0===n||n.unmount(),e[p]=null}},m=(0,e.withInstallProps)(v,{setDefaultIndicator:c,BkLoadingMode:i,BkLoadingSize:a},!0,{name:"loading",directive:f});const y=m})(),l})()));
|
package/lib/message/index.js
CHANGED
@@ -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("vue"),require("../shared"),require("vue-types"),require("../config-provider"),require("../icon"));else if("function"==typeof define&&define.amd)define(["vue","../shared","vue-types","../config-provider","../icon"],t);else{var n="object"==typeof exports?t(require("vue"),require("../shared"),require("vue-types"),require("../config-provider"),require("../icon")):t(e.vue,e["../shared"],e["vue-types"],e["../config-provider"],e["../icon"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,o)=>(()=>{var i={7647:function(e){var t;t=function(){return function(){var e={686:function(e,t,n){"use strict";n.d(t,{default:function(){return b}});var r=n(279),o=n.n(r),i=n(370),s=n.n(i),a=n(817),c=n.n(a);function l(e){try{return document.execCommand(e)}catch(e){return!1}}var u=function(e){var t=c()(e);return l("cut"),t},f=function(e,t){var n=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(r,"px"),n.setAttribute("readonly",""),n.value=e,n}(e);t.container.appendChild(n);var r=c()(n);return l("copy"),n.remove(),r},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=f(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=f(e.value,t):(n=c()(e),l("copy")),n};function d(e){return d="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},d(e)}function m(e){return m="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},m(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function g(e,t){var n="data-clipboard-".concat(e);if(t.hasAttribute(n))return t.getAttribute(n)}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(c,e);var t,n,r,o,i,a=(o=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=v(o);if(i){var n=v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function c(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(n=a.call(this)).resolveOptions(t),n.listenClick(e),n}return t=c,n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===m(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=s()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,o=e.target,i=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==d(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return i?p(i,{container:r}):o?"cut"===n?u(o):p(o,{container:r}):void 0}({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return g("action",e)}},{key:"defaultTarget",value:function(e){var t=g("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return g("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],r=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return p(e,t)}},{key:"cut",value:function(e){return u(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&y(t.prototype,n),r&&y(t,r),c}(o()),b=j},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var s=i.apply(this,arguments);return e.addEventListener(n,s,o),{destroy:function(){e.removeEventListener(n,s,o)}}}function i(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,s=r.length;i<s;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(686)}().default},e.exports=t()},4346:function(e){e.exports=function(){"use strict";function e(e){return null===e?"null":typeof e}function t(e){return!!e&&"object"==typeof e}function n(e){if(void 0===e)return"";if(null===e)return"Object";if("object"==typeof e&&!e.constructor)return"Object";var t=/function ([^(]*)/.exec(e.constructor.toString());return t&&t.length>1?t[1]:""}function r(e,t,n){return"null"===e||"undefined"===e?e:("string"!==e&&"stringifiable"!==e||(n='"'+n.replace(/"/g,'\\"')+'"'),"function"===e?t.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{…}":n)}function o(o){var i="";return t(o)?(i=n(o),Array.isArray(o)&&(i+="["+o.length+"]")):i=r(e(o),o,o),i}function i(e){return"json-formatter-"+e}function s(e,t,n){var r=document.createElement(e);return t&&r.classList.add(i(t)),void 0!==n&&(n instanceof Node?r.appendChild(n):r.appendChild(document.createTextNode(String(n)))),r}!function(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");t.setAttribute("media","screen"),t.innerHTML=e,document.head.appendChild(t)}}('.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-row,\n.json-formatter-row a,\n.json-formatter-row a:hover {\n color: black;\n text-decoration: none;\n}\n.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-row .json-formatter-string,\n.json-formatter-row .json-formatter-stringifiable {\n color: green;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-row .json-formatter-number {\n color: blue;\n}\n.json-formatter-row .json-formatter-boolean {\n color: red;\n}\n.json-formatter-row .json-formatter-null {\n color: #855A00;\n}\n.json-formatter-row .json-formatter-undefined {\n color: #ca0b69;\n}\n.json-formatter-row .json-formatter-function {\n color: #FF20ED;\n}\n.json-formatter-row .json-formatter-date {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: blue;\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-bracket {\n color: blue;\n}\n.json-formatter-row .json-formatter-key {\n color: #00008B;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n.json-formatter-dark.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-dark.json-formatter-row,\n.json-formatter-dark.json-formatter-row a,\n.json-formatter-dark.json-formatter-row a:hover {\n color: white;\n text-decoration: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-string,\n.json-formatter-dark.json-formatter-row .json-formatter-stringifiable {\n color: #31F031;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-number {\n color: #66C2FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-boolean {\n color: #EC4242;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-null {\n color: #EEC97D;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-undefined {\n color: #ef8fbe;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-function {\n color: #FD48CB;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-date {\n background-color: rgba(255, 255, 255, 0.05);\n}\n.json-formatter-dark.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: #027BFF;\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-bracket {\n color: #9494FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-key {\n color: #23A0DB;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-dark.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-dark.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n');var a=/(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/,c=/\d{2}:\d{2}:\d{2} GMT-\d{4}/,l=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,u=window.requestAnimationFrame||function(e){return e(),0},f={hoverPreviewEnabled:!1,hoverPreviewArrayCount:100,hoverPreviewFieldCount:5,animateOpen:!0,animateClose:!0,theme:null,useToJSON:!0,sortPropertiesBy:null};return function(){function p(e,t,n,r){void 0===t&&(t=1),void 0===n&&(n=f),this.json=e,this.open=t,this.config=n,this.key=r,this._isOpen=null,void 0===this.config.hoverPreviewEnabled&&(this.config.hoverPreviewEnabled=f.hoverPreviewEnabled),void 0===this.config.hoverPreviewArrayCount&&(this.config.hoverPreviewArrayCount=f.hoverPreviewArrayCount),void 0===this.config.hoverPreviewFieldCount&&(this.config.hoverPreviewFieldCount=f.hoverPreviewFieldCount),void 0===this.config.useToJSON&&(this.config.useToJSON=f.useToJSON),""===this.key&&(this.key='""')}return Object.defineProperty(p.prototype,"isOpen",{get:function(){return null!==this._isOpen?this._isOpen:this.open>0},set:function(e){this._isOpen=e},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isDate",{get:function(){return this.json instanceof Date||"string"===this.type&&(a.test(this.json)||l.test(this.json)||c.test(this.json))},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isUrl",{get:function(){return"string"===this.type&&0===this.json.indexOf("http")},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isArray",{get:function(){return Array.isArray(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isObject",{get:function(){return t(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isEmptyObject",{get:function(){return!this.keys.length&&!this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isEmpty",{get:function(){return this.isEmptyObject||this.keys&&!this.keys.length&&this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"useToJSON",{get:function(){return this.config.useToJSON&&"stringifiable"===this.type},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"hasKey",{get:function(){return void 0!==this.key},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"constructorName",{get:function(){return n(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"type",{get:function(){return this.config.useToJSON&&this.json&&this.json.toJSON?"stringifiable":e(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"keys",{get:function(){if(this.isObject){var e=Object.keys(this.json);return!this.isArray&&this.config.sortPropertiesBy?e.sort(this.config.sortPropertiesBy):e}return[]},enumerable:!0,configurable:!0}),p.prototype.toggleOpen=function(){this.isOpen=!this.isOpen,this.element&&(this.isOpen?this.appendChildren(this.config.animateOpen):this.removeChildren(this.config.animateClose),this.element.classList.toggle(i("open")))},p.prototype.openAtDepth=function(e){void 0===e&&(e=1),e<0||(this.open=e,this.isOpen=0!==e,this.element&&(this.removeChildren(!1),0===e?this.element.classList.remove(i("open")):(this.appendChildren(this.config.animateOpen),this.element.classList.add(i("open")))))},p.prototype.getInlinepreview=function(){var e=this;if(this.isArray)return this.json.length>this.config.hoverPreviewArrayCount?"Array["+this.json.length+"]":"["+this.json.map(o).join(", ")+"]";var t=this.keys,n=t.slice(0,this.config.hoverPreviewFieldCount).map((function(t){return t+":"+o(e.json[t])})),r=t.length>=this.config.hoverPreviewFieldCount?"…":"";return"{"+n.join(", ")+r+"}"},p.prototype.render=function(){this.element=s("div","row");var e=this.isObject?s("a","toggler-link"):s("span");if(this.isObject&&!this.useToJSON&&e.appendChild(s("span","toggler")),this.hasKey&&e.appendChild(s("span","key",this.key+":")),this.isObject&&!this.useToJSON){var t=s("span","value"),n=s("span"),o=s("span","constructor-name",this.constructorName);if(n.appendChild(o),this.isArray){var a=s("span");a.appendChild(s("span","bracket","[")),a.appendChild(s("span","number",this.json.length)),a.appendChild(s("span","bracket","]")),n.appendChild(a)}t.appendChild(n),e.appendChild(t)}else{(t=this.isUrl?s("a"):s("span")).classList.add(i(this.type)),this.isDate&&t.classList.add(i("date")),this.isUrl&&(t.classList.add(i("url")),t.setAttribute("href",this.json));var c=r(this.type,this.json,this.useToJSON?this.json.toJSON():this.json);t.appendChild(document.createTextNode(c)),e.appendChild(t)}if(this.isObject&&this.config.hoverPreviewEnabled){var l=s("span","preview-text");l.appendChild(document.createTextNode(this.getInlinepreview())),e.appendChild(l)}var u=s("div","children");return this.isObject&&u.classList.add(i("object")),this.isArray&&u.classList.add(i("array")),this.isEmpty&&u.classList.add(i("empty")),this.config&&this.config.theme&&this.element.classList.add(i(this.config.theme)),this.isOpen&&this.element.classList.add(i("open")),this.element.appendChild(e),this.element.appendChild(u),this.isObject&&this.isOpen&&this.appendChildren(),this.isObject&&!this.useToJSON&&e.addEventListener("click",this.toggleOpen.bind(this)),this.element},p.prototype.appendChildren=function(e){var t=this;void 0===e&&(e=!1);var n=this.element.querySelector("div."+i("children"));if(n&&!this.isEmpty)if(e){var r=0,o=function(){var e=t.keys[r],i=new p(t.json[e],t.open-1,t.config,e);n.appendChild(i.render()),(r+=1)<t.keys.length&&(r>10?o():u(o))};u(o)}else this.keys.forEach((function(e){var r=new p(t.json[e],t.open-1,t.config,e);n.appendChild(r.render())}))},p.prototype.removeChildren=function(e){void 0===e&&(e=!1);var t=this.element.querySelector("div."+i("children"));if(e){var n=0,r=function(){t&&t.children.length&&(t.removeChild(t.children[0]),(n+=1)>10?r():u(r))};u(r)}else t&&(t.innerHTML="")},p}()}()},2717:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=o},4212:e=>{"use strict";e.exports=t},748:t=>{"use strict";t.exports=e},210:e=>{"use strict";e.exports=n}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return i[e].call(n.exports,n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{"use strict";a.r(c),a.d(c,{default:()=>k});var e=a(748),t=a(4212),n={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},r=1;function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return s="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},s(e)}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===s(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u,f,p,d=a(7647),m=a.n(d),y=a(4346),h=a.n(y),v=a(210),g=a(2717),j=a(6870);!function(e){e.PRIMARY="primary",e.WARNING="warning",e.SUCCESS="success",e.ERROR="error"}(u||(u={})),function(e){e.KEY_VALUE="key-value",e.JSON="json"}(f||(f={})),function(e){e.ASSISTANT="assistant",e.DETAILS="details",e.FIX="fix",e.CLOSE="close"}(p||(p={}));var b={code:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.number]),overview:t.PropTypes.string,suggestion:t.PropTypes.string,details:t.PropTypes.string,assistant:t.PropTypes.string,type:(0,v.toType)("MessageContentType",{})},w={id:t.PropTypes.string.def(""),message:t.PropTypes.oneOfType([t.PropTypes.shape(b).loose,t.PropTypes.string]),theme:(0,v.toType)("messageTheme",{}).def(u.PRIMARY),delay:t.PropTypes.number,dismissable:t.PropTypes.bool.def(!0),offsetY:t.PropTypes.number.def(30),spacing:t.PropTypes.number.def(10),extCls:t.PropTypes.string.def(""),onClose:t.PropTypes.func,getContainer:t.PropTypes.instanceOf(HTMLElement),width:t.PropTypes.oneOfType([t.PropTypes.number,t.PropTypes.string]),actions:t.PropTypes.shape([])};const S=(0,e.defineComponent)({name:"Message",props:w,emits:["destroy"],setup:function(n,r){var o,a=this,c=r.emit,u=r.slots,d=(0,g.useLocale)("message"),y=(0,e.computed)((function(){return["bk-message","bk-message-".concat(n.theme),"".concat(n.extCls)]})),v=t.bkZIndexManager.getMessageNextIndex(),b=(0,e.computed)((function(){return/^\d+\.?\d*$/.test("".concat(n.delay))?n.delay:"object"!==s(n.message)||(0,e.isVNode)(n.message)?3e3:8e3})),w=(0,e.computed)((function(){return/^\d+/.test("".concat(n.width))?/^\d+\.?\d*$/.test("".concat(n.width))?"".concat(n.width,"px"):n.width:"object"!==s(n.message)||(0,e.isVNode)(n.message)?"".concat(560,"px"):"".concat(800,"px")})),S=(0,e.computed)((function(){return n.getContainer&&(0,t.isElement)(n.getContainer)})),k=(0,e.computed)((function(){return{top:"".concat(n.offsetY,"px"),zIndex:v,position:S.value?"absolute":"fixed",width:w.value}})),C=(0,e.ref)(null),T=(0,e.ref)(null),O=(0,e.ref)(null),x=(0,e.ref)(!1),E=(0,e.reactive)({isFix:!1,isDetailShow:!1}),N=null,A=function(){N=setTimeout((function(){E.isFix||(x.value=!1)}),b.value)},P=function(e){e.preventDefault(),e.stopPropagation(),x.value=!1},L=(0,e.ref)(!1),M=(0,e.ref)(null),V=function(e){var t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){console.error("Format Json Error: ".concat(e))}return t},F=function(t,r){if(E.isDetailShow=null!=r?r:!E.isDetailShow,I(t,E.isDetailShow),E.isDetailShow&&"object"===s(n.message)&&!(0,e.isVNode)(n.message)&&(n.message.type===f.JSON||!n.message.type)){var o=V(n.message.details),i=new(h())(o);setTimeout((function(){C.value&&(C.value.innerHTML="",C.value.append(i.render()))}))}},I=function(e,t){E.isFix=null!=t?t:!E.isFix};(0,e.onMounted)((function(){b.value&&A(),x.value=!0})),(0,e.onUnmounted)((function(){clearTimeout(N)})),(0,e.watch)(x,(function(){x.value||c("destroy",n.id)}));var D=(0,e.computed)((function(){var t;return l(t={},p.ASSISTANT,{id:p.ASSISTANT,icon:function(){return(0,e.createVNode)(j.WeixinPro,null,null)},text:function(){return d.value.assistant},onClick:function(e){n.message.assistant&&window.open(n.message.assistant,"_blank")}}),l(t,p.DETAILS,{id:p.DETAILS,icon:function(){return E.isDetailShow?(0,e.createVNode)(j.AngleDoubleUpLine,null,null):(0,e.createVNode)(j.AngleDoubleDownLine,null,null)},text:function(){return d.value.details},onClick:function(e){return F(e)}}),l(t,p.FIX,{id:p.FIX,icon:function(){return E.isFix?(0,e.createVNode)(j.FixShape,null,null):(0,e.createVNode)(j.FixLine,null,null)},classList:E.isFix?"fixed":"",onClick:function(e){return I(e)}}),l(t,p.CLOSE,{id:p.CLOSE,classList:"normal-color",icon:function(){return n.dismissable&&(0,e.createVNode)(j.Error,{class:"bk-message-close",onClick:P},null)},onClick:P}),t})),R=[p.ASSISTANT,p.DETAILS,p.FIX,p.CLOSE],_=(0,e.computed)((function(){var e;if((null===(e=n.actions)||void 0===e?void 0:e.length)>0){var t=n.actions.map((function(e){var t=e.id.toLocaleLowerCase(),n=D.value[t],r=null==n?void 0:n.onClick,o=Object.assign({},D.value[t]||{},e);if(o.id=t,void 0!==e.classList){var c=Array.isArray(e.classList)?e.classList:[e.classList],l=[];void 0!==n.classList&&(l=Array.isArray(n.classList)?n.classList:[n.classList]),o.classList=[].concat(i(l),i(c))}return"function"==typeof e.onClick?(o.onClick=function(){var t=Reflect.apply(e.onClick,a,[]);void 0!==s(t)&&!t||"function"!=typeof r||Reflect.apply(r,a,[])},o):(o.onClick=r,o)})),r=R.filter((function(e){return!t.some((function(t){return t.id===e}))})).map((function(e){return D.value[e]}));return t.push.apply(t,i(r)),t}return R.map((function(e){return D.value[e]}))}));return{classNames:y,styles:k,visible:x,close:P,setDetailsShow:F,fixMesage:I,copyMessage:function(e){if(!L.value){var t=new(m())(O.value,{text:function(){return n.message.details}});["success","error"].forEach((function(e){t.on(e,(function(){var t,n,r=T.value;M.value=e,r&&((t=r.classList).remove.apply(t,["success","error","is-hidden"]),(n=r.classList).add.apply(n,[e,"is-show"]),o&&clearTimeout(o),o=setTimeout((function(){var e,t;(e=r.classList).remove.apply(e,["is-show"]),(t=r.classList).add.apply(t,["is-hidden"])}),2e3))})),L.value=!0,setTimeout((function(){O.value.click()}))}))}},parseJson:V,handleMouseenter:function(e){clearTimeout(N)},handleMouseleave:function(e){b.value&&A()},renderMessageActions:function(){var t,n,r=function(t){var n=t.text,r=void 0;if("function"==typeof n&&(r=Reflect.apply(n,a,[])),void 0!==r)return"string"==typeof r?(0,e.createVNode)("span",{class:"message-action-text"},[r]):r};return null!==(n=null===(t=u.action)||void 0===t?void 0:t.call(u))&&void 0!==n?n:_.value.map((function(t){if(t.disabled)return null;if("function"==typeof t.render)return Reflect.apply(t.render,a,[]);var n,o,i=Array.isArray(t.classList)?t.classList.join(" "):t.classList;return(0,e.createVNode)("span",{class:["tool",t.id,i],onClick:function(e){return function(e,t){t.readonly||t.disabled||"function"==typeof t.onClick&&Reflect.apply(t.onClick,a,[e,t])}(e,t)}},[(n=t,o=n.icon,"function"==typeof o?Reflect.apply(o,a,[]):(0,e.createVNode)("span",{class:o},null)),r(t)])}))},refJsonContent:C,refCopyStatus:T,refCopyMsgDiv:O,toolOperation:E,copyStatus:M,t:d}},render:function(){var t=this,n=function(n){return{primary:(0,e.createVNode)(j.Info,null,null),warning:(0,e.createVNode)(j.Warn,null,null),success:(0,e.createVNode)(j.Success,null,null),error:(0,e.createVNode)(j.Close,null,null)}[null!=n?n:t.theme]},r=function(n){if(n.type===f.KEY_VALUE){var r=t.parseJson(n.details||{});return Object.keys(r).map((function(t){return(0,e.createVNode)("div",{class:"message-row"},[(0,e.createVNode)("label",null,[t]),r[t]])}))}};return(0,e.createVNode)(e.Transition,{name:"bk-message-fade"},{default:function(){return[(0,e.withDirectives)((0,e.createVNode)("div",{class:t.classNames,style:t.styles,onMouseenter:t.handleMouseenter,onMouseleave:t.handleMouseleave},["object"!==s(t.message)||(0,e.isVNode)(t.message)?(0,e.createVNode)(e.Fragment,null,[(0,e.createVNode)("div",{class:"bk-message-content"},[(0,e.createVNode)("div",{class:"bk-message-icon"},[n()]),t.message]),t.dismissable&&(0,e.createVNode)(j.Error,{class:"bk-message-close",onClick:t.close},null)]):(0,e.createVNode)("div",{class:"bk-message-content multi"},[(0,e.createVNode)("div",{class:"overview"},[(0,e.createVNode)("div",{class:"left-content"},[(0,e.createVNode)("div",{class:"bk-message-icon"},[n()]),(0,e.createVNode)("div",{class:"describe"},[null!==(a=null===(i=(o=t.$slots).title)||void 0===i?void 0:i.call(o))&&void 0!==a?a:"【".concat(t.message.code,"】").concat(t.message.overview," ").concat(t.message.suggestion)])]),(0,e.createVNode)("div",{class:"tools"},[t.renderMessageActions()])]),t.toolOperation.isDetailShow&&(0,e.createVNode)("div",{class:"message-detail"},[(0,e.createVNode)("div",{class:"message-copy",ref:"refCopyMsgDiv",onClick:t.copyMessage},[(0,e.createVNode)(j.CopyShape,null,null),(0,e.createVNode)("div",{class:"copy-status",ref:"refCopyStatus"},[(0,e.createVNode)("div",{class:"inner"},[n(t.copyStatus),"success"===t.copyStatus?t.t.copySuccess:t.t.copyFailed])])]),(0,e.createVNode)("div",{ref:"refJsonContent",class:"message-tree"},[r(t.message)])])])]),[[e.vShow,t.visible]])];var o,i,a}})}}),k=function(o){!function(o,i){var s=i,a=s.position||"top-right";"string"==typeof i&&(s={message:i});var c=i.onClose,l=s.offsetX||10,u=s.offsetY||30,f=s.spacing,p=void 0===f?10:f;n[a].forEach((function(e){u+=(e.el.offsetHeight||0)+p}));var d="message_".concat(r+=1);s=Object.assign(Object.assign({},s),{offsetX:l,offsetY:u,id:d});var m=document.createElement("div"),y=(0,e.createVNode)(o,s);y.props.onDestroy=function(t){!function(e,t,r,o){null==o||o();var i=t.startsWith("top")?"top":"bottom",s=-1;n[t].forEach((function(t,n){t.props.id===e&&(s=n)}));for(var a=n[t][s].el.offsetHeight,c=n[t].length,l=s;l<c;l++){var u=parseInt(n[t][l].el.style[i],10)-a-r;n[t][l].component.props.offsetY=u}n[t].splice(s,1)}(t,a,p,c),(0,e.render)(null,m)},(0,e.render)(y,m),n[a].push(y),(y.props.getContainer&&(0,t.isElement)(y.props.getContainer)?y.props.getContainer:document.body).appendChild(m.firstElementChild)}(S,o)}})(),c})()));
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("vue"),require("../shared"),require("vue-types"),require("../config-provider"),require("../icon"));else if("function"==typeof define&&define.amd)define(["vue","../shared","vue-types","../config-provider","../icon"],t);else{var n="object"==typeof exports?t(require("vue"),require("../shared"),require("vue-types"),require("../config-provider"),require("../icon")):t(e.vue,e["../shared"],e["vue-types"],e["../config-provider"],e["../icon"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,((e,t,n,r,o)=>(()=>{var i={7647:function(e){var t;t=function(){return function(){var e={686:function(e,t,n){"use strict";n.d(t,{default:function(){return b}});var r=n(279),o=n.n(r),i=n(370),s=n.n(i),a=n(817),c=n.n(a);function l(e){try{return document.execCommand(e)}catch(e){return!1}}var u=function(e){var t=c()(e);return l("cut"),t},f=function(e,t){var n=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(r,"px"),n.setAttribute("readonly",""),n.value=e,n}(e);t.container.appendChild(n);var r=c()(n);return l("copy"),n.remove(),r},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=f(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=f(e.value,t):(n=c()(e),l("copy")),n};function d(e){return d="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},d(e)}function m(e){return m="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},m(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function g(e,t){var n="data-clipboard-".concat(e);if(t.hasAttribute(n))return t.getAttribute(n)}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(c,e);var t,n,r,o,i,a=(o=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=v(o);if(i){var n=v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==m(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function c(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(n=a.call(this)).resolveOptions(t),n.listenClick(e),n}return t=c,n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===m(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=s()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,o=e.target,i=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==d(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return i?p(i,{container:r}):o?"cut"===n?u(o):p(o,{container:r}):void 0}({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return g("action",e)}},{key:"defaultTarget",value:function(e){var t=g("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return g("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],r=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return p(e,t)}},{key:"cut",value:function(e){return u(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&y(t.prototype,n),r&&y(t,r),c}(o()),b=j},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var s=i.apply(this,arguments);return e.addEventListener(n,s,o),{destroy:function(){e.removeEventListener(n,s,o)}}}function i(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,s=r.length;i<s;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(686)}().default},e.exports=t()},4346:function(e){e.exports=function(){"use strict";function e(e){return null===e?"null":typeof e}function t(e){return!!e&&"object"==typeof e}function n(e){if(void 0===e)return"";if(null===e)return"Object";if("object"==typeof e&&!e.constructor)return"Object";var t=/function ([^(]*)/.exec(e.constructor.toString());return t&&t.length>1?t[1]:""}function r(e,t,n){return"null"===e||"undefined"===e?e:("string"!==e&&"stringifiable"!==e||(n='"'+n.replace(/"/g,'\\"')+'"'),"function"===e?t.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{…}":n)}function o(o){var i="";return t(o)?(i=n(o),Array.isArray(o)&&(i+="["+o.length+"]")):i=r(e(o),o,o),i}function i(e){return"json-formatter-"+e}function s(e,t,n){var r=document.createElement(e);return t&&r.classList.add(i(t)),void 0!==n&&(n instanceof Node?r.appendChild(n):r.appendChild(document.createTextNode(String(n)))),r}!function(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");t.setAttribute("media","screen"),t.innerHTML=e,document.head.appendChild(t)}}('.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-row,\n.json-formatter-row a,\n.json-formatter-row a:hover {\n color: black;\n text-decoration: none;\n}\n.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-row .json-formatter-string,\n.json-formatter-row .json-formatter-stringifiable {\n color: green;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-row .json-formatter-number {\n color: blue;\n}\n.json-formatter-row .json-formatter-boolean {\n color: red;\n}\n.json-formatter-row .json-formatter-null {\n color: #855A00;\n}\n.json-formatter-row .json-formatter-undefined {\n color: #ca0b69;\n}\n.json-formatter-row .json-formatter-function {\n color: #FF20ED;\n}\n.json-formatter-row .json-formatter-date {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: blue;\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-bracket {\n color: blue;\n}\n.json-formatter-row .json-formatter-key {\n color: #00008B;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n.json-formatter-dark.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-dark.json-formatter-row,\n.json-formatter-dark.json-formatter-row a,\n.json-formatter-dark.json-formatter-row a:hover {\n color: white;\n text-decoration: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-string,\n.json-formatter-dark.json-formatter-row .json-formatter-stringifiable {\n color: #31F031;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-number {\n color: #66C2FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-boolean {\n color: #EC4242;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-null {\n color: #EEC97D;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-undefined {\n color: #ef8fbe;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-function {\n color: #FD48CB;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-date {\n background-color: rgba(255, 255, 255, 0.05);\n}\n.json-formatter-dark.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: #027BFF;\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-bracket {\n color: #9494FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-key {\n color: #23A0DB;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-dark.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-dark.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n');var a=/(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/,c=/\d{2}:\d{2}:\d{2} GMT-\d{4}/,l=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,u=window.requestAnimationFrame||function(e){return e(),0},f={hoverPreviewEnabled:!1,hoverPreviewArrayCount:100,hoverPreviewFieldCount:5,animateOpen:!0,animateClose:!0,theme:null,useToJSON:!0,sortPropertiesBy:null};return function(){function p(e,t,n,r){void 0===t&&(t=1),void 0===n&&(n=f),this.json=e,this.open=t,this.config=n,this.key=r,this._isOpen=null,void 0===this.config.hoverPreviewEnabled&&(this.config.hoverPreviewEnabled=f.hoverPreviewEnabled),void 0===this.config.hoverPreviewArrayCount&&(this.config.hoverPreviewArrayCount=f.hoverPreviewArrayCount),void 0===this.config.hoverPreviewFieldCount&&(this.config.hoverPreviewFieldCount=f.hoverPreviewFieldCount),void 0===this.config.useToJSON&&(this.config.useToJSON=f.useToJSON),""===this.key&&(this.key='""')}return Object.defineProperty(p.prototype,"isOpen",{get:function(){return null!==this._isOpen?this._isOpen:this.open>0},set:function(e){this._isOpen=e},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isDate",{get:function(){return this.json instanceof Date||"string"===this.type&&(a.test(this.json)||l.test(this.json)||c.test(this.json))},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isUrl",{get:function(){return"string"===this.type&&0===this.json.indexOf("http")},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isArray",{get:function(){return Array.isArray(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isObject",{get:function(){return t(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isEmptyObject",{get:function(){return!this.keys.length&&!this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"isEmpty",{get:function(){return this.isEmptyObject||this.keys&&!this.keys.length&&this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"useToJSON",{get:function(){return this.config.useToJSON&&"stringifiable"===this.type},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"hasKey",{get:function(){return void 0!==this.key},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"constructorName",{get:function(){return n(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"type",{get:function(){return this.config.useToJSON&&this.json&&this.json.toJSON?"stringifiable":e(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"keys",{get:function(){if(this.isObject){var e=Object.keys(this.json);return!this.isArray&&this.config.sortPropertiesBy?e.sort(this.config.sortPropertiesBy):e}return[]},enumerable:!0,configurable:!0}),p.prototype.toggleOpen=function(){this.isOpen=!this.isOpen,this.element&&(this.isOpen?this.appendChildren(this.config.animateOpen):this.removeChildren(this.config.animateClose),this.element.classList.toggle(i("open")))},p.prototype.openAtDepth=function(e){void 0===e&&(e=1),e<0||(this.open=e,this.isOpen=0!==e,this.element&&(this.removeChildren(!1),0===e?this.element.classList.remove(i("open")):(this.appendChildren(this.config.animateOpen),this.element.classList.add(i("open")))))},p.prototype.getInlinepreview=function(){var e=this;if(this.isArray)return this.json.length>this.config.hoverPreviewArrayCount?"Array["+this.json.length+"]":"["+this.json.map(o).join(", ")+"]";var t=this.keys,n=t.slice(0,this.config.hoverPreviewFieldCount).map((function(t){return t+":"+o(e.json[t])})),r=t.length>=this.config.hoverPreviewFieldCount?"…":"";return"{"+n.join(", ")+r+"}"},p.prototype.render=function(){this.element=s("div","row");var e=this.isObject?s("a","toggler-link"):s("span");if(this.isObject&&!this.useToJSON&&e.appendChild(s("span","toggler")),this.hasKey&&e.appendChild(s("span","key",this.key+":")),this.isObject&&!this.useToJSON){var t=s("span","value"),n=s("span"),o=s("span","constructor-name",this.constructorName);if(n.appendChild(o),this.isArray){var a=s("span");a.appendChild(s("span","bracket","[")),a.appendChild(s("span","number",this.json.length)),a.appendChild(s("span","bracket","]")),n.appendChild(a)}t.appendChild(n),e.appendChild(t)}else{(t=this.isUrl?s("a"):s("span")).classList.add(i(this.type)),this.isDate&&t.classList.add(i("date")),this.isUrl&&(t.classList.add(i("url")),t.setAttribute("href",this.json));var c=r(this.type,this.json,this.useToJSON?this.json.toJSON():this.json);t.appendChild(document.createTextNode(c)),e.appendChild(t)}if(this.isObject&&this.config.hoverPreviewEnabled){var l=s("span","preview-text");l.appendChild(document.createTextNode(this.getInlinepreview())),e.appendChild(l)}var u=s("div","children");return this.isObject&&u.classList.add(i("object")),this.isArray&&u.classList.add(i("array")),this.isEmpty&&u.classList.add(i("empty")),this.config&&this.config.theme&&this.element.classList.add(i(this.config.theme)),this.isOpen&&this.element.classList.add(i("open")),this.element.appendChild(e),this.element.appendChild(u),this.isObject&&this.isOpen&&this.appendChildren(),this.isObject&&!this.useToJSON&&e.addEventListener("click",this.toggleOpen.bind(this)),this.element},p.prototype.appendChildren=function(e){var t=this;void 0===e&&(e=!1);var n=this.element.querySelector("div."+i("children"));if(n&&!this.isEmpty)if(e){var r=0,o=function(){var e=t.keys[r],i=new p(t.json[e],t.open-1,t.config,e);n.appendChild(i.render()),(r+=1)<t.keys.length&&(r>10?o():u(o))};u(o)}else this.keys.forEach((function(e){var r=new p(t.json[e],t.open-1,t.config,e);n.appendChild(r.render())}))},p.prototype.removeChildren=function(e){void 0===e&&(e=!1);var t=this.element.querySelector("div."+i("children"));if(e){var n=0,r=function(){t&&t.children.length&&(t.removeChild(t.children[0]),(n+=1)>10?r():u(r))};u(r)}else t&&(t.innerHTML="")},p}()}()},2717:e=>{"use strict";e.exports=r},6870:e=>{"use strict";e.exports=o},4212:e=>{"use strict";e.exports=t},748:t=>{"use strict";t.exports=e},210:e=>{"use strict";e.exports=n}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return i[e].call(n.exports,n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{"use strict";a.r(c),a.d(c,{default:()=>C});var e=a(748),t=a(4212),n={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},r=1;function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return s="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},s(e)}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===s(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u,f,p,d=a(7647),m=a.n(d),y=a(4346),h=a.n(y),v=a(210),g=a(2717),j=a(6870);!function(e){e.PRIMARY="primary",e.WARNING="warning",e.SUCCESS="success",e.ERROR="error"}(u||(u={})),function(e){e.KEY_VALUE="key-value",e.JSON="json"}(f||(f={})),function(e){e.ASSISTANT="assistant",e.DETAILS="details",e.FIX="fix",e.CLOSE="close"}(p||(p={}));var b={code:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.number]),overview:t.PropTypes.string,suggestion:t.PropTypes.string,details:t.PropTypes.string,assistant:t.PropTypes.string,type:(0,v.toType)("MessageContentType",{})},w={id:t.PropTypes.string.def(""),message:t.PropTypes.oneOfType([t.PropTypes.shape(b).loose,t.PropTypes.string]),theme:(0,v.toType)("messageTheme",{}).def(u.PRIMARY),delay:t.PropTypes.number,dismissable:t.PropTypes.bool.def(!0),offsetY:t.PropTypes.number.def(30),spacing:t.PropTypes.number.def(10),extCls:t.PropTypes.string.def(""),onClose:t.PropTypes.func,getContainer:t.PropTypes.instanceOf(HTMLElement),width:t.PropTypes.oneOfType([t.PropTypes.number,t.PropTypes.string]),actions:t.PropTypes.shape([])};const S=(0,e.defineComponent)({name:"Message",props:w,emits:["destroy"],setup:function(n,r){var o,a=this,c=r.emit,u=r.slots,d=(0,g.useLocale)("message"),y=(0,g.usePrefix)().resolveClassName,v=(0,e.computed)((function(){return["".concat(y("message")),"".concat(y("message-".concat(n.theme))),"".concat(n.extCls)]})),b=t.bkZIndexManager.getMessageNextIndex(),w=(0,e.computed)((function(){return/^\d+\.?\d*$/.test("".concat(n.delay))?n.delay:"object"!==s(n.message)||(0,e.isVNode)(n.message)?3e3:8e3})),S=(0,e.computed)((function(){return/^\d+/.test("".concat(n.width))?/^\d+\.?\d*$/.test("".concat(n.width))?"".concat(n.width,"px"):n.width:"object"!==s(n.message)||(0,e.isVNode)(n.message)?"".concat(560,"px"):"".concat(800,"px")})),C=(0,e.computed)((function(){return n.getContainer&&(0,t.isElement)(n.getContainer)})),k=(0,e.computed)((function(){return{top:"".concat(n.offsetY,"px"),zIndex:b,position:C.value?"absolute":"fixed",width:S.value}})),T=(0,e.ref)(null),O=(0,e.ref)(null),x=(0,e.ref)(null),N=(0,e.ref)(!1),E=(0,e.reactive)({isFix:!1,isDetailShow:!1}),A=null,P=function(){A=setTimeout((function(){E.isFix||(N.value=!1)}),w.value)},L=function(e){e.preventDefault(),e.stopPropagation(),N.value=!1},M=(0,e.ref)(!1),V=(0,e.ref)(null),F=function(e){var t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){console.error("Format Json Error: ".concat(e))}return t},I=function(t,r){if(E.isDetailShow=null!=r?r:!E.isDetailShow,D(t,E.isDetailShow),E.isDetailShow&&"object"===s(n.message)&&!(0,e.isVNode)(n.message)&&(n.message.type===f.JSON||!n.message.type)){var o=F(n.message.details),i=new(h())(o);setTimeout((function(){T.value&&(T.value.innerHTML="",T.value.append(i.render()))}))}},D=function(e,t){E.isFix=null!=t?t:!E.isFix};(0,e.onMounted)((function(){w.value&&P(),N.value=!0})),(0,e.onUnmounted)((function(){clearTimeout(A)})),(0,e.watch)(N,(function(){N.value||c("destroy",n.id)}));var R=(0,e.computed)((function(){var t;return l(t={},p.ASSISTANT,{id:p.ASSISTANT,icon:function(){return(0,e.createVNode)(j.WeixinPro,null,null)},text:function(){return d.value.assistant},onClick:function(e){n.message.assistant&&window.open(n.message.assistant,"_blank")}}),l(t,p.DETAILS,{id:p.DETAILS,icon:function(){return E.isDetailShow?(0,e.createVNode)(j.AngleDoubleUpLine,null,null):(0,e.createVNode)(j.AngleDoubleDownLine,null,null)},text:function(){return d.value.details},onClick:function(e){return I(e)}}),l(t,p.FIX,{id:p.FIX,icon:function(){return E.isFix?(0,e.createVNode)(j.FixShape,null,null):(0,e.createVNode)(j.FixLine,null,null)},classList:E.isFix?"fixed":"",onClick:function(e){return D(e)}}),l(t,p.CLOSE,{id:p.CLOSE,classList:"normal-color",icon:function(){return n.dismissable&&(0,e.createVNode)(j.Error,{class:"".concat(y("message-close")),onClick:L},null)},onClick:L}),t})),_=[p.ASSISTANT,p.DETAILS,p.FIX,p.CLOSE],J=(0,e.computed)((function(){var e;if((null===(e=n.actions)||void 0===e?void 0:e.length)>0){var t=n.actions.map((function(e){var t=e.id.toLocaleLowerCase(),n=R.value[t],r=null==n?void 0:n.onClick,o=Object.assign({},R.value[t]||{},e);if(o.id=t,void 0!==e.classList){var c=Array.isArray(e.classList)?e.classList:[e.classList],l=[];void 0!==n.classList&&(l=Array.isArray(n.classList)?n.classList:[n.classList]),o.classList=[].concat(i(l),i(c))}return"function"==typeof e.onClick?(o.onClick=function(){var t=Reflect.apply(e.onClick,a,[]);void 0!==s(t)&&!t||"function"!=typeof r||Reflect.apply(r,a,[])},o):(o.onClick=r,o)})),r=_.filter((function(e){return!t.some((function(t){return t.id===e}))})).map((function(e){return R.value[e]}));return t.push.apply(t,i(r)),t}return _.map((function(e){return R.value[e]}))}));return{classNames:v,styles:k,visible:N,close:L,setDetailsShow:I,fixMesage:D,copyMessage:function(e){if(!M.value){var t=new(m())(x.value,{text:function(){return n.message.details}});["success","error"].forEach((function(e){t.on(e,(function(){var t,n,r=O.value;V.value=e,r&&((t=r.classList).remove.apply(t,["success","error","is-hidden"]),(n=r.classList).add.apply(n,[e,"is-show"]),o&&clearTimeout(o),o=setTimeout((function(){var e,t;(e=r.classList).remove.apply(e,["is-show"]),(t=r.classList).add.apply(t,["is-hidden"])}),2e3))})),M.value=!0,setTimeout((function(){x.value.click()}))}))}},parseJson:F,handleMouseenter:function(e){clearTimeout(A)},handleMouseleave:function(e){w.value&&P()},renderMessageActions:function(){var t,n,r=function(t){var n=t.text,r=void 0;if("function"==typeof n&&(r=Reflect.apply(n,a,[])),void 0!==r)return"string"==typeof r?(0,e.createVNode)("span",{class:"message-action-text"},[r]):r};return null!==(n=null===(t=u.action)||void 0===t?void 0:t.call(u))&&void 0!==n?n:J.value.map((function(t){if(t.disabled)return null;if("function"==typeof t.render)return Reflect.apply(t.render,a,[]);var n,o,i=Array.isArray(t.classList)?t.classList.join(" "):t.classList;return(0,e.createVNode)("span",{class:["tool",t.id,i],onClick:function(e){return function(e,t){t.readonly||t.disabled||"function"==typeof t.onClick&&Reflect.apply(t.onClick,a,[e,t])}(e,t)}},[(n=t,o=n.icon,"function"==typeof o?Reflect.apply(o,a,[]):(0,e.createVNode)("span",{class:o},null)),r(t)])}))},refJsonContent:T,refCopyStatus:O,refCopyMsgDiv:x,toolOperation:E,copyStatus:V,t:d,resolveClassName:y}},render:function(){var t=this,n=function(n){return{primary:(0,e.createVNode)(j.Info,null,null),warning:(0,e.createVNode)(j.Warn,null,null),success:(0,e.createVNode)(j.Success,null,null),error:(0,e.createVNode)(j.Close,null,null)}[null!=n?n:t.theme]},r=function(n){if(n.type===f.KEY_VALUE){var r=t.parseJson(n.details||{});return Object.keys(r).map((function(t){return(0,e.createVNode)("div",{class:"message-row"},[(0,e.createVNode)("label",null,[t]),r[t]])}))}};return(0,e.createVNode)(e.Transition,{name:"bk-message-fade"},{default:function(){return[(0,e.withDirectives)((0,e.createVNode)("div",{class:t.classNames,style:t.styles,onMouseenter:t.handleMouseenter,onMouseleave:t.handleMouseleave},["object"!==s(t.message)||(0,e.isVNode)(t.message)?(0,e.createVNode)(e.Fragment,null,[(0,e.createVNode)("div",{class:"".concat(t.resolveClassName("message-content"))},[(0,e.createVNode)("div",{class:"".concat(t.resolveClassName("message-icon"))},[n()]),t.message]),t.dismissable&&(0,e.createVNode)(j.Error,{class:"".concat(t.resolveClassName("message-close")),onClick:t.close},null)]):(0,e.createVNode)("div",{class:"".concat(t.resolveClassName("message-content")," multi")},[(0,e.createVNode)("div",{class:"overview"},[(0,e.createVNode)("div",{class:"left-content"},[(0,e.createVNode)("div",{class:"".concat(t.resolveClassName("message-icon"))},[n()]),(0,e.createVNode)("div",{class:"describe"},[null!==(a=null===(i=(o=t.$slots).title)||void 0===i?void 0:i.call(o))&&void 0!==a?a:"【".concat(t.message.code,"】").concat(t.message.overview," ").concat(t.message.suggestion)])]),(0,e.createVNode)("div",{class:"tools"},[t.renderMessageActions()])]),t.toolOperation.isDetailShow&&(0,e.createVNode)("div",{class:"message-detail"},[(0,e.createVNode)("div",{class:"message-copy",ref:"refCopyMsgDiv",onClick:t.copyMessage},[(0,e.createVNode)(j.CopyShape,null,null),(0,e.createVNode)("div",{class:"copy-status",ref:"refCopyStatus"},[(0,e.createVNode)("div",{class:"inner"},[n(t.copyStatus),"success"===t.copyStatus?t.t.copySuccess:t.t.copyFailed])])]),(0,e.createVNode)("div",{ref:"refJsonContent",class:"message-tree"},[r(t.message)])])])]),[[e.vShow,t.visible]])];var o,i,a}})}}),C=function(o){!function(o,i){var s=i,a=s.position||"top-right";"string"==typeof i&&(s={message:i});var c=i.onClose,l=s.offsetX||10,u=s.offsetY||30,f=s.spacing,p=void 0===f?10:f;n[a].forEach((function(e){u+=(e.el.offsetHeight||0)+p}));var d="message_".concat(r+=1);s=Object.assign(Object.assign({},s),{offsetX:l,offsetY:u,id:d});var m=document.createElement("div"),y=(0,e.createVNode)(o,s);y.props.onDestroy=function(t){!function(e,t,r,o){null==o||o();var i=t.startsWith("top")?"top":"bottom",s=-1;n[t].forEach((function(t,n){t.props.id===e&&(s=n)}));for(var a=n[t][s].el.offsetHeight,c=n[t].length,l=s;l<c;l++){var u=parseInt(n[t][l].el.style[i],10)-a-r;n[t][l].component.props.offsetY=u}n[t].splice(s,1)}(t,a,p,c),(0,e.render)(null,m)},(0,e.render)(y,m),n[a].push(y),(y.props.getContainer&&(0,t.isElement)(y.props.getContainer)?y.props.getContainer:document.body).appendChild(m.firstElementChild)}(S,o)}})(),c})()));
|
package/lib/message/message.less
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
box-shadow: 0px 2px 4px 0px @message-primary-shadow-color;
|
17
17
|
justify-content: space-between;
|
18
18
|
|
19
|
-
|
19
|
+
.@{bk-prefix}-message-close {
|
20
20
|
padding-left: 20px;
|
21
21
|
margin-right: 0;
|
22
22
|
font-size: 14px;
|
@@ -135,14 +135,14 @@
|
|
135
135
|
color: #3a84ff;
|
136
136
|
}
|
137
137
|
}
|
138
|
-
|
138
|
+
|
139
139
|
&.fix {
|
140
140
|
&.fixed {
|
141
141
|
span {
|
142
142
|
color: #3a84ff;
|
143
143
|
}
|
144
144
|
}
|
145
|
-
|
145
|
+
|
146
146
|
span {
|
147
147
|
color: #979ba5;
|
148
148
|
}
|
@@ -135,7 +135,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
135
135
|
styles: import("vue").ComputedRef<{
|
136
136
|
top: string;
|
137
137
|
zIndex: number;
|
138
|
-
position: "
|
138
|
+
position: "absolute" | "fixed";
|
139
139
|
width: string | number;
|
140
140
|
}>;
|
141
141
|
visible: import("vue").Ref<boolean>;
|
@@ -161,6 +161,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
161
161
|
copySuccess: string;
|
162
162
|
copyFailed: string;
|
163
163
|
}>;
|
164
|
+
resolveClassName: (cls: string) => string;
|
164
165
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "destroy"[], "destroy", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
165
166
|
id: import("vue-types").VueTypeValidableDef<string> & {
|
166
167
|
default: string;
|
package/lib/modal/index.d.ts
CHANGED
@@ -9,7 +9,6 @@ declare const BkModal: {
|
|
9
9
|
};
|
10
10
|
$props: {
|
11
11
|
title?: string;
|
12
|
-
transfer?: string | boolean | HTMLElement;
|
13
12
|
width?: string | number;
|
14
13
|
height?: string | number;
|
15
14
|
maxHeight?: string;
|
@@ -17,6 +16,7 @@ declare const BkModal: {
|
|
17
16
|
isShow?: boolean;
|
18
17
|
zIndex?: string | number;
|
19
18
|
draggable?: boolean;
|
19
|
+
transfer?: string | boolean | HTMLElement;
|
20
20
|
showMask?: boolean;
|
21
21
|
multiInstance?: boolean;
|
22
22
|
direction?: string;
|
@@ -72,7 +72,7 @@ declare const BkModal: {
|
|
72
72
|
[key: string]: any;
|
73
73
|
}>) => void)[];
|
74
74
|
readonly size?: "small" | "medium" | "large" | "normal";
|
75
|
-
readonly dialogType?: "
|
75
|
+
readonly dialogType?: "show" | "process" | "operation" | "confirm";
|
76
76
|
onClose?: (...args: any[]) => any;
|
77
77
|
onShown?: (...args: any[]) => any;
|
78
78
|
onHidden?: (...args: any[]) => any;
|
@@ -173,7 +173,7 @@ declare const BkModal: {
|
|
173
173
|
default: "show" | "if";
|
174
174
|
};
|
175
175
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
176
|
-
dialogType: import("vue-types").VueTypeDef<"
|
176
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "process" | "operation" | "confirm">;
|
177
177
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
178
178
|
default: boolean;
|
179
179
|
} & {
|
@@ -199,7 +199,6 @@ declare const BkModal: {
|
|
199
199
|
handleClickOutSide(): void;
|
200
200
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "shown" | "hidden" | "quick-close" | "quickClose")[], string, {
|
201
201
|
title: string;
|
202
|
-
transfer: string | boolean | HTMLElement;
|
203
202
|
width: string | number;
|
204
203
|
height: string | number;
|
205
204
|
maxHeight: string;
|
@@ -207,6 +206,7 @@ declare const BkModal: {
|
|
207
206
|
isShow: boolean;
|
208
207
|
zIndex: string | number;
|
209
208
|
draggable: boolean;
|
209
|
+
transfer: string | boolean | HTMLElement;
|
210
210
|
showMask: boolean;
|
211
211
|
multiInstance: boolean;
|
212
212
|
direction: string;
|
@@ -316,7 +316,7 @@ declare const BkModal: {
|
|
316
316
|
default: "show" | "if";
|
317
317
|
};
|
318
318
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
319
|
-
dialogType: import("vue-types").VueTypeDef<"
|
319
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "process" | "operation" | "confirm">;
|
320
320
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
321
321
|
default: boolean;
|
322
322
|
} & {
|
@@ -423,7 +423,7 @@ declare const BkModal: {
|
|
423
423
|
default: "show" | "if";
|
424
424
|
};
|
425
425
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
426
|
-
dialogType: import("vue-types").VueTypeDef<"
|
426
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "process" | "operation" | "confirm">;
|
427
427
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
428
428
|
default: boolean;
|
429
429
|
} & {
|
@@ -449,7 +449,6 @@ declare const BkModal: {
|
|
449
449
|
handleClickOutSide(): void;
|
450
450
|
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "shown" | "hidden" | "quick-close" | "quickClose")[], "close" | "shown" | "hidden" | "quick-close" | "quickClose", {
|
451
451
|
title: string;
|
452
|
-
transfer: string | boolean | HTMLElement;
|
453
452
|
width: string | number;
|
454
453
|
height: string | number;
|
455
454
|
maxHeight: string;
|
@@ -457,6 +456,7 @@ declare const BkModal: {
|
|
457
456
|
isShow: boolean;
|
458
457
|
zIndex: string | number;
|
459
458
|
draggable: boolean;
|
459
|
+
transfer: string | boolean | HTMLElement;
|
460
460
|
showMask: boolean;
|
461
461
|
multiInstance: boolean;
|
462
462
|
direction: string;
|
@@ -547,7 +547,7 @@ declare const BkModal: {
|
|
547
547
|
default: "show" | "if";
|
548
548
|
};
|
549
549
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
550
|
-
dialogType: import("vue-types").VueTypeDef<"
|
550
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "process" | "operation" | "confirm">;
|
551
551
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
552
552
|
default: boolean;
|
553
553
|
} & {
|
package/lib/modal/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("../shared"),require("vue"),require("vue-types"));else if("function"==typeof define&&define.amd)define(["../shared","vue","vue-types"],o);else{var
|
1
|
+
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("../shared"),require("vue"),require("../config-provider"),require("vue-types"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","vue-types"],o);else{var i="object"==typeof exports?o(require("../shared"),require("vue"),require("../config-provider"),require("vue-types")):o(e["../shared"],e.vue,e["../config-provider"],e["vue-types"]);for(var t in i)("object"==typeof exports?exports:e)[t]=i[t]}}(self,((e,o,i,t)=>(()=>{"use strict";var s={2717:e=>{e.exports=i},4212:o=>{o.exports=e},748:e=>{e.exports=o},210:e=>{e.exports=t}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return s[e](i,i.exports,n),i.exports}n.d=(e,o)=>{for(var i in o)n.o(o,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},n.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{n.r(l),n.d(l,{BkModal:()=>a,default:()=>c,propsMixin:()=>r});var e,o=n(4212),i=n(748),t=n(2717),s=n(210);!function(e){e.NORMAL="normal",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large"}(e||(e={}));var r={isShow:o.PropTypes.bool.def(!1),width:o.PropTypes.oneOfType([String,Number]).def("50%"),height:o.PropTypes.oneOfType([String,Number]).def("50%"),extCls:o.PropTypes.string||o.PropTypes.array,scrollable:o.PropTypes.bool.def(!0),showMask:o.PropTypes.bool.def(!0),closeIcon:o.PropTypes.bool.def(!0),escClose:o.PropTypes.bool.def(!0),fullscreen:o.PropTypes.bool.def(!1),size:(0,s.toType)("size",{}),draggable:o.PropTypes.bool.def(!0),quickClose:o.PropTypes.bool.def(!0),transfer:o.PropTypes.oneOfType([Boolean,String,HTMLElement]).def(!1),zIndex:o.PropTypes.oneOfType([String,Number]).def("inherit"),maxHeight:o.PropTypes.string,direction:o.PropTypes.string,title:o.PropTypes.string.def(""),animateType:o.PropTypes.string.def("slide"),renderDirective:(0,o.renderDirectiveType)(),beforeClose:o.PropTypes.custom((function(){return!0})),dialogType:(0,o.dialogTypeUnion)(),multiInstance:o.PropTypes.bool.def(!0),infoType:o.PropTypes.theme()};const d=(0,i.defineComponent)({name:"Modal",props:Object.assign({},r),emits:["quick-close","quickClose","hidden","shown","close"],data:function(){return{visible:!1,closeTimer:null,bkPopIndexManager:null}},computed:{dialogWidth:function(){return/^\d+\.?\d*$/.test("".concat(this.width))?"".concat(this.width,"px"):this.width},dialogHeight:function(){return/^\d+\.?\d*$/.test("".concat(this.height))?"".concat(this.height,"px"):this.height},compStyle:function(){return{width:this.dialogWidth,height:this.dialogHeight,minHeigth:"".concat(200,"px"),display:this.visible?"inherit":"none",zIndex:this.zIndex||"inherit"}},fullscreenStyle:function(){return{width:"".concat(100,"%"),height:"".concat(100,"%")}}},watch:{isShow:{handler:function(e){var o=this;e?(this.closeTimer&&clearTimeout(this.closeTimer),this.closeTimer=null,this.visible=e):this.closeTimer=setTimeout((function(){o.$emit("hidden"),o.visible=e}),250)},immediate:!0},visible:{handler:function(e){var o,i,t=this;e?this.$nextTick((function(){t.bkPopIndexManager.onMaskClick((function(e){t.handleClickOutSide()}),t.$el);var e=t.showMask?{}:{"background-color":"rgba(0,0,0,0)"};t.bkPopIndexManager.show(t.$el,t.showMask,e,!!t.transfer,t.zIndex),t.$emit("shown")})):(null===(o=this.bkPopIndexManager)||void 0===o||o.hide(this.$el,!!this.transfer),null===(i=this.bkPopIndexManager)||void 0===i||i.destroy())},immediate:!0}},created:function(){},mounted:function(){var e,i=Object.assign(Object.assign({},this.$props),{transfer:"parent"===this.transfer?null===(e=this.$el)||void 0===e?void 0:e.parentElement:this.transfer});this.bkPopIndexManager=new o.BKPopIndexManager(i)},beforeUnmount:function(){var e,o;this.visible&&(null===(e=this.bkPopIndexManager)||void 0===e||e.hide(this.$el),null===(o=this.bkPopIndexManager)||void 0===o||o.destroy())},methods:{handleClickOutSide:function(){this.quickClose&&(this.$emit("close"),this.$emit("quick-close",this.$el),this.$emit("quickClose",this.$el))}},render:function(){var e,o,s,r,n,l,d,a,c,p,h,u,f=this,v=(0,t.usePrefix)().resolveClassName,y=this.maxHeight?{maxHeight:this.maxHeight}:{},m="".concat(v("modal-body")," ").concat("slide"===this.animateType?this.direction:"");return(0,i.createVNode)("div",{class:[v("modal-wrapper"),this.extCls,this.size,this.fullscreen?"fullscreen":""],style:[this.compStyle,this.fullscreen?this.fullscreenStyle:""]},[(0,i.createVNode)(i.Transition,{name:this.animateType},{default:function(){return[f.isShow?(0,i.createVNode)("div",{class:m},[(0,i.createVNode)("div",{class:v("modal-header")},[null!==(s=null===(o=(e=f.$slots).header)||void 0===o?void 0:o.call(e))&&void 0!==s?s:""]),(0,i.createVNode)("div",{class:v("modal-content"),style:["show"===f.dialogType?"padding-bottom: 20px":"",Object.assign({},y)]},[null!==(l=null===(n=(r=f.$slots).default)||void 0===n?void 0:n.call(r))&&void 0!==l?l:""]),"show"===f.dialogType?"":(0,i.createVNode)("div",{class:v("modal-footer")},[null!==(c=null===(a=(d=f.$slots).footer)||void 0===a?void 0:a.call(d))&&void 0!==c?c:""]),(0,i.createVNode)("div",{class:[v("modal-close"),f.closeIcon?"":"close-icon"]},[null!==(u=null===(h=(p=f.$slots).close)||void 0===h?void 0:h.call(p))&&void 0!==u?u:""])]):""]}})])}});var a=(0,o.withInstallProps)(d,{propsMixin:r},!0);const c=a})(),l})()));
|
package/lib/modal/modal.d.ts
CHANGED
@@ -77,7 +77,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
77
77
|
default: "show" | "if";
|
78
78
|
};
|
79
79
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
80
|
-
dialogType: import("vue-types").VueTypeDef<"
|
80
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "process" | "operation" | "confirm">;
|
81
81
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
82
82
|
default: boolean;
|
83
83
|
} & {
|
@@ -174,7 +174,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
174
174
|
default: "show" | "if";
|
175
175
|
};
|
176
176
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
177
|
-
dialogType: import("vue-types").VueTypeDef<"
|
177
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "process" | "operation" | "confirm">;
|
178
178
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
179
179
|
default: boolean;
|
180
180
|
} & {
|
@@ -189,7 +189,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
189
189
|
onQuickClose?: (...args: any[]) => any;
|
190
190
|
}, {
|
191
191
|
title: string;
|
192
|
-
transfer: string | boolean | HTMLElement;
|
193
192
|
width: string | number;
|
194
193
|
height: string | number;
|
195
194
|
maxHeight: string;
|
@@ -197,6 +196,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
197
196
|
isShow: boolean;
|
198
197
|
zIndex: string | number;
|
199
198
|
draggable: boolean;
|
199
|
+
transfer: string | boolean | HTMLElement;
|
200
200
|
showMask: boolean;
|
201
201
|
multiInstance: boolean;
|
202
202
|
direction: string;
|
@@ -77,7 +77,7 @@ export declare const propsMixin: {
|
|
77
77
|
default: "show" | "if";
|
78
78
|
};
|
79
79
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
80
|
-
dialogType: import("vue-types").VueTypeDef<"
|
80
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "process" | "operation" | "confirm">;
|
81
81
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
82
82
|
default: boolean;
|
83
83
|
} & {
|
@@ -118,11 +118,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
118
118
|
onDestroy?: (...args: any[]) => any;
|
119
119
|
}, {
|
120
120
|
title: string;
|
121
|
-
message: any;
|
122
121
|
extCls: string;
|
123
122
|
theme: "error" | "success" | "warning" | "primary";
|
124
123
|
id: string;
|
125
124
|
position: string;
|
125
|
+
message: any;
|
126
126
|
onClose: (...args: any[]) => any;
|
127
127
|
delay: number;
|
128
128
|
offsetX: number;
|
@@ -3,8 +3,8 @@ declare const BkPagination: {
|
|
3
3
|
$: import("vue").ComponentInternalInstance;
|
4
4
|
$data: {};
|
5
5
|
$props: {
|
6
|
-
small?: boolean;
|
7
6
|
type?: string;
|
7
|
+
small?: boolean;
|
8
8
|
disabled?: boolean;
|
9
9
|
layout?: string[];
|
10
10
|
location?: string;
|
@@ -63,7 +63,7 @@ declare const BkPagination: {
|
|
63
63
|
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
64
64
|
[key: string]: any;
|
65
65
|
}>) => void)[];
|
66
|
-
readonly size?: "
|
66
|
+
readonly size?: "default" | "small" | "large";
|
67
67
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
68
68
|
"onUpdate:limit"?: (...args: any[]) => any;
|
69
69
|
onLimitChange?: (...args: any[]) => any;
|
@@ -116,7 +116,7 @@ declare const BkPagination: {
|
|
116
116
|
align: import("vue-types").VueTypeDef<string> & {
|
117
117
|
default: string;
|
118
118
|
};
|
119
|
-
size: import("vue-types").VueTypeDef<"
|
119
|
+
size: import("vue-types").VueTypeDef<"default" | "small" | "large">;
|
120
120
|
small: import("vue-types").VueTypeValidableDef<boolean> & {
|
121
121
|
default: boolean;
|
122
122
|
} & {
|
@@ -166,8 +166,8 @@ declare const BkPagination: {
|
|
166
166
|
renderSmallList: () => JSX.Element;
|
167
167
|
resolveClassName: (cls: string) => string;
|
168
168
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:limit" | "limitChange")[], string, {
|
169
|
-
small: boolean;
|
170
169
|
type: string;
|
170
|
+
small: boolean;
|
171
171
|
disabled: boolean;
|
172
172
|
layout: string[];
|
173
173
|
location: string;
|
@@ -236,7 +236,7 @@ declare const BkPagination: {
|
|
236
236
|
align: import("vue-types").VueTypeDef<string> & {
|
237
237
|
default: string;
|
238
238
|
};
|
239
|
-
size: import("vue-types").VueTypeDef<"
|
239
|
+
size: import("vue-types").VueTypeDef<"default" | "small" | "large">;
|
240
240
|
small: import("vue-types").VueTypeValidableDef<boolean> & {
|
241
241
|
default: boolean;
|
242
242
|
} & {
|
@@ -324,7 +324,7 @@ declare const BkPagination: {
|
|
324
324
|
align: import("vue-types").VueTypeDef<string> & {
|
325
325
|
default: string;
|
326
326
|
};
|
327
|
-
size: import("vue-types").VueTypeDef<"
|
327
|
+
size: import("vue-types").VueTypeDef<"default" | "small" | "large">;
|
328
328
|
small: import("vue-types").VueTypeValidableDef<boolean> & {
|
329
329
|
default: boolean;
|
330
330
|
} & {
|
@@ -374,8 +374,8 @@ declare const BkPagination: {
|
|
374
374
|
renderSmallList: () => JSX.Element;
|
375
375
|
resolveClassName: (cls: string) => string;
|
376
376
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "update:limit" | "limitChange")[], "change" | "update:modelValue" | "update:limit" | "limitChange", {
|
377
|
-
small: boolean;
|
378
377
|
type: string;
|
378
|
+
small: boolean;
|
379
379
|
disabled: boolean;
|
380
380
|
layout: string[];
|
381
381
|
location: string;
|
package/lib/pagination/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../select"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../select","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../select"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,e["../config-provider"],e["../select"],e["../icon"],e["../popover"]);for(var a in n)("object"==typeof exports?exports:e)[a]=n[a]}}(self,((e,t,n,a,r,o)=>(()=>{"use strict";var i={2717:e=>{e.exports=n},6870:e=>{e.exports=r},5537:e=>{e.exports=o},6422:e=>{e.exports=a},4212:t=>{t.exports=e},748:e=>{e.exports=t}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return i[e](n,n.exports,u),n.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 c={};return(()=>{u.r(c),u.d(c,{BkPagination:()=>g,default:()=>y});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 n(e,n,a){return(n=function(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,"string");if("object"!==t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,i,l=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(a=o.call(n)).done)&&(l.push(a.value),l.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var o=u(748),i=u(2717),l=u(6422),s=u.n(l),f=u(6870),d=u(5537),v=u.n(d);var p={modelValue:e.PropTypes.number.def(1),count:e.PropTypes.number.def(0).isRequired,limit:e.PropTypes.number.def(10),limitList:e.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:e.PropTypes.bool.def(!0),type:e.PropTypes.oneOf(["default","compact"]).def("default"),location:e.PropTypes.oneOf(["left","right"]).def("right"),align:e.PropTypes.oneOf(["left","center","right"]).def("left"),size:e.PropTypes.size(),small:e.PropTypes.bool.def(!1),showTotalCount:e.PropTypes.bool.def(!0),prevText:e.PropTypes.string,nextText:e.PropTypes.string,disabled:e.PropTypes.bool.def(!1),beforeChange:e.PropTypes.func,layout:e.PropTypes.custom((function(e){var t={total:!0,list:!0,limit:!0};return e.some((function(e){return t[e]}))}),"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])};const m=(0,o.defineComponent)({name:"Pagination",props:p,emits:["update:modelValue","change","update:limit","limitChange"],setup:function(e,t){var a=(0,i.useLocale)("pagination"),u=(0,o.ref)(0),c=(0,o.toRefs)(e),d=c.count,p=c.limit,m=function(e){return function(t){var a,r=t.isFirst,l=t.isLast,u=(0,o.getCurrentInstance)().props;if(!u.showTotalCount)return null;var c=(0,i.usePrefix)().resolveClassName;return(0,o.createVNode)("div",(0,o.mergeProps)({class:(a={},n(a,"".concat(c("pagination-total")),!0),n(a,"is-first",r),n(a,"is-last",l),a)},{disabled:u.disabled}),[e.value.total,(0,o.createVNode)("div",{class:"".concat(c("pagination-total-num"))},[u.count]),e.value.strip])}}(a),g=function(){var e=(0,o.getCurrentInstance)().proxy,t=(0,o.ref)(1),a=(0,o.computed)((function(){return 1===t.value})),r=(0,o.computed)((function(){return t.value===e.totalPageNum})),l=(0,o.ref)(!1),u=(0,o.ref)(!1),c=(0,o.computed)((function(){l.value=!1,u.value=!1;var n=[];if(e.totalPageNum<=7){for(var a=2;a<=e.totalPageNum-1;a++)n.push(a);return n}var r=Math.floor(2.5);e.totalPageNum>5&&(l.value=t.value-r>2,u.value=t.value+r<e.totalPageNum-1);for(var o=Math.min(e.totalPageNum-5,Math.max(2,t.value-r)),i=o;i<o+5;i++)n.push(i);return n}));(0,o.watch)((function(){return e.modelValue}),(function(n){(0,o.nextTick)((function(){n>=1&&n<=e.totalPageNum?t.value=n:t.value=n<1?1:e.totalPageNum}))}),{immediate:!0}),(0,o.nextTick)((function(){(0,o.watch)((function(){return e.totalPageNum}),(function(e){t.value>e&&(t.value=e)}))}));var s=function(){a.value||(t.value=t.value-1)},d=function(){r.value||(t.value=t.value+1)},v=function(e){e!==t.value&&(t.value=e)},p=function(){t.value=Math.max(1,t.value-5)},m=function(){t.value=Math.min(e.totalPageNum,t.value+5)},g=(0,i.usePrefix)().resolveClassName;return{current:t,render:function(i){var y,b,h,N,P,x=i.isFirst,V=i.isLast;return(0,o.createVNode)("div",{class:(y={},n(y,"".concat(g("pagination-list")),!0),n(y,"is-first",x),n(y,"is-last",V),y)},[(0,o.createVNode)("div",{class:(b={},n(b,"".concat(g("pagination-list-pre")),!0),n(b,"is-disabled",a.value),b),onClick:s},[e.prevText||(0,o.createVNode)(f.AngleLeft,null,null)]),(0,o.createVNode)("div",{class:(h={},n(h,"".concat(g("pagination-list-item")),!0),n(h,"is-active",1===t.value),h),key:"1",onClick:function(){return v(1)}},[(0,o.createTextVNode)("1")]),l.value&&(0,o.createVNode)("div",{key:"pre-batch",class:"".concat(g("pagination-list-pre-batch")),onClick:p},[(0,o.createVNode)(f.Ellipsis,null,null)]),c.value.map((function(e){var a;return(0,o.createVNode)("div",{class:(a={},n(a,"".concat(g("pagination-list-item")),!0),n(a,"is-active",t.value===e),a),key:e,onClick:function(){return v(e)}},[e])})),u.value&&(0,o.createVNode)("div",{key:"next-batch",class:"".concat(g("pagination-list-next-batch")),onClick:m},[(0,o.createVNode)(f.Ellipsis,null,null)]),e.totalPageNum>1&&(0,o.createVNode)("div",{class:(N={},n(N,"".concat(g("pagination-list-item")),!0),n(N,"is-active",t.value===e.totalPageNum),N),key:"last",onClick:function(){return v(e.totalPageNum)}},[e.totalPageNum]),(0,o.createVNode)("div",{class:(P={},n(P,"".concat(g("pagination-list-pre")),!0),n(P,"is-disabled",r.value),P),onClick:d},[e.nextText||(0,o.createVNode)(f.AngleRight,null,null)])])}}}(),y=g.current,b=g.render,h=function(){var e=(0,o.getCurrentInstance)().proxy,t=(0,o.ref)(null),a=(0,o.ref)(!1),r=(0,o.ref)(1),l=(0,o.computed)((function(){return 1===r.value})),u=(0,o.computed)((function(){return r.value===e.totalPageNum})),c=0,s=(0,o.computed)((function(){for(var t=[],n=1;n<=e.totalPageNum;n++)t.push(n);return t}));(0,o.watch)((function(){return e.modelValue}),(function(t){(0,o.nextTick)((function(){t>=1&&t<=e.totalPageNum?r.value=t:r.value=t<1?1:e.totalPageNum,c=r.value}))}),{immediate:!0}),(0,o.nextTick)((function(){(0,o.watch)((function(){return e.totalPageNum}),(function(e){r.value>e&&(r.value=e)}))}));var d=function(){l.value||(r.value=r.value-1)},p=function(){u.value||(r.value=r.value+1)},m=function(){a.value=!0},g=function(){a.value=!1,t.value.textContent="".concat(c),c!==r.value&&(r.value=c)},y=function(t){var n=t.target,a=Number(n.textContent);!a||a<1||a>e.totalPageNum||a===r.value||(c=a)},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),g())},h=(0,i.usePrefix)().resolveClassName;return{current:r,render:function(){var i,N;return(0,o.createVNode)("div",{class:"bk-pagination-small-list"},[(0,o.createVNode)("div",{class:(i={},n(i,"".concat(h("pagination-btn-pre")),!0),n(i,"is-disabled",l.value),i),onClick:d},[(0,o.createVNode)(f.AngleLeft,null,null)]),(0,o.createVNode)(v(),{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:function(){var i;return(0,o.createVNode)("div",{class:(i={},n(i,"".concat(h("pagination-picker")),!0),n(i,"is-focused",a.value),i)},[(0,o.createVNode)("span",{ref:t,class:"".concat(h("pagination-editor")),contenteditable:!0,spellcheck:"false",onFocus:m,onBlur:g,onInput:y,onKeydown:b},[r.value]),(0,o.createVNode)("span",null,[(0,o.createTextVNode)("/")]),(0,o.createVNode)("span",{class:"".concat(h("pagination-small-list-total"))},[e.totalPageNum])])},content:function(){return(0,o.createVNode)("div",{class:"".concat(h("pagination-picker-list"))},[s.value.map((function(e){return(0,o.createVNode)("div",{class:{item:!0,"is-actived":e===r.value},key:e,onClick:function(){return function(e){c=e,g()}(e)}},[e])}))])}}),(0,o.createVNode)("div",{class:(N={},n(N,"".concat(h("pagination-btn-next")),!0),n(N,"is-disabled",u.value),N),onClick:p},[(0,o.createVNode)(f.AngleRight,null,null)])])}}}(),N=h.current,P=h.render,x=function(e){var t=(0,o.getCurrentInstance)().proxy,a=(0,o.ref)(t.limit);(0,o.watch)((function(){return t.limit}),(function(e){a.value=e})),(0,o.watch)((function(){return t.limitList}),(function(e){(0,o.nextTick)((function(){if(!e.includes(a.value)){var t=r(e,1);a.value=t[0]}}))}),{immediate:!0});var u=function(e){a.value=e},c=(0,i.usePrefix)().resolveClassName;return{limit:a,render:function(r){var i,f,d,v=r.isFirst,p=r.isLast;return t.showLimit?(0,o.createVNode)("div",(0,o.mergeProps)({class:(f={},n(f,c("pagination-limit"),!0),n(f,"is-first",v),n(f,"is-last",p),f)},{disabled:t.disabled}),[(0,o.createVNode)("div",null,[e.value.eachPage]),(0,o.createVNode)(s(),{class:"".concat(c("pagination-limit-select")),clearable:!1,size:"small",withValidate:!1,modelValue:a.value,onChange:u,disabled:t.disabled},(d=i=t.limitList.map((function(e,t){return(0,o.createVNode)(l.BkOption,{id:e,name:"".concat(e),key:"".concat(t,"_").concat(e)},null)})),"function"==typeof d||"[object Object]"===Object.prototype.toString.call(d)&&!(0,o.isVNode)(d)?i:{default:function(){return[i]}})),(0,o.createVNode)("div",null,[e.value.strip])]):null}}}(a),V=x.limit,T=x.render;(0,o.watch)([d,V,p],(function(e){var t=r(e,2),n=t[0],a=t[1],o=Math.ceil(n/a);u.value=o<1?1:o}),{immediate:!0}),(0,o.watch)(y,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),(0,o.watch)(N,(function(n){e.small&&(t.emit("update:modelValue",n),t.emit("change",n))})),(0,o.watch)(V,(function(e){t.emit("limitChange",e)}));var C=(0,i.usePrefix)().resolveClassName;return{totalPageNum:u,renderTotal:m,renderList:b,renderLimit:T,renderSmallList:P,resolveClassName:C}},render:function(){var t,a=this,r=(0,e.classes)((n(t={},"".concat(this.resolveClassName("pagination")),!0),n(t,"".concat(this.resolveClassName("pagination--".concat(this.size))),!0),n(t,"is-align-".concat(this.align),!0),t)),i={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return(0,o.createVNode)("div",{class:r},[this.layout.map((function(e,t){return i[e]({isFirst:0===t,isLast:t===a.layout.length-1})}))])}});var g=(0,e.withInstall)(m);const y=g})(),c})()));
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../select"),require("../icon"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../select","../icon","../popover"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../select"),require("../icon"),require("../popover")):t(e["../shared"],e.vue,e["../config-provider"],e["../select"],e["../icon"],e["../popover"]);for(var a in n)("object"==typeof exports?exports:e)[a]=n[a]}}(self,((e,t,n,a,r,o)=>(()=>{"use strict";var i={2717:e=>{e.exports=n},6870:e=>{e.exports=r},5537:e=>{e.exports=o},6422:e=>{e.exports=a},4212:t=>{t.exports=e},748:e=>{e.exports=t}},l={};function u(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return i[e](n,n.exports,u),n.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 c={};return(()=>{u.r(c),u.d(c,{BkPagination:()=>g,default:()=>y});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 n(e,n,a){return(n=function(e){var n=function(e,n){if("object"!==t(e)||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var r=a.call(e,"string");if("object"!==t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(n)?n:String(n)}(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,i,l=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(a=o.call(n)).done)&&(l.push(a.value),l.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var o=u(748),i=u(2717),l=u(6422),s=u.n(l),f=u(6870),d=u(5537),v=u.n(d);var p={modelValue:e.PropTypes.number.def(1),count:e.PropTypes.number.def(0).isRequired,limit:e.PropTypes.number.def(10),limitList:e.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:e.PropTypes.bool.def(!0),type:e.PropTypes.oneOf(["default","compact"]).def("default"),location:e.PropTypes.oneOf(["left","right"]).def("right"),align:e.PropTypes.oneOf(["left","center","right"]).def("left"),size:e.PropTypes.size(),small:e.PropTypes.bool.def(!1),showTotalCount:e.PropTypes.bool.def(!0),prevText:e.PropTypes.string,nextText:e.PropTypes.string,disabled:e.PropTypes.bool.def(!1),beforeChange:e.PropTypes.func,layout:e.PropTypes.custom((function(e){var t={total:!0,list:!0,limit:!0};return e.some((function(e){return t[e]}))}),"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])};const m=(0,o.defineComponent)({name:"Pagination",props:p,emits:["update:modelValue","change","update:limit","limitChange"],setup:function(e,t){var a=(0,i.useLocale)("pagination"),u=(0,o.ref)(0),c=(0,o.toRefs)(e),d=c.count,p=c.limit,m=function(e){return function(t){var a,r=t.isFirst,l=t.isLast,u=(0,o.getCurrentInstance)().props;if(!u.showTotalCount)return null;var c=(0,i.usePrefix)().resolveClassName;return(0,o.createVNode)("div",(0,o.mergeProps)({class:(a={},n(a,"".concat(c("pagination-total")),!0),n(a,"is-first",r),n(a,"is-last",l),a)},{disabled:u.disabled}),[e.value.total,(0,o.createVNode)("div",{class:"".concat(c("pagination-total-num"))},[u.count]),e.value.strip])}}(a),g=function(){var e=(0,o.getCurrentInstance)().proxy,t=(0,o.ref)(1),a=(0,o.computed)((function(){return 1===t.value})),r=(0,o.computed)((function(){return t.value===e.totalPageNum})),l=(0,o.ref)(!1),u=(0,o.ref)(!1),c=(0,o.computed)((function(){l.value=!1,u.value=!1;var n=[];if(e.totalPageNum<=7){for(var a=2;a<=e.totalPageNum-1;a++)n.push(a);return n}var r=Math.floor(2.5);e.totalPageNum>5&&(l.value=t.value-r>2,u.value=t.value+r<e.totalPageNum-1);for(var o=Math.min(e.totalPageNum-5,Math.max(2,t.value-r)),i=o;i<o+5;i++)n.push(i);return n}));(0,o.watch)((function(){return e.modelValue}),(function(n){(0,o.nextTick)((function(){n>=1&&n<=e.totalPageNum?t.value=n:t.value=n<1?1:e.totalPageNum}))}),{immediate:!0}),(0,o.nextTick)((function(){(0,o.watch)((function(){return e.totalPageNum}),(function(e){t.value>e&&(t.value=e)}))}));var s=function(){a.value||(t.value=t.value-1)},d=function(){r.value||(t.value=t.value+1)},v=function(e){e!==t.value&&(t.value=e)},p=function(){t.value=Math.max(1,t.value-5)},m=function(){t.value=Math.min(e.totalPageNum,t.value+5)},g=(0,i.usePrefix)().resolveClassName;return{current:t,render:function(i){var y,b,h,N,P,x=i.isFirst,V=i.isLast;return(0,o.createVNode)("div",{class:(y={},n(y,"".concat(g("pagination-list")),!0),n(y,"is-first",x),n(y,"is-last",V),y)},[(0,o.createVNode)("div",{class:(b={},n(b,"".concat(g("pagination-list-pre")),!0),n(b,"is-disabled",a.value),b),onClick:s},[e.prevText||(0,o.createVNode)(f.AngleLeft,null,null)]),(0,o.createVNode)("div",{class:(h={},n(h,"".concat(g("pagination-list-item")),!0),n(h,"is-active",1===t.value),h),key:"1",onClick:function(){return v(1)}},[(0,o.createTextVNode)("1")]),l.value&&(0,o.createVNode)("div",{key:"pre-batch",class:"".concat(g("pagination-list-pre-batch")),onClick:p},[(0,o.createVNode)(f.Ellipsis,null,null)]),c.value.map((function(e){var a;return(0,o.createVNode)("div",{class:(a={},n(a,"".concat(g("pagination-list-item")),!0),n(a,"is-active",t.value===e),a),key:e,onClick:function(){return v(e)}},[e])})),u.value&&(0,o.createVNode)("div",{key:"next-batch",class:"".concat(g("pagination-list-next-batch")),onClick:m},[(0,o.createVNode)(f.Ellipsis,null,null)]),e.totalPageNum>1&&(0,o.createVNode)("div",{class:(N={},n(N,"".concat(g("pagination-list-item")),!0),n(N,"is-active",t.value===e.totalPageNum),N),key:"last",onClick:function(){return v(e.totalPageNum)}},[e.totalPageNum]),(0,o.createVNode)("div",{class:(P={},n(P,"".concat(g("pagination-list-pre")),!0),n(P,"is-disabled",r.value),P),onClick:d},[e.nextText||(0,o.createVNode)(f.AngleRight,null,null)])])}}}(),y=g.current,b=g.render,h=function(){var e=(0,o.getCurrentInstance)().proxy,t=(0,o.ref)(null),a=(0,o.ref)(!1),r=(0,o.ref)(1),l=(0,o.computed)((function(){return 1===r.value})),u=(0,o.computed)((function(){return r.value===e.totalPageNum})),c=0,s=(0,o.computed)((function(){for(var t=[],n=1;n<=e.totalPageNum;n++)t.push(n);return t}));(0,o.watch)((function(){return e.modelValue}),(function(t){(0,o.nextTick)((function(){t>=1&&t<=e.totalPageNum?r.value=t:r.value=t<1?1:e.totalPageNum,c=r.value}))}),{immediate:!0}),(0,o.nextTick)((function(){(0,o.watch)((function(){return e.totalPageNum}),(function(e){r.value>e&&(r.value=e)}))}));var d=function(){l.value||(r.value=r.value-1)},p=function(){u.value||(r.value=r.value+1)},m=function(){a.value=!0},g=function(){a.value=!1,t.value.textContent="".concat(c),c!==r.value&&(r.value=c)},y=function(t){var n=t.target,a=Number(n.textContent);!a||a<1||a>e.totalPageNum||a===r.value||(c=a)},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),g())},h=(0,i.usePrefix)().resolveClassName;return{current:r,render:function(){var i,N;return(0,o.createVNode)("div",{class:"".concat(h("pagination-small-list"))},[(0,o.createVNode)("div",{class:(i={},n(i,"".concat(h("pagination-btn-pre")),!0),n(i,"is-disabled",l.value),i),onClick:d},[(0,o.createVNode)(f.AngleLeft,null,null)]),(0,o.createVNode)(v(),{theme:"light",trigger:"click",arrow:!1,width:56,boundary:"body",placement:"bottom"},{default:function(){var i;return(0,o.createVNode)("div",{class:(i={},n(i,"".concat(h("pagination-picker")),!0),n(i,"is-focused",a.value),i)},[(0,o.createVNode)("span",{ref:t,class:"".concat(h("pagination-editor")),contenteditable:!0,spellcheck:"false",onFocus:m,onBlur:g,onInput:y,onKeydown:b},[r.value]),(0,o.createVNode)("span",null,[(0,o.createTextVNode)("/")]),(0,o.createVNode)("span",{class:"".concat(h("pagination-small-list-total"))},[e.totalPageNum])])},content:function(){return(0,o.createVNode)("div",{class:"".concat(h("pagination-picker-list"))},[s.value.map((function(e){return(0,o.createVNode)("div",{class:{item:!0,"is-actived":e===r.value},key:e,onClick:function(){return function(e){c=e,g()}(e)}},[e])}))])}}),(0,o.createVNode)("div",{class:(N={},n(N,"".concat(h("pagination-btn-next")),!0),n(N,"is-disabled",u.value),N),onClick:p},[(0,o.createVNode)(f.AngleRight,null,null)])])}}}(),N=h.current,P=h.render,x=function(e){var t=(0,o.getCurrentInstance)().proxy,a=(0,o.ref)(t.limit);(0,o.watch)((function(){return t.limit}),(function(e){a.value=e})),(0,o.watch)((function(){return t.limitList}),(function(e){(0,o.nextTick)((function(){if(!e.includes(a.value)){var t=r(e,1);a.value=t[0]}}))}),{immediate:!0});var u=function(e){a.value=e},c=(0,i.usePrefix)().resolveClassName;return{limit:a,render:function(r){var i,f,d,v=r.isFirst,p=r.isLast;return t.showLimit?(0,o.createVNode)("div",(0,o.mergeProps)({class:(f={},n(f,c("pagination-limit"),!0),n(f,"is-first",v),n(f,"is-last",p),f)},{disabled:t.disabled}),[(0,o.createVNode)("div",null,[e.value.eachPage]),(0,o.createVNode)(s(),{class:"".concat(c("pagination-limit-select")),clearable:!1,size:"small",withValidate:!1,modelValue:a.value,onChange:u,disabled:t.disabled},(d=i=t.limitList.map((function(e,t){return(0,o.createVNode)(l.BkOption,{id:e,name:"".concat(e),key:"".concat(t,"_").concat(e)},null)})),"function"==typeof d||"[object Object]"===Object.prototype.toString.call(d)&&!(0,o.isVNode)(d)?i:{default:function(){return[i]}})),(0,o.createVNode)("div",null,[e.value.strip])]):null}}}(a),V=x.limit,T=x.render;(0,o.watch)([d,V,p],(function(e){var t=r(e,2),n=t[0],a=t[1],o=Math.ceil(n/a);u.value=o<1?1:o}),{immediate:!0}),(0,o.watch)(y,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),(0,o.watch)(N,(function(n){e.small&&(t.emit("update:modelValue",n),t.emit("change",n))})),(0,o.watch)(V,(function(e){t.emit("limitChange",e)}));var C=(0,i.usePrefix)().resolveClassName;return{totalPageNum:u,renderTotal:m,renderList:b,renderLimit:T,renderSmallList:P,resolveClassName:C}},render:function(){var t,a=this,r=(0,e.classes)((n(t={},"".concat(this.resolveClassName("pagination")),!0),n(t,"".concat(this.resolveClassName("pagination--".concat(this.size))),!0),n(t,"is-align-".concat(this.align),!0),t)),i={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return(0,o.createVNode)("div",{class:r},[this.layout.map((function(e,t){return i[e]({isFirst:0===t,isLast:t===a.layout.length-1})}))])}});var g=(0,e.withInstall)(m);const y=g})(),c})()));
|