bkui-vue 0.0.2-beta.36 → 0.0.2-beta.37

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.
Files changed (169) hide show
  1. package/lib/affix/index.js +391 -1
  2. package/lib/alert/index.js +287 -1
  3. package/lib/animate-number/index.js +219 -1
  4. package/lib/backtop/index.js +264 -1
  5. package/lib/badge/index.js +304 -1
  6. package/lib/breadcrumb/index.js +379 -1
  7. package/lib/button/index.js +403 -1
  8. package/lib/card/index.js +369 -1
  9. package/lib/cascader/index.js +2095 -2
  10. package/lib/checkbox/index.js +602 -1
  11. package/lib/code-diff/index.js +5548 -1
  12. package/lib/collapse/index.js +605 -1
  13. package/lib/collapse-transition/index.js +237 -1
  14. package/lib/color-picker/index.js +2735 -1
  15. package/lib/components.js +770 -1
  16. package/lib/config-provider/index.js +377 -1
  17. package/lib/container/index.js +408 -1
  18. package/lib/date-picker/index.js +5576 -1
  19. package/lib/dialog/index.js +1324 -2
  20. package/lib/directives/index.js +1386 -2
  21. package/lib/dist.index.js +179 -1
  22. package/lib/divider/index.js +237 -1
  23. package/lib/dropdown/index.js +455 -1
  24. package/lib/exception/index.js +435 -1
  25. package/lib/fixed-navbar/index.js +222 -1
  26. package/lib/form/index.js +1004 -1
  27. package/lib/hooks.js +133 -1
  28. package/lib/icon/angle-double-down-line.js +541 -1
  29. package/lib/icon/angle-double-left-line.js +541 -1
  30. package/lib/icon/angle-double-left.js +541 -1
  31. package/lib/icon/angle-double-right-line.js +541 -1
  32. package/lib/icon/angle-double-right.js +541 -1
  33. package/lib/icon/angle-double-up-line.js +541 -1
  34. package/lib/icon/angle-down-fill.js +541 -1
  35. package/lib/icon/angle-down-line.js +541 -1
  36. package/lib/icon/angle-down.js +541 -1
  37. package/lib/icon/angle-left.js +541 -1
  38. package/lib/icon/angle-right.js +541 -1
  39. package/lib/icon/angle-up-fill.js +541 -1
  40. package/lib/icon/angle-up.js +541 -1
  41. package/lib/icon/archive-fill.js +541 -1
  42. package/lib/icon/arrows-left.js +541 -1
  43. package/lib/icon/arrows-right.js +541 -1
  44. package/lib/icon/assistant.js +541 -1
  45. package/lib/icon/audio-fill.js +541 -1
  46. package/lib/icon/bk.js +541 -1
  47. package/lib/icon/circle.js +541 -1
  48. package/lib/icon/close-line.js +541 -1
  49. package/lib/icon/close.js +541 -1
  50. package/lib/icon/code.js +541 -1
  51. package/lib/icon/cog-shape.js +541 -1
  52. package/lib/icon/collapse-left.js +541 -1
  53. package/lib/icon/copy-shape.js +541 -1
  54. package/lib/icon/copy.js +541 -1
  55. package/lib/icon/data-shape.js +541 -1
  56. package/lib/icon/del.js +541 -1
  57. package/lib/icon/doc-fill.js +541 -1
  58. package/lib/icon/done.js +541 -1
  59. package/lib/icon/down-shape.js +541 -1
  60. package/lib/icon/down-small.js +541 -1
  61. package/lib/icon/edit-line.js +541 -1
  62. package/lib/icon/ellipsis.js +541 -1
  63. package/lib/icon/enlarge-line.js +541 -1
  64. package/lib/icon/error.js +541 -1
  65. package/lib/icon/excel-fill.js +541 -1
  66. package/lib/icon/exclamation-circle-shape.js +541 -1
  67. package/lib/icon/eye.js +541 -1
  68. package/lib/icon/filliscreen-line.js +541 -1
  69. package/lib/icon/fix-line.js +541 -1
  70. package/lib/icon/fix-shape.js +541 -1
  71. package/lib/icon/folder-open.js +541 -1
  72. package/lib/icon/folder-shape-open.js +541 -1
  73. package/lib/icon/folder-shape.js +541 -1
  74. package/lib/icon/folder.js +541 -1
  75. package/lib/icon/funnel.js +541 -1
  76. package/lib/icon/help-document-fill.js +541 -1
  77. package/lib/icon/help-fill.js +541 -1
  78. package/lib/icon/help.js +541 -1
  79. package/lib/icon/image-fill.js +563 -1
  80. package/lib/icon/img-error.js +563 -1
  81. package/lib/icon/img-placehoulder.js +563 -1
  82. package/lib/icon/index.js +2353 -1
  83. package/lib/icon/info-line.js +563 -1
  84. package/lib/icon/info.js +563 -1
  85. package/lib/icon/left-shape.js +563 -1
  86. package/lib/icon/left-turn-line.js +563 -1
  87. package/lib/icon/narrow-line.js +563 -1
  88. package/lib/icon/original.js +563 -1
  89. package/lib/icon/pdf-fill.js +563 -1
  90. package/lib/icon/play-shape.js +563 -1
  91. package/lib/icon/plus.js +563 -1
  92. package/lib/icon/ppt-fill.js +563 -1
  93. package/lib/icon/qq.js +563 -1
  94. package/lib/icon/right-shape.js +563 -1
  95. package/lib/icon/right-turn-line.js +563 -1
  96. package/lib/icon/search.js +563 -1
  97. package/lib/icon/share.js +563 -1
  98. package/lib/icon/spinner.js +563 -1
  99. package/lib/icon/success.js +563 -1
  100. package/lib/icon/switcher-loading.js +563 -1
  101. package/lib/icon/text-file.js +563 -1
  102. package/lib/icon/text-fill.js +563 -1
  103. package/lib/icon/transfer.js +563 -1
  104. package/lib/icon/tree-application-shape.js +563 -1
  105. package/lib/icon/unfull-screen.js +563 -1
  106. package/lib/icon/unvisible.js +563 -1
  107. package/lib/icon/up-shape.js +563 -1
  108. package/lib/icon/upload.js +563 -1
  109. package/lib/icon/video-fill.js +563 -1
  110. package/lib/icon/warn.js +563 -1
  111. package/lib/icon/weixin-pro.js +563 -1
  112. package/lib/icon/weixin.js +563 -1
  113. package/lib/image/index.js +681 -1
  114. package/lib/index.js +195 -1
  115. package/lib/info-box/index.js +1514 -2
  116. package/lib/input/index.js +1038 -1
  117. package/lib/link/index.js +232 -1
  118. package/lib/loading/index.js +443 -1
  119. package/lib/locale/index.js +489 -1
  120. package/lib/menu/index.js +793 -1
  121. package/lib/message/index.js +1842 -2
  122. package/lib/modal/index.js +407 -1
  123. package/lib/navigation/index.js +439 -1
  124. package/lib/notify/index.js +470 -1
  125. package/lib/overflow-title/index.js +547 -1
  126. package/lib/pagination/index.js +974 -1
  127. package/lib/plugin-popover/index.js +4121 -1
  128. package/lib/plugins/index.js +130 -1
  129. package/lib/pop-confirm/index.js +367 -1
  130. package/lib/popover/index.js +4127 -1
  131. package/lib/popover2/index.js +171 -1
  132. package/lib/preset.js +164 -1
  133. package/lib/process/index.js +1146 -2
  134. package/lib/progress/index.js +495 -1
  135. package/lib/radio/index.js +693 -1
  136. package/lib/rate/index.js +406 -1
  137. package/lib/resize-layout/index.js +499 -1
  138. package/lib/search-select/index.js +3024 -2
  139. package/lib/select/index.js +2599 -2
  140. package/lib/shared/index.js +2832 -1
  141. package/lib/sideslider/index.js +1056 -2
  142. package/lib/slider/index.js +1683 -2
  143. package/lib/steps/index.js +1215 -2
  144. package/lib/swiper/index.js +404 -1
  145. package/lib/switcher/index.js +335 -1
  146. package/lib/tab/index.js +935 -1
  147. package/lib/table/index.js +6588 -1
  148. package/lib/table-column/index.js +768 -1
  149. package/lib/tag/index.js +309 -1
  150. package/lib/tag-input/index.js +1758 -1
  151. package/lib/time-picker/index.js +142 -1
  152. package/lib/timeline/index.js +310 -1
  153. package/lib/transfer/index.js +767 -1
  154. package/lib/tree/index.js +2664 -1
  155. package/lib/upload/index.js +3257 -2
  156. package/lib/virtual-render/index.js +806 -1
  157. package/package.json +1 -1
  158. package/lib/cascader/index.js.LICENSE.txt +0 -1
  159. package/lib/dialog/index.js.LICENSE.txt +0 -1
  160. package/lib/directives/index.js.LICENSE.txt +0 -14
  161. package/lib/info-box/index.js.LICENSE.txt +0 -1
  162. package/lib/message/index.js.LICENSE.txt +0 -6
  163. package/lib/process/index.js.LICENSE.txt +0 -1
  164. package/lib/search-select/index.js.LICENSE.txt +0 -1
  165. package/lib/select/index.js.LICENSE.txt +0 -1
  166. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  167. package/lib/slider/index.js.LICENSE.txt +0 -1
  168. package/lib/steps/index.js.LICENSE.txt +0 -1
  169. package/lib/upload/index.js.LICENSE.txt +0 -1
