bkui-vue 0.0.2-beta.81 → 0.0.2-beta.82

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 (176) hide show
  1. package/dist/index.cjs.js +161 -135
  2. package/dist/index.esm.js +19126 -16409
  3. package/dist/index.umd.js +161 -135
  4. package/lib/affix/index.js +1 -321
  5. package/lib/alert/index.js +1 -214
  6. package/lib/animate-number/index.js +1 -155
  7. package/lib/backtop/index.js +1 -188
  8. package/lib/badge/index.js +1 -235
  9. package/lib/breadcrumb/index.js +1 -309
  10. package/lib/button/index.js +1 -321
  11. package/lib/card/index.js +1 -285
  12. package/lib/cascader/index.js +2 -2036
  13. package/lib/cascader/index.js.LICENSE.txt +1 -0
  14. package/lib/checkbox/index.js +1 -542
  15. package/lib/code-diff/index.js +1 -5501
  16. package/lib/collapse/index.js +1 -570
  17. package/lib/collapse-transition/index.js +1 -177
  18. package/lib/color-picker/index.js +1 -2665
  19. package/lib/components.js +1 -530
  20. package/lib/config-provider/index.js +1 -365
  21. package/lib/container/index.js +1 -391
  22. package/lib/date-picker/index.js +1 -5527
  23. package/lib/dialog/index.js +2 -975
  24. package/lib/dialog/index.js.LICENSE.txt +1 -0
  25. package/lib/directives/index.js +2 -1375
  26. package/lib/directives/index.js.LICENSE.txt +14 -0
  27. package/lib/dist.index.js +1 -87
  28. package/lib/divider/index.js +1 -169
  29. package/lib/dropdown/index.js +1 -369
  30. package/lib/exception/index.js +1 -385
  31. package/lib/fixed-navbar/index.js +1 -154
  32. package/lib/form/index.js +1 -952
  33. package/lib/hooks.js +1 -73
  34. package/lib/icon/angle-double-down-line.js +1 -191
  35. package/lib/icon/angle-double-left-line.js +1 -191
  36. package/lib/icon/angle-double-left.js +1 -191
  37. package/lib/icon/angle-double-right-line.js +1 -191
  38. package/lib/icon/angle-double-right.js +1 -191
  39. package/lib/icon/angle-double-up-line.js +1 -191
  40. package/lib/icon/angle-down-fill.js +1 -191
  41. package/lib/icon/angle-down-line.js +1 -191
  42. package/lib/icon/angle-down.js +1 -191
  43. package/lib/icon/angle-left.js +1 -191
  44. package/lib/icon/angle-right.js +1 -191
  45. package/lib/icon/angle-up-fill.js +1 -191
  46. package/lib/icon/angle-up.js +1 -191
  47. package/lib/icon/archive-fill.js +1 -191
  48. package/lib/icon/arrows-left.js +1 -191
  49. package/lib/icon/arrows-right.js +1 -191
  50. package/lib/icon/assistant.js +1 -191
  51. package/lib/icon/audio-fill.js +1 -191
  52. package/lib/icon/bk.js +1 -191
  53. package/lib/icon/circle.js +1 -191
  54. package/lib/icon/close-line.js +1 -191
  55. package/lib/icon/close.js +1 -191
  56. package/lib/icon/code.js +1 -191
  57. package/lib/icon/cog-shape.js +1 -191
  58. package/lib/icon/collapse-left.js +1 -191
  59. package/lib/icon/copy-shape.js +1 -191
  60. package/lib/icon/copy.js +1 -191
  61. package/lib/icon/data-shape.js +1 -191
  62. package/lib/icon/del.js +1 -191
  63. package/lib/icon/doc-fill.js +1 -191
  64. package/lib/icon/done.js +1 -191
  65. package/lib/icon/down-shape.js +1 -191
  66. package/lib/icon/down-small.js +1 -191
  67. package/lib/icon/edit-line.js +1 -191
  68. package/lib/icon/ellipsis.js +1 -191
  69. package/lib/icon/enlarge-line.js +1 -191
  70. package/lib/icon/error.js +1 -191
  71. package/lib/icon/excel-fill.js +1 -191
  72. package/lib/icon/exclamation-circle-shape.js +1 -191
  73. package/lib/icon/eye.js +1 -191
  74. package/lib/icon/filliscreen-line.js +1 -191
  75. package/lib/icon/fix-line.js +1 -191
  76. package/lib/icon/fix-shape.js +1 -191
  77. package/lib/icon/folder-open.js +1 -191
  78. package/lib/icon/folder-shape-open.js +1 -191
  79. package/lib/icon/folder-shape.js +1 -191
  80. package/lib/icon/folder.js +1 -191
  81. package/lib/icon/funnel.js +1 -191
  82. package/lib/icon/help-document-fill.js +1 -191
  83. package/lib/icon/help-fill.js +1 -191
  84. package/lib/icon/help.js +1 -191
  85. package/lib/icon/image-fill.js +1 -276
  86. package/lib/icon/img-error.js +1 -276
  87. package/lib/icon/img-placehoulder.js +1 -276
  88. package/lib/icon/index.js +1 -2399
  89. package/lib/icon/info-line.js +1 -276
  90. package/lib/icon/info.js +1 -276
  91. package/lib/icon/left-shape.js +1 -276
  92. package/lib/icon/left-turn-line.js +1 -276
  93. package/lib/icon/narrow-line.js +1 -276
  94. package/lib/icon/original.js +1 -276
  95. package/lib/icon/pdf-fill.js +1 -276
  96. package/lib/icon/play-shape.js +1 -276
  97. package/lib/icon/plus.js +1 -276
  98. package/lib/icon/ppt-fill.js +1 -276
  99. package/lib/icon/qq.js +1 -276
  100. package/lib/icon/right-shape.js +1 -276
  101. package/lib/icon/right-turn-line.js +1 -276
  102. package/lib/icon/search.js +1 -276
  103. package/lib/icon/share.js +1 -276
  104. package/lib/icon/spinner.js +1 -276
  105. package/lib/icon/success.js +1 -276
  106. package/lib/icon/switcher-loading.js +1 -276
  107. package/lib/icon/text-file.js +1 -276
  108. package/lib/icon/text-fill.js +1 -276
  109. package/lib/icon/transfer.js +1 -276
  110. package/lib/icon/tree-application-shape.js +1 -276
  111. package/lib/icon/unfull-screen.js +1 -276
  112. package/lib/icon/unvisible.js +1 -276
  113. package/lib/icon/up-shape.js +1 -276
  114. package/lib/icon/upload.js +1 -276
  115. package/lib/icon/video-fill.js +1 -276
  116. package/lib/icon/warn.js +1 -276
  117. package/lib/icon/weixin-pro.js +1 -276
  118. package/lib/icon/weixin.js +1 -276
  119. package/lib/image/index.js +1 -641
  120. package/lib/index.js +1 -97
  121. package/lib/info-box/index.js +2 -1165
  122. package/lib/info-box/index.js.LICENSE.txt +1 -0
  123. package/lib/input/index.js +2 -1218
  124. package/lib/input/index.js.LICENSE.txt +1 -0
  125. package/lib/link/index.js +1 -160
  126. package/lib/loading/index.js +1 -381
  127. package/lib/locale/index.js +1 -465
  128. package/lib/menu/index.js +1 -724
  129. package/lib/message/index.js +2 -1795
  130. package/lib/message/index.js.LICENSE.txt +6 -0
  131. package/lib/modal/index.js +1 -396
  132. package/lib/navigation/index.js +1 -367
  133. package/lib/notify/index.js +1 -397
  134. package/lib/overflow-title/index.js +1 -461
  135. package/lib/pagination/index.js +1 -880
  136. package/lib/plugin-popover/index.js +1 -3905
  137. package/lib/plugins/index.js +1 -63
  138. package/lib/pop-confirm/index.js +1 -273
  139. package/lib/popover/index.js +1 -3913
  140. package/lib/popover2/index.js +1 -107
  141. package/lib/preset.js +1 -93
  142. package/lib/process/index.js +2 -759
  143. package/lib/process/index.js.LICENSE.txt +1 -0
  144. package/lib/progress/index.js +1 -431
  145. package/lib/radio/index.js +1 -627
  146. package/lib/rate/index.js +1 -338
  147. package/lib/resize-layout/index.js +1 -429
  148. package/lib/search-select/index.js +2 -2729
  149. package/lib/search-select/index.js.LICENSE.txt +1 -0
  150. package/lib/select/index.js +2 -2251
  151. package/lib/select/index.js.LICENSE.txt +1 -0
  152. package/lib/shared/index.js +1 -2689
  153. package/lib/sideslider/index.js +2 -714
  154. package/lib/sideslider/index.js.LICENSE.txt +1 -0
  155. package/lib/slider/index.js +2 -1291
  156. package/lib/slider/index.js.LICENSE.txt +1 -0
  157. package/lib/steps/index.js +2 -825
  158. package/lib/steps/index.js.LICENSE.txt +1 -0
  159. package/lib/swiper/index.js +1 -336
  160. package/lib/switcher/index.js +1 -277
  161. package/lib/tab/index.js +1 -914
  162. package/lib/table/index.js +1 -6222
  163. package/lib/table/plugins/use-column-resize.d.ts +1 -1
  164. package/lib/table/use-column.d.ts +87 -0
  165. package/lib/table-column/index.js +1 -763
  166. package/lib/tag/index.js +1 -233
  167. package/lib/tag-input/index.js +1 -1660
  168. package/lib/tag-input/tag-input.d.ts +14 -2
  169. package/lib/time-picker/index.js +1 -71
  170. package/lib/timeline/index.js +1 -241
  171. package/lib/transfer/index.js +1 -673
  172. package/lib/tree/index.js +1 -2502
  173. package/lib/upload/index.js +2 -2874
  174. package/lib/upload/index.js.LICENSE.txt +1 -0
  175. package/lib/virtual-render/index.js +1 -865
  176. package/package.json +2 -13
