bkui-vue 0.0.1-beta.392 → 0.0.1-beta.394

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 (155) hide show
  1. package/dist/index.cjs.js +40 -40
  2. package/dist/index.esm.js +1129 -1100
  3. package/dist/index.umd.js +39 -39
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -353
  7. package/lib/alert/index.js +1 -251
  8. package/lib/animate-number/index.js +1 -226
  9. package/lib/backtop/index.js +1 -260
  10. package/lib/badge/index.js +1 -274
  11. package/lib/breadcrumb/index.js +1 -329
  12. package/lib/button/index.js +1 -371
  13. package/lib/card/index.js +1 -326
  14. package/lib/cascader/index.js +1 -2168
  15. package/lib/checkbox/index.js +1 -571
  16. package/lib/code-diff/index.js +1 -5520
  17. package/lib/collapse/index.js +1 -698
  18. package/lib/color-picker/index.js +1 -2816
  19. package/lib/components.js +1 -759
  20. package/lib/container/index.js +1 -369
  21. package/lib/date-picker/index.js +1 -5601
  22. package/lib/dialog/index.js +1 -545
  23. package/lib/directives/index.js +2 -1427
  24. package/lib/directives/index.js.LICENSE.txt +14 -0
  25. package/lib/dist.index.js +1 -166
  26. package/lib/divider/index.js +1 -512
  27. package/lib/dropdown/index.js +1 -414
  28. package/lib/exception/index.js +1 -405
  29. package/lib/fixed-navbar/index.js +1 -214
  30. package/lib/form/index.js +1 -986
  31. package/lib/icon/angle-double-down-line.js +1 -426
  32. package/lib/icon/angle-double-left-line.js +1 -426
  33. package/lib/icon/angle-double-left.js +1 -426
  34. package/lib/icon/angle-double-right-line.js +1 -426
  35. package/lib/icon/angle-double-right.js +1 -426
  36. package/lib/icon/angle-double-up-line.js +1 -426
  37. package/lib/icon/angle-down-fill.js +1 -426
  38. package/lib/icon/angle-down-line.js +1 -426
  39. package/lib/icon/angle-down.js +1 -426
  40. package/lib/icon/angle-left.js +1 -426
  41. package/lib/icon/angle-right.js +1 -426
  42. package/lib/icon/angle-up-fill.js +1 -426
  43. package/lib/icon/angle-up.js +1 -426
  44. package/lib/icon/archive-fill.js +1 -426
  45. package/lib/icon/arrows-left.js +1 -426
  46. package/lib/icon/arrows-right.js +1 -426
  47. package/lib/icon/audio-fill.js +1 -426
  48. package/lib/icon/bk.js +1 -426
  49. package/lib/icon/circle.js +1 -426
  50. package/lib/icon/close-line.js +1 -426
  51. package/lib/icon/close.js +1 -426
  52. package/lib/icon/code.js +1 -426
  53. package/lib/icon/cog-shape.js +1 -426
  54. package/lib/icon/collapse-left.js +1 -426
  55. package/lib/icon/copy.js +1 -426
  56. package/lib/icon/data-shape.js +1 -426
  57. package/lib/icon/del.js +1 -426
  58. package/lib/icon/doc-fill.js +1 -426
  59. package/lib/icon/done.js +1 -426
  60. package/lib/icon/down-shape.js +1 -426
  61. package/lib/icon/down-small.js +1 -426
  62. package/lib/icon/edit-line.js +1 -426
  63. package/lib/icon/ellipsis.js +1 -426
  64. package/lib/icon/enlarge-line.js +1 -426
  65. package/lib/icon/error.js +1 -426
  66. package/lib/icon/excel-fill.js +1 -426
  67. package/lib/icon/exclamation-circle-shape.js +1 -426
  68. package/lib/icon/eye.js +1 -426
  69. package/lib/icon/filliscreen-line.js +1 -426
  70. package/lib/icon/folder-open.js +1 -426
  71. package/lib/icon/folder-shape-open.js +1 -426
  72. package/lib/icon/folder-shape.js +1 -426
  73. package/lib/icon/folder.js +1 -426
  74. package/lib/icon/funnel.js +1 -426
  75. package/lib/icon/help-document-fill.js +1 -426
  76. package/lib/icon/help-fill.js +1 -426
  77. package/lib/icon/help.js +1 -426
  78. package/lib/icon/image-fill.js +1 -426
  79. package/lib/icon/img-placehoulder.js +1 -448
  80. package/lib/icon/index.js +1 -2275
  81. package/lib/icon/info-line.js +1 -448
  82. package/lib/icon/info.js +1 -448
  83. package/lib/icon/left-shape.js +1 -448
  84. package/lib/icon/left-turn-line.js +1 -448
  85. package/lib/icon/narrow-line.js +1 -448
  86. package/lib/icon/original.js +1 -448
  87. package/lib/icon/pdf-fill.js +1 -448
  88. package/lib/icon/play-shape.js +1 -448
  89. package/lib/icon/plus.js +1 -448
  90. package/lib/icon/ppt-fill.js +1 -448
  91. package/lib/icon/qq.js +1 -448
  92. package/lib/icon/right-shape.js +1 -448
  93. package/lib/icon/right-turn-line.js +1 -448
  94. package/lib/icon/search.js +1 -448
  95. package/lib/icon/share.js +1 -448
  96. package/lib/icon/spinner.js +1 -448
  97. package/lib/icon/success.js +1 -448
  98. package/lib/icon/switcher-loading.js +1 -448
  99. package/lib/icon/text-file.js +1 -448
  100. package/lib/icon/text-fill.js +1 -448
  101. package/lib/icon/transfer.js +1 -448
  102. package/lib/icon/tree-application-shape.js +1 -448
  103. package/lib/icon/unfull-screen.js +1 -448
  104. package/lib/icon/unvisible.js +1 -448
  105. package/lib/icon/up-shape.js +1 -448
  106. package/lib/icon/upload.js +1 -448
  107. package/lib/icon/video-fill.js +1 -448
  108. package/lib/icon/warn.js +1 -448
  109. package/lib/icon/weixin.js +1 -448
  110. package/lib/image/index.js +1 -873
  111. package/lib/index.js +1 -169
  112. package/lib/info-box/index.js +1 -1784
  113. package/lib/input/index.js +1 -846
  114. package/lib/link/index.js +1 -226
  115. package/lib/loading/index.js +1 -309
  116. package/lib/menu/index.js +1 -796
  117. package/lib/message/index.js +1 -401
  118. package/lib/modal/index.js +1 -395
  119. package/lib/navigation/index.js +1 -431
  120. package/lib/notify/index.js +1 -430
  121. package/lib/overflow-title/index.js +1 -512
  122. package/lib/pagination/index.js +1 -1026
  123. package/lib/plugin-popover/index.js +1 -2447
  124. package/lib/plugins/index.js +1 -130
  125. package/lib/popover/index.js +1 -2453
  126. package/lib/popover2/index.js +1 -172
  127. package/lib/preset.js +1 -129
  128. package/lib/process/index.js +1 -1417
  129. package/lib/progress/index.js +1 -479
  130. package/lib/radio/index.js +1 -649
  131. package/lib/rate/index.js +1 -358
  132. package/lib/resize-layout/index.js +1 -495
  133. package/lib/search-select/index.js +1 -3388
  134. package/lib/search-select/search-select.css +1 -1
  135. package/lib/search-select/search-select.less +1 -1
  136. package/lib/search-select/search-select.variable.css +1 -1
  137. package/lib/select/index.js +1 -2819
  138. package/lib/shared/index.js +1 -2813
  139. package/lib/sideslider/index.js +1 -1362
  140. package/lib/slider/index.js +1 -2060
  141. package/lib/steps/index.js +1 -1504
  142. package/lib/swiper/index.js +1 -374
  143. package/lib/switcher/index.js +1 -308
  144. package/lib/tab/index.js +1 -919
  145. package/lib/table/index.js +1 -6635
  146. package/lib/table-column/index.js +1 -737
  147. package/lib/tag/index.js +1 -278
  148. package/lib/tag-input/index.js +1 -1897
  149. package/lib/time-picker/index.js +1 -142
  150. package/lib/timeline/index.js +1 -315
  151. package/lib/transfer/index.js +1 -658
  152. package/lib/tree/index.js +1 -2917
  153. package/lib/upload/index.js +1 -3735
  154. package/lib/virtual-render/index.js +1 -825
  155. package/package.json +2 -1
