bkui-vue 0.0.2-beta.74 → 0.0.2-beta.77

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 (175) hide show
  1. package/lib/affix/index.js +1 -319
  2. package/lib/alert/index.js +1 -215
  3. package/lib/animate-number/index.js +1 -155
  4. package/lib/backtop/backtop.variable.css +3 -3
  5. package/lib/backtop/index.js +1 -188
  6. package/lib/badge/index.js +1 -236
  7. package/lib/breadcrumb/index.js +1 -309
  8. package/lib/button/index.js +1 -321
  9. package/lib/card/index.js +1 -274
  10. package/lib/cascader/index.js +2 -2019
  11. package/lib/cascader/index.js.LICENSE.txt +1 -0
  12. package/lib/checkbox/index.js +1 -542
  13. package/lib/code-diff/index.js +1 -5501
  14. package/lib/collapse/index.js +1 -518
  15. package/lib/collapse-transition/index.js +1 -178
  16. package/lib/color-picker/index.js +1 -2662
  17. package/lib/components.js +1 -530
  18. package/lib/config-provider/index.js +1 -317
  19. package/lib/container/index.js +1 -343
  20. package/lib/date-picker/index.js +1 -5481
  21. package/lib/dialog/index.js +2 -1266
  22. package/lib/dialog/index.js.LICENSE.txt +1 -0
  23. package/lib/directives/index.js +2 -1335
  24. package/lib/directives/index.js.LICENSE.txt +14 -0
  25. package/lib/dist.index.js +1 -87
  26. package/lib/divider/index.js +1 -169
  27. package/lib/dropdown/index.js +1 -369
  28. package/lib/exception/index.js +1 -385
  29. package/lib/fixed-navbar/index.js +1 -154
  30. package/lib/form/index.js +1 -918
  31. package/lib/hooks.js +1 -73
  32. package/lib/icon/angle-double-down-line.js +1 -481
  33. package/lib/icon/angle-double-left-line.js +1 -481
  34. package/lib/icon/angle-double-left.js +1 -481
  35. package/lib/icon/angle-double-right-line.js +1 -481
  36. package/lib/icon/angle-double-right.js +1 -481
  37. package/lib/icon/angle-double-up-line.js +1 -481
  38. package/lib/icon/angle-down-fill.js +1 -481
  39. package/lib/icon/angle-down-line.js +1 -481
  40. package/lib/icon/angle-down.js +1 -481
  41. package/lib/icon/angle-left.js +1 -481
  42. package/lib/icon/angle-right.js +1 -481
  43. package/lib/icon/angle-up-fill.js +1 -481
  44. package/lib/icon/angle-up.js +1 -481
  45. package/lib/icon/archive-fill.js +1 -481
  46. package/lib/icon/arrows-left.js +1 -481
  47. package/lib/icon/arrows-right.js +1 -481
  48. package/lib/icon/assistant.js +1 -481
  49. package/lib/icon/audio-fill.js +1 -481
  50. package/lib/icon/bk.js +1 -481
  51. package/lib/icon/circle.js +1 -481
  52. package/lib/icon/close-line.js +1 -481
  53. package/lib/icon/close.js +1 -481
  54. package/lib/icon/code.js +1 -481
  55. package/lib/icon/cog-shape.js +1 -481
  56. package/lib/icon/collapse-left.js +1 -481
  57. package/lib/icon/copy-shape.js +1 -481
  58. package/lib/icon/copy.js +1 -481
  59. package/lib/icon/data-shape.js +1 -481
  60. package/lib/icon/del.js +1 -481
  61. package/lib/icon/doc-fill.js +1 -481
  62. package/lib/icon/done.js +1 -481
  63. package/lib/icon/down-shape.js +1 -481
  64. package/lib/icon/down-small.js +1 -481
  65. package/lib/icon/edit-line.js +1 -481
  66. package/lib/icon/ellipsis.js +1 -481
  67. package/lib/icon/enlarge-line.js +1 -481
  68. package/lib/icon/error.js +1 -481
  69. package/lib/icon/excel-fill.js +1 -481
  70. package/lib/icon/exclamation-circle-shape.js +1 -481
  71. package/lib/icon/eye.js +1 -481
  72. package/lib/icon/filliscreen-line.js +1 -481
  73. package/lib/icon/fix-line.js +1 -481
  74. package/lib/icon/fix-shape.js +1 -481
  75. package/lib/icon/folder-open.js +1 -481
  76. package/lib/icon/folder-shape-open.js +1 -481
  77. package/lib/icon/folder-shape.js +1 -481
  78. package/lib/icon/folder.js +1 -481
  79. package/lib/icon/funnel.js +1 -481
  80. package/lib/icon/help-document-fill.js +1 -481
  81. package/lib/icon/help-fill.js +1 -481
  82. package/lib/icon/help.js +1 -481
  83. package/lib/icon/image-fill.js +1 -527
  84. package/lib/icon/img-error.js +1 -527
  85. package/lib/icon/img-placehoulder.js +1 -527
  86. package/lib/icon/index.js +1 -2367
  87. package/lib/icon/info-line.js +1 -527
  88. package/lib/icon/info.js +1 -527
  89. package/lib/icon/left-shape.js +1 -527
  90. package/lib/icon/left-turn-line.js +1 -527
  91. package/lib/icon/narrow-line.js +1 -527
  92. package/lib/icon/original.js +1 -527
  93. package/lib/icon/pdf-fill.js +1 -527
  94. package/lib/icon/play-shape.js +1 -527
  95. package/lib/icon/plus.js +1 -527
  96. package/lib/icon/ppt-fill.js +1 -527
  97. package/lib/icon/qq.js +1 -527
  98. package/lib/icon/right-shape.js +1 -527
  99. package/lib/icon/right-turn-line.js +1 -527
  100. package/lib/icon/search.js +1 -527
  101. package/lib/icon/share.js +1 -527
  102. package/lib/icon/spinner.js +1 -527
  103. package/lib/icon/success.js +1 -527
  104. package/lib/icon/switcher-loading.js +1 -527
  105. package/lib/icon/text-file.js +1 -527
  106. package/lib/icon/text-fill.js +1 -527
  107. package/lib/icon/transfer.js +1 -527
  108. package/lib/icon/tree-application-shape.js +1 -527
  109. package/lib/icon/unfull-screen.js +1 -527
  110. package/lib/icon/unvisible.js +1 -527
  111. package/lib/icon/up-shape.js +1 -527
  112. package/lib/icon/upload.js +1 -527
  113. package/lib/icon/video-fill.js +1 -527
  114. package/lib/icon/warn.js +1 -527
  115. package/lib/icon/weixin-pro.js +1 -527
  116. package/lib/icon/weixin.js +1 -527
  117. package/lib/image/index.js +1 -593
  118. package/lib/index.js +1 -97
  119. package/lib/info-box/index.js +2 -1456
  120. package/lib/info-box/index.js.LICENSE.txt +1 -0
  121. package/lib/input/index.js +2 -1528
  122. package/lib/input/index.js.LICENSE.txt +1 -0
  123. package/lib/link/index.js +1 -160
  124. package/lib/loading/index.js +1 -379
  125. package/lib/locale/index.js +1 -465
  126. package/lib/menu/index.js +1 -725
  127. package/lib/message/index.js +2 -1790
  128. package/lib/message/index.js.LICENSE.txt +6 -0
  129. package/lib/modal/index.js +1 -337
  130. package/lib/navigation/index.js +1 -367
  131. package/lib/notify/index.js +1 -394
  132. package/lib/overflow-title/index.js +1 -485
  133. package/lib/pagination/index.js +1 -880
  134. package/lib/plugin-popover/index.js +1 -4067
  135. package/lib/plugins/index.js +1 -63
  136. package/lib/pop-confirm/index.js +1 -273
  137. package/lib/popover/index.js +1 -4075
  138. package/lib/popover2/index.js +1 -107
  139. package/lib/preset.js +1 -93
  140. package/lib/process/index.js +2 -1099
  141. package/lib/process/index.js.LICENSE.txt +1 -0
  142. package/lib/progress/index.js +1 -428
  143. package/lib/radio/index.js +1 -627
  144. package/lib/rate/index.js +1 -338
  145. package/lib/resize-layout/index.js +1 -430
  146. package/lib/search-select/index.js +2 -3036
  147. package/lib/search-select/index.js.LICENSE.txt +1 -0
  148. package/lib/select/index.js +2 -2571
  149. package/lib/select/index.js.LICENSE.txt +1 -0
  150. package/lib/select/select.variable.css +24 -24
  151. package/lib/shared/index.js +1 -2865
  152. package/lib/sideslider/index.js +2 -1005
  153. package/lib/sideslider/index.js.LICENSE.txt +1 -0
  154. package/lib/slider/index.js +2 -1629
  155. package/lib/slider/index.js.LICENSE.txt +1 -0
  156. package/lib/steps/index.js +2 -1163
  157. package/lib/steps/index.js.LICENSE.txt +1 -0
  158. package/lib/styles/mixins/animate.css +21 -0
  159. package/lib/styles/mixins/animate.less +31 -0
  160. package/lib/styles/mixins/animate.variable.css +143 -0
  161. package/lib/swiper/index.js +1 -336
  162. package/lib/switcher/index.js +1 -277
  163. package/lib/tab/index.js +1 -859
  164. package/lib/table/index.js +1 -6568
  165. package/lib/table-column/index.js +1 -730
  166. package/lib/tag/index.js +1 -233
  167. package/lib/tag-input/index.js +1 -1652
  168. package/lib/time-picker/index.js +1 -71
  169. package/lib/timeline/index.js +1 -242
  170. package/lib/transfer/index.js +1 -673
  171. package/lib/tree/index.js +1 -2625
  172. package/lib/upload/index.js +2 -3193
  173. package/lib/upload/index.js.LICENSE.txt +1 -0
  174. package/lib/virtual-render/index.js +1 -748
  175. package/package.json +1 -1
