bkui-vue 0.0.2-beta.36 → 0.0.2-beta.37
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.
- package/lib/affix/index.js +391 -1
- package/lib/alert/index.js +287 -1
- package/lib/animate-number/index.js +219 -1
- package/lib/backtop/index.js +264 -1
- package/lib/badge/index.js +304 -1
- package/lib/breadcrumb/index.js +379 -1
- package/lib/button/index.js +403 -1
- package/lib/card/index.js +369 -1
- package/lib/cascader/index.js +2095 -2
- package/lib/checkbox/index.js +602 -1
- package/lib/code-diff/index.js +5548 -1
- package/lib/collapse/index.js +605 -1
- package/lib/collapse-transition/index.js +237 -1
- package/lib/color-picker/index.js +2735 -1
- package/lib/components.js +770 -1
- package/lib/config-provider/index.js +377 -1
- package/lib/container/index.js +408 -1
- package/lib/date-picker/index.js +5576 -1
- package/lib/dialog/index.js +1324 -2
- package/lib/directives/index.js +1386 -2
- package/lib/dist.index.js +179 -1
- package/lib/divider/index.js +237 -1
- package/lib/dropdown/index.js +455 -1
- package/lib/exception/index.js +435 -1
- package/lib/fixed-navbar/index.js +222 -1
- package/lib/form/index.js +1004 -1
- package/lib/hooks.js +133 -1
- package/lib/icon/angle-double-down-line.js +541 -1
- package/lib/icon/angle-double-left-line.js +541 -1
- package/lib/icon/angle-double-left.js +541 -1
- package/lib/icon/angle-double-right-line.js +541 -1
- package/lib/icon/angle-double-right.js +541 -1
- package/lib/icon/angle-double-up-line.js +541 -1
- package/lib/icon/angle-down-fill.js +541 -1
- package/lib/icon/angle-down-line.js +541 -1
- package/lib/icon/angle-down.js +541 -1
- package/lib/icon/angle-left.js +541 -1
- package/lib/icon/angle-right.js +541 -1
- package/lib/icon/angle-up-fill.js +541 -1
- package/lib/icon/angle-up.js +541 -1
- package/lib/icon/archive-fill.js +541 -1
- package/lib/icon/arrows-left.js +541 -1
- package/lib/icon/arrows-right.js +541 -1
- package/lib/icon/assistant.js +541 -1
- package/lib/icon/audio-fill.js +541 -1
- package/lib/icon/bk.js +541 -1
- package/lib/icon/circle.js +541 -1
- package/lib/icon/close-line.js +541 -1
- package/lib/icon/close.js +541 -1
- package/lib/icon/code.js +541 -1
- package/lib/icon/cog-shape.js +541 -1
- package/lib/icon/collapse-left.js +541 -1
- package/lib/icon/copy-shape.js +541 -1
- package/lib/icon/copy.js +541 -1
- package/lib/icon/data-shape.js +541 -1
- package/lib/icon/del.js +541 -1
- package/lib/icon/doc-fill.js +541 -1
- package/lib/icon/done.js +541 -1
- package/lib/icon/down-shape.js +541 -1
- package/lib/icon/down-small.js +541 -1
- package/lib/icon/edit-line.js +541 -1
- package/lib/icon/ellipsis.js +541 -1
- package/lib/icon/enlarge-line.js +541 -1
- package/lib/icon/error.js +541 -1
- package/lib/icon/excel-fill.js +541 -1
- package/lib/icon/exclamation-circle-shape.js +541 -1
- package/lib/icon/eye.js +541 -1
- package/lib/icon/filliscreen-line.js +541 -1
- package/lib/icon/fix-line.js +541 -1
- package/lib/icon/fix-shape.js +541 -1
- package/lib/icon/folder-open.js +541 -1
- package/lib/icon/folder-shape-open.js +541 -1
- package/lib/icon/folder-shape.js +541 -1
- package/lib/icon/folder.js +541 -1
- package/lib/icon/funnel.js +541 -1
- package/lib/icon/help-document-fill.js +541 -1
- package/lib/icon/help-fill.js +541 -1
- package/lib/icon/help.js +541 -1
- package/lib/icon/image-fill.js +563 -1
- package/lib/icon/img-error.js +563 -1
- package/lib/icon/img-placehoulder.js +563 -1
- package/lib/icon/index.js +2353 -1
- package/lib/icon/info-line.js +563 -1
- package/lib/icon/info.js +563 -1
- package/lib/icon/left-shape.js +563 -1
- package/lib/icon/left-turn-line.js +563 -1
- package/lib/icon/narrow-line.js +563 -1
- package/lib/icon/original.js +563 -1
- package/lib/icon/pdf-fill.js +563 -1
- package/lib/icon/play-shape.js +563 -1
- package/lib/icon/plus.js +563 -1
- package/lib/icon/ppt-fill.js +563 -1
- package/lib/icon/qq.js +563 -1
- package/lib/icon/right-shape.js +563 -1
- package/lib/icon/right-turn-line.js +563 -1
- package/lib/icon/search.js +563 -1
- package/lib/icon/share.js +563 -1
- package/lib/icon/spinner.js +563 -1
- package/lib/icon/success.js +563 -1
- package/lib/icon/switcher-loading.js +563 -1
- package/lib/icon/text-file.js +563 -1
- package/lib/icon/text-fill.js +563 -1
- package/lib/icon/transfer.js +563 -1
- package/lib/icon/tree-application-shape.js +563 -1
- package/lib/icon/unfull-screen.js +563 -1
- package/lib/icon/unvisible.js +563 -1
- package/lib/icon/up-shape.js +563 -1
- package/lib/icon/upload.js +563 -1
- package/lib/icon/video-fill.js +563 -1
- package/lib/icon/warn.js +563 -1
- package/lib/icon/weixin-pro.js +563 -1
- package/lib/icon/weixin.js +563 -1
- package/lib/image/index.js +681 -1
- package/lib/index.js +195 -1
- package/lib/info-box/index.js +1514 -2
- package/lib/input/index.js +1038 -1
- package/lib/link/index.js +232 -1
- package/lib/loading/index.js +443 -1
- package/lib/locale/index.js +489 -1
- package/lib/menu/index.js +793 -1
- package/lib/message/index.js +1842 -2
- package/lib/modal/index.js +407 -1
- package/lib/navigation/index.js +439 -1
- package/lib/notify/index.js +470 -1
- package/lib/overflow-title/index.js +547 -1
- package/lib/pagination/index.js +974 -1
- package/lib/plugin-popover/index.js +4121 -1
- package/lib/plugins/index.js +130 -1
- package/lib/pop-confirm/index.js +367 -1
- package/lib/popover/index.js +4127 -1
- package/lib/popover2/index.js +171 -1
- package/lib/preset.js +164 -1
- package/lib/process/index.js +1146 -2
- package/lib/progress/index.js +495 -1
- package/lib/radio/index.js +693 -1
- package/lib/rate/index.js +406 -1
- package/lib/resize-layout/index.js +499 -1
- package/lib/search-select/index.js +3024 -2
- package/lib/select/index.js +2599 -2
- package/lib/shared/index.js +2832 -1
- package/lib/sideslider/index.js +1056 -2
- package/lib/slider/index.js +1683 -2
- package/lib/steps/index.js +1215 -2
- package/lib/swiper/index.js +404 -1
- package/lib/switcher/index.js +335 -1
- package/lib/tab/index.js +935 -1
- package/lib/table/index.js +6588 -1
- package/lib/table-column/index.js +768 -1
- package/lib/tag/index.js +309 -1
- package/lib/tag-input/index.js +1758 -1
- package/lib/time-picker/index.js +142 -1
- package/lib/timeline/index.js +310 -1
- package/lib/transfer/index.js +767 -1
- package/lib/tree/index.js +2664 -1
- package/lib/upload/index.js +3257 -2
- package/lib/virtual-render/index.js +806 -1
- package/package.json +1 -1
- package/lib/cascader/index.js.LICENSE.txt +0 -1
- package/lib/dialog/index.js.LICENSE.txt +0 -1
- package/lib/directives/index.js.LICENSE.txt +0 -14
- package/lib/info-box/index.js.LICENSE.txt +0 -1
- package/lib/message/index.js.LICENSE.txt +0 -6
- package/lib/process/index.js.LICENSE.txt +0 -1
- package/lib/search-select/index.js.LICENSE.txt +0 -1
- package/lib/select/index.js.LICENSE.txt +0 -1
- package/lib/sideslider/index.js.LICENSE.txt +0 -1
- package/lib/slider/index.js.LICENSE.txt +0 -1
- package/lib/steps/index.js.LICENSE.txt +0 -1
- package/lib/upload/index.js.LICENSE.txt +0 -1
package/lib/menu/index.js
CHANGED
@@ -1 +1,793 @@
|
|
1
|
-
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
3
|
+
module.exports = factory(require("../shared"), require("vue"), require("../config-provider"), require("../icon/"));
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
5
|
+
define(["../shared", "vue", "../config-provider", "../icon/"], factory);
|
6
|
+
else {
|
7
|
+
var a = typeof exports === 'object' ? factory(require("../shared"), require("vue"), require("../config-provider"), require("../icon/")) : factory(root["../shared"], root["vue"], root["../config-provider"], 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__2717__, __WEBPACK_EXTERNAL_MODULE__7685__) => {
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
12
|
+
/******/ "use strict";
|
13
|
+
/******/ var __webpack_modules__ = ({
|
14
|
+
|
15
|
+
/***/ 2717:
|
16
|
+
/***/ ((module) => {
|
17
|
+
|
18
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__2717__;
|
19
|
+
|
20
|
+
/***/ }),
|
21
|
+
|
22
|
+
/***/ 7685:
|
23
|
+
/***/ ((module) => {
|
24
|
+
|
25
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__7685__;
|
26
|
+
|
27
|
+
/***/ }),
|
28
|
+
|
29
|
+
/***/ 4212:
|
30
|
+
/***/ ((module) => {
|
31
|
+
|
32
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__4212__;
|
33
|
+
|
34
|
+
/***/ }),
|
35
|
+
|
36
|
+
/***/ 748:
|
37
|
+
/***/ ((module) => {
|
38
|
+
|
39
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__748__;
|
40
|
+
|
41
|
+
/***/ })
|
42
|
+
|
43
|
+
/******/ });
|
44
|
+
/************************************************************************/
|
45
|
+
/******/ // The module cache
|
46
|
+
/******/ var __webpack_module_cache__ = {};
|
47
|
+
/******/
|
48
|
+
/******/ // The require function
|
49
|
+
/******/ function __webpack_require__(moduleId) {
|
50
|
+
/******/ // Check if module is in cache
|
51
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
52
|
+
/******/ if (cachedModule !== undefined) {
|
53
|
+
/******/ return cachedModule.exports;
|
54
|
+
/******/ }
|
55
|
+
/******/ // Create a new module (and put it into the cache)
|
56
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
57
|
+
/******/ // no module.id needed
|
58
|
+
/******/ // no module.loaded needed
|
59
|
+
/******/ exports: {}
|
60
|
+
/******/ };
|
61
|
+
/******/
|
62
|
+
/******/ // Execute the module function
|
63
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
64
|
+
/******/
|
65
|
+
/******/ // Return the exports of the module
|
66
|
+
/******/ return module.exports;
|
67
|
+
/******/ }
|
68
|
+
/******/
|
69
|
+
/************************************************************************/
|
70
|
+
/******/ /* webpack/runtime/define property getters */
|
71
|
+
/******/ (() => {
|
72
|
+
/******/ // define getter functions for harmony exports
|
73
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
74
|
+
/******/ for(var key in definition) {
|
75
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
76
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
77
|
+
/******/ }
|
78
|
+
/******/ }
|
79
|
+
/******/ };
|
80
|
+
/******/ })();
|
81
|
+
/******/
|
82
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
83
|
+
/******/ (() => {
|
84
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
85
|
+
/******/ })();
|
86
|
+
/******/
|
87
|
+
/******/ /* webpack/runtime/make namespace object */
|
88
|
+
/******/ (() => {
|
89
|
+
/******/ // define __esModule on exports
|
90
|
+
/******/ __webpack_require__.r = (exports) => {
|
91
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
92
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
93
|
+
/******/ }
|
94
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
95
|
+
/******/ };
|
96
|
+
/******/ })();
|
97
|
+
/******/
|
98
|
+
/************************************************************************/
|
99
|
+
var __webpack_exports__ = {};
|
100
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
101
|
+
(() => {
|
102
|
+
// ESM COMPAT FLAG
|
103
|
+
__webpack_require__.r(__webpack_exports__);
|
104
|
+
|
105
|
+
// EXPORTS
|
106
|
+
__webpack_require__.d(__webpack_exports__, {
|
107
|
+
BkMenu: () => (/* binding */ BkMenu),
|
108
|
+
BkMenuGroup: () => (/* reexport */ menu_group),
|
109
|
+
BkMenuItem: () => (/* reexport */ menu_item),
|
110
|
+
BkSubmenu: () => (/* reexport */ submenu),
|
111
|
+
"default": () => (/* binding */ src)
|
112
|
+
});
|
113
|
+
|
114
|
+
// EXTERNAL MODULE: external "../shared"
|
115
|
+
var external_shared_ = __webpack_require__(4212);
|
116
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
117
|
+
function _typeof(obj) {
|
118
|
+
"@babel/helpers - typeof";
|
119
|
+
|
120
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
121
|
+
return typeof obj;
|
122
|
+
} : function (obj) {
|
123
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
124
|
+
}, _typeof(obj);
|
125
|
+
}
|
126
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
127
|
+
|
128
|
+
function _toPrimitive(input, hint) {
|
129
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
130
|
+
var prim = input[Symbol.toPrimitive];
|
131
|
+
if (prim !== undefined) {
|
132
|
+
var res = prim.call(input, hint || "default");
|
133
|
+
if (_typeof(res) !== "object") return res;
|
134
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
135
|
+
}
|
136
|
+
return (hint === "string" ? String : Number)(input);
|
137
|
+
}
|
138
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
139
|
+
|
140
|
+
|
141
|
+
function _toPropertyKey(arg) {
|
142
|
+
var key = _toPrimitive(arg, "string");
|
143
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
144
|
+
}
|
145
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
146
|
+
|
147
|
+
function _defineProperty(obj, key, value) {
|
148
|
+
key = _toPropertyKey(key);
|
149
|
+
if (key in obj) {
|
150
|
+
Object.defineProperty(obj, key, {
|
151
|
+
value: value,
|
152
|
+
enumerable: true,
|
153
|
+
configurable: true,
|
154
|
+
writable: true
|
155
|
+
});
|
156
|
+
} else {
|
157
|
+
obj[key] = value;
|
158
|
+
}
|
159
|
+
return obj;
|
160
|
+
}
|
161
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
162
|
+
function _arrayLikeToArray(arr, len) {
|
163
|
+
if (len == null || len > arr.length) len = arr.length;
|
164
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
165
|
+
return arr2;
|
166
|
+
}
|
167
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
168
|
+
|
169
|
+
function _arrayWithoutHoles(arr) {
|
170
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
171
|
+
}
|
172
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
173
|
+
function _iterableToArray(iter) {
|
174
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
175
|
+
}
|
176
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
177
|
+
|
178
|
+
function _unsupportedIterableToArray(o, minLen) {
|
179
|
+
if (!o) return;
|
180
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
181
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
182
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
183
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
184
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
185
|
+
}
|
186
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
187
|
+
function _nonIterableSpread() {
|
188
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
189
|
+
}
|
190
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
function _toConsumableArray(arr) {
|
196
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
197
|
+
}
|
198
|
+
// EXTERNAL MODULE: external "vue"
|
199
|
+
var external_vue_ = __webpack_require__(748);
|
200
|
+
// EXTERNAL MODULE: external "../config-provider"
|
201
|
+
var external_config_provider_ = __webpack_require__(2717);
|
202
|
+
;// CONCATENATED MODULE: ../../packages/menu/src/utils.ts
|
203
|
+
|
204
|
+
/* eslint-disable no-param-reassign */
|
205
|
+
/*
|
206
|
+
* Tencent is pleased to support the open source community by making
|
207
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
208
|
+
*
|
209
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
210
|
+
*
|
211
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
212
|
+
*
|
213
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
214
|
+
*
|
215
|
+
* ---------------------------------------------------
|
216
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
217
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
218
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
219
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
220
|
+
*
|
221
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
222
|
+
* the Software.
|
223
|
+
*
|
224
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
225
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
226
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
227
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
228
|
+
* IN THE SOFTWARE.
|
229
|
+
*/
|
230
|
+
|
231
|
+
var MENU_PROVIDER_KEY = Symbol('MENU_PROVIDER_KEY');
|
232
|
+
var MENU_PROVIDER_KEY_PATH = Symbol('MENU_PROVIDER_KEY_PATH');
|
233
|
+
var useMenuProvider = function useMenuProvider(data) {
|
234
|
+
(0,external_vue_.provide)(MENU_PROVIDER_KEY, data);
|
235
|
+
};
|
236
|
+
var useMenuPathProvider = function useMenuPathProvider(key) {
|
237
|
+
var _useMenuPathInject = useMenuPathInject(),
|
238
|
+
parentKeys = _useMenuPathInject.parentKeys,
|
239
|
+
parentInfo = _useMenuPathInject.parentInfo;
|
240
|
+
var keys = (0,external_vue_.computed)(function () {
|
241
|
+
return [].concat(_toConsumableArray(parentKeys.value), [key]);
|
242
|
+
});
|
243
|
+
(0,external_vue_.provide)(MENU_PROVIDER_KEY_PATH, {
|
244
|
+
parentInfo: {
|
245
|
+
key: key,
|
246
|
+
parentKey: parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.key
|
247
|
+
},
|
248
|
+
parentKeys: keys
|
249
|
+
});
|
250
|
+
};
|
251
|
+
var useMenuInject = function useMenuInject() {
|
252
|
+
return (0,external_vue_.inject)(MENU_PROVIDER_KEY);
|
253
|
+
};
|
254
|
+
var useMenuPathInject = function useMenuPathInject() {
|
255
|
+
var _a;
|
256
|
+
var instance = (0,external_vue_.getCurrentInstance)();
|
257
|
+
var provides = !instance.parent ? (_a = instance.vnode.appContext) === null || _a === void 0 ? void 0 : _a.provides : instance.parent.provides;
|
258
|
+
if (provides && MENU_PROVIDER_KEY_PATH in provides) {
|
259
|
+
return (0,external_vue_.inject)(MENU_PROVIDER_KEY_PATH);
|
260
|
+
}
|
261
|
+
return {
|
262
|
+
parentInfo: undefined,
|
263
|
+
parentKeys: (0,external_vue_.ref)([])
|
264
|
+
};
|
265
|
+
};
|
266
|
+
var trimArr = function trimArr(s) {
|
267
|
+
return (s || '').split(' ').filter(function (item) {
|
268
|
+
return !!item.trim();
|
269
|
+
});
|
270
|
+
};
|
271
|
+
function removeClass(el, cls) {
|
272
|
+
if (!el || !cls) return;
|
273
|
+
var classes = trimArr(cls);
|
274
|
+
var curClass = el.getAttribute('class') || '';
|
275
|
+
if (el.classList) {
|
276
|
+
var _el$classList;
|
277
|
+
(_el$classList = el.classList).remove.apply(_el$classList, _toConsumableArray(classes));
|
278
|
+
return;
|
279
|
+
}
|
280
|
+
classes.forEach(function (item) {
|
281
|
+
curClass = curClass.replace(" ".concat(item, " "), ' ');
|
282
|
+
});
|
283
|
+
var className = trimArr(curClass).join(' ');
|
284
|
+
el.setAttribute('class', className);
|
285
|
+
}
|
286
|
+
/* istanbul ignore next */
|
287
|
+
function addClass(el, cls) {
|
288
|
+
if (!el) return;
|
289
|
+
var className = el.getAttribute('class') || '';
|
290
|
+
var curClass = trimArr(className);
|
291
|
+
var classes = (cls || '').split(' ').filter(function (item) {
|
292
|
+
return !curClass.includes(item) && !!item.trim();
|
293
|
+
});
|
294
|
+
if (el.classList) {
|
295
|
+
var _el$classList2;
|
296
|
+
(_el$classList2 = el.classList).add.apply(_el$classList2, _toConsumableArray(classes));
|
297
|
+
} else {
|
298
|
+
className += " ".concat(classes.join(' '));
|
299
|
+
el.setAttribute('class', className);
|
300
|
+
}
|
301
|
+
}
|
302
|
+
var collapseMotion = function collapseMotion() {
|
303
|
+
return {
|
304
|
+
css: true,
|
305
|
+
onBeforeEnter: function onBeforeEnter(el) {
|
306
|
+
addClass(el, 'collapse-transition');
|
307
|
+
if (!el.dataset) el.dataset = {};
|
308
|
+
el.style.height = '0px';
|
309
|
+
el.style.maxHeight = '0px';
|
310
|
+
},
|
311
|
+
onEnter: function onEnter(el) {
|
312
|
+
el.dataset.oldOverflow = el.style.overflow;
|
313
|
+
if (el.scrollHeight !== 0) {
|
314
|
+
el.style.height = "".concat(el.scrollHeight, "px");
|
315
|
+
el.style.maxHeight = "".concat(el.scrollHeight, "px");
|
316
|
+
} else {
|
317
|
+
el.style.height = '0px';
|
318
|
+
el.style.maxHeight = '0px';
|
319
|
+
}
|
320
|
+
el.style.overflow = 'hidden';
|
321
|
+
},
|
322
|
+
onAfterEnter: function onAfterEnter(el) {
|
323
|
+
el.style.height = '';
|
324
|
+
el.style.maxHeight = '';
|
325
|
+
el.style.overflow = el.dataset.oldOverflow;
|
326
|
+
removeClass(el, 'collapse-transition');
|
327
|
+
},
|
328
|
+
onBeforeLeave: function onBeforeLeave(el) {
|
329
|
+
if (!el.dataset) el.dataset = {};
|
330
|
+
el.dataset.oldOverflow = el.style.overflow;
|
331
|
+
el.style.height = "".concat(el.scrollHeight, "px");
|
332
|
+
el.style.maxHeight = "".concat(el.scrollHeight, "px");
|
333
|
+
el.style.overflow = 'hidden';
|
334
|
+
},
|
335
|
+
onLeave: function onLeave(el) {
|
336
|
+
if (el.scrollHeight !== 0) {
|
337
|
+
addClass(el, 'collapse-transition');
|
338
|
+
el.style.transitionProperty = 'height';
|
339
|
+
el.style.height = '0px';
|
340
|
+
el.style.maxHeight = '0px';
|
341
|
+
}
|
342
|
+
},
|
343
|
+
onAfterLeave: function onAfterLeave(el) {
|
344
|
+
removeClass(el, 'collapse-transition');
|
345
|
+
el.style.height = '';
|
346
|
+
el.style.maxHeight = '';
|
347
|
+
el.style.overflow = el.dataset.oldOverflow;
|
348
|
+
}
|
349
|
+
};
|
350
|
+
};
|
351
|
+
;// CONCATENATED MODULE: ../../packages/menu/src/menu.tsx
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
/*
|
356
|
+
* Tencent is pleased to support the open source community by making
|
357
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
358
|
+
*
|
359
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
360
|
+
*
|
361
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
362
|
+
*
|
363
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
364
|
+
*
|
365
|
+
* ---------------------------------------------------
|
366
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
367
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
368
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
369
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
370
|
+
*
|
371
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
372
|
+
* the Software.
|
373
|
+
*
|
374
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
375
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
376
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
377
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
378
|
+
* IN THE SOFTWARE.
|
379
|
+
*/
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
var menuProps = {
|
384
|
+
activeKey: String,
|
385
|
+
collapse: Boolean,
|
386
|
+
openedKeys: {
|
387
|
+
type: Array
|
388
|
+
},
|
389
|
+
mode: {
|
390
|
+
type: String,
|
391
|
+
"default": 'vertical'
|
392
|
+
},
|
393
|
+
uniqueOpen: {
|
394
|
+
type: Boolean,
|
395
|
+
"default": true
|
396
|
+
}
|
397
|
+
};
|
398
|
+
/* harmony default export */ const menu = ((0,external_vue_.defineComponent)({
|
399
|
+
name: 'Menu',
|
400
|
+
props: menuProps,
|
401
|
+
emits: ['update:activeKey', 'update:openKeys', 'click', 'openChange'],
|
402
|
+
setup: function setup(props, _ref) {
|
403
|
+
var slots = _ref.slots,
|
404
|
+
emit = _ref.emit,
|
405
|
+
expose = _ref.expose;
|
406
|
+
var activeKey = (0,external_vue_.ref)('');
|
407
|
+
var openedKeys = (0,external_vue_.ref)([]);
|
408
|
+
var menuStore = (0,external_vue_.ref)({});
|
409
|
+
var mode = (0,external_vue_.computed)(function () {
|
410
|
+
return props.mode;
|
411
|
+
});
|
412
|
+
var collapse = (0,external_vue_.ref)(props.collapse);
|
413
|
+
var oldOpenKeys = (0,external_vue_.ref)([]);
|
414
|
+
(0,external_vue_.watchEffect)(function () {
|
415
|
+
if (props.activeKey !== undefined) {
|
416
|
+
activeKey.value = props.activeKey;
|
417
|
+
}
|
418
|
+
});
|
419
|
+
(0,external_vue_.watch)(function () {
|
420
|
+
return props.collapse;
|
421
|
+
}, function () {
|
422
|
+
collapse.value = props.collapse;
|
423
|
+
var oldKeys = _toConsumableArray(oldOpenKeys.value);
|
424
|
+
var openKeys = _toConsumableArray(openedKeys.value);
|
425
|
+
openedKeys.value = collapse.value ? [] : oldKeys;
|
426
|
+
oldOpenKeys.value = collapse.value ? openKeys : [];
|
427
|
+
}, {
|
428
|
+
immediate: true
|
429
|
+
});
|
430
|
+
(0,external_vue_.watch)(function () {
|
431
|
+
return props.openedKeys;
|
432
|
+
}, function () {
|
433
|
+
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : openedKeys.value;
|
434
|
+
openedKeys.value = keys;
|
435
|
+
}, {
|
436
|
+
immediate: true
|
437
|
+
});
|
438
|
+
var registerMenuInfo = function registerMenuInfo(key, info) {
|
439
|
+
menuStore.value = Object.assign(Object.assign({}, menuStore.value), _defineProperty({}, key, info));
|
440
|
+
};
|
441
|
+
var unregisterMenuInfo = function unregisterMenuInfo(key) {
|
442
|
+
delete menuStore.value[key];
|
443
|
+
menuStore.value = Object.assign({}, menuStore.value);
|
444
|
+
};
|
445
|
+
var handleOpenChange = function handleOpenChange(key, opened) {
|
446
|
+
if (opened) {
|
447
|
+
if (props.uniqueOpen) {
|
448
|
+
openedKeys.value = [key];
|
449
|
+
} else openedKeys.value.push(key);
|
450
|
+
} else {
|
451
|
+
openedKeys.value = openedKeys.value.filter(function (v) {
|
452
|
+
return v !== key;
|
453
|
+
});
|
454
|
+
}
|
455
|
+
emit('openChange', opened, menuStore.value[key]);
|
456
|
+
emit('update:openKeys', _toConsumableArray(openedKeys.value));
|
457
|
+
};
|
458
|
+
var handleActiveChange = function handleActiveChange(key) {
|
459
|
+
activeKey.value = key;
|
460
|
+
emit('click', menuStore.value[key]);
|
461
|
+
emit('update:activeKey', key, menuStore.value[key]);
|
462
|
+
};
|
463
|
+
useMenuProvider({
|
464
|
+
activeKey: activeKey,
|
465
|
+
menuStore: menuStore,
|
466
|
+
registerMenuInfo: registerMenuInfo,
|
467
|
+
unregisterMenuInfo: unregisterMenuInfo,
|
468
|
+
mode: mode.value,
|
469
|
+
openedKeys: openedKeys,
|
470
|
+
collapse: collapse,
|
471
|
+
handleOpenChange: handleOpenChange,
|
472
|
+
handleActiveChange: handleActiveChange
|
473
|
+
});
|
474
|
+
expose({
|
475
|
+
activeKey: activeKey,
|
476
|
+
openedKeys: openedKeys,
|
477
|
+
menuStore: menuStore
|
478
|
+
});
|
479
|
+
var _usePrefix = (0,external_config_provider_.usePrefix)(),
|
480
|
+
resolveClassName = _usePrefix.resolveClassName;
|
481
|
+
return function () {
|
482
|
+
var _ref2;
|
483
|
+
var _a;
|
484
|
+
return (0,external_vue_.createVNode)("div", {
|
485
|
+
"class": (_ref2 = {}, _defineProperty(_ref2, "".concat(resolveClassName('menu')), true), _defineProperty(_ref2, 'is-collapse', collapse.value), _ref2)
|
486
|
+
}, [(_a = slots["default"]) === null || _a === void 0 ? void 0 : _a.call(slots)]);
|
487
|
+
};
|
488
|
+
}
|
489
|
+
}));
|
490
|
+
;// CONCATENATED MODULE: ../../packages/menu/src/menu-group.tsx
|
491
|
+
|
492
|
+
/*
|
493
|
+
* Tencent is pleased to support the open source community by making
|
494
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
495
|
+
*
|
496
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
497
|
+
*
|
498
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
499
|
+
*
|
500
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
501
|
+
*
|
502
|
+
* ---------------------------------------------------
|
503
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
504
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
505
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
506
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
507
|
+
*
|
508
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
509
|
+
* the Software.
|
510
|
+
*
|
511
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
512
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
513
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
514
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
515
|
+
* IN THE SOFTWARE.
|
516
|
+
*/
|
517
|
+
|
518
|
+
|
519
|
+
/* harmony default export */ const menu_group = ((0,external_vue_.defineComponent)({
|
520
|
+
name: 'MenuGroup',
|
521
|
+
props: {
|
522
|
+
name: {
|
523
|
+
type: String,
|
524
|
+
"default": ''
|
525
|
+
}
|
526
|
+
},
|
527
|
+
setup: function setup(props, _ref) {
|
528
|
+
var slots = _ref.slots;
|
529
|
+
var _usePrefix = (0,external_config_provider_.usePrefix)(),
|
530
|
+
resolveClassName = _usePrefix.resolveClassName;
|
531
|
+
return function () {
|
532
|
+
var _a;
|
533
|
+
return (0,external_vue_.createVNode)("div", {
|
534
|
+
"class": "".concat(resolveClassName('menu-group'))
|
535
|
+
}, [(0,external_vue_.createVNode)("div", {
|
536
|
+
"class": "group-name"
|
537
|
+
}, [props.name]), (0,external_vue_.createVNode)("ul", {
|
538
|
+
"class": "group-wrap"
|
539
|
+
}, [(_a = slots["default"]) === null || _a === void 0 ? void 0 : _a.call(slots)])]);
|
540
|
+
};
|
541
|
+
}
|
542
|
+
}));
|
543
|
+
;// CONCATENATED MODULE: ../../packages/menu/src/menu-item.tsx
|
544
|
+
|
545
|
+
|
546
|
+
/*
|
547
|
+
* Tencent is pleased to support the open source community by making
|
548
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
549
|
+
*
|
550
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
551
|
+
*
|
552
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
553
|
+
*
|
554
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
555
|
+
*
|
556
|
+
* ---------------------------------------------------
|
557
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
558
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
559
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
560
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
561
|
+
*
|
562
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
563
|
+
* the Software.
|
564
|
+
*
|
565
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
566
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
567
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
568
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
569
|
+
* IN THE SOFTWARE.
|
570
|
+
*/
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
/* harmony default export */ const menu_item = ((0,external_vue_.defineComponent)({
|
575
|
+
name: 'MenuItem',
|
576
|
+
props: {
|
577
|
+
needIcon: {
|
578
|
+
type: Boolean,
|
579
|
+
"default": true
|
580
|
+
}
|
581
|
+
},
|
582
|
+
emits: ['click'],
|
583
|
+
// slots: ['icon'],
|
584
|
+
slots: Object,
|
585
|
+
setup: function setup(props, _ref) {
|
586
|
+
var slots = _ref.slots,
|
587
|
+
emit = _ref.emit;
|
588
|
+
var _a, _b;
|
589
|
+
var _useMenuInject = useMenuInject(),
|
590
|
+
registerMenuInfo = _useMenuInject.registerMenuInfo,
|
591
|
+
unregisterMenuInfo = _useMenuInject.unregisterMenuInfo,
|
592
|
+
activeKey = _useMenuInject.activeKey,
|
593
|
+
handleActiveChange = _useMenuInject.handleActiveChange;
|
594
|
+
var instance = (0,external_vue_.getCurrentInstance)();
|
595
|
+
var _useMenuPathInject = useMenuPathInject(),
|
596
|
+
parentInfo = _useMenuPathInject.parentInfo;
|
597
|
+
var key = ((_b = (_a = instance.vnode.key) === null || _a === void 0 ? void 0 : _a.toString) === null || _b === void 0 ? void 0 : _b.call(_a)) || String(instance.uid);
|
598
|
+
var isActive = (0,external_vue_.computed)(function () {
|
599
|
+
return activeKey.value === key;
|
600
|
+
});
|
601
|
+
var needIcon = (0,external_vue_.computed)(function () {
|
602
|
+
return props.needIcon;
|
603
|
+
});
|
604
|
+
registerMenuInfo(key, {
|
605
|
+
key: key,
|
606
|
+
parentKey: parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.key
|
607
|
+
});
|
608
|
+
var handleClick = function handleClick(e) {
|
609
|
+
handleActiveChange(key);
|
610
|
+
emit('click', e);
|
611
|
+
};
|
612
|
+
(0,external_vue_.onBeforeUnmount)(function () {
|
613
|
+
return unregisterMenuInfo(key);
|
614
|
+
});
|
615
|
+
var _usePrefix = (0,external_config_provider_.usePrefix)(),
|
616
|
+
resolveClassName = _usePrefix.resolveClassName;
|
617
|
+
return function () {
|
618
|
+
var _ref2;
|
619
|
+
var _a, _b;
|
620
|
+
return (0,external_vue_.createVNode)("li", {
|
621
|
+
"class": (_ref2 = {}, _defineProperty(_ref2, "".concat(resolveClassName('menu-item')), true), _defineProperty(_ref2, 'is-active', isActive.value), _ref2),
|
622
|
+
"onClick": handleClick
|
623
|
+
}, [needIcon.value && (0,external_vue_.createVNode)("span", {
|
624
|
+
"class": "item-icon"
|
625
|
+
}, [((_a = slots === null || slots === void 0 ? void 0 : slots.icon) === null || _a === void 0 ? void 0 : _a.call(slots)) || (0,external_vue_.createVNode)("i", {
|
626
|
+
"class": "default-icon"
|
627
|
+
}, null)]), (0,external_vue_.createVNode)("span", {
|
628
|
+
"class": "item-content"
|
629
|
+
}, [(_b = slots["default"]) === null || _b === void 0 ? void 0 : _b.call(slots)])]);
|
630
|
+
};
|
631
|
+
}
|
632
|
+
}));
|
633
|
+
// EXTERNAL MODULE: external "../icon/"
|
634
|
+
var _ = __webpack_require__(7685);
|
635
|
+
;// CONCATENATED MODULE: ../../packages/menu/src/submenu.tsx
|
636
|
+
|
637
|
+
|
638
|
+
/*
|
639
|
+
* Tencent is pleased to support the open source community by making
|
640
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
641
|
+
*
|
642
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
643
|
+
*
|
644
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
645
|
+
*
|
646
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
647
|
+
*
|
648
|
+
* ---------------------------------------------------
|
649
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
650
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
651
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
652
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
653
|
+
*
|
654
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
655
|
+
* the Software.
|
656
|
+
*
|
657
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
658
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
659
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
660
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
661
|
+
* IN THE SOFTWARE.
|
662
|
+
*/
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
var subMenuProps = {
|
668
|
+
title: {
|
669
|
+
type: String,
|
670
|
+
"default": 'title'
|
671
|
+
}
|
672
|
+
};
|
673
|
+
/* harmony default export */ const submenu = ((0,external_vue_.defineComponent)({
|
674
|
+
name: 'Submenu',
|
675
|
+
props: subMenuProps,
|
676
|
+
emits: ['collapse'],
|
677
|
+
// slots: ['icon'],
|
678
|
+
slots: Object,
|
679
|
+
setup: function setup(props, _ref) {
|
680
|
+
var slots = _ref.slots,
|
681
|
+
emit = _ref.emit;
|
682
|
+
var _a, _b;
|
683
|
+
var _useMenuInject = useMenuInject(),
|
684
|
+
registerMenuInfo = _useMenuInject.registerMenuInfo,
|
685
|
+
unregisterMenuInfo = _useMenuInject.unregisterMenuInfo,
|
686
|
+
openedKeys = _useMenuInject.openedKeys,
|
687
|
+
handleOpenChange = _useMenuInject.handleOpenChange,
|
688
|
+
collapse = _useMenuInject.collapse,
|
689
|
+
activeKey = _useMenuInject.activeKey,
|
690
|
+
menuStore = _useMenuInject.menuStore;
|
691
|
+
var _useMenuPathInject = useMenuPathInject(),
|
692
|
+
parentInfo = _useMenuPathInject.parentInfo;
|
693
|
+
var instance = (0,external_vue_.getCurrentInstance)();
|
694
|
+
var key = ((_b = (_a = instance.vnode.key) === null || _a === void 0 ? void 0 : _a.toString) === null || _b === void 0 ? void 0 : _b.call(_a)) || String(instance.uid);
|
695
|
+
var transition = (0,external_vue_.ref)(collapseMotion());
|
696
|
+
var isShow = (0,external_vue_.computed)(function () {
|
697
|
+
return openedKeys.value.includes(key);
|
698
|
+
});
|
699
|
+
var specialCollapse = (0,external_vue_.computed)(function () {
|
700
|
+
var _a, _b;
|
701
|
+
var activeParentKey = (_b = (_a = menuStore.value) === null || _a === void 0 ? void 0 : _a[activeKey.value]) === null || _b === void 0 ? void 0 : _b.parentKey;
|
702
|
+
return collapse.value && activeParentKey === key && isShow;
|
703
|
+
});
|
704
|
+
useMenuPathProvider(key);
|
705
|
+
registerMenuInfo(key, {
|
706
|
+
key: key,
|
707
|
+
parentKey: parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.key
|
708
|
+
});
|
709
|
+
(0,external_vue_.onBeforeUnmount)(function () {
|
710
|
+
return unregisterMenuInfo(key);
|
711
|
+
});
|
712
|
+
var handleCollapse = function handleCollapse() {
|
713
|
+
handleOpenChange(key, !isShow.value);
|
714
|
+
emit('collapse', !isShow.value, instance);
|
715
|
+
};
|
716
|
+
var _usePrefix = (0,external_config_provider_.usePrefix)(),
|
717
|
+
resolveClassName = _usePrefix.resolveClassName;
|
718
|
+
return function () {
|
719
|
+
var _ref2;
|
720
|
+
var _a, _b;
|
721
|
+
return (0,external_vue_.createVNode)("li", {
|
722
|
+
"class": (_ref2 = {}, _defineProperty(_ref2, "".concat(resolveClassName('menu-submenu')), true), _defineProperty(_ref2, 'is-opened', isShow.value), _ref2)
|
723
|
+
}, [(0,external_vue_.createVNode)("div", {
|
724
|
+
"class": {
|
725
|
+
'submenu-header': true,
|
726
|
+
'is-collapse': specialCollapse.value
|
727
|
+
},
|
728
|
+
"onClick": handleCollapse
|
729
|
+
}, [(0,external_vue_.createVNode)("span", {
|
730
|
+
"class": "submenu-header-icon"
|
731
|
+
}, [((_a = slots.icon) === null || _a === void 0 ? void 0 : _a.call(slots)) || (0,external_vue_.createVNode)(_.TreeApplicationShape, {
|
732
|
+
"class": "menu-icon"
|
733
|
+
}, null)]), (0,external_vue_.createVNode)("span", {
|
734
|
+
"class": "submenu-header-content"
|
735
|
+
}, [props.title]), (0,external_vue_.createVNode)(_.AngleDown, {
|
736
|
+
"class": {
|
737
|
+
'submenu-header-collapse': true,
|
738
|
+
'is-collapse': openedKeys.value.includes(key)
|
739
|
+
}
|
740
|
+
}, null)]), (0,external_vue_.createVNode)(external_vue_.Transition, transition.value, {
|
741
|
+
"default": function _default() {
|
742
|
+
return [(0,external_vue_.withDirectives)((0,external_vue_.createVNode)("ul", {
|
743
|
+
"class": "submenu-list"
|
744
|
+
}, [(_b = slots["default"]) === null || _b === void 0 ? void 0 : _b.call(slots)]), [[external_vue_.vShow, isShow.value]])];
|
745
|
+
}
|
746
|
+
})]);
|
747
|
+
};
|
748
|
+
}
|
749
|
+
}));
|
750
|
+
;// CONCATENATED MODULE: ../../packages/menu/src/index.ts
|
751
|
+
/*
|
752
|
+
* Tencent is pleased to support the open source community by making
|
753
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
754
|
+
*
|
755
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
756
|
+
*
|
757
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
758
|
+
*
|
759
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
760
|
+
*
|
761
|
+
* ---------------------------------------------------
|
762
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
763
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
764
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
765
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
766
|
+
*
|
767
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
768
|
+
* the Software.
|
769
|
+
*
|
770
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
771
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
772
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
773
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
774
|
+
* IN THE SOFTWARE.
|
775
|
+
*/
|
776
|
+
|
777
|
+
|
778
|
+
|
779
|
+
|
780
|
+
|
781
|
+
var BkMenu = (0,external_shared_.withInstallProps)(menu, {
|
782
|
+
Item: menu_item,
|
783
|
+
Submenu: submenu,
|
784
|
+
Group: menu_group
|
785
|
+
});
|
786
|
+
/* harmony default export */ const src = (BkMenu);
|
787
|
+
|
788
|
+
})();
|
789
|
+
|
790
|
+
/******/ return __webpack_exports__;
|
791
|
+
/******/ })()
|
792
|
+
;
|
793
|
+
});
|