bkui-vue 0.0.2-beta.78 → 0.0.2-beta.79

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 (211) hide show
  1. package/dist/index.cjs.js +64 -64
  2. package/dist/index.esm.js +12188 -12269
  3. package/dist/index.umd.js +65 -65
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -321
  7. package/lib/alert/index.js +1 -214
  8. package/lib/animate-number/index.js +1 -155
  9. package/lib/backtop/index.js +1 -188
  10. package/lib/badge/index.js +1 -235
  11. package/lib/breadcrumb/index.js +1 -309
  12. package/lib/button/index.js +1 -321
  13. package/lib/card/index.js +1 -285
  14. package/lib/cascader/index.js +2 -2036
  15. package/lib/cascader/index.js.LICENSE.txt +1 -0
  16. package/lib/checkbox/index.js +1 -542
  17. package/lib/code-diff/index.js +1 -5501
  18. package/lib/collapse/index.js +1 -570
  19. package/lib/collapse-transition/index.js +1 -178
  20. package/lib/color-picker/index.js +1 -2665
  21. package/lib/components.js +1 -530
  22. package/lib/config-provider/index.js +1 -365
  23. package/lib/container/index.js +1 -391
  24. package/lib/date-picker/index.js +1 -5527
  25. package/lib/dialog/dialog.css +2 -0
  26. package/lib/dialog/dialog.variable.css +2 -0
  27. package/lib/dialog/index.js +2 -975
  28. package/lib/dialog/index.js.LICENSE.txt +1 -0
  29. package/lib/directives/index.js +2 -1375
  30. package/lib/directives/index.js.LICENSE.txt +14 -0
  31. package/lib/dist.index.js +1 -87
  32. package/lib/divider/index.js +1 -169
  33. package/lib/dropdown/index.js +1 -369
  34. package/lib/exception/index.js +1 -385
  35. package/lib/fixed-navbar/index.js +1 -154
  36. package/lib/form/index.js +1 -924
  37. package/lib/hooks.js +1 -73
  38. package/lib/icon/angle-double-down-line.js +1 -191
  39. package/lib/icon/angle-double-left-line.js +1 -191
  40. package/lib/icon/angle-double-left.js +1 -191
  41. package/lib/icon/angle-double-right-line.js +1 -191
  42. package/lib/icon/angle-double-right.js +1 -191
  43. package/lib/icon/angle-double-up-line.js +1 -191
  44. package/lib/icon/angle-down-fill.js +1 -191
  45. package/lib/icon/angle-down-line.js +1 -191
  46. package/lib/icon/angle-down.js +1 -191
  47. package/lib/icon/angle-left.js +1 -191
  48. package/lib/icon/angle-right.js +1 -191
  49. package/lib/icon/angle-up-fill.js +1 -191
  50. package/lib/icon/angle-up.js +1 -191
  51. package/lib/icon/archive-fill.js +1 -191
  52. package/lib/icon/arrows-left.js +1 -191
  53. package/lib/icon/arrows-right.js +1 -191
  54. package/lib/icon/assistant.js +1 -191
  55. package/lib/icon/audio-fill.js +1 -191
  56. package/lib/icon/bk.js +1 -191
  57. package/lib/icon/circle.js +1 -191
  58. package/lib/icon/close-line.js +1 -191
  59. package/lib/icon/close.js +1 -191
  60. package/lib/icon/code.js +1 -191
  61. package/lib/icon/cog-shape.js +1 -191
  62. package/lib/icon/collapse-left.js +1 -191
  63. package/lib/icon/copy-shape.js +1 -191
  64. package/lib/icon/copy.js +1 -191
  65. package/lib/icon/data-shape.js +1 -191
  66. package/lib/icon/del.js +1 -191
  67. package/lib/icon/doc-fill.js +1 -191
  68. package/lib/icon/done.js +1 -191
  69. package/lib/icon/down-shape.js +1 -191
  70. package/lib/icon/down-small.js +1 -191
  71. package/lib/icon/edit-line.js +1 -191
  72. package/lib/icon/ellipsis.js +1 -191
  73. package/lib/icon/enlarge-line.js +1 -191
  74. package/lib/icon/error.js +1 -191
  75. package/lib/icon/excel-fill.js +1 -191
  76. package/lib/icon/exclamation-circle-shape.js +1 -191
  77. package/lib/icon/eye.js +1 -191
  78. package/lib/icon/filliscreen-line.js +1 -191
  79. package/lib/icon/fix-line.js +1 -191
  80. package/lib/icon/fix-shape.js +1 -191
  81. package/lib/icon/folder-open.js +1 -191
  82. package/lib/icon/folder-shape-open.js +1 -191
  83. package/lib/icon/folder-shape.js +1 -191
  84. package/lib/icon/folder.js +1 -191
  85. package/lib/icon/funnel.js +1 -191
  86. package/lib/icon/help-document-fill.js +1 -191
  87. package/lib/icon/help-fill.js +1 -191
  88. package/lib/icon/help.js +1 -191
  89. package/lib/icon/image-fill.js +1 -276
  90. package/lib/icon/img-error.js +1 -276
  91. package/lib/icon/img-placehoulder.js +1 -276
  92. package/lib/icon/index.js +1 -2399
  93. package/lib/icon/info-line.js +1 -276
  94. package/lib/icon/info.js +1 -276
  95. package/lib/icon/left-shape.js +1 -276
  96. package/lib/icon/left-turn-line.js +1 -276
  97. package/lib/icon/narrow-line.js +1 -276
  98. package/lib/icon/original.js +1 -276
  99. package/lib/icon/pdf-fill.js +1 -276
  100. package/lib/icon/play-shape.js +1 -276
  101. package/lib/icon/plus.js +1 -276
  102. package/lib/icon/ppt-fill.js +1 -276
  103. package/lib/icon/qq.js +1 -276
  104. package/lib/icon/right-shape.js +1 -276
  105. package/lib/icon/right-turn-line.js +1 -276
  106. package/lib/icon/search.js +1 -276
  107. package/lib/icon/share.js +1 -276
  108. package/lib/icon/spinner.js +1 -276
  109. package/lib/icon/success.js +1 -276
  110. package/lib/icon/switcher-loading.js +1 -276
  111. package/lib/icon/text-file.js +1 -276
  112. package/lib/icon/text-fill.js +1 -276
  113. package/lib/icon/transfer.js +1 -276
  114. package/lib/icon/tree-application-shape.js +1 -276
  115. package/lib/icon/unfull-screen.js +1 -276
  116. package/lib/icon/unvisible.js +1 -276
  117. package/lib/icon/up-shape.js +1 -276
  118. package/lib/icon/upload.js +1 -276
  119. package/lib/icon/video-fill.js +1 -276
  120. package/lib/icon/warn.js +1 -276
  121. package/lib/icon/weixin-pro.js +1 -276
  122. package/lib/icon/weixin.js +1 -276
  123. package/lib/image/index.js +1 -641
  124. package/lib/index.js +1 -97
  125. package/lib/info-box/index.js +2 -1165
  126. package/lib/info-box/index.js.LICENSE.txt +1 -0
  127. package/lib/info-box/info-box.css +2 -0
  128. package/lib/info-box/info-box.less +2 -1
  129. package/lib/info-box/info-box.variable.css +2 -0
  130. package/lib/input/index.js +2 -1218
  131. package/lib/input/index.js.LICENSE.txt +1 -0
  132. package/lib/link/index.js +1 -160
  133. package/lib/loading/index.js +1 -381
  134. package/lib/locale/index.js +1 -465
  135. package/lib/menu/index.js +1 -724
  136. package/lib/message/index.js +2 -1795
  137. package/lib/message/index.js.LICENSE.txt +6 -0
  138. package/lib/modal/index.js +1 -396
  139. package/lib/modal/modal.css +2 -0
  140. package/lib/modal/modal.variable.css +2 -0
  141. package/lib/navigation/index.js +1 -367
  142. package/lib/notify/index.js +1 -397
  143. package/lib/overflow-title/index.js +1 -486
  144. package/lib/pagination/index.js +1 -880
  145. package/lib/plugin-popover/index.js +1 -3905
  146. package/lib/plugins/index.js +1 -63
  147. package/lib/pop-confirm/index.js +1 -273
  148. package/lib/popover/index.js +1 -3913
  149. package/lib/popover2/index.js +1 -107
  150. package/lib/preset.js +1 -93
  151. package/lib/process/index.js +2 -759
  152. package/lib/process/index.js.LICENSE.txt +1 -0
  153. package/lib/progress/index.js +1 -431
  154. package/lib/radio/index.js +1 -627
  155. package/lib/rate/index.js +1 -338
  156. package/lib/resize-layout/index.js +1 -429
  157. package/lib/search-select/index.js +2 -2729
  158. package/lib/search-select/index.js.LICENSE.txt +1 -0
  159. package/lib/select/index.js +2 -2240
  160. package/lib/select/index.js.LICENSE.txt +1 -0
  161. package/lib/shared/index.js +1 -2689
  162. package/lib/sideslider/index.js +2 -714
  163. package/lib/sideslider/index.js.LICENSE.txt +1 -0
  164. package/lib/slider/index.js +2 -1291
  165. package/lib/slider/index.js.LICENSE.txt +1 -0
  166. package/lib/steps/index.js +2 -825
  167. package/lib/steps/index.js.LICENSE.txt +1 -0
  168. package/lib/swiper/index.js +1 -336
  169. package/lib/switcher/index.js +1 -277
  170. package/lib/tab/index.js +1 -914
  171. package/lib/table/components/table-column.d.ts +2 -0
  172. package/lib/table/const.d.ts +24 -2
  173. package/lib/table/index.d.ts +38 -0
  174. package/lib/table/index.js +1 -6406
  175. package/lib/table/plugins/use-column-resize.d.ts +30 -10
  176. package/lib/table/plugins/use-fixed-column.d.ts +9 -9
  177. package/lib/table/plugins/use-pagination.d.ts +7 -4
  178. package/lib/table/props.d.ts +22 -1
  179. package/lib/table/render.d.ts +7 -17
  180. package/lib/table/table.css +4 -1
  181. package/lib/table/table.d.ts +44 -23
  182. package/lib/table/table.less +4 -1
  183. package/lib/table/table.variable.css +4 -1
  184. package/lib/table/use-attributes.d.ts +55 -0
  185. package/lib/table/use-column.d.ts +177 -53
  186. package/lib/table/use-common.d.ts +1602 -76
  187. package/lib/table/use-render.d.ts +11 -0
  188. package/lib/table/utils.d.ts +22 -16
  189. package/lib/table-column/index.d.ts +6 -0
  190. package/lib/table-column/index.js +1 -731
  191. package/lib/tag/index.js +1 -233
  192. package/lib/tag-input/index.js +1 -1660
  193. package/lib/time-picker/index.js +1 -71
  194. package/lib/timeline/index.js +1 -241
  195. package/lib/transfer/index.js +1 -673
  196. package/lib/tree/index.d.ts +12 -0
  197. package/lib/tree/index.js +1 -2445
  198. package/lib/tree/props.d.ts +8 -1
  199. package/lib/tree/tree.d.ts +7 -0
  200. package/lib/tree/use-node-action.d.ts +2 -1
  201. package/lib/tree/use-node-attribute.d.ts +2 -0
  202. package/lib/tree/use-search.d.ts +2 -2
  203. package/lib/tree/util.d.ts +2 -2
  204. package/lib/upload/index.js +2 -2874
  205. package/lib/upload/index.js.LICENSE.txt +1 -0
  206. package/lib/virtual-render/index.d.ts +12 -0
  207. package/lib/virtual-render/index.js +1 -792
  208. package/lib/virtual-render/props.d.ts +4 -0
  209. package/lib/virtual-render/v-virtual-render.d.ts +19 -1
  210. package/lib/virtual-render/virtual-render.d.ts +7 -0
  211. package/package.json +1 -2
