bkui-vue 0.0.2-beta.72 → 0.0.2-beta.73

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 (170) hide show
  1. package/lib/affix/index.js +319 -1
  2. package/lib/alert/index.js +215 -1
  3. package/lib/animate-number/index.js +155 -1
  4. package/lib/backtop/index.js +188 -1
  5. package/lib/badge/index.js +236 -1
  6. package/lib/breadcrumb/index.js +309 -1
  7. package/lib/button/index.js +321 -1
  8. package/lib/card/index.js +274 -1
  9. package/lib/cascader/index.js +2019 -2
  10. package/lib/checkbox/index.js +542 -1
  11. package/lib/code-diff/index.js +5501 -1
  12. package/lib/collapse/index.js +518 -1
  13. package/lib/collapse-transition/index.js +178 -1
  14. package/lib/color-picker/index.js +2662 -1
  15. package/lib/components.js +530 -1
  16. package/lib/config-provider/index.js +317 -1
  17. package/lib/container/index.js +343 -1
  18. package/lib/date-picker/index.js +5481 -1
  19. package/lib/dialog/index.js +1266 -2
  20. package/lib/directives/index.js +1335 -2
  21. package/lib/dist.index.js +87 -1
  22. package/lib/divider/index.js +169 -1
  23. package/lib/dropdown/index.js +369 -1
  24. package/lib/exception/index.js +385 -1
  25. package/lib/fixed-navbar/index.js +154 -1
  26. package/lib/form/index.js +918 -1
  27. package/lib/hooks.js +73 -1
  28. package/lib/icon/angle-double-down-line.js +481 -1
  29. package/lib/icon/angle-double-left-line.js +481 -1
  30. package/lib/icon/angle-double-left.js +481 -1
  31. package/lib/icon/angle-double-right-line.js +481 -1
  32. package/lib/icon/angle-double-right.js +481 -1
  33. package/lib/icon/angle-double-up-line.js +481 -1
  34. package/lib/icon/angle-down-fill.js +481 -1
  35. package/lib/icon/angle-down-line.js +481 -1
  36. package/lib/icon/angle-down.js +481 -1
  37. package/lib/icon/angle-left.js +481 -1
  38. package/lib/icon/angle-right.js +481 -1
  39. package/lib/icon/angle-up-fill.js +481 -1
  40. package/lib/icon/angle-up.js +481 -1
  41. package/lib/icon/archive-fill.js +481 -1
  42. package/lib/icon/arrows-left.js +481 -1
  43. package/lib/icon/arrows-right.js +481 -1
  44. package/lib/icon/assistant.js +481 -1
  45. package/lib/icon/audio-fill.js +481 -1
  46. package/lib/icon/bk.js +481 -1
  47. package/lib/icon/circle.js +481 -1
  48. package/lib/icon/close-line.js +481 -1
  49. package/lib/icon/close.js +481 -1
  50. package/lib/icon/code.js +481 -1
  51. package/lib/icon/cog-shape.js +481 -1
  52. package/lib/icon/collapse-left.js +481 -1
  53. package/lib/icon/copy-shape.js +481 -1
  54. package/lib/icon/copy.js +481 -1
  55. package/lib/icon/data-shape.js +481 -1
  56. package/lib/icon/del.js +481 -1
  57. package/lib/icon/doc-fill.js +481 -1
  58. package/lib/icon/done.js +481 -1
  59. package/lib/icon/down-shape.js +481 -1
  60. package/lib/icon/down-small.js +481 -1
  61. package/lib/icon/edit-line.js +481 -1
  62. package/lib/icon/ellipsis.js +481 -1
  63. package/lib/icon/enlarge-line.js +481 -1
  64. package/lib/icon/error.js +481 -1
  65. package/lib/icon/excel-fill.js +481 -1
  66. package/lib/icon/exclamation-circle-shape.js +481 -1
  67. package/lib/icon/eye.js +481 -1
  68. package/lib/icon/filliscreen-line.js +481 -1
  69. package/lib/icon/fix-line.js +481 -1
  70. package/lib/icon/fix-shape.js +481 -1
  71. package/lib/icon/folder-open.js +481 -1
  72. package/lib/icon/folder-shape-open.js +481 -1
  73. package/lib/icon/folder-shape.js +481 -1
  74. package/lib/icon/folder.js +481 -1
  75. package/lib/icon/funnel.js +481 -1
  76. package/lib/icon/help-document-fill.js +481 -1
  77. package/lib/icon/help-fill.js +481 -1
  78. package/lib/icon/help.js +481 -1
  79. package/lib/icon/image-fill.js +527 -1
  80. package/lib/icon/img-error.js +527 -1
  81. package/lib/icon/img-placehoulder.js +527 -1
  82. package/lib/icon/index.js +2367 -1
  83. package/lib/icon/info-line.js +527 -1
  84. package/lib/icon/info.js +527 -1
  85. package/lib/icon/left-shape.js +527 -1
  86. package/lib/icon/left-turn-line.js +527 -1
  87. package/lib/icon/narrow-line.js +527 -1
  88. package/lib/icon/original.js +527 -1
  89. package/lib/icon/pdf-fill.js +527 -1
  90. package/lib/icon/play-shape.js +527 -1
  91. package/lib/icon/plus.js +527 -1
  92. package/lib/icon/ppt-fill.js +527 -1
  93. package/lib/icon/qq.js +527 -1
  94. package/lib/icon/right-shape.js +527 -1
  95. package/lib/icon/right-turn-line.js +527 -1
  96. package/lib/icon/search.js +527 -1
  97. package/lib/icon/share.js +527 -1
  98. package/lib/icon/spinner.js +527 -1
  99. package/lib/icon/success.js +527 -1
  100. package/lib/icon/switcher-loading.js +527 -1
  101. package/lib/icon/text-file.js +527 -1
  102. package/lib/icon/text-fill.js +527 -1
  103. package/lib/icon/transfer.js +527 -1
  104. package/lib/icon/tree-application-shape.js +527 -1
  105. package/lib/icon/unfull-screen.js +527 -1
  106. package/lib/icon/unvisible.js +527 -1
  107. package/lib/icon/up-shape.js +527 -1
  108. package/lib/icon/upload.js +527 -1
  109. package/lib/icon/video-fill.js +527 -1
  110. package/lib/icon/warn.js +527 -1
  111. package/lib/icon/weixin-pro.js +527 -1
  112. package/lib/icon/weixin.js +527 -1
  113. package/lib/image/index.js +593 -1
  114. package/lib/index.js +97 -1
  115. package/lib/info-box/index.js +1456 -2
  116. package/lib/input/index.js +1528 -2
  117. package/lib/link/index.js +160 -1
  118. package/lib/loading/index.js +379 -1
  119. package/lib/locale/index.js +465 -1
  120. package/lib/menu/index.js +725 -1
  121. package/lib/message/index.js +1790 -2
  122. package/lib/modal/index.js +337 -1
  123. package/lib/navigation/index.js +367 -1
  124. package/lib/notify/index.js +394 -1
  125. package/lib/overflow-title/index.js +485 -1
  126. package/lib/pagination/index.js +880 -1
  127. package/lib/plugin-popover/index.js +4067 -1
  128. package/lib/plugins/index.js +63 -1
  129. package/lib/pop-confirm/index.js +273 -1
  130. package/lib/popover/index.js +4075 -1
  131. package/lib/popover2/index.js +107 -1
  132. package/lib/preset.js +93 -1
  133. package/lib/process/index.js +1099 -2
  134. package/lib/progress/index.js +428 -1
  135. package/lib/radio/index.js +627 -1
  136. package/lib/rate/index.js +338 -1
  137. package/lib/resize-layout/index.js +430 -1
  138. package/lib/search-select/index.js +3036 -2
  139. package/lib/select/index.js +2571 -2
  140. package/lib/shared/index.js +2865 -1
  141. package/lib/sideslider/index.js +1005 -2
  142. package/lib/slider/index.js +1629 -2
  143. package/lib/steps/index.js +1163 -2
  144. package/lib/swiper/index.js +336 -1
  145. package/lib/switcher/index.js +277 -1
  146. package/lib/tab/index.js +859 -1
  147. package/lib/table/index.js +6568 -1
  148. package/lib/table-column/index.js +730 -1
  149. package/lib/tag/index.js +233 -1
  150. package/lib/tag-input/index.js +1652 -1
  151. package/lib/time-picker/index.js +71 -1
  152. package/lib/timeline/index.js +242 -1
  153. package/lib/transfer/index.js +673 -1
  154. package/lib/tree/index.js +2625 -1
  155. package/lib/upload/index.js +3193 -2
  156. package/lib/virtual-render/index.js +748 -1
  157. package/package.json +2 -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/input/index.js.LICENSE.txt +0 -1
  163. package/lib/message/index.js.LICENSE.txt +0 -6
  164. package/lib/process/index.js.LICENSE.txt +0 -1
  165. package/lib/search-select/index.js.LICENSE.txt +0 -1
  166. package/lib/select/index.js.LICENSE.txt +0 -1
  167. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  168. package/lib/slider/index.js.LICENSE.txt +0 -1
  169. package/lib/steps/index.js.LICENSE.txt +0 -1
  170. package/lib/upload/index.js.LICENSE.txt +0 -1