@@ -1,429 +1 @@
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__config_provider_9d0186d9__ from "../config-provider";
4
- import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
5
- /******/ // The require scope
6
- /******/ var __webpack_require__ = {};
7
- /******/
8
- /************************************************************************/
9
- /******/ /* webpack/runtime/define property getters */
10
- /******/ (() => {
11
- /******/ // define getter functions for harmony exports
12
- /******/ __webpack_require__.d = (exports, definition) => {
13
- /******/ for(var key in definition) {
14
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
15
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
16
- /******/ }
17
- /******/ }
18
- /******/ };
19
- /******/ })();
20
- /******/
21
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
22
- /******/ (() => {
23
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
24
- /******/ })();
25
- /******/
26
- /************************************************************************/
27
- var __webpack_exports__ = {};
28
-
29
- // EXPORTS
30
- __webpack_require__.d(__webpack_exports__, {
31
- Z: () => (/* binding */ src)
32
- });
33
-
34
- ;// CONCATENATED MODULE: external "../shared"
35
- var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
36
- var y = x => () => x
37
- const external_shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
38
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
39
- function _typeof(obj) {
40
- "@babel/helpers - typeof";
41
-
42
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
43
- return typeof obj;
44
- } : function (obj) {
45
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
46
- }, _typeof(obj);
47
- }
48
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
49
-
50
- function _toPrimitive(input, hint) {
51
- if (_typeof(input) !== "object" || input === null) return input;
52
- var prim = input[Symbol.toPrimitive];
53
- if (prim !== undefined) {
54
- var res = prim.call(input, hint || "default");
55
- if (_typeof(res) !== "object") return res;
56
- throw new TypeError("@@toPrimitive must return a primitive value.");
57
- }
58
- return (hint === "string" ? String : Number)(input);
59
- }
60
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
61
-
62
-
63
- function _toPropertyKey(arg) {
64
- var key = _toPrimitive(arg, "string");
65
- return _typeof(key) === "symbol" ? key : String(key);
66
- }
67
- ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
68
-
69
- function _defineProperty(obj, key, value) {
70
- key = _toPropertyKey(key);
71
- if (key in obj) {
72
- Object.defineProperty(obj, key, {
73
- value: value,
74
- enumerable: true,
75
- configurable: true,
76
- writable: true
77
- });
78
- } else {
79
- obj[key] = value;
80
- }
81
- return obj;
82
- }
83
- ;// CONCATENATED MODULE: external "vue"
84
- var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
85
- var external_vue_y = x => () => x
86
- const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives, ["withModifiers"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withModifiers });
87
- ;// CONCATENATED MODULE: external "../config-provider"
88
- var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
89
- var external_config_provider_y = x => () => x
90
- const external_config_provider_namespaceObject = external_config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
91
- ;// CONCATENATED MODULE: external "../icon"
92
- var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
93
- var external_icon_y = x => () => x
94
- const external_icon_namespaceObject = external_icon_x({ ["AngleLeft"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.AngleLeft, ["AngleRight"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.AngleRight });
95
- ;// CONCATENATED MODULE: ../../packages/resize-layout/src/resize-layout.tsx
96
-
97
-
98
- /*
99
- * Tencent is pleased to support the open source community by making
100
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
101
- *
102
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
103
- *
104
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
105
- *
106
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
107
- *
108
- * ---------------------------------------------------
109
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
110
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
111
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
112
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
113
- *
114
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
115
- * the Software.
116
- *
117
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
118
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
119
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
120
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
121
- * IN THE SOFTWARE.
122
- */
123
-
124
-
125
-
126
-
127
- /* harmony default export */ const resize_layout = ((0,external_vue_namespaceObject.defineComponent)({
128
- name: 'ResizeLayout',
129
- props: {
130
- placement: external_shared_namespaceObject.PropTypes.placement().def('left'),
131
- min: external_shared_namespaceObject.PropTypes.number.def(3),
132
- max: external_shared_namespaceObject.PropTypes.number.def(Infinity),
133
- triggerWidth: external_shared_namespaceObject.PropTypes.number.def(5),
134
- triggerOffset: external_shared_namespaceObject.PropTypes.number.def(3),
135
- initialDivide: external_shared_namespaceObject.PropTypes.oneOfType([String, Number]).def('20%'),
136
- immediate: external_shared_namespaceObject.PropTypes.bool,
137
- disabled: external_shared_namespaceObject.PropTypes.bool,
138
- collapsible: external_shared_namespaceObject.PropTypes.bool,
139
- autoMinimize: external_shared_namespaceObject.PropTypes.oneOfType([Boolean, Number]).def(false),
140
- border: external_shared_namespaceObject.PropTypes.bool.def(true)
141
- },
142
- emits: ['before-resize', 'resizing', 'after-resize', 'collapse-change'],
143
- setup: function setup(props, _ref) {
144
- var emit = _ref.emit;
145
- var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
146
- placement = _toRefs.placement,
147
- initialDivide = _toRefs.initialDivide,
148
- triggerOffset = _toRefs.triggerOffset,
149
- triggerWidth = _toRefs.triggerWidth,
150
- max = _toRefs.max,
151
- min = _toRefs.min,
152
- immediate = _toRefs.immediate,
153
- autoMinimize = _toRefs.autoMinimize;
154
- var collapsed = (0,external_vue_namespaceObject.ref)(false);
155
- var asideContentVisible = (0,external_vue_namespaceObject.ref)(true);
156
- var minimized = (0,external_vue_namespaceObject.ref)(false);
157
- var limitMax = (0,external_vue_namespaceObject.ref)(null);
158
- var state = (0,external_vue_namespaceObject.ref)({});
159
- var bkResizeLayoutRef = (0,external_vue_namespaceObject.ref)(null);
160
- var resizeProxyRef = (0,external_vue_namespaceObject.ref)(null);
161
- var resizeMaskRef = (0,external_vue_namespaceObject.ref)(null);
162
- var asideRef = (0,external_vue_namespaceObject.ref)(null);
163
- var vertical = (0,external_vue_namespaceObject.computed)(function () {
164
- return ['left', 'right'].includes(placement.value);
165
- });
166
- var cssPropKey = (0,external_vue_namespaceObject.computed)(function () {
167
- return vertical.value ? 'width' : 'height';
168
- });
169
- var asideStyle = (0,external_vue_namespaceObject.computed)(function () {
170
- var divide = initialDivide.value;
171
- if (typeof divide === 'number') {
172
- divide = "".concat(divide, "px");
173
- }
174
- return _defineProperty({}, cssPropKey.value, divide);
175
- });
176
- var triggerStyle = (0,external_vue_namespaceObject.computed)(function () {
177
- var _style;
178
- var style = (_style = {}, _defineProperty(_style, "margin-".concat(placement.value), "".concat(triggerOffset.value - triggerWidth.value, "px")), _defineProperty(_style, cssPropKey.value, "".concat(triggerWidth.value, "px")), _style);
179
- return style;
180
- });
181
- var parseAutoMinimize = (0,external_vue_namespaceObject.computed)(function () {
182
- if (autoMinimize.value) {
183
- return typeof autoMinimize.value === 'boolean' ? 50 : autoMinimize.value;
184
- }
185
- return 0;
186
- });
187
- var setMaxLimit = function setMaxLimit() {
188
- var rect = bkResizeLayoutRef.value.getBoundingClientRect();
189
- limitMax.value = vertical.value ? rect.width : rect.height;
190
- };
191
- var observer = new ResizeObserver(setMaxLimit);
192
- // 更新 resizeProxyRef 的样式
193
- var updateResizeProxyStyle = function updateResizeProxyStyle() {
194
- resizeProxyRef.value.style.visibility = 'visible';
195
- switch (placement.value) {
196
- case 'left':
197
- resizeProxyRef.value.style.inset = "0 auto auto ".concat(state.value.aside.width, "px");
198
- break;
199
- case 'right':
200
- resizeProxyRef.value.style.inset = "0 ".concat(state.value.aside.width, "px auto auto");
201
- break;
202
- case 'top':
203
- resizeProxyRef.value.style.inset = "".concat(state.value.aside.height, "px auto auto 0");
204
- break;
205
- case 'bottom':
206
- resizeProxyRef.value.style.inset = "auto auto ".concat(state.value.aside.height, "px 0");
207
- break;
208
- }
209
- };
210
- // 更新遮罩的样式
211
- var updateResizeMaskStyle = function updateResizeMaskStyle() {
212
- resizeMaskRef.value.style.display = 'block';
213
- resizeMaskRef.value.style.cursor = vertical.value ? 'col-resize' : 'row-resize';
214
- };
215
- var getRealValue = function getRealValue(current) {
216
- return Math.min(max.value, Math.max(min.value, current), limitMax.value - triggerWidth.value);
217
- };
218
- // mousedown 事件处理
219
- var handleMousedown = function handleMousedown(event) {
220
- emit('before-resize', event);
221
- var asideRect = asideRef.value.getBoundingClientRect();
222
- state.value = Object.freeze({
223
- mouse: {
224
- clientX: event.clientX,
225
- clientY: event.clientY
226
- },
227
- aside: {
228
- width: asideRect.width,
229
- height: asideRect.height
230
- }
231
- });
232
- updateResizeMaskStyle();
233
- if (!immediate.value) {
234
- updateResizeProxyStyle();
235
- }
236
- document.onselectstart = function () {
237
- return false;
238
- };
239
- document.ondragstart = function () {
240
- return false;
241
- };
242
- var resizingCallback = function resizingCallback(value) {
243
- emit('resizing', value);
244
- };
245
- var handleMouseMove = function handleMouseMove(event) {
246
- var delta;
247
- switch (placement.value) {
248
- case 'top':
249
- delta = event.clientY - state.value.mouse.clientY;
250
- break;
251
- case 'right':
252
- delta = state.value.mouse.clientX - event.clientX;
253
- break;
254
- case 'bottom':
255
- delta = state.value.mouse.clientY - event.clientY;
256
- break;
257
- case 'left':
258
- delta = event.clientX - state.value.mouse.clientX;
259
- }
260
- var current = state.value.aside[cssPropKey.value] + delta;
261
- var realValue = getRealValue(current) + triggerOffset.value;
262
- var pixel = "".concat(realValue, "px");
263
- if (immediate.value) {
264
- asideRef.value.style[cssPropKey.value] = pixel;
265
- } else {
266
- resizeProxyRef.value.style[placement.value] = pixel;
267
- }
268
- resizingCallback(realValue);
269
- };
270
- var handleMouseUp = function handleMouseUp() {
271
- resizeProxyRef.value.style.visibility = 'hidden';
272
- resizeMaskRef.value.style.display = 'none';
273
- document.removeEventListener('mousemove', handleMouseMove);
274
- document.removeEventListener('mouseup', handleMouseUp);
275
- document.onselectstart = null;
276
- document.ondragstart = null;
277
- (0,external_vue_namespaceObject.nextTick)(function () {
278
- setupAutoMinimize();
279
- emit('after-resize', parseFloat(resizeProxyRef.value.style[placement.value]));
280
- });
281
- if (immediate.value) {
282
- return false;
283
- }
284
- asideRef.value.style[cssPropKey.value] = resizeProxyRef.value.style[placement.value];
285
- };
286
- document.addEventListener('mousemove', handleMouseMove);
287
- document.addEventListener('mouseup', handleMouseUp);
288
- };
289
- var setupAutoMinimize = function setupAutoMinimize() {
290
- if (!autoMinimize.value) {
291
- return false;
292
- }
293
- var asideRect = asideRef.value.getBoundingClientRect();
294
- // 最小化同时设置为已折叠,此时展开以初始化initial-divide数据为参考
295
- // eslint-disable-next-line no-multi-assign
296
- minimized.value = collapsed.value = asideRect[cssPropKey.value] <= parseAutoMinimize.value;
297
- if (!minimized.value) {
298
- asideContentVisible.value = true;
299
- return false;
300
- }
301
- setupAsideAnimation();
302
- (0,external_vue_namespaceObject.nextTick)(function () {
303
- asideRef.value.setAttribute("data-".concat(cssPropKey.value), asideStyle.value[cssPropKey.value]);
304
- });
305
- };
306
- var setCollapse = function setCollapse(collapse) {
307
- collapsed.value = typeof collapse === 'boolean' ? collapse : !collapsed.value;
308
- setupAsideAnimation();
309
- emit('collapse-change', collapsed.value);
310
- };
311
- var setupAsideAnimation = function setupAsideAnimation() {
312
- var asideRect = asideRef.value.getBoundingClientRect();
313
- setupAsideListener(!collapsed.value);
314
- if (collapsed.value) {
315
- asideRef.value.setAttribute("data-".concat(cssPropKey.value), "".concat(asideRect[cssPropKey.value], "px"));
316
- asideRef.value.style[cssPropKey.value] = props.collapsible ? '0px' : '5px';
317
- } else {
318
- asideContentVisible.value = true;
319
- asideRef.value.style[cssPropKey.value] = asideRef.value.getAttribute("data-".concat(cssPropKey.value));
320
- }
321
- };
322
- var setupAsideListener = function setupAsideListener(visible) {
323
- var removeClass = function removeClass() {
324
- asideContentVisible.value = visible;
325
- asideRef.value.style.transition = '';
326
- asideRef.value.removeEventListener('transitionend', removeClass);
327
- };
328
- asideRef.value.addEventListener('transitionend', removeClass);
329
- asideRef.value.style.transition = "".concat(cssPropKey.value, " cubic-bezier(0.4, 0, 0.2, 1) .3s");
330
- };
331
- (0,external_vue_namespaceObject.onMounted)(function () {
332
- observer.observe(bkResizeLayoutRef.value);
333
- });
334
- (0,external_vue_namespaceObject.onBeforeUnmount)(function () {
335
- if (bkResizeLayoutRef.value) {
336
- observer.unobserve(bkResizeLayoutRef.value);
337
- observer = null;
338
- }
339
- });
340
- var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
341
- resolveClassName = _usePrefix.resolveClassName;
342
- return {
343
- collapsed: collapsed,
344
- asideContentVisible: asideContentVisible,
345
- minimized: minimized,
346
- limitMax: limitMax,
347
- state: state,
348
- vertical: vertical,
349
- cssPropKey: cssPropKey,
350
- bkResizeLayoutRef: bkResizeLayoutRef,
351
- resizeProxyRef: resizeProxyRef,
352
- resizeMaskRef: resizeMaskRef,
353
- asideRef: asideRef,
354
- triggerStyle: triggerStyle,
355
- asideStyle: asideStyle,
356
- handleMousedown: handleMousedown,
357
- setCollapse: setCollapse,
358
- resolveClassName: resolveClassName
359
- };
360
- },
361
- render: function render() {
362
- var _ref3, _this$$slots$aside, _this$$slots, _this$$slots$collapse, _this$$slots2, _this$$slots$main, _this$$slots3;
363
- var bkResizeLayoutClass = ["".concat(this.resolveClassName('resize-layout')), "".concat(this.resolveClassName("resize-layout-".concat(this.placement))), (_ref3 = {}, _defineProperty(_ref3, "".concat(this.resolveClassName('resize-layout-collapsed')), this.collapsed), _defineProperty(_ref3, "".concat(this.resolveClassName('resize-layout-border')), this.border), _defineProperty(_ref3, "".concat(this.resolveClassName('resize-layout-collapsible')), this.collapsible), _ref3)];
364
- return (0,external_vue_namespaceObject.createVNode)("div", {
365
- "ref": "bkResizeLayoutRef",
366
- "class": bkResizeLayoutClass
367
- }, [(0,external_vue_namespaceObject.createVNode)("aside", {
368
- "class": "".concat(this.resolveClassName('resize-layout-aside')),
369
- "ref": "asideRef",
370
- "style": this.asideStyle
371
- }, [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
372
- "class": "".concat(this.resolveClassName('resize-layout-aside-content'))
373
- }, [(_this$$slots$aside = (_this$$slots = this.$slots).aside) === null || _this$$slots$aside === void 0 ? void 0 : _this$$slots$aside.call(_this$$slots)]), [[external_vue_namespaceObject.vShow, this.asideContentVisible]]), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("i", {
374
- "class": "".concat(this.resolveClassName('resize-trigger')),
375
- "style": this.triggerStyle,
376
- "onMousedown": (0,external_vue_namespaceObject.withModifiers)(this.handleMousedown, ['left'])
377
- }, null), [[external_vue_namespaceObject.vShow, !this.disabled && (!this.collapsed || this.autoMinimize)]]), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("i", {
378
- "class": ["".concat(this.resolveClassName('resize-proxy')), this.placement],
379
- "ref": "resizeProxyRef"
380
- }, null), [[external_vue_namespaceObject.vShow, !this.collapsed || this.autoMinimize]]), this.collapsible && (((_this$$slots$collapse = (_this$$slots2 = this.$slots)['collapse-trigger']) === null || _this$$slots$collapse === void 0 ? void 0 : _this$$slots$collapse.call(_this$$slots2)) || (this.collapsed ? (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.AngleRight, {
381
- "width": 26,
382
- "height": 26,
383
- "class": "".concat(this.resolveClassName('resize-collapse')),
384
- "onClick": this.setCollapse
385
- }, null) : (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.AngleLeft, {
386
- "width": 26,
387
- "height": 26,
388
- "class": "".concat(this.resolveClassName('resize-collapse')),
389
- "onClick": this.setCollapse
390
- }, null)))]), (0,external_vue_namespaceObject.createVNode)("main", {
391
- "class": "".concat(this.resolveClassName('resize-layout-main'))
392
- }, [(_this$$slots$main = (_this$$slots3 = this.$slots).main) === null || _this$$slots$main === void 0 ? void 0 : _this$$slots$main.call(_this$$slots3)]), (0,external_vue_namespaceObject.createVNode)("div", {
393
- "class": "".concat(this.resolveClassName('resize-mask')),
394
- "ref": "resizeMaskRef"
395
- }, null)]);
396
- }
397
- }));
398
- ;// CONCATENATED MODULE: ../../packages/resize-layout/src/index.ts
399
- /*
400
- * Tencent is pleased to support the open source community by making
401
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
402
- *
403
- * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
404
- *
405
- * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
406
- *
407
- * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
408
- *
409
- * ---------------------------------------------------
410
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
411
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
412
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
413
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
414
- *
415
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
416
- * the Software.
417
- *
418
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
419
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
420
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
421
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
422
- * IN THE SOFTWARE.
423
- */
424
-
425
-
426
- var BkResizeLayout = (0,external_shared_namespaceObject.withInstall)(resize_layout);
427
- /* harmony default export */ const src = (BkResizeLayout);
428
- var __webpack_exports__default = __webpack_exports__.Z;
429
- export { __webpack_exports__default as default };
1
+ import*as e from"../shared";import*as t from"vue";import*as a from"../config-provider";import*as i from"../icon";var l={d:(e,t)=>{for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},o={};l.d(o,{Z:()=>p});const s=(n={PropTypes:()=>e.PropTypes,withInstall:()=>e.withInstall},r={},l.d(r,n),r);var n,r;function u(e){return u="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},u(e)}function c(e,t,a){return(t=function(e){var t=function(e,t){if("object"!==u(e)||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var i=a.call(e,"string");if("object"!==u(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===u(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const v=(e=>{var t={};return l.d(t,e),t})({computed:()=>t.computed,createVNode:()=>t.createVNode,defineComponent:()=>t.defineComponent,nextTick:()=>t.nextTick,onBeforeUnmount:()=>t.onBeforeUnmount,onMounted:()=>t.onMounted,ref:()=>t.ref,toRefs:()=>t.toRefs,vShow:()=>t.vShow,withDirectives:()=>t.withDirectives,withModifiers:()=>t.withModifiers}),d=(e=>{var t={};return l.d(t,e),t})({usePrefix:()=>a.usePrefix}),f=(e=>{var t={};return l.d(t,e),t})({AngleLeft:()=>i.AngleLeft,AngleRight:()=>i.AngleRight}),m=(0,v.defineComponent)({name:"ResizeLayout",props:{placement:s.PropTypes.placement().def("left"),min:s.PropTypes.number.def(3),max:s.PropTypes.number.def(1/0),triggerWidth:s.PropTypes.number.def(5),triggerOffset:s.PropTypes.number.def(3),initialDivide:s.PropTypes.oneOfType([String,Number]).def("20%"),immediate:s.PropTypes.bool,disabled:s.PropTypes.bool,collapsible:s.PropTypes.bool,autoMinimize:s.PropTypes.oneOfType([Boolean,Number]).def(!1),border:s.PropTypes.bool.def(!0)},emits:["before-resize","resizing","after-resize","collapse-change"],setup:function(e,t){var a=t.emit,i=(0,v.toRefs)(e),l=i.placement,o=i.initialDivide,s=i.triggerOffset,n=i.triggerWidth,r=i.max,u=i.min,f=i.immediate,m=i.autoMinimize,p=(0,v.ref)(!1),h=(0,v.ref)(!0),y=(0,v.ref)(!1),b=(0,v.ref)(null),g=(0,v.ref)({}),z=(0,v.ref)(null),w=(0,v.ref)(null),C=(0,v.ref)(null),N=(0,v.ref)(null),x=(0,v.computed)((function(){return["left","right"].includes(l.value)})),P=(0,v.computed)((function(){return x.value?"width":"height"})),R=(0,v.computed)((function(){var e=o.value;return"number"==typeof e&&(e="".concat(e,"px")),c({},P.value,e)})),T=(0,v.computed)((function(){var e;return c(e={},"margin-".concat(l.value),"".concat(s.value-n.value,"px")),c(e,P.value,"".concat(n.value,"px")),e})),k=(0,v.computed)((function(){return m.value?"boolean"==typeof m.value?50:m.value:0})),M=new ResizeObserver((function(){var e=z.value.getBoundingClientRect();b.value=x.value?e.width:e.height})),S=function(){var t=N.value.getBoundingClientRect();V(!p.value),p.value?(N.value.setAttribute("data-".concat(P.value),"".concat(t[P.value],"px")),N.value.style[P.value]=e.collapsible?"0px":"5px"):(h.value=!0,N.value.style[P.value]=N.value.getAttribute("data-".concat(P.value)))},V=function(e){N.value.addEventListener("transitionend",(function t(){h.value=e,N.value.style.transition="",N.value.removeEventListener("transitionend",t)})),N.value.style.transition="".concat(P.value," cubic-bezier(0.4, 0, 0.2, 1) .3s")};(0,v.onMounted)((function(){M.observe(z.value)})),(0,v.onBeforeUnmount)((function(){z.value&&(M.unobserve(z.value),M=null)}));var L=(0,d.usePrefix)().resolveClassName;return{collapsed:p,asideContentVisible:h,minimized:y,limitMax:b,state:g,vertical:x,cssPropKey:P,bkResizeLayoutRef:z,resizeProxyRef:w,resizeMaskRef:C,asideRef:N,triggerStyle:T,asideStyle:R,handleMousedown:function(e){a("before-resize",e);var t=N.value.getBoundingClientRect();g.value=Object.freeze({mouse:{clientX:e.clientX,clientY:e.clientY},aside:{width:t.width,height:t.height}}),C.value.style.display="block",C.value.style.cursor=x.value?"col-resize":"row-resize",f.value||function(){switch(w.value.style.visibility="visible",l.value){case"left":w.value.style.inset="0 auto auto ".concat(g.value.aside.width,"px");break;case"right":w.value.style.inset="0 ".concat(g.value.aside.width,"px auto auto");break;case"top":w.value.style.inset="".concat(g.value.aside.height,"px auto auto 0");break;case"bottom":w.value.style.inset="auto auto ".concat(g.value.aside.height,"px 0")}}(),document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var i=function(e){var t;switch(l.value){case"top":t=e.clientY-g.value.mouse.clientY;break;case"right":t=g.value.mouse.clientX-e.clientX;break;case"bottom":t=g.value.mouse.clientY-e.clientY;break;case"left":t=e.clientX-g.value.mouse.clientX}var i,o=(i=g.value.aside[P.value]+t,Math.min(r.value,Math.max(u.value,i),b.value-n.value)+s.value),c="".concat(o,"px");f.value?N.value.style[P.value]=c:w.value.style[l.value]=c,a("resizing",o)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",(function e(){if(w.value.style.visibility="hidden",C.value.style.display="none",document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e),document.onselectstart=null,document.ondragstart=null,(0,v.nextTick)((function(){(function(){if(!m.value)return!1;var e=N.value.getBoundingClientRect();if(y.value=p.value=e[P.value]<=k.value,!y.value)return h.value=!0,!1;S(),(0,v.nextTick)((function(){N.value.setAttribute("data-".concat(P.value),R.value[P.value])}))})(),a("after-resize",parseFloat(w.value.style[l.value]))})),f.value)return!1;N.value.style[P.value]=w.value.style[l.value]}))},setCollapse:function(e){p.value="boolean"==typeof e?e:!p.value,S(),a("collapse-change",p.value)},resolveClassName:L}},render:function(){var e,t,a,i,l,o,s,n=["".concat(this.resolveClassName("resize-layout")),"".concat(this.resolveClassName("resize-layout-".concat(this.placement))),(e={},c(e,"".concat(this.resolveClassName("resize-layout-collapsed")),this.collapsed),c(e,"".concat(this.resolveClassName("resize-layout-border")),this.border),c(e,"".concat(this.resolveClassName("resize-layout-collapsible")),this.collapsible),e)];return(0,v.createVNode)("div",{ref:"bkResizeLayoutRef",class:n},[(0,v.createVNode)("aside",{class:"".concat(this.resolveClassName("resize-layout-aside")),ref:"asideRef",style:this.asideStyle},[(0,v.withDirectives)((0,v.createVNode)("div",{class:"".concat(this.resolveClassName("resize-layout-aside-content"))},[null===(a=(t=this.$slots).aside)||void 0===a?void 0:a.call(t)]),[[v.vShow,this.asideContentVisible]]),(0,v.withDirectives)((0,v.createVNode)("i",{class:"".concat(this.resolveClassName("resize-trigger")),style:this.triggerStyle,onMousedown:(0,v.withModifiers)(this.handleMousedown,["left"])},null),[[v.vShow,!this.disabled&&(!this.collapsed||this.autoMinimize)]]),(0,v.withDirectives)((0,v.createVNode)("i",{class:["".concat(this.resolveClassName("resize-proxy")),this.placement],ref:"resizeProxyRef"},null),[[v.vShow,!this.collapsed||this.autoMinimize]]),this.collapsible&&((null===(l=(i=this.$slots)["collapse-trigger"])||void 0===l?void 0:l.call(i))||(this.collapsed?(0,v.createVNode)(f.AngleRight,{width:26,height:26,class:"".concat(this.resolveClassName("resize-collapse")),onClick:this.setCollapse},null):(0,v.createVNode)(f.AngleLeft,{width:26,height:26,class:"".concat(this.resolveClassName("resize-collapse")),onClick:this.setCollapse},null)))]),(0,v.createVNode)("main",{class:"".concat(this.resolveClassName("resize-layout-main"))},[null===(s=(o=this.$slots).main)||void 0===s?void 0:s.call(o)]),(0,v.createVNode)("div",{class:"".concat(this.resolveClassName("resize-mask")),ref:"resizeMaskRef"},null)])}}),p=(0,s.withInstall)(m);var h=o.Z;export{h as default};