@@ -1,975 +1,2 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
2
- import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
3
- import * as __WEBPACK_EXTERNAL_MODULE__button_59c00871__ from "../button";
4
- import * as __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__ from "../config-provider";
5
- import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
6
- import * as __WEBPACK_EXTERNAL_MODULE__modal_4c8fdca5__ from "../modal";
7
- /******/ var __webpack_modules__ = ({
8
-
9
- /***/ 7609:
10
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11
-
12
- var _typeof = (__webpack_require__(7425)["default"]);
13
- function _regeneratorRuntime() {
14
- "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
15
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
16
- return exports;
17
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
18
- var exports = {},
19
- Op = Object.prototype,
20
- hasOwn = Op.hasOwnProperty,
21
- defineProperty = Object.defineProperty || function (obj, key, desc) {
22
- obj[key] = desc.value;
23
- },
24
- $Symbol = "function" == typeof Symbol ? Symbol : {},
25
- iteratorSymbol = $Symbol.iterator || "@@iterator",
26
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
27
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
28
- function define(obj, key, value) {
29
- return Object.defineProperty(obj, key, {
30
- value: value,
31
- enumerable: !0,
32
- configurable: !0,
33
- writable: !0
34
- }), obj[key];
35
- }
36
- try {
37
- define({}, "");
38
- } catch (err) {
39
- define = function define(obj, key, value) {
40
- return obj[key] = value;
41
- };
42
- }
43
- function wrap(innerFn, outerFn, self, tryLocsList) {
44
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
45
- generator = Object.create(protoGenerator.prototype),
46
- context = new Context(tryLocsList || []);
47
- return defineProperty(generator, "_invoke", {
48
- value: makeInvokeMethod(innerFn, self, context)
49
- }), generator;
50
- }
51
- function tryCatch(fn, obj, arg) {
52
- try {
53
- return {
54
- type: "normal",
55
- arg: fn.call(obj, arg)
56
- };
57
- } catch (err) {
58
- return {
59
- type: "throw",
60
- arg: err
61
- };
62
- }
63
- }
64
- exports.wrap = wrap;
65
- var ContinueSentinel = {};
66
- function Generator() {}
67
- function GeneratorFunction() {}
68
- function GeneratorFunctionPrototype() {}
69
- var IteratorPrototype = {};
70
- define(IteratorPrototype, iteratorSymbol, function () {
71
- return this;
72
- });
73
- var getProto = Object.getPrototypeOf,
74
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
75
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
76
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
77
- function defineIteratorMethods(prototype) {
78
- ["next", "throw", "return"].forEach(function (method) {
79
- define(prototype, method, function (arg) {
80
- return this._invoke(method, arg);
81
- });
82
- });
83
- }
84
- function AsyncIterator(generator, PromiseImpl) {
85
- function invoke(method, arg, resolve, reject) {
86
- var record = tryCatch(generator[method], generator, arg);
87
- if ("throw" !== record.type) {
88
- var result = record.arg,
89
- value = result.value;
90
- return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
91
- invoke("next", value, resolve, reject);
92
- }, function (err) {
93
- invoke("throw", err, resolve, reject);
94
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
95
- result.value = unwrapped, resolve(result);
96
- }, function (error) {
97
- return invoke("throw", error, resolve, reject);
98
- });
99
- }
100
- reject(record.arg);
101
- }
102
- var previousPromise;
103
- defineProperty(this, "_invoke", {
104
- value: function value(method, arg) {
105
- function callInvokeWithMethodAndArg() {
106
- return new PromiseImpl(function (resolve, reject) {
107
- invoke(method, arg, resolve, reject);
108
- });
109
- }
110
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
111
- }
112
- });
113
- }
114
- function makeInvokeMethod(innerFn, self, context) {
115
- var state = "suspendedStart";
116
- return function (method, arg) {
117
- if ("executing" === state) throw new Error("Generator is already running");
118
- if ("completed" === state) {
119
- if ("throw" === method) throw arg;
120
- return doneResult();
121
- }
122
- for (context.method = method, context.arg = arg;;) {
123
- var delegate = context.delegate;
124
- if (delegate) {
125
- var delegateResult = maybeInvokeDelegate(delegate, context);
126
- if (delegateResult) {
127
- if (delegateResult === ContinueSentinel) continue;
128
- return delegateResult;
129
- }
130
- }
131
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
132
- if ("suspendedStart" === state) throw state = "completed", context.arg;
133
- context.dispatchException(context.arg);
134
- } else "return" === context.method && context.abrupt("return", context.arg);
135
- state = "executing";
136
- var record = tryCatch(innerFn, self, context);
137
- if ("normal" === record.type) {
138
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
139
- return {
140
- value: record.arg,
141
- done: context.done
142
- };
143
- }
144
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
145
- }
146
- };
147
- }
148
- function maybeInvokeDelegate(delegate, context) {
149
- var methodName = context.method,
150
- method = delegate.iterator[methodName];
151
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
152
- var record = tryCatch(method, delegate.iterator, context.arg);
153
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
154
- var info = record.arg;
155
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
156
- }
157
- function pushTryEntry(locs) {
158
- var entry = {
159
- tryLoc: locs[0]
160
- };
161
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
162
- }
163
- function resetTryEntry(entry) {
164
- var record = entry.completion || {};
165
- record.type = "normal", delete record.arg, entry.completion = record;
166
- }
167
- function Context(tryLocsList) {
168
- this.tryEntries = [{
169
- tryLoc: "root"
170
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
171
- }
172
- function values(iterable) {
173
- if (iterable) {
174
- var iteratorMethod = iterable[iteratorSymbol];
175
- if (iteratorMethod) return iteratorMethod.call(iterable);
176
- if ("function" == typeof iterable.next) return iterable;
177
- if (!isNaN(iterable.length)) {
178
- var i = -1,
179
- next = function next() {
180
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
181
- return next.value = undefined, next.done = !0, next;
182
- };
183
- return next.next = next;
184
- }
185
- }
186
- return {
187
- next: doneResult
188
- };
189
- }
190
- function doneResult() {
191
- return {
192
- value: undefined,
193
- done: !0
194
- };
195
- }
196
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
197
- value: GeneratorFunctionPrototype,
198
- configurable: !0
199
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
200
- value: GeneratorFunction,
201
- configurable: !0
202
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
203
- var ctor = "function" == typeof genFun && genFun.constructor;
204
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
205
- }, exports.mark = function (genFun) {
206
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
207
- }, exports.awrap = function (arg) {
208
- return {
209
- __await: arg
210
- };
211
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
212
- return this;
213
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
214
- void 0 === PromiseImpl && (PromiseImpl = Promise);
215
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
216
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
217
- return result.done ? result.value : iter.next();
218
- });
219
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
220
- return this;
221
- }), define(Gp, "toString", function () {
222
- return "[object Generator]";
223
- }), exports.keys = function (val) {
224
- var object = Object(val),
225
- keys = [];
226
- for (var key in object) keys.push(key);
227
- return keys.reverse(), function next() {
228
- for (; keys.length;) {
229
- var key = keys.pop();
230
- if (key in object) return next.value = key, next.done = !1, next;
231
- }
232
- return next.done = !0, next;
233
- };
234
- }, exports.values = values, Context.prototype = {
235
- constructor: Context,
236
- reset: function reset(skipTempReset) {
237
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
238
- },
239
- stop: function stop() {
240
- this.done = !0;
241
- var rootRecord = this.tryEntries[0].completion;
242
- if ("throw" === rootRecord.type) throw rootRecord.arg;
243
- return this.rval;
244
- },
245
- dispatchException: function dispatchException(exception) {
246
- if (this.done) throw exception;
247
- var context = this;
248
- function handle(loc, caught) {
249
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
250
- }
251
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
252
- var entry = this.tryEntries[i],
253
- record = entry.completion;
254
- if ("root" === entry.tryLoc) return handle("end");
255
- if (entry.tryLoc <= this.prev) {
256
- var hasCatch = hasOwn.call(entry, "catchLoc"),
257
- hasFinally = hasOwn.call(entry, "finallyLoc");
258
- if (hasCatch && hasFinally) {
259
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
260
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
261
- } else if (hasCatch) {
262
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
263
- } else {
264
- if (!hasFinally) throw new Error("try statement without catch or finally");
265
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
266
- }
267
- }
268
- }
269
- },
270
- abrupt: function abrupt(type, arg) {
271
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
272
- var entry = this.tryEntries[i];
273
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
274
- var finallyEntry = entry;
275
- break;
276
- }
277
- }
278
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
279
- var record = finallyEntry ? finallyEntry.completion : {};
280
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
281
- },
282
- complete: function complete(record, afterLoc) {
283
- if ("throw" === record.type) throw record.arg;
284
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
285
- },
286
- finish: function finish(finallyLoc) {
287
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
288
- var entry = this.tryEntries[i];
289
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
290
- }
291
- },
292
- "catch": function _catch(tryLoc) {
293
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
294
- var entry = this.tryEntries[i];
295
- if (entry.tryLoc === tryLoc) {
296
- var record = entry.completion;
297
- if ("throw" === record.type) {
298
- var thrown = record.arg;
299
- resetTryEntry(entry);
300
- }
301
- return thrown;
302
- }
303
- }
304
- throw new Error("illegal catch attempt");
305
- },
306
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
307
- return this.delegate = {
308
- iterator: values(iterable),
309
- resultName: resultName,
310
- nextLoc: nextLoc
311
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
312
- }
313
- }, exports;
314
- }
315
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
316
-
317
- /***/ }),
318
-
319
- /***/ 7425:
320
- /***/ ((module) => {
321
-
322
- function _typeof(obj) {
323
- "@babel/helpers - typeof";
324
-
325
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
326
- return typeof obj;
327
- } : function (obj) {
328
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
329
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
330
- }
331
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
332
-
333
- /***/ }),
334
-
335
- /***/ 2841:
336
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
337
-
338
- // TODO(Babel 8): Remove this file.
339
-
340
- var runtime = __webpack_require__(7609)();
341
- module.exports = runtime;
342
-
343
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
344
- try {
345
- regeneratorRuntime = runtime;
346
- } catch (accidentalStrictMode) {
347
- if (typeof globalThis === "object") {
348
- globalThis.regeneratorRuntime = runtime;
349
- } else {
350
- Function("r", "regeneratorRuntime = r")(runtime);
351
- }
352
- }
353
-
354
-
355
- /***/ })
356
-
357
- /******/ });
358
- /************************************************************************/
359
- /******/ // The module cache
360
- /******/ var __webpack_module_cache__ = {};
361
- /******/
362
- /******/ // The require function
363
- /******/ function __webpack_require__(moduleId) {
364
- /******/ // Check if module is in cache
365
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
366
- /******/ if (cachedModule !== undefined) {
367
- /******/ return cachedModule.exports;
368
- /******/ }
369
- /******/ // Create a new module (and put it into the cache)
370
- /******/ var module = __webpack_module_cache__[moduleId] = {
371
- /******/ // no module.id needed
372
- /******/ // no module.loaded needed
373
- /******/ exports: {}
374
- /******/ };
375
- /******/
376
- /******/ // Execute the module function
377
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
378
- /******/
379
- /******/ // Return the exports of the module
380
- /******/ return module.exports;
381
- /******/ }
382
- /******/
383
- /************************************************************************/
384
- /******/ /* webpack/runtime/compat get default export */
385
- /******/ (() => {
386
- /******/ // getDefaultExport function for compatibility with non-harmony modules
387
- /******/ __webpack_require__.n = (module) => {
388
- /******/ var getter = module && module.__esModule ?
389
- /******/ () => (module['default']) :
390
- /******/ () => (module);
391
- /******/ __webpack_require__.d(getter, { a: getter });
392
- /******/ return getter;
393
- /******/ };
394
- /******/ })();
395
- /******/
396
- /******/ /* webpack/runtime/define property getters */
397
- /******/ (() => {
398
- /******/ // define getter functions for harmony exports
399
- /******/ __webpack_require__.d = (exports, definition) => {
400
- /******/ for(var key in definition) {
401
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
402
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
403
- /******/ }
404
- /******/ }
405
- /******/ };
406
- /******/ })();
407
- /******/
408
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
409
- /******/ (() => {
410
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
411
- /******/ })();
412
- /******/
413
- /************************************************************************/
414
- var __webpack_exports__ = {};
415
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
416
- (() => {
417
-
418
- // EXPORTS
419
- __webpack_require__.d(__webpack_exports__, {
420
- Z: () => (/* binding */ src)
421
- });
422
-
423
- ;// CONCATENATED MODULE: external "../shared"
424
- var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
425
- var y = x => () => x
426
- const external_shared_namespaceObject = x({ ["AlignEnum"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.AlignEnum, ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["ThemeEnum"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.ThemeEnum, ["alignType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.alignType, ["dialogTypeUnion"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.dialogTypeUnion, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
427
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
428
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
429
- try {
430
- var info = gen[key](arg);
431
- var value = info.value;
432
- } catch (error) {
433
- reject(error);
434
- return;
435
- }
436
- if (info.done) {
437
- resolve(value);
438
- } else {
439
- Promise.resolve(value).then(_next, _throw);
440
- }
441
- }
442
- function _asyncToGenerator(fn) {
443
- return function () {
444
- var self = this,
445
- args = arguments;
446
- return new Promise(function (resolve, reject) {
447
- var gen = fn.apply(self, args);
448
- function _next(value) {
449
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
450
- }
451
- function _throw(err) {
452
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
453
- }
454
- _next(undefined);
455
- });
456
- };
457
- }
458
- ;// CONCATENATED MODULE: external "vue"
459
- var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
460
- var external_vue_y = x => () => x
461
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch });
462
- // EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
463
- var regenerator = __webpack_require__(2841);
464
- var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
465
- ;// CONCATENATED MODULE: external "../button"
466
- var external_button_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
467
- var external_button_y = x => () => x
468
- const external_button_namespaceObject = external_button_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__button_59c00871__["default"] });
469
- ;// CONCATENATED MODULE: external "../config-provider"
470
- var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
471
- var external_config_provider_y = x => () => x
472
- const external_config_provider_namespaceObject = external_config_provider_x({ ["useLocale"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.useLocale, ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
473
- ;// CONCATENATED MODULE: external "../icon"
474
- var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
475
- var external_icon_y = x => () => x
476
- const external_icon_namespaceObject = external_icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Error, ["Spinner"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Spinner, ["Success"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Success, ["Warn"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Warn });
477
- ;// CONCATENATED MODULE: external "../modal"
478
- var external_modal_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
479
- var external_modal_y = x => () => x
480
- const external_modal_namespaceObject = external_modal_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__modal_4c8fdca5__["default"], ["propsMixin"]: () => __WEBPACK_EXTERNAL_MODULE__modal_4c8fdca5__.propsMixin });
481
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
482
- function _typeof(obj) {
483
- "@babel/helpers - typeof";
484
-
485
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
486
- return typeof obj;
487
- } : function (obj) {
488
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
489
- }, _typeof(obj);
490
- }
491
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
492
-
493
- function _toPrimitive(input, hint) {
494
- if (_typeof(input) !== "object" || input === null) return input;
495
- var prim = input[Symbol.toPrimitive];
496
- if (prim !== undefined) {
497
- var res = prim.call(input, hint || "default");
498
- if (_typeof(res) !== "object") return res;
499
- throw new TypeError("@@toPrimitive must return a primitive value.");
500
- }
501
- return (hint === "string" ? String : Number)(input);
502
- }
503
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
504
-
505
-
506
- function _toPropertyKey(arg) {
507
- var key = _toPrimitive(arg, "string");
508
- return _typeof(key) === "symbol" ? key : String(key);
509
- }
510
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
511
-
512
- function _defineProperty(obj, key, value) {
513
- key = _toPropertyKey(key);
514
- if (key in obj) {
515
- Object.defineProperty(obj, key, {
516
- value: value,
517
- enumerable: true,
518
- configurable: true,
519
- writable: true
520
- });
521
- } else {
522
- obj[key] = value;
523
- }
524
- return obj;
525
- }
526
- ;// CONCATENATED MODULE: ../../packages/dialog/src/props.ts
527
-
528
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
529
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
530
- /*
531
- * Tencent is pleased to support the open source community by making
532
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
533
- *
534
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
535
- *
536
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
537
- *
538
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
539
- *
540
- * ---------------------------------------------------
541
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
542
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
543
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
544
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
545
- *
546
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
547
- * the Software.
548
- *
549
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
550
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
551
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
552
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
553
- * IN THE SOFTWARE.
554
- */
555
-
556
-
557
- var props = _objectSpread(_objectSpread({}, external_modal_namespaceObject.propsMixin), {}, {
558
- width: external_shared_namespaceObject.PropTypes.oneOfType([String, Number]).def(''),
559
- height: external_shared_namespaceObject.PropTypes.oneOfType([String, Number]).def(''),
560
- // 确认按钮文字
561
- // confirmText: PropTypes.string.def('确定'),
562
- confirmText: external_shared_namespaceObject.PropTypes.string,
563
- // 取消按钮文字
564
- // cancelText: PropTypes.string.def('取消'),
565
- cancelText: external_shared_namespaceObject.PropTypes.string,
566
- // 步骤按钮文字
567
- // prevText: PropTypes.string.def('上一步'),
568
- prevText: external_shared_namespaceObject.PropTypes.string,
569
- // nextText: PropTypes.string.def('下一步'),
570
- nextText: external_shared_namespaceObject.PropTypes.string,
571
- // 当前步骤
572
- current: external_shared_namespaceObject.PropTypes.number.def(1),
573
- // 总步数
574
- totalStep: external_shared_namespaceObject.PropTypes.number,
575
- // 弹框的标题
576
- title: external_shared_namespaceObject.PropTypes.string.def('title'),
577
- // 显示 header 的位置
578
- headerAlign: (0,external_shared_namespaceObject.alignType)().def(external_shared_namespaceObject.AlignEnum.LEFT),
579
- // 显示 footer 的位置
580
- footerAlign: (0,external_shared_namespaceObject.alignType)().def(external_shared_namespaceObject.AlignEnum.RIGHT),
581
- // 颜色 按钮类型
582
- theme: external_shared_namespaceObject.PropTypes.theme().def(external_shared_namespaceObject.ThemeEnum.PRIMARY),
583
- // 对话框类型
584
- dialogType: (0,external_shared_namespaceObject.dialogTypeUnion)(),
585
- // 按钮loading
586
- isLoading: external_shared_namespaceObject.PropTypes.bool.def(false)
587
- });
588
- /* harmony default export */ const src_props = (props);
589
- ;// CONCATENATED MODULE: ../../packages/dialog/src/dialog.tsx
590
-
591
-
592
-
593
- /*
594
- * Tencent is pleased to support the open source community by making
595
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
596
- *
597
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
598
- *
599
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
600
- *
601
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
602
- *
603
- * ---------------------------------------------------
604
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
605
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
606
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
607
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
608
- *
609
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
610
- * the Software.
611
- *
612
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
613
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
614
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
615
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
616
- * IN THE SOFTWARE.
617
- */
618
-
619
-
620
-
621
-
622
-
623
-
624
- function _isSlot(s) {
625
- return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
626
- }
627
- /* harmony default export */ const dialog = ((0,external_vue_namespaceObject.defineComponent)({
628
- // eslint-disable-next-line vue/no-reserved-component-names
629
- name: 'Dialog',
630
- components: {
631
- BkModal: external_modal_namespaceObject["default"],
632
- BkButton: external_button_namespaceObject["default"]
633
- },
634
- props: src_props,
635
- emits: ['closed', 'update:isShow', 'confirm', 'prev', 'next', 'value-change'],
636
- setup: function setup(props, _ref) {
637
- var emit = _ref.emit;
638
- var t = (0,external_config_provider_namespaceObject.useLocale)('dialog');
639
- var localConfirmText = (0,external_vue_namespaceObject.computed)(function () {
640
- if (props.confirmText === undefined) {
641
- return t.value.ok;
642
- }
643
- return props.confirmText;
644
- });
645
- var localCancelText = (0,external_vue_namespaceObject.computed)(function () {
646
- if (props.cancelText === undefined) {
647
- return t.value.cancel;
648
- }
649
- return props.cancelText;
650
- });
651
- var localPrevText = (0,external_vue_namespaceObject.computed)(function () {
652
- if (props.prevText === undefined) {
653
- return t.value.prev;
654
- }
655
- return props.prevText;
656
- });
657
- var localNextText = (0,external_vue_namespaceObject.computed)(function () {
658
- if (props.nextText === undefined) {
659
- return t.value.next;
660
- }
661
- return props.nextText;
662
- });
663
- var data = (0,external_vue_namespaceObject.reactive)({
664
- positionX: 0,
665
- positionY: 0,
666
- moveStyle: {
667
- top: '',
668
- left: ''
669
- }
670
- });
671
- var isModalShow = (0,external_vue_namespaceObject.ref)(props.isShow);
672
- (0,external_vue_namespaceObject.onMounted)(function () {
673
- if (props.escClose) {
674
- addEventListener('keydown', escCloseHandler);
675
- }
676
- });
677
- (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
678
- if (props.escClose) {
679
- removeEventListener('keydown', escCloseHandler);
680
- }
681
- });
682
- (0,external_vue_namespaceObject.watch)(function () {
683
- return props.isShow;
684
- }, function (val) {
685
- if (!val) {
686
- setTimeout(function () {
687
- data.moveStyle = {
688
- top: '50%',
689
- left: '50%'
690
- };
691
- data.positionX = 0;
692
- data.positionY = 0;
693
- isModalShow.value = false;
694
- }, 250);
695
- } else {
696
- isModalShow.value = true;
697
- }
698
- emit('value-change', val);
699
- });
700
- // 关闭弹框
701
- var handleClose = /*#__PURE__*/function () {
702
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee() {
703
- var shouldClose;
704
- return regenerator_default().wrap(function _callee$(_context) {
705
- while (1) switch (_context.prev = _context.next) {
706
- case 0:
707
- shouldClose = true;
708
- if (!(typeof props.beforeClose === 'function')) {
709
- _context.next = 5;
710
- break;
711
- }
712
- _context.next = 4;
713
- return props.beforeClose();
714
- case 4:
715
- shouldClose = _context.sent;
716
- case 5:
717
- if (shouldClose) {
718
- emit('update:isShow', false);
719
- emit('closed');
720
- isModalShow.value = false;
721
- }
722
- case 6:
723
- case "end":
724
- return _context.stop();
725
- }
726
- }, _callee);
727
- }));
728
- return function handleClose() {
729
- return _ref2.apply(this, arguments);
730
- };
731
- }();
732
- var handleConfirm = function handleConfirm() {
733
- emit('update:isShow', false);
734
- emit('confirm');
735
- // isModalShow.value = false; 影响异步关闭
736
- };
737
-
738
- var hasFooter = (0,external_vue_namespaceObject.computed)(function () {
739
- return ['process', 'operation', 'confirm'].includes(props.dialogType);
740
- });
741
- // 按 esc 关闭弹框
742
- var escCloseHandler = function escCloseHandler(e) {
743
- if (props.isShow && props.closeIcon) {
744
- if (e.keyCode === 27) {
745
- handleClose();
746
- }
747
- }
748
- };
749
- // 上一步
750
- var handlePrevStep = function handlePrevStep() {
751
- emit('prev');
752
- };
753
- // 下一步
754
- var handleNextStep = function handleNextStep() {
755
- emit('next');
756
- };
757
- // 拖拽事件
758
- var moveHandler = function moveHandler(e) {
759
- if (props.fullscreen) {
760
- return false;
761
- }
762
- if (!props.draggable) {
763
- return false;
764
- }
765
- var odiv = e.target;
766
- var parentHeight = e.currentTarget.parentNode.parentNode.offsetHeight;
767
- var parentWidth = e.currentTarget.parentNode.parentNode.offsetWidth;
768
- var disX;
769
- var disY;
770
- if (data.positionX !== 0 && data.positionY !== 0) {
771
- disX = e.clientX - data.positionX;
772
- disY = e.clientY - data.positionY;
773
- } else {
774
- disX = e.clientX - odiv.offsetLeft;
775
- disY = e.clientY - odiv.offsetTop;
776
- }
777
- document.onmousemove = function (e) {
778
- var boxLeft = window.innerWidth - parentWidth;
779
- var boxTop = window.innerHeight - parentHeight;
780
- var left = e.clientX - disX;
781
- var top = e.clientY - disY;
782
- if (boxLeft / 2 - left <= 0) {
783
- left = boxLeft / 2;
784
- } else if (boxLeft / 2 + left <= 0) {
785
- left = -boxLeft / 2;
786
- }
787
- if (boxTop / 2 - top <= 0) {
788
- top = boxTop / 2;
789
- } else if (boxTop / 2 + top <= 0) {
790
- top = -boxTop / 2;
791
- }
792
- data.positionX = left;
793
- data.positionY = top;
794
- data.moveStyle.left = "calc(50% + ".concat(left, "px)");
795
- data.moveStyle.top = "calc(50% + ".concat(top, "px)");
796
- };
797
- document.onmouseup = function () {
798
- document.onmousemove = null;
799
- document.onmouseup = null;
800
- };
801
- };
802
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
803
- resolveClassName = _usePrefix.resolveClassName;
804
- return {
805
- data: data,
806
- handleClose: handleClose,
807
- handleConfirm: handleConfirm,
808
- escCloseHandler: escCloseHandler,
809
- moveHandler: moveHandler,
810
- handlePrevStep: handlePrevStep,
811
- handleNextStep: handleNextStep,
812
- hasFooter: hasFooter,
813
- isModalShow: isModalShow,
814
- localConfirmText: localConfirmText,
815
- localCancelText: localCancelText,
816
- localPrevText: localPrevText,
817
- localNextText: localNextText,
818
- resolveClassName: resolveClassName
819
- };
820
- },
821
- render: function render() {
822
- var _this = this;
823
- var renderIcon = function renderIcon() {
824
- var iconMap = {
825
- loading: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Spinner, {
826
- "class": [_this.resolveClassName('info-icon'), 'primary']
827
- }, null),
828
- warning: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Warn, {
829
- "class": [_this.resolveClassName('info-icon'), 'warning']
830
- }, null),
831
- success: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Success, {
832
- "class": [_this.resolveClassName('info-icon'), 'success']
833
- }, null),
834
- danger: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Close, {
835
- "class": [_this.resolveClassName('info-icon'), 'danger']
836
- }, null)
837
- };
838
- return iconMap[_this.infoType];
839
- };
840
- var dialogSlot = {
841
- header: function header() {
842
- var _this$$slots$tools, _this$$slots$tools2, _this$$slots, _this$$slots$header, _this$$slots$header2, _this$$slots2;
843
- return [(0,external_vue_namespaceObject.createVNode)("div", {
844
- "class": [_this.resolveClassName('dialog-tool'), _this.fullscreen || !_this.draggable ? '' : 'move', _this.draggable ? 'content-dragging' : ''],
845
- "onMousedown": _this.moveHandler
846
- }, [(_this$$slots$tools = (_this$$slots$tools2 = (_this$$slots = _this.$slots).tools) === null || _this$$slots$tools2 === void 0 ? void 0 : _this$$slots$tools2.call(_this$$slots)) !== null && _this$$slots$tools !== void 0 ? _this$$slots$tools : '']), (0,external_vue_namespaceObject.createVNode)("div", {
847
- "class": _this.resolveClassName('dialog-header')
848
- }, [(0,external_vue_namespaceObject.createVNode)("div", {
849
- "class": _this.resolveClassName('header-icon')
850
- }, [_this.infoType ? renderIcon() : (0,external_vue_namespaceObject.createVNode)("slot", {
851
- "name": "info-icon"
852
- }, null)]), (0,external_vue_namespaceObject.createVNode)("span", {
853
- "class": _this.resolveClassName('dialog-title'),
854
- "style": "text-align: ".concat(_this.headerAlign)
855
- }, [(_this$$slots$header = (_this$$slots$header2 = (_this$$slots2 = _this.$slots).header) === null || _this$$slots$header2 === void 0 ? void 0 : _this$$slots$header2.call(_this$$slots2)) !== null && _this$$slots$header !== void 0 ? _this$$slots$header : _this.title])])];
856
- },
857
- "default": function _default() {
858
- var _this$$slots$default, _this$$slots$default2, _this$$slots3;
859
- return (_this$$slots$default = (_this$$slots$default2 = (_this$$slots3 = _this.$slots)["default"]) === null || _this$$slots$default2 === void 0 ? void 0 : _this$$slots$default2.call(_this$$slots3)) !== null && _this$$slots$default !== void 0 ? _this$$slots$default : 'default';
860
- },
861
- footer: function footer() {
862
- var _this$$slots$footer, _this$$slots$footer2, _this$$slots4, _this$$slots$footer3, _this$$slots$footer4, _this$$slots5, _this$$slots$footer5, _this$$slots$footer6, _this$$slots6;
863
- return (0,external_vue_namespaceObject.createVNode)("div", {
864
- "class": _this.resolveClassName('dialog-footer'),
865
- "style": "text-align: ".concat(_this.footerAlign)
866
- }, [_this.dialogType === 'process' ? (_this$$slots$footer = (_this$$slots$footer2 = (_this$$slots4 = _this.$slots).footer) === null || _this$$slots$footer2 === void 0 ? void 0 : _this$$slots$footer2.call(_this$$slots4)) !== null && _this$$slots$footer !== void 0 ? _this$$slots$footer : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.current === 1 ? '' : (0,external_vue_namespaceObject.createVNode)(external_button_namespaceObject["default"], {
867
- "class": _this.resolveClassName('dialog-perv'),
868
- "onClick": _this.handlePrevStep
869
- }, {
870
- "default": function _default() {
871
- return [_this.localPrevText];
872
- }
873
- }), _this.current === _this.totalStep ? '' : (0,external_vue_namespaceObject.createVNode)(external_button_namespaceObject["default"], {
874
- "class": _this.resolveClassName('dialog-next'),
875
- "onClick": _this.handleNextStep
876
- }, {
877
- "default": function _default() {
878
- return [_this.localNextText];
879
- }
880
- }), _this.current === _this.totalStep ? (0,external_vue_namespaceObject.createVNode)(external_button_namespaceObject["default"], {
881
- "onClick": _this.handleConfirm,
882
- "theme": _this.theme,
883
- "loading": _this.isLoading
884
- }, {
885
- "default": function _default() {
886
- return [_this.localConfirmText];
887
- }
888
- }) : '', (0,external_vue_namespaceObject.createVNode)(external_button_namespaceObject["default"], {
889
- "class": _this.resolveClassName('dialog-cancel'),
890
- "onClick": _this.handleClose,
891
- "disabled": _this.isLoading
892
- }, {
893
- "default": function _default() {
894
- return [_this.localCancelText];
895
- }
896
- })]) : '', _this.dialogType === 'operation' ? (_this$$slots$footer3 = (_this$$slots$footer4 = (_this$$slots5 = _this.$slots).footer) === null || _this$$slots$footer4 === void 0 ? void 0 : _this$$slots$footer4.call(_this$$slots5)) !== null && _this$$slots$footer3 !== void 0 ? _this$$slots$footer3 : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(external_button_namespaceObject["default"], {
897
- "onClick": _this.handleConfirm,
898
- "theme": _this.theme,
899
- "loading": _this.isLoading
900
- }, {
901
- "default": function _default() {
902
- return [_this.localConfirmText];
903
- }
904
- }), (0,external_vue_namespaceObject.createVNode)(external_button_namespaceObject["default"], {
905
- "class": _this.resolveClassName('dialog-cancel'),
906
- "onClick": _this.handleClose,
907
- "disabled": _this.isLoading
908
- }, {
909
- "default": function _default() {
910
- return [_this.localCancelText];
911
- }
912
- })]) : '', _this.dialogType === 'confirm' ? (_this$$slots$footer5 = (_this$$slots$footer6 = (_this$$slots6 = _this.$slots).footer) === null || _this$$slots$footer6 === void 0 ? void 0 : _this$$slots$footer6.call(_this$$slots6)) !== null && _this$$slots$footer5 !== void 0 ? _this$$slots$footer5 : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(external_button_namespaceObject["default"], {
913
- "onClick": _this.handleConfirm,
914
- "theme": _this.theme,
915
- "loading": _this.isLoading
916
- }, {
917
- "default": function _default() {
918
- return [_this.localConfirmText];
919
- }
920
- })]) : '']);
921
- },
922
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
923
- close: function close() {
924
- return (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Error, {
925
- "onClick": _this.handleClose
926
- }, null);
927
- }
928
- };
929
- var className = "".concat(this.resolveClassName('dialog-wrapper '), " ").concat(this.scrollable ? 'scroll-able' : '', " ").concat(this.multiInstance ? 'multi-instance' : '', " ").concat(this.hasFooter ? 'has-footer' : 'no-footer');
930
- return (0,external_vue_namespaceObject.createVNode)(external_modal_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)(this.$props, {
931
- "class": className,
932
- "onClose": this.handleClose,
933
- "isShow": this.isModalShow,
934
- "style": this.data.moveStyle
935
- }), _isSlot(dialogSlot) ? dialogSlot : {
936
- "default": function _default() {
937
- return [dialogSlot];
938
- }
939
- });
940
- }
941
- }));
942
- ;// CONCATENATED MODULE: ../../packages/dialog/src/index.ts
943
- /*
944
- * Tencent is pleased to support the open source community by making
945
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
946
- *
947
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
948
- *
949
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
950
- *
951
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
952
- *
953
- * ---------------------------------------------------
954
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
955
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
956
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
957
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
958
- *
959
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
960
- * the Software.
961
- *
962
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
963
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
964
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
965
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
966
- * IN THE SOFTWARE.
967
- */
968
-
969
-
970
- var BkDialog = (0,external_shared_namespaceObject.withInstall)(dialog);
971
- /* harmony default export */ const src = (BkDialog);
972
- })();
973
-
974
- var __webpack_exports__default = __webpack_exports__.Z;
975
- export { __webpack_exports__default as default };
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+ import*as e from"../shared";import*as t from"vue";import*as o from"../button";import*as r from"../config-provider";import*as n from"../icon";import*as a from"../modal";var i={7609:(e,t,o)=>{var r=o(7425).default;function n(){e.exports=n=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,o){e[t]=o.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",s=l.asyncIterator||"@@asyncIterator",u=l.toStringTag||"@@toStringTag";function f(e,t,o){return Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,o){return e[t]=o}}function d(e,t,o,r){var n=t&&t.prototype instanceof v?t:v,a=Object.create(n.prototype),l=new P(r||[]);return i(a,"_invoke",{value:C(e,o,l)}),a}function p(e,t,o){try{return{type:"normal",arg:e.call(t,o)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var h={};function v(){}function m(){}function g(){}var y={};f(y,c,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(V([])));w&&w!==o&&a.call(w,c)&&(y=w);var T=g.prototype=v.prototype=Object.create(y);function b(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function o(n,i,l,c){var s=p(e[n],e,i);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"==r(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,l,c)}),(function(e){o("throw",e,l,c)})):t.resolve(f).then((function(e){u.value=e,l(u)}),(function(e){return o("throw",e,l,c)}))}c(s.arg)}var n;i(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,n){o(e,r,t,n)}))}return n=n?n.then(a,a):a()}})}function C(e,t,o){var r="suspendedStart";return function(n,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw a;return{value:void 0,done:!0}}for(o.method=n,o.arg=a;;){var i=o.delegate;if(i){var l=S(i,o);if(l){if(l===h)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===r)throw r="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r="executing";var c=p(e,t,o);if("normal"===c.type){if(r=o.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:o.done}}"throw"===c.type&&(r="completed",o.method="throw",o.arg=c.arg)}}}function S(e,t){var o=t.method,r=e.iterator[o];if(void 0===r)return t.delegate=null,"throw"===o&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==o&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+o+"' method")),h;var n=p(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function V(e){if(e){var t=e[c];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function t(){for(;++o<e.length;)if(a.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:O}}function O(){return{value:void 0,done:!0}}return m.prototype=g,i(T,"constructor",{value:g,configurable:!0}),i(g,"constructor",{value:m,configurable:!0}),m.displayName=f(g,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,f(e,u,"GeneratorFunction")),e.prototype=Object.create(T),e},t.awrap=function(e){return{__await:e}},b(N.prototype),f(N.prototype,s,(function(){return this})),t.AsyncIterator=N,t.async=function(e,o,r,n,a){void 0===a&&(a=Promise);var i=new N(d(e,o,r,n),a);return t.isGeneratorFunction(o)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(T),f(T,u,"Generator"),f(T,c,(function(){return this})),f(T,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),o=[];for(var r in t)o.push(r);return o.reverse(),function e(){for(;o.length;){var r=o.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=V,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(o,r){return i.type="throw",i.arg=e,t.next=o,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r],i=n.completion;if("root"===n.tryLoc)return o("end");if(n.tryLoc<=this.prev){var l=a.call(n,"catchLoc"),c=a.call(n,"finallyLoc");if(l&&c){if(this.prev<n.catchLoc)return o(n.catchLoc,!0);if(this.prev<n.finallyLoc)return o(n.finallyLoc)}else if(l){if(this.prev<n.catchLoc)return o(n.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return o(n.finallyLoc)}}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var n=r;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var i=n?n.completion:{};return i.type=e,i.arg=t,n?(this.method="next",this.next=n.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===e)return this.complete(o.completion,o.afterLoc),E(o),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===e){var r=o.completion;if("throw"===r.type){var n=r.arg;E(o)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,o){return this.delegate={iterator:V(e),resultName:t,nextLoc:o},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},7425:e=>{function t(o){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},2841:(e,t,o)=>{var r=o(7609)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},l={};function c(e){var t=l[e];if(void 0!==t)return t.exports;var o=l[e]={exports:{}};return i[e](o,o.exports,c),o.exports}c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},c.d=(e,t)=>{for(var o in t)c.o(t,o)&&!c.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};(()=>{c.d(s,{Z:()=>w});const i=(l={AlignEnum:()=>e.AlignEnum,PropTypes:()=>e.PropTypes,ThemeEnum:()=>e.ThemeEnum,alignType:()=>e.alignType,dialogTypeUnion:()=>e.dialogTypeUnion,withInstall:()=>e.withInstall},u={},c.d(u,l),u);var l,u;const f=(e=>{var t={};return c.d(t,e),t})({Fragment:()=>t.Fragment,computed:()=>t.computed,createVNode:()=>t.createVNode,defineComponent:()=>t.defineComponent,isVNode:()=>t.isVNode,mergeProps:()=>t.mergeProps,onBeforeUnmount:()=>t.onBeforeUnmount,onMounted:()=>t.onMounted,reactive:()=>t.reactive,ref:()=>t.ref,watch:()=>t.watch});var d=c(2841),p=c.n(d);Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;const h=(e=>{var t={};return c.d(t,e),t})({default:()=>o.default}),v=(e=>{var t={};return c.d(t,e),t})({useLocale:()=>r.useLocale,usePrefix:()=>r.usePrefix}),m=(e=>{var t={};return c.d(t,e),t})({Close:()=>n.Close,Error:()=>n.Error,Spinner:()=>n.Spinner,Success:()=>n.Success,Warn:()=>n.Warn}),g=(e=>{var t={};return c.d(t,e),t})({default:()=>a.default,propsMixin:()=>a.propsMixin}),y=Object.assign(Object.assign({},g.propsMixin),{width:i.PropTypes.oneOfType([String,Number]).def(""),height:i.PropTypes.oneOfType([String,Number]).def(""),confirmText:i.PropTypes.string,cancelText:i.PropTypes.string,prevText:i.PropTypes.string,nextText:i.PropTypes.string,current:i.PropTypes.number.def(1),totalStep:i.PropTypes.number,title:i.PropTypes.string.def("title"),headerAlign:(0,i.alignType)().def(i.AlignEnum.LEFT),footerAlign:(0,i.alignType)().def(i.AlignEnum.RIGHT),theme:i.PropTypes.theme().def(i.ThemeEnum.PRIMARY),dialogType:(0,i.dialogTypeUnion)(),isLoading:i.PropTypes.bool.def(!1)}),x=(0,f.defineComponent)({name:"Dialog",components:{BkModal:g.default,BkButton:h.default},props:y,emits:["closed","update:isShow","confirm","prev","next","value-change"],setup:function(e,t){var o=this,r=t.emit,n=(0,v.useLocale)("dialog"),a=(0,f.computed)((function(){return void 0===e.confirmText?n.value.ok:e.confirmText})),i=(0,f.computed)((function(){return void 0===e.cancelText?n.value.cancel:e.cancelText})),l=(0,f.computed)((function(){return void 0===e.prevText?n.value.prev:e.prevText})),c=(0,f.computed)((function(){return void 0===e.nextText?n.value.next:e.nextText})),s=(0,f.reactive)({positionX:0,positionY:0,moveStyle:{top:"",left:""}}),u=(0,f.ref)(e.isShow);(0,f.onMounted)((function(){e.escClose&&addEventListener("keydown",m)})),(0,f.onBeforeUnmount)((function(){e.escClose&&removeEventListener("keydown",m)})),(0,f.watch)((function(){return e.isShow}),(function(e){e?u.value=!0:setTimeout((function(){s.moveStyle={top:"50%",left:"50%"},s.positionX=0,s.positionY=0,u.value=!1}),250),r("value-change",e)}));var d=function(){return t=o,n=void 0,a=void 0,i=p().mark((function t(){var o;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=!0,"function"!=typeof e.beforeClose){t.next=5;break}return t.next=4,e.beforeClose();case 4:o=t.sent;case 5:o&&(r("update:isShow",!1),r("closed"),u.value=!1);case 6:case"end":return t.stop()}}),t)})),new(a||(a=Promise))((function(e,o){function r(e){try{c(i.next(e))}catch(e){o(e)}}function l(e){try{c(i.throw(e))}catch(e){o(e)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof a?o:new a((function(e){e(o)}))).then(r,l)}c((i=i.apply(t,n||[])).next())}));var t,n,a,i},h=(0,f.computed)((function(){return["process","operation","confirm"].includes(e.dialogType)})),m=function(t){e.isShow&&e.closeIcon&&27===t.keyCode&&d()},g=(0,v.usePrefix)().resolveClassName;return{data:s,handleClose:d,handleConfirm:function(){r("update:isShow",!1),r("confirm")},escCloseHandler:m,moveHandler:function(t){if(e.fullscreen)return!1;if(!e.draggable)return!1;var o,r,n=t.target,a=t.currentTarget.parentNode.parentNode.offsetHeight,i=t.currentTarget.parentNode.parentNode.offsetWidth;0!==s.positionX&&0!==s.positionY?(o=t.clientX-s.positionX,r=t.clientY-s.positionY):(o=t.clientX-n.offsetLeft,r=t.clientY-n.offsetTop),document.onmousemove=function(e){var t=window.innerWidth-i,n=window.innerHeight-a,l=e.clientX-o,c=e.clientY-r;t/2-l<=0?l=t/2:t/2+l<=0&&(l=-t/2),n/2-c<=0?c=n/2:n/2+c<=0&&(c=-n/2),s.positionX=l,s.positionY=c,s.moveStyle.left="calc(50% + ".concat(l,"px)"),s.moveStyle.top="calc(50% + ".concat(c,"px)")},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}},handlePrevStep:function(){r("prev")},handleNextStep:function(){r("next")},hasFooter:h,isModalShow:u,localConfirmText:a,localCancelText:i,localPrevText:l,localNextText:c,resolveClassName:g}},render:function(){var e,t=this,o={header:function(){var e,o,r,n,a,i;return[(0,f.createVNode)("div",{class:[t.resolveClassName("dialog-tool"),t.fullscreen||!t.draggable?"":"move",t.draggable?"content-dragging":""],onMousedown:t.moveHandler},[null!==(r=null===(o=(e=t.$slots).tools)||void 0===o?void 0:o.call(e))&&void 0!==r?r:""]),(0,f.createVNode)("div",{class:t.resolveClassName("dialog-header")},[(0,f.createVNode)("div",{class:t.resolveClassName("header-icon")},[t.infoType?{loading:(0,f.createVNode)(m.Spinner,{class:[t.resolveClassName("info-icon"),"primary"]},null),warning:(0,f.createVNode)(m.Warn,{class:[t.resolveClassName("info-icon"),"warning"]},null),success:(0,f.createVNode)(m.Success,{class:[t.resolveClassName("info-icon"),"success"]},null),danger:(0,f.createVNode)(m.Close,{class:[t.resolveClassName("info-icon"),"danger"]},null)}[t.infoType]:(0,f.createVNode)("slot",{name:"info-icon"},null)]),(0,f.createVNode)("span",{class:t.resolveClassName("dialog-title"),style:"text-align: ".concat(t.headerAlign)},[null!==(i=null===(a=(n=t.$slots).header)||void 0===a?void 0:a.call(n))&&void 0!==i?i:t.title])])]},default:function(){var e,o,r;return null!==(r=null===(o=(e=t.$slots).default)||void 0===o?void 0:o.call(e))&&void 0!==r?r:"default"},footer:function(){var e,o,r,n,a,i,l,c,s;return(0,f.createVNode)("div",{class:t.resolveClassName("dialog-footer"),style:"text-align: ".concat(t.footerAlign)},["process"===t.dialogType?null!==(r=null===(o=(e=t.$slots).footer)||void 0===o?void 0:o.call(e))&&void 0!==r?r:(0,f.createVNode)(f.Fragment,null,[1===t.current?"":(0,f.createVNode)(h.default,{class:t.resolveClassName("dialog-perv"),onClick:t.handlePrevStep},{default:function(){return[t.localPrevText]}}),t.current===t.totalStep?"":(0,f.createVNode)(h.default,{class:t.resolveClassName("dialog-next"),onClick:t.handleNextStep},{default:function(){return[t.localNextText]}}),t.current===t.totalStep?(0,f.createVNode)(h.default,{onClick:t.handleConfirm,theme:t.theme,loading:t.isLoading},{default:function(){return[t.localConfirmText]}}):"",(0,f.createVNode)(h.default,{class:t.resolveClassName("dialog-cancel"),onClick:t.handleClose,disabled:t.isLoading},{default:function(){return[t.localCancelText]}})]):"","operation"===t.dialogType?null!==(i=null===(a=(n=t.$slots).footer)||void 0===a?void 0:a.call(n))&&void 0!==i?i:(0,f.createVNode)(f.Fragment,null,[(0,f.createVNode)(h.default,{onClick:t.handleConfirm,theme:t.theme,loading:t.isLoading},{default:function(){return[t.localConfirmText]}}),(0,f.createVNode)(h.default,{class:t.resolveClassName("dialog-cancel"),onClick:t.handleClose,disabled:t.isLoading},{default:function(){return[t.localCancelText]}})]):"","confirm"===t.dialogType?null!==(s=null===(c=(l=t.$slots).footer)||void 0===c?void 0:c.call(l))&&void 0!==s?s:(0,f.createVNode)(f.Fragment,null,[(0,f.createVNode)(h.default,{onClick:t.handleConfirm,theme:t.theme,loading:t.isLoading},{default:function(){return[t.localConfirmText]}})]):""])},close:function(){return(0,f.createVNode)(m.Error,{onClick:t.handleClose},null)}},r="".concat(this.resolveClassName("dialog-wrapper ")," ").concat(this.scrollable?"scroll-able":""," ").concat(this.multiInstance?"multi-instance":""," ").concat(this.hasFooter?"has-footer":"no-footer");return(0,f.createVNode)(g.default,(0,f.mergeProps)(this.$props,{class:r,onClose:this.handleClose,isShow:this.isModalShow,style:this.data.moveStyle}),"function"==typeof(e=o)||"[object Object]"===Object.prototype.toString.call(e)&&!(0,f.isVNode)(e)?o:{default:function(){return[o]}})}}),w=(0,i.withInstall)(x)})();var u=s.Z;export{u as default};