@@ -1 +1,470 @@
1
- !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 o="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 o)("object"==typeof exports?exports:e)[r]=o[r]}}(self,((e,t,o,r,n)=>(()=>{"use strict";var s={2717:e=>{e.exports=r},6870:e=>{e.exports=n},4212:e=>{e.exports=t},748:t=>{t.exports=e},210:e=>{e.exports=o}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={exports:{}};return s[e](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},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 l={};return(()=>{a.r(l),a.d(l,{default:()=>y});var e=a(748),t=a(4212),o={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},r=1;function n(e){return n="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},n(e)}function s(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,"string");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var i,c=a(210),u=a(2717),f=a(6870);!function(e){e.PRIMARY="primary",e.WARNING="warning",e.SUCCESS="success",e.ERROR="error"}(i||(i={}));var p={id:t.PropTypes.string.def(""),title:t.PropTypes.string.def(""),message:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.func]).def(""),theme:(0,c.toType)("notifyTheme",{}).def(i.PRIMARY),position:t.PropTypes.position().def("top-right"),delay:t.PropTypes.number.def(5e3),dismissable:t.PropTypes.bool.def(!0),offsetX:t.PropTypes.number.def(100),offsetY:t.PropTypes.number.def(30),spacing:t.PropTypes.number.def(10),extCls:t.PropTypes.string.def(""),onClose:t.PropTypes.func};const d=(0,e.defineComponent)({name:"Notify",props:p,emits:["destroy"],setup:function(o,r){var n=r.emit,i=t.bkZIndexManager.getMessageNextIndex(),a=(0,e.computed)((function(){return o.position.indexOf("right")>1?"right":"left"})),l=(0,e.computed)((function(){return o.position.startsWith("top")?"top":"bottom"})),c=(0,e.computed)((function(){var e;return s(e={},a.value,"".concat(o.offsetX,"px")),s(e,l.value,"".concat(o.offsetY,"px")),s(e,"zIndex",i),e})),f=(0,u.usePrefix)().resolveClassName,p=(0,e.computed)((function(){return[f("notify"),f("notify-".concat(o.theme)),a.value]})),d=(0,e.computed)((function(){return"function"==typeof o.message?o.message():o.message})),y=(0,e.ref)(!1),v=null;return(0,e.onMounted)((function(){o.delay&&(v=setTimeout((function(){y.value=!1}),o.delay)),y.value=!0})),(0,e.onUnmounted)((function(){clearTimeout(v)})),(0,e.watch)(y,(function(){y.value||n("destroy",o.id)})),{classNames:p,styles:c,visible:y,renderMessage:d,handleClose:function(){y.value=!1},resolveClassName:f}},render:function(){var t=this;return(0,e.createVNode)(e.Transition,{name:"bk-notify-fade"},{default:function(){return[(0,e.withDirectives)((0,e.createVNode)("div",{class:t.classNames,style:t.styles},[(0,e.createVNode)("div",{class:"".concat(t.resolveClassName("notify-content"))},[(0,e.createVNode)("div",{class:"".concat(t.resolveClassName("notify-icon"))},[{primary:(0,e.createVNode)(f.Info,null,null),warning:(0,e.createVNode)(f.Warn,null,null),success:(0,e.createVNode)(f.Success,null,null),error:(0,e.createVNode)(f.Close,null,null)}[t.theme]]),t.title?(0,e.createVNode)("div",{class:"".concat(t.resolveClassName("notify-content-header"))},[t.title]):"",(0,e.createVNode)("div",{class:"".concat(t.resolveClassName("notify-content-text"))},[t.renderMessage])]),t.dismissable&&(0,e.createVNode)(f.Error,{class:"".concat(t.resolveClassName("notify-icon")," ").concat(t.resolveClassName("notify-close")),onClick:t.handleClose},null)]),[[e.vShow,t.visible]])]}})}}),y=function(n){!function(n,s){var i=s,a=i.position||"top-right";"string"==typeof s&&(i={message:s});var l=s.onClose,c=i.offsetX||10,u=i.offsetY||30,f=i.spacing,p=void 0===f?10:f;o[a].forEach((function(e){u+=(e.el.offsetHeight||0)+p}));var d="message_".concat(r+=1);i=Object.assign(Object.assign({},i),{offsetX:c,offsetY:u,id:d});var y=document.createElement("div"),v=(0,e.createVNode)(n,i);v.props.onDestroy=function(t){!function(e,t,r,n){null==n||n();var s=t.startsWith("top")?"top":"bottom",i=-1;o[t].forEach((function(t,o){t.props.id===e&&(i=o)}));for(var a=o[t][i].el.offsetHeight,l=o[t].length,c=i;c<l;c++){var u=parseInt(o[t][c].el.style[s],10)-a-r;o[t][c].component.props.offsetY=u}o[t].splice(i,1)}(t,a,p,l),(0,e.render)(null,y)},v.props.onDetail=function(e,t){o[a].forEach((function(e){var o,r;e.props.id!==t&&(null===(r=null===(o=e.component)||void 0===o?void 0:o.exposed)||void 0===r||r.setDetailsShow(null,!1))}))},(0,e.render)(v,y),o[a].push(v),(v.props.getContainer&&(0,t.isElement)(v.props.getContainer)?v.props.getContainer:document.body).appendChild(y.firstElementChild)}(d,n)}})(),l})()));
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("vue"), require("../shared"), require("vue-types"), require("../config-provider"), require("../icon"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["vue", "../shared", "vue-types", "../config-provider", "../icon"], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("vue"), require("../shared"), require("vue-types"), require("../config-provider"), require("../icon")) : factory(root["vue"], root["../shared"], root["vue-types"], root["../config-provider"], root["../icon"]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(self, (__WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__210__, __WEBPACK_EXTERNAL_MODULE__2717__, __WEBPACK_EXTERNAL_MODULE__6870__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 2717:
16
+ /***/ ((module) => {
17
+
18
+ module.exports = __WEBPACK_EXTERNAL_MODULE__2717__;
19
+
20
+ /***/ }),
21
+
22
+ /***/ 6870:
23
+ /***/ ((module) => {
24
+
25
+ module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
26
+
27
+ /***/ }),
28
+
29
+ /***/ 4212:
30
+ /***/ ((module) => {
31
+
32
+ module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
33
+
34
+ /***/ }),
35
+
36
+ /***/ 748:
37
+ /***/ ((module) => {
38
+
39
+ module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
40
+
41
+ /***/ }),
42
+
43
+ /***/ 210:
44
+ /***/ ((module) => {
45
+
46
+ module.exports = __WEBPACK_EXTERNAL_MODULE__210__;
47
+
48
+ /***/ })
49
+
50
+ /******/ });
51
+ /************************************************************************/
52
+ /******/ // The module cache
53
+ /******/ var __webpack_module_cache__ = {};
54
+ /******/
55
+ /******/ // The require function
56
+ /******/ function __webpack_require__(moduleId) {
57
+ /******/ // Check if module is in cache
58
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
59
+ /******/ if (cachedModule !== undefined) {
60
+ /******/ return cachedModule.exports;
61
+ /******/ }
62
+ /******/ // Create a new module (and put it into the cache)
63
+ /******/ var module = __webpack_module_cache__[moduleId] = {
64
+ /******/ // no module.id needed
65
+ /******/ // no module.loaded needed
66
+ /******/ exports: {}
67
+ /******/ };
68
+ /******/
69
+ /******/ // Execute the module function
70
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
71
+ /******/
72
+ /******/ // Return the exports of the module
73
+ /******/ return module.exports;
74
+ /******/ }
75
+ /******/
76
+ /************************************************************************/
77
+ /******/ /* webpack/runtime/define property getters */
78
+ /******/ (() => {
79
+ /******/ // define getter functions for harmony exports
80
+ /******/ __webpack_require__.d = (exports, definition) => {
81
+ /******/ for(var key in definition) {
82
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
83
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
84
+ /******/ }
85
+ /******/ }
86
+ /******/ };
87
+ /******/ })();
88
+ /******/
89
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
90
+ /******/ (() => {
91
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
92
+ /******/ })();
93
+ /******/
94
+ /******/ /* webpack/runtime/make namespace object */
95
+ /******/ (() => {
96
+ /******/ // define __esModule on exports
97
+ /******/ __webpack_require__.r = (exports) => {
98
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
99
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
100
+ /******/ }
101
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
102
+ /******/ };
103
+ /******/ })();
104
+ /******/
105
+ /************************************************************************/
106
+ var __webpack_exports__ = {};
107
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
108
+ (() => {
109
+ // ESM COMPAT FLAG
110
+ __webpack_require__.r(__webpack_exports__);
111
+
112
+ // EXPORTS
113
+ __webpack_require__.d(__webpack_exports__, {
114
+ "default": () => (/* binding */ src)
115
+ });
116
+
117
+ // EXTERNAL MODULE: external "vue"
118
+ var external_vue_ = __webpack_require__(748);
119
+ // EXTERNAL MODULE: external "../shared"
120
+ var external_shared_ = __webpack_require__(4212);
121
+ ;// CONCATENATED MODULE: ../../packages/hooks/use-message.ts
122
+ /*
123
+ * Tencent is pleased to support the open source community by making
124
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
125
+ *
126
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
127
+ *
128
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
129
+ *
130
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
131
+ *
132
+ * ---------------------------------------------------
133
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
134
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
135
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
136
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
137
+ *
138
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
139
+ * the Software.
140
+ *
141
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
142
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
143
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
144
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
145
+ * IN THE SOFTWARE.
146
+ */
147
+
148
+
149
+ var instances = {
150
+ 'top-left': [],
151
+ 'top-right': [],
152
+ 'bottom-left': [],
153
+ 'bottom-right': []
154
+ };
155
+ var seed = 1;
156
+ var Message = function Message(constructor, options) {
157
+ var opts = options;
158
+ var position = opts.position || 'top-right';
159
+ if (typeof options === 'string') {
160
+ opts = {
161
+ message: options
162
+ };
163
+ }
164
+ var userOnClose = options.onClose;
165
+ var horizontalOffset = opts.offsetX || 10;
166
+ var verticalOffset = opts.offsetY || 30;
167
+ var _opts = opts,
168
+ _opts$spacing = _opts.spacing,
169
+ spacing = _opts$spacing === void 0 ? 10 : _opts$spacing;
170
+ instances[position].forEach(function (vm) {
171
+ verticalOffset += (vm.el.offsetHeight || 0) + spacing;
172
+ });
173
+ seed += 1;
174
+ var id = "message_".concat(seed);
175
+ opts = Object.assign(Object.assign({}, opts), {
176
+ offsetX: horizontalOffset,
177
+ offsetY: verticalOffset,
178
+ id: id
179
+ });
180
+ var container = document.createElement('div');
181
+ var vm = (0,external_vue_.createVNode)(constructor, opts);
182
+ // const updateModalPosition = () => {
183
+ // let offsetTop = 30;
184
+ // instances[position].forEach((vm) => {
185
+ // offsetTop += (vm.el.offsetHeight || 0) + spacing;
186
+ // vm.props.offsetY = offsetTop;
187
+ // });
188
+ // };
189
+ vm.props.onDestroy = function (id) {
190
+ use_message_close(id, position, spacing, userOnClose);
191
+ (0,external_vue_.render)(null, container);
192
+ };
193
+ vm.props.onDetail = function (_isShow, id) {
194
+ instances[position].forEach(function (item) {
195
+ var _a, _b;
196
+ if (item.props.id !== id) {
197
+ (_b = (_a = item.component) === null || _a === void 0 ? void 0 : _a.exposed) === null || _b === void 0 ? void 0 : _b.setDetailsShow(null, false);
198
+ }
199
+ });
200
+ // setTimeout(() => {
201
+ // console.log('updateModalPosition');
202
+ // updateModalPosition();
203
+ // });
204
+ };
205
+
206
+ (0,external_vue_.render)(vm, container);
207
+ instances[position].push(vm);
208
+ var target;
209
+ if (vm.props.getContainer && (0,external_shared_.isElement)(vm.props.getContainer)) {
210
+ target = vm.props.getContainer;
211
+ } else {
212
+ target = document.body;
213
+ }
214
+ target.appendChild(container.firstElementChild);
215
+ };
216
+ function use_message_close(id, position, spacing, userOnClose) {
217
+ userOnClose === null || userOnClose === void 0 ? void 0 : userOnClose();
218
+ var verticalProperty = position.startsWith('top') ? 'top' : 'bottom';
219
+ var instanceIndex = -1;
220
+ instances[position].forEach(function (item, index) {
221
+ if (item.props.id === id) {
222
+ instanceIndex = index;
223
+ }
224
+ });
225
+ var vm = instances[position][instanceIndex];
226
+ var removeHeight = vm.el.offsetHeight;
227
+ var len = instances[position].length;
228
+ for (var i = instanceIndex; i < len; i++) {
229
+ var pos = parseInt(instances[position][i].el.style[verticalProperty], 10) - removeHeight - spacing;
230
+ instances[position][i].component.props.offsetY = pos;
231
+ }
232
+ instances[position].splice(instanceIndex, 1);
233
+ }
234
+ /* harmony default export */ const use_message = (Message);
235
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
236
+ function _typeof(obj) {
237
+ "@babel/helpers - typeof";
238
+
239
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
240
+ return typeof obj;
241
+ } : function (obj) {
242
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
243
+ }, _typeof(obj);
244
+ }
245
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
246
+
247
+ function _toPrimitive(input, hint) {
248
+ if (_typeof(input) !== "object" || input === null) return input;
249
+ var prim = input[Symbol.toPrimitive];
250
+ if (prim !== undefined) {
251
+ var res = prim.call(input, hint || "default");
252
+ if (_typeof(res) !== "object") return res;
253
+ throw new TypeError("@@toPrimitive must return a primitive value.");
254
+ }
255
+ return (hint === "string" ? String : Number)(input);
256
+ }
257
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
258
+
259
+
260
+ function _toPropertyKey(arg) {
261
+ var key = _toPrimitive(arg, "string");
262
+ return _typeof(key) === "symbol" ? key : String(key);
263
+ }
264
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
265
+
266
+ function _defineProperty(obj, key, value) {
267
+ key = _toPropertyKey(key);
268
+ if (key in obj) {
269
+ Object.defineProperty(obj, key, {
270
+ value: value,
271
+ enumerable: true,
272
+ configurable: true,
273
+ writable: true
274
+ });
275
+ } else {
276
+ obj[key] = value;
277
+ }
278
+ return obj;
279
+ }
280
+ // EXTERNAL MODULE: external "vue-types"
281
+ var external_vue_types_ = __webpack_require__(210);
282
+ // EXTERNAL MODULE: external "../config-provider"
283
+ var external_config_provider_ = __webpack_require__(2717);
284
+ // EXTERNAL MODULE: external "../icon"
285
+ var external_icon_ = __webpack_require__(6870);
286
+ ;// CONCATENATED MODULE: ../../packages/notify/src/notifyConstructor.tsx
287
+
288
+
289
+ /*
290
+ * Tencent is pleased to support the open source community by making
291
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
292
+ *
293
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
294
+ *
295
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
296
+ *
297
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
298
+ *
299
+ * ---------------------------------------------------
300
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
301
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
302
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
303
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
304
+ *
305
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
306
+ * the Software.
307
+ *
308
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
309
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
310
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
311
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
312
+ * IN THE SOFTWARE.
313
+ */
314
+
315
+
316
+
317
+
318
+
319
+ var NotifyThemeEnum;
320
+ (function (NotifyThemeEnum) {
321
+ NotifyThemeEnum["PRIMARY"] = "primary";
322
+ NotifyThemeEnum["WARNING"] = "warning";
323
+ NotifyThemeEnum["SUCCESS"] = "success";
324
+ NotifyThemeEnum["ERROR"] = "error";
325
+ })(NotifyThemeEnum || (NotifyThemeEnum = {}));
326
+ var notifyProps = {
327
+ id: external_shared_.PropTypes.string.def(''),
328
+ title: external_shared_.PropTypes.string.def(''),
329
+ message: external_shared_.PropTypes.oneOfType([external_shared_.PropTypes.string, external_shared_.PropTypes.func]).def(''),
330
+ theme: (0,external_vue_types_.toType)('notifyTheme', {}).def(NotifyThemeEnum.PRIMARY),
331
+ position: external_shared_.PropTypes.position().def('top-right'),
332
+ delay: external_shared_.PropTypes.number.def(5000),
333
+ dismissable: external_shared_.PropTypes.bool.def(true),
334
+ offsetX: external_shared_.PropTypes.number.def(100),
335
+ offsetY: external_shared_.PropTypes.number.def(30),
336
+ spacing: external_shared_.PropTypes.number.def(10),
337
+ extCls: external_shared_.PropTypes.string.def(''),
338
+ onClose: external_shared_.PropTypes.func
339
+ };
340
+ /* harmony default export */ const notifyConstructor = ((0,external_vue_.defineComponent)({
341
+ name: 'Notify',
342
+ props: notifyProps,
343
+ emits: ['destroy'],
344
+ setup: function setup(props, _ref) {
345
+ var emit = _ref.emit;
346
+ var zIndex = external_shared_.bkZIndexManager.getMessageNextIndex();
347
+ var horizontalClass = (0,external_vue_.computed)(function () {
348
+ return props.position.indexOf('right') > 1 ? 'right' : 'left';
349
+ });
350
+ var verticalProperty = (0,external_vue_.computed)(function () {
351
+ return props.position.startsWith('top') ? 'top' : 'bottom';
352
+ });
353
+ var styles = (0,external_vue_.computed)(function () {
354
+ var _ref2;
355
+ return _ref2 = {}, _defineProperty(_ref2, horizontalClass.value, "".concat(props.offsetX, "px")), _defineProperty(_ref2, verticalProperty.value, "".concat(props.offsetY, "px")), _defineProperty(_ref2, "zIndex", zIndex), _ref2;
356
+ });
357
+ var _usePrefix = (0,external_config_provider_.usePrefix)(),
358
+ resolveClassName = _usePrefix.resolveClassName;
359
+ var classNames = (0,external_vue_.computed)(function () {
360
+ return [resolveClassName('notify'), resolveClassName("notify-".concat(props.theme)), horizontalClass.value];
361
+ });
362
+ var renderMessage = (0,external_vue_.computed)(function () {
363
+ if (typeof props.message === 'function') {
364
+ return props.message();
365
+ }
366
+ return props.message;
367
+ });
368
+ var visible = (0,external_vue_.ref)(false);
369
+ var timer = null;
370
+ var startTimer = function startTimer() {
371
+ timer = setTimeout(function () {
372
+ visible.value = false;
373
+ }, props.delay);
374
+ };
375
+ var handleClose = function handleClose() {
376
+ visible.value = false;
377
+ };
378
+ (0,external_vue_.onMounted)(function () {
379
+ props.delay && startTimer();
380
+ visible.value = true;
381
+ });
382
+ (0,external_vue_.onUnmounted)(function () {
383
+ clearTimeout(timer);
384
+ });
385
+ (0,external_vue_.watch)(visible, function () {
386
+ if (!visible.value) {
387
+ emit('destroy', props.id);
388
+ }
389
+ });
390
+ return {
391
+ classNames: classNames,
392
+ styles: styles,
393
+ visible: visible,
394
+ renderMessage: renderMessage,
395
+ handleClose: handleClose,
396
+ resolveClassName: resolveClassName
397
+ };
398
+ },
399
+ render: function render() {
400
+ var _this = this;
401
+ var renderIcon = function renderIcon() {
402
+ var iconMap = {
403
+ primary: (0,external_vue_.createVNode)(external_icon_.Info, null, null),
404
+ warning: (0,external_vue_.createVNode)(external_icon_.Warn, null, null),
405
+ success: (0,external_vue_.createVNode)(external_icon_.Success, null, null),
406
+ error: (0,external_vue_.createVNode)(external_icon_.Close, null, null)
407
+ };
408
+ return iconMap[_this.theme];
409
+ };
410
+ return (0,external_vue_.createVNode)(external_vue_.Transition, {
411
+ "name": "bk-notify-fade"
412
+ }, {
413
+ "default": function _default() {
414
+ return [(0,external_vue_.withDirectives)((0,external_vue_.createVNode)("div", {
415
+ "class": _this.classNames,
416
+ "style": _this.styles
417
+ }, [(0,external_vue_.createVNode)("div", {
418
+ "class": "".concat(_this.resolveClassName('notify-content'))
419
+ }, [(0,external_vue_.createVNode)("div", {
420
+ "class": "".concat(_this.resolveClassName('notify-icon'))
421
+ }, [renderIcon()]), _this.title ? (0,external_vue_.createVNode)("div", {
422
+ "class": "".concat(_this.resolveClassName('notify-content-header'))
423
+ }, [_this.title]) : '', (0,external_vue_.createVNode)("div", {
424
+ "class": "".concat(_this.resolveClassName('notify-content-text'))
425
+ }, [_this.renderMessage])]), _this.dismissable && (0,external_vue_.createVNode)(external_icon_.Error, {
426
+ "class": "".concat(_this.resolveClassName('notify-icon'), " ").concat(_this.resolveClassName('notify-close')),
427
+ "onClick": _this.handleClose
428
+ }, null)]), [[external_vue_.vShow, _this.visible]])];
429
+ }
430
+ });
431
+ }
432
+ }));
433
+ ;// CONCATENATED MODULE: ../../packages/notify/src/index.ts
434
+ /*
435
+ * Tencent is pleased to support the open source community by making
436
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
437
+ *
438
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
439
+ *
440
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
441
+ *
442
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
443
+ *
444
+ * ---------------------------------------------------
445
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
446
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
447
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
448
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
449
+ *
450
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
451
+ * the Software.
452
+ *
453
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
454
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
455
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
456
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
457
+ * IN THE SOFTWARE.
458
+ */
459
+
460
+
461
+ var Notify = function Notify(options) {
462
+ use_message(notifyConstructor, options);
463
+ };
464
+ /* harmony default export */ const src = (Notify);
465
+ })();
466
+
467
+ /******/ return __webpack_exports__;
468
+ /******/ })()
469
+ ;
470
+ });