@@ -1 +1,394 @@
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
+ import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__ from "../config-provider";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
6
+ /******/ // The require scope
7
+ /******/ var __webpack_require__ = {};
8
+ /******/
9
+ /************************************************************************/
10
+ /******/ /* webpack/runtime/define property getters */
11
+ /******/ (() => {
12
+ /******/ // define getter functions for harmony exports
13
+ /******/ __webpack_require__.d = (exports, definition) => {
14
+ /******/ for(var key in definition) {
15
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
16
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
17
+ /******/ }
18
+ /******/ }
19
+ /******/ };
20
+ /******/ })();
21
+ /******/
22
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
23
+ /******/ (() => {
24
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
25
+ /******/ })();
26
+ /******/
27
+ /************************************************************************/
28
+ var __webpack_exports__ = {};
29
+
30
+ // EXPORTS
31
+ __webpack_require__.d(__webpack_exports__, {
32
+ Z: () => (/* binding */ src)
33
+ });
34
+
35
+ ;// CONCATENATED MODULE: external "vue"
36
+ var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
37
+ var y = x => () => x
38
+ const external_vue_namespaceObject = x({ ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
39
+ ;// CONCATENATED MODULE: external "../shared"
40
+ var external_shared_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
41
+ var external_shared_y = x => () => x
42
+ const external_shared_namespaceObject = external_shared_x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.bkZIndexManager, ["isElement"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.isElement });
43
+ ;// CONCATENATED MODULE: ../../packages/hooks/use-message.ts
44
+ /*
45
+ * Tencent is pleased to support the open source community by making
46
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
47
+ *
48
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
49
+ *
50
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
51
+ *
52
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
53
+ *
54
+ * ---------------------------------------------------
55
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
56
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
57
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
58
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
59
+ *
60
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
61
+ * the Software.
62
+ *
63
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
64
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
66
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
67
+ * IN THE SOFTWARE.
68
+ */
69
+
70
+
71
+ var instances = {
72
+ 'top-left': [],
73
+ 'top-right': [],
74
+ 'bottom-left': [],
75
+ 'bottom-right': []
76
+ };
77
+ var seed = 1;
78
+ var Message = function Message(constructor, options) {
79
+ var opts = options;
80
+ var position = opts.position || 'top-right';
81
+ if (typeof options === 'string') {
82
+ opts = {
83
+ message: options
84
+ };
85
+ }
86
+ var userOnClose = options.onClose;
87
+ var horizontalOffset = opts.offsetX || 10;
88
+ var verticalOffset = opts.offsetY || 30;
89
+ var _opts = opts,
90
+ _opts$spacing = _opts.spacing,
91
+ spacing = _opts$spacing === void 0 ? 10 : _opts$spacing;
92
+ instances[position].forEach(function (vm) {
93
+ verticalOffset += (vm.el.offsetHeight || 0) + spacing;
94
+ });
95
+ seed += 1;
96
+ var id = "message_".concat(seed);
97
+ opts = Object.assign(Object.assign({}, opts), {
98
+ offsetX: horizontalOffset,
99
+ offsetY: verticalOffset,
100
+ id: id
101
+ });
102
+ var container = document.createElement('div');
103
+ var vm = (0,external_vue_namespaceObject.createVNode)(constructor, opts);
104
+ // const updateModalPosition = () => {
105
+ // let offsetTop = 30;
106
+ // instances[position].forEach((vm) => {
107
+ // offsetTop += (vm.el.offsetHeight || 0) + spacing;
108
+ // vm.props.offsetY = offsetTop;
109
+ // });
110
+ // };
111
+ vm.props.onDestroy = function (id) {
112
+ use_message_close(id, position, spacing, userOnClose);
113
+ (0,external_vue_namespaceObject.render)(null, container);
114
+ };
115
+ vm.props.onDetail = function (_isShow, id) {
116
+ instances[position].forEach(function (item) {
117
+ var _a, _b;
118
+ if (item.props.id !== id) {
119
+ (_b = (_a = item.component) === null || _a === void 0 ? void 0 : _a.exposed) === null || _b === void 0 ? void 0 : _b.setDetailsShow(null, false);
120
+ }
121
+ });
122
+ // setTimeout(() => {
123
+ // console.log('updateModalPosition');
124
+ // updateModalPosition();
125
+ // });
126
+ };
127
+
128
+ (0,external_vue_namespaceObject.render)(vm, container);
129
+ instances[position].push(vm);
130
+ var target;
131
+ if (vm.props.getContainer && (0,external_shared_namespaceObject.isElement)(vm.props.getContainer)) {
132
+ target = vm.props.getContainer;
133
+ } else {
134
+ target = document.body;
135
+ }
136
+ target.appendChild(container.firstElementChild);
137
+ };
138
+ function use_message_close(id, position, spacing, userOnClose) {
139
+ userOnClose === null || userOnClose === void 0 ? void 0 : userOnClose();
140
+ var verticalProperty = position.startsWith('top') ? 'top' : 'bottom';
141
+ var instanceIndex = -1;
142
+ instances[position].forEach(function (item, index) {
143
+ if (item.props.id === id) {
144
+ instanceIndex = index;
145
+ }
146
+ });
147
+ var vm = instances[position][instanceIndex];
148
+ var removeHeight = vm.el.offsetHeight;
149
+ var len = instances[position].length;
150
+ for (var i = instanceIndex; i < len; i++) {
151
+ var pos = parseInt(instances[position][i].el.style[verticalProperty], 10) - removeHeight - spacing;
152
+ instances[position][i].component.props.offsetY = pos;
153
+ }
154
+ instances[position].splice(instanceIndex, 1);
155
+ }
156
+ /* harmony default export */ const use_message = (Message);
157
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
158
+ function _typeof(obj) {
159
+ "@babel/helpers - typeof";
160
+
161
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
162
+ return typeof obj;
163
+ } : function (obj) {
164
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
165
+ }, _typeof(obj);
166
+ }
167
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
168
+
169
+ function _toPrimitive(input, hint) {
170
+ if (_typeof(input) !== "object" || input === null) return input;
171
+ var prim = input[Symbol.toPrimitive];
172
+ if (prim !== undefined) {
173
+ var res = prim.call(input, hint || "default");
174
+ if (_typeof(res) !== "object") return res;
175
+ throw new TypeError("@@toPrimitive must return a primitive value.");
176
+ }
177
+ return (hint === "string" ? String : Number)(input);
178
+ }
179
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
180
+
181
+
182
+ function _toPropertyKey(arg) {
183
+ var key = _toPrimitive(arg, "string");
184
+ return _typeof(key) === "symbol" ? key : String(key);
185
+ }
186
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
187
+
188
+ function _defineProperty(obj, key, value) {
189
+ key = _toPropertyKey(key);
190
+ if (key in obj) {
191
+ Object.defineProperty(obj, key, {
192
+ value: value,
193
+ enumerable: true,
194
+ configurable: true,
195
+ writable: true
196
+ });
197
+ } else {
198
+ obj[key] = value;
199
+ }
200
+ return obj;
201
+ }
202
+ ;// CONCATENATED MODULE: external "vue-types"
203
+ var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
204
+ var external_vue_types_y = x => () => x
205
+ const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
206
+ ;// CONCATENATED MODULE: external "../config-provider"
207
+ var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
208
+ var external_config_provider_y = x => () => x
209
+ const external_config_provider_namespaceObject = external_config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
210
+ ;// CONCATENATED MODULE: external "../icon"
211
+ var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
212
+ var external_icon_y = x => () => x
213
+ const external_icon_namespaceObject = external_icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Error, ["Info"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Info, ["Success"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Success, ["Warn"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Warn });
214
+ ;// CONCATENATED MODULE: ../../packages/notify/src/notifyConstructor.tsx
215
+
216
+
217
+ /*
218
+ * Tencent is pleased to support the open source community by making
219
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
220
+ *
221
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
222
+ *
223
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
224
+ *
225
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
226
+ *
227
+ * ---------------------------------------------------
228
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
229
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
230
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
231
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
232
+ *
233
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
234
+ * the Software.
235
+ *
236
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
237
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
238
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
239
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
240
+ * IN THE SOFTWARE.
241
+ */
242
+
243
+
244
+
245
+
246
+
247
+ var NotifyThemeEnum;
248
+ (function (NotifyThemeEnum) {
249
+ NotifyThemeEnum["PRIMARY"] = "primary";
250
+ NotifyThemeEnum["WARNING"] = "warning";
251
+ NotifyThemeEnum["SUCCESS"] = "success";
252
+ NotifyThemeEnum["ERROR"] = "error";
253
+ })(NotifyThemeEnum || (NotifyThemeEnum = {}));
254
+ var notifyProps = {
255
+ id: external_shared_namespaceObject.PropTypes.string.def(''),
256
+ title: external_shared_namespaceObject.PropTypes.string.def(''),
257
+ message: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.func]).def(''),
258
+ theme: (0,external_vue_types_namespaceObject.toType)('notifyTheme', {}).def(NotifyThemeEnum.PRIMARY),
259
+ position: external_shared_namespaceObject.PropTypes.position().def('top-right'),
260
+ delay: external_shared_namespaceObject.PropTypes.number.def(5000),
261
+ dismissable: external_shared_namespaceObject.PropTypes.bool.def(true),
262
+ offsetX: external_shared_namespaceObject.PropTypes.number.def(100),
263
+ offsetY: external_shared_namespaceObject.PropTypes.number.def(30),
264
+ spacing: external_shared_namespaceObject.PropTypes.number.def(10),
265
+ extCls: external_shared_namespaceObject.PropTypes.string.def(''),
266
+ onClose: external_shared_namespaceObject.PropTypes.func
267
+ };
268
+ /* harmony default export */ const notifyConstructor = ((0,external_vue_namespaceObject.defineComponent)({
269
+ name: 'Notify',
270
+ props: notifyProps,
271
+ emits: ['destroy'],
272
+ setup: function setup(props, _ref) {
273
+ var emit = _ref.emit;
274
+ var zIndex = external_shared_namespaceObject.bkZIndexManager.getMessageNextIndex();
275
+ var horizontalClass = (0,external_vue_namespaceObject.computed)(function () {
276
+ return props.position.indexOf('right') > 1 ? 'right' : 'left';
277
+ });
278
+ var verticalProperty = (0,external_vue_namespaceObject.computed)(function () {
279
+ return props.position.startsWith('top') ? 'top' : 'bottom';
280
+ });
281
+ var styles = (0,external_vue_namespaceObject.computed)(function () {
282
+ var _ref2;
283
+ return _ref2 = {}, _defineProperty(_ref2, horizontalClass.value, "".concat(props.offsetX, "px")), _defineProperty(_ref2, verticalProperty.value, "".concat(props.offsetY, "px")), _defineProperty(_ref2, "zIndex", zIndex), _ref2;
284
+ });
285
+ var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
286
+ resolveClassName = _usePrefix.resolveClassName;
287
+ var classNames = (0,external_vue_namespaceObject.computed)(function () {
288
+ return [resolveClassName('notify'), resolveClassName("notify-".concat(props.theme)), horizontalClass.value];
289
+ });
290
+ var renderMessage = (0,external_vue_namespaceObject.computed)(function () {
291
+ if (typeof props.message === 'function') {
292
+ return props.message();
293
+ }
294
+ return props.message;
295
+ });
296
+ var visible = (0,external_vue_namespaceObject.ref)(false);
297
+ var timer = null;
298
+ var startTimer = function startTimer() {
299
+ timer = setTimeout(function () {
300
+ visible.value = false;
301
+ }, props.delay);
302
+ };
303
+ var handleClose = function handleClose() {
304
+ visible.value = false;
305
+ };
306
+ (0,external_vue_namespaceObject.onMounted)(function () {
307
+ props.delay && startTimer();
308
+ visible.value = true;
309
+ });
310
+ (0,external_vue_namespaceObject.onUnmounted)(function () {
311
+ clearTimeout(timer);
312
+ });
313
+ (0,external_vue_namespaceObject.watch)(visible, function () {
314
+ if (!visible.value) {
315
+ emit('destroy', props.id);
316
+ }
317
+ });
318
+ return {
319
+ classNames: classNames,
320
+ styles: styles,
321
+ visible: visible,
322
+ renderMessage: renderMessage,
323
+ handleClose: handleClose,
324
+ resolveClassName: resolveClassName
325
+ };
326
+ },
327
+ render: function render() {
328
+ var _this = this;
329
+ var renderIcon = function renderIcon() {
330
+ var iconMap = {
331
+ primary: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Info, null, null),
332
+ warning: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Warn, null, null),
333
+ success: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Success, null, null),
334
+ error: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Close, null, null)
335
+ };
336
+ return iconMap[_this.theme];
337
+ };
338
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Transition, {
339
+ "name": "bk-notify-fade"
340
+ }, {
341
+ "default": function _default() {
342
+ return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
343
+ "class": _this.classNames,
344
+ "style": _this.styles
345
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
346
+ "class": "".concat(_this.resolveClassName('notify-content'))
347
+ }, [(0,external_vue_namespaceObject.createVNode)("div", {
348
+ "class": "".concat(_this.resolveClassName('notify-icon'))
349
+ }, [renderIcon()]), _this.title ? (0,external_vue_namespaceObject.createVNode)("div", {
350
+ "class": "".concat(_this.resolveClassName('notify-content-header'))
351
+ }, [_this.title]) : '', (0,external_vue_namespaceObject.createVNode)("div", {
352
+ "class": "".concat(_this.resolveClassName('notify-content-text'))
353
+ }, [_this.renderMessage])]), _this.dismissable && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Error, {
354
+ "class": "".concat(_this.resolveClassName('notify-icon'), " ").concat(_this.resolveClassName('notify-close')),
355
+ "onClick": _this.handleClose
356
+ }, null)]), [[external_vue_namespaceObject.vShow, _this.visible]])];
357
+ }
358
+ });
359
+ }
360
+ }));
361
+ ;// CONCATENATED MODULE: ../../packages/notify/src/index.ts
362
+ /*
363
+ * Tencent is pleased to support the open source community by making
364
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
365
+ *
366
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
367
+ *
368
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
369
+ *
370
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
371
+ *
372
+ * ---------------------------------------------------
373
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
374
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
375
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
376
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
377
+ *
378
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
379
+ * the Software.
380
+ *
381
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
382
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
383
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
384
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
385
+ * IN THE SOFTWARE.
386
+ */
387
+
388
+
389
+ var Notify = function Notify(options) {
390
+ use_message(notifyConstructor, options);
391
+ };
392
+ /* harmony default export */ const src = (Notify);
393
+ var __webpack_exports__default = __webpack_exports__.Z;
394
+ export { __webpack_exports__default as default };