@@ -1,394 +1 @@
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 };
1
+ import*as e from"vue";import*as o from"../shared";import*as t from"vue-types";import*as n from"../config-provider";import*as r from"../icon";var s={d:(e,o)=>{for(var t in o)s.o(o,t)&&!s.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)},i={};s.d(i,{Z:()=>C});const a=(c={Transition:()=>e.Transition,computed:()=>e.computed,createVNode:()=>e.createVNode,defineComponent:()=>e.defineComponent,onMounted:()=>e.onMounted,onUnmounted:()=>e.onUnmounted,ref:()=>e.ref,render:()=>e.render,vShow:()=>e.vShow,watch:()=>e.watch,withDirectives:()=>e.withDirectives},l={},s.d(l,c),l);var c,l;const f=(e=>{var o={};return s.d(o,e),o})({PropTypes:()=>o.PropTypes,bkZIndexManager:()=>o.bkZIndexManager,isElement:()=>o.isElement});var u={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},p=1;function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function m(e,o,t){return(o=function(e){var o=function(e,o){if("object"!==d(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===d(o)?o:String(o)}(o))in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}const v=(e=>{var o={};return s.d(o,e),o})({toType:()=>t.toType}),y=(e=>{var o={};return s.d(o,e),o})({usePrefix:()=>n.usePrefix}),g=(e=>{var o={};return s.d(o,e),o})({Close:()=>r.Close,Error:()=>r.Error,Info:()=>r.Info,Success:()=>r.Success,Warn:()=>r.Warn});var b;!function(e){e.PRIMARY="primary",e.WARNING="warning",e.SUCCESS="success",e.ERROR="error"}(b||(b={}));var h={id:f.PropTypes.string.def(""),title:f.PropTypes.string.def(""),message:f.PropTypes.oneOfType([f.PropTypes.string,f.PropTypes.func]).def(""),theme:(0,v.toType)("notifyTheme",{}).def(b.PRIMARY),position:f.PropTypes.position().def("top-right"),delay:f.PropTypes.number.def(5e3),dismissable:f.PropTypes.bool.def(!0),offsetX:f.PropTypes.number.def(100),offsetY:f.PropTypes.number.def(30),spacing:f.PropTypes.number.def(10),extCls:f.PropTypes.string.def(""),onClose:f.PropTypes.func};const N=(0,a.defineComponent)({name:"Notify",props:h,emits:["destroy"],setup:function(e,o){var t=o.emit,n=f.bkZIndexManager.getMessageNextIndex(),r=(0,a.computed)((function(){return e.position.indexOf("right")>1?"right":"left"})),s=(0,a.computed)((function(){return e.position.startsWith("top")?"top":"bottom"})),i=(0,a.computed)((function(){var o;return m(o={},r.value,"".concat(e.offsetX,"px")),m(o,s.value,"".concat(e.offsetY,"px")),m(o,"zIndex",n),o})),c=(0,y.usePrefix)().resolveClassName,l=(0,a.computed)((function(){return[c("notify"),c("notify-".concat(e.theme)),r.value]})),u=(0,a.computed)((function(){return"function"==typeof e.message?e.message():e.message})),p=(0,a.ref)(!1),d=null;return(0,a.onMounted)((function(){e.delay&&(d=setTimeout((function(){p.value=!1}),e.delay)),p.value=!0})),(0,a.onUnmounted)((function(){clearTimeout(d)})),(0,a.watch)(p,(function(){p.value||t("destroy",e.id)})),{classNames:l,styles:i,visible:p,renderMessage:u,handleClose:function(){p.value=!1},resolveClassName:c}},render:function(){var e=this;return(0,a.createVNode)(a.Transition,{name:"bk-notify-fade"},{default:function(){return[(0,a.withDirectives)((0,a.createVNode)("div",{class:e.classNames,style:e.styles},[(0,a.createVNode)("div",{class:"".concat(e.resolveClassName("notify-content"))},[(0,a.createVNode)("div",{class:"".concat(e.resolveClassName("notify-icon"))},[{primary:(0,a.createVNode)(g.Info,null,null),warning:(0,a.createVNode)(g.Warn,null,null),success:(0,a.createVNode)(g.Success,null,null),error:(0,a.createVNode)(g.Close,null,null)}[e.theme]]),e.title?(0,a.createVNode)("div",{class:"".concat(e.resolveClassName("notify-content-header"))},[e.title]):"",(0,a.createVNode)("div",{class:"".concat(e.resolveClassName("notify-content-text"))},[e.renderMessage])]),e.dismissable&&(0,a.createVNode)(g.Error,{class:"".concat(e.resolveClassName("notify-icon")," ").concat(e.resolveClassName("notify-close")),onClick:e.handleClose},null)]),[[a.vShow,e.visible]])]}})}}),C=function(e){!function(e,o){var t=o,n=t.position||"top-right";"string"==typeof o&&(t={message:o});var r=o.onClose,s=t.offsetX||10,i=t.offsetY||30,c=t.spacing,l=void 0===c?10:c;u[n].forEach((function(e){i+=(e.el.offsetHeight||0)+l}));var d="message_".concat(p+=1);t=Object.assign(Object.assign({},t),{offsetX:s,offsetY:i,id:d});var m=document.createElement("div"),v=(0,a.createVNode)(e,t);v.props.onDestroy=function(e){!function(e,o,t,n){null==n||n();var r=o.startsWith("top")?"top":"bottom",s=-1;u[o].forEach((function(o,t){o.props.id===e&&(s=t)}));for(var i=u[o][s].el.offsetHeight,a=u[o].length,c=s;c<a;c++){var l=parseInt(u[o][c].el.style[r],10)-i-t;u[o][c].component.props.offsetY=l}u[o].splice(s,1)}(e,n,l,r),(0,a.render)(null,m)},v.props.onDetail=function(e,o){u[n].forEach((function(e){var t,n;e.props.id!==o&&(null===(n=null===(t=e.component)||void 0===t?void 0:t.exposed)||void 0===n||n.setDetailsShow(null,!1))}))},(0,a.render)(v,m),u[n].push(v),(v.props.getContainer&&(0,f.isElement)(v.props.getContainer)?v.props.getContainer:document.body).appendChild(m.firstElementChild)}(N,e)};var T=i.Z;export{T as default};