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

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 (174) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/style.variable.css +1 -1
  3. package/lib/affix/index.js +1 -391
  4. package/lib/alert/index.js +1 -287
  5. package/lib/animate-number/index.js +1 -219
  6. package/lib/backtop/index.js +1 -264
  7. package/lib/badge/index.js +1 -304
  8. package/lib/breadcrumb/index.js +1 -379
  9. package/lib/button/index.js +1 -403
  10. package/lib/card/index.js +1 -369
  11. package/lib/cascader/index.js +2 -2095
  12. package/lib/cascader/index.js.LICENSE.txt +1 -0
  13. package/lib/checkbox/index.js +1 -602
  14. package/lib/code-diff/index.js +1 -5548
  15. package/lib/collapse/index.js +1 -605
  16. package/lib/collapse-transition/index.js +1 -237
  17. package/lib/color-picker/index.js +1 -2735
  18. package/lib/components.js +1 -770
  19. package/lib/config-provider/index.js +1 -377
  20. package/lib/container/index.js +1 -408
  21. package/lib/date-picker/index.js +1 -5576
  22. package/lib/dialog/index.js +2 -1324
  23. package/lib/dialog/index.js.LICENSE.txt +1 -0
  24. package/lib/directives/index.js +2 -1386
  25. package/lib/directives/index.js.LICENSE.txt +14 -0
  26. package/lib/dist.index.js +1 -179
  27. package/lib/divider/index.js +1 -237
  28. package/lib/dropdown/index.js +1 -455
  29. package/lib/exception/index.js +1 -435
  30. package/lib/fixed-navbar/index.js +1 -222
  31. package/lib/form/index.js +1 -1004
  32. package/lib/hooks.js +1 -133
  33. package/lib/icon/angle-double-down-line.js +1 -541
  34. package/lib/icon/angle-double-left-line.js +1 -541
  35. package/lib/icon/angle-double-left.js +1 -541
  36. package/lib/icon/angle-double-right-line.js +1 -541
  37. package/lib/icon/angle-double-right.js +1 -541
  38. package/lib/icon/angle-double-up-line.js +1 -541
  39. package/lib/icon/angle-down-fill.js +1 -541
  40. package/lib/icon/angle-down-line.js +1 -541
  41. package/lib/icon/angle-down.js +1 -541
  42. package/lib/icon/angle-left.js +1 -541
  43. package/lib/icon/angle-right.js +1 -541
  44. package/lib/icon/angle-up-fill.js +1 -541
  45. package/lib/icon/angle-up.js +1 -541
  46. package/lib/icon/archive-fill.js +1 -541
  47. package/lib/icon/arrows-left.js +1 -541
  48. package/lib/icon/arrows-right.js +1 -541
  49. package/lib/icon/assistant.js +1 -541
  50. package/lib/icon/audio-fill.js +1 -541
  51. package/lib/icon/bk.js +1 -541
  52. package/lib/icon/circle.js +1 -541
  53. package/lib/icon/close-line.js +1 -541
  54. package/lib/icon/close.js +1 -541
  55. package/lib/icon/code.js +1 -541
  56. package/lib/icon/cog-shape.js +1 -541
  57. package/lib/icon/collapse-left.js +1 -541
  58. package/lib/icon/copy-shape.js +1 -541
  59. package/lib/icon/copy.js +1 -541
  60. package/lib/icon/data-shape.js +1 -541
  61. package/lib/icon/del.js +1 -541
  62. package/lib/icon/doc-fill.js +1 -541
  63. package/lib/icon/done.js +1 -541
  64. package/lib/icon/down-shape.js +1 -541
  65. package/lib/icon/down-small.js +1 -541
  66. package/lib/icon/edit-line.js +1 -541
  67. package/lib/icon/ellipsis.js +1 -541
  68. package/lib/icon/enlarge-line.js +1 -541
  69. package/lib/icon/error.js +1 -541
  70. package/lib/icon/excel-fill.js +1 -541
  71. package/lib/icon/exclamation-circle-shape.js +1 -541
  72. package/lib/icon/eye.js +1 -541
  73. package/lib/icon/filliscreen-line.js +1 -541
  74. package/lib/icon/fix-line.js +1 -541
  75. package/lib/icon/fix-shape.js +1 -541
  76. package/lib/icon/folder-open.js +1 -541
  77. package/lib/icon/folder-shape-open.js +1 -541
  78. package/lib/icon/folder-shape.js +1 -541
  79. package/lib/icon/folder.js +1 -541
  80. package/lib/icon/funnel.js +1 -541
  81. package/lib/icon/help-document-fill.js +1 -541
  82. package/lib/icon/help-fill.js +1 -541
  83. package/lib/icon/help.js +1 -541
  84. package/lib/icon/image-fill.js +1 -563
  85. package/lib/icon/img-error.js +1 -563
  86. package/lib/icon/img-placehoulder.js +1 -563
  87. package/lib/icon/index.js +1 -2353
  88. package/lib/icon/info-line.js +1 -563
  89. package/lib/icon/info.js +1 -563
  90. package/lib/icon/left-shape.js +1 -563
  91. package/lib/icon/left-turn-line.js +1 -563
  92. package/lib/icon/narrow-line.js +1 -563
  93. package/lib/icon/original.js +1 -563
  94. package/lib/icon/pdf-fill.js +1 -563
  95. package/lib/icon/play-shape.js +1 -563
  96. package/lib/icon/plus.js +1 -563
  97. package/lib/icon/ppt-fill.js +1 -563
  98. package/lib/icon/qq.js +1 -563
  99. package/lib/icon/right-shape.js +1 -563
  100. package/lib/icon/right-turn-line.js +1 -563
  101. package/lib/icon/search.js +1 -563
  102. package/lib/icon/share.js +1 -563
  103. package/lib/icon/spinner.js +1 -563
  104. package/lib/icon/success.js +1 -563
  105. package/lib/icon/switcher-loading.js +1 -563
  106. package/lib/icon/text-file.js +1 -563
  107. package/lib/icon/text-fill.js +1 -563
  108. package/lib/icon/transfer.js +1 -563
  109. package/lib/icon/tree-application-shape.js +1 -563
  110. package/lib/icon/unfull-screen.js +1 -563
  111. package/lib/icon/unvisible.js +1 -563
  112. package/lib/icon/up-shape.js +1 -563
  113. package/lib/icon/upload.js +1 -563
  114. package/lib/icon/video-fill.js +1 -563
  115. package/lib/icon/warn.js +1 -563
  116. package/lib/icon/weixin-pro.js +1 -563
  117. package/lib/icon/weixin.js +1 -563
  118. package/lib/image/index.js +1 -681
  119. package/lib/index.js +1 -195
  120. package/lib/info-box/index.js +2 -1514
  121. package/lib/info-box/index.js.LICENSE.txt +1 -0
  122. package/lib/input/index.js +1 -1038
  123. package/lib/link/index.js +1 -232
  124. package/lib/loading/index.js +1 -443
  125. package/lib/locale/index.js +1 -489
  126. package/lib/menu/index.js +1 -793
  127. package/lib/message/index.js +2 -1842
  128. package/lib/message/index.js.LICENSE.txt +6 -0
  129. package/lib/modal/index.js +1 -407
  130. package/lib/navigation/index.js +1 -439
  131. package/lib/notify/index.js +1 -470
  132. package/lib/overflow-title/index.js +1 -547
  133. package/lib/pagination/index.js +1 -974
  134. package/lib/plugin-popover/index.js +1 -4121
  135. package/lib/plugins/index.js +1 -130
  136. package/lib/pop-confirm/index.js +1 -367
  137. package/lib/popover/index.js +1 -4127
  138. package/lib/popover2/index.js +1 -171
  139. package/lib/preset.js +1 -164
  140. package/lib/process/index.js +2 -1146
  141. package/lib/process/index.js.LICENSE.txt +1 -0
  142. package/lib/progress/index.js +1 -495
  143. package/lib/radio/index.js +1 -693
  144. package/lib/rate/index.js +1 -406
  145. package/lib/resize-layout/index.js +1 -499
  146. package/lib/search-select/index.js +2 -3024
  147. package/lib/search-select/index.js.LICENSE.txt +1 -0
  148. package/lib/select/index.js +2 -2599
  149. package/lib/select/index.js.LICENSE.txt +1 -0
  150. package/lib/select/select.css +9 -0
  151. package/lib/select/select.less +11 -0
  152. package/lib/select/select.variable.css +9 -0
  153. package/lib/shared/index.js +1 -2832
  154. package/lib/sideslider/index.js +2 -1056
  155. package/lib/sideslider/index.js.LICENSE.txt +1 -0
  156. package/lib/slider/index.js +2 -1683
  157. package/lib/slider/index.js.LICENSE.txt +1 -0
  158. package/lib/steps/index.js +2 -1215
  159. package/lib/steps/index.js.LICENSE.txt +1 -0
  160. package/lib/swiper/index.js +1 -404
  161. package/lib/switcher/index.js +1 -335
  162. package/lib/tab/index.js +1 -935
  163. package/lib/table/index.js +1 -6588
  164. package/lib/table-column/index.js +1 -768
  165. package/lib/tag/index.js +1 -309
  166. package/lib/tag-input/index.js +1 -1758
  167. package/lib/time-picker/index.js +1 -142
  168. package/lib/timeline/index.js +1 -310
  169. package/lib/transfer/index.js +1 -767
  170. package/lib/tree/index.js +1 -2664
  171. package/lib/upload/index.js +2 -3257
  172. package/lib/upload/index.js.LICENSE.txt +1 -0
  173. package/lib/virtual-render/index.js +1 -806
  174. package/package.json +1 -1
@@ -1,470 +1 @@
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
- });
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})()));