@@ -1,545 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("../shared"), require("vue"), require("../button"), require("../icon"), require("../modal"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["../shared", "vue", "../button", "../icon", "../modal"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("../button"), require("../icon"), require("../modal")) : factory(root["../shared"], root["vue"], root["../button"], root["../icon"], root["../modal"]);
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(self, (__WEBPACK_EXTERNAL_MODULE__4212__, __WEBPACK_EXTERNAL_MODULE__748__, __WEBPACK_EXTERNAL_MODULE__4976__, __WEBPACK_EXTERNAL_MODULE__6870__, __WEBPACK_EXTERNAL_MODULE__8014__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ 4976:
16
- /***/ ((module) => {
17
-
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__4976__;
19
-
20
- /***/ }),
21
-
22
- /***/ 6870:
23
- /***/ ((module) => {
24
-
25
- module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
26
-
27
- /***/ }),
28
-
29
- /***/ 8014:
30
- /***/ ((module) => {
31
-
32
- module.exports = __WEBPACK_EXTERNAL_MODULE__8014__;
33
-
34
- /***/ }),
35
-
36
- /***/ 4212:
37
- /***/ ((module) => {
38
-
39
- module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
40
-
41
- /***/ }),
42
-
43
- /***/ 748:
44
- /***/ ((module) => {
45
-
46
- module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
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/compat get default export */
78
- /******/ (() => {
79
- /******/ // getDefaultExport function for compatibility with non-harmony modules
80
- /******/ __webpack_require__.n = (module) => {
81
- /******/ var getter = module && module.__esModule ?
82
- /******/ () => (module['default']) :
83
- /******/ () => (module);
84
- /******/ __webpack_require__.d(getter, { a: getter });
85
- /******/ return getter;
86
- /******/ };
87
- /******/ })();
88
- /******/
89
- /******/ /* webpack/runtime/define property getters */
90
- /******/ (() => {
91
- /******/ // define getter functions for harmony exports
92
- /******/ __webpack_require__.d = (exports, definition) => {
93
- /******/ for(var key in definition) {
94
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
95
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
96
- /******/ }
97
- /******/ }
98
- /******/ };
99
- /******/ })();
100
- /******/
101
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
102
- /******/ (() => {
103
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
104
- /******/ })();
105
- /******/
106
- /******/ /* webpack/runtime/make namespace object */
107
- /******/ (() => {
108
- /******/ // define __esModule on exports
109
- /******/ __webpack_require__.r = (exports) => {
110
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
111
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
112
- /******/ }
113
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
114
- /******/ };
115
- /******/ })();
116
- /******/
117
- /************************************************************************/
118
- var __webpack_exports__ = {};
119
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
120
- (() => {
121
- // ESM COMPAT FLAG
122
- __webpack_require__.r(__webpack_exports__);
123
-
124
- // EXPORTS
125
- __webpack_require__.d(__webpack_exports__, {
126
- "default": () => (/* binding */ src)
127
- });
128
-
129
- // EXTERNAL MODULE: external "../shared"
130
- var external_shared_ = __webpack_require__(4212);
131
- // EXTERNAL MODULE: external "vue"
132
- var external_vue_ = __webpack_require__(748);
133
- // EXTERNAL MODULE: external "../button"
134
- var external_button_ = __webpack_require__(4976);
135
- var external_button_default = /*#__PURE__*/__webpack_require__.n(external_button_);
136
- // EXTERNAL MODULE: external "../icon"
137
- var external_icon_ = __webpack_require__(6870);
138
- // EXTERNAL MODULE: external "../modal"
139
- var external_modal_ = __webpack_require__(8014);
140
- var external_modal_default = /*#__PURE__*/__webpack_require__.n(external_modal_);
141
- ;// CONCATENATED MODULE: ../../packages/dialog/src/props.ts
142
- /*
143
- * Tencent is pleased to support the open source community by making
144
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
145
- *
146
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
147
- *
148
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
149
- *
150
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
151
- *
152
- * ---------------------------------------------------
153
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
154
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
155
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
156
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
157
- *
158
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
159
- * the Software.
160
- *
161
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
162
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
163
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
164
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
165
- * IN THE SOFTWARE.
166
- */
167
-
168
-
169
- var props = Object.assign(Object.assign({}, external_modal_.propsMixin), {
170
- width: external_shared_.PropTypes.oneOfType([String, Number]).def(''),
171
- height: external_shared_.PropTypes.oneOfType([String, Number]).def(''),
172
- // 确认按钮文字
173
- confirmText: external_shared_.PropTypes.string.def('确定'),
174
- // 取消按钮文字
175
- cancelText: external_shared_.PropTypes.string.def('取消'),
176
- // 步骤按钮文字
177
- prevText: external_shared_.PropTypes.string.def('上一步'),
178
- nextText: external_shared_.PropTypes.string.def('下一步'),
179
- // 当前步骤
180
- current: external_shared_.PropTypes.number.def(1),
181
- // 总步数
182
- totalStep: external_shared_.PropTypes.number,
183
- // 弹框的标题
184
- title: external_shared_.PropTypes.string.def('title'),
185
- // 显示 header 的位置
186
- headerAlign: (0,external_shared_.alignType)().def(external_shared_.AlignEnum.LEFT),
187
- // 显示 footer 的位置
188
- footerAlign: (0,external_shared_.alignType)().def(external_shared_.AlignEnum.RIGHT),
189
- // 颜色 按钮类型
190
- theme: external_shared_.PropTypes.theme().def(external_shared_.ThemeEnum.PRIMARY),
191
- // 对话框类型
192
- dialogType: (0,external_shared_.dialogTypeUnion)(),
193
- // 按钮loading
194
- isLoading: external_shared_.PropTypes.bool.def(false)
195
- });
196
- /* harmony default export */ const src_props = (props);
197
- ;// CONCATENATED MODULE: ../../packages/dialog/src/dialog.tsx
198
-
199
-
200
- /*
201
- * Tencent is pleased to support the open source community by making
202
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
203
- *
204
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
205
- *
206
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
207
- *
208
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
209
- *
210
- * ---------------------------------------------------
211
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
212
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
213
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
214
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
215
- *
216
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
217
- * the Software.
218
- *
219
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
220
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
221
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
222
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
223
- * IN THE SOFTWARE.
224
- */
225
-
226
-
227
-
228
-
229
-
230
-
231
-
232
- function _isSlot(s) {
233
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_.isVNode)(s);
234
- }
235
-
236
- /* harmony default export */ const dialog = ((0,external_vue_.defineComponent)({
237
- name: 'Dialog',
238
- components: {
239
- BkModal: (external_modal_default()),
240
- BkButton: (external_button_default())
241
- },
242
- props: src_props,
243
- emits: ['closed', 'update:isShow', 'confirm', 'prev', 'next', 'value-change'],
244
- setup: function setup(props, _ref) {
245
- var emit = _ref.emit;
246
- var data = (0,external_vue_.reactive)({
247
- positionX: 0,
248
- positionY: 0,
249
- moveStyle: {
250
- top: '',
251
- left: ''
252
- }
253
- });
254
- var isModalShow = (0,external_vue_.ref)(props.isShow);
255
- (0,external_vue_.onMounted)(function () {
256
- if (props.escClose) {
257
- addEventListener('keydown', escCloseHandler);
258
- }
259
- });
260
- (0,external_vue_.onBeforeUnmount)(function () {
261
- if (props.escClose) {
262
- removeEventListener('keydown', escCloseHandler);
263
- }
264
- });
265
- (0,external_vue_.watch)(function () {
266
- return props.isShow;
267
- }, function (val) {
268
- if (!val) {
269
- setTimeout(function () {
270
- data.moveStyle = {
271
- top: '50%',
272
- left: '50%'
273
- };
274
- data.positionX = 0;
275
- data.positionY = 0;
276
- isModalShow.value = false;
277
- }, 250);
278
- } else {
279
- isModalShow.value = true;
280
- }
281
-
282
- emit('value-change', val);
283
- }); // 关闭弹框
284
-
285
- var handleClose = function handleClose() {
286
- emit('update:isShow', false);
287
- emit('closed');
288
- isModalShow.value = false;
289
- };
290
-
291
- var handleConfirm = function handleConfirm() {
292
- emit('update:isShow', false);
293
- emit('confirm'); // isModalShow.value = false; 影响异步关闭
294
- };
295
-
296
- var hasFooter = (0,external_vue_.computed)(function () {
297
- return ['process', 'operation', 'confirm'].includes(props.dialogType);
298
- }); // 按 esc 关闭弹框
299
-
300
- var escCloseHandler = function escCloseHandler(e) {
301
- if (props.isShow && props.closeIcon) {
302
- if (e.keyCode === 27) {
303
- handleClose();
304
- }
305
- }
306
- }; // 上一步
307
-
308
-
309
- var handlePrevStep = function handlePrevStep() {
310
- emit('prev');
311
- }; // 下一步
312
-
313
-
314
- var handleNextStep = function handleNextStep() {
315
- emit('next');
316
- }; // 拖拽事件
317
-
318
-
319
- var moveHandler = function moveHandler(e) {
320
- if (props.fullscreen) {
321
- return false;
322
- }
323
-
324
- if (!props.draggable) {
325
- return false;
326
- }
327
-
328
- var odiv = e.target;
329
- var parentHeight = e.currentTarget.parentNode.parentNode.offsetHeight;
330
- var parentWidth = e.currentTarget.parentNode.parentNode.offsetWidth;
331
- var disX;
332
- var disY;
333
-
334
- if (data.positionX !== 0 && data.positionY !== 0) {
335
- disX = e.clientX - data.positionX;
336
- disY = e.clientY - data.positionY;
337
- } else {
338
- disX = e.clientX - odiv.offsetLeft;
339
- disY = e.clientY - odiv.offsetTop;
340
- }
341
-
342
- document.onmousemove = function (e) {
343
- var boxLeft = window.innerWidth - parentWidth;
344
- var boxTop = window.innerHeight - parentHeight;
345
- var left = e.clientX - disX;
346
- var top = e.clientY - disY;
347
-
348
- if (boxLeft / 2 - left <= 0) {
349
- left = boxLeft / 2;
350
- } else if (boxLeft / 2 + left <= 0) {
351
- left = -boxLeft / 2;
352
- }
353
-
354
- if (boxTop / 2 - top <= 0) {
355
- top = boxTop / 2;
356
- } else if (boxTop / 2 + top <= 0) {
357
- top = -boxTop / 2;
358
- }
359
-
360
- data.positionX = left;
361
- data.positionY = top;
362
- data.moveStyle.left = "calc(50% + ".concat(left, "px)");
363
- data.moveStyle.top = "calc(50% + ".concat(top, "px)");
364
- };
365
-
366
- document.onmouseup = function () {
367
- document.onmousemove = null;
368
- document.onmouseup = null;
369
- };
370
- };
371
-
372
- return {
373
- data: data,
374
- handleClose: handleClose,
375
- handleConfirm: handleConfirm,
376
- escCloseHandler: escCloseHandler,
377
- moveHandler: moveHandler,
378
- handlePrevStep: handlePrevStep,
379
- handleNextStep: handleNextStep,
380
- hasFooter: hasFooter,
381
- isModalShow: isModalShow
382
- };
383
- },
384
- render: function render() {
385
- var _this = this;
386
-
387
- var renderIcon = function renderIcon() {
388
- var iconMap = {
389
- loading: (0,external_vue_.createVNode)(external_icon_.Spinner, {
390
- "class": [(0,external_shared_.resolveClassName)('info-icon'), 'primary']
391
- }, null),
392
- warning: (0,external_vue_.createVNode)(external_icon_.Warn, {
393
- "class": [(0,external_shared_.resolveClassName)('info-icon'), 'warning']
394
- }, null),
395
- success: (0,external_vue_.createVNode)(external_icon_.Success, {
396
- "class": [(0,external_shared_.resolveClassName)('info-icon'), 'success']
397
- }, null),
398
- danger: (0,external_vue_.createVNode)(external_icon_.Close, {
399
- "class": [(0,external_shared_.resolveClassName)('info-icon'), 'danger']
400
- }, null)
401
- };
402
- return iconMap[_this.infoType];
403
- };
404
-
405
- var dialogSlot = {
406
- header: function header() {
407
- var _a, _b, _c, _d, _e, _f;
408
-
409
- return [(0,external_vue_.createVNode)("div", {
410
- "class": [(0,external_shared_.resolveClassName)('dialog-tool'), _this.fullscreen || !_this.draggable ? '' : 'move', _this.draggable ? 'content-dragging' : ''],
411
- "onMousedown": _this.moveHandler
412
- }, [(_c = (_b = (_a = _this.$slots).tools) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '']), (0,external_vue_.createVNode)("div", {
413
- "class": (0,external_shared_.resolveClassName)('dialog-header')
414
- }, [(0,external_vue_.createVNode)("div", {
415
- "class": (0,external_shared_.resolveClassName)('header-icon')
416
- }, [_this.infoType ? renderIcon() : (0,external_vue_.createVNode)("slot", {
417
- "name": "info-icon"
418
- }, null)]), (0,external_vue_.createVNode)("span", {
419
- "class": (0,external_shared_.resolveClassName)('dialog-title'),
420
- "style": "text-align: ".concat(_this.headerAlign)
421
- }, [(_f = (_e = (_d = _this.$slots).header) === null || _e === void 0 ? void 0 : _e.call(_d)) !== null && _f !== void 0 ? _f : _this.title])])];
422
- },
423
- "default": function _default() {
424
- var _a, _b, _c;
425
-
426
- return (_c = (_b = (_a = _this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : 'default';
427
- },
428
- footer: function footer() {
429
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
430
-
431
- return (0,external_vue_.createVNode)("div", {
432
- "class": (0,external_shared_.resolveClassName)('dialog-footer'),
433
- "style": "text-align: ".concat(_this.footerAlign)
434
- }, [_this.dialogType === 'process' ? (_c = (_b = (_a = _this.$slots).footer) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : (0,external_vue_.createVNode)(external_vue_.Fragment, null, [_this.current === 1 ? '' : (0,external_vue_.createVNode)((external_button_default()), {
435
- "class": (0,external_shared_.resolveClassName)('dialog-perv'),
436
- "onClick": _this.handlePrevStep
437
- }, {
438
- "default": function _default() {
439
- return [_this.prevText];
440
- }
441
- }), _this.current === _this.totalStep ? '' : (0,external_vue_.createVNode)((external_button_default()), {
442
- "class": (0,external_shared_.resolveClassName)('dialog-next'),
443
- "onClick": _this.handleNextStep
444
- }, {
445
- "default": function _default() {
446
- return [_this.nextText];
447
- }
448
- }), _this.current === _this.totalStep ? (0,external_vue_.createVNode)((external_button_default()), {
449
- "onClick": _this.handleConfirm,
450
- "theme": _this.theme,
451
- "loading": _this.isLoading
452
- }, {
453
- "default": function _default() {
454
- return [_this.confirmText];
455
- }
456
- }) : '', (0,external_vue_.createVNode)((external_button_default()), {
457
- "class": (0,external_shared_.resolveClassName)('dialog-cancel'),
458
- "onClick": _this.handleClose,
459
- "disabled": _this.isLoading
460
- }, {
461
- "default": function _default() {
462
- return [_this.cancelText];
463
- }
464
- })]) : '', _this.dialogType === 'operation' ? (_f = (_e = (_d = _this.$slots).footer) === null || _e === void 0 ? void 0 : _e.call(_d)) !== null && _f !== void 0 ? _f : (0,external_vue_.createVNode)(external_vue_.Fragment, null, [(0,external_vue_.createVNode)((external_button_default()), {
465
- "onClick": _this.handleConfirm,
466
- "theme": _this.theme,
467
- "loading": _this.isLoading
468
- }, {
469
- "default": function _default() {
470
- return [_this.confirmText];
471
- }
472
- }), (0,external_vue_.createVNode)((external_button_default()), {
473
- "class": (0,external_shared_.resolveClassName)('dialog-cancel'),
474
- "onClick": _this.handleClose,
475
- "disabled": _this.isLoading
476
- }, {
477
- "default": function _default() {
478
- return [_this.cancelText];
479
- }
480
- })]) : '', _this.dialogType === 'confirm' ? (_j = (_h = (_g = _this.$slots).footer) === null || _h === void 0 ? void 0 : _h.call(_g)) !== null && _j !== void 0 ? _j : (0,external_vue_.createVNode)(external_vue_.Fragment, null, [(0,external_vue_.createVNode)((external_button_default()), {
481
- "onClick": _this.handleConfirm,
482
- "theme": _this.theme,
483
- "loading": _this.isLoading
484
- }, {
485
- "default": function _default() {
486
- return [_this.confirmText];
487
- }
488
- })]) : '']);
489
- },
490
- close: function close() {
491
- return (0,external_vue_.createVNode)("span", {
492
- "class": (0,external_shared_.resolveClassName)('dialog-close'),
493
- "onClick": _this.handleClose
494
- }, [(0,external_vue_.createTextVNode)("+")]);
495
- }
496
- };
497
- var className = "".concat((0,external_shared_.resolveClassName)('dialog-wrapper '), " ").concat(this.scrollable ? 'scroll-able' : '', " ").concat(this.multiInstance ? 'multi-instance' : '', " ").concat(this.hasFooter ? 'has-footer' : 'no-footer');
498
- return (0,external_vue_.createVNode)((external_modal_default()), (0,external_vue_.mergeProps)(this.$props, {
499
- "class": className,
500
- "onClose": this.handleClose,
501
- "isShow": this.isModalShow,
502
- "style": this.data.moveStyle
503
- }), _isSlot(dialogSlot) ? dialogSlot : {
504
- "default": function _default() {
505
- return [dialogSlot];
506
- }
507
- });
508
- }
509
- }));
510
- ;// CONCATENATED MODULE: ../../packages/dialog/src/index.ts
511
- /*
512
- * Tencent is pleased to support the open source community by making
513
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
514
- *
515
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
516
- *
517
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
518
- *
519
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
520
- *
521
- * ---------------------------------------------------
522
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
523
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
524
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
525
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
526
- *
527
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
528
- * the Software.
529
- *
530
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
531
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
532
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
533
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
534
- * IN THE SOFTWARE.
535
- */
536
-
537
-
538
- var BkDialog = (0,external_shared_.withInstall)(dialog);
539
- /* harmony default export */ const src = (BkDialog);
540
- })();
541
-
542
- /******/ return __webpack_exports__;
543
- /******/ })()
544
- ;
545
- });
1
+ !function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("../shared"),require("vue"),require("../button"),require("../icon"),require("../modal"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../button","../icon","../modal"],o);else{var t="object"==typeof exports?o(require("../shared"),require("vue"),require("../button"),require("../icon"),require("../modal")):o(e["../shared"],e.vue,e["../button"],e["../icon"],e["../modal"]);for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(self,((e,o,t,n,r)=>(()=>{"use strict";var l={4976:e=>{e.exports=t},6870:e=>{e.exports=n},8014:e=>{e.exports=r},4212:o=>{o.exports=e},748:e=>{e.exports=o}},a={};function i(e){var o=a[e];if(void 0!==o)return o.exports;var t=a[e]={exports:{}};return l[e](t,t.exports,i),t.exports}i.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return i.d(o,{a:o}),o},i.d=(e,o)=>{for(var t in o)i.o(o,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},i.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{i.r(s),i.d(s,{default:()=>u});var e=i(4212),o=i(748),t=i(4976),n=i.n(t),r=i(6870),l=i(8014),a=i.n(l);const c=Object.assign(Object.assign({},l.propsMixin),{width:e.PropTypes.oneOfType([String,Number]).def(""),height:e.PropTypes.oneOfType([String,Number]).def(""),confirmText:e.PropTypes.string.def("确定"),cancelText:e.PropTypes.string.def("取消"),prevText:e.PropTypes.string.def("上一步"),nextText:e.PropTypes.string.def("下一步"),current:e.PropTypes.number.def(1),totalStep:e.PropTypes.number,title:e.PropTypes.string.def("title"),headerAlign:(0,e.alignType)().def(e.AlignEnum.LEFT),footerAlign:(0,e.alignType)().def(e.AlignEnum.RIGHT),theme:e.PropTypes.theme().def(e.ThemeEnum.PRIMARY),dialogType:(0,e.dialogTypeUnion)(),isLoading:e.PropTypes.bool.def(!1)}),d=(0,o.defineComponent)({name:"Dialog",components:{BkModal:a(),BkButton:n()},props:c,emits:["closed","update:isShow","confirm","prev","next","value-change"],setup:function(e,t){var n=t.emit,r=(0,o.reactive)({positionX:0,positionY:0,moveStyle:{top:"",left:""}}),l=(0,o.ref)(e.isShow);(0,o.onMounted)((function(){e.escClose&&addEventListener("keydown",s)})),(0,o.onBeforeUnmount)((function(){e.escClose&&removeEventListener("keydown",s)})),(0,o.watch)((function(){return e.isShow}),(function(e){e?l.value=!0:setTimeout((function(){r.moveStyle={top:"50%",left:"50%"},r.positionX=0,r.positionY=0,l.value=!1}),250),n("value-change",e)}));var a=function(){n("update:isShow",!1),n("closed"),l.value=!1},i=(0,o.computed)((function(){return["process","operation","confirm"].includes(e.dialogType)})),s=function(o){e.isShow&&e.closeIcon&&27===o.keyCode&&a()};return{data:r,handleClose:a,handleConfirm:function(){n("update:isShow",!1),n("confirm")},escCloseHandler:s,moveHandler:function(o){if(e.fullscreen)return!1;if(!e.draggable)return!1;var t,n,l=o.target,a=o.currentTarget.parentNode.parentNode.offsetHeight,i=o.currentTarget.parentNode.parentNode.offsetWidth;0!==r.positionX&&0!==r.positionY?(t=o.clientX-r.positionX,n=o.clientY-r.positionY):(t=o.clientX-l.offsetLeft,n=o.clientY-l.offsetTop),document.onmousemove=function(e){var o=window.innerWidth-i,l=window.innerHeight-a,s=e.clientX-t,c=e.clientY-n;o/2-s<=0?s=o/2:o/2+s<=0&&(s=-o/2),l/2-c<=0?c=l/2:l/2+c<=0&&(c=-l/2),r.positionX=s,r.positionY=c,r.moveStyle.left="calc(50% + ".concat(s,"px)"),r.moveStyle.top="calc(50% + ".concat(c,"px)")},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}},handlePrevStep:function(){n("prev")},handleNextStep:function(){n("next")},hasFooter:i,isModalShow:l}},render:function(){var t,l=this,i={header:function(){var t,n,a,i,s,c;return[(0,o.createVNode)("div",{class:[(0,e.resolveClassName)("dialog-tool"),l.fullscreen||!l.draggable?"":"move",l.draggable?"content-dragging":""],onMousedown:l.moveHandler},[null!==(a=null===(n=(t=l.$slots).tools)||void 0===n?void 0:n.call(t))&&void 0!==a?a:""]),(0,o.createVNode)("div",{class:(0,e.resolveClassName)("dialog-header")},[(0,o.createVNode)("div",{class:(0,e.resolveClassName)("header-icon")},[l.infoType?{loading:(0,o.createVNode)(r.Spinner,{class:[(0,e.resolveClassName)("info-icon"),"primary"]},null),warning:(0,o.createVNode)(r.Warn,{class:[(0,e.resolveClassName)("info-icon"),"warning"]},null),success:(0,o.createVNode)(r.Success,{class:[(0,e.resolveClassName)("info-icon"),"success"]},null),danger:(0,o.createVNode)(r.Close,{class:[(0,e.resolveClassName)("info-icon"),"danger"]},null)}[l.infoType]:(0,o.createVNode)("slot",{name:"info-icon"},null)]),(0,o.createVNode)("span",{class:(0,e.resolveClassName)("dialog-title"),style:"text-align: ".concat(l.headerAlign)},[null!==(c=null===(s=(i=l.$slots).header)||void 0===s?void 0:s.call(i))&&void 0!==c?c:l.title])])]},default:function(){var e,o,t;return null!==(t=null===(o=(e=l.$slots).default)||void 0===o?void 0:o.call(e))&&void 0!==t?t:"default"},footer:function(){var t,r,a,i,s,c,d,u,f;return(0,o.createVNode)("div",{class:(0,e.resolveClassName)("dialog-footer"),style:"text-align: ".concat(l.footerAlign)},["process"===l.dialogType?null!==(a=null===(r=(t=l.$slots).footer)||void 0===r?void 0:r.call(t))&&void 0!==a?a:(0,o.createVNode)(o.Fragment,null,[1===l.current?"":(0,o.createVNode)(n(),{class:(0,e.resolveClassName)("dialog-perv"),onClick:l.handlePrevStep},{default:function(){return[l.prevText]}}),l.current===l.totalStep?"":(0,o.createVNode)(n(),{class:(0,e.resolveClassName)("dialog-next"),onClick:l.handleNextStep},{default:function(){return[l.nextText]}}),l.current===l.totalStep?(0,o.createVNode)(n(),{onClick:l.handleConfirm,theme:l.theme,loading:l.isLoading},{default:function(){return[l.confirmText]}}):"",(0,o.createVNode)(n(),{class:(0,e.resolveClassName)("dialog-cancel"),onClick:l.handleClose,disabled:l.isLoading},{default:function(){return[l.cancelText]}})]):"","operation"===l.dialogType?null!==(c=null===(s=(i=l.$slots).footer)||void 0===s?void 0:s.call(i))&&void 0!==c?c:(0,o.createVNode)(o.Fragment,null,[(0,o.createVNode)(n(),{onClick:l.handleConfirm,theme:l.theme,loading:l.isLoading},{default:function(){return[l.confirmText]}}),(0,o.createVNode)(n(),{class:(0,e.resolveClassName)("dialog-cancel"),onClick:l.handleClose,disabled:l.isLoading},{default:function(){return[l.cancelText]}})]):"","confirm"===l.dialogType?null!==(f=null===(u=(d=l.$slots).footer)||void 0===u?void 0:u.call(d))&&void 0!==f?f:(0,o.createVNode)(o.Fragment,null,[(0,o.createVNode)(n(),{onClick:l.handleConfirm,theme:l.theme,loading:l.isLoading},{default:function(){return[l.confirmText]}})]):""])},close:function(){return(0,o.createVNode)("span",{class:(0,e.resolveClassName)("dialog-close"),onClick:l.handleClose},[(0,o.createTextVNode)("+")])}},s="".concat((0,e.resolveClassName)("dialog-wrapper ")," ").concat(this.scrollable?"scroll-able":""," ").concat(this.multiInstance?"multi-instance":""," ").concat(this.hasFooter?"has-footer":"no-footer");return(0,o.createVNode)(a(),(0,o.mergeProps)(this.$props,{class:s,onClose:this.handleClose,isShow:this.isModalShow,style:this.data.moveStyle}),"function"==typeof(t=i)||"[object Object]"===Object.prototype.toString.call(t)&&!(0,o.isVNode)(t)?i:{default:function(){return[i]}})}}),u=(0,e.withInstall)(d)})(),s})()));