bkui-vue 0.0.1-beta.393 → 0.0.1-beta.395

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/index.cjs.js +36 -36
  2. package/dist/index.esm.js +93 -49
  3. package/dist/index.umd.js +36 -36
  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/badge.css +0 -2
  11. package/lib/badge/badge.less +2 -2
  12. package/lib/badge/badge.variable.css +0 -2
  13. package/lib/badge/index.js +1 -274
  14. package/lib/breadcrumb/index.js +1 -329
  15. package/lib/button/index.js +1 -371
  16. package/lib/card/index.js +1 -326
  17. package/lib/cascader/index.js +1 -2168
  18. package/lib/checkbox/index.js +1 -571
  19. package/lib/code-diff/index.js +1 -5520
  20. package/lib/collapse/collapse-panel.d.ts +11 -0
  21. package/lib/collapse/index.d.ts +20 -5
  22. package/lib/collapse/index.js +1 -698
  23. package/lib/collapse/props.d.ts +5 -0
  24. package/lib/color-picker/index.js +1 -2816
  25. package/lib/components.d.ts +2 -0
  26. package/lib/components.js +1 -759
  27. package/lib/container/index.js +1 -369
  28. package/lib/date-picker/index.js +1 -5601
  29. package/lib/dialog/index.js +1 -545
  30. package/lib/directives/index.js +2 -1427
  31. package/lib/directives/index.js.LICENSE.txt +14 -0
  32. package/lib/dist.index.js +1 -166
  33. package/lib/divider/index.js +1 -512
  34. package/lib/dropdown/index.js +1 -414
  35. package/lib/exception/exception.d.ts +13 -0
  36. package/lib/exception/index.d.ts +2 -0
  37. package/lib/exception/index.js +1 -405
  38. package/lib/fixed-navbar/index.js +1 -214
  39. package/lib/form/index.js +1 -986
  40. package/lib/icon/angle-double-down-line.js +1 -426
  41. package/lib/icon/angle-double-left-line.js +1 -426
  42. package/lib/icon/angle-double-left.js +1 -426
  43. package/lib/icon/angle-double-right-line.js +1 -426
  44. package/lib/icon/angle-double-right.js +1 -426
  45. package/lib/icon/angle-double-up-line.js +1 -426
  46. package/lib/icon/angle-down-fill.js +1 -426
  47. package/lib/icon/angle-down-line.js +1 -426
  48. package/lib/icon/angle-down.js +1 -426
  49. package/lib/icon/angle-left.js +1 -426
  50. package/lib/icon/angle-right.js +1 -426
  51. package/lib/icon/angle-up-fill.js +1 -426
  52. package/lib/icon/angle-up.js +1 -426
  53. package/lib/icon/archive-fill.js +1 -426
  54. package/lib/icon/arrows-left.js +1 -426
  55. package/lib/icon/arrows-right.js +1 -426
  56. package/lib/icon/audio-fill.js +1 -426
  57. package/lib/icon/bk.js +1 -426
  58. package/lib/icon/circle.js +1 -426
  59. package/lib/icon/close-line.js +1 -426
  60. package/lib/icon/close.js +1 -426
  61. package/lib/icon/code.js +1 -426
  62. package/lib/icon/cog-shape.js +1 -426
  63. package/lib/icon/collapse-left.js +1 -426
  64. package/lib/icon/copy.js +1 -426
  65. package/lib/icon/data-shape.js +1 -426
  66. package/lib/icon/del.js +1 -426
  67. package/lib/icon/doc-fill.js +1 -426
  68. package/lib/icon/done.js +1 -426
  69. package/lib/icon/down-shape.js +1 -426
  70. package/lib/icon/down-small.js +1 -426
  71. package/lib/icon/edit-line.js +1 -426
  72. package/lib/icon/ellipsis.js +1 -426
  73. package/lib/icon/enlarge-line.js +1 -426
  74. package/lib/icon/error.js +1 -426
  75. package/lib/icon/excel-fill.js +1 -426
  76. package/lib/icon/exclamation-circle-shape.js +1 -426
  77. package/lib/icon/eye.js +1 -426
  78. package/lib/icon/filliscreen-line.js +1 -426
  79. package/lib/icon/folder-open.js +1 -426
  80. package/lib/icon/folder-shape-open.js +1 -426
  81. package/lib/icon/folder-shape.js +1 -426
  82. package/lib/icon/folder.js +1 -426
  83. package/lib/icon/funnel.js +1 -426
  84. package/lib/icon/help-document-fill.js +1 -426
  85. package/lib/icon/help-fill.js +1 -426
  86. package/lib/icon/help.js +1 -426
  87. package/lib/icon/image-fill.js +1 -426
  88. package/lib/icon/img-placehoulder.js +1 -448
  89. package/lib/icon/index.js +1 -2275
  90. package/lib/icon/info-line.js +1 -448
  91. package/lib/icon/info.js +1 -448
  92. package/lib/icon/left-shape.js +1 -448
  93. package/lib/icon/left-turn-line.js +1 -448
  94. package/lib/icon/narrow-line.js +1 -448
  95. package/lib/icon/original.js +1 -448
  96. package/lib/icon/pdf-fill.js +1 -448
  97. package/lib/icon/play-shape.js +1 -448
  98. package/lib/icon/plus.js +1 -448
  99. package/lib/icon/ppt-fill.js +1 -448
  100. package/lib/icon/qq.js +1 -448
  101. package/lib/icon/right-shape.js +1 -448
  102. package/lib/icon/right-turn-line.js +1 -448
  103. package/lib/icon/search.js +1 -448
  104. package/lib/icon/share.js +1 -448
  105. package/lib/icon/spinner.js +1 -448
  106. package/lib/icon/success.js +1 -448
  107. package/lib/icon/switcher-loading.js +1 -448
  108. package/lib/icon/text-file.js +1 -448
  109. package/lib/icon/text-fill.js +1 -448
  110. package/lib/icon/transfer.js +1 -448
  111. package/lib/icon/tree-application-shape.js +1 -448
  112. package/lib/icon/unfull-screen.js +1 -448
  113. package/lib/icon/unvisible.js +1 -448
  114. package/lib/icon/up-shape.js +1 -448
  115. package/lib/icon/upload.js +1 -448
  116. package/lib/icon/video-fill.js +1 -448
  117. package/lib/icon/warn.js +1 -448
  118. package/lib/icon/weixin.js +1 -448
  119. package/lib/image/index.js +1 -873
  120. package/lib/index.js +1 -169
  121. package/lib/info-box/index.js +1 -1784
  122. package/lib/input/index.d.ts +4 -4
  123. package/lib/input/index.js +1 -846
  124. package/lib/input/input.d.ts +1 -1
  125. package/lib/link/index.js +1 -226
  126. package/lib/loading/index.js +1 -309
  127. package/lib/menu/index.js +1 -796
  128. package/lib/message/index.js +1 -401
  129. package/lib/modal/index.js +1 -395
  130. package/lib/navigation/index.js +1 -431
  131. package/lib/notify/index.js +1 -430
  132. package/lib/overflow-title/index.js +1 -512
  133. package/lib/pagination/index.js +1 -1026
  134. package/lib/plugin-popover/index.js +1 -2581
  135. package/lib/plugins/index.js +1 -130
  136. package/lib/popover/index.js +1 -2587
  137. package/lib/popover2/index.js +1 -172
  138. package/lib/preset.js +1 -129
  139. package/lib/process/index.js +1 -1417
  140. package/lib/progress/index.js +1 -479
  141. package/lib/radio/index.js +1 -649
  142. package/lib/rate/index.js +1 -358
  143. package/lib/resize-layout/index.js +1 -495
  144. package/lib/search-select/index.js +1 -3388
  145. package/lib/search-select/search-select.css +1 -1
  146. package/lib/search-select/search-select.less +1 -1
  147. package/lib/search-select/search-select.variable.css +1 -1
  148. package/lib/select/index.d.ts +9 -9
  149. package/lib/select/index.js +1 -2819
  150. package/lib/select/select.css +0 -1
  151. package/lib/select/select.d.ts +3 -3
  152. package/lib/select/select.less +0 -1
  153. package/lib/select/select.variable.css +0 -1
  154. package/lib/select/selectTagInput.d.ts +1 -1
  155. package/lib/shared/index.js +1 -2813
  156. package/lib/shared/vue-types.d.ts +1 -1
  157. package/lib/sideslider/index.js +1 -1362
  158. package/lib/slider/index.js +1 -2060
  159. package/lib/steps/index.js +1 -1504
  160. package/lib/swiper/index.js +1 -374
  161. package/lib/switcher/index.js +1 -308
  162. package/lib/tab/index.d.ts +10 -6
  163. package/lib/tab/index.js +1 -919
  164. package/lib/tab/props.d.ts +6 -0
  165. package/lib/table/index.js +1 -6635
  166. package/lib/table-column/index.js +1 -737
  167. package/lib/tag/index.js +1 -278
  168. package/lib/tag-input/index.js +1 -1897
  169. package/lib/time-picker/index.js +1 -142
  170. package/lib/timeline/index.js +1 -315
  171. package/lib/transfer/index.js +1 -658
  172. package/lib/tree/index.js +1 -2917
  173. package/lib/upload/index.js +1 -3735
  174. package/lib/virtual-render/index.js +1 -825
  175. package/package.json +2 -1
@@ -1,495 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("../shared"), require("vue"), require("../icon"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["../shared", "vue", "../icon"], factory);
6
- else {
7
- var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("../icon")) : factory(root["../shared"], root["vue"], root["../icon"]);
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__6870__) => {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ "use strict";
13
- /******/ var __webpack_modules__ = ({
14
-
15
- /***/ 6870:
16
- /***/ ((module) => {
17
-
18
- module.exports = __WEBPACK_EXTERNAL_MODULE__6870__;
19
-
20
- /***/ }),
21
-
22
- /***/ 4212:
23
- /***/ ((module) => {
24
-
25
- module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
26
-
27
- /***/ }),
28
-
29
- /***/ 748:
30
- /***/ ((module) => {
31
-
32
- module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
33
-
34
- /***/ })
35
-
36
- /******/ });
37
- /************************************************************************/
38
- /******/ // The module cache
39
- /******/ var __webpack_module_cache__ = {};
40
- /******/
41
- /******/ // The require function
42
- /******/ function __webpack_require__(moduleId) {
43
- /******/ // Check if module is in cache
44
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
45
- /******/ if (cachedModule !== undefined) {
46
- /******/ return cachedModule.exports;
47
- /******/ }
48
- /******/ // Create a new module (and put it into the cache)
49
- /******/ var module = __webpack_module_cache__[moduleId] = {
50
- /******/ // no module.id needed
51
- /******/ // no module.loaded needed
52
- /******/ exports: {}
53
- /******/ };
54
- /******/
55
- /******/ // Execute the module function
56
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
57
- /******/
58
- /******/ // Return the exports of the module
59
- /******/ return module.exports;
60
- /******/ }
61
- /******/
62
- /************************************************************************/
63
- /******/ /* webpack/runtime/define property getters */
64
- /******/ (() => {
65
- /******/ // define getter functions for harmony exports
66
- /******/ __webpack_require__.d = (exports, definition) => {
67
- /******/ for(var key in definition) {
68
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
69
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
70
- /******/ }
71
- /******/ }
72
- /******/ };
73
- /******/ })();
74
- /******/
75
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
76
- /******/ (() => {
77
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
78
- /******/ })();
79
- /******/
80
- /******/ /* webpack/runtime/make namespace object */
81
- /******/ (() => {
82
- /******/ // define __esModule on exports
83
- /******/ __webpack_require__.r = (exports) => {
84
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
85
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
86
- /******/ }
87
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
88
- /******/ };
89
- /******/ })();
90
- /******/
91
- /************************************************************************/
92
- var __webpack_exports__ = {};
93
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
94
- (() => {
95
- // ESM COMPAT FLAG
96
- __webpack_require__.r(__webpack_exports__);
97
-
98
- // EXPORTS
99
- __webpack_require__.d(__webpack_exports__, {
100
- "default": () => (/* binding */ src)
101
- });
102
-
103
- // EXTERNAL MODULE: external "../shared"
104
- var external_shared_ = __webpack_require__(4212);
105
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
106
- function _defineProperty(obj, key, value) {
107
- if (key in obj) {
108
- Object.defineProperty(obj, key, {
109
- value: value,
110
- enumerable: true,
111
- configurable: true,
112
- writable: true
113
- });
114
- } else {
115
- obj[key] = value;
116
- }
117
-
118
- return obj;
119
- }
120
- // EXTERNAL MODULE: external "vue"
121
- var external_vue_ = __webpack_require__(748);
122
- // EXTERNAL MODULE: external "../icon"
123
- var external_icon_ = __webpack_require__(6870);
124
- ;// CONCATENATED MODULE: ../../packages/resize-layout/src/resize-layout.tsx
125
-
126
-
127
-
128
- /*
129
- * Tencent is pleased to support the open source community by making
130
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
131
- *
132
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
133
- *
134
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
135
- *
136
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
137
- *
138
- * ---------------------------------------------------
139
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
140
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
141
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
142
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
143
- *
144
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
145
- * the Software.
146
- *
147
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
148
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
149
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
150
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
151
- * IN THE SOFTWARE.
152
- */
153
-
154
-
155
-
156
- /* harmony default export */ const resize_layout = ((0,external_vue_.defineComponent)({
157
- name: 'ResizeLayout',
158
- props: {
159
- placement: external_shared_.PropTypes.placement().def('left'),
160
- min: external_shared_.PropTypes.number.def(3),
161
- max: external_shared_.PropTypes.number.def(Infinity),
162
- triggerWidth: external_shared_.PropTypes.number.def(5),
163
- triggerOffset: external_shared_.PropTypes.number.def(3),
164
- initialDivide: external_shared_.PropTypes.oneOfType([String, Number]).def('20%'),
165
- immediate: external_shared_.PropTypes.bool,
166
- disabled: external_shared_.PropTypes.bool,
167
- collapsible: external_shared_.PropTypes.bool,
168
- autoMinimize: external_shared_.PropTypes.oneOfType([Boolean, Number]).def(false),
169
- border: external_shared_.PropTypes.bool.def(true)
170
- },
171
- emits: ['before-resize', 'resizing', 'after-resize', 'collapse-change'],
172
- setup: function setup(props, _ref) {
173
- var emit = _ref.emit;
174
-
175
- var _toRefs = (0,external_vue_.toRefs)(props),
176
- placement = _toRefs.placement,
177
- initialDivide = _toRefs.initialDivide,
178
- triggerOffset = _toRefs.triggerOffset,
179
- triggerWidth = _toRefs.triggerWidth,
180
- max = _toRefs.max,
181
- min = _toRefs.min,
182
- immediate = _toRefs.immediate,
183
- autoMinimize = _toRefs.autoMinimize;
184
-
185
- var collapsed = (0,external_vue_.ref)(false);
186
- var asideContentVisible = (0,external_vue_.ref)(true);
187
- var minimized = (0,external_vue_.ref)(false);
188
- var limitMax = (0,external_vue_.ref)(null);
189
- var state = (0,external_vue_.ref)({});
190
- var bkResizeLayoutRef = (0,external_vue_.ref)(null);
191
- var resizeProxyRef = (0,external_vue_.ref)(null);
192
- var resizeMaskRef = (0,external_vue_.ref)(null);
193
- var asideRef = (0,external_vue_.ref)(null);
194
- var vertical = (0,external_vue_.computed)(function () {
195
- return ['left', 'right'].includes(placement.value);
196
- });
197
- var cssPropKey = (0,external_vue_.computed)(function () {
198
- return vertical.value ? 'width' : 'height';
199
- });
200
- var asideStyle = (0,external_vue_.computed)(function () {
201
- var divide = initialDivide.value;
202
-
203
- if (typeof divide === 'number') {
204
- divide = "".concat(divide, "px");
205
- }
206
-
207
- return _defineProperty({}, cssPropKey.value, divide);
208
- });
209
- var triggerStyle = (0,external_vue_.computed)(function () {
210
- var _style;
211
-
212
- var style = (_style = {}, _defineProperty(_style, "margin-".concat(placement.value), "".concat(triggerOffset.value - triggerWidth.value, "px")), _defineProperty(_style, cssPropKey.value, "".concat(triggerWidth.value, "px")), _style);
213
- return style;
214
- });
215
- var parseAutoMinimize = (0,external_vue_.computed)(function () {
216
- if (autoMinimize.value) {
217
- return typeof autoMinimize.value === 'boolean' ? 50 : autoMinimize.value;
218
- }
219
-
220
- return 0;
221
- });
222
-
223
- var setMaxLimit = function setMaxLimit() {
224
- var rect = bkResizeLayoutRef.value.getBoundingClientRect();
225
- limitMax.value = vertical.value ? rect.width : rect.height;
226
- };
227
-
228
- var observer = new ResizeObserver(setMaxLimit);
229
-
230
- var updateResizeProxyStyle = function updateResizeProxyStyle() {
231
- resizeProxyRef.value.style.visibility = 'visible';
232
-
233
- switch (placement.value) {
234
- case 'left':
235
- resizeProxyRef.value.style.inset = "0 auto auto ".concat(state.value.aside.width, "px");
236
- break;
237
-
238
- case 'right':
239
- resizeProxyRef.value.style.inset = "0 ".concat(state.value.aside.width, "px auto auto");
240
- break;
241
-
242
- case 'top':
243
- resizeProxyRef.value.style.inset = "".concat(state.value.aside.height, "px auto auto 0");
244
- break;
245
-
246
- case 'bottom':
247
- resizeProxyRef.value.style.inset = "auto auto ".concat(state.value.aside.height, "px 0");
248
- break;
249
- }
250
- };
251
-
252
- var updateResizeMaskStyle = function updateResizeMaskStyle() {
253
- resizeMaskRef.value.style.display = 'block';
254
- resizeMaskRef.value.style.cursor = vertical.value ? 'col-resize' : 'row-resize';
255
- };
256
-
257
- var getRealValue = function getRealValue(current) {
258
- return Math.min(max.value, Math.max(min.value, current), limitMax.value - triggerWidth.value);
259
- };
260
-
261
- var handleMousedown = function handleMousedown(event) {
262
- emit('before-resize', event);
263
- var asideRect = asideRef.value.getBoundingClientRect();
264
- state.value = Object.freeze({
265
- mouse: {
266
- clientX: event.clientX,
267
- clientY: event.clientY
268
- },
269
- aside: {
270
- width: asideRect.width,
271
- height: asideRect.height
272
- }
273
- });
274
- updateResizeMaskStyle();
275
-
276
- if (!immediate.value) {
277
- updateResizeProxyStyle();
278
- }
279
-
280
- document.onselectstart = function () {
281
- return false;
282
- };
283
-
284
- document.ondragstart = function () {
285
- return false;
286
- };
287
-
288
- var resizingCallback = function resizingCallback(value) {
289
- emit('resizing', value);
290
- };
291
-
292
- var handleMouseMove = function handleMouseMove(event) {
293
- var delta;
294
-
295
- switch (placement.value) {
296
- case 'top':
297
- delta = event.clientY - state.value.mouse.clientY;
298
- break;
299
-
300
- case 'right':
301
- delta = state.value.mouse.clientX - event.clientX;
302
- break;
303
-
304
- case 'bottom':
305
- delta = state.value.mouse.clientY - event.clientY;
306
- break;
307
-
308
- case 'left':
309
- delta = event.clientX - state.value.mouse.clientX;
310
- }
311
-
312
- var current = state.value.aside[cssPropKey.value] + delta;
313
- var realValue = getRealValue(current) + triggerOffset.value;
314
- var pixel = "".concat(realValue, "px");
315
-
316
- if (immediate.value) {
317
- asideRef.value.style[cssPropKey.value] = pixel;
318
- } else {
319
- resizeProxyRef.value.style[placement.value] = pixel;
320
- }
321
-
322
- resizingCallback(realValue);
323
- };
324
-
325
- var handleMouseUp = function handleMouseUp() {
326
- resizeProxyRef.value.style.visibility = 'hidden';
327
- resizeMaskRef.value.style.display = 'none';
328
- document.removeEventListener('mousemove', handleMouseMove);
329
- document.removeEventListener('mouseup', handleMouseUp);
330
- document.onselectstart = null;
331
- document.ondragstart = null;
332
- (0,external_vue_.nextTick)(function () {
333
- setupAutoMinimize();
334
- emit('after-resize', parseFloat(resizeProxyRef.value.style[placement.value]));
335
- });
336
-
337
- if (immediate.value) {
338
- return false;
339
- }
340
-
341
- asideRef.value.style[cssPropKey.value] = resizeProxyRef.value.style[placement.value];
342
- };
343
-
344
- document.addEventListener('mousemove', handleMouseMove);
345
- document.addEventListener('mouseup', handleMouseUp);
346
- };
347
-
348
- var setupAutoMinimize = function setupAutoMinimize() {
349
- if (!autoMinimize.value) {
350
- return false;
351
- }
352
-
353
- var asideRect = asideRef.value.getBoundingClientRect(); // 最小化同时设置为已折叠,此时展开以初始化initial-divide数据为参考
354
- // eslint-disable-next-line no-multi-assign
355
-
356
- minimized.value = collapsed.value = asideRect[cssPropKey.value] <= parseAutoMinimize.value;
357
-
358
- if (!minimized.value) {
359
- asideContentVisible.value = true;
360
- return false;
361
- }
362
-
363
- setupAsideAnimation();
364
- (0,external_vue_.nextTick)(function () {
365
- asideRef.value.setAttribute("data-".concat(cssPropKey.value), asideStyle.value[cssPropKey.value]);
366
- });
367
- };
368
-
369
- var setCollapse = function setCollapse(collapse) {
370
- collapsed.value = typeof collapse === 'boolean' ? collapse : !collapsed.value;
371
- setupAsideAnimation();
372
- emit('collapse-change', collapsed.value);
373
- };
374
-
375
- var setupAsideAnimation = function setupAsideAnimation() {
376
- var asideRect = asideRef.value.getBoundingClientRect();
377
- setupAsideListener(!collapsed.value);
378
-
379
- if (collapsed.value) {
380
- asideRef.value.setAttribute("data-".concat(cssPropKey.value), "".concat(asideRect[cssPropKey.value], "px"));
381
- asideRef.value.style[cssPropKey.value] = '5px';
382
- } else {
383
- asideContentVisible.value = true;
384
- asideRef.value.style[cssPropKey.value] = asideRef.value.getAttribute("data-".concat(cssPropKey.value));
385
- }
386
- };
387
-
388
- var setupAsideListener = function setupAsideListener(visible) {
389
- var removeClass = function removeClass() {
390
- asideContentVisible.value = visible;
391
- asideRef.value.style.transition = '';
392
- asideRef.value.removeEventListener('transitionend', removeClass);
393
- };
394
-
395
- asideRef.value.addEventListener('transitionend', removeClass);
396
- asideRef.value.style.transition = "".concat(cssPropKey.value, " cubic-bezier(0.4, 0, 0.2, 1) .3s");
397
- };
398
-
399
- (0,external_vue_.onMounted)(function () {
400
- observer.observe(bkResizeLayoutRef.value);
401
- });
402
- (0,external_vue_.onBeforeUnmount)(function () {
403
- observer.unobserve(bkResizeLayoutRef.value);
404
- });
405
- return {
406
- collapsed: collapsed,
407
- asideContentVisible: asideContentVisible,
408
- minimized: minimized,
409
- limitMax: limitMax,
410
- state: state,
411
- vertical: vertical,
412
- cssPropKey: cssPropKey,
413
- bkResizeLayoutRef: bkResizeLayoutRef,
414
- resizeProxyRef: resizeProxyRef,
415
- resizeMaskRef: resizeMaskRef,
416
- asideRef: asideRef,
417
- triggerStyle: triggerStyle,
418
- asideStyle: asideStyle,
419
- handleMousedown: handleMousedown,
420
- setCollapse: setCollapse
421
- };
422
- },
423
- render: function render() {
424
- var _a, _b, _c, _d, _e, _f;
425
-
426
- var bkResizeLayoutClass = ['bk-resize-layout', "bk-resize-layout-".concat(this.placement), {
427
- 'bk-resize-layout-collapsed': this.collapsed,
428
- 'bk-resize-layout-border': this.border
429
- }];
430
- return (0,external_vue_.createVNode)("div", {
431
- "ref": "bkResizeLayoutRef",
432
- "class": bkResizeLayoutClass
433
- }, [(0,external_vue_.createVNode)("aside", {
434
- "class": "bk-resize-layout-aside",
435
- "ref": "asideRef",
436
- "style": this.asideStyle
437
- }, [(0,external_vue_.withDirectives)((0,external_vue_.createVNode)("div", {
438
- "class": "bk-resize-layout-aside-content"
439
- }, [(_b = (_a = this.$slots).aside) === null || _b === void 0 ? void 0 : _b.call(_a)]), [[external_vue_.vShow, this.asideContentVisible]]), (0,external_vue_.withDirectives)((0,external_vue_.createVNode)("i", {
440
- "class": "bk-resize-trigger",
441
- "style": this.triggerStyle,
442
- "onMousedown": (0,external_vue_.withModifiers)(this.handleMousedown, ['left'])
443
- }, null), [[external_vue_.vShow, !this.disabled && (!this.collapsed || this.autoMinimize)]]), (0,external_vue_.withDirectives)((0,external_vue_.createVNode)("i", {
444
- "class": ['bk-resize-proxy', this.placement],
445
- "ref": "resizeProxyRef"
446
- }, null), [[external_vue_.vShow, !this.collapsed || this.autoMinimize]]), this.collapsible && (((_d = (_c = this.$slots)['collapse-trigger']) === null || _d === void 0 ? void 0 : _d.call(_c)) || (this.collapsed ? (0,external_vue_.createVNode)(external_icon_.AngleRight, {
447
- "class": "bk-resize-collapse",
448
- "onClick": this.setCollapse
449
- }, null) : (0,external_vue_.createVNode)(external_icon_.AngleLeft, {
450
- "class": "bk-resize-collapse",
451
- "onClick": this.setCollapse
452
- }, null)))]), (0,external_vue_.createVNode)("main", {
453
- "class": "bk-resize-layout-main"
454
- }, [(_f = (_e = this.$slots).main) === null || _f === void 0 ? void 0 : _f.call(_e)]), (0,external_vue_.createVNode)("div", {
455
- "class": "bk-resize-mask",
456
- "ref": "resizeMaskRef"
457
- }, null)]);
458
- }
459
- }));
460
- ;// CONCATENATED MODULE: ../../packages/resize-layout/src/index.ts
461
- /*
462
- * Tencent is pleased to support the open source community by making
463
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
464
- *
465
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
466
- *
467
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
468
- *
469
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
470
- *
471
- * ---------------------------------------------------
472
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
473
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
474
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
475
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
476
- *
477
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
478
- * the Software.
479
- *
480
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
481
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
482
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
483
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
484
- * IN THE SOFTWARE.
485
- */
486
-
487
-
488
- var BkResizeLayout = (0,external_shared_.withInstall)(resize_layout);
489
- /* harmony default export */ const src = (BkResizeLayout);
490
- })();
491
-
492
- /******/ return __webpack_exports__;
493
- /******/ })()
494
- ;
495
- });
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../icon"],t);else{var a="object"==typeof exports?t(require("../shared"),require("vue"),require("../icon")):t(e["../shared"],e.vue,e["../icon"]);for(var i in a)("object"==typeof exports?exports:e)[i]=a[i]}}(self,((e,t,a)=>(()=>{"use strict";var i={6870:e=>{e.exports=a},4212:t=>{t.exports=e},748:e=>{e.exports=t}},l={};function o(e){var t=l[e];if(void 0!==t)return t.exports;var a=l[e]={exports:{}};return i[e](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{default:()=>r});var e=o(4212);function t(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var a=o(748),i=o(6870);const l=(0,a.defineComponent)({name:"ResizeLayout",props:{placement:e.PropTypes.placement().def("left"),min:e.PropTypes.number.def(3),max:e.PropTypes.number.def(1/0),triggerWidth:e.PropTypes.number.def(5),triggerOffset:e.PropTypes.number.def(3),initialDivide:e.PropTypes.oneOfType([String,Number]).def("20%"),immediate:e.PropTypes.bool,disabled:e.PropTypes.bool,collapsible:e.PropTypes.bool,autoMinimize:e.PropTypes.oneOfType([Boolean,Number]).def(!1),border:e.PropTypes.bool.def(!0)},emits:["before-resize","resizing","after-resize","collapse-change"],setup:function(e,i){var l=i.emit,o=(0,a.toRefs)(e),n=o.placement,r=o.initialDivide,u=o.triggerOffset,s=o.triggerWidth,c=o.max,v=o.min,d=o.immediate,f=o.autoMinimize,p=(0,a.ref)(!1),m=(0,a.ref)(!0),b=(0,a.ref)(!1),y=(0,a.ref)(null),h=(0,a.ref)({}),g=(0,a.ref)(null),z=(0,a.ref)(null),x=(0,a.ref)(null),k=(0,a.ref)(null),w=(0,a.computed)((function(){return["left","right"].includes(n.value)})),P=(0,a.computed)((function(){return w.value?"width":"height"})),R=(0,a.computed)((function(){var e=r.value;return"number"==typeof e&&(e="".concat(e,"px")),t({},P.value,e)})),T=(0,a.computed)((function(){var e;return t(e={},"margin-".concat(n.value),"".concat(u.value-s.value,"px")),t(e,P.value,"".concat(s.value,"px")),e})),M=(0,a.computed)((function(){return f.value?"boolean"==typeof f.value?50:f.value:0})),S=new ResizeObserver((function(){var e=g.value.getBoundingClientRect();y.value=w.value?e.width:e.height})),C=function(){var e=k.value.getBoundingClientRect();O(!p.value),p.value?(k.value.setAttribute("data-".concat(P.value),"".concat(e[P.value],"px")),k.value.style[P.value]="5px"):(m.value=!0,k.value.style[P.value]=k.value.getAttribute("data-".concat(P.value)))},O=function(e){k.value.addEventListener("transitionend",(function t(){m.value=e,k.value.style.transition="",k.value.removeEventListener("transitionend",t)})),k.value.style.transition="".concat(P.value," cubic-bezier(0.4, 0, 0.2, 1) .3s")};return(0,a.onMounted)((function(){S.observe(g.value)})),(0,a.onBeforeUnmount)((function(){S.unobserve(g.value)})),{collapsed:p,asideContentVisible:m,minimized:b,limitMax:y,state:h,vertical:w,cssPropKey:P,bkResizeLayoutRef:g,resizeProxyRef:z,resizeMaskRef:x,asideRef:k,triggerStyle:T,asideStyle:R,handleMousedown:function(e){l("before-resize",e);var t=k.value.getBoundingClientRect();h.value=Object.freeze({mouse:{clientX:e.clientX,clientY:e.clientY},aside:{width:t.width,height:t.height}}),x.value.style.display="block",x.value.style.cursor=w.value?"col-resize":"row-resize",d.value||function(){switch(z.value.style.visibility="visible",n.value){case"left":z.value.style.inset="0 auto auto ".concat(h.value.aside.width,"px");break;case"right":z.value.style.inset="0 ".concat(h.value.aside.width,"px auto auto");break;case"top":z.value.style.inset="".concat(h.value.aside.height,"px auto auto 0");break;case"bottom":z.value.style.inset="auto auto ".concat(h.value.aside.height,"px 0")}}(),document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var i=function(e){var t;switch(n.value){case"top":t=e.clientY-h.value.mouse.clientY;break;case"right":t=h.value.mouse.clientX-e.clientX;break;case"bottom":t=h.value.mouse.clientY-e.clientY;break;case"left":t=e.clientX-h.value.mouse.clientX}var a,i=(a=h.value.aside[P.value]+t,Math.min(c.value,Math.max(v.value,a),y.value-s.value)+u.value),o="".concat(i,"px");d.value?k.value.style[P.value]=o:z.value.style[n.value]=o,l("resizing",i)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",(function e(){if(z.value.style.visibility="hidden",x.value.style.display="none",document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e),document.onselectstart=null,document.ondragstart=null,(0,a.nextTick)((function(){(function(){if(!f.value)return!1;var e=k.value.getBoundingClientRect();if(b.value=p.value=e[P.value]<=M.value,!b.value)return m.value=!0,!1;C(),(0,a.nextTick)((function(){k.value.setAttribute("data-".concat(P.value),R.value[P.value])}))})(),l("after-resize",parseFloat(z.value.style[n.value]))})),d.value)return!1;k.value.style[P.value]=z.value.style[n.value]}))},setCollapse:function(e){p.value="boolean"==typeof e?e:!p.value,C(),l("collapse-change",p.value)}}},render:function(){var e,t,l,o,n,r,u=["bk-resize-layout","bk-resize-layout-".concat(this.placement),{"bk-resize-layout-collapsed":this.collapsed,"bk-resize-layout-border":this.border}];return(0,a.createVNode)("div",{ref:"bkResizeLayoutRef",class:u},[(0,a.createVNode)("aside",{class:"bk-resize-layout-aside",ref:"asideRef",style:this.asideStyle},[(0,a.withDirectives)((0,a.createVNode)("div",{class:"bk-resize-layout-aside-content"},[null===(t=(e=this.$slots).aside)||void 0===t?void 0:t.call(e)]),[[a.vShow,this.asideContentVisible]]),(0,a.withDirectives)((0,a.createVNode)("i",{class:"bk-resize-trigger",style:this.triggerStyle,onMousedown:(0,a.withModifiers)(this.handleMousedown,["left"])},null),[[a.vShow,!this.disabled&&(!this.collapsed||this.autoMinimize)]]),(0,a.withDirectives)((0,a.createVNode)("i",{class:["bk-resize-proxy",this.placement],ref:"resizeProxyRef"},null),[[a.vShow,!this.collapsed||this.autoMinimize]]),this.collapsible&&((null===(o=(l=this.$slots)["collapse-trigger"])||void 0===o?void 0:o.call(l))||(this.collapsed?(0,a.createVNode)(i.AngleRight,{class:"bk-resize-collapse",onClick:this.setCollapse},null):(0,a.createVNode)(i.AngleLeft,{class:"bk-resize-collapse",onClick:this.setCollapse},null)))]),(0,a.createVNode)("main",{class:"bk-resize-layout-main"},[null===(r=(n=this.$slots).main)||void 0===r?void 0:r.call(n)]),(0,a.createVNode)("div",{class:"bk-resize-mask",ref:"resizeMaskRef"},null)])}}),r=(0,e.withInstall)(l)})(